[Android] Invert orientation and DVD menu icons
Nicolas Pomepuy
git at videolan.org
Tue Jun 30 14:06:25 CEST 2020
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Jun 24 08:12:14 2020 +0200| [cb57913a1bc239519f1bff1d0698421193ac87c1] | committer: Nicolas Pomepuy
Invert orientation and DVD menu icons
> https://code.videolan.org/videolan/vlc-android/commit/cb57913a1bc239519f1bff1d0698421193ac87c1
---
application/vlc-android/res/layout/player_hud.xml | 10 +++++-----
application/vlc-android/res/layout/player_hud_right.xml | 4 ++--
.../org/videolan/vlc/gui/video/VideoPlayerActivity.kt | 16 +++++++++-------
3 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/application/vlc-android/res/layout/player_hud.xml b/application/vlc-android/res/layout/player_hud.xml
index e7cec03c1..6d6d0031d 100644
--- a/application/vlc-android/res/layout/player_hud.xml
+++ b/application/vlc-android/res/layout/player_hud.xml
@@ -309,14 +309,14 @@
tools:visibility="visible"
android:padding="4dp"
vlc:layout_constraintBottom_toBottomOf="@+id/player_overlay_play"
- vlc:layout_constraintEnd_toStartOf="@+id/player_overlay_navmenu"
+ vlc:layout_constraintEnd_toStartOf="@+id/orientation_toggle"
vlc:layout_constraintHorizontal_chainStyle="spread_inside"
vlc:layout_constraintStart_toStartOf="parent"
vlc:layout_constraintTop_toTopOf="@+id/player_overlay_play"
vlc:srcCompat="@drawable/ic_player_audiotrack" />
<ImageView
- android:id="@+id/player_overlay_navmenu"
+ android:id="@+id/orientation_toggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
@@ -324,14 +324,14 @@
android:layout_marginEnd="8dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:focusable="true"
- android:visibility="invisible"
android:padding="4dp"
+ android:visibility="invisible"
tools:visibility="visible"
vlc:layout_constraintBottom_toBottomOf="@+id/player_overlay_play"
vlc:layout_constraintEnd_toStartOf="@+id/player_space_left"
vlc:layout_constraintStart_toEndOf="@+id/player_overlay_tracks"
vlc:layout_constraintTop_toTopOf="@+id/player_overlay_play"
- vlc:srcCompat="@drawable/ic_player_navmenu" />
+ vlc:srcCompat="@drawable/ic_player_rotate" />
<Space
android:id="@+id/player_space_left"
@@ -339,7 +339,7 @@
android:layout_height="wrap_content"
vlc:layout_constraintBottom_toBottomOf="@+id/playlist_previous"
vlc:layout_constraintEnd_toStartOf="@+id/playlist_previous"
- vlc:layout_constraintStart_toEndOf="@+id/player_overlay_navmenu"
+ vlc:layout_constraintStart_toEndOf="@+id/orientation_toggle"
vlc:layout_constraintTop_toTopOf="@+id/playlist_previous" />
<ImageView
diff --git a/application/vlc-android/res/layout/player_hud_right.xml b/application/vlc-android/res/layout/player_hud_right.xml
index 3f547eefc..6a27c7d50 100644
--- a/application/vlc-android/res/layout/player_hud_right.xml
+++ b/application/vlc-android/res/layout/player_hud_right.xml
@@ -26,7 +26,7 @@
app:layout_constraintTop_toTopOf="parent" />
<ImageView
- android:id="@+id/orientation_toggle"
+ android:id="@+id/player_overlay_navmenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
@@ -37,7 +37,7 @@
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
- app:srcCompat="@drawable/ic_player_rotate"
+ app:srcCompat="@drawable/ic_player_navmenu"
tools:visibility="visible" />
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index e51a02877..44fc2b7e2 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -552,10 +552,12 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
hudBinding.abRepeatReset.setOnClickListener(this)
hudBinding.abRepeatStop.setOnClickListener(this)
abRepeatAddMarker.setOnClickListener(this)
+ hudBinding.orientationToggle.setOnClickListener(if (enabled) this else null)
+ hudBinding.orientationToggle.setOnLongClickListener(if (enabled) this else null)
}
if (::hudRightBinding.isInitialized) {
- hudRightBinding.orientationToggle.setOnClickListener(if (enabled) this else null)
- hudRightBinding.orientationToggle.setOnLongClickListener(if (enabled) this else null)
+// hudRightBinding.orientationToggle.setOnClickListener(if (enabled) this else null)
+// hudRightBinding.orientationToggle.setOnLongClickListener(if (enabled) this else null)
}
UiTools.setViewOnClickListener(rendererBtn, if (enabled) this else null)
}
@@ -684,9 +686,9 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
fun resetHudLayout() {
- if (!::hudRightBinding.isInitialized) return
+ if (!::hudBinding.isInitialized) return
if (!isTv && !AndroidDevices.isChromeBook) {
- hudRightBinding.orientationToggle.setVisible()
+ hudBinding.orientationToggle.setVisible()
}
}
@@ -1966,13 +1968,13 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
hudBinding.playlistPrevious.visibility = if (show) View.VISIBLE else View.INVISIBLE
hudBinding.playlistNext.visibility = if (show) View.VISIBLE else View.INVISIBLE
}
+ hudBinding.orientationToggle.visibility = if (isTv || AndroidDevices.isChromeBook) View.GONE else if (show) View.VISIBLE else View.INVISIBLE
}
if (::hudRightBinding.isInitialized) {
val secondary = displayManager.isSecondary
if (secondary) hudRightBinding.videoSecondaryDisplay.setImageResource(R.drawable.ic_player_screenshare_stop)
hudRightBinding.videoSecondaryDisplay.visibility = if (!show) View.GONE else if (UiTools.hasSecondaryDisplay(applicationContext)) View.VISIBLE else View.GONE
hudRightBinding.videoSecondaryDisplay.contentDescription = resources.getString(if (secondary) R.string.video_remote_disable else R.string.video_remote_enable)
- hudRightBinding.orientationToggle.visibility = if (isTv || AndroidDevices.isChromeBook) View.GONE else if (show) View.VISIBLE else View.INVISIBLE
hudRightBinding.playlistToggle.visibility = if (show && service?.hasPlaylist() == true) View.VISIBLE else View.GONE
}
@@ -2082,7 +2084,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
titleConstraintSetPortrait.clone(hudRightBinding.hudRightOverlay)
titleConstraintSetPortrait.setMargin(hudRightBinding.playerOverlayTitle.id, ConstraintSet.START, 16.dp)
titleConstraintSetPortrait.setMargin(hudRightBinding.playerOverlayTitle.id, ConstraintSet.END, 16.dp)
- titleConstraintSetPortrait.connect(hudRightBinding.playerOverlayTitle.id, ConstraintSet.TOP, hudRightBinding.orientationToggle.id, ConstraintSet.BOTTOM, 0.dp)
+ titleConstraintSetPortrait.connect(hudRightBinding.playerOverlayTitle.id, ConstraintSet.TOP, hudRightBinding.playerOverlayNavmenu.id, ConstraintSet.BOTTOM, 0.dp)
}
private fun updateTitleConstraints() {
@@ -2103,7 +2105,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
applyMargin(hudBinding.playerOverlayForward, largeMargin.toInt(), false)
applyMargin(hudBinding.playerOverlayTracks, smallMargin.toInt(), false)
- applyMargin(hudBinding.playerOverlayNavmenu, smallMargin.toInt(), false)
+ applyMargin(hudBinding.orientationToggle, smallMargin.toInt(), false)
applyMargin(hudBinding.playerResize, smallMargin.toInt(), true)
applyMargin(hudBinding.playerOverlayAdvFunction, smallMargin.toInt(), true)
More information about the Android
mailing list