summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AndroidManifest.xml2
-rw-r--r--res/layout-sw600dp/accessibility_tutorial_container.xml44
-rw-r--r--res/layout/accessibility_tutorial_1.xml4
-rw-r--r--res/layout/accessibility_tutorial_container.xml53
-rw-r--r--res/values/strings.xml2
-rw-r--r--res/values/styles.xml7
-rw-r--r--src/com/android/settings/AccessibilityTutorialActivity.java47
7 files changed, 86 insertions, 73 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 77fd94e..797dbf1 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -948,7 +948,7 @@
android:label="@string/accessibility_tutorial_title"
android:configChanges="orientation"
android:immersive="true"
- android:theme="@android:style/Theme.Holo">
+ android:theme="@android:style/Theme.Holo.NoActionBar">
<intent-filter>
<action android:name="android.settings.ACCESSIBILITY_TUTORIAL" />
<category android:name="android.intent.category.DEFAULT" />
diff --git a/res/layout-sw600dp/accessibility_tutorial_container.xml b/res/layout-sw600dp/accessibility_tutorial_container.xml
index 2895a29..d649354 100644
--- a/res/layout-sw600dp/accessibility_tutorial_container.xml
+++ b/res/layout-sw600dp/accessibility_tutorial_container.xml
@@ -74,6 +74,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
+
<View
android:layout_marginBottom="16dip"
style="@style/AccessibilityTutorialDivider" />
@@ -81,25 +82,40 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:gravity="right">
-
- <Button
- android:id="@+id/back_button"
- style="@style/AccessibilityTutorialButton"
- android:text="@string/accessibility_tutorial_back" />
+ android:orientation="horizontal">
<Button
- android:id="@+id/next_button"
+ android:id="@+id/skip_button"
style="@style/AccessibilityTutorialButton"
- android:text="@string/accessibility_tutorial_next" />
-
- <Button
- android:id="@+id/finish_button"
- style="@style/AccessibilityTutorialButton"
- android:text="@string/accessibility_tutorial_finish"
+ android:text="@string/accessibility_tutorial_skip"
android:visibility="gone" />
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:gravity="right">
+
+ <Button
+ android:id="@+id/back_button"
+ style="@style/AccessibilityTutorialButton"
+ android:text="@string/accessibility_tutorial_back"
+ android:visibility="gone" />
+
+ <Button
+ android:id="@+id/next_button"
+ style="@style/AccessibilityTutorialButton"
+ android:text="@string/accessibility_tutorial_next"
+ android:visibility="gone" />
+
+ <Button
+ android:id="@id/finish_button"
+ style="@style/AccessibilityTutorialButton"
+ android:text="@string/accessibility_tutorial_finish"
+ android:visibility="gone" />
+
+ </LinearLayout>
+
</LinearLayout>
</LinearLayout>
diff --git a/res/layout/accessibility_tutorial_1.xml b/res/layout/accessibility_tutorial_1.xml
index 710e327..b2bb40d 100644
--- a/res/layout/accessibility_tutorial_1.xml
+++ b/res/layout/accessibility_tutorial_1.xml
@@ -19,8 +19,8 @@
android:id="@+id/all_apps"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
- android:columnWidth="72dip"
+ android:columnWidth="96dip"
android:numColumns="auto_fit"
android:verticalSpacing="10dip"
- android:horizontalSpacing="10dip"
+ android:horizontalSpacing="20dip"
android:stretchMode="columnWidth" /> \ No newline at end of file
diff --git a/res/layout/accessibility_tutorial_container.xml b/res/layout/accessibility_tutorial_container.xml
index e949d2a..4ee72f5 100644
--- a/res/layout/accessibility_tutorial_container.xml
+++ b/res/layout/accessibility_tutorial_container.xml
@@ -21,32 +21,6 @@
android:layout_width="fill_parent">
<LinearLayout
- android:orientation="vertical"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:paddingLeft="15dip"
- android:paddingRight="15dip">
-
- <TextView
- android:id="@+id/title"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="@style/AccessibilityTutorialTitle"
- android:layout_marginTop="11dip" />
-
- <View
- android:layout_width="fill_parent"
- android:layout_height="1dip"
- android:layout_gravity="center"
- android:background="@color/divider_color"
- android:layout_marginTop="14dip"
- android:layout_marginBottom="13dip"
- android:focusable="false"
- android:clickable="false" />
-
- </LinearLayout>
-
- <LinearLayout
android:id="@+id/content"
android:orientation="vertical"
android:layout_height="0dip"
@@ -88,28 +62,29 @@
android:background="@android:drawable/bottom_bar">
<Button
+ android:id="@+id/skip_button"
+ style="@style/AccessibilityTutorialButton"
+ android:layout_alignParentLeft="true"
+ android:text="@string/accessibility_tutorial_skip"
+ android:visibility="gone" />
+
+ <Button
android:id="@+id/back_button"
- android:layout_width="150dip"
- android:layout_height="wrap_content"
- android:layout_margin="5dip"
+ style="@style/AccessibilityTutorialButton"
android:layout_alignParentLeft="true"
- android:drawablePadding="3dip"
- android:text="@string/accessibility_tutorial_back" />
+ android:text="@string/accessibility_tutorial_back"
+ android:visibility="gone" />
<Button
android:id="@+id/next_button"
- android:layout_width="150dip"
- android:layout_height="wrap_content"
- android:layout_margin="5dip"
+ style="@style/AccessibilityTutorialButton"
android:layout_alignParentRight="true"
- android:drawablePadding="3dip"
- android:text="@string/accessibility_tutorial_next" />
+ android:text="@string/accessibility_tutorial_next"
+ android:visibility="gone" />
<Button
android:id="@+id/finish_button"
- android:layout_width="150dip"
- android:layout_height="wrap_content"
- android:layout_margin="5dip"
+ style="@style/AccessibilityTutorialButton"
android:layout_alignParentRight="true"
android:text="@string/accessibility_tutorial_finish"
android:visibility="gone" />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2912291..bad4934 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -3526,7 +3526,7 @@ found in the list of installed applications.</string>
<!-- Button label to exit the touch explorationtutorial. [CHAR LIMIT=10] -->
<string name="accessibility_tutorial_finish">Finish</string>
<!-- Button label to skip the touch exploration tutorial. [CHAR LIMIT=10] -->
- <string name="accessibility_tutorial_skip">Skip</string>
+ <string name="accessibility_tutorial_skip">Skip tutorial</string>
<!-- Title for touch exploration tutorial lesson 1. -->
<string name="accessibility_tutorial_lesson_1_title">Exploring the screen</string>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index d214d48..210a284 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -158,6 +158,13 @@
<item name="android:layout">@layout/preference_inputmethod</item>
<item name="android:widgetLayout">@layout/preference_inputmethod_widget</item>
</style>
+
+ <stlye name="AcessibilityTutorialButton">
+ <item name="android:layout_width">150dip</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:layout_margin">5dip</item>
+ <item name="android:drawablePadding">3dip</item>
+ </stlye>
<style name="AccessibilityTutorialDivider">
<item name="android:layout_width">match_parent</item>
diff --git a/src/com/android/settings/AccessibilityTutorialActivity.java b/src/com/android/settings/AccessibilityTutorialActivity.java
index be9b90d..5e65dcd 100644
--- a/src/com/android/settings/AccessibilityTutorialActivity.java
+++ b/src/com/android/settings/AccessibilityTutorialActivity.java
@@ -306,7 +306,7 @@ public class AccessibilityTutorialActivity extends Activity {
findViewById(R.id.next_button).setOnHoverListener(this);
- setPreviousVisible(false);
+ setSkipVisible(true);
}
@Override
@@ -350,6 +350,7 @@ public class AccessibilityTutorialActivity extends Activity {
final CharSequence nextText = getContext().getText(
R.string.accessibility_tutorial_next);
addInstruction(R.string.accessibility_tutorial_lesson_1_text_5, nextText);
+ setNextVisible(true);
}
}
@@ -403,8 +404,7 @@ public class AccessibilityTutorialActivity extends Activity {
((ListView) findViewById(R.id.list_view)).setAdapter(mAppsAdapter);
((ListView) findViewById(R.id.list_view)).setOnScrollListener(this);
- setNextVisible(false);
- setFinishVisible(true);
+ setBackVisible(true);
}
@Override
@@ -452,6 +452,7 @@ public class AccessibilityTutorialActivity extends Activity {
R.string.accessibility_tutorial_finish);
addInstruction(R.string.accessibility_tutorial_lesson_2_text_4, finishText);
setFlag(FLAG_COMPLETED_TUTORIAL, true);
+ setFinishVisible(true);
} else if (mScrollCount == MORE_SCROLL_COUNT) {
addInstruction(R.string.accessibility_tutorial_lesson_2_text_3_more);
}
@@ -476,8 +477,8 @@ public class AccessibilityTutorialActivity extends Activity {
private static abstract class TutorialModule extends FrameLayout implements OnClickListener {
private final AccessibilityTutorialActivity mController;
private final TextView mInstructions;
- private final TextView mTitle;
- private final Button mPrevious;
+ private final Button mSkip;
+ private final Button mBack;
private final Button mNext;
private final Button mFinish;
@@ -505,15 +506,23 @@ public class AccessibilityTutorialActivity extends Activity {
R.layout.accessibility_tutorial_container, this, true);
mInstructions = (TextView) container.findViewById(R.id.instructions);
- mTitle = (TextView) container.findViewById(R.id.title);
- mTitle.setText(titleResId);
- mPrevious = (Button) container.findViewById(R.id.back_button);
- mPrevious.setOnClickListener(this);
+ mSkip = (Button) container.findViewById(R.id.skip_button);
+ mSkip.setOnClickListener(this);
+ mBack = (Button) container.findViewById(R.id.back_button);
+ mBack.setOnClickListener(this);
mNext = (Button) container.findViewById(R.id.next_button);
mNext.setOnClickListener(this);
mFinish = (Button) container.findViewById(R.id.finish_button);
mFinish.setOnClickListener(this);
+ final TextView title = (TextView) container.findViewById(R.id.title);
+
+ if (title != null) {
+ title.setText(titleResId);
+ }
+
+ controller.setTitle(titleResId);
+
final ViewGroup contentHolder = (ViewGroup) container.findViewById(R.id.content);
LayoutInflater.from(context).inflate(layoutResId, contentHolder, true);
}
@@ -526,7 +535,6 @@ public class AccessibilityTutorialActivity extends Activity {
mFlags = 0;
mInstructions.setVisibility(View.GONE);
- mTitle.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
onShown();
}
@@ -572,6 +580,9 @@ public class AccessibilityTutorialActivity extends Activity {
@Override
public void onClick(View v) {
switch (v.getId()) {
+ case R.id.skip_button:
+ mController.finish();
+ break;
case R.id.back_button:
mController.previous();
break;
@@ -586,10 +597,6 @@ public class AccessibilityTutorialActivity extends Activity {
public abstract void onShown();
- protected void setFinishVisible(boolean visible) {
- mFinish.setVisibility(visible ? VISIBLE : GONE);
- }
-
/**
* Sets or removes the flag with the specified id.
*
@@ -605,12 +612,20 @@ public class AccessibilityTutorialActivity extends Activity {
}
}
+ protected void setSkipVisible(boolean visible) {
+ mSkip.setVisibility(visible ? VISIBLE : GONE);
+ }
+
+ protected void setBackVisible(boolean visible) {
+ mBack.setVisibility(visible ? VISIBLE : GONE);
+ }
+
protected void setNextVisible(boolean visible) {
mNext.setVisibility(visible ? VISIBLE : GONE);
}
- protected void setPreviousVisible(boolean visible) {
- mPrevious.setVisibility(visible ? VISIBLE : GONE);
+ protected void setFinishVisible(boolean visible) {
+ mFinish.setVisibility(visible ? VISIBLE : GONE);
}
}
}