[Android] Fix renderers dialog
Geoffrey Métais
git at videolan.org
Mon Feb 12 17:38:52 CET 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Feb 12 17:29:09 2018 +0100| [8079f20aeb74247095cad3a1026e7d952ab1a5b4] | committer: Geoffrey Métais
Fix renderers dialog
> https://code.videolan.org/videolan/vlc-android/commit/8079f20aeb74247095cad3a1026e7d952ab1a5b4
---
vlc-android/res/layout/dialog_renderers.xml | 9 +++++----
vlc-android/res/values/strings.xml | 1 +
.../src/org/videolan/vlc/gui/dialogs/RenderersDialog.kt | 11 +++++++++++
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/vlc-android/res/layout/dialog_renderers.xml b/vlc-android/res/layout/dialog_renderers.xml
index 4133d2624..fc04e5a36 100644
--- a/vlc-android/res/layout/dialog_renderers.xml
+++ b/vlc-android/res/layout/dialog_renderers.xml
@@ -11,7 +11,8 @@
<android.support.constraint.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:minWidth="448dp">
+ android:minWidth="384dp"
+ android:minHeight="256dp">
<TextView
android:id="@+id/renderers_title"
android:layout_width="wrap_content"
@@ -23,10 +24,11 @@
<android.support.v7.widget.RecyclerView
android:id="@+id/renderers_list"
android:layout_width="0dp"
- android:layout_height="wrap_content"
+ android:layout_height="0dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/renderers_title"
+ app:layout_constraintBottom_toTopOf="@+id/renderers_disconnect"
tools:listitem="@layout/item_renderer"/>
<Button
android:id="@+id/renderers_disconnect"
@@ -34,9 +36,8 @@
android:layout_height="wrap_content"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/renderers_list"
app:layout_constraintBottom_toBottomOf="parent"
- android:text="Disconnect"
+ android:text="@string/renderers_disconnect"
tools:targetApi="11"
style="?android:attr/borderlessButtonStyle"
android:textColor="@color/orange800"
diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 704ffdc13..06dca9855 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -592,4 +592,5 @@
<string name="sdcard_permission_dialog_title">You have to grant VLC write access to your SD Card</string>
<string name="sdcard_permission_dialog_message">VLC cannot delete this file without write access permission.\nPlease go to your SD Card and click on \"Select\".\nYou may have to click on \"Show SD card\" first in the top-right menu</string>
<string name="dialog_sd_wizard">Show me</string>
+ <string name="renderers_disconnect">Disconnect</string>
</resources>
diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/RenderersDialog.kt b/vlc-android/src/org/videolan/vlc/gui/dialogs/RenderersDialog.kt
index 6fbc30293..6e5926868 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/RenderersDialog.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/RenderersDialog.kt
@@ -19,6 +19,7 @@
*/
package org.videolan.vlc.gui.dialogs
+import android.app.Dialog
import android.content.DialogInterface
import android.os.Bundle
import android.support.v4.app.DialogFragment
@@ -27,6 +28,7 @@ import android.support.v7.widget.LinearLayoutManager
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
+import android.view.Window
import org.videolan.libvlc.RendererItem
import org.videolan.vlc.PlaybackService
import org.videolan.vlc.R
@@ -58,6 +60,15 @@ class RenderersDialog : DialogFragment(), RendererDelegate.RendererListener, Pla
RendererDelegate.removeListener(this)
}
+ override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
+ val inflater = LayoutInflater.from(context)
+ mBinding = DialogRenderersBinding.inflate(inflater, null)
+ val dialog = Dialog(context, R.style.ThemeOverlay_AppCompat_Dialog)
+ dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
+ dialog.setContentView(mBinding.root)
+ return dialog
+ }
+
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
mBinding = DialogRenderersBinding.inflate(inflater, container, false)
return mBinding.root
More information about the Android
mailing list