am 46420204: Add user feedback to setup action labels and icons

* commit '464202047d6813e7559ceb8e73aceae0b15da1d9':
  Add user feedback to setup action labels and icons
This commit is contained in:
Tadashi G. Takaoka 2013-04-17 04:03:10 -07:00 committed by Android Git Automerger
commit e85e3c6476
17 changed files with 186 additions and 9 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -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:drawable="@drawable/unbundled_key_01" />
<item
android:state_pressed="true"
android:drawable="@drawable/unbundled_key_01" />
<item
android:drawable="@drawable/unbundled_key_02" />
</selector>

View file

@ -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:drawable="@drawable/unbundled_select_01" />
<item
android:state_pressed="true"
android:drawable="@drawable/unbundled_select_01" />
<item
android:drawable="@drawable/unbundled_select_02" />
</selector>

View file

@ -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:drawable="@drawable/unbundled_earth_01" />
<item
android:state_pressed="true"
android:drawable="@drawable/unbundled_earth_01" />
<item
android:drawable="@drawable/unbundled_earth_02" />
</selector>

View file

@ -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:drawable="@drawable/unbundled_check_01" />
<item
android:state_pressed="true"
android:drawable="@drawable/unbundled_check_01" />
<item
android:drawable="@drawable/unbundled_check_02" />
</selector>

View file

@ -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:drawable="@color/setup_text_action" />
<item
android:state_pressed="true"
android:drawable="@color/setup_text_action" />
<item
android:drawable="@color/setup_step_background" />
</selector>

View file

@ -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_step_background" />
<item
android:state_pressed="true"
android:color="@color/setup_step_background" />
<item
android:color="@color/setup_text_action" />
</selector>

View file

@ -42,7 +42,7 @@
<View
android:layout_width="match_parent"
android:layout_height="2dp" />
<TextView
<Button
android:id="@+id/setup_step_action_label"
style="@style/setupStepActionLabelStyle"
android:gravity="center_vertical"

View file

@ -38,8 +38,8 @@
<item name="android:textSize">14sp</item>
</style>
<style name="setupStepActionLabelStyle">
<item name="android:background">@color/setup_step_background</item>
<item name="android:textColor">@color/setup_text_action</item>
<item name="android:background">@drawable/setup_step_action_background</item>
<item name="android:textColor">@drawable/setup_step_action_color</item>
<item name="android:textSize">18sp</item>
</style>
</resources>

View file

@ -20,7 +20,6 @@ import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Message;
@ -119,7 +118,7 @@ public final class SetupActivity extends Activity {
final SetupStep step1 = new SetupStep(findViewById(R.id.setup_step1),
appName, R.string.setup_step1_title, R.string.setup_step1_instruction,
R.drawable.ic_settings_language, R.string.setup_step1_action);
R.drawable.ic_setup_step1, R.string.setup_step1_action);
step1.setAction(new Runnable() {
@Override
public void run() {
@ -131,7 +130,7 @@ public final class SetupActivity extends Activity {
final SetupStep step2 = new SetupStep(findViewById(R.id.setup_step2),
appName, R.string.setup_step2_title, R.string.setup_step2_instruction,
0 /* actionIcon */, R.string.setup_step2_action);
R.drawable.ic_setup_step2, R.string.setup_step2_action);
step2.setAction(new Runnable() {
@Override
public void run() {
@ -144,7 +143,7 @@ public final class SetupActivity extends Activity {
final SetupStep step3 = new SetupStep(findViewById(R.id.setup_step3),
appName, R.string.setup_step3_title, R.string.setup_step3_instruction,
R.drawable.sym_keyboard_language_switch, R.string.setup_step3_action);
R.drawable.ic_setup_step3, R.string.setup_step3_action);
step3.setAction(new Runnable() {
@Override
public void run() {
@ -314,9 +313,7 @@ public final class SetupActivity extends Activity {
final int paddingEnd = ViewCompatUtils.getPaddingEnd(mActionLabel);
ViewCompatUtils.setPaddingRelative(mActionLabel, paddingEnd, 0, paddingEnd, 0);
} else {
final int overrideColor = res.getColor(R.color.setup_text_action);
final Drawable icon = res.getDrawable(actionIcon);
icon.setColorFilter(overrideColor, PorterDuff.Mode.MULTIPLY);
icon.setBounds(0, 0, icon.getIntrinsicWidth(), icon.getIntrinsicHeight());
TextViewCompatUtils.setCompoundDrawablesRelative(
mActionLabel, icon, null, null, null);