fix "account moved" on profiles not being clickable (#2438)
This commit is contained in:
parent
dff039e123
commit
b5d8b73044
3 changed files with 61 additions and 62 deletions
|
@ -20,8 +20,6 @@ import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.res.ColorStateList
|
import android.content.res.ColorStateList
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.graphics.PorterDuff
|
|
||||||
import android.graphics.PorterDuffColorFilter
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.text.Editable
|
import android.text.Editable
|
||||||
import android.view.Menu
|
import android.view.Menu
|
||||||
|
@ -499,13 +497,6 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
|
||||||
loadAvatar(movedAccount.avatar, binding.accountMovedAvatar, avatarRadius, animateAvatar)
|
loadAvatar(movedAccount.avatar, binding.accountMovedAvatar, avatarRadius, animateAvatar)
|
||||||
|
|
||||||
binding.accountMovedText.text = getString(R.string.account_moved_description, movedAccount.name)
|
binding.accountMovedText.text = getString(R.string.account_moved_description, movedAccount.name)
|
||||||
|
|
||||||
// this is necessary because API 19 can't handle vector compound drawables
|
|
||||||
val movedIcon = ContextCompat.getDrawable(this, R.drawable.ic_briefcase)?.mutate()
|
|
||||||
val textColor = ThemeUtils.getColor(this, android.R.attr.textColorTertiary)
|
|
||||||
movedIcon?.colorFilter = PorterDuffColorFilter(textColor, PorterDuff.Mode.SRC_IN)
|
|
||||||
|
|
||||||
binding.accountMovedText.setCompoundDrawablesRelativeWithIntrinsicBounds(movedIcon, null, null, null)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
android:viewportHeight="24"
|
android:viewportHeight="24"
|
||||||
android:viewportWidth="24">
|
android:viewportWidth="24">
|
||||||
<path
|
<path
|
||||||
android:fillColor="#000"
|
android:fillColor="@color/textColorTertiary"
|
||||||
android:pathData="M20,6C20.58,6 21.05,6.2 21.42,6.59C21.8,7 22,7.45 22,8V19C22,19.55 21.8,20 21.42,20.41C21.05,20.8 20.58,21 20,21H4C3.42,21 2.95,20.8 2.58,20.41C2.2,20 2,19.55 2,19V8C2,7.45 2.2,7 2.58,6.59C2.95,6.2 3.42,6 4,6H8V4C8,3.42 8.2,2.95 8.58,2.58C8.95,2.2 9.42,2 10,2H14C14.58,2 15.05,2.2 15.42,2.58C15.8,2.95 16,3.42 16,4V6H20M4,8V19H20V8H4M14,6V4H10V6H14Z" />
|
android:pathData="M20,6C20.58,6 21.05,6.2 21.42,6.59C21.8,7 22,7.45 22,8V19C22,19.55 21.8,20 21.42,20.41C21.05,20.8 20.58,21 20,21H4C3.42,21 2.95,20.8 2.58,20.41C2.2,20 2,19.55 2,19V8C2,7.45 2.2,7 2.58,6.59C2.95,6.2 3.42,6 4,6H8V4C8,3.42 8.2,2.95 8.58,2.58C8.95,2.2 9.42,2 10,2H14C14.58,2 15.05,2.2 15.42,2.58C15.8,2.95 16,3.42 16,4V6H20M4,8V19H20V8H4M14,6V4H10V6H14Z" />
|
||||||
</vector>
|
</vector>
|
|
@ -248,63 +248,71 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/accountFieldList"
|
app:layout_constraintTop_toBottomOf="@id/accountFieldList"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Group
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/accountMovedView"
|
android:id="@+id/accountMovedView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:constraint_referenced_ids="accountMovedText,accountMovedAvatar,accountMovedDisplayName,accountMovedUsername" />
|
android:layout_marginTop="4dp"
|
||||||
|
|
||||||
<androidx.emoji.widget.EmojiTextView
|
|
||||||
android:id="@+id/accountMovedText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="12dp"
|
|
||||||
android:drawablePadding="6dp"
|
|
||||||
android:textSize="?attr/status_text_medium"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/accountRemoveView"
|
app:layout_constraintTop_toBottomOf="@id/accountRemoveView"
|
||||||
tools:text="Account has moved" />
|
tools:visibility="visible">
|
||||||
|
|
||||||
<ImageView
|
<androidx.emoji.widget.EmojiTextView
|
||||||
android:id="@+id/accountMovedAvatar"
|
android:id="@+id/accountMovedText"
|
||||||
android:layout_width="48dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="48dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginTop="8dp"
|
android:drawablePadding="6dp"
|
||||||
android:layout_marginEnd="24dp"
|
android:drawableStart="@drawable/ic_briefcase"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:textSize="?attr/status_text_medium"
|
||||||
app:layout_constraintTop_toBottomOf="@id/accountMovedText"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
tools:src="@drawable/avatar_default" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:text="Account has moved" />
|
||||||
|
|
||||||
<androidx.emoji.widget.EmojiTextView
|
<ImageView
|
||||||
android:id="@+id/accountMovedDisplayName"
|
android:importantForAccessibility="no"
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/accountMovedAvatar"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="48dp"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_height="48dp"
|
||||||
android:ellipsize="end"
|
android:layout_centerVertical="true"
|
||||||
android:maxLines="1"
|
android:layout_marginTop="8dp"
|
||||||
android:textColor="?android:textColorPrimary"
|
android:layout_marginBottom="8dp"
|
||||||
android:textSize="?attr/status_text_large"
|
android:layout_marginEnd="24dp"
|
||||||
android:textStyle="normal|bold"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintBottom_toTopOf="@id/accountMovedUsername"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/accountMovedAvatar"
|
app:layout_constraintTop_toBottomOf="@id/accountMovedText"
|
||||||
app:layout_constraintTop_toTopOf="@id/accountMovedAvatar"
|
tools:src="@drawable/avatar_default" />
|
||||||
tools:text="Display name" />
|
|
||||||
|
|
||||||
<TextView
|
<androidx.emoji.widget.EmojiTextView
|
||||||
android:id="@+id/accountMovedUsername"
|
android:id="@+id/accountMovedDisplayName"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:textColor="?android:textColorSecondary"
|
android:textColor="?android:textColorPrimary"
|
||||||
android:textSize="?attr/status_text_medium"
|
android:textSize="?attr/status_text_large"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/accountMovedAvatar"
|
android:textStyle="normal|bold"
|
||||||
app:layout_constraintStart_toEndOf="@id/accountMovedAvatar"
|
app:layout_constraintBottom_toTopOf="@id/accountMovedUsername"
|
||||||
app:layout_constraintTop_toBottomOf="@id/accountMovedDisplayName"
|
app:layout_constraintStart_toEndOf="@id/accountMovedAvatar"
|
||||||
tools:text="\@username" />
|
app:layout_constraintTop_toTopOf="@id/accountMovedAvatar"
|
||||||
|
tools:text="Display name" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/accountMovedUsername"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="?android:textColorSecondary"
|
||||||
|
android:textSize="?attr/status_text_medium"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/accountMovedAvatar"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/accountMovedAvatar"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/accountMovedDisplayName"
|
||||||
|
tools:text="\@username" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/accountStatuses"
|
android:id="@+id/accountStatuses"
|
||||||
|
@ -315,7 +323,7 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintEnd_toStartOf="@id/accountFollowing"
|
app:layout_constraintEnd_toStartOf="@id/accountFollowing"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/accountMovedAvatar">
|
app:layout_constraintTop_toBottomOf="@id/accountMovedView">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/accountStatusesTextView"
|
android:id="@+id/accountStatusesTextView"
|
||||||
|
@ -346,7 +354,7 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintEnd_toStartOf="@id/accountFollowers"
|
app:layout_constraintEnd_toStartOf="@id/accountFollowers"
|
||||||
app:layout_constraintStart_toEndOf="@id/accountStatuses"
|
app:layout_constraintStart_toEndOf="@id/accountStatuses"
|
||||||
app:layout_constraintTop_toBottomOf="@id/accountMovedAvatar">
|
app:layout_constraintTop_toBottomOf="@id/accountMovedView">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/accountFollowingTextView"
|
android:id="@+id/accountFollowingTextView"
|
||||||
|
@ -376,7 +384,7 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/accountFollowing"
|
app:layout_constraintStart_toEndOf="@id/accountFollowing"
|
||||||
app:layout_constraintTop_toBottomOf="@id/accountMovedAvatar">
|
app:layout_constraintTop_toBottomOf="@id/accountMovedView">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/accountFollowersTextView"
|
android:id="@+id/accountFollowersTextView"
|
||||||
|
|
Loading…
Reference in a new issue