Added Permission Screen
This commit is contained in:
parent
cc494edbbf
commit
10f56e9e6d
27 changed files with 334 additions and 89 deletions
5
app/src/main/res/drawable/ic_phonelink_ring.xml
Normal file
5
app/src/main/res/drawable/ic_phonelink_ring.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M14,1L4,1c-1.1,0 -2,0.9 -2,2v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2L16,3c0,-1.1 -0.9,-2 -2,-2zM14,20L4,20L4,4h10v16zM20.63,8.26c-0.26,-0.32 -0.74,-0.36 -1.04,-0.06l-0.03,0.03c-0.25,0.25 -0.26,0.65 -0.05,0.93 1.26,1.64 1.25,3.87 -0.02,5.57 -0.21,0.28 -0.19,0.67 0.05,0.92l0.05,0.05c0.29,0.29 0.76,0.26 1.03,-0.05 1.8,-2.13 1.8,-5.19 0.01,-7.39zM17.42,10.37l-0.06,0.06c-0.2,0.2 -0.26,0.5 -0.15,0.76 0.21,0.49 0.21,1.03 0,1.52 -0.11,0.26 -0.05,0.56 0.15,0.76l0.08,0.08c0.32,0.32 0.87,0.25 1.09,-0.15 0.49,-0.89 0.49,-1.94 -0.01,-2.86 -0.22,-0.42 -0.77,-0.5 -1.1,-0.17z"/>
|
||||
</vector>
|
5
app/src/main/res/drawable/ic_sd_storage.xml
Normal file
5
app/src/main/res/drawable/ic_sd_storage.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M18,2h-7.17c-0.53,0 -1.04,0.21 -1.42,0.59L4.6,7.42c-0.37,0.37 -0.6,0.88 -0.6,1.4L4,20c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,4c0,-1.1 -0.9,-2 -2,-2zM11,8c-0.55,0 -1,-0.45 -1,-1L10,5c0,-0.55 0.45,-1 1,-1s1,0.45 1,1v2c0,0.55 -0.45,1 -1,1zM14,8c-0.55,0 -1,-0.45 -1,-1L13,5c0,-0.55 0.45,-1 1,-1s1,0.45 1,1v2c0,0.55 -0.45,1 -1,1zM17,8c-0.55,0 -1,-0.45 -1,-1L16,5c0,-0.55 0.45,-1 1,-1s1,0.45 1,1v2c0,0.55 -0.45,1 -1,1z"/>
|
||||
</vector>
|
72
app/src/main/res/layout/activity_permission.xml
Normal file
72
app/src/main/res/layout/activity_permission.xml
Normal file
|
@ -0,0 +1,72 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorSurface">
|
||||
|
||||
<code.name.monkey.retromusic.views.BaselineGridTextView
|
||||
android:id="@+id/appNameText"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="32dp"
|
||||
android:text="@string/app_name"
|
||||
android:textAppearance="@style/TextViewHeadline5"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:lineHeightHint="32sp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dividerHorizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/appNameText" />
|
||||
|
||||
<code.name.monkey.retromusic.views.PermissionItem
|
||||
android:id="@+id/storagePermission"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/divider"
|
||||
app:permissionButtonTitle="Grant access"
|
||||
app:permissionIcon="@drawable/ic_sd_storage"
|
||||
app:permissionTitle="Storage Access"
|
||||
app:permissionTitleNumber="1"
|
||||
app:permissionTitleSubTitle="The app needs permission to access your device storage for music files playing music" />
|
||||
|
||||
<code.name.monkey.retromusic.views.PermissionItem
|
||||
android:id="@+id/audioPermission"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/storagePermission"
|
||||
app:permissionButtonTitle="Grant access"
|
||||
app:permissionIcon="@drawable/ic_phonelink_ring"
|
||||
app:permissionTitle="Ringtone"
|
||||
app:permissionTitleNumber="2"
|
||||
app:permissionTitleSubTitle="The app needs permission to access your device settings in order to set music as Ringtone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/finish"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:paddingVertical="12dp"
|
||||
android:text="Let's go"
|
||||
android:textAppearance="@style/TextViewButton"
|
||||
app:cornerRadius="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
77
app/src/main/res/layout/item_permission.xml
Normal file
77
app/src/main/res/layout/item_permission.xml
Normal file
|
@ -0,0 +1,77 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/rectSelector"
|
||||
android:minHeight="?attr/listPreferredItemHeight"
|
||||
android:paddingStart="?attr/listPreferredItemPaddingStart"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="?attr/listPreferredItemPaddingEnd"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/number"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:background="@drawable/color_circle_gradient"
|
||||
android:gravity="center"
|
||||
android:maxLines="3"
|
||||
tools:text="1"
|
||||
android:textAppearance="@style/TextViewButton"
|
||||
app:layout_constraintBottom_toBottomOf="@id/title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/title" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextViewSubtitle1"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline_front_margin"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:maxLines="@string/grid_size_1"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<code.name.monkey.retromusic.views.BaselineGridTextView
|
||||
android:id="@+id/summary"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:textAppearance="@style/TextViewNormal"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline_front_margin"
|
||||
app:layout_constraintTop_toBottomOf="@id/title"
|
||||
tools:maxLines="2"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
app:cornerRadius="8dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="10dp"
|
||||
android:textAppearance="@style/TextViewButton"
|
||||
app:icon="@drawable/ic_history"
|
||||
app:iconGravity="start"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/guideline_front_margin"
|
||||
app:layout_constraintTop_toBottomOf="@id/summary"
|
||||
tools:text="@tools:sample/full_names" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_front_margin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_begin="@dimen/list_pref_guideline_begin" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -71,5 +71,9 @@
|
|||
android:name="code.name.monkey.retromusic.activities.SettingsActivity"
|
||||
android:label="SettingsActivity" />
|
||||
|
||||
|
||||
<activity
|
||||
android:id="@+id/permissionFragment"
|
||||
android:name="code.name.monkey.retromusic.activities.PermissionActivity"
|
||||
android:label="PermissionFragment"
|
||||
tools:layout="@layout/activity_permission" />
|
||||
</navigation>
|
|
@ -20,5 +20,5 @@
|
|||
<string name="app_shortcut_shuffle_all_long" translatable="false">@string/action_shuffle_all</string>
|
||||
<string name="app_shortcut_top_tracks_long" translatable="false">@string/my_top_tracks</string>
|
||||
|
||||
<string name="empty_text_emoji" translatable="false">🤔</string>
|
||||
<string name="empty_text_emoji" translatable="false">😱</string>
|
||||
</resources>
|
10
app/src/main/res/values/permission_item.xml
Normal file
10
app/src/main/res/values/permission_item.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<declare-styleable name="PermissionItem">
|
||||
<attr name="permissionTitle" format="string" />
|
||||
<attr name="permissionTitleSubTitle" format="string" />
|
||||
<attr name="permissionTitleNumber" format="string" />
|
||||
<attr name="permissionIcon" format="integer" />
|
||||
<attr name="permissionButtonTitle" format="string" />
|
||||
</declare-styleable>
|
||||
</resources>
|
|
@ -3,7 +3,7 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:defaultValue="true"
|
||||
android:key="ignore_media_store_artwork"
|
||||
android:layout="@layout/list_item_view_switch"
|
||||
android:summary="@string/pref_summary_ignore_media_store_artwork"
|
||||
|
@ -11,7 +11,7 @@
|
|||
app:icon="@drawable/ic_image" />
|
||||
|
||||
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEListPreference
|
||||
android:defaultValue="only_wifi"
|
||||
android:defaultValue="always"
|
||||
android:entries="@array/pref_auto_download_images_titles"
|
||||
android:entryValues="@array/pref_auto_download_images_values"
|
||||
android:key="auto_download_images_policy"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue