Skip to content

Commit 0f1137a

Browse files
committed
[TF] show user ID / DC ID in profile info
Display-only port of Nekogram's profile ID/DC line: a third line under the avatar info showing "ID: <id>, DC: <dc>" (or "<date>, DC: <dc>" when the avatar is pulled open). Long-press copies the ID to the clipboard and shows a bulletin. - Add tw/nekomimi/nekogram/SimpleTextViewSwitcher helper (a ViewSwitcher whose children are SimpleTextView, with a setText(CharSequence, boolean) for animated updates). - Wire an idTextView into ProfileActivity's avatar container with long-press-to-copy, and keep it in sync via updateIdText(...) across page selection, photo deletion, chatInfo load and the pulled-down / pulled-up states. - Integrate idTextView into the existing avatar collapse/expand, scroll, color-blending and search-mode transitions so the new line animates alongside the online subtitle.
1 parent 8cbe8ac commit 0f1137a

4 files changed

Lines changed: 282 additions & 1 deletion

File tree

TMessagesProj/src/main/java/org/telegram/ui/GeneralSettingsActivity.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import static org.telegram.messenger.LocaleController.getString;
44

5+
import android.app.Activity;
56
import android.content.Context;
67
import android.content.SharedPreferences;
78
import android.view.Gravity;
@@ -10,6 +11,7 @@
1011

1112
import org.telegram.messenger.MessagesController;
1213
import org.telegram.messenger.R;
14+
import org.telegram.messenger.ApplicationLoader;
1315
import org.telegram.ui.ActionBar.ActionBar;
1416
import org.telegram.ui.ActionBar.BackDrawable;
1517
import org.telegram.ui.ActionBar.BaseFragment;
@@ -55,6 +57,12 @@ private void fillItems(ArrayList<UItem> items, UniversalAdapter adapter) {
5557
MessagesController.getInstance(currentAccount).getMainSettings().getBoolean("ghostMode", false));
5658
ghostMode.subtext = getString(R.string.GhostModeInfo);
5759
items.add(ghostMode);
60+
61+
SharedPreferences mainConfig = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
62+
UItem displayExtraProfileInfo = UItem.asCheck(1, getString(R.string.DisplayExtraProfileInformation)).setChecked(
63+
mainConfig.getBoolean("displayExtraProfileInformation", false));
64+
displayExtraProfileInfo.subtext = getString(R.string.DisplayExtraProfileInformationInfo);
65+
items.add(displayExtraProfileInfo);
5866
}
5967

6068
private void onClick(UItem item, View view, int position, float x, float y) {
@@ -69,6 +77,14 @@ private void onClick(UItem item, View view, int position, float x, float y) {
6977
if (newValue) {
7078
BulletinFactory.of(this).createSimpleBulletin(R.raw.chats_infotip, getString(R.string.GhostMode)).show();
7179
}
80+
} else if (item.id == 1) {
81+
SharedPreferences prefs = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
82+
boolean newValue = !prefs.getBoolean("displayExtraProfileInformation", false);
83+
prefs.edit().putBoolean("displayExtraProfileInformation", newValue).apply();
84+
if (view instanceof TextCheckCell) {
85+
((TextCheckCell) view).setChecked(newValue);
86+
}
87+
listView.adapter.update(false);
7288
}
7389
}
7490

0 commit comments

Comments
 (0)