From fcefabf9abafc867ae858160169bb1cd19981e07 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Thu, 18 Apr 2013 17:19:40 +0900 Subject: [PATCH] Groundwork to implement landscape and welcome screen Bug: 8159728 Change-Id: I05ff6578980ec2e210ebb482ea51b1600e74a4f4 --- .../color/setup_step_action_background.xml | 30 +++++++++ .../layout/setup_start_indicator_label.xml | 32 ++++++++++ java/res/layout/setup_steps_cards.xml | 64 +++++++++++++++++++ java/res/layout/setup_steps_screen.xml | 27 ++++++++ java/res/layout/setup_steps_title.xml | 27 ++++++++ java/res/layout/setup_wizard.xml | 58 ++--------------- java/res/values-sw600dp-land/setup-dimens.xml | 1 + java/res/values-sw768dp-land/setup-dimens.xml | 1 + java/res/values/setup-dimens.xml | 1 + java/res/values/setup-styles-common.xml | 11 ++++ .../latin/setup/SetupActivity.java | 17 ++--- 11 files changed, 208 insertions(+), 61 deletions(-) create mode 100644 java/res/color/setup_step_action_background.xml create mode 100644 java/res/layout/setup_start_indicator_label.xml create mode 100644 java/res/layout/setup_steps_cards.xml create mode 100644 java/res/layout/setup_steps_screen.xml create mode 100644 java/res/layout/setup_steps_title.xml diff --git a/java/res/color/setup_step_action_background.xml b/java/res/color/setup_step_action_background.xml new file mode 100644 index 000000000..79120b4d0 --- /dev/null +++ b/java/res/color/setup_step_action_background.xml @@ -0,0 +1,30 @@ + + + + + + + + diff --git a/java/res/layout/setup_start_indicator_label.xml b/java/res/layout/setup_start_indicator_label.xml new file mode 100644 index 000000000..33854bb44 --- /dev/null +++ b/java/res/layout/setup_start_indicator_label.xml @@ -0,0 +1,32 @@ + + + + + + + diff --git a/java/res/layout/setup_steps_cards.xml b/java/res/layout/setup_steps_cards.xml new file mode 100644 index 000000000..17207d354 --- /dev/null +++ b/java/res/layout/setup_steps_cards.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + diff --git a/java/res/layout/setup_steps_screen.xml b/java/res/layout/setup_steps_screen.xml new file mode 100644 index 000000000..1159c0acf --- /dev/null +++ b/java/res/layout/setup_steps_screen.xml @@ -0,0 +1,27 @@ + + + + + + + diff --git a/java/res/layout/setup_steps_title.xml b/java/res/layout/setup_steps_title.xml new file mode 100644 index 000000000..e3694bfe0 --- /dev/null +++ b/java/res/layout/setup_steps_title.xml @@ -0,0 +1,27 @@ + + + + + + diff --git a/java/res/layout/setup_wizard.xml b/java/res/layout/setup_wizard.xml index 0ee24c282..1cf19d299 100644 --- a/java/res/layout/setup_wizard.xml +++ b/java/res/layout/setup_wizard.xml @@ -18,7 +18,7 @@ */ --> - - - - - - - - - - - - - - - + + diff --git a/java/res/values-sw600dp-land/setup-dimens.xml b/java/res/values-sw600dp-land/setup-dimens.xml index 9aea21423..e5051eac7 100644 --- a/java/res/values-sw600dp-land/setup-dimens.xml +++ b/java/res/values-sw600dp-land/setup-dimens.xml @@ -16,5 +16,6 @@ 64sp + 36sp 96dp diff --git a/java/res/values-sw768dp-land/setup-dimens.xml b/java/res/values-sw768dp-land/setup-dimens.xml index 0d2af17e3..34b7f429d 100644 --- a/java/res/values-sw768dp-land/setup-dimens.xml +++ b/java/res/values-sw768dp-land/setup-dimens.xml @@ -16,5 +16,6 @@ 64sp + 36sp 192dp diff --git a/java/res/values/setup-dimens.xml b/java/res/values/setup-dimens.xml index 007906dc0..a5ff47b02 100644 --- a/java/res/values/setup-dimens.xml +++ b/java/res/values/setup-dimens.xml @@ -16,5 +16,6 @@ 46sp + 26sp 16dp diff --git a/java/res/values/setup-styles-common.xml b/java/res/values/setup-styles-common.xml index 4e4e4a5a3..e9c72eb58 100644 --- a/java/res/values/setup-styles-common.xml +++ b/java/res/values/setup-styles-common.xml @@ -21,6 +21,9 @@ match_parent wrap_content + + + diff --git a/java/src/com/android/inputmethod/latin/setup/SetupActivity.java b/java/src/com/android/inputmethod/latin/setup/SetupActivity.java index 0622aef08..7b38c70e2 100644 --- a/java/src/com/android/inputmethod/latin/setup/SetupActivity.java +++ b/java/src/com/android/inputmethod/latin/setup/SetupActivity.java @@ -38,10 +38,11 @@ import com.android.inputmethod.latin.StaticInnerHandlerWrapper; import java.util.HashMap; +// TODO: Use Fragment to implement welcome screen and setup steps. public final class SetupActivity extends Activity implements View.OnClickListener { private SetupStepIndicatorView mStepIndicatorView; private TextView mActionFinish; - private final SetupStepGroup mSetupSteps = new SetupStepGroup(); + private final SetupStepGroup mSetupStepGroup = new SetupStepGroup(); private static final String STATE_STEP = "step"; private int mStepNumber; private static final int STEP_1 = 1; @@ -108,9 +109,9 @@ public final class SetupActivity extends Activity implements View.OnClickListene return; } - final TextView titleView = (TextView)findViewById(R.id.setup_title); + final TextView stepsTitle = (TextView)findViewById(R.id.setup_title); final String applicationName = getResources().getString(getApplicationInfo().labelRes); - titleView.setText(getString(R.string.setup_steps_title, applicationName)); + stepsTitle.setText(getString(R.string.setup_steps_title, applicationName)); mStepIndicatorView = (SetupStepIndicatorView)findViewById(R.id.setup_step_indicator); @@ -125,7 +126,7 @@ public final class SetupActivity extends Activity implements View.OnClickListene mHandler.startPollingImeSettings(); } }); - mSetupSteps.addStep(STEP_1, step1); + mSetupStepGroup.addStep(STEP_1, step1); final SetupStep step2 = new SetupStep(applicationName, (TextView)findViewById(R.id.setup_step2_bullet), findViewById(R.id.setup_step2), @@ -139,7 +140,7 @@ public final class SetupActivity extends Activity implements View.OnClickListene .showInputMethodPicker(); } }); - mSetupSteps.addStep(STEP_2, step2); + mSetupStepGroup.addStep(STEP_2, step2); final SetupStep step3 = new SetupStep(applicationName, (TextView)findViewById(R.id.setup_step3_bullet), findViewById(R.id.setup_step3), @@ -151,7 +152,7 @@ public final class SetupActivity extends Activity implements View.OnClickListene invokeSubtypeEnablerOfThisIme(); } }); - mSetupSteps.addStep(STEP_3, step3); + mSetupStepGroup.addStep(STEP_3, step3); mActionFinish = (TextView)findViewById(R.id.setup_finish); TextViewCompatUtils.setCompoundDrawablesRelativeWithIntrinsicBounds(mActionFinish, @@ -290,8 +291,8 @@ public final class SetupActivity extends Activity implements View.OnClickListene private void updateSetupStepView() { final int layoutDirection = ViewCompatUtils.getLayoutDirection(mStepIndicatorView); mStepIndicatorView.setIndicatorPosition( - getIndicatorPosition(mStepNumber, mSetupSteps.getTotalStep(), layoutDirection)); - mSetupSteps.enableStep(mStepNumber); + getIndicatorPosition(mStepNumber, mSetupStepGroup.getTotalStep(), layoutDirection)); + mSetupStepGroup.enableStep(mStepNumber); mActionFinish.setVisibility((mStepNumber == STEP_3) ? View.VISIBLE : View.GONE); }