Share filters with web client (#956)

* First step toward synchronized content filters

* Add simple filter management UI

* Remove old regex filter UI

* More cleanup

* Escape filter phrases when applying them via regex

* Apply code review feedback

* Fix live timeline update when filters change
This commit is contained in:
Levi Bard 2019-03-20 19:25:26 +01:00 committed by Konrad Pozniak
commit 5135daad2c
13 changed files with 439 additions and 91 deletions

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activityFilters"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.keylesspalace.tusky.FiltersActivity">
<include layout="@layout/toolbar_basic" />
<ListView
android:id="@+id/filtersView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/filter_floating_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:contentDescription="@string/filter_addition_dialog_title"
app:layout_anchor="@id/filtersView"
app:layout_anchorGravity="bottom|end"
android:src="@drawable/ic_plus_24dp"
/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<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="match_parent"
android:paddingTop="16dp">
<EditText
android:id="@+id/phraseEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="24dp"
android:paddingStart="24dp"
android:hint="@string/filter_add_description"
app:layout_constraintTop_toTopOf="parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>