Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix blocked contacts button #1264

Merged
merged 2 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
}
}
}
27 changes: 12 additions & 15 deletions app/src/main/res/layout/blocked_contacts_preference.xml
Original file line number Diff line number Diff line change
@@ -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"
/>