Implement feed groups manual sorting
Now, the user can sort its groups to his liking even after he created them. Also updated the database diagram to reflect the table's new column.
This commit is contained in:
parent
eb8b394d96
commit
7aecb00211
20 changed files with 473 additions and 19 deletions
9
app/src/main/res/drawable/ic_sort_black_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_sort_black_24dp.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M3,18h6v-2L3,16v2zM3,6v2h18L21,6L3,6zM3,13h12v-2L3,11v2z"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ic_sort_white_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_sort_white_24dp.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M3,18h6v-2L3,16v2zM3,6v2h18L21,6L3,6zM3,13h12v-2L3,11v2z"/>
|
||||
</vector>
|
||||
31
app/src/main/res/layout/dialog_feed_group_reorder.xml
Normal file
31
app/src/main/res/layout/dialog_feed_group_reorder.xml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/feed_groups_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:clipToPadding="false"
|
||||
android:padding="6dp"
|
||||
android:scrollbars="vertical"
|
||||
tools:itemCount="100"
|
||||
tools:listitem="@layout/feed_group_reorder_item" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/separator_color" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/confirm_button"
|
||||
style="?buttonBarButtonStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:text="@string/finish" />
|
||||
</LinearLayout>
|
||||
62
app/src/main/res/layout/feed_group_reorder_item.xml
Normal file
62
app/src/main/res/layout/feed_group_reorder_item.xml
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView 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:id="@+id/layoutCard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:minHeight="?listPreferredItemHeightSmall"
|
||||
android:orientation="horizontal"
|
||||
app:cardBackgroundColor="?attr/card_item_background_color"
|
||||
app:cardCornerRadius="5dp"
|
||||
app:cardElevation="2dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/group_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="16dp"
|
||||
tools:ignore="ContentDescription,RtlHardcoded"
|
||||
tools:src="?attr/ic_hot" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/group_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:layout_toLeftOf="@+id/handle"
|
||||
android:layout_toRightOf="@+id/group_icon"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:textAppearance="?textAppearanceListItem"
|
||||
tools:ignore="RtlHardcoded"
|
||||
tools:text="Lorem ipsum dolor sit amet" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/handle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:src="?attr/drag_handle"
|
||||
tools:ignore="ContentDescription,RtlHardcoded" />
|
||||
</RelativeLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
32
app/src/main/res/layout/header_with_menu_item.xml
Normal file
32
app/src/main/res/layout/header_with_menu_item.xml
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingBottom="12dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/header_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="start|center_vertical"
|
||||
android:maxLines="2"
|
||||
android:minHeight="24dp"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="Header" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/header_menu_item"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
tools:src="?attr/ic_bookmark" />
|
||||
</LinearLayout>
|
||||
|
|
@ -79,6 +79,7 @@
|
|||
<attr name="ic_sunny" format="reference"/>
|
||||
<attr name="ic_telescope" format="reference"/>
|
||||
<attr name="ic_megaphone" format="reference"/>
|
||||
<attr name="ic_sort" format="reference"/>
|
||||
|
||||
<attr name="progress_horizontal_drawable" format="reference"/>
|
||||
<!-- Can't refer to colors directly in drawable's xml-->
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@
|
|||
<item name="ic_sunny">@drawable/ic_sunny_black_24dp</item>
|
||||
<item name="ic_telescope">@drawable/ic_telescope_black_24dp</item>
|
||||
<item name="ic_megaphone">@drawable/ic_megaphone_black_24dp</item>
|
||||
<item name="ic_sort">@drawable/ic_sort_black_24dp</item>
|
||||
|
||||
<item name="separator_color">@color/light_separator_color</item>
|
||||
<item name="contrast_background_color">@color/light_contrast_background_color</item>
|
||||
|
|
@ -198,6 +199,7 @@
|
|||
<item name="ic_sunny">@drawable/ic_sunny_white_24dp</item>
|
||||
<item name="ic_telescope">@drawable/ic_telescope_white_24dp</item>
|
||||
<item name="ic_megaphone">@drawable/ic_megaphone_white_24dp</item>
|
||||
<item name="ic_sort">@drawable/ic_sort_white_24dp</item>
|
||||
|
||||
<item name="separator_color">@color/dark_separator_color</item>
|
||||
<item name="contrast_background_color">@color/dark_contrast_background_color</item>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue