diff options
Diffstat (limited to 'src/com/android/dialer')
-rw-r--r-- | src/com/android/dialer/onboard/OnboardingActivity.java | 2 | ||||
-rw-r--r-- | src/com/android/dialer/onboard/OnboardingFragment.java | 19 |
2 files changed, 16 insertions, 5 deletions
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); } |