aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-07-02 15:16:18 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-07-02 15:16:18 +0000
commite3578c59dd7cb65c3d78a1bd219d05577472a0b6 (patch)
treea7bb0b3a04035d210fd6f38c80feafc39288b41c /app/src/main/res
parent992cf0dda12f16f19baec2f7ec6197da314a9096 (diff)
downloadinfinity-for-reddit-e3578c59dd7cb65c3d78a1bd219d05577472a0b6.tar
infinity-for-reddit-e3578c59dd7cb65c3d78a1bd219d05577472a0b6.tar.gz
infinity-for-reddit-e3578c59dd7cb65c3d78a1bd219d05577472a0b6.tar.bz2
infinity-for-reddit-e3578c59dd7cb65c3d78a1bd219d05577472a0b6.tar.lz
infinity-for-reddit-e3578c59dd7cb65c3d78a1bd219d05577472a0b6.tar.xz
infinity-for-reddit-e3578c59dd7cb65c3d78a1bd219d05577472a0b6.tar.zst
infinity-for-reddit-e3578c59dd7cb65c3d78a1bd219d05577472a0b6.zip
Save light, dark and amoled Material You themes to database. Add 'Apply Material You' option. Test MotionLayout.
Diffstat (limited to 'app/src/main/res')
-rw-r--r--app/src/main/res/layout/activity_motion_test.xml17
-rw-r--r--app/src/main/res/values/strings.xml3
-rw-r--r--app/src/main/res/xml/activity_motion_test_scene.xml45
-rw-r--r--app/src/main/res/xml/item_post_with_preview_scene.xml26
-rw-r--r--app/src/main/res/xml/theme_preferences.xml17
5 files changed, 105 insertions, 3 deletions
diff --git a/app/src/main/res/layout/activity_motion_test.xml b/app/src/main/res/layout/activity_motion_test.xml
new file mode 100644
index 00000000..c65afba9
--- /dev/null
+++ b/app/src/main/res/layout/activity_motion_test.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ml.docilealligator.infinityforreddit.customviews.ClickableMotionLayout 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:id="@+id/motion_layout"
+ tools:context=".activities.MotionTestActivity"
+ app:layoutDescription="@xml/activity_motion_test_scene">
+
+ <View
+ android:id="@+id/button"
+ android:background="@color/colorAccent"
+ android:layout_width="64dp"
+ android:layout_height="64dp" />
+
+</ml.docilealligator.infinityforreddit.customviews.ClickableMotionLayout> \ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index ac7f028e..f657e724 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -458,8 +458,11 @@
<string name="settings_customize_amoled_theme_title">Amoled Theme</string>
<string name="settings_manage_themes_title">Manage Themes</string>
<string name="settings_category_material_you_title">Material You</string>
+ <string name="settings_enable_material_you_warning_summary">Make sure you don\'t have themes named\n\"Material You\",\n\"Material You Dark\" or\n\"Material You Amoled\".\nOtherwise, rename them before enabling Material You.</string>
<string name="settings_enable_material_you_title">Enable Material You</string>
<string name="settings_enable_material_you_summary">Personalize Infinity based on Your Wallpaper</string>
+ <string name="settings_apply_material_you_title">Apply Material You</string>
+ <string name="settings_apply_material_you_summary">In case Infinity did not change the theme</string>
<string name="settings_custom_theme_cannot_apply_to_settings_page_summary">Custom themes cannot be applied to settings page (except toolbar, status bar and navigation bar).</string>
<string name="settings_advanced_master_title">Advanced</string>
<string name="settings_delete_all_subreddits_data_in_database_title">Delete All Subreddits in Database</string>
diff --git a/app/src/main/res/xml/activity_motion_test_scene.xml b/app/src/main/res/xml/activity_motion_test_scene.xml
new file mode 100644
index 00000000..d271b2e1
--- /dev/null
+++ b/app/src/main/res/xml/activity_motion_test_scene.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:motion="http://schemas.android.com/apk/res-auto">
+
+ <Transition
+ android:id="@+id/transition_to_end"
+ motion:constraintSetStart="@+id/start"
+ motion:constraintSetEnd="@+id/end"
+ motion:autoTransition="animateToStart"
+ motion:duration="100">
+ <OnSwipe
+ motion:touchAnchorId="@+id/button"
+ motion:touchAnchorSide="right"
+ motion:onTouchUp="autoCompleteToEnd"
+ motion:dragDirection="dragRight" />
+ </Transition>
+
+ <Transition
+ android:id="@+id/transition_to_start"
+ motion:constraintSetStart="@+id/end"
+ motion:constraintSetEnd="@+id/start"
+ motion:autoTransition="animateToEnd">
+ </Transition>
+
+ <ConstraintSet android:id="@+id/start">
+ <Constraint
+ android:id="@+id/button"
+ android:layout_width="64dp"
+ android:layout_height="64dp"
+ motion:layout_constraintBottom_toBottomOf="parent"
+ motion:layout_constraintStart_toStartOf="parent"
+ motion:layout_constraintTop_toTopOf="parent" />
+ </ConstraintSet>
+
+ <ConstraintSet android:id="@+id/end">
+ <Constraint
+ android:id="@+id/button"
+ android:layout_width="64dp"
+ android:layout_height="64dp"
+ motion:layout_constraintBottom_toBottomOf="parent"
+ motion:layout_constraintStart_toEndOf="parent"
+ motion:layout_constraintTop_toTopOf="parent"/>
+ </ConstraintSet>
+
+</MotionScene>
diff --git a/app/src/main/res/xml/item_post_with_preview_scene.xml b/app/src/main/res/xml/item_post_with_preview_scene.xml
new file mode 100644
index 00000000..dc28317a
--- /dev/null
+++ b/app/src/main/res/xml/item_post_with_preview_scene.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto">
+
+ <ConstraintSet android:id="@+id/start">
+ <Constraint android:id="@+id/material_card_view_item_post_with_preview" />
+ </ConstraintSet>
+
+ <ConstraintSet android:id="@+id/end">
+ <Constraint android:id="@id/material_card_view_item_post_with_preview"
+ android:layout_width="0dp"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintWidth_percent="0.7" />
+ </ConstraintSet>
+
+ <Transition
+ app:constraintSetEnd="@id/end"
+ app:constraintSetStart="@+id/start">
+
+ <OnSwipe
+ app:dragDirection="dragRight"
+ app:touchAnchorId="@id/material_card_view_item_post_with_preview"
+ app:touchAnchorSide="right" />
+
+ </Transition>
+</MotionScene>
diff --git a/app/src/main/res/xml/theme_preferences.xml b/app/src/main/res/xml/theme_preferences.xml
index 3f726ec0..6bac18e4 100644
--- a/app/src/main/res/xml/theme_preferences.xml
+++ b/app/src/main/res/xml/theme_preferences.xml
@@ -12,6 +12,7 @@
<SwitchPreference
app:defaultValue="false"
app:key="amoled_dark"
+ app:icon="@drawable/ic_amoled_theme_preference_24dp"
app:title="@string/settings_amoled_dark_title" />
<PreferenceCategory
@@ -40,9 +41,19 @@
app:icon="@drawable/ic_edit_24dp"
app:title="@string/settings_manage_themes_title" />
+ <Preference
+ app:icon="@drawable/ic_info_preference_24dp"
+ app:summary="@string/settings_custom_theme_cannot_apply_to_settings_page_summary"
+ app:enabled="false" />
+
<PreferenceCategory
app:title="@string/settings_category_material_you_title" />
+ <Preference
+ app:icon="@drawable/ic_info_preference_24dp"
+ app:summary="@string/settings_enable_material_you_warning_summary"
+ app:enabled="false" />
+
<SwitchPreference
app:defaultValue="false"
app:key="enable_material_you"
@@ -50,8 +61,8 @@
app:summary="@string/settings_enable_material_you_summary" />
<Preference
- app:icon="@drawable/ic_info_preference_24dp"
- app:summary="@string/settings_custom_theme_cannot_apply_to_settings_page_summary"
- app:enabled="false" />
+ app:key="apply_material_you"
+ app:title="@string/settings_apply_material_you_title"
+ app:summary="@string/settings_apply_material_you_summary" />
</PreferenceScreen> \ No newline at end of file