Hashtag timelines with multiple tags (#584)
* feat(api/hashtag): add any, all, and none parameter * feat(timeline/hashtag): load with any, all and none parameter * feat(timeline/hashtag): save any, all and none in timeline definition * feat: set hastag parameter in UI * feat: move strings to string res * feat: show hint for tags * refactor: use method for setting up tags text * improve edit dialog, allow creating hashtag timelines * add chips for hashtags * add option for displaying only local posts in hashtag * improve layout and wording --------- Co-authored-by: sk <sk22@mailbox.org>
This commit is contained in:
@@ -1,22 +1,201 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<ImageButton
|
||||
style="?android:editTextStyle"
|
||||
android:id="@+id/button"
|
||||
android:contentDescription="@string/sk_timeline_icon"
|
||||
android:paddingHorizontal="14dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginBottom="16dp" />
|
||||
<org.joinmastodon.android.ui.views.TextInputFrameLayout
|
||||
android:id="@+id/input"
|
||||
android:layout_marginStart="-8dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button"
|
||||
style="?android:editTextStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:contentDescription="@string/sk_timeline_icon"
|
||||
android:paddingHorizontal="14dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/input"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?colorPollVoted" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/advanced"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:minHeight="32dp"
|
||||
android:background="@drawable/bg_inline_button"
|
||||
android:elevation="0dp"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="16sp"
|
||||
android:text="@string/sk_advanced_options_show" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tag_wrap"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sk_edit_timeline_tag_main"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:drawableStart="@drawable/ic_fluent_number_symbol_20_filled"
|
||||
android:drawablePadding="12dp"
|
||||
android:drawableTint="?android:textColorSecondary"
|
||||
android:textColor="?android:textColorSecondary" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/tag_main"
|
||||
android:hint="@string/sk_edit_timeline_tag_hint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginBottom="12dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sk_edit_timeline_tag_any"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:drawableStart="@drawable/ic_fluent_shape_union_20_filled"
|
||||
android:drawablePadding="12dp"
|
||||
android:drawableTint="?android:textColorSecondary"
|
||||
android:textColor="?android:textColorSecondary" />
|
||||
|
||||
<com.hootsuite.nachos.NachoTextView
|
||||
style="@style/Widget.Mastodon.EditText"
|
||||
android:id="@+id/tags_any"
|
||||
android:hint="@string/sk_edit_timeline_tags_hint"
|
||||
android:paddingVertical="8sp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
app:chipBackground="?colorAccentLightest"
|
||||
app:chipTextColor="?android:textColorPrimary" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sk_edit_timeline_tag_all"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:drawableStart="@drawable/ic_fluent_shape_intersect_20_filled"
|
||||
android:drawablePadding="12dp"
|
||||
android:drawableTint="?android:textColorSecondary"
|
||||
android:textColor="?android:textColorSecondary" />
|
||||
|
||||
<com.hootsuite.nachos.NachoTextView
|
||||
style="@style/Widget.Mastodon.EditText"
|
||||
android:id="@+id/tags_all"
|
||||
android:hint="@string/sk_edit_timeline_tags_hint"
|
||||
android:paddingVertical="8sp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
app:chipBackground="?colorAccentLightest"
|
||||
app:chipTextColor="?android:textColorPrimary" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sk_edit_timeline_tag_none"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:drawableStart="@drawable/ic_fluent_shape_subtract_20_filled"
|
||||
android:drawablePadding="16dp"
|
||||
android:drawableTint="?android:textColorSecondary"
|
||||
android:textColor="?android:textColorSecondary" />
|
||||
|
||||
<com.hootsuite.nachos.NachoTextView
|
||||
style="@style/Widget.Mastodon.EditText"
|
||||
android:id="@+id/tags_none"
|
||||
android:hint="@string/sk_edit_timeline_tags_hint"
|
||||
android:paddingVertical="8sp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
app:chipBackground="?colorAccentLightest"
|
||||
app:chipTextColor="?android:textColorPrimary" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="14sp"
|
||||
android:text="@string/sk_edit_timeline_tags_explanation" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/local_only"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:minHeight="48dp"
|
||||
android:gravity="center_vertical"
|
||||
android:layoutDirection="locale">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:paddingVertical="8dp"
|
||||
android:textSize="16sp"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:drawableStart="@drawable/ic_fluent_eye_24_regular"
|
||||
android:drawableTint="?android:textColorPrimary"
|
||||
android:drawablePadding="16dp"
|
||||
android:text="@string/sk_hashtag_timeline_local_only_switch" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/local_only_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:focusable="false"
|
||||
android:clickable="false"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
@@ -50,15 +50,6 @@
|
||||
android:gravity="center_vertical"
|
||||
android:layoutDirection="locale">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:tint="?android:textColorPrimary"
|
||||
android:src="@drawable/ic_fluent_rss_24_regular"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -66,6 +57,9 @@
|
||||
android:paddingVertical="8dp"
|
||||
android:textSize="16sp"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:drawableStart="@drawable/ic_fluent_rss_24_regular"
|
||||
android:drawableTint="?android:textColorPrimary"
|
||||
android:drawablePadding="16dp"
|
||||
android:text="@string/sk_list_exclusive_switch" />
|
||||
|
||||
<Switch
|
||||
@@ -73,7 +67,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:duplicateParentState="true"
|
||||
android:focusable="false"
|
||||
android:clickable="false"/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user