aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2013-04-18 17:19:40 +0900
committerTadashi G. Takaoka <takaoka@google.com>2013-04-19 20:10:59 +0900
commitfcefabf9abafc867ae858160169bb1cd19981e07 (patch)
tree9f909c5aae1a8b36ea940c3b3a3fde9be2b1a415 /java
parent16ec2e1155a0152c6ded42bc8941b90b7cd08d35 (diff)
downloadlatinime-fcefabf9abafc867ae858160169bb1cd19981e07.tar.gz
latinime-fcefabf9abafc867ae858160169bb1cd19981e07.tar.xz
latinime-fcefabf9abafc867ae858160169bb1cd19981e07.zip
Groundwork to implement landscape and welcome screen
Bug: 8159728 Change-Id: I05ff6578980ec2e210ebb482ea51b1600e74a4f4
Diffstat (limited to 'java')
-rw-r--r--java/res/color/setup_step_action_background.xml30
-rw-r--r--java/res/layout/setup_start_indicator_label.xml32
-rw-r--r--java/res/layout/setup_steps_cards.xml64
-rw-r--r--java/res/layout/setup_steps_screen.xml27
-rw-r--r--java/res/layout/setup_steps_title.xml27
-rw-r--r--java/res/layout/setup_wizard.xml58
-rw-r--r--java/res/values-sw600dp-land/setup-dimens.xml1
-rw-r--r--java/res/values-sw768dp-land/setup-dimens.xml1
-rw-r--r--java/res/values/setup-dimens.xml1
-rw-r--r--java/res/values/setup-styles-common.xml11
-rw-r--r--java/src/com/android/inputmethod/latin/setup/SetupActivity.java17
11 files changed, 208 insertions, 61 deletions
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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2013, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:state_focused="true"
+ android:color="@color/setup_text_action" />
+ <item
+ android:state_pressed="true"
+ android:color="@color/setup_text_action" />
+ <item
+ android:color="@color/setup_step_background" />
+</selector>
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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2013, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <view class="com.android.inputmethod.latin.setup.SetupStartIndicatorView$LabelView"
+ android:id="@+id/setup_start_label"
+ android:text="@string/setup_start_action"
+ android:gravity="end|center_vertical"
+ android:layout_width="0dp"
+ android:layout_weight="1.0"
+ style="@style/setupStepActionLabelStyleCommon" />
+ <view class="com.android.inputmethod.latin.setup.SetupStartIndicatorView$IndicatorView"
+ android:id="@+id/setup_start_indicator"
+ style="@style/setupStepStartIndicatorStyle" />
+</merge>
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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2013, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <LinearLayout
+ android:id="@+id/setup_step_bullets"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:orientation="horizontal">
+ <TextView
+ android:id="@+id/setup_step1_bullet"
+ style="@style/setupStepBulletStyle"
+ android:text="@string/setup_step1_bullet" />
+ <TextView
+ android:id="@+id/setup_step2_bullet"
+ style="@style/setupStepBulletStyle"
+ android:text="@string/setup_step2_bullet" />
+ <TextView
+ android:id="@+id/setup_step3_bullet"
+ style="@style/setupStepBulletStyle"
+ android:text="@string/setup_step3_bullet" />
+ </LinearLayout>
+ <com.android.inputmethod.latin.setup.SetupStepIndicatorView
+ android:id="@+id/setup_step_indicator"
+ android:layout_width="match_parent"
+ android:layout_height="24dp" />
+ <FrameLayout
+ android:id="@+id/setup_steps_pane"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+ <include
+ android:id="@+id/setup_step1"
+ layout="@layout/setup_step" />
+ <include
+ android:id="@+id/setup_step2"
+ layout="@layout/setup_step" />
+ <include
+ android:id="@+id/setup_step3"
+ layout="@layout/setup_step" />
+ </FrameLayout>
+ <TextView
+ android:id="@+id/setup_finish"
+ android:text="@string/setup_finish_action"
+ style="@style/setupStepActionLabelStyle"
+ android:layout_marginTop="2dp" />
+</merge>
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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2013, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+ <include layout="@layout/setup_steps_title" />
+ <include layout="@layout/setup_steps_cards" />
+</LinearLayout>
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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2013, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <TextView
+ android:id="@+id/setup_title"
+ style="@style/setupTitleStyle"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true" />
+</merge>
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 @@
*/
-->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/setup_background"
@@ -26,55 +26,7 @@
android:paddingRight="@dimen/setup_horizontal_padding"
android:paddingTop="16dp"
android:paddingBottom="16dp">
- <TextView
- android:id="@+id/setup_title"
- style="@style/setupTitleStyle"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true" />
- <LinearLayout
- android:id="@+id/setup_step_bullets"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/setup_title"
- android:paddingTop="16dp"
- android:orientation="horizontal">
- <TextView
- android:id="@+id/setup_step1_bullet"
- style="@style/setupStepBulletStyle"
- android:text="@string/setup_step1_bullet" />
- <TextView
- android:id="@+id/setup_step2_bullet"
- style="@style/setupStepBulletStyle"
- android:text="@string/setup_step2_bullet" />
- <TextView
- android:id="@+id/setup_step3_bullet"
- style="@style/setupStepBulletStyle"
- android:text="@string/setup_step3_bullet" />
- </LinearLayout>
- <com.android.inputmethod.latin.setup.SetupStepIndicatorView
- android:id="@+id/setup_step_indicator"
- android:layout_width="match_parent"
- android:layout_height="24dp"
- android:layout_below="@id/setup_step_bullets" />
- <FrameLayout
- android:id="@+id/setup_steps_pane"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/setup_step_indicator">
- <include
- android:id="@+id/setup_step1"
- layout="@layout/setup_step" />
- <include
- android:id="@+id/setup_step2"
- layout="@layout/setup_step" />
- <include
- android:id="@+id/setup_step3"
- layout="@layout/setup_step" />
- </FrameLayout>
- <TextView
- android:id="@+id/setup_finish"
- android:text="@string/setup_finish_action"
- style="@style/setupStepActionLabelStyle"
- android:layout_below="@id/setup_steps_pane"
- android:layout_marginTop="2dp" />
-</RelativeLayout>
+ <include
+ android:id="@+id/setup_steps_screen"
+ layout="@layout/setup_steps_screen" />
+</FrameLayout>
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 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<dimen name="setup_title_text_size">64sp</dimen>
+ <dimen name="setup_welcome_description_text_size">36sp</dimen>
<dimen name="setup_horizontal_padding">96dp</dimen>
</resources>
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 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<dimen name="setup_title_text_size">64sp</dimen>
+ <dimen name="setup_welcome_description_text_size">36sp</dimen>
<dimen name="setup_horizontal_padding">192dp</dimen>
</resources>
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 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<dimen name="setup_title_text_size">46sp</dimen>
+ <dimen name="setup_welcome_description_text_size">26sp</dimen>
<dimen name="setup_horizontal_padding">16dp</dimen>
</resources>
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 @@
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
</style>
+ <style name="setupWelcomeDescritpionStyle" parent="setupTitleStyle">
+ <item name="android:textSize">@dimen/setup_welcome_description_text_size</item>
+ </style>
<style name="setupStepBulletStyle">
<item name="android:textColor">@color/setup_text_dark</item>
<item name="android:textSize">22sp</item>
@@ -43,6 +46,10 @@
<style name="setupStepInstructionStyle" parent="setupStepBaseStyle">
<item name="android:textSize">14sp</item>
</style>
+ <style name="setupStepStartIndicatorStyle">
+ <item name="android:layout_width">24dp</item>
+ <item name="android:layout_height">48dp</item>
+ </style>
<style name="setupStepActionLabelStyleCommon" parent="setupStepBaseStyle">
<item name="android:textColor">@color/setup_step_action_color</item>
<item name="android:background">@drawable/setup_step_action_background</item>
@@ -54,4 +61,8 @@
<item name="android:clickable">true</item>
<item name="android:focusable">true</item>
</style>
+ <style name="setupStepStartActionLabelStyleCommon" parent="setupStepActionLabelStyleCommon">
+ <item name="android:paddingLeft">24dp</item>
+ <item name="android:paddingRight">24dp</item>
+ </style>
</resources>
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);
}