mirror of
https://github.com/NekoX-Dev/NekoX.git
synced 2024-11-29 01:00:46 +01:00
Allow hide phone and id
This commit is contained in:
parent
ec69d53713
commit
6469b03304
@ -418,6 +418,8 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
private int transitionIndex;
|
||||
private TLRPC.Document preloadedSticker;
|
||||
|
||||
private boolean hideNumber;
|
||||
|
||||
private final Property<ProfileActivity, Float> HEADER_SHADOW = new AnimationProperties.FloatProperty<ProfileActivity>("headerShadow") {
|
||||
@Override
|
||||
public void setValue(ProfileActivity object, float value) {
|
||||
@ -2741,6 +2743,12 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
|
||||
builder.addItem(LocaleController.getString("Hide", R.string.Hide), R.drawable.baseline_remove_circle_24, __ -> {
|
||||
hideNumber = true;
|
||||
updateListAnimated();
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
|
||||
showDialog(builder.create());
|
||||
|
||||
} else if (position == phoneRow) {
|
||||
@ -2778,6 +2786,12 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
|
||||
builder.addItem(LocaleController.getString("Hide", R.string.Hide), R.drawable.baseline_remove_circle_24, __ -> {
|
||||
hideNumber = true;
|
||||
updateListAnimated();
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
|
||||
showDialog(builder.create());
|
||||
|
||||
} else if (position == setAvatarRow) {
|
||||
@ -5248,7 +5262,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
if (UserObject.isUserSelf(user)) {
|
||||
numberSectionRow = rowCount++;
|
||||
setUsernameRow = rowCount++;
|
||||
numberRow = rowCount++;
|
||||
if (!hideNumber) {
|
||||
numberRow = rowCount++;
|
||||
}
|
||||
bioRow = rowCount++;
|
||||
settingsSectionRow = rowCount++;
|
||||
settingsSectionRow2 = rowCount++;
|
||||
@ -5279,7 +5295,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
if (user != null && !TextUtils.isEmpty(user.username)) {
|
||||
usernameRow = rowCount++;
|
||||
}
|
||||
if (!isBot && (hasPhone || !hasInfo)) {
|
||||
if (!isBot && (hasPhone || !hasInfo) && !hideNumber) {
|
||||
phoneRow = rowCount++;
|
||||
}
|
||||
if (userInfo != null && !TextUtils.isEmpty(userInfo.about)) {
|
||||
@ -5746,6 +5762,10 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
}
|
||||
builder.addItem(LocaleController.getString("Hide", R.string.Hide), R.drawable.baseline_remove_circle_24, __ -> {
|
||||
idTextView.setVisibility(View.GONE);
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
builder.show();
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user