mirror of
https://github.com/NekoX-Dev/NekoX.git
synced 2024-11-29 03:50:08 +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 int transitionIndex;
|
||||||
private TLRPC.Document preloadedSticker;
|
private TLRPC.Document preloadedSticker;
|
||||||
|
|
||||||
|
private boolean hideNumber;
|
||||||
|
|
||||||
private final Property<ProfileActivity, Float> HEADER_SHADOW = new AnimationProperties.FloatProperty<ProfileActivity>("headerShadow") {
|
private final Property<ProfileActivity, Float> HEADER_SHADOW = new AnimationProperties.FloatProperty<ProfileActivity>("headerShadow") {
|
||||||
@Override
|
@Override
|
||||||
public void setValue(ProfileActivity object, float value) {
|
public void setValue(ProfileActivity object, float value) {
|
||||||
@ -2741,6 +2743,12 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
return Unit.INSTANCE;
|
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());
|
showDialog(builder.create());
|
||||||
|
|
||||||
} else if (position == phoneRow) {
|
} else if (position == phoneRow) {
|
||||||
@ -2778,6 +2786,12 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
return Unit.INSTANCE;
|
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());
|
showDialog(builder.create());
|
||||||
|
|
||||||
} else if (position == setAvatarRow) {
|
} else if (position == setAvatarRow) {
|
||||||
@ -5248,7 +5262,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
if (UserObject.isUserSelf(user)) {
|
if (UserObject.isUserSelf(user)) {
|
||||||
numberSectionRow = rowCount++;
|
numberSectionRow = rowCount++;
|
||||||
setUsernameRow = rowCount++;
|
setUsernameRow = rowCount++;
|
||||||
numberRow = rowCount++;
|
if (!hideNumber) {
|
||||||
|
numberRow = rowCount++;
|
||||||
|
}
|
||||||
bioRow = rowCount++;
|
bioRow = rowCount++;
|
||||||
settingsSectionRow = rowCount++;
|
settingsSectionRow = rowCount++;
|
||||||
settingsSectionRow2 = rowCount++;
|
settingsSectionRow2 = rowCount++;
|
||||||
@ -5279,7 +5295,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
if (user != null && !TextUtils.isEmpty(user.username)) {
|
if (user != null && !TextUtils.isEmpty(user.username)) {
|
||||||
usernameRow = rowCount++;
|
usernameRow = rowCount++;
|
||||||
}
|
}
|
||||||
if (!isBot && (hasPhone || !hasInfo)) {
|
if (!isBot && (hasPhone || !hasInfo) && !hideNumber) {
|
||||||
phoneRow = rowCount++;
|
phoneRow = rowCount++;
|
||||||
}
|
}
|
||||||
if (userInfo != null && !TextUtils.isEmpty(userInfo.about)) {
|
if (userInfo != null && !TextUtils.isEmpty(userInfo.about)) {
|
||||||
@ -5746,6 +5762,10 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
return Unit.INSTANCE;
|
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();
|
builder.show();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user