Skip to content

Commit

Permalink
Don't count taps that are too far to the right
Browse files Browse the repository at this point in the history
  • Loading branch information
Hocuri committed Aug 26, 2024
1 parent 56b925f commit 59435e8
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ protected void onCreate(Bundle icicle, boolean ready) {
TooltipCompat.setTooltipText(searchAction, getText(R.string.search_explain));

TooltipCompat.setTooltipText(selfAvatar, getText(R.string.switch_account));
toolbar.setOnClickListener(v -> {
findViewById(R.id.avatar_and_title).setOnClickListener(v -> {
if (!isRelayingMessageContent(this)) {
AccountManager.getInstance().showSwitchAccountMenu(this);
}
Expand Down
94 changes: 52 additions & 42 deletions src/main/res/layout/conversation_list_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:contentInsetStart="14dp"
app:contentInsetLeft="14dp"
app:contentInsetStart="0dp"
app:contentInsetLeft="0dp"
android:elevation="4dp"
android:theme="?attr/actionBarStyle">

Expand All @@ -24,47 +24,57 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<RelativeLayout
android:id="@+id/self_avatar_container"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<org.thoughtcrime.securesms.components.AvatarImageView
android:id="@+id/self_avatar"
android:foreground="@drawable/contact_photo_background"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:cropToPadding="true"
android:clickable="true"
app:inverted="true"
tools:src="@drawable/ic_contact_picture"
android:contentDescription="@string/pref_profile_info_headline" />
<ImageView android:id="@+id/unread_indicator"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginBottom="16dp"
android:contentDescription="@null"
android:visibility="gone"
/>
</RelativeLayout>
<LinearLayout
android:id="@+id/avatar_and_title"
android:orientation="horizontal"
android:layout_width="0dp"
android:layout_weight="1"
android:paddingStart="14dp"
android:layout_height="match_parent"
android:layout_marginEnd="10dp">

<TextView style="@style/TextSecure.TitleTextStyle"
android:id="@+id/toolbar_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:paddingRight="10dp"
android:ellipsize="end"
android:maxLines="1"/>
<RelativeLayout
android:id="@+id/self_avatar_container"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<org.thoughtcrime.securesms.components.AvatarImageView
android:id="@+id/self_avatar"
android:foreground="@drawable/contact_photo_background"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:cropToPadding="true"
android:clickable="true"
app:inverted="true"
tools:src="@drawable/ic_contact_picture"
android:contentDescription="@string/pref_profile_info_headline" />
<ImageView android:id="@+id/unread_indicator"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginBottom="16dp"
android:contentDescription="@null"
android:visibility="gone"
/>
</RelativeLayout>

<TextView style="@style/TextSecure.TitleTextStyle"
android:id="@+id/toolbar_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:paddingRight="10dp"
android:ellipsize="end"
android:maxLines="1"/>
</LinearLayout>

<ImageView android:id="@+id/search_action"
android:layout_width="wrap_content"
Expand Down

0 comments on commit 59435e8

Please sign in to comment.