Fix blocked contacts button (#1264)

This commit is contained in:
Andrew 2023-07-04 11:39:49 +09:30 committed by GitHub
parent ba4143c298
commit 7da3e4f022
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 27 deletions

View file

@ -1,9 +0,0 @@
package org.thoughtcrime.securesms.preferences
import android.content.Context
import android.util.AttributeSet
import android.widget.FrameLayout
class BlockedContactsLayout @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null
) : FrameLayout(context, attrs)

View file

@ -3,7 +3,6 @@ package org.thoughtcrime.securesms.preferences
import android.content.Context
import android.content.Intent
import android.util.AttributeSet
import android.view.View
import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceViewHolder
@ -16,8 +15,7 @@ class BlockedContactsPreference @JvmOverloads constructor(
super.onBindViewHolder(holder)
holder.itemView.setOnClickListener {
val intent = Intent(context, BlockedContactsActivity::class.java)
context.startActivity(intent)
Intent(context, BlockedContactsActivity::class.java).let(context::startActivity)
}
}
}

View file

@ -1,18 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<org.thoughtcrime.securesms.preferences.BlockedContactsLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
<Button
xmlns:android="http://schemas.android.com/apk/res/android"
android:contentDescription="@string/AccessibilityId_blocked_contacts"
style="@style/Widget.Session.Button.Common.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/medium_spacing"
android:layout_marginHorizontal="@dimen/large_spacing"
android:layout_marginVertical="@dimen/medium_spacing"
android:layout_height="wrap_content">
<Button
android:contentDescription="@string/AccessibilityId_blocked_contacts"
style="@style/Widget.Session.Button.Common.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/medium_spacing"
android:text="@string/blocked_contacts_title"
android:textColor="@color/destructive"
android:textSize="16sp"
android:textStyle="bold"
/>
</org.thoughtcrime.securesms.preferences.BlockedContactsLayout>
android:text="@string/blocked_contacts_title"
android:textColor="@color/destructive"
android:textSize="16sp"
android:textStyle="bold"
/>