diff --git a/java/res/layout/setup_steps_cards.xml b/java/res/layout/setup_steps_cards.xml index 12e6e42a..a6a7d177 100644 --- a/java/res/layout/setup_steps_cards.xml +++ b/java/res/layout/setup_steps_cards.xml @@ -37,6 +37,10 @@ android:id="@+id/setup_step3_bullet" style="@style/setupStepBulletStyle" android:text="@string/setup_step3_bullet" /> + + - diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml index ecd20267..91d58f65 100644 --- a/java/res/values/strings.xml +++ b/java/res/values/strings.xml @@ -331,9 +331,9 @@ mobile devices. [CHAR LIMIT=25] --> Default - "नमस्ते வணக்கம் നമസ്കാരം నమస్కారం সাগতাম" + "Welcome to %s" - "Welcome to %s" + "नमस्ते\nவணக்கம் \nനമസ്കാരം \nನಮಸ್ಕಾರ \nనమస్కారం \nনমস্কার \nਸਤਿ ਸ੍ਰੀ ਅਕਾਲ \nનમસ્તે" Get started @@ -361,11 +361,14 @@ mobile devices. [CHAR LIMIT=25] --> 3 - "Congratulations, you're all set!" - - Now you can type in all your favorite apps with %s. + "Select languages" + Select the languages and layouts you want to use. + Configure languages - Configure additional languages + 4 + "Congratulations, you're all set!" + + Now you can type in all your favorite apps with %s. Finished diff --git a/java/src/org.smc.inputmethod/indic/setup/SetupWizardActivity.java b/java/src/org.smc.inputmethod/indic/setup/SetupWizardActivity.java index b97c94a8..55dc833b 100644 --- a/java/src/org.smc.inputmethod/indic/setup/SetupWizardActivity.java +++ b/java/src/org.smc.inputmethod/indic/setup/SetupWizardActivity.java @@ -48,17 +48,19 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL private View mActionStart; private View mActionNext; private TextView mStep1Bullet; - private TextView mActionFinish; + //private TextView mActionFinish; private SetupStepGroup mSetupStepGroup; private static final String STATE_STEP = "step"; private int mStepNumber; private boolean mNeedsToAdjustStepNumberToSystemState; + private boolean finishState; private static final int STEP_WELCOME = 0; private static final int STEP_1 = 1; private static final int STEP_2 = 2; private static final int STEP_3 = 3; - private static final int STEP_LAUNCHING_IME_SETTINGS = 4; - private static final int STEP_BACK_FROM_IME_SETTINGS = 5; + private static final int STEP_4 = 4; + private static final int STEP_LAUNCHING_IME_SETTINGS = 5; + private static final int STEP_BACK_FROM_IME_SETTINGS = 6; private SettingsPoolingHandler mHandler; @@ -122,8 +124,8 @@ protected void onCreate(final Bundle savedInstanceState) { final String applicationName = getResources().getString(getApplicationInfo().labelRes); mWelcomeScreen = findViewById(R.id.setup_welcome_screen); - final TextView welcomeDesc = (TextView)findViewById(R.id.setup_welcome_description); - welcomeDesc.setText(getString(R.string.setup_welcome_additional_description, applicationName)); + final TextView welcomeTitle = (TextView)findViewById(R.id.setup_welcome_title); + welcomeTitle.setText(getString(R.string.setup_welcome_title, applicationName)); mSetupScreen = findViewById(R.id.setup_steps_screen); final TextView stepsTitle = (TextView)findViewById(R.id.setup_title); @@ -176,22 +178,39 @@ public void run() { }); mSetupStepGroup.addStep(step3); + final SetupStep step4 = new SetupStep(STEP_4, applicationName, + (TextView)findViewById(R.id.setup_step4_bullet), findViewById(R.id.setup_step4), + R.string.setup_step4_title, R.string.setup_step4_instruction, + 0 /* finishedInstruction */, R.drawable.ic_setup_finish, + R.string.setup_finish_action); + step4.setAction(new Runnable() { + @Override + public void run() { + finish(); + } + }); + mSetupStepGroup.addStep(step4); + mActionStart = findViewById(R.id.setup_start_label); mActionStart.setOnClickListener(this); mActionNext = findViewById(R.id.setup_next); mActionNext.setOnClickListener(this); + /* mActionFinish = (TextView)findViewById(R.id.setup_finish); TextViewCompatUtils.setCompoundDrawablesRelativeWithIntrinsicBounds(mActionFinish, getResources().getDrawable(R.drawable.ic_setup_finish), null, null, null); mActionFinish.setOnClickListener(this); + */ } @Override public void onClick(final View v) { + /* if (v == mActionFinish) { finish(); return; } + */ final int currentStep = determineSetupStepNumber(); final int nextStep; if (v == mActionStart) { @@ -252,6 +271,8 @@ void invokeSubtypeEnablerOfThisIme() { intent.addCategory(Intent.CATEGORY_DEFAULT); intent.putExtra(Settings.EXTRA_INPUT_METHOD_ID, imi.getId()); startActivity(intent); + mNeedsToAdjustStepNumberToSystemState = true; + finishState = true; } private int determineSetupStepNumberFromLauncher() { @@ -259,7 +280,7 @@ private int determineSetupStepNumberFromLauncher() { if (stepNumber == STEP_1) { return STEP_WELCOME; } - if (stepNumber == STEP_3) { + if (stepNumber == STEP_4) { return STEP_LAUNCHING_IME_SETTINGS; } return stepNumber; @@ -273,6 +294,9 @@ private int determineSetupStepNumber() { if (!UncachedInputMethodManagerUtils.isThisImeCurrent(this, mImm)) { return STEP_2; } + if (finishState) { + return STEP_4; + } return STEP_3; } @@ -289,7 +313,7 @@ protected void onRestoreInstanceState(final Bundle savedInstanceState) { } private static boolean isInSetupSteps(final int stepNumber) { - return stepNumber >= STEP_1 && stepNumber <= STEP_3; + return stepNumber >= STEP_1 && stepNumber <= STEP_4; } @Override @@ -356,7 +380,7 @@ private void updateSetupStepView() { final boolean isStepActionAlreadyDone = mStepNumber < determineSetupStepNumber(); mSetupStepGroup.enableStep(mStepNumber, isStepActionAlreadyDone); mActionNext.setVisibility(isStepActionAlreadyDone ? View.VISIBLE : View.GONE); - mActionFinish.setVisibility((mStepNumber == STEP_3) ? View.VISIBLE : View.GONE); + //mActionFinish.setVisibility((mStepNumber == STEP_4) ? View.VISIBLE : View.GONE); } static final class SetupStep implements View.OnClickListener {