Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

Commit

Permalink
Bug 717137: Scrolling in manual setup, kill landscape mode in J-PAKE,…
Browse files Browse the repository at this point in the history
… activity flow.
  • Loading branch information
liuche committed Jan 13, 2012
1 parent f9f58d2 commit 19dbfd1
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 13 deletions.
4 changes: 3 additions & 1 deletion manifests/SyncAndroidManifest_activities.xml.in
Expand Up @@ -2,7 +2,9 @@
android:icon="@drawable/sync_ic_launcher"
android:label="@string/sync_app_name"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:configChanges="orientation"
android:windowSoftInputMode="adjustResize"
android:name="org.mozilla.gecko.sync.setup.activities.SetupSyncActivity" >
<!-- android:configChanges: SetupSyncActivity will handle orientation changes; no longer restarts activity (default) -->
<intent-filter>
Expand All @@ -18,7 +20,7 @@
android:clearTaskOnLaunch="true"
android:launchMode="singleTask"
android:name="org.mozilla.gecko.sync.setup.activities.AccountActivity"
android:windowSoftInputMode="stateVisible|adjustResize"/>
android:windowSoftInputMode="adjustPan"/>
<activity
android:name="org.mozilla.gecko.sync.setup.activities.SetupFailureActivity" />
<activity
Expand Down
16 changes: 12 additions & 4 deletions res/layout/sync_account.xml
Expand Up @@ -2,6 +2,11 @@
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/SyncTextFrame" >

<ScrollView
style="@style/SyncLayout" >
<LinearLayout
style="@style/SyncLayout" >

<TextView
style="@style/SyncTextTitle"
android:text="@string/sync_title_connect" />
Expand All @@ -27,12 +32,14 @@
android:hint="@string/sync_input_key" />

<CheckBox android:id="@+id/checkbox_server"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/sync_checkbox_server" />

<EditText android:id="@+id/serverInput"
style="@style/SyncEditItem"
android:enabled="false"
android:clickable="false"
android:visibility="gone"
android:hint="@string/sync_input_server" />

<LinearLayout
Expand All @@ -54,5 +61,6 @@
android:text="@string/sync_button_connect" />

</LinearLayout>

</TableLayout>
</LinearLayout>
</ScrollView>
</TableLayout>
11 changes: 9 additions & 2 deletions res/layout/sync_setup.xml
@@ -1,6 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/SyncTextFrame" >
style="@style/SyncTextFrame" >

<ScrollView
style="@style/SyncLayout" >

<LinearLayout
style="@style/SyncLayout" >

<TextView
android:id="@+id/setup_title"
Expand Down Expand Up @@ -53,5 +59,6 @@
android:onClick="cancelClickHandler"
android:text="@string/sync_button_cancel" />
</LinearLayout>

</LinearLayout>
</ScrollView>
</TableLayout>
8 changes: 6 additions & 2 deletions res/layout/sync_setup_pair.xml
@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/SyncTextFrame" >

<ScrollView
style="@style/SyncLayout" >
<LinearLayout
style="@style/SyncLayout" >
<TextView
android:id="@+id/setup_title"
style="@style/SyncTextTitle"
Expand Down Expand Up @@ -72,5 +75,6 @@
android:enabled="false"
android:text="@string/sync_button_connect" />
</LinearLayout>

</LinearLayout>
</ScrollView>
</TableLayout>
6 changes: 6 additions & 0 deletions res/values/sync_styles.xml
@@ -1,5 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="SyncLayout" parent="@android:style/Widget">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:gravity">center</item>
<item name="android:orientation">vertical</item>
</style>
<!-- TextView Styles -->
<style name="SyncTextFrame" parent="@android:style/TextAppearance">
<item name="android:layout_width">wrap_content</item>
Expand Down
Expand Up @@ -108,9 +108,12 @@ public void onCreate(Bundle savedInstanceState) {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
Log.i(LOG_TAG, "Toggling checkbox: " + isChecked);
activateView(serverInput, isChecked);
// Hack for pre-3.0 Android: can enter text into disabled EditText.
if (!isChecked) { // Clear server input.
serverInput.setVisibility(View.GONE);
serverInput.setText("");
} else {
serverInput.setVisibility(View.VISIBLE);
}
// Activate connectButton if necessary.
activateView(connectButton, validateInputs());
Expand Down
Expand Up @@ -246,9 +246,8 @@ public void run() {
runOnUiThread(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(mContext, SetupFailureActivity.class);
intent.setFlags(Constants.FLAG_ACTIVITY_REORDER_TO_FRONT_NO_ANIMATION);
startActivity(intent);
displayReceiveNoPin();
jClient.receiveNoPin();
}
});
}
Expand Down

0 comments on commit 19dbfd1

Please sign in to comment.