diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java index 11161ddbc..eb0b4b481 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java @@ -232,6 +232,8 @@ public class MessagesController extends BaseController implements NotificationCe private boolean loadingAppConfig; + public int thisDc; + public boolean enableJoined; public String linkPrefix; public int maxGroupCount; @@ -1173,6 +1175,7 @@ public class MessagesController extends BaseController implements NotificationCe AndroidUtilities.runOnUIThread(() -> { getDownloadController().loadAutoDownloadConfig(false); loadAppConfig(); + thisDc = config.this_dc; maxMegagroupCount = config.megagroup_size_max; maxGroupCount = config.chat_size_max; maxEditTime = config.edit_time_limit; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCheckCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCheckCell.java index 5801d3e19..1df260d45 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCheckCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCheckCell.java @@ -18,6 +18,7 @@ import android.view.MotionEvent; import android.view.View; import android.view.accessibility.AccessibilityNodeInfo; import android.widget.FrameLayout; +import android.widget.LinearLayout; import android.widget.TextView; import org.telegram.messenger.AndroidUtilities; @@ -31,7 +32,7 @@ import org.telegram.ui.Components.Switch; import java.util.ArrayList; -public class DrawerActionCheckCell extends FrameLayout { +public class DrawerActionCheckCell extends LinearLayout { private TextView textView; private TextView valueTextView; @@ -70,11 +71,14 @@ public class DrawerActionCheckCell extends FrameLayout { public DrawerActionCheckCell(Context context, int padding, boolean dialog) { super(context); + setOrientation(LinearLayout.HORIZONTAL); + setGravity(Gravity.CENTER_VERTICAL); + textView = new TextView(context); textView.setTextColor(Theme.getColor(dialog ? Theme.key_dialogTextBlack : Theme.key_windowBackgroundWhiteBlackText)); textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); textView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL); - addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 70 : padding, 0, LocaleController.isRTL ? padding : 70, 0)); + addView(textView, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 70 : padding, 0, LocaleController.isRTL ? padding : 70, 0)); valueTextView = new TextView(context); valueTextView.setTextColor(Theme.getColor(dialog ? Theme.key_dialogIcon : Theme.key_windowBackgroundWhiteGrayText2)); @@ -85,11 +89,11 @@ public class DrawerActionCheckCell extends FrameLayout { valueTextView.setSingleLine(true); valueTextView.setPadding(0, 0, 0, 0); valueTextView.setEllipsize(TextUtils.TruncateAt.END); - addView(valueTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 64 : padding, 36, LocaleController.isRTL ? padding : 64, 0)); + addView(valueTextView, LayoutHelper.createLinear(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 64 : padding, 36, LocaleController.isRTL ? padding : 64, 0)); checkBox = new Switch(context); checkBox.setColors(Theme.key_switchTrack, Theme.key_switchTrackChecked, Theme.key_windowBackgroundWhite, Theme.key_windowBackgroundWhite); - addView(checkBox, LayoutHelper.createFrame(37, 20, (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.CENTER_VERTICAL, 22, 0, 22, 0)); + addView(checkBox, LayoutHelper.createLinear(37, 20, (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.CENTER_VERTICAL, 22, 0, 22, 0)); setClipChildren(false); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java index 9244c8796..12c3ed71c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java @@ -139,7 +139,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.concurrent.CountDownLatch; -import kotlin.collections.ArraysKt; import tw.nekomimi.nekogram.NekoConfig; import tw.nekomimi.nekogram.NekoXConfig; import tw.nekomimi.nekogram.utils.ProxyUtil; @@ -527,7 +526,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. for (int i = 0; i < 2; i++) { final GradientDrawable.Orientation orientation = i == 0 ? GradientDrawable.Orientation.LEFT_RIGHT : GradientDrawable.Orientation.RIGHT_LEFT; - pressedOverlayGradient[i] = new GradientDrawable(orientation, new int[] {0x32000000, 0}); + pressedOverlayGradient[i] = new GradientDrawable(orientation, new int[]{0x32000000, 0}); pressedOverlayGradient[i].setShape(GradientDrawable.RECTANGLE); } @@ -1348,7 +1347,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. openAddMember(); } else if (id == statistics) { Bundle args = new Bundle(); - args.putInt("chat_id",chat_id); + args.putInt("chat_id", chat_id); StatisticActivity fragment = new StatisticActivity(args); presentFragment(fragment); } else if (id == start_secret_chat) { @@ -2255,6 +2254,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. } } } + public boolean onMemberClick(TLRPC.ChatParticipant participant, boolean isLong) { return onMemberClick(participant, isLong, false); } @@ -4136,6 +4136,8 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. if (user.photo != null && user.photo.dc_id != 0) { idTextView.setText("ID: " + user_id + ", DC: " + user.photo.dc_id); + } else if (user.id == getUserConfig().clientUserId) { + idTextView.setText("ID: " + user_id + ", DC: " + getMessagesController().thisDc); } else { idTextView.setText("ID: " + user_id); }