Browse Source

Improve the permission dialog UI

merge-requests/1594/merge
Nicolas Pomepuy 1 year ago
parent
commit
d479e5e540
  1. 6
      application/resources/assets/images/svg/ic_permission_media_audio.svg
  2. 6
      application/resources/assets/images/svg/ic_permission_media_video.svg
  3. 30
      application/resources/src/main/res/drawable/ic_permission_media_audio.xml
  4. 48
      application/resources/src/main/res/drawable/ic_permission_media_audio_denied.xml
  5. 6
      application/resources/src/main/res/drawable/ic_permission_media_video.xml
  6. 37
      application/resources/src/main/res/drawable/ic_permission_media_video_denied.xml
  7. 6
      application/vlc-android/res/layout/dialog_permissions.xml
  8. 4
      application/vlc-android/src/org/videolan/vlc/gui/dialogs/PermissionListDialog.kt

6
application/resources/assets/images/svg/ic_permission_media_audio.svg

@ -30,7 +30,7 @@
inkscape:window-width="2560"
inkscape:window-height="1376"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="layer1">
<inkscape:grid
@ -237,8 +237,8 @@
</g>
<path
id="path3110"
style="color:#000000;overflow:visible;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.12898;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
d="M 18.13387,6.25 C 16.950081,6.26792 15.999865,7.232741 16,8.416667 v 2.166666 7.080811 c -0.658725,-0.380418 -1.405985,-0.580733 -2.166667,-0.580811 -2.393234,0 -4.333333,1.9401 -4.333333,4.333334 0,2.393234 1.940099,4.333333 4.333333,4.333333 2.393234,0 4.333334,-1.940099 4.333334,-4.333333 V 10.583333 H 20.36613 C 21.549919,10.565413 22.500135,9.600592 22.5,8.416667 V 6.25 Z m -4.333333,13 c 0.01093,-8.3e-5 0.02187,-8.3e-5 0.0328,0 1.196617,0 2.166667,0.97005 2.166667,2.166667 0,1.196617 -0.97005,2.166666 -2.166667,2.166666 -1.196617,0 -2.166667,-0.970049 -2.166667,-2.166666 -1.35e-4,-1.183926 0.950081,-2.148746 2.133871,-2.166667 z"
style="color:#000000;overflow:visible;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.85603;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
d="M 17.860297,7.5 C 16.828275,7.515623 15.999882,8.3567486 16,9.3888892 v 1.8888878 6.173015 c -0.574273,-0.331646 -1.225731,-0.50628 -1.88889,-0.506348 -2.086409,0 -3.777777,1.691369 -3.777777,3.777779 0,2.086409 1.691368,3.777777 3.777777,3.777777 2.08641,0 3.777779,-1.691368 3.777779,-3.777777 v -9.444446 h 1.91748 c 1.032022,-0.01562 1.860415,-0.856748 1.860297,-1.8888878 V 7.5 Z m -3.777778,11.333333 c 0.0095,-7.2e-5 0.01907,-7.2e-5 0.02859,0 1.043205,0 1.888889,0.845685 1.888889,1.88889 0,1.043204 -0.845684,1.888888 -1.888889,1.888888 -1.043205,0 -1.888889,-0.845684 -1.888889,-1.888888 -1.18e-4,-1.032141 0.828276,-1.873266 1.860298,-1.88889 z"
sodipodi:nodetypes="cccccssscccccscsscss" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

6
application/resources/assets/images/svg/ic_permission_media_video.svg

