diff options
author | Yorke Lee <yorkelee@google.com> | 2015-10-23 19:19:46 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-10-23 19:19:46 +0000 |
commit | 77e08334c549639bc708368c41bf581386127fef (patch) | |
tree | 4cec99e864207e458159fdd5eb2926570d8a11f0 | |
parent | 576961a495e1006a83b7a7ae97ed03f06003b389 (diff) | |
parent | 3cc291b6de8c1ee37939a2b740d5149e9364c5ff (diff) |
Merge "Refresh onboarding flow UI" into ub-contactsdialer-a-dev
16 files changed, 55 insertions, 34 deletions
diff --git a/res/drawable-hdpi/ill_onboard_default.png b/res/drawable-hdpi/ill_onboard_default.png Binary files differnew file mode 100644 index 000000000..d16c1f429 --- /dev/null +++ b/res/drawable-hdpi/ill_onboard_default.png diff --git a/res/drawable-hdpi/ill_onboard_permissions.png b/res/drawable-hdpi/ill_onboard_permissions.png Binary files differnew file mode 100644 index 000000000..90ef14c80 --- /dev/null +++ b/res/drawable-hdpi/ill_onboard_permissions.png diff --git a/res/drawable-mdpi/ill_onboard_default.png b/res/drawable-mdpi/ill_onboard_default.png Binary files differnew file mode 100644 index 000000000..41de46742 --- /dev/null +++ b/res/drawable-mdpi/ill_onboard_default.png diff --git a/res/drawable-mdpi/ill_onboard_permissions.png b/res/drawable-mdpi/ill_onboard_permissions.png Binary files differnew file mode 100644 index 000000000..3ec39db9d --- /dev/null +++ b/res/drawable-mdpi/ill_onboard_permissions.png diff --git a/res/drawable-xhdpi/ill_onboard_default.png b/res/drawable-xhdpi/ill_onboard_default.png Binary files differnew file mode 100644 index 000000000..1cf47df28 --- /dev/null +++ b/res/drawable-xhdpi/ill_onboard_default.png diff --git a/res/drawable-xhdpi/ill_onboard_permissions.png b/res/drawable-xhdpi/ill_onboard_permissions.png Binary files differnew file mode 100644 index 000000000..ab52a5823 --- /dev/null +++ b/res/drawable-xhdpi/ill_onboard_permissions.png diff --git a/res/drawable-xxhdpi/ill_onboard_default.png b/res/drawable-xxhdpi/ill_onboard_default.png Binary files differnew file mode 100644 index 000000000..f243d44c0 --- /dev/null +++ b/res/drawable-xxhdpi/ill_onboard_default.png diff --git a/res/drawable-xxhdpi/ill_onboard_permissions.png b/res/drawable-xxhdpi/ill_onboard_permissions.png Binary files differnew file mode 100644 index 000000000..4725bfd29 --- /dev/null +++ b/res/drawable-xxhdpi/ill_onboard_permissions.png diff --git a/res/drawable-xxxhdpi/ill_onboard_default.png b/res/drawable-xxxhdpi/ill_onboard_default.png Binary files differnew file mode 100644 index 000000000..53f858d0b --- /dev/null +++ b/res/drawable-xxxhdpi/ill_onboard_default.png diff --git a/res/drawable-xxxhdpi/ill_onboard_permissions.png b/res/drawable-xxxhdpi/ill_onboard_permissions.png Binary files differnew file mode 100644 index 000000000..f406a9531 --- /dev/null +++ b/res/drawable-xxxhdpi/ill_onboard_permissions.png diff --git a/res/layout/onboarding_screen_fragment.xml b/res/layout/onboarding_screen_fragment.xml index f4136aed7..f60225d90 100644 --- a/res/layout/onboarding_screen_fragment.xml +++ b/res/layout/onboarding_screen_fragment.xml @@ -17,7 +17,14 @@ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" - android:padding="20dp" > + android:paddingBottom="20dp" > + + <ImageView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:id="@+id/onboarding_screen_background_image" + android:scaleType="centerCrop" + android:importantForAccessibility="no" /> <TextView android:id="@+id/onboarding_screen_title" @@ -25,42 +32,40 @@ android:layout_height="wrap_content" android:layout_above="@+id/onboarding_screen_content" android:textAppearance="?android:attr/textAppearanceLarge" - android:textColor="@color/onboarding_primary_text_color" /> + android:textColor="@color/onboarding_primary_text_color" + android:layout_marginStart="@dimen/onboard_screen_side_padding" + android:layout_marginEnd="@dimen/onboard_screen_side_padding" /> <TextView android:id="@id/onboarding_screen_content" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_above="@+id/onboarding_buttons_container" + android:layout_above="@+id/onboard_next_button" android:layout_marginTop="20dp" - android:textColor="@color/onboarding_primary_text_color" /> + android:textColor="@color/onboarding_primary_text_color" + android:layout_marginStart="@dimen/onboard_screen_side_padding" + android:layout_marginEnd="@dimen/onboard_screen_side_padding" /> - <LinearLayout - android:id="@id/onboarding_buttons_container" - android:layout_width="match_parent" + <Button + android:id="@+id/onboard_skip_button" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentBottom="true" - android:layout_marginTop="20dp" > + android:layout_alignTop="@id/onboard_next_button" + android:layout_toStartOf="@id/onboard_next_button" + android:text="@string/onboarding_skip_button" + android:textColor="@color/onboarding_primary_text_color" + style="?android:attr/borderlessButtonStyle" /> - <Button - android:id="@+id/onboard_skip_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="1" - android:gravity="center" - android:text="@string/onboarding_skip_button" - android:textColor="@color/onboarding_primary_text_color" - style="?android:attr/borderlessButtonStyle" /> - - <Button - android:id="@+id/onboard_next_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="1" - android:gravity="center" - android:text="@string/onboarding_next_button" - android:textColor="@color/onboarding_primary_text_color" - style="?android:attr/borderlessButtonStyle" /> + <Button + android:id="@id/onboard_next_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentEnd="true" + android:layout_alignParentBottom="true" + android:layout_marginBottom="5dp" + android:layout_marginEnd="@dimen/onboard_screen_side_padding" + android:text="@string/onboarding_next_button" + android:textColor="@color/onboarding_primary_text_color" + style="@android:style/Widget.Material.Button" /> - </LinearLayout> </RelativeLayout> diff --git a/res/values/colors.xml b/res/values/colors.xml index d8d0de4b9..da68061e9 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -138,6 +138,7 @@ <color name="onboarding_primary_text_color">#ffffff</color> <color name="onboarding_default_dialer_screen_background_color">#e06055</color> <color name="onboarding_permissions_screen_background_color">#689f38</color> + <color name="onboarding_next_button_color">#ffffff</color> <!-- Grey 700 --> <color name="call_detail_footer_text_color">#616161</color> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 18f33d5f2..8ea7d1c0d 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -167,4 +167,6 @@ <dimen name="blocked_number_settings_description_text_size">16sp</dimen> <dimen name="call_type_icon_size">12dp</dimen> + + <dimen name="onboard_screen_side_padding">20dp</dimen> </resources> diff --git a/res/values/styles.xml b/res/values/styles.xml index 533b88edd..108f299d3 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -120,6 +120,8 @@ <item name="windowActionBar">false</item> <item name="android:windowNoTitle">true</item> <item name="windowNoTitle">true</item> + <item name="android:colorButtonNormal">@color/onboarding_next_button_color</item> + <item name="colorButtonNormal">@color/onboarding_next_button_color</item> </style> <!-- Hide the actionbar title during the activity preview --> diff --git a/src/com/android/dialer/onboard/OnboardingActivity.java b/src/com/android/dialer/onboard/OnboardingActivity.java index 144e6d441..9be0fd0a7 100644 --- a/src/com/android/dialer/onboard/OnboardingActivity.java +++ b/src/com/android/dialer/onboard/OnboardingActivity.java @@ -257,6 +257,7 @@ public class OnboardingActivity extends TransactionSafeActivity implements Onboa SCREEN_DEFAULT_DIALER, canSkipScreen(), R.color.onboarding_default_dialer_screen_background_color, + R.drawable.ill_onboard_default, R.string.request_default_dialer_screen_title, R.string.request_default_dialer_screen_content ); @@ -294,6 +295,7 @@ public class OnboardingActivity extends TransactionSafeActivity implements Onboa SCREEN_PERMISSIONS, canSkipScreen(), R.color.onboarding_permissions_screen_background_color, + R.drawable.ill_onboard_permissions, R.string.request_permissions_screen_title, R.string.request_permissions_screen_content ); diff --git a/src/com/android/dialer/onboard/OnboardingFragment.java b/src/com/android/dialer/onboard/OnboardingFragment.java index 77b265b2c..2836a958c 100644 --- a/src/com/android/dialer/onboard/OnboardingFragment.java +++ b/src/com/android/dialer/onboard/OnboardingFragment.java @@ -21,6 +21,8 @@ import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; +import android.widget.Button; +import android.widget.ImageView; import android.widget.TextView; import com.android.dialer.R; @@ -28,7 +30,8 @@ import com.android.dialer.R; public class OnboardingFragment extends Fragment implements OnClickListener { public static final String ARG_SCREEN_ID = "arg_screen_id"; public static final String ARG_CAN_SKIP_SCREEN = "arg_can_skip_screen"; - public static final String ARG_BACKGROUND_COLOR_RESOURCE = "arg_background_color"; + public static final String ARG_BACKGROUND_COLOR_RESOURCE = "arg_background_color_resource"; + public static final String ARG_BACKGROUND_IMAGE_RESOURCE="arg_background_image_resource"; public static final String ARG_TEXT_TITLE_RESOURCE = "arg_text_title_resource"; public static final String ARG_TEXT_CONTENT_RESOURCE = "arg_text_content_resource"; @@ -42,11 +45,12 @@ public class OnboardingFragment extends Fragment implements OnClickListener { public OnboardingFragment() {} public OnboardingFragment(int screenId, boolean canSkipScreen, int backgroundColorResourceId, - int textTitleResourceId, int textContentResourceId) { + int backgroundImageResourceId, int textTitleResourceId, int textContentResourceId) { final Bundle args = new Bundle(); args.putInt(ARG_SCREEN_ID, screenId); args.putBoolean(ARG_CAN_SKIP_SCREEN, canSkipScreen); args.putInt(ARG_BACKGROUND_COLOR_RESOURCE, backgroundColorResourceId); + args.putInt(ARG_BACKGROUND_IMAGE_RESOURCE, backgroundImageResourceId); args.putInt(ARG_TEXT_TITLE_RESOURCE, textTitleResourceId); args.putInt(ARG_TEXT_CONTENT_RESOURCE, textContentResourceId); setArguments(args); @@ -62,12 +66,17 @@ public class OnboardingFragment extends Fragment implements OnClickListener { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View view = inflater.inflate(R.layout.onboarding_screen_fragment, container, false); - view.setBackgroundColor(getResources().getColor( - getArguments().getInt(ARG_BACKGROUND_COLOR_RESOURCE), null)); + final int backgroundColor = getResources().getColor( + getArguments().getInt(ARG_BACKGROUND_COLOR_RESOURCE), null); + view.setBackgroundColor(backgroundColor); + ((ImageView) view.findViewById(R.id.onboarding_screen_background_image)).setImageResource( + getArguments().getInt(ARG_BACKGROUND_IMAGE_RESOURCE)); ((TextView) view.findViewById(R.id.onboarding_screen_content)). setText(getArguments().getInt(ARG_TEXT_CONTENT_RESOURCE)); ((TextView) view.findViewById(R.id.onboarding_screen_title)). - setText(getArguments().getInt(ARG_TEXT_TITLE_RESOURCE)); + setText(getArguments().getInt(ARG_TEXT_TITLE_RESOURCE)); + ((Button) view.findViewById(R.id.onboard_next_button)).setTextColor(backgroundColor); + if (!getArguments().getBoolean(ARG_CAN_SKIP_SCREEN)) { view.findViewById(R.id.onboard_skip_button).setVisibility(View.INVISIBLE); } |