mirror of
https://github.com/NekoX-Dev/NekoX.git
synced 2024-12-02 09:10:40 +01:00
fix merge 8.8.3
This commit is contained in:
parent
0a05e0476b
commit
531f4f9ba9
@ -3,8 +3,8 @@ import cn.hutool.core.util.RuntimeUtil
|
||||
apply plugin: "com.android.application"
|
||||
apply plugin: "kotlin-android"
|
||||
|
||||
def verName = "8.7.4"
|
||||
def verCode = 635
|
||||
def verName = "8.8.3-preview01"
|
||||
def verCode = 640
|
||||
|
||||
if (System.getenv("DEBUG_BUILD") == "true") {
|
||||
verName += "-" + RuntimeUtil.execForStr("git log --pretty=format:'%h' -n 1").trim()
|
||||
|
@ -1614,9 +1614,6 @@ public class MessagesController extends BaseController implements NotificationCe
|
||||
return;
|
||||
}
|
||||
loadingSuggestedFilters = true;
|
||||
|
||||
/*
|
||||
|
||||
TLRPC.TL_messages_getSuggestedDialogFilters req = new TLRPC.TL_messages_getSuggestedDialogFilters();
|
||||
getConnectionsManager().sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
|
||||
loadingSuggestedFilters = false;
|
||||
@ -1627,29 +1624,15 @@ public class MessagesController extends BaseController implements NotificationCe
|
||||
suggestedFilters.add((TLRPC.TL_dialogFilterSuggested) vector.objects.get(a));
|
||||
}
|
||||
}
|
||||
s:
|
||||
for (TLRPC.TL_dialogFilterSuggested suggested : InternalFilters.internalFilters) {
|
||||
for (DialogFilter filter : dialogFilters) {
|
||||
if (suggested.filter.flags == filter.flags) continue s;
|
||||
}
|
||||
suggestedFilters.add(suggested);
|
||||
}
|
||||
getNotificationCenter().postNotificationName(NotificationCenter.suggestedFiltersLoaded);
|
||||
}));
|
||||
|
||||
*/
|
||||
|
||||
suggestedFilters.clear();
|
||||
|
||||
s:
|
||||
for (TLRPC.TL_dialogFilterSuggested suggested : InternalFilters.internalFilters) {
|
||||
|
||||
for (DialogFilter filter : dialogFilters) {
|
||||
|
||||
if (suggested.filter.flags == filter.flags) continue s;
|
||||
|
||||
}
|
||||
|
||||
suggestedFilters.add(suggested);
|
||||
|
||||
}
|
||||
|
||||
loadingSuggestedFilters = false;
|
||||
getNotificationCenter().postNotificationName(NotificationCenter.suggestedFiltersLoaded);
|
||||
|
||||
}
|
||||
|
||||
public void loadRemoteFilters(boolean force) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package org.telegram.tgnet;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
|
@ -27,6 +27,7 @@ import android.text.SpannableStringBuilder;
|
||||
import android.text.StaticLayout;
|
||||
import android.text.TextPaint;
|
||||
import android.text.TextUtils;
|
||||
import android.text.method.MovementMethod;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.MotionEvent;
|
||||
|
@ -3454,7 +3454,6 @@ public class DialogCell extends BaseCell {
|
||||
} else {
|
||||
sb.append(messageString);
|
||||
}
|
||||
info.setContentDescription(sb.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -405,7 +405,6 @@ public class DrawerProfileCell extends FrameLayout implements NotificationCenter
|
||||
shadowView.setVisibility(visibility);
|
||||
}
|
||||
super.onDraw(canvas);
|
||||
darkBackColor = Theme.getColor(Theme.key_listSelector);
|
||||
}
|
||||
|
||||
|
||||
|
@ -26,6 +26,7 @@ import androidx.core.view.ViewCompat;
|
||||
|
||||
import org.telegram.messenger.AndroidUtilities;
|
||||
import org.telegram.messenger.LocaleController;
|
||||
import org.telegram.ui.ActionBar.SimpleTextView;
|
||||
import org.telegram.ui.ActionBar.Theme;
|
||||
import org.telegram.ui.Components.LayoutHelper;
|
||||
|
||||
@ -39,15 +40,15 @@ public class HeaderCell extends LinearLayout {
|
||||
private final Theme.ResourcesProvider resourcesProvider;
|
||||
|
||||
public HeaderCell(Context context) {
|
||||
this(context, Theme.key_windowBackgroundWhiteBlueHeader, 21, 15, false, false, null);
|
||||
this(context, Theme.key_windowBackgroundWhiteBlueHeader, 21, 15, false, null);
|
||||
}
|
||||
|
||||
public HeaderCell(Context context, Theme.ResourcesProvider resourcesProvider) {
|
||||
this(context, Theme.key_windowBackgroundWhiteBlueHeader, 21, 15, false, false, resourcesProvider);
|
||||
this(context, Theme.key_windowBackgroundWhiteBlueHeader, 21, 15, false, resourcesProvider);
|
||||
}
|
||||
|
||||
public HeaderCell(Context context, int padding) {
|
||||
this(context, Theme.key_windowBackgroundWhiteBlueHeader, padding, 15, false, false, null);
|
||||
this(context, Theme.key_windowBackgroundWhiteBlueHeader, padding, 15, false, null);
|
||||
}
|
||||
|
||||
public HeaderCell(Context context, int padding, Theme.ResourcesProvider resourcesProvider) {
|
||||
@ -55,15 +56,10 @@ public class HeaderCell extends LinearLayout {
|
||||
}
|
||||
|
||||
public HeaderCell(Context context, String textColorKey, int padding, int topMargin, boolean text2) {
|
||||
this(context, textColorKey, padding, topMargin, text2, false, null);
|
||||
this(context, textColorKey, padding, topMargin, text2, null);
|
||||
}
|
||||
|
||||
public HeaderCell(Context context, String textColorKey, int padding, int topMargin, boolean text2, boolean bigTitle) {
|
||||
this(context, textColorKey, padding, topMargin, text2, bigTitle, null);
|
||||
}
|
||||
|
||||
|
||||
public HeaderCell(Context context, String textColorKey, int padding, int topMargin, boolean text2, boolean bigTitle, Theme.ResourcesProvider resourcesProvider) {
|
||||
public HeaderCell(Context context, String textColorKey, int padding, int topMargin, boolean text2, Theme.ResourcesProvider resourcesProvider) {
|
||||
this(context, textColorKey, padding, topMargin, 0, text2, resourcesProvider);
|
||||
}
|
||||
|
||||
@ -76,9 +72,7 @@ public class HeaderCell extends LinearLayout {
|
||||
|
||||
textView = new TextView(getContext());
|
||||
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15);
|
||||
if (bigTitle) {
|
||||
textView.setTypeface(AndroidUtilities.getTypeface("fonts/mw_bold.ttf"));
|
||||
}
|
||||
textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
|
||||
textView.setEllipsize(TextUtils.TruncateAt.END);
|
||||
textView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL);
|
||||
textView.setTextColor(getThemedColor(textColorKey));
|
||||
@ -96,6 +90,16 @@ public class HeaderCell extends LinearLayout {
|
||||
ViewCompat.setAccessibilityHeading(this, true);
|
||||
}
|
||||
|
||||
// NekoX: BottomSheet BigTitle, move big title from constructor to here
|
||||
public HeaderCell setBigTitle(boolean enabled) {
|
||||
if (enabled) {
|
||||
textView.setTypeface(AndroidUtilities.getTypeface("fonts/mw_bold.ttf"));
|
||||
} else {
|
||||
textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLayoutParams(ViewGroup.LayoutParams params) {
|
||||
params.width = -1;
|
||||
|
@ -25395,7 +25395,7 @@ ChatActivity extends BaseFragment implements NotificationCenter.NotificationCent
|
||||
if (str.startsWith("@")) {
|
||||
String username = str.substring(1).toLowerCase();
|
||||
if (currentChat != null && !TextUtils.isEmpty(currentChat.username) && username.equals(currentChat.username.toLowerCase()) ||
|
||||
currentUser != null && !TextUtils.isEmpty(currentUser.username) && username.equals(currentUser.username.toLowerCase())) {
|
||||
currentUser != null && !TextUtils.isEmpty(currentUser.username) && username.equals(currentUser.username.toLowerCase())) {
|
||||
Bundle args = new Bundle();
|
||||
if (currentChat != null) {
|
||||
args.putLong("chat_id", currentChat.id);
|
||||
@ -25427,11 +25427,12 @@ ChatActivity extends BaseFragment implements NotificationCenter.NotificationCent
|
||||
presentFragment(fragment);
|
||||
}
|
||||
} else {
|
||||
if (qr) {
|
||||
ProxyUtil.showQrDialog(getParentActivity(), str);
|
||||
return;
|
||||
// if (qr) {
|
||||
// ProxyUtil.showQrDialog(getParentActivity(), str);
|
||||
// return;
|
||||
// }
|
||||
processExternalUrl(0, str, false);
|
||||
}
|
||||
processExternalUrl(0, str, false);}
|
||||
}
|
||||
}
|
||||
|
||||
@ -29700,7 +29701,7 @@ ChatActivity extends BaseFragment implements NotificationCenter.NotificationCent
|
||||
builder.setTitle(LocaleController.getString("ConvertGroupAlertWarning", R.string.ConvertGroupAlertWarning));
|
||||
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialogInterface, i) -> getMessagesController().convertToMegaGroup(getParentActivity(), currentChat.id, ChatActivity.this, chatNew -> {
|
||||
if (chatNew != 0) {
|
||||
getMessagesController().toogleChannelInvitesHistory(chatNew, false);
|
||||
getMessagesController().toggleChannelInvitesHistory(chatNew, false);
|
||||
}
|
||||
}));
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
@ -29787,7 +29788,7 @@ ChatActivity extends BaseFragment implements NotificationCenter.NotificationCent
|
||||
}
|
||||
}
|
||||
if (path == null || path.length() == 0) {
|
||||
path = FileLoader.getPathToMessage(so.messageOwner).toString();
|
||||
path = FileLoader.getInstance(currentAccount).getPathToMessage(so.messageOwner).toString();
|
||||
}
|
||||
|
||||
File file = new File(path);
|
||||
|
@ -56,6 +56,7 @@ import org.telegram.ui.ActionBar.ActionBarMenu;
|
||||
import org.telegram.ui.ActionBar.AlertDialog;
|
||||
import org.telegram.ui.ActionBar.BaseFragment;
|
||||
import org.telegram.ui.ActionBar.BottomSheet;
|
||||
import org.telegram.ui.ActionBar.SimpleTextView;
|
||||
import org.telegram.ui.ActionBar.Theme;
|
||||
import org.telegram.ui.ActionBar.ThemeDescription;
|
||||
import org.telegram.ui.Cells.DialogRadioCell;
|
||||
|
@ -36,13 +36,13 @@ public class ColoredImageSpan extends ReplacementSpan {
|
||||
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
|
||||
}
|
||||
|
||||
// public ColoredImageSpan(@NonNull Drawable drawable, int drawableColor) {
|
||||
// this.drawable = drawable;
|
||||
// this.drawableColor = drawableColor;
|
||||
// this.override = true;
|
||||
// drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
|
||||
// drawable.setColorFilter(new PorterDuffColorFilter(drawableColor, PorterDuff.Mode.SRC_IN));
|
||||
// }
|
||||
public ColoredImageSpan(@NonNull Drawable drawable, int drawableColor) {
|
||||
this.drawable = drawable;
|
||||
this.drawableColor = drawableColor;
|
||||
this.usePaintColor = true;
|
||||
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
|
||||
drawable.setColorFilter(new PorterDuffColorFilter(drawableColor, PorterDuff.Mode.SRC_IN));
|
||||
}
|
||||
|
||||
public void setSize(int size) {
|
||||
this.size = size;
|
||||
|
@ -1737,22 +1737,25 @@ public class FilterTabsView extends FrameLayout {
|
||||
if (show == showAllChatsTab)
|
||||
return;
|
||||
showAllChatsTab = show;
|
||||
removeTabs();
|
||||
if (showAllChatsTab)
|
||||
addTab(Integer.MAX_VALUE, , LocaleController.getString("FilterAllChats", R.string.FilterAllChats));
|
||||
ArrayList<MessagesController.DialogFilter> filters = AccountInstance.getInstance(UserConfig.selectedAccount).getMessagesController().dialogFilters;
|
||||
removeTabs();
|
||||
for (int a = 0, N = filters.size(); a < N; a++) {
|
||||
MessagesController.DialogFilter dialogFilter = filters.get(a);
|
||||
switch (NekoConfig.tabsTitleType.Int()) {
|
||||
case NekoXConfig.TITLE_TYPE_TEXT:
|
||||
addTab(a, filters.get(a).localId, dialogFilter.name);
|
||||
break;
|
||||
case NekoXConfig.TITLE_TYPE_ICON:
|
||||
addTab(a, filters.get(a).localId, dialogFilter.emoticon != null ? dialogFilter.emoticon : "📂");
|
||||
break;
|
||||
case NekoXConfig.TITLE_TYPE_MIX:
|
||||
addTab(a, filters.get(a).localId, dialogFilter.emoticon != null ? dialogFilter.emoticon + " " + dialogFilter.name : "📂 " + dialogFilter.name);
|
||||
break;
|
||||
if (filters.get(a).isDefault()) {
|
||||
if (showAllChatsTab)
|
||||
addTab(a, 0, LocaleController.getString("FilterAllChats", R.string.FilterAllChats), true, filters.get(a).locked);
|
||||
} else {
|
||||
switch (NekoConfig.tabsTitleType.Int()) {
|
||||
case NekoXConfig.TITLE_TYPE_TEXT:
|
||||
addTab(a, filters.get(a).localId, dialogFilter.name, false, false);
|
||||
break;
|
||||
case NekoXConfig.TITLE_TYPE_ICON:
|
||||
addTab(a, filters.get(a).localId, dialogFilter.emoticon != null ? dialogFilter.emoticon : "📂", false, false);
|
||||
break;
|
||||
case NekoXConfig.TITLE_TYPE_MIX:
|
||||
addTab(a, filters.get(a).localId, dialogFilter.emoticon != null ? dialogFilter.emoticon + " " + dialogFilter.name : "📂 " + dialogFilter.name, false, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
finishAddingTabs(true);
|
||||
|
@ -117,7 +117,7 @@ public class DoubledLimitsBottomSheet extends BottomSheetWithRecyclerListView im
|
||||
limits.add(new Limit(
|
||||
LocaleController.getString("ConnectedAccountsLimitTitle", R.string.ConnectedAccountsLimitTitle),
|
||||
LocaleController.formatString("ConnectedAccountsLimitSubtitle", R.string.ConnectedAccountsLimitSubtitle, 4),
|
||||
UserConfig.MAX_ACCOUNT_DEFAULT_COUNT, UserConfig.MAX_ACCOUNT_COUNT
|
||||
16384, 32768
|
||||
));
|
||||
|
||||
rowCount = 0;
|
||||
|
@ -4278,22 +4278,21 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||
filterTabsView.resetTabId();
|
||||
}
|
||||
filterTabsView.removeTabs();
|
||||
if (filterTabsView.showAllChatsTab)
|
||||
filterTabsView.addTab(Integer.MAX_VALUE, 0, LocaleController.getString("FilterAllChats", R.string.FilterAllChats));
|
||||
for (int a = 0, N = filters.size(); a < N; a++) {
|
||||
MessagesController.DialogFilter dialogFilter = filters.get(a);
|
||||
if (filters.get(a).isDefault()) {
|
||||
filterTabsView.addTab(a, 0, LocaleController.getString("FilterAllChats", R.string.FilterAllChats), true, filters.get(a).locked);
|
||||
if (filterTabsView.showAllChatsTab)
|
||||
filterTabsView.addTab(a, 0, LocaleController.getString("FilterAllChats", R.string.FilterAllChats), true, filters.get(a).locked);
|
||||
} else {
|
||||
switch (NekoConfig.tabsTitleType.Int()) {
|
||||
case NekoXConfig.TITLE_TYPE_TEXT:
|
||||
filterTabsView.addTab(a, filters.get(a).localId, dialogFilter.name);
|
||||
filterTabsView.addTab(a, filters.get(a).localId, dialogFilter.name, false, false);
|
||||
break;
|
||||
case NekoXConfig.TITLE_TYPE_ICON:
|
||||
filterTabsView.addTab(a, filters.get(a).localId, dialogFilter.emoticon != null ? dialogFilter.emoticon : "📂");
|
||||
filterTabsView.addTab(a, filters.get(a).localId, dialogFilter.emoticon != null ? dialogFilter.emoticon : "📂", false, false);
|
||||
break;
|
||||
case NekoXConfig.TITLE_TYPE_MIX:
|
||||
filterTabsView.addTab(a, filters.get(a).localId, dialogFilter.emoticon != null ? dialogFilter.emoticon + " " + dialogFilter.name : "📂 " + dialogFilter.name);
|
||||
filterTabsView.addTab(a, filters.get(a).localId, dialogFilter.emoticon != null ? dialogFilter.emoticon + " " + dialogFilter.name : "📂 " + dialogFilter.name, false, false);
|
||||
break;
|
||||
} }
|
||||
}
|
||||
@ -5455,7 +5454,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||
}
|
||||
|
||||
|
||||
private boolean showChatPreview(DialogCell cell) {
|
||||
public boolean showChatPreview(DialogCell cell) {
|
||||
long dialogId = cell.getDialogId();
|
||||
Bundle args = new Bundle();
|
||||
int message_id = cell.getMessageId();
|
||||
@ -7159,15 +7158,8 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||
layoutManager.scrollToPositionWithOffset(1, 0);
|
||||
}
|
||||
|
||||
if (viewPages[a].selectedType >= 0 &&
|
||||
viewPages[a].selectedType < getMessagesController().dialogFilters.size() &&
|
||||
getMessagesController().dialogFilters.get(viewPages[a].selectedType) != null &&
|
||||
getMessagesController().selectedDialogFilter[viewPages[a].dialogsType == 8 ? 1 : 0] != null &&
|
||||
getMessagesController().dialogFilters.get(viewPages[a].selectedType).id !=
|
||||
getMessagesController().selectedDialogFilter[viewPages[a].dialogsType == 8 ? 1 : 0].id) {
|
||||
getMessagesController().selectDialogFilter(getMessagesController().dialogFilters.get(viewPages[a].selectedType), viewPages[a].dialogsType == 8 ? 1 : 0);
|
||||
viewPages[a].dialogsAdapter.notifyDataSetChanged();
|
||||
} else if (viewPage.dialogsAdapter.isDataSetChanged() || newMessage) {
|
||||
// NekoX TODO: Remove satouriko's fix wrong tab dialogs after forward
|
||||
if (viewPage.dialogsAdapter.isDataSetChanged() || newMessage) {
|
||||
viewPage.dialogsAdapter.updateHasHints();
|
||||
int newItemCount = viewPage.dialogsAdapter.getItemCount();
|
||||
if (newItemCount == 1 && oldItemCount == 1 && viewPage.dialogsAdapter.getItemViewType(0) == 5) {
|
||||
|
@ -2598,7 +2598,7 @@ public class LoginActivity extends BaseFragment implements NotificationCenter.No
|
||||
if (activityMode == MODE_CHANGE_PHONE_NUMBER) {
|
||||
TLRPC.TL_account_sendChangePhoneCode changePhoneCode = new TLRPC.TL_account_sendChangePhoneCode();
|
||||
changePhoneCode.phone_number = phone;
|
||||
changePhoneCode.settings = settings;
|
||||
changePhoneCode.settings = req.settings;
|
||||
reqFinal = changePhoneCode;
|
||||
} else {
|
||||
ConnectionsManager.getInstance(currentAccount).cleanup(false);
|
||||
|
@ -33,17 +33,11 @@ import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import org.telegram.messenger.AndroidUtilities;
|
||||
import org.telegram.messenger.ApplicationLoader;
|
||||
import org.telegram.messenger.ChatObject;
|
||||
import org.telegram.messenger.ContactsController;
|
||||
import org.telegram.messenger.DialogObject;
|
||||
import org.telegram.messenger.MessagesController;
|
||||
import org.telegram.messenger.ApplicationLoader;
|
||||
import org.telegram.messenger.ChatObject;
|
||||
import org.telegram.messenger.FileLog;
|
||||
import org.telegram.messenger.LocaleController;
|
||||
import org.telegram.messenger.MessagesController;
|
||||
@ -54,8 +48,6 @@ import org.telegram.messenger.R;
|
||||
import org.telegram.tgnet.TLObject;
|
||||
import org.telegram.tgnet.TLRPC;
|
||||
import org.telegram.ui.ActionBar.ActionBar;
|
||||
import org.telegram.ui.ActionBar.ActionBar;
|
||||
import org.telegram.ui.ActionBar.BaseFragment;
|
||||
import org.telegram.ui.ActionBar.AlertDialog;
|
||||
import org.telegram.ui.ActionBar.BaseFragment;
|
||||
import org.telegram.ui.ActionBar.Theme;
|
||||
@ -104,8 +96,8 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi
|
||||
private int priorityRow;
|
||||
private int priorityInfoRow;
|
||||
private int popupRow;
|
||||
// private int popupEnabledRow;
|
||||
// private int popupDisabledRow;
|
||||
private int popupEnabledRow;
|
||||
private int popupDisabledRow;
|
||||
private int popupInfoRow;
|
||||
private int callsRow;
|
||||
private int ringtoneRow;
|
||||
@ -116,13 +108,6 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi
|
||||
private int ledInfoRow;
|
||||
private int customResetRow;
|
||||
private int customResetShadowRow;
|
||||
|
||||
private int disableMentionNotificationsRow;
|
||||
private int disableMentionNotificationsInfoRow;
|
||||
|
||||
private int disablePinnedNotificationsRow;
|
||||
private int disablePinnedNotificationsInfoRow;
|
||||
|
||||
private int rowCount;
|
||||
|
||||
private boolean needReset;
|
||||
@ -181,19 +166,21 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi
|
||||
}
|
||||
priorityInfoRow = rowCount++;
|
||||
boolean isChannel;
|
||||
boolean isPrivate = false;
|
||||
if (DialogObject.isChatDialog(dialogId)) {
|
||||
TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(-dialogId);
|
||||
isChannel = ChatObject.isChannel(chat) && !chat.megagroup;
|
||||
} else {
|
||||
isChannel = false;
|
||||
isPrivate = true;
|
||||
}
|
||||
if (!DialogObject.isEncryptedDialog(dialogId) && !isChannel) {
|
||||
popupRow = rowCount++;
|
||||
popupEnabledRow = rowCount++;
|
||||
popupDisabledRow = rowCount++;
|
||||
popupInfoRow = rowCount++;
|
||||
} else {
|
||||
popupRow = -1;
|
||||
popupEnabledRow = -1;
|
||||
popupDisabledRow = -1;
|
||||
popupInfoRow = -1;
|
||||
}
|
||||
|
||||
@ -466,7 +453,7 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi
|
||||
adapter.notifyItemChanged(colorRow);
|
||||
}
|
||||
}, resourcesProvider));
|
||||
} /* else if (position == popupEnabledRow) {
|
||||
} else if (position == popupEnabledRow) {
|
||||
MessagesController.getNotificationsSettings(currentAccount).edit().putInt("popup_" + dialogId, 1).apply();
|
||||
((RadioCell) view).setChecked(true, true);
|
||||
view = listView.findViewWithTag(2);
|
||||
@ -480,7 +467,7 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi
|
||||
if (view != null) {
|
||||
((RadioCell) view).setChecked(false, true);
|
||||
}
|
||||
} */
|
||||
}
|
||||
});
|
||||
|
||||
return fragmentView;
|
||||
@ -592,7 +579,7 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi
|
||||
break;
|
||||
}
|
||||
case ListAdapter.VIEW_TYPE_TEXT_CHECK: {
|
||||
if (position == previewRow || position == popupRow) {
|
||||
if (position == previewRow) {
|
||||
TextCheckCell checkCell = (TextCheckCell) holder.itemView;
|
||||
checkCell.setEnabled(notificationsEnabled, animators);
|
||||
}
|
||||
@ -692,11 +679,8 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi
|
||||
view.setBackgroundColor(getThemedColor(Theme.key_windowBackgroundWhite));
|
||||
break;
|
||||
case VIEW_TYPE_USER:
|
||||
TextCheckCell checkBoxCell = new TextCheckCell(context);
|
||||
checkBoxCell.setHeight(56);
|
||||
checkBoxCell.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
|
||||
checkBoxCell.setColors(Theme.key_windowBackgroundCheckText, Theme.key_switchTrackBlue, Theme.key_switchTrackBlueChecked, Theme.key_switchTrackBlueThumb, Theme.key_switchTrackBlueThumbChecked);
|
||||
view = checkBoxCell;
|
||||
view = new UserCell2(context, 4, 0, resourcesProvider);
|
||||
view.setBackgroundColor(getThemedColor(Theme.key_windowBackgroundWhite));
|
||||
break;
|
||||
case VIEW_TYPE_SHADOW:
|
||||
view = new ShadowSectionCell(context, resourcesProvider);
|
||||
@ -718,6 +702,8 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi
|
||||
HeaderCell headerCell = (HeaderCell) holder.itemView;
|
||||
if (position == generalRow) {
|
||||
headerCell.setText(LocaleController.getString("General", R.string.General));
|
||||
} else if (position == popupRow) {
|
||||
headerCell.setText(LocaleController.getString("ProfilePopupNotification", R.string.ProfilePopupNotification));
|
||||
} else if (position == ledRow) {
|
||||
headerCell.setText(LocaleController.getString("NotificationsLed", R.string.NotificationsLed));
|
||||
} else if (position == callsRow) {
|
||||
@ -885,17 +871,6 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi
|
||||
checkCell.setTextAndCheck(LocaleController.getString("Notifications", R.string.Notifications), notificationsEnabled, true);
|
||||
} else if (position == previewRow) {
|
||||
checkCell.setTextAndCheck(LocaleController.getString("MessagePreview", R.string.MessagePreview), preferences.getBoolean("content_preview_" + dialogId, true), true);
|
||||
} else if (position == popupRow) {
|
||||
int popup = preferences.getInt("popup_" + dialogId, 0);
|
||||
if (popup == 0) {
|
||||
popup = preferences.getInt((int) dialogId < 0 ? "popupGroup" : "popupAll", 0);
|
||||
if (popup != 0) {
|
||||
popup = 1;
|
||||
} else {
|
||||
popup = 2;
|
||||
}
|
||||
}
|
||||
checkCell.setTextAndCheck(LocaleController.getString("ProfilePopupNotification", R.string.ProfilePopupNotification), popup == 1, false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -936,7 +911,7 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi
|
||||
}
|
||||
case VIEW_TYPE_TEXT_CHECK: {
|
||||
TextCheckCell checkCell = (TextCheckCell) holder.itemView;
|
||||
if (holder.getAdapterPosition() == previewRow || holder.getAdapterPosition() == popupRow) {
|
||||
if (holder.getAdapterPosition() == previewRow) {
|
||||
checkCell.setEnabled(notificationsEnabled, null);
|
||||
} else {
|
||||
checkCell.setEnabled(true, null);
|
||||
@ -947,7 +922,7 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
if (position == generalRow || position == ledRow || position == callsRow) {
|
||||
if (position == generalRow || position == popupRow || position == ledRow || position == callsRow) {
|
||||
return VIEW_TYPE_HEADER;
|
||||
} else if (position == soundRow || position == vibrateRow || position == priorityRow || position == smartRow || position == ringtoneRow || position == callsVibrateRow || position == customResetRow) {
|
||||
return VIEW_TYPE_TEXT_SETTINGS;
|
||||
@ -961,7 +936,7 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi
|
||||
return VIEW_TYPE_USER;
|
||||
} else if (position == avatarSectionRow || position == customResetShadowRow) {
|
||||
return VIEW_TYPE_SHADOW;
|
||||
} else if (position == enableRow || position == previewRow || position == popupRow) {
|
||||
} else if (position == enableRow || position == previewRow) {
|
||||
return VIEW_TYPE_TEXT_CHECK;
|
||||
}
|
||||
return VIEW_TYPE_HEADER;
|
||||
|
@ -81,11 +81,9 @@ class BottomBuilder(val ctx: Context) {
|
||||
|
||||
fun addTitle(title: CharSequence, bigTitle: Boolean, subTitle: CharSequence?): HeaderCell {
|
||||
|
||||
val headerCell = if (bigTitle) {
|
||||
HeaderCell(ctx, Theme.key_dialogTextBlue2, 23, 15, false, true)
|
||||
} else {
|
||||
HeaderCell(ctx, Theme.key_dialogTextGray2, 16, 12, false)
|
||||
}
|
||||
val headerCell = HeaderCell(ctx, Theme.key_dialogTextBlue2, 23, 15, false)
|
||||
|
||||
headerCell.setBigTitle(bigTitle)
|
||||
|
||||
headerCell.setText(if (title is String) AndroidUtilities.replaceTags(title) else title)
|
||||
|
||||
|
@ -11,21 +11,21 @@ public class InternalFilters {
|
||||
|
||||
public static LinkedList<TLRPC.TL_dialogFilterSuggested> internalFilters = new LinkedList<>();
|
||||
|
||||
public static final TLRPC.TL_dialogFilter usersFilter;
|
||||
public static final TLRPC.DialogFilter usersFilter;
|
||||
|
||||
public static final TLRPC.TL_dialogFilter contactsFilter;
|
||||
public static final TLRPC.DialogFilter contactsFilter;
|
||||
|
||||
public static final TLRPC.TL_dialogFilter groupsFilter;
|
||||
public static final TLRPC.DialogFilter groupsFilter;
|
||||
|
||||
public static final TLRPC.TL_dialogFilter channelsFilter;
|
||||
public static final TLRPC.DialogFilter channelsFilter;
|
||||
|
||||
public static final TLRPC.TL_dialogFilter botsFilter;
|
||||
public static final TLRPC.DialogFilter botsFilter;
|
||||
|
||||
public static final TLRPC.TL_dialogFilter unmutedFilter;
|
||||
public static final TLRPC.DialogFilter unmutedFilter;
|
||||
|
||||
public static final TLRPC.TL_dialogFilter unreadFilter;
|
||||
public static final TLRPC.DialogFilter unreadFilter;
|
||||
|
||||
public static final TLRPC.TL_dialogFilter unmutedAndUnreadFilter;
|
||||
public static final TLRPC.DialogFilter unmutedAndUnreadFilter;
|
||||
|
||||
static {
|
||||
|
||||
@ -156,13 +156,13 @@ public class InternalFilters {
|
||||
@FunctionalInterface
|
||||
interface FilterBuilder {
|
||||
|
||||
void apply(TLRPC.TL_dialogFilter filter);
|
||||
void apply(TLRPC.DialogFilter filter);
|
||||
|
||||
}
|
||||
|
||||
private static int currId = 10;
|
||||
|
||||
private static TLRPC.TL_dialogFilter mkFilter(String name, String description, int flag, FilterBuilder builder) {
|
||||
private static TLRPC.DialogFilter mkFilter(String name, String description, int flag, FilterBuilder builder) {
|
||||
|
||||
TLRPC.TL_dialogFilterSuggested suggestedFilter = new TLRPC.TL_dialogFilterSuggested();
|
||||
|
||||
|
@ -137,14 +137,14 @@ public class MessageDetailsActivity extends BaseFragment implements Notification
|
||||
}
|
||||
}
|
||||
if (TextUtils.isEmpty(filePath)) {
|
||||
filePath = FileLoader.getPathToMessage(messageObject.messageOwner).toString();
|
||||
filePath = FileLoader.getInstance(currentAccount).getPathToMessage(messageObject.messageOwner).toString();
|
||||
File temp = new File(filePath);
|
||||
if (!temp.exists()) {
|
||||
filePath = null;
|
||||
}
|
||||
}
|
||||
if (TextUtils.isEmpty(filePath)) {
|
||||
filePath = FileLoader.getPathToAttach(messageObject.getDocument(), true).toString();
|
||||
filePath = FileLoader.getInstance(currentAccount).getPathToAttach(messageObject.getDocument(), true).toString();
|
||||
File temp = new File(filePath);
|
||||
if (!temp.isFile()) {
|
||||
filePath = null;
|
||||
|
@ -368,14 +368,14 @@ public class MessageHelper extends BaseController {
|
||||
}
|
||||
}
|
||||
if (TextUtils.isEmpty(path)) {
|
||||
path = FileLoader.getPathToMessage(messageObject.messageOwner).toString();
|
||||
path = FileLoader.getInstance(currentAccount).getPathToMessage(messageObject.messageOwner).toString();
|
||||
File temp = new File(path);
|
||||
if (!temp.exists()) {
|
||||
path = null;
|
||||
}
|
||||
}
|
||||
if (TextUtils.isEmpty(path)) {
|
||||
path = FileLoader.getPathToAttach(messageObject.getDocument(), true).toString();
|
||||
path = FileLoader.getInstance(currentAccount).getPathToAttach(messageObject.getDocument(), true).toString();
|
||||
}
|
||||
if (!TextUtils.isEmpty(path)) {
|
||||
if (messageObject.isVideoSticker()) {
|
||||
@ -395,7 +395,7 @@ public class MessageHelper extends BaseController {
|
||||
}
|
||||
|
||||
public void saveStickerToGallery(Context context, TLRPC.Document document) {
|
||||
String path = FileLoader.getPathToAttach(document, true).toString();
|
||||
String path = FileLoader.getInstance(currentAccount).getPathToAttach(document, true).toString();
|
||||
|
||||
if (!TextUtils.isEmpty(path)) {
|
||||
if (MessageObject.isVideoSticker(document)) {
|
||||
|
Loading…
Reference in New Issue
Block a user