@ -30,7 +30,7 @@
inkscape:window-width="2560"
inkscape:window-height="1376"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="layer1">
<inkscape:grid
@ -217,8 +217,8 @@
r="14" />
<path
id="path46413"
style="color:#000000;fill:#000000;stroke-linecap:round;stroke-linejoin:round;-inkscape-stroke:none"
d="m 11,11 c -0.825,0 -1.5,0.675 -1.5,1.5 v 7 c 0,0.825 0.675,1.5 1.5,1.5 h 10 c 0.825,0 1.5,-0.675 1.5,-1.5 V 11.75 C 22.5,11.3375 22.1625,11 21.75,11 H 20 l 0.820312,1.638672 c 0.082,0.1657 -0.03806,0.360428 -0.222656,0.361328 h -0.980468 c -0.379001,0 -0.725132,-0.214034 -0.894532,-0.552734 L 18,11 h -1 l 0.820312,1.638672 c 0.082,0.1657 -0.03806,0.360428 -0.222656,0.361328 h -0.980468 c -0.379001,0 -0.725132,-0.214034 -0.894532,-0.552734 L 15,11 h -1 l 0.820312,1.638672 c 0.082,0.1657 -0.03806,0.360428 -0.222656,0.361328 h -0.980468 c -0.379,0 -0.725132,-0.214034 -0.894532,-0.552734 L 12,11 Z m 0.5,2 0.722656,1.447266 C 12.392056,14.785966 12.738287,15 13.117188,15 H 13.5 h 7 v 4 h -9 z"
style="color:#000000;fill:#000000;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;-inkscape-stroke:none"
d="m 10,10 c -0.99,0 -1.8,0.81 -1.8,1.8 v 8.4 c 0,0.99 0.81,1.8 1.8,1.8 h 12 c 0.99,0 1.8,-0.81 1.8,-1.8 V 10.9 C 23.8,10.405 23.395,10 22.9,10 h -2.1 l 0.984374,1.966406 c 0.0984,0.19884 -0.04567,0.432514 -0.267187,0.433594 h -1.176561 c -0.454802,0 -0.870159,-0.256841 -1.073439,-0.663281 L 18.4,10 h -1.2 l 0.984374,1.966406 c 0.0984,0.19884 -0.04567,0.432514 -0.267187,0.433594 h -1.176561 c -0.454802,0 -0.870159,-0.256841 -1.073439,-0.663281 L 14.8,10 h -1.2 l 0.984374,1.966406 c 0.0984,0.19884 -0.04567,0.432514 -0.267187,0.433594 h -1.176561 c -0.4548,0 -0.870159,-0.256841 -1.073439,-0.663281 L 11.2,10 Z m 0.6,2.4 0.867187,1.736719 C 11.670467,14.543159 12.085944,14.8 12.540626,14.8 H 13 21.4 v 4.8 H 10.6 Z"
sodipodi:nodetypes="sssssssscccscccccscccccsccsccsccccc" />
<g
id="g3158"

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

30
application/resources/src/main/res/drawable/ic_permission_media_audio.xml

@ -1,31 +1,7 @@
<!--
~ *************************************************************************
~ ic_permission_media_audio.xml
~ **************************************************************************
~ Copyright © 2024 VLC authors and VideoLAN
~ Author: Nicolas POMEPUY
~ This program is free software; you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation; either version 2 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program; if not, write to the Free Software
~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
~ ***************************************************************************
~
~
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="32dp"
android:height="32dp"
android:width="42dp"
android:height="42dp"
android:viewportWidth="32"
android:viewportHeight="32">
<path
@ -47,7 +23,7 @@
android:fillType="nonZero"
android:strokeLineCap="round"/>
<path
android:pathData="M18.134,6.25C16.95,6.268 16,7.233 16,8.417v2.167,7.081c-0.659,-0.38 -1.406,-0.581 -2.167,-0.581 -2.393,0 -4.333,1.94 -4.333,4.333 0,2.393 1.94,4.333 4.333,4.333 2.393,0 4.333,-1.94 4.333,-4.333L18.167,10.583L20.366,10.583C21.55,10.565 22.5,9.601 22.5,8.417L22.5,6.25ZM13.801,19.25c0.011,-0 0.022,-0 0.033,0 1.197,0 2.167,0.97 2.167,2.167 0,1.197 -0.97,2.167 -2.167,2.167 -1.197,0 -2.167,-0.97 -2.167,-2.167 -0,-1.184 0.95,-2.149 2.134,-2.167z"
android:pathData="M17.86,7.5C16.828,7.516 16,8.357 16,9.389v1.889,6.173c-0.574,-0.332 -1.226,-0.506 -1.889,-0.506 -2.086,0 -3.778,1.691 -3.778,3.778 0,2.086 1.691,3.778 3.778,3.778 2.086,0 3.778,-1.691 3.778,-3.778v-9.444h1.917c1.032,-0.016 1.86,-0.857 1.86,-1.889L21.667,7.5ZM14.083,18.833c0.009,-0 0.019,-0 0.029,0 1.043,0 1.889,0.846 1.889,1.889 0,1.043 -0.846,1.889 -1.889,1.889 -1.043,0 -1.889,-0.846 -1.889,-1.889 -0,-1.032 0.828,-1.873 1.86,-1.889z"
android:strokeLineJoin="round"
android:strokeWidth="2.12898"
android:fillColor="@color/white"

