1
0
mirror of https://github.com/NekoX-Dev/NekoX.git synced 2024-11-29 06:40:15 +01:00

Allow hide phone and id

This commit is contained in:
世界 2021-01-17 19:39:32 +08:00
parent ec69d53713
commit 6469b03304
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
2 changed files with 27 additions and 4 deletions

View File

@ -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();
}); });
} }

5
run
View File

@ -3,5 +3,8 @@
TARGET="bin" TARGET="bin"
for e in $@; do for e in $@; do
TARGET="$TARGET/$e" TARGET="$TARGET/$e"
shift
if [ -x "${TARGET}.sh" ]; then
exec "${TARGET}.sh" $@
fi
done done
exec ${TARGET}.sh