[Android] No need to imageviews
Geoffrey Métais
git at videolan.org
Thu Feb 12 17:12:34 CET 2015
vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Feb 12 13:49:55 2015 +0100| [0b7c9d9f6d545fca52e20bf36b9ef0fc147818ed] | committer: Geoffrey Métais
No need to imageviews
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=0b7c9d9f6d545fca52e20bf36b9ef0fc147818ed
---
.../res/layout/fragment_advanced_options.xml | 36 ++++++--------------
.../videolan/vlc/gui/video/AdvOptionsDialog.java | 8 -----
2 files changed, 10 insertions(+), 34 deletions(-)
diff --git a/vlc-android/res/layout/fragment_advanced_options.xml b/vlc-android/res/layout/fragment_advanced_options.xml
index 7e8cdc4..04c7484 100644
--- a/vlc-android/res/layout/fragment_advanced_options.xml
+++ b/vlc-android/res/layout/fragment_advanced_options.xml
@@ -116,18 +116,14 @@
android:layout_marginTop="10dp"
android:orientation="horizontal" >
- <ImageView
- android:id="@+id/sleep_timer_icon"
- android:layout_width="40dp"
- android:layout_height="40dp"
- android:src="@drawable/ic_sleep_normal_w" />
-
<TextView
android:id="@+id/sleep_timer_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
- android:text="@string/sleep_title" />
+ android:gravity="center_vertical"
+ android:text="@string/sleep_title"
+ android:drawableLeft="@drawable/ic_sleep_normal_w"/>
<TextView
android:id="@+id/sleep_timer_value"
@@ -152,27 +148,15 @@
</LinearLayout>
<!-- Jump to position -->
-
- <LinearLayout
+ <TextView
+ android:id="@+id/jump_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal" >
-
- <ImageView
- android:id="@+id/jump_icon"
- android:layout_width="40dp"
- android:layout_height="40dp"
- android:src="@drawable/ic_jumpto_normal_w" />
-
- <TextView
- android:id="@+id/jump_title"
- android:layout_width="wrap_content"
- android:layout_height="40dp"
- android:clickable="true"
- android:focusable="true"
- android:gravity="center_vertical"
- android:text="@string/jump_to_time" />
- </LinearLayout>
+ android:clickable="true"
+ android:focusable="true"
+ android:gravity="center_vertical"
+ android:text="@string/jump_to_time"
+ android:drawableLeft="@drawable/ic_jumpto_normal_w"/>
<!-- Tracks delay -->
<LinearLayout
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/AdvOptionsDialog.java b/vlc-android/src/org/videolan/vlc/gui/video/AdvOptionsDialog.java
index bb9e7a9..13c26c9 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/AdvOptionsDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/AdvOptionsDialog.java
@@ -67,12 +67,10 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
private SeekBar mSeek;
private Button mReset;
- private ImageView mSleepIcon;
private TextView mSleepTitle;
private TextView mSleepTime;
private TextView mSleepCancel;
- private ImageView mJumpIcon;
private TextView mJumpTitle;
private TextView mAudioDelay;
@@ -105,13 +103,11 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
mSeek.setOnSeekBarChangeListener(mSeekBarListener);
mReset.setOnClickListener(mResetListener);
- mSleepIcon = (ImageView) root.findViewById(R.id.sleep_timer_icon);
mSleepTitle = (TextView) root.findViewById(R.id.sleep_timer_title);
mSleepTime = (TextView) root.findViewById(R.id.sleep_timer_value);
mSleepCancel = (TextView) root.findViewById(R.id.sleep_timer_cancel);
if (AndroidDevices.hasTsp()) {
- mSleepIcon.setOnClickListener(this);
mSleepTitle.setOnClickListener(this);
mSleepTime.setOnClickListener(this);
mSleepCancel.setOnClickListener(this);
@@ -119,13 +115,11 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
root.findViewById(R.id.sleep_timer_container).setVisibility(View.GONE);
}
- mJumpIcon = (ImageView) root.findViewById(R.id.jump_icon);
mJumpTitle = (TextView) root.findViewById(R.id.jump_title);
mAudioDelay = (TextView) root.findViewById(R.id.audio_delay);
mSpuDelay = (TextView) root.findViewById(R.id.spu_delay);
- mJumpIcon.setOnClickListener(this);
mJumpTitle.setOnClickListener(this);
mAudioDelay.setOnClickListener(this);
@@ -269,11 +263,9 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
case R.id.spu_delay:
showTimePickerFragment(ACTION_SPU_DELAY);
break;
- case R.id.jump_icon:
case R.id.jump_title:
showTimePickerFragment(ACTION_JUMP_TO_TIME);
break;
- case R.id.sleep_timer_icon:
case R.id.sleep_timer_title:
case R.id.sleep_timer_value:
showTimePicker(TimePickerDialogFragment.ACTION_SLEEP);
More information about the Android
mailing list