Add follow indicator

This commit is contained in:
Thomas 2023-03-08 16:01:25 +01:00
parent a8ffbcae29
commit b77239b874
3 changed files with 20 additions and 2 deletions

View File

@ -143,7 +143,11 @@ public class AccountAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
accountViewHolder.binding.followAction.setBackgroundTintList(ColorStateList.valueOf(ThemeHelper.getAttColor(context, R.attr.colorPrimary))); accountViewHolder.binding.followAction.setBackgroundTintList(ColorStateList.valueOf(ThemeHelper.getAttColor(context, R.attr.colorPrimary)));
} }
if (account.relationShip.followed_by) {
accountViewHolder.binding.followIndicator.setVisibility(View.VISIBLE);
} else {
accountViewHolder.binding.followIndicator.setVisibility(View.GONE);
}
if (account.relationShip.blocking) { if (account.relationShip.blocking) {
accountViewHolder.binding.block.setBackgroundTintList(ColorStateList.valueOf(ThemeHelper.getAttColor(context, R.attr.colorError))); accountViewHolder.binding.block.setBackgroundTintList(ColorStateList.valueOf(ThemeHelper.getAttColor(context, R.attr.colorError)));
accountViewHolder.binding.block.setIconResource(R.drawable.ic_baseline_lock_open_24); accountViewHolder.binding.block.setIconResource(R.drawable.ic_baseline_lock_open_24);

View File

@ -74,6 +74,19 @@
app:layout_constraintTop_toBottomOf="@id/display_name" app:layout_constraintTop_toBottomOf="@id/display_name"
tools:text="\@username@instance.test" /> tools:text="\@username@instance.test" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/follow_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:background="@drawable/blue_border"
android:text="@string/follows_you"
android:textColor="?colorPrimary"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/avatar"
tools:visibility="visible" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/bio" android:id="@+id/bio"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -82,7 +95,7 @@
android:ellipsize="end" android:ellipsize="end"
android:maxLines="2" android:maxLines="2"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium" android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
app:layout_constraintTop_toBottomOf="@id/avatar" app:layout_constraintTop_toBottomOf="@id/follow_indicator"
tools:text="@tools:sample/lorem/random" /> tools:text="@tools:sample/lorem/random" />
<com.google.android.material.button.MaterialButtonToggleGroup <com.google.android.material.button.MaterialButtonToggleGroup

View File

@ -2,4 +2,5 @@
<resources> <resources>
<string name="follows_you">Follows you</string>
</resources> </resources>