Follow Request By

This commit is contained in:
Thomas 2023-03-09 15:35:12 +01:00
parent 7f9d6ca2d5
commit 7c1d5a4830
7 changed files with 52 additions and 8 deletions

View file

@ -625,18 +625,18 @@ public class ProfileActivity extends BaseActivity {
binding.accountFollow.setContentDescription(getString(R.string.action_disabled));
}
if (relationship.requested) {
binding.accountFollowRequest.setVisibility(View.VISIBLE);
binding.accountFollow.setIconResource(R.drawable.ic_baseline_hourglass_full_24);
binding.accountFollow.setVisibility(View.VISIBLE);
binding.accountFollow.setContentDescription(getString(R.string.follow_request));
doAction = action.UNFOLLOW;
}
if (relationship.followed_by) {
binding.accountFollowedBy.setVisibility(View.VISIBLE);
} else {
binding.accountFollowedBy.setVisibility(View.GONE);
}
if (relationship.requested_by) {
binding.accountRequestedBy.setVisibility(View.VISIBLE);
} else {
binding.accountRequestedBy.setVisibility(View.GONE);
}
binding.accountFollowRequest.setVisibility(View.GONE);
if (relationship.following) {
binding.accountFollow.setIconResource(R.drawable.ic_baseline_person_remove_24);
binding.accountFollow.setBackgroundTintList(ColorStateList.valueOf(ThemeHelper.getAttColor(this, R.attr.colorError)));
@ -649,12 +649,20 @@ public class ProfileActivity extends BaseActivity {
doAction = action.UNBLOCK;
binding.accountFollow.setVisibility(View.VISIBLE);
binding.accountFollow.setContentDescription(getString(R.string.action_unblock));
} else if (relationship.requested) {
binding.accountFollowRequest.setVisibility(View.VISIBLE);
binding.accountFollow.setIconResource(R.drawable.ic_baseline_hourglass_full_24);
binding.accountFollow.setVisibility(View.VISIBLE);
binding.accountFollow.setContentDescription(getString(R.string.follow_request));
doAction = action.UNFOLLOW;
} else {
binding.accountFollow.setIconResource(R.drawable.ic_baseline_person_add_24);
doAction = action.FOLLOW;
binding.accountFollow.setVisibility(View.VISIBLE);
binding.accountFollow.setContentDescription(getString(R.string.action_follow));
}
//The value for account is from same server so id can be used
if (account.id.equals(currentAccount.user_id)) {

View file

@ -32,6 +32,9 @@ public class RelationShip {
public boolean followed_by;
@SerializedName("blocking")
public boolean blocking;
@SerializedName("requested_by")
public boolean requested_by;
@SerializedName("blocked_by")
public boolean blocked_by;
@SerializedName("muting")

View file

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

View file

@ -319,6 +319,18 @@
android:textColor="@color/verified_text"
android:visibility="gone" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/account_requested_by"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="3dp"
android:layout_marginEnd="3dp"
android:background="@drawable/red_border"
android:singleLine="true"
android:text="@string/requested_by"
android:textColor="?colorError"
android:visibility="gone" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/account_follow_request"
android:layout_width="wrap_content"

View file

@ -87,6 +87,19 @@
app:layout_constraintTop_toBottomOf="@id/avatar"
tools:visibility="visible" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/request_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:background="@drawable/red_border"
android:text="@string/requested_by"
android:textColor="?colorError"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/avatar"
tools:visibility="visible" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/bio"
android:layout_width="match_parent"

View file

@ -240,6 +240,7 @@
<string name="action_unmute">Unmute</string>
<string name="request_sent">Request sent</string>
<string name="followed_by">Follows you</string>
<string name="requested_by">Requested to follow you</string>
<string name="set_capitalize">First letter in capital for replies</string>
<string name="set_resize_picture">Resize pictures</string>
<string name="set_resize_video">Resize videos</string>

View file

@ -1,9 +1,11 @@
Added:
- Add a button to fetch remote media when it fails
- Add a settings to automatically fetch remote media when it fails (default: disabled)
- Display on profiles & list of accounts if users have requested to follow you
Changed:
- Warn when there are missing descriptions enabled by default
Fixed:
- Some settings not properly restored (multiple choices)
- Some settings not properly restored (multiple choices)
- Cancel a follow request