mirror of
https://github.com/videolan/vlc-android
synced 2024-11-23 09:56:36 +08:00
Fix video tips for RTL
This commit is contained in:
parent
148fcd7097
commit
7c5f6795b8
@ -58,9 +58,9 @@
|
|||||||
android:textColor="?attr/font_default"
|
android:textColor="?attr/font_default"
|
||||||
android:textSize="24sp"
|
android:textSize="24sp"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/guideline8"
|
app:layout_constraintBottom_toTopOf="@+id/guideline8"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.5"
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
tools:text="Help title" />
|
tools:text="Help title" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -74,9 +74,9 @@
|
|||||||
android:textColor="@color/white_transparent_50"
|
android:textColor="@color/white_transparent_50"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
app:layout_constrainedWidth="true"
|
app:layout_constrainedWidth="true"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.5"
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/guideline8"
|
app:layout_constraintTop_toTopOf="@+id/guideline8"
|
||||||
tools:text="Help description" />
|
tools:text="Help description" />
|
||||||
|
|
||||||
@ -261,7 +261,7 @@
|
|||||||
android:layout_marginEnd="24dp"
|
android:layout_marginEnd="24dp"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
@ -300,7 +300,7 @@
|
|||||||
android:layout_marginStart="24dp"
|
android:layout_marginStart="24dp"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/guideline8"
|
app:layout_constraintBottom_toTopOf="@+id/guideline8"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/guideline8"
|
app:layout_constraintTop_toTopOf="@+id/guideline8"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ import org.videolan.tools.*
|
|||||||
import org.videolan.vlc.R
|
import org.videolan.vlc.R
|
||||||
import org.videolan.vlc.gui.helpers.TipsUtils
|
import org.videolan.vlc.gui.helpers.TipsUtils
|
||||||
import org.videolan.vlc.gui.view.PlayerProgress
|
import org.videolan.vlc.gui.view.PlayerProgress
|
||||||
|
import org.videolan.vlc.util.LocaleUtil
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delegate to manage the video tips workflow.
|
* Delegate to manage the video tips workflow.
|
||||||
@ -233,17 +234,23 @@ class VideoTipsDelegate(private val player: VideoPlayerActivity) : OnClickListen
|
|||||||
clearAllAnimations()
|
clearAllAnimations()
|
||||||
nextButton.setText(R.string.next_step)
|
nextButton.setText(R.string.next_step)
|
||||||
|
|
||||||
|
// For RTL, we have to invert some constraints as the volume and brightness gestures are kept at the same side of the screen
|
||||||
|
val independentStart = if (LocaleUtil.isRtl()) ConstraintSet.END else ConstraintSet.START
|
||||||
|
val independentEnd = if (LocaleUtil.isRtl()) ConstraintSet.START else ConstraintSet.END
|
||||||
when (currentTip) {
|
when (currentTip) {
|
||||||
VideoPlayerTipsStep.CONTROLS -> {
|
VideoPlayerTipsStep.CONTROLS -> {
|
||||||
getTapIndicators().forEach { constraintSet.setVisibility(it.id, VISIBLE) }
|
getTapIndicators().forEach { constraintSet.setVisibility(it.id, VISIBLE) }
|
||||||
TipsUtils.startTapAnimation(getTapIndicators().toList())
|
TipsUtils.startTapAnimation(getTapIndicators().toList())
|
||||||
}
|
}
|
||||||
VideoPlayerTipsStep.BRIGHTNESS -> {
|
VideoPlayerTipsStep.BRIGHTNESS -> {
|
||||||
constraintSet.connect(R.id.helpTitle, ConstraintSet.START, R.id.tap_gesture_background, ConstraintSet.END, 16.dp)
|
constraintSet.clear(R.id.tap_gesture_background, independentEnd)
|
||||||
constraintSet.connect(R.id.helpTitle, ConstraintSet.END, R.id.tipsBrightnessProgress, ConstraintSet.START, 16.dp)
|
constraintSet.connect(R.id.tap_gesture_background, independentStart, ConstraintSet.PARENT_ID, independentStart, 32.dp)
|
||||||
|
|
||||||
|
constraintSet.connect(R.id.helpTitle, ConstraintSet.LEFT, R.id.tap_gesture_background, ConstraintSet.RIGHT, 16.dp)
|
||||||
|
constraintSet.connect(R.id.helpTitle, ConstraintSet.RIGHT, R.id.tipsBrightnessProgress, ConstraintSet.LEFT, 16.dp)
|
||||||
constraintSet.setHorizontalBias(R.id.helpTitle, 1F)
|
constraintSet.setHorizontalBias(R.id.helpTitle, 1F)
|
||||||
constraintSet.connect(R.id.helpDescription, ConstraintSet.START, R.id.tap_gesture_background, ConstraintSet.END, 16.dp)
|
constraintSet.connect(R.id.helpDescription, ConstraintSet.LEFT, R.id.tap_gesture_background, ConstraintSet.RIGHT, 16.dp)
|
||||||
constraintSet.connect(R.id.helpDescription, ConstraintSet.END, R.id.tipsBrightnessProgress, ConstraintSet.START, 16.dp)
|
constraintSet.connect(R.id.helpDescription, ConstraintSet.RIGHT, R.id.tipsBrightnessProgress, ConstraintSet.LEFT, 16.dp)
|
||||||
constraintSet.setHorizontalBias(R.id.helpDescription, 1F)
|
constraintSet.setHorizontalBias(R.id.helpDescription, 1F)
|
||||||
|
|
||||||
constraintSet.setVisibility(R.id.tapGesture, VISIBLE)
|
constraintSet.setVisibility(R.id.tapGesture, VISIBLE)
|
||||||
@ -255,14 +262,14 @@ class VideoTipsDelegate(private val player: VideoPlayerActivity) : OnClickListen
|
|||||||
currentAnimations.add(swipe(tipsBrightnessProgress, tipsBrightnessText))
|
currentAnimations.add(swipe(tipsBrightnessProgress, tipsBrightnessText))
|
||||||
}
|
}
|
||||||
VideoPlayerTipsStep.VOLUME -> {
|
VideoPlayerTipsStep.VOLUME -> {
|
||||||
constraintSet.clear(R.id.tap_gesture_background, ConstraintSet.START)
|
constraintSet.clear(R.id.tap_gesture_background, independentStart)
|
||||||
constraintSet.connect(R.id.tap_gesture_background, ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END, 32.dp)
|
constraintSet.connect(R.id.tap_gesture_background, independentEnd, ConstraintSet.PARENT_ID, independentEnd, 32.dp)
|
||||||
|
|
||||||
constraintSet.connect(R.id.helpTitle, ConstraintSet.START, R.id.tipsVolumeProgress, ConstraintSet.END, 16.dp)
|
constraintSet.connect(R.id.helpTitle, ConstraintSet.LEFT, R.id.tipsVolumeProgress, ConstraintSet.RIGHT, 16.dp)
|
||||||
constraintSet.connect(R.id.helpTitle, ConstraintSet.END, R.id.tap_gesture_background, ConstraintSet.START, 16.dp)
|
constraintSet.connect(R.id.helpTitle, ConstraintSet.RIGHT, R.id.tap_gesture_background, ConstraintSet.LEFT, 16.dp)
|
||||||
constraintSet.setHorizontalBias(R.id.helpTitle, 0F)
|
constraintSet.setHorizontalBias(R.id.helpTitle, 0F)
|
||||||
constraintSet.connect(R.id.helpDescription, ConstraintSet.START, R.id.tipsVolumeProgress, ConstraintSet.END, 16.dp)
|
constraintSet.connect(R.id.helpDescription, ConstraintSet.LEFT, R.id.tipsVolumeProgress, ConstraintSet.RIGHT, 16.dp)
|
||||||
constraintSet.connect(R.id.helpDescription, ConstraintSet.END, R.id.tap_gesture_background, ConstraintSet.START, 16.dp)
|
constraintSet.connect(R.id.helpDescription, ConstraintSet.RIGHT, R.id.tap_gesture_background, ConstraintSet.LEFT, 16.dp)
|
||||||
constraintSet.setHorizontalBias(R.id.helpDescription, 0F)
|
constraintSet.setHorizontalBias(R.id.helpDescription, 0F)
|
||||||
|
|
||||||
constraintSet.setVisibility(R.id.tapGesture, VISIBLE)
|
constraintSet.setVisibility(R.id.tapGesture, VISIBLE)
|
||||||
|
Loading…
Reference in New Issue
Block a user