TouchFeedbackDrawable is now RippleDrawable

Change-Id: Id025b58e9b62baa8d07f13b7eae2de61a3e4c90a
This commit is contained in:
Alan Viverette
2014-05-19 15:10:36 -07:00
parent ba046c034c
commit ba348ca996
4 changed files with 16 additions and 12 deletions

View File

@@ -14,10 +14,10 @@
limitations under the License. limitations under the License.
--> -->
<touch-feedback xmlns:android="http://schemas.android.com/apk/res/android" <ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:tint="?android:attr/colorButtonPressed"> android:tint="?android:attr/colorButtonPressed">
<item> <item>
<color android:color="@android:color/white" /> <color android:color="@android:color/white" />
</item> </item>
</touch-feedback> </ripple>

View File

@@ -14,10 +14,10 @@
limitations under the License. limitations under the License.
--> -->
<touch-feedback xmlns:android="http://schemas.android.com/apk/res/android" <ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:tint="?android:attr/colorButtonPressed" android:tint="?android:attr/colorButtonPressed"
android:pinned="true"> android:pinned="true">
<item android:id="@android:id/mask" <item android:id="@android:id/mask"
android:drawable="@android:color/white" /> android:drawable="@android:color/white" />
</touch-feedback> </ripple>

View File

@@ -83,8 +83,9 @@ public class HighlightingFragment extends Fragment {
public void run() { public void run() {
final int centerX = view.getWidth() / 2; final int centerX = view.getWidth() / 2;
final int centerY = view.getHeight() / 2; final int centerY = view.getHeight() / 2;
highlight.setHotspot(0, centerX, centerY); highlight.setHotspot(centerX, centerY);
highlight.clearHotspots(); view.setPressed(true);
view.setPressed(false);
} }
}, DELAY_HIGHLIGHT_DURATION_MILLIS); }, DELAY_HIGHLIGHT_DURATION_MILLIS);

View File

@@ -183,10 +183,12 @@ public class SettingsPreferenceFragment extends PreferenceFragment implements Di
listView.postDelayed(new Runnable() { listView.postDelayed(new Runnable() {
@Override @Override
public void run() { public void run() {
final int centerX = listView.getWidth() / 2; final View v = listView.getChildAt(0);
final int centerY = listView.getChildAt(0).getHeight() / 2; final int centerX = v.getWidth() / 2;
highlight.setHotspot(0, centerX, centerY); final int centerY = v.getHeight() / 2;
highlight.clearHotspots(); highlight.setHotspot(centerX, centerY);
v.setPressed(true);
v.setPressed(false);
((PreferenceGroupAdapter) adapter).setHighlighted(-1); ((PreferenceGroupAdapter) adapter).setHighlighted(-1);
} }
}, DELAY_HIGHLIGHT_DURATION_MILLIS); }, DELAY_HIGHLIGHT_DURATION_MILLIS);
@@ -201,8 +203,9 @@ public class SettingsPreferenceFragment extends PreferenceFragment implements Di
preferenceView.setBackground(highlight); preferenceView.setBackground(highlight);
final int centerX = preferenceView.getWidth() / 2; final int centerX = preferenceView.getWidth() / 2;
final int centerY = preferenceView.getHeight() / 2; final int centerY = preferenceView.getHeight() / 2;
highlight.setHotspot(0, centerX, centerY); highlight.setHotspot(centerX, centerY);
highlight.clearHotspots(); preferenceView.setPressed(true);
preferenceView.setPressed(false);
} }
} }
} }