Polishing accessibility tutorial UI.
Change-Id: I059f00e94cdc906935b2d42a505f31512dd99668
This commit is contained in:
@@ -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" />
|
||||
|
@@ -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">
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/back_button"
|
||||
android:id="@+id/skip_button"
|
||||
style="@style/AccessibilityTutorialButton"
|
||||
android:text="@string/accessibility_tutorial_back" />
|
||||
|
||||
<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: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>
|
||||
|
@@ -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" />
|
@@ -20,32 +20,6 @@
|
||||
android:layout_height="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
|
||||
android:id="@+id/content"
|
||||
android:orientation="vertical"
|
||||
@@ -88,28 +62,29 @@
|
||||
android:background="@android:drawable/bottom_bar">
|
||||
|
||||
<Button
|
||||
android:id="@+id/back_button"
|
||||
android:layout_width="150dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dip"
|
||||
android:id="@+id/skip_button"
|
||||
style="@style/AccessibilityTutorialButton"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:drawablePadding="3dip"
|
||||
android:text="@string/accessibility_tutorial_back" />
|
||||
android:text="@string/accessibility_tutorial_skip"
|
||||
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
|
||||
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" />
|
||||
|
@@ -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>
|
||||
|
@@ -159,6 +159,13 @@
|
||||
<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>
|
||||
<item name="android:layout_height">2dip</item>
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user