mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-28 04:34:21 +01:00
Improve contact blocking UX via settings.
This commit is contained in:
committed by
Cody Henthorne
parent
d6a230a235
commit
e9c7b120a0
@@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<org.thoughtcrime.securesms.preferences.BlockedContactListItem
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/listPreferredItemHeight"
|
||||
android:paddingEnd="25dip">
|
||||
|
||||
<org.thoughtcrime.securesms.components.AvatarImageView
|
||||
android:id="@+id/contact_photo_image"
|
||||
android:layout_width="@dimen/contact_selection_photo_size"
|
||||
android:layout_height="@dimen/contact_selection_photo_size"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="10dp"
|
||||
android:cropToPadding="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:contentDescription="@string/SingleContactSelectionActivity_contact_photo" />
|
||||
|
||||
<TextView android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginStart="14dip"
|
||||
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:layout_toEndOf="@id/contact_photo_image"
|
||||
android:gravity="center_vertical|start"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
</org.thoughtcrime.securesms.preferences.BlockedContactListItem>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="16dip"
|
||||
android:paddingEnd="16dip">
|
||||
|
||||
<ListView android:id="@id/android:list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:drawSelectorOnTop="false"/>
|
||||
|
||||
<TextView android:id="@id/android:empty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center|center_vertical"
|
||||
android:gravity="center|center_vertical"
|
||||
android:textSize="20sp"
|
||||
android:text="@string/blocked_contacts_fragment__no_blocked_contacts"/>
|
||||
|
||||
</LinearLayout>
|
||||
41
app/src/main/res/layout/blocked_users_activity.xml
Normal file
41
app/src/main/res/layout/blocked_users_activity.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:orientation="vertical">
|
||||
|
||||
<ViewSwitcher
|
||||
android:id="@+id/toolbar_switcher"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inAnimation="@anim/fade_in"
|
||||
android:outAnimation="@anim/fade_out">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:theme="?attr/actionBarStyle"
|
||||
app:navigationIcon="@drawable/ic_arrow_left_24"
|
||||
app:title="@string/BlockedUsersActivity__blocked_users" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.ContactFilterToolbar
|
||||
android:id="@+id/filter_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:elevation="4dp"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:theme="?attr/actionBarStyle"
|
||||
app:contentInsetStartWithNavigation="0dp"
|
||||
app:navigationIcon="@drawable/ic_arrow_left_24" />
|
||||
|
||||
</ViewSwitcher>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
41
app/src/main/res/layout/blocked_users_adapter_item.xml
Normal file
41
app/src/main/res/layout/blocked_users_adapter_item.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/listPreferredItemHeight"
|
||||
android:background="?attr/selectableItemBackground">
|
||||
|
||||
<org.thoughtcrime.securesms.components.AvatarImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/display_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||
app:layout_constraintBottom_toTopOf="@id/number_or_username"
|
||||
app:layout_constraintStart_toEndOf="@id/avatar"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
tools:text="Aadam" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/number_or_username"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body2"
|
||||
android:textColor="?attr/title_text_color_secondary"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/display_name"
|
||||
app:layout_constraintTop_toBottomOf="@id/display_name"
|
||||
tools:text="1 234 567 8901" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
81
app/src/main/res/layout/blocked_users_fragment.xml
Normal file
81
app/src/main/res/layout/blocked_users_fragment.xml
Normal file
@@ -0,0 +1,81 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/add_blocked_user"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:paddingTop="7dp"
|
||||
android:text="@string/BlockedUsersActivity__add_blocked_user"
|
||||
android:textAppearance="@style/Signal.Text.Body"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/add_blocked_user_description"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:paddingBottom="7dp"
|
||||
android:text="@string/BlockedUsersActivity__blocked_users_will"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/add_blocked_user" />
|
||||
|
||||
<View
|
||||
android:id="@+id/add_blocked_user_touch_target"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="?selectableItemBackground"
|
||||
app:layout_constraintBottom_toBottomOf="@id/add_blocked_user_description"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/add_blocked_user" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/blocked_users_header"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="29dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="@string/BlockedUsersActivity__blocked_users"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Subtitle"
|
||||
android:textColor="?colorAccent"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/add_blocked_user_touch_target" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/no_blocked_users"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="@string/BlockedUsersActivity__no_blocked_users"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/blocked_users_header" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/blocked_users_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/blocked_users_header"
|
||||
tools:listitem="@layout/contact_selection_list_item" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -97,8 +97,18 @@
|
||||
<!-- AudioSlidePlayer -->
|
||||
<string name="AudioSlidePlayer_error_playing_audio">Error playing audio!</string>
|
||||
|
||||
<!-- BlockedContactsActivity -->
|
||||
<string name="BlockedContactsActivity_blocked_contacts">Blocked contacts</string>
|
||||
<!-- BlockedUsersActivity -->
|
||||
<string name="BlockedUsersActivity__blocked_users">Blocked users</string>
|
||||
<string name="BlockedUsersActivity__add_blocked_user">Add blocked user</string>
|
||||
<string name="BlockedUsersActivity__blocked_users_will">Blocked users will not be able to call you or send you messages.</string>
|
||||
<string name="BlockedUsersActivity__no_blocked_users">No blocked users</string>
|
||||
<string name="BlockedUsersActivity__block_user">Block user?</string>
|
||||
<string name="BlockedUserActivity__s_will_not_be_able_to">\"%1$s\" will not be able to call you or send you messages.</string>
|
||||
<string name="BlockedUsersActivity__block">Block</string>
|
||||
<string name="BlockedUsersActivity__unblock_user">Unblock user?</string>
|
||||
<string name="BlockedUsersActivity__do_you_want_to_unblock_s">Do you want to unblock \"%1$s\"?</string>
|
||||
<string name="BlockedUsersActivity__unblock">Unblock</string>
|
||||
|
||||
|
||||
<!-- BlockUnblockDialog -->
|
||||
<string name="BlockUnblockDialog_block_and_leave_s">Block and leave %1$s?</string>
|
||||
@@ -2253,7 +2263,7 @@
|
||||
<string name="preferences__typing_indicators">Typing indicators</string>
|
||||
<string name="preferences__if_typing_indicators_are_disabled_you_wont_be_able_to_see_typing_indicators">If typing indicators are disabled, you won\'t be able to see typing indicators from others.</string>
|
||||
<string name="preferences__request_keyboard_to_disable_personalized_learning">Request keyboard to disable personalized learning</string>
|
||||
<string name="preferences_app_protection__blocked_contacts">Blocked contacts</string>
|
||||
<string name="preferences_app_protection__blocked_users">Blocked users</string>
|
||||
<string name="preferences_chats__when_using_mobile_data">When using mobile data</string>
|
||||
<string name="preferences_chats__when_using_wifi">When using Wi-Fi</string>
|
||||
<string name="preferences_chats__when_roaming">When roaming</string>
|
||||
@@ -2351,6 +2361,7 @@
|
||||
|
||||
<!-- contact_selection_list -->
|
||||
<string name="contact_selection_list__unknown_contact">New message to…</string>
|
||||
<string name="contact_selection_list__unknown_contact_block">Block user</string>
|
||||
<string name="contact_selection_list__unknown_contact_add_to_group">Add to group</string>
|
||||
|
||||
<!-- conversation_callable_insecure -->
|
||||
@@ -2824,6 +2835,9 @@
|
||||
|
||||
<!-- StorageUtil -->
|
||||
<string name="StorageUtil__s_s">%1$s/%2$s</string>
|
||||
<string name="BlockedUsersActivity__s_has_been_blocked">\"%1$s\" has been blocked.</string>
|
||||
<string name="BlockedUsersActivity__failed_to_block_s">Failed to block \"%1$s\"</string>
|
||||
<string name="BlockedUsersActivity__s_has_been_unblocked">\"%1$s\" has been unblocked.</string>
|
||||
|
||||
<!-- ReviewCardDialogFragment -->
|
||||
<string name="ReviewCardDialogFragment__review_members">Review Members</string>
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
<Preference
|
||||
android:key="preference_category_blocked"
|
||||
android:title="@string/preferences_app_protection__blocked_contacts" />
|
||||
android:title="@string/preferences_app_protection__blocked_users" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory android:layout="@layout/preference_divider" />
|
||||
|
||||
Reference in New Issue
Block a user