48
application/resources/src/main/res/drawable/ic_permission_media_audio_denied.xml

@ -1,53 +1,15 @@
<!--
~ *************************************************************************
~ ic_permission_media_audio.xml
~ **************************************************************************
~ Copyright © 2024 VLC authors and VideoLAN
~ Author: Nicolas POMEPUY
~ This program is free software; you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation; either version 2 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program; if not, write to the Free Software
~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
~ ***************************************************************************
~
~
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:width="42dp"
android:height="42dp"
android:viewportWidth="32"
android:viewportHeight="32">
<path
android:fillColor="@color/grey400"
android:fillColor="?attr/font_disabled"
android:pathData="M16,16m-14,0a14,14 0,1 1,28 0a14,14 0,1 1,-28 0"
android:strokeWidth="0.294741" />
<path
android:fillColor="@color/grey300"
android:fillType="nonZero"
android:pathData="M25,25m-6,0a6,6 135,1 1,12 0a6,6 135,1 1,-12 0"
android:strokeWidth="0.141"
android:strokeColor="#00000000" />
<path
android:fillColor="@color/white"
android:fillType="nonZero"
android:pathData="m24.143,27.572 l4.723,-4.723 -0.606,-0.606 -4.117,4.117 -1.818,-1.818 -0.606,0.606z"
android:strokeWidth="2.492"
android:strokeColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:fillColor="@color/white"
android:pathData="M18.134,6.25C16.95,6.268 16,7.233 16,8.417v2.167,7.081c-0.659,-0.38 -1.406,-0.581 -2.167,-0.581 -2.393,0 -4.333,1.94 -4.333,4.333 0,2.393 1.94,4.333 4.333,4.333 2.393,0 4.333,-1.94 4.333,-4.333L18.167,10.583L20.366,10.583C21.55,10.565 22.5,9.601 22.5,8.417L22.5,6.25ZM13.801,19.25c0.011,-0 0.022,-0 0.033,0 1.197,0 2.167,0.97 2.167,2.167 0,1.197 -0.97,2.167 -2.167,2.167 -1.197,0 -2.167,-0.97 -2.167,-2.167 -0,-1.184 0.95,-2.149 2.134,-2.167z"
android:fillColor="?attr/background_default_darker"
android:pathData="M17.86,7.5C16.828,7.516 16,8.357 16,9.389v1.889,6.173c-0.574,-0.332 -1.226,-0.506 -1.889,-0.506 -2.086,0 -3.778,1.691 -3.778,3.778 0,2.086 1.691,3.778 3.778,3.778 2.086,0 3.778,-1.691 3.778,-3.778v-9.444h1.917c1.032,-0.016 1.86,-0.857 1.86,-1.889L21.667,7.5ZM14.083,18.833c0.009,-0 0.019,-0 0.029,0 1.043,0 1.889,0.846 1.889,1.889 0,1.043 -0.846,1.889 -1.889,1.889 -1.043,0 -1.889,-0.846 -1.889,-1.889 -0,-1.032 0.828,-1.873 1.86,-1.889z"
android:strokeWidth="2.12898"
android:strokeColor="#00000000"
android:strokeLineCap="butt"

