feat: implemented customizable home, allowing users to toggle visibility of elements and change their order

This commit is contained in:
CappielloAntonio 2024-03-23 21:33:11 +01:00
parent 309eca0764
commit 0e97eab744
12 changed files with 507 additions and 0 deletions

View file

@ -0,0 +1,23 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="24dp"
android:layout_marginBottom="4dp"
android:text="@string/home_rearrangement_dialog_subtitle" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/home_sector_item_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:nestedScrollingEnabled="false"
android:paddingHorizontal="18dp" />
</LinearLayout>

View file

@ -787,6 +787,14 @@
android:id="@+id/shares_placeholder"
layout="@layout/item_placeholder_horizontal"
android:visibility="gone" />
<Button
android:id="@+id/home_sector_rearrangement_button"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/home_option_reorganize"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View file

@ -0,0 +1,26 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clipChildren="false"
android:orientation="horizontal">
<CheckBox
android:id="@+id/home_sector_title_check_box"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<ImageView
android:id="@+id/home_sector_rearranger_image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_drag_handle"
app:layout_constraintBottom_toBottomOf="@+id/home_sector_title_check_box"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/home_sector_title_check_box" />
</androidx.constraintlayout.widget.ConstraintLayout>