Added Bluetooth connect permission and better UX for permissions

This commit is contained in:
Prathamesh More 2022-05-13 12:57:34 +05:30
parent 33bbc0d07e
commit c8dbb0a0fd
11 changed files with 121 additions and 35 deletions

View file

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
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="M6,13c0.55,-0.55 0.55,-1.44 0,-1.99L6,11c-0.55,-0.55 -1.45,-0.55 -2,0s-0.55,1.45 0,2 1.45,0.55 2,0zM20,11c-0.56,-0.56 -1.45,-0.56 -2,-0.01L18,11c-0.55,0.55 -0.55,1.44 0,1.99L18,13c0.55,0.55 1.44,0.55 1.99,0L20,13c0.55,-0.55 0.55,-1.45 0,-2zM17,7l-4.29,-4.29c-0.63,-0.63 -1.71,-0.19 -1.71,0.7v6.18L7.11,5.7c-0.39,-0.39 -1.02,-0.39 -1.41,0 -0.39,0.39 -0.39,1.02 0,1.41L10.59,12 5.7,16.89c-0.39,0.39 -0.39,1.02 0,1.41 0.39,0.39 1.02,0.39 1.41,0L11,14.41v6.18c0,0.89 1.08,1.34 1.71,0.71L17,17c0.39,-0.39 0.39,-1.02 0,-1.42L13.41,12 17,8.42c0.39,-0.39 0.39,-1.03 0,-1.42zM14.88,16.29L13,18.17v-3.76l1.88,1.88zM13,9.59L13,5.83l1.88,1.88L13,9.59z"/>
</vector>

View file

@ -43,26 +43,39 @@
android:orientation="@integer/permission_orientation">
<code.name.monkey.retromusic.views.PermissionItem
android:id="@+id/storagePermission"
android:id="@+id/storage_permission"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="@integer/permission_layout_weight"
app:permissionButtonTitle="Grant access"
app:permissionButtonTitle="@string/grant_access"
app:permissionIcon="@drawable/ic_sd_storage"
app:permissionTitle="@string/permission_title"
app:permissionTitleNumber="1"
app:permissionTitleSubTitle="@string/permission_summary" />
<code.name.monkey.retromusic.views.PermissionItem
android:id="@+id/audioPermission"
android:id="@+id/bluetooth_permission"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_weight="@integer/permission_layout_weight"
app:permissionButtonTitle="Grant access"
android:visibility="gone"
app:permissionButtonTitle="@string/grant_access"
app:permissionIcon="@drawable/ic_bluetooth_connect"
app:permissionTitle="@string/bluetooth_title"
app:permissionTitleNumber="2"
app:permissionTitleSubTitle="@string/bluetooth_summary"
tools:visibility="visible" />
<code.name.monkey.retromusic.views.PermissionItem
android:id="@+id/audio_permission"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="@integer/permission_layout_weight"
android:visibility="gone"
app:permissionButtonTitle="@string/grant_access"
app:permissionIcon="@drawable/ic_phonelink_ring"
app:permissionTitle="@string/ringtone_title"
app:permissionTitleNumber="2"
app:permissionTitleNumber="3"
app:permissionTitleSubTitle="@string/ringtone_summary"
tools:visibility="visible" />
</LinearLayout>
@ -76,7 +89,7 @@
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:paddingVertical="12dp"
android:text="Let's go"
android:text="@string/lets_go"
android:textAppearance="@style/TextViewButton"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View file

@ -1,10 +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="permissionTitle" format="string" localization="suggested" />
<attr name="permissionTitleSubTitle" format="string" localization="suggested" />
<attr name="permissionTitleNumber" format="string" />
<attr name="permissionIcon" format="integer" />
<attr name="permissionButtonTitle" format="string" />
<attr name="permissionIcon" format="reference" />
<attr name="permissionButtonTitle" format="string" localization="suggested" />
</declare-styleable>
</resources>

View file

@ -93,6 +93,7 @@
<string name="biography">Biography</string>
<string name="black_theme_name">Just Black</string>
<string name="blacklist">Blacklist</string>
<string name="bluetooth_summary">The app needs nearby devices permission to check for bluetooth devices</string>
<string name="blur">Blur</string>
<string name="blur_card">Blur Card</string>
<string name="bug_report_failed">Unable to send report</string>
@ -196,6 +197,7 @@
<string name="genres">Genres</string>
<string name="git_hub_summary">Fork the project on GitHub</string>
<string name="gradient">Gradient</string>
<string name="grant_access">Grant access</string>
<string name="grid_size_1">1</string>
<string name="grid_size_2">2</string>
<string name="grid_size_3">3</string>
@ -234,6 +236,7 @@
<string name="labeled">Labeled</string>
<string name="last_added">Last added</string>
<string name="last_song">Last song</string>
<string name="lets_go">Let\'s go</string>
<string name="library_categories">Library categories</string>
<string name="licenses">Licenses</string>
<string name="light_theme_name">Clearly White</string>
@ -293,6 +296,7 @@
<string name="paste_lyrics_here">Paste Lyrics Here</string>
<string name="paste_timeframe_lyrics_here">Paste timeframe lyrics here</string>
<string name="peek">Peek</string>
<string name="permission_bluetooth_denied">Nearby devices permission denied.</string>
<string name="permission_external_storage_denied">Permission to access external storage denied.</string>
<string name="permission_summary">The app needs permission to access your device storage for playing music</string>
<string name="permission_title">Storage Access</string>
@ -362,6 +366,7 @@
<string name="pref_summary_show_lyrics">Display synced lyrics over album cover</string>
<string name="pref_summary_suggestions">Show New Music Mix on homescreen</string>
<string name="pref_summary_swipe_anywhere_now_playing">Enables changing song by swiping anywhere on the now playing screen</string>
<string name="pref_summary_swipe_to_dismiss">Swipe down to dismiss mini player</string>
<string name="pref_summary_toggle_full_screen">Immersive mode</string>
<string name="pref_summary_toggle_headset">Start playing immediately after headphones are connected</string>
<string name="pref_summary_toggle_shuffle">Shuffle mode will turn off when playing a new list of songs</string>
@ -408,6 +413,7 @@
<string name="pref_title_show_lyrics">Show lyrics</string>
<string name="pref_title_suggestions">Show suggestions</string>
<string name="pref_title_swipe_anywhere_now_playing">Swipe anywhere to change song</string>
<string name="pref_title_swipe_to_dismiss">Dismiss with swipe down</string>
<string name="pref_title_tab_text_mode">Tab titles mode</string>
<string name="pref_title_toggle_carousel_effect">Carousel effect</string>
<string name="pref_title_toggle_full_screen">Fullscreen app</string>
@ -553,6 +559,5 @@
<string name="you_have_to_select_at_least_one_category">You have to select at least one category.</string>
<string name="you_will_be_forwarded_to_the_issue_tracker_website">You will be forwarded to the issue tracker website.</string>
<string name="your_account_data_is_only_used_for_authentication">Your account data is only used for authentication.</string>
<string name="pref_summary_swipe_to_dismiss">Swipe down to dismiss mini player</string>
<string name="pref_title_swipe_to_dismiss">Dismiss with swipe down</string>
<string name="bluetooth_title">Nearby devices</string>
</resources>