3509: Ensure filter edit dialog is scrollable (#3510)

This commit is contained in:
UlrichKu 2023-04-23 22:39:19 +02:00 committed by GitHub
parent ce92c52fc1
commit 8de5613b47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 24 deletions

View File

@ -152,7 +152,8 @@
<activity android:name=".components.scheduled.ScheduledStatusActivity" />
<activity android:name=".components.announcements.AnnouncementsActivity" />
<activity android:name=".components.drafts.DraftsActivity" />
<activity android:name="com.keylesspalace.tusky.components.filters.EditFilterActivity" />
<activity android:name="com.keylesspalace.tusky.components.filters.EditFilterActivity"
android:windowSoftInputMode="adjustResize" />
<receiver android:name=".receiver.NotificationClearBroadcastReceiver"
android:exported="false" />

View File

@ -247,6 +247,8 @@ class EditFilterActivity : BaseActivity() {
}
private fun saveChanges() {
// TODO use a progress bar here (see EditProfileActivity/activity_edit_profile.xml for example)?
lifecycleScope.launch {
if (viewModel.saveChanges(this@EditFilterActivity)) {
finish()

View File

@ -1,13 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:orientation="vertical"
tools:context="com.keylesspalace.tusky.components.filters.EditFilterActivity">
<include
@ -16,9 +12,8 @@
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:fillViewport="true">
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
@ -148,20 +143,15 @@
android:layout_height="wrap_content"
android:minHeight="48dp"
android:text="@string/pref_title_account_filter_keywords" />
<Button
android:id="@+id/filter_save_button"
android:layout_width="wrap_content"
android:layout_gravity="end"
android:layout_height="wrap_content"
android:padding="6dp"
android:layout_marginBottom="16dp"
android:text="@string/action_save" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:gravity="end">
<Button
android:id="@+id/filter_save_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/action_save" />
</LinearLayout>
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>