1
0
mirror of https://github.com/MGislv/NekoX.git synced 2024-06-30 10:14:04 +00: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 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();
});
}

7
run
View File

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