Skip to content

Commit

Permalink
DocumentUI: Fix extra shortcuts
Browse files Browse the repository at this point in the history
- Fix Videos shortcut.
- Disable Documents shortcut as it does not work.
  • Loading branch information
BAProductions committed Oct 2, 2022
1 parent d7adca5 commit aee9183
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 14 deletions.
22 changes: 22 additions & 0 deletions res/drawable/ic_downloads_shortcut.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2017 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/shortcut_background" />
<foreground android:drawable="@drawable/ic_root_download"/>
</adaptive-icon>

3 changes: 3 additions & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@

<!-- Shortcut label of Documents root folder -->
<string name="documents_shortcut_label">Documents</string>

<!-- Shortcut label of Downloads root folder -->
<string name="downloads_shortcut_label">@string/downloads_label</string>

<!-- Error message shown when an archive fails to load -->
<string name="archive_loading_failed">Unable to open archive for browsing. File is either corrupt, or an unsupported format.</string>
Expand Down
2 changes: 1 addition & 1 deletion res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<item name="backgroundInsetBottom">12dp</item>
</style>

<style name="MaterialAlertDialogTheme" parent="@style/ThemeOverlay.MaterialComponents.MaterialAlertDialog.Centered">
<style name="MaterialAlertDialogTheme" parent="@style/ThemeOverlay.MaterialComponents.MaterialAlertDialog">
<item name="android:dialogCornerRadius">@dimen/grid_item_radius</item>
<item name="alertDialogStyle">@style/MaterialAlertDialogStyle</item>
<item name="buttonBarPositiveButtonStyle">@style/PositiveButtonStyle</item>
Expand Down
35 changes: 22 additions & 13 deletions res/xml/shortcuts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,37 @@
android:action="android.intent.action.VIEW"
android:data="content://com.android.providers.media.documents/root/images_root" />
</shortcut>
<shortcut
android:shortcutId="content://com.android.providers.media.documents/root/video_root"
<shortcut
android:shortcutId="content://com.android.providers.media.documents/root/videos_root"
android:icon="@drawable/ic_videos_shortcut"
android:shortcutShortLabel="@string/vidoes_shortcut_label" >
<intent
android:action="android.intent.action.VIEW"
android:data="content://com.android.providers.media.documents/root/video_root" />
android:data="content://com.android.providers.media.documents/root/videos_root" />
</shortcut>
<shortcut
<shortcut
android:shortcutId="content://com.android.providers.media.documents/root/audio_root"
android:icon="@drawable/ic_audios_shortcut"
android:shortcutShortLabel="@string/audios_shortcut_label" >
<intent
android:action="android.intent.action.VIEW"
android:data="content://com.android.providers.media.documents/root/audio_root" />
</shortcut>
<shortcut
android:shortcutId="content://com.android.providers.media.documents/root/documents_root"
android:icon="@drawable/ic_folder_shortcut"
android:shortcutShortLabel="@string/documents_shortcut_label" >
<intent
android:action="android.intent.action.VIEW"
android:data="content://com.android.providers.media.documents/root/documents_root" />
</shortcut>
</shortcuts>
<!-- TODO: FIX downloads & documents shortct-->
<!-- <shortcut-->
<!-- android:shortcutId="content://com.android.providers.downloads.documents/document/downloads"-->
<!-- android:icon="@drawable/ic_downloads_shortcut"-->
<!-- android:shortcutShortLabel="@string/downloads_shortcut_label" >-->
<!-- <intent-->
<!-- android:action="android.intent.action.VIEW"-->
<!-- android:data="content://com.android.providers.downloads.documents/document/downloads" />-->
<!-- </shortcut>-->
<!-- <shortcut-->
<!-- android:shortcutId="content://com.android.providers.media.documents/root/documents_root"-->
<!-- android:icon="@drawable/ic_folder_shortcut"-->
<!-- android:shortcutShortLabel="@string/documents_shortcut_label" >-->
<!-- <intent-->
<!-- android:action="android.intent.action.VIEW"-->
<!-- android:data="content://com.android.providers.media.documents/root/documents_root" />-->
<!-- </shortcut>-->
</shortcuts>

0 comments on commit aee9183

Please sign in to comment.