Set image as wallpaper.

This commit is contained in:
Alex Ning
2020-06-15 14:48:16 +08:00
parent 4d753fc562
commit e8e85b9631
18 changed files with 463 additions and 12 deletions

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,5.69l5,4.5V18h-2v-6H9v6H7v-7.81l5,-4.5M12,3L2,12h3v8h6v-6h2v6h6v-8h3L12,3z"
android:fillColor="#000000"/>
</vector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M17,1.01L7,1c-1.1,0 -2,0.9 -2,2v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3c0,-1.1 -0.9,-1.99 -2,-1.99zM17,19H7V5h10v14z"
android:fillColor="#FFFFFF"/>
</vector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,5.69l5,4.5V18h-2v-6H9v6H7v-7.81l5,-4.5M12,3L2,12h3v8h6v-6h2v6h6v-8h3L12,3z"
android:fillColor="#FFFFFF"/>
</vector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM9,6c0,-1.66 1.34,-3 3,-3s3,1.34 3,3v2L9,8L9,6zM18,20L6,20L6,10h12v10zM12,17c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2z"
android:fillColor="#FFFFFF"/>
</vector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M17,1.01L7,1c-1.1,0 -2,0.9 -2,2v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3c0,-1.1 -0.9,-1.99 -2,-1.99zM17,19H7V5h10v14z"
android:fillColor="#000000"/>
</vector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,5.69l5,4.5V18h-2v-6H9v6H7v-7.81l5,-4.5M12,3L2,12h3v8h6v-6h2v6h6v-8h3L12,3z"
android:fillColor="#000000"/>
</vector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM9,6c0,-1.66 1.34,-3 3,-3s3,1.34 3,3v2L9,8L9,6zM18,20L6,20L6,10h12v10zM12,17c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2z"
android:fillColor="#000000"/>
</vector>

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="8dp"
android:overScrollMode="never">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/home_screen_text_view_set_as_wallpaper_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/set_to_home_screen"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family"
android:drawableStart="@drawable/ic_wallpaper_home_screen_black_24dp"
android:drawablePadding="48dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground"
android:visibility="gone" />
<TextView
android:id="@+id/lock_screen_text_view_set_as_wallpaper_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/set_to_lock_screen"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family"
android:drawableStart="@drawable/ic_wallpaper_lock_screen_black_24dp"
android:drawablePadding="48dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground"
android:visibility="gone" />
<TextView
android:id="@+id/both_text_view_set_as_wallpaper_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/set_to_both"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family"
android:drawableStart="@drawable/ic_wallpaper_both_black_24dp"
android:drawablePadding="48dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View File

@@ -14,4 +14,10 @@
android:title="@string/action_share"
android:icon="@drawable/ic_share_toolbar_white_24dp"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_set_wallpaper_view_image_activity"
android:orderInCategory="3"
android:title="@string/action_set_wallpaper"
app:showAsAction="never" />
</menu>

View File

@@ -14,4 +14,10 @@
android:title="@string/action_share"
android:icon="@drawable/ic_share_toolbar_white_24dp"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_set_wallpaper_view_imgur_image_fragments"
android:orderInCategory="3"
android:title="@string/action_set_wallpaper"
app:showAsAction="never" />
</menu>

View File

@@ -61,6 +61,7 @@
<string name="action_share">Share</string>
<string name="action_preview">Preview</string>
<string name="action_report">Report</string>
<string name="action_set_wallpaper">Set as Wallpaper</string>
<string name="parse_json_response_error">Error occurred when parsing the JSON response</string>
<string name="retrieve_token_error">Error Retrieving the token</string>
@@ -518,8 +519,8 @@
<string name="cannot_save_image">Cannot save the image</string>
<string name="cannot_save_gif">Cannot save the gif</string>
<string name="cannot_get_storage">Cannot access the app storage</string>
<string name="save_image_before_sharing">Saving the image. Please wait.</string>
<string name="save_gif_before_sharing">Saving the gif. Please wait.</string>
<string name="save_image_first">Saving the image. Please wait.</string>
<string name="save_gif_first">Saving the gif. Please wait.</string>
<string name="theme_name_description">Tap to change the name of this theme.</string>
<string name="theme_item_is_light_theme">Set as Light Theme</string>
@@ -763,7 +764,12 @@
<string name="downloading_reddit_video_failed_cannot_save_audio">Download failed: cannot save audio to cache directory</string>
<string name="downloading_reddit_video_failed_cannot_mux">Download failed: cannot mux video and audio</string>
<string name="downloading_reddit_video_failed_cannot_save_mux_video">Download failed: cannot save the video to public directory</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="wallpaper_set">Wallpaper set</string>
<string name="error_set_wallpaper">Cannot set wallpaper</string>
<string name="set_to_home_screen">Set to Home Screen</string>
<string name="set_to_lock_screen">Set to Lock Screen</string>
<string name="set_to_both">Set to Both</string>
</resources>