Polishing accessibility tutorial UI.
Change-Id: I059f00e94cdc906935b2d42a505f31512dd99668
This commit is contained in:
@@ -948,7 +948,7 @@
|
|||||||
android:label="@string/accessibility_tutorial_title"
|
android:label="@string/accessibility_tutorial_title"
|
||||||
android:configChanges="orientation"
|
android:configChanges="orientation"
|
||||||
android:immersive="true"
|
android:immersive="true"
|
||||||
android:theme="@android:style/Theme.Holo">
|
android:theme="@android:style/Theme.Holo.NoActionBar">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.settings.ACCESSIBILITY_TUTORIAL" />
|
<action android:name="android.settings.ACCESSIBILITY_TUTORIAL" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
@@ -74,6 +74,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_marginBottom="16dip"
|
android:layout_marginBottom="16dip"
|
||||||
style="@style/AccessibilityTutorialDivider" />
|
style="@style/AccessibilityTutorialDivider" />
|
||||||
@@ -81,25 +82,40 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal">
|
||||||
android:gravity="right">
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/back_button"
|
android:id="@+id/skip_button"
|
||||||
style="@style/AccessibilityTutorialButton"
|
style="@style/AccessibilityTutorialButton"
|
||||||
android:text="@string/accessibility_tutorial_back" />
|
android:text="@string/accessibility_tutorial_skip"
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/next_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:visibility="gone" />
|
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>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@@ -19,8 +19,8 @@
|
|||||||
android:id="@+id/all_apps"
|
android:id="@+id/all_apps"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:columnWidth="72dip"
|
android:columnWidth="96dip"
|
||||||
android:numColumns="auto_fit"
|
android:numColumns="auto_fit"
|
||||||
android:verticalSpacing="10dip"
|
android:verticalSpacing="10dip"
|
||||||
android:horizontalSpacing="10dip"
|
android:horizontalSpacing="20dip"
|
||||||
android:stretchMode="columnWidth" />
|
android:stretchMode="columnWidth" />
|
@@ -20,32 +20,6 @@
|
|||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:layout_width="fill_parent">
|
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
|
<LinearLayout
|
||||||
android:id="@+id/content"
|
android:id="@+id/content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
@@ -88,28 +62,29 @@
|
|||||||
android:background="@android:drawable/bottom_bar">
|
android:background="@android:drawable/bottom_bar">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/back_button"
|
android:id="@+id/skip_button"
|
||||||
android:layout_width="150dip"
|
style="@style/AccessibilityTutorialButton"
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="5dip"
|
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:drawablePadding="3dip"
|
android:text="@string/accessibility_tutorial_skip"
|
||||||
android:text="@string/accessibility_tutorial_back" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/back_button"
|
||||||
|
style="@style/AccessibilityTutorialButton"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:text="@string/accessibility_tutorial_back"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/next_button"
|
android:id="@+id/next_button"
|
||||||
android:layout_width="150dip"
|
style="@style/AccessibilityTutorialButton"
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="5dip"
|
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:drawablePadding="3dip"
|
android:text="@string/accessibility_tutorial_next"
|
||||||
android:text="@string/accessibility_tutorial_next" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/finish_button"
|
android:id="@+id/finish_button"
|
||||||
android:layout_width="150dip"
|
style="@style/AccessibilityTutorialButton"
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="5dip"
|
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:text="@string/accessibility_tutorial_finish"
|
android:text="@string/accessibility_tutorial_finish"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
@@ -3526,7 +3526,7 @@ found in the list of installed applications.</string>
|
|||||||
<!-- Button label to exit the touch explorationtutorial. [CHAR LIMIT=10] -->
|
<!-- Button label to exit the touch explorationtutorial. [CHAR LIMIT=10] -->
|
||||||
<string name="accessibility_tutorial_finish">Finish</string>
|
<string name="accessibility_tutorial_finish">Finish</string>
|
||||||
<!-- Button label to skip the touch exploration tutorial. [CHAR LIMIT=10] -->
|
<!-- 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. -->
|
<!-- Title for touch exploration tutorial lesson 1. -->
|
||||||
<string name="accessibility_tutorial_lesson_1_title">Exploring the screen</string>
|
<string name="accessibility_tutorial_lesson_1_title">Exploring the screen</string>
|
||||||
|
@@ -158,6 +158,13 @@
|
|||||||
<item name="android:layout">@layout/preference_inputmethod</item>
|
<item name="android:layout">@layout/preference_inputmethod</item>
|
||||||
<item name="android:widgetLayout">@layout/preference_inputmethod_widget</item>
|
<item name="android:widgetLayout">@layout/preference_inputmethod_widget</item>
|
||||||
</style>
|
</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">
|
<style name="AccessibilityTutorialDivider">
|
||||||
<item name="android:layout_width">match_parent</item>
|
<item name="android:layout_width">match_parent</item>
|
||||||
|
@@ -306,7 +306,7 @@ public class AccessibilityTutorialActivity extends Activity {
|
|||||||
|
|
||||||
findViewById(R.id.next_button).setOnHoverListener(this);
|
findViewById(R.id.next_button).setOnHoverListener(this);
|
||||||
|
|
||||||
setPreviousVisible(false);
|
setSkipVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -350,6 +350,7 @@ public class AccessibilityTutorialActivity extends Activity {
|
|||||||
final CharSequence nextText = getContext().getText(
|
final CharSequence nextText = getContext().getText(
|
||||||
R.string.accessibility_tutorial_next);
|
R.string.accessibility_tutorial_next);
|
||||||
addInstruction(R.string.accessibility_tutorial_lesson_1_text_5, nextText);
|
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)).setAdapter(mAppsAdapter);
|
||||||
((ListView) findViewById(R.id.list_view)).setOnScrollListener(this);
|
((ListView) findViewById(R.id.list_view)).setOnScrollListener(this);
|
||||||
|
|
||||||
setNextVisible(false);
|
setBackVisible(true);
|
||||||
setFinishVisible(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -452,6 +452,7 @@ public class AccessibilityTutorialActivity extends Activity {
|
|||||||
R.string.accessibility_tutorial_finish);
|
R.string.accessibility_tutorial_finish);
|
||||||
addInstruction(R.string.accessibility_tutorial_lesson_2_text_4, finishText);
|
addInstruction(R.string.accessibility_tutorial_lesson_2_text_4, finishText);
|
||||||
setFlag(FLAG_COMPLETED_TUTORIAL, true);
|
setFlag(FLAG_COMPLETED_TUTORIAL, true);
|
||||||
|
setFinishVisible(true);
|
||||||
} else if (mScrollCount == MORE_SCROLL_COUNT) {
|
} else if (mScrollCount == MORE_SCROLL_COUNT) {
|
||||||
addInstruction(R.string.accessibility_tutorial_lesson_2_text_3_more);
|
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 static abstract class TutorialModule extends FrameLayout implements OnClickListener {
|
||||||
private final AccessibilityTutorialActivity mController;
|
private final AccessibilityTutorialActivity mController;
|
||||||
private final TextView mInstructions;
|
private final TextView mInstructions;
|
||||||
private final TextView mTitle;
|
private final Button mSkip;
|
||||||
private final Button mPrevious;
|
private final Button mBack;
|
||||||
private final Button mNext;
|
private final Button mNext;
|
||||||
private final Button mFinish;
|
private final Button mFinish;
|
||||||
|
|
||||||
@@ -505,15 +506,23 @@ public class AccessibilityTutorialActivity extends Activity {
|
|||||||
R.layout.accessibility_tutorial_container, this, true);
|
R.layout.accessibility_tutorial_container, this, true);
|
||||||
|
|
||||||
mInstructions = (TextView) container.findViewById(R.id.instructions);
|
mInstructions = (TextView) container.findViewById(R.id.instructions);
|
||||||
mTitle = (TextView) container.findViewById(R.id.title);
|
mSkip = (Button) container.findViewById(R.id.skip_button);
|
||||||
mTitle.setText(titleResId);
|
mSkip.setOnClickListener(this);
|
||||||
mPrevious = (Button) container.findViewById(R.id.back_button);
|
mBack = (Button) container.findViewById(R.id.back_button);
|
||||||
mPrevious.setOnClickListener(this);
|
mBack.setOnClickListener(this);
|
||||||
mNext = (Button) container.findViewById(R.id.next_button);
|
mNext = (Button) container.findViewById(R.id.next_button);
|
||||||
mNext.setOnClickListener(this);
|
mNext.setOnClickListener(this);
|
||||||
mFinish = (Button) container.findViewById(R.id.finish_button);
|
mFinish = (Button) container.findViewById(R.id.finish_button);
|
||||||
mFinish.setOnClickListener(this);
|
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);
|
final ViewGroup contentHolder = (ViewGroup) container.findViewById(R.id.content);
|
||||||
LayoutInflater.from(context).inflate(layoutResId, contentHolder, true);
|
LayoutInflater.from(context).inflate(layoutResId, contentHolder, true);
|
||||||
}
|
}
|
||||||
@@ -526,7 +535,6 @@ public class AccessibilityTutorialActivity extends Activity {
|
|||||||
|
|
||||||
mFlags = 0;
|
mFlags = 0;
|
||||||
mInstructions.setVisibility(View.GONE);
|
mInstructions.setVisibility(View.GONE);
|
||||||
mTitle.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
|
|
||||||
|
|
||||||
onShown();
|
onShown();
|
||||||
}
|
}
|
||||||
@@ -572,6 +580,9 @@ public class AccessibilityTutorialActivity extends Activity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
|
case R.id.skip_button:
|
||||||
|
mController.finish();
|
||||||
|
break;
|
||||||
case R.id.back_button:
|
case R.id.back_button:
|
||||||
mController.previous();
|
mController.previous();
|
||||||
break;
|
break;
|
||||||
@@ -586,10 +597,6 @@ public class AccessibilityTutorialActivity extends Activity {
|
|||||||
|
|
||||||
public abstract void onShown();
|
public abstract void onShown();
|
||||||
|
|
||||||
protected void setFinishVisible(boolean visible) {
|
|
||||||
mFinish.setVisibility(visible ? VISIBLE : GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets or removes the flag with the specified id.
|
* 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) {
|
protected void setNextVisible(boolean visible) {
|
||||||
mNext.setVisibility(visible ? VISIBLE : GONE);
|
mNext.setVisibility(visible ? VISIBLE : GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setPreviousVisible(boolean visible) {
|
protected void setFinishVisible(boolean visible) {
|
||||||
mPrevious.setVisibility(visible ? VISIBLE : GONE);
|
mFinish.setVisibility(visible ? VISIBLE : GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user