Force tags to be in portrait.
This fixes a bug where rotations would drop the record.
Unfortunately, while fixing this, I discovered that the UI design just
doesn't work in landscape. There's a list halfway at the bottom of the
UI, and you can't put a ListView in a ScrollView, so the user has no way
of scrolling down to see the list contents.
Change-Id: Ic282c066789831ff02725895112e884ea7864c07
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index b38ce66..56cfd03 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -34,6 +34,7 @@
>
<activity android:name="TagBrowserActivity"
android:theme="@android:style/Theme.NoTitleBar"
+ android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
@@ -43,7 +44,10 @@
<activity android:name="TagList" />
- <activity android:name="MyTagList" />
+ <!-- TODO: lift the portrait restriction by re-working the list in the
+ layout. -->
+ <activity android:name="MyTagList"
+ android:screenOrientation="portrait" />
<activity android:name="TagViewer"
android:theme="@android:style/Theme.NoTitleBar"
diff --git a/res/layout/my_tag_activity.xml b/res/layout/my_tag_activity.xml
index 8c91f45..d0f199f 100644
--- a/res/layout/my_tag_activity.xml
+++ b/res/layout/my_tag_activity.xml
@@ -92,8 +92,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
- <!-- TODO: green active image -->
-
</RelativeLayout>
<TextView
diff --git a/src/com/android/apps/tag/EditTagActivity.java b/src/com/android/apps/tag/EditTagActivity.java
index c35b078..edaff80 100644
--- a/src/com/android/apps/tag/EditTagActivity.java
+++ b/src/com/android/apps/tag/EditTagActivity.java
@@ -60,7 +60,7 @@
private static final String LOG_TAG = "Tags";
- protected static final String BUNDLE_KEY_OUTSTANDING_PICK = "outstanding-pick";
+ protected static final String BUNDLE_KEY_RECORD = "outstanding-pick";
public static final String EXTRA_RESULT_MSG = "com.android.apps.tag.msg";
public static final String EXTRA_NEW_RECORD_INFO = "com.android.apps.tag.new_record";
@@ -100,7 +100,12 @@
mContentRoot = (ViewGroup) findViewById(R.id.content_parent);
- resolveIntent();
+ if (savedState != null) {
+ mRecord = savedState.getParcelable(BUNDLE_KEY_RECORD);
+ refresh();
+ } else {
+ resolveIntent();
+ }
}
/**
@@ -158,7 +163,7 @@
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
- outState.putParcelable(BUNDLE_KEY_OUTSTANDING_PICK, mRecord);
+ outState.putParcelable(BUNDLE_KEY_RECORD, mRecord);
}
interface GetTagQuery {