Merge "More "Manual Setup" button tweaks" into ub-mail-algol

This commit is contained in:
Tony Mantler 2014-04-04 17:43:03 +00:00 committed by Android (Google) Code Review
commit a061731281
6 changed files with 33 additions and 12 deletions

View File

@ -54,9 +54,4 @@
android:layout_height="wrap_content"
android:inputType="textEmailAddress" />
</LinearLayout>
<TextView
android:id="@+id/manual_setup"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/account_setup_basics_manual_setup_action" />
</LinearLayout>

View File

@ -63,13 +63,24 @@
android:id="@+id/setup_fragment_content"
style="@style/account_setup_fragment_container"
/>
<TextView
android:id="@+id/manual_setup"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/account_setup_basics_manual_setup_action"
android:visibility="gone"
style="@style/account_setup_manual_button" />
android:orientation="horizontal"
android:paddingLeft="@dimen/setup_fragment_padding_side"
android:paddingRight="@dimen/setup_fragment_padding_side" >
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<Button
android:id="@+id/manual_setup"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/account_setup_basics_manual_setup_action"
android:visibility="gone"
style="@style/account_setup_manual_button" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<ImageButton

View File

@ -64,7 +64,7 @@
android:layout_width="wrap_content"
android:src="@drawable/ic_nav_arrow_previous_button"
android:text="@string/next_action" />
<TextView
<Button
android:id="@+id/manual_setup"
android:layout_height="wrap_content"
android:layout_width="wrap_content"

View File

@ -22,4 +22,9 @@
<!-- Int value for whether we want the 'previous' button on the Basics setup screen to be
invisible or gone. See also w800dp -->
<bool name="setup_basics_prev_button_gone">true</bool>
<!-- Alpha value for 'manual setup' button when disabled -->
<fraction name="manual_setup_disabled_alpha">40%</fraction>
<!-- Alpha value for 'manual setup' button when enabled -->
<fraction name="manual_setup_enabled_alpha">100%</fraction>
</resources>

View File

@ -70,6 +70,7 @@
<item name="android:textSize">16sp</item>
<item name="android:textColor">@color/account_setup_manual_button_color</item>
<item name="android:alpha">0.4</item>
<item name="android:background">?android:attr/selectableItemBackground</item>
</style>
<!-- Account setup row label text -->

View File

@ -131,6 +131,15 @@ public class AccountSetupBasicsFragment extends AccountSetupFragment {
public void setNextButtonEnabled(boolean enabled) {
super.setNextButtonEnabled(enabled);
mManualSetupView.setEnabled(enabled);
final float manualButtonAlpha;
if (enabled) {
manualButtonAlpha =
getResources().getFraction(R.fraction.manual_setup_enabled_alpha, 1, 1);
} else {
manualButtonAlpha =
getResources().getFraction(R.fraction.manual_setup_disabled_alpha, 1, 1);
}
mManualSetupView.setAlpha(manualButtonAlpha);
}
public void setEmail(final String email) {