Loading res/layout/gesture_preference.xml +3 −3 Original line number Diff line number Diff line Loading @@ -30,7 +30,8 @@ android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="?android:attr/listPreferredItemPaddingStart" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"> android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:background="@android:color/white"> <TextView android:id="@android:id/title" Loading @@ -50,10 +51,9 @@ </LinearLayout> <LinearLayout android:id="@+id/gesture_detail" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/gestures_setting_backgroud_color" android:background="@color/gestures_setting_background_color" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:orientation="horizontal"> Loading res/values/colors.xml +1 −1 Original line number Diff line number Diff line Loading @@ -125,6 +125,6 @@ <color name="card_background_grey">#eeeeee</color> <!-- Gestures settings --> <color name="gestures_setting_backgroud_color">#f5f5f5</color> <color name="gestures_setting_background_color">#f5f5f5</color> </resources> src/com/android/settings/gestures/GesturePreference.java +12 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,9 @@ import android.content.ContentResolver; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.drawable.BitmapDrawable; import android.graphics.PorterDuff; import android.graphics.SurfaceTexture; import android.media.MediaMetadataRetriever; import android.media.MediaPlayer; Loading Loading @@ -77,10 +79,11 @@ public final class GesturePreference extends SwitchPreference { @Override public void onBindViewHolder(PreferenceViewHolder holder) { super.onBindViewHolder(holder); holder.setDividerAllowedAbove(false); holder.setDividerAllowedBelow(false); final TextureView video = (TextureView) holder.findViewById(R.id.gesture_video); final ImageView imageView = (ImageView) holder.findViewById(R.id.gesture_image); final ImageView playButton = (ImageView) holder.findViewById(R.id.gesture_play_button); final View detailView = holder.findViewById(R.id.gesture_detail); final View animationFrame = holder.findViewById(R.id.gesture_animation_frame); if (!animationAvailable) { Loading @@ -91,6 +94,8 @@ public final class GesturePreference extends SwitchPreference { Bitmap bitmap = mMediaMetadata.getFrameAtTime(0); if (bitmap != null) { imageView.setImageDrawable(new BitmapDrawable(bitmap)); imageView.setColorFilter(mContext.getResources().getColor( R.color.gestures_setting_background_color), PorterDuff.Mode.DARKEN); } imageView.setVisibility(View.VISIBLE); playButton.setVisibility(View.VISIBLE); Loading Loading @@ -157,4 +162,10 @@ public final class GesturePreference extends SwitchPreference { } @Override public void onDetached() { mMediaMetadata.release(); super.onDetached(); } } Loading
res/layout/gesture_preference.xml +3 −3 Original line number Diff line number Diff line Loading @@ -30,7 +30,8 @@ android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="?android:attr/listPreferredItemPaddingStart" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"> android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:background="@android:color/white"> <TextView android:id="@android:id/title" Loading @@ -50,10 +51,9 @@ </LinearLayout> <LinearLayout android:id="@+id/gesture_detail" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/gestures_setting_backgroud_color" android:background="@color/gestures_setting_background_color" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:orientation="horizontal"> Loading
res/values/colors.xml +1 −1 Original line number Diff line number Diff line Loading @@ -125,6 +125,6 @@ <color name="card_background_grey">#eeeeee</color> <!-- Gestures settings --> <color name="gestures_setting_backgroud_color">#f5f5f5</color> <color name="gestures_setting_background_color">#f5f5f5</color> </resources>
src/com/android/settings/gestures/GesturePreference.java +12 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,9 @@ import android.content.ContentResolver; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.drawable.BitmapDrawable; import android.graphics.PorterDuff; import android.graphics.SurfaceTexture; import android.media.MediaMetadataRetriever; import android.media.MediaPlayer; Loading Loading @@ -77,10 +79,11 @@ public final class GesturePreference extends SwitchPreference { @Override public void onBindViewHolder(PreferenceViewHolder holder) { super.onBindViewHolder(holder); holder.setDividerAllowedAbove(false); holder.setDividerAllowedBelow(false); final TextureView video = (TextureView) holder.findViewById(R.id.gesture_video); final ImageView imageView = (ImageView) holder.findViewById(R.id.gesture_image); final ImageView playButton = (ImageView) holder.findViewById(R.id.gesture_play_button); final View detailView = holder.findViewById(R.id.gesture_detail); final View animationFrame = holder.findViewById(R.id.gesture_animation_frame); if (!animationAvailable) { Loading @@ -91,6 +94,8 @@ public final class GesturePreference extends SwitchPreference { Bitmap bitmap = mMediaMetadata.getFrameAtTime(0); if (bitmap != null) { imageView.setImageDrawable(new BitmapDrawable(bitmap)); imageView.setColorFilter(mContext.getResources().getColor( R.color.gestures_setting_background_color), PorterDuff.Mode.DARKEN); } imageView.setVisibility(View.VISIBLE); playButton.setVisibility(View.VISIBLE); Loading Loading @@ -157,4 +162,10 @@ public final class GesturePreference extends SwitchPreference { } @Override public void onDetached() { mMediaMetadata.release(); super.onDetached(); } }