Added support for landscape mode when encoding QR Codes, and made some small layout...
authordswitkin <dswitkin@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Thu, 6 Nov 2008 17:17:07 +0000 (17:17 +0000)
committerdswitkin <dswitkin@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Thu, 6 Nov 2008 17:17:07 +0000 (17:17 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@672 59b500cc-1b3d-0410-9834-0bbf25fbcc57

android/AndroidManifest.xml
android/res/layout-land/encode.xml [new file with mode: 0755]
android/res/layout/encode.xml
android/src/com/google/zxing/client/android/BarcodesEncodeActivity.java

index 18abffe..65bfc83 100755 (executable)
@@ -45,8 +45,7 @@ versionName is 2.31, 2.4, or 3.0. -->
     <activity android:name="BarcodesPreferenceActivity"
               android:label="@string/preferences_name">
     </activity>
-    <activity android:name="BarcodesEncodeActivity"
-              android:screenOrientation="portrait">
+    <activity android:name="BarcodesEncodeActivity">
       <intent-filter>
         <action android:name="com.google.zxing.client.android.ENCODE"/>
         <category android:name="android.intent.category.DEFAULT"/>
diff --git a/android/res/layout-land/encode.xml b/android/res/layout-land/encode.xml
new file mode 100755 (executable)
index 0000000..f5e2c25
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2008 ZXing authors
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              android:id="@+id/encode_view"
+              android:layout_width="fill_parent"
+              android:layout_height="fill_parent"
+              android:background="@color/encode_view"
+              android:orientation="horizontal"
+              android:gravity="center">
+
+  <ImageView android:id="@+id/image_view"
+             android:layout_width="wrap_content"
+             android:layout_height="fill_parent"
+             android:layout_gravity="center_vertical"
+             android:scaleType="center"/>
+
+  <TextView android:id="@+id/contents_text_view"
+            android:layout_width="wrap_content"
+            android:layout_height="fill_parent"
+            android:layout_gravity="center_vertical"
+            android:gravity="center"
+            android:textColor="@color/contents_text"
+            android:textSize="20.0sp"
+            android:paddingRight="8px"/>
+</LinearLayout>
index cd8397c..f68285e 100755 (executable)
@@ -34,5 +34,6 @@
             android:layout_gravity="center_horizontal"
             android:gravity="center"
             android:textColor="@color/contents_text"
-            android:textSize="20.0sp"/>
+            android:textSize="20.0sp"
+            android:paddingBottom="8px"/>
 </LinearLayout>
index f406739..e1cfae2 100755 (executable)
@@ -75,6 +75,7 @@ public class BarcodesEncodeActivity extends Activity {
         int width = layout.getWidth();
         int height = layout.getHeight();
         int smallerDimension = (width < height) ? width : height;
+        smallerDimension = smallerDimension * 7 / 8;
 
         Intent intent = getIntent();
         try {