mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2025-06-25 14:40:09 +03:00
Follow Request By
This commit is contained in:
parent
7f9d6ca2d5
commit
7c1d5a4830
7 changed files with 52 additions and 8 deletions
|
@ -625,18 +625,18 @@ public class ProfileActivity extends BaseActivity {
|
||||||
binding.accountFollow.setContentDescription(getString(R.string.action_disabled));
|
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) {
|
if (relationship.followed_by) {
|
||||||
binding.accountFollowedBy.setVisibility(View.VISIBLE);
|
binding.accountFollowedBy.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
binding.accountFollowedBy.setVisibility(View.GONE);
|
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) {
|
if (relationship.following) {
|
||||||
binding.accountFollow.setIconResource(R.drawable.ic_baseline_person_remove_24);
|
binding.accountFollow.setIconResource(R.drawable.ic_baseline_person_remove_24);
|
||||||
binding.accountFollow.setBackgroundTintList(ColorStateList.valueOf(ThemeHelper.getAttColor(this, R.attr.colorError)));
|
binding.accountFollow.setBackgroundTintList(ColorStateList.valueOf(ThemeHelper.getAttColor(this, R.attr.colorError)));
|
||||||
|
@ -649,12 +649,20 @@ public class ProfileActivity extends BaseActivity {
|
||||||
doAction = action.UNBLOCK;
|
doAction = action.UNBLOCK;
|
||||||
binding.accountFollow.setVisibility(View.VISIBLE);
|
binding.accountFollow.setVisibility(View.VISIBLE);
|
||||||
binding.accountFollow.setContentDescription(getString(R.string.action_unblock));
|
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 {
|
} else {
|
||||||
binding.accountFollow.setIconResource(R.drawable.ic_baseline_person_add_24);
|
binding.accountFollow.setIconResource(R.drawable.ic_baseline_person_add_24);
|
||||||
doAction = action.FOLLOW;
|
doAction = action.FOLLOW;
|
||||||
binding.accountFollow.setVisibility(View.VISIBLE);
|
binding.accountFollow.setVisibility(View.VISIBLE);
|
||||||
binding.accountFollow.setContentDescription(getString(R.string.action_follow));
|
binding.accountFollow.setContentDescription(getString(R.string.action_follow));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//The value for account is from same server so id can be used
|
//The value for account is from same server so id can be used
|
||||||
|
|
||||||
if (account.id.equals(currentAccount.user_id)) {
|
if (account.id.equals(currentAccount.user_id)) {
|
||||||
|
|
|
@ -32,6 +32,9 @@ public class RelationShip {
|
||||||
public boolean followed_by;
|
public boolean followed_by;
|
||||||
@SerializedName("blocking")
|
@SerializedName("blocking")
|
||||||
public boolean blocking;
|
public boolean blocking;
|
||||||
|
|
||||||
|
@SerializedName("requested_by")
|
||||||
|
public boolean requested_by;
|
||||||
@SerializedName("blocked_by")
|
@SerializedName("blocked_by")
|
||||||
public boolean blocked_by;
|
public boolean blocked_by;
|
||||||
@SerializedName("muting")
|
@SerializedName("muting")
|
||||||
|
|
|
@ -148,6 +148,11 @@ public class AccountAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
} else {
|
} else {
|
||||||
accountViewHolder.binding.followIndicator.setVisibility(View.GONE);
|
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) {
|
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);
|
||||||
|
|
|
@ -319,6 +319,18 @@
|
||||||
android:textColor="@color/verified_text"
|
android:textColor="@color/verified_text"
|
||||||
android:visibility="gone" />
|
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
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/account_follow_request"
|
android:id="@+id/account_follow_request"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
|
@ -87,6 +87,19 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/avatar"
|
app:layout_constraintTop_toBottomOf="@id/avatar"
|
||||||
tools:visibility="visible" />
|
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
|
<com.google.android.material.textview.MaterialTextView
|
||||||
android:id="@+id/bio"
|
android:id="@+id/bio"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -240,6 +240,7 @@
|
||||||
<string name="action_unmute">Unmute</string>
|
<string name="action_unmute">Unmute</string>
|
||||||
<string name="request_sent">Request sent</string>
|
<string name="request_sent">Request sent</string>
|
||||||
<string name="followed_by">Follows you</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_capitalize">First letter in capital for replies</string>
|
||||||
<string name="set_resize_picture">Resize pictures</string>
|
<string name="set_resize_picture">Resize pictures</string>
|
||||||
<string name="set_resize_video">Resize videos</string>
|
<string name="set_resize_video">Resize videos</string>
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
Added:
|
Added:
|
||||||
- Add a button to fetch remote media when it fails
|
- Add a button to fetch remote media when it fails
|
||||||
- Add a settings to automatically fetch remote media when it fails (default: disabled)
|
- 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:
|
Changed:
|
||||||
- Warn when there are missing descriptions enabled by default
|
- Warn when there are missing descriptions enabled by default
|
||||||
|
|
||||||
Fixed:
|
Fixed:
|
||||||
- Some settings not properly restored (multiple choices)
|
- Some settings not properly restored (multiple choices)
|
||||||
|
- Cancel a follow request
|
Loading…
Reference in a new issue