mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-10-05 21:39:50 +02:00
Save light, dark and amoled Material You themes to database. Add 'Apply Material You' option. Test MotionLayout.
This commit is contained in:
45
app/src/main/res/xml/activity_motion_test_scene.xml
Normal file
45
app/src/main/res/xml/activity_motion_test_scene.xml
Normal file
@@ -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>
|
26
app/src/main/res/xml/item_post_with_preview_scene.xml
Normal file
26
app/src/main/res/xml/item_post_with_preview_scene.xml
Normal file
@@ -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>
|
@@ -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>
|
Reference in New Issue
Block a user