6
application/resources/src/main/res/drawable/ic_permission_media_video.xml

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="32dp"
android:height="32dp"
android:width="42dp"
android:height="42dp"
android:viewportWidth="32"
android:viewportHeight="32">
<path
@ -9,7 +9,7 @@
android:strokeWidth="0.294741"
android:fillColor="@color/grey600"/>
<path
android:pathData="m11,11c-0.825,0 -1.5,0.675 -1.5,1.5v7c0,0.825 0.675,1.5 1.5,1.5h10c0.825,0 1.5,-0.675 1.5,-1.5L22.5,11.75C22.5,11.337 22.163,11 21.75,11L20,11l0.82,1.639c0.082,0.166 -0.038,0.36 -0.223,0.361h-0.98c-0.379,0 -0.725,-0.214 -0.895,-0.553L18,11h-1l0.82,1.639c0.082,0.166 -0.038,0.36 -0.223,0.361h-0.98c-0.379,0 -0.725,-0.214 -0.895,-0.553L15,11h-1l0.82,1.639c0.082,0.166 -0.038,0.36 -0.223,0.361h-0.98c-0.379,0 -0.725,-0.214 -0.895,-0.553L12,11ZM11.5,13 L12.223,14.447C12.392,14.786 12.738,15 13.117,15L13.5,15h7v4h-9z"
android:pathData="m10,10c-0.99,0 -1.8,0.81 -1.8,1.8v8.4c0,0.99 0.81,1.8 1.8,1.8h12c0.99,0 1.8,-0.81 1.8,-1.8L23.8,10.9C23.8,10.405 23.395,10 22.9,10h-2.1l0.984,1.966c0.098,0.199 -0.046,0.433 -0.267,0.434h-1.177c-0.455,0 -0.87,-0.257 -1.073,-0.663L18.4,10h-1.2l0.984,1.966c0.098,0.199 -0.046,0.433 -0.267,0.434h-1.177c-0.455,0 -0.87,-0.257 -1.073,-0.663L14.8,10h-1.2l0.984,1.966c0.098,0.199 -0.046,0.433 -0.267,0.434h-1.177c-0.455,0 -0.87,-0.257 -1.073,-0.663L11.2,10ZM10.6,12.4 L11.467,14.137C11.67,14.543 12.086,14.8 12.541,14.8L13,14.8 21.4,14.8v4.8L10.6,19.6Z"
android:strokeLineJoin="round"
android:fillColor="@color/white"
android:strokeLineCap="round"/>

37
application/resources/src/main/res/drawable/ic_permission_media_video_denied.xml

@ -1,30 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="32dp"
android:height="32dp"
android:width="42dp"
android:height="42dp"
android:viewportWidth="32"
android:viewportHeight="32">
<path
android:pathData="M16,16m-14,0a14,14 0,1 1,28 0a14,14 0,1 1,-28 0"
android:strokeWidth="0.294741"
android:fillColor="@color/grey400"/>
<path
android:pathData="m11,11c-0.825,0 -1.5,0.675 -1.5,1.5v7c0,0.825 0.675,1.5 1.5,1.5h10c0.825,0 1.5,-0.675 1.5,-1.5L22.5,11.75C22.5,11.337 22.163,11 21.75,11L20,11l0.82,1.639c0.082,0.166 -0.038,0.36 -0.223,0.361h-0.98c-0.379,0 -0.725,-0.214 -0.895,-0.553L18,11h-1l0.82,1.639c0.082,0.166 -0.038,0.36 -0.223,0.361h-0.98c-0.379,0 -0.725,-0.214 -0.895,-0.553L15,11h-1l0.82,1.639c0.082,0.166 -0.038,0.36 -0.223,0.361h-0.98c-0.379,0 -0.725,-0.214 -0.895,-0.553L12,11ZM11.5,13 L12.223,14.447C12.392,14.786 12.738,15 13.117,15L13.5,15h7v4h-9z"
android:strokeLineJoin="round"
android:fillColor="@color/white"
android:strokeLineCap="round"/>
<path
android:pathData="M25,25m-6,0a6,6 135,1 1,12 0a6,6 135,1 1,-12 0"
android:strokeWidth="0.141"
android:fillColor="@color/grey300"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m24.143,27.572 l4.723,-4.723 -0.606,-0.606 -4.117,4.117 -1.818,-1.818 -0.606,0.606z"
android:strokeLineJoin="round"
android:strokeWidth="2.492"
android:fillColor="#fafafa"
android:strokeColor="#00000000"
android:fillType="nonZero"
android:strokeLineCap="round"/>
<path
android:fillColor="?attr/font_disabled"
android:pathData="M16,16m-14,0a14,14 0,1 1,28 0a14,14 0,1 1,-28 0"
android:strokeWidth="0.294741" />
<path
android:fillColor="?attr/background_default_darker"
android:pathData="m10,10c-0.99,0 -1.8,0.81 -1.8,1.8v8.4c0,0.99 0.81,1.8 1.8,1.8h12c0.99,0 1.8,-0.81 1.8,-1.8L23.8,10.9C23.8,10.405 23.395,10 22.9,10h-2.1l0.984,1.966c0.098,0.199 -0.046,0.433 -0.267,0.434h-1.177c-0.455,0 -0.87,-0.257 -1.073,-0.663L18.4,10h-1.2l0.984,1.966c0.098,0.199 -0.046,0.433 -0.267,0.434h-1.177c-0.455,0 -0.87,-0.257 -1.073,-0.663L14.8,10h-1.2l0.984,1.966c0.098,0.199 -0.046,0.433 -0.267,0.434h-1.177c-0.455,0 -0.87,-0.257 -1.073,-0.663L11.2,10ZM10.6,12.4 L11.467,14.137C11.67,14.543 12.086,14.8 12.541,14.8L13,14.8 21.4,14.8v4.8L10.6,19.6Z"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

6
application/vlc-android/res/layout/dialog_permissions.xml

@ -171,6 +171,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:enabled="true"
@ -188,7 +189,6 @@
android:id="@+id/manage_media_audio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:background="?attr/selectableItemBackgroundBorderless"
app:layout_constraintBottom_toBottomOf="@+id/manage_media_perms_check"
app:layout_constraintEnd_toStartOf="@+id/manage_media_video"
@ -201,7 +201,8 @@
android:id="@+id/manage_media_video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="16dp"
android:background="?attr/selectableItemBackgroundBorderless"
app:layout_constraintBottom_toBottomOf="@+id/manage_media_perms_check"
app:layout_constraintEnd_toEndOf="parent"
@ -216,6 +217,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:enabled="true"

4
application/vlc-android/src/org/videolan/vlc/gui/dialogs/PermissionListDialog.kt

@ -155,10 +155,6 @@ class PermissionListDialog : VLCBottomSheetDialogFragment() {
binding.manageMediaVideo.isEnabled = !Permissions.hasAllAccess(requireActivity()) && !Permissions.hasVideoPermission(requireActivity())
binding.manageMediaAudio.isEnabled = !Permissions.hasAllAccess(requireActivity()) && !Permissions.hasAudioPermission(requireActivity())
//backgrounds
binding.manageMediaPermsCheck.setBackgroundResource(defaultBackground)
// explanation text state
binding.fileAccessExplanation.text = when {
Permissions.hasAllAccess(requireActivity()) -> getString(R.string.permission_onboarding_perm_all)

Loading…
Cancel
Save