This commit is contained in:
世界 2020-03-29 19:42:09 +08:00
parent 0491612587
commit e346a316e9
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
58 changed files with 364 additions and 291 deletions

View File

@ -22,7 +22,7 @@ jobs:
run: |
git submodule update --init --recursive
cd TMessagesProj/
cd TMessagesProj/libs
go env -w GOPATH=$HOME/go
export GOPATH=$HOME/go
@ -53,8 +53,6 @@ jobs:
./patch_boringssl.sh
./build_boringssl.sh
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
- name: assemble
run: |
sudo bash <<EOF

View File

@ -26,21 +26,22 @@ jobs:
./gradlew TMessagesPro:assembleRelease TMessagesProj:assembleReleaseNoGcm TMessagesProj:bundleAfatRelease
EOF
- name: Upload apks
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_KEY: ${{ secrets.GPG_KEY }}
run: |
sudo bash <<EOF
export GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}"
export GPG_KEY="${{ secrets.GPG_KEY }}"
mkdir apks; find . -name "*.apk" -exec mv {} apks \;
ghr -b "${{ github.event.head_commit.message }}" \
ghr -replace -b "${{ github.event.head_commit.message }}" \
-n "${{ github.ref }}" "${{ github.ref }}" apks/
cd apks
gpg --import <<EOF
$GPG_KEY
EOF
EOF
echo "DA55ACBFDDA40853BFC5496ECD109927C34A63C4" > $HOME/.gnupg/sshcontrol

View File

@ -82,7 +82,7 @@
android:allowBackup="false"
android:networkSecurityConfig="@xml/network_security_config"
android:hardwareAccelerated="@bool/useHardwareAcceleration"
android:label="@string/Nekogram"
android:label="@string/NekoX"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher"
android:largeHeap="true"

View File

@ -2375,7 +2375,7 @@ public class AndroidUtilities {
parentFragment.presentFragment(new ThemePreviewActivity(themeInfo));
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("IncorrectTheme", R.string.IncorrectTheme));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
parentFragment.showDialog(builder.create());
@ -2421,7 +2421,7 @@ public class AndroidUtilities {
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
builder.setMessage(LocaleController.formatString("NoHandleAppInstalled", R.string.NoHandleAppInstalled, message.getDocument().mime_type));
if (parentFragment != null) {
@ -2463,7 +2463,7 @@ public class AndroidUtilities {
}
if (Build.VERSION.SDK_INT >= 26 && realMimeType != null && realMimeType.equals("application/vnd.android.package-archive") && !ApplicationLoader.applicationContext.getPackageManager().canRequestPackageInstalls()) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("ApkRestricted", R.string.ApkRestricted));
builder.setPositiveButton(LocaleController.getString("PermissionOpenSettings", R.string.PermissionOpenSettings), (dialogInterface, i) -> {
try {

View File

@ -136,7 +136,7 @@ public class LocationSharingService extends Service implements NotificationCente
builder.setContentIntent(contentIntent);
NotificationsController.checkOtherNotificationsChannel();
builder.setChannelId(NotificationsController.OTHER_NOTIFICATIONS_CHANNEL);
builder.setContentTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setContentTitle(LocaleController.getString("NekoX", R.string.NekoX));
Intent stopIntent = new Intent(ApplicationLoader.applicationContext, StopLiveLocationReceiver.class);
builder.addAction(0, LocaleController.getString("StopLiveLocation", R.string.StopLiveLocation), PendingIntent.getBroadcast(ApplicationLoader.applicationContext, 2, stopIntent, PendingIntent.FLAG_UPDATE_CURRENT));
}

View File

@ -351,11 +351,11 @@ public class MessagesController extends BaseController implements NotificationCe
ArraysKt.contains(NekoXConfig.DEVELOPER_IDS, (int) dialog1.id) &&
ArraysKt.contains(NekoXConfig.DEVELOPER_IDS, (int) dialog2.id))
if (NekoXConfig.sortByUnmuted) {
if (isDialogMuted(dialog1.id) && !isDialogMuted(dialog2.id)) {
if (!isDialogMuted(dialog1.id) && isDialogMuted(dialog2.id)) {
return 1;
} else if (!isDialogMuted(dialog1.id) && isDialogMuted(dialog2.id)) {
} else if (isDialogMuted(dialog1.id) && !isDialogMuted(dialog2.id)) {
return -1;
} else if (isDialogMuted(dialog1.id) && isDialogMuted(dialog2.id)) {
} else if (!isDialogMuted(dialog1.id) && !isDialogMuted(dialog2.id)) {
if (NekoXConfig.sortByUser) {
if (!is1user && is2user) {
return 1;
@ -11576,7 +11576,7 @@ public class MessagesController extends BaseController implements NotificationCe
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(fragment.getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
builder.setMessage(reason);
fragment.showDialog(builder.create());

View File

@ -2697,7 +2697,7 @@ public class NotificationsController extends BaseController {
name = LocaleController.getString("NotificationHiddenName", R.string.NotificationHiddenName);
}
} else {
name = LocaleController.getString("AppName", R.string.AppName);
name = LocaleController.getString("NekoX", R.string.NekoX);
}
replace = false;
} else {

View File

@ -1953,7 +1953,7 @@ public class SecretChatHelper extends BaseController {
FileLog.e(e);
}
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("CreateEncryptedChatError", R.string.CreateEncryptedChatError));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
builder.show().setCanceledOnTouchOutside(true);

View File

@ -93,7 +93,7 @@ public class VideoEncodingService extends Service implements NotificationCenter.
builder.setSmallIcon(android.R.drawable.stat_sys_upload);
builder.setWhen(System.currentTimeMillis());
builder.setChannelId(NotificationsController.OTHER_NOTIFICATIONS_CHANNEL);
builder.setContentTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setContentTitle(LocaleController.getString("NekoX", R.string.NekoX));
if (isGif) {
builder.setTicker(LocaleController.getString("SendingGif", R.string.SendingGif));
builder.setContentText(LocaleController.getString("SendingGif", R.string.SendingGif));

View File

@ -9,7 +9,9 @@
package org.telegram.ui.ActionBar;
import android.animation.Animator;
import android.app.Activity;
import android.content.Context;
import android.graphics.Point;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.Rect;
@ -18,8 +20,10 @@ import android.os.Build;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.ActionMode;
import android.view.Display;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.Menu;
@ -37,6 +41,7 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import org.telegram.messenger.AndroidUtilities;
import org.telegram.messenger.FileLog;
import org.telegram.messenger.LocaleController;
import org.telegram.messenger.R;
import org.telegram.messenger.SharedConfig;
@ -44,6 +49,8 @@ import org.telegram.ui.Components.CloseProgressDrawable2;
import org.telegram.ui.Components.EditTextBoldCursor;
import org.telegram.ui.Components.LayoutHelper;
import tw.nekomimi.nekogram.utils.AlertUtil;
public class ActionBarMenuItem extends FrameLayout {
public static class ActionBarMenuItemSearchListener {
@ -121,6 +128,18 @@ public class ActionBarMenuItem extends FrameLayout {
private boolean clearsTextOnSearchCollapse = true;
private boolean measurePopup = true;
@Override
public boolean isVerticalScrollBarEnabled() {
return verticalScrollBarEnabled;
}
@Override
public void setVerticalScrollBarEnabled(boolean verticalScrollBarEnabled) {
this.verticalScrollBarEnabled = verticalScrollBarEnabled;
}
private boolean verticalScrollBarEnabled;
public ActionBarMenuItem(Context context, ActionBarMenu menu, int backgroundColor, int iconColor) {
this(context, menu, backgroundColor, iconColor, false);
}
@ -264,7 +283,7 @@ public class ActionBarMenuItem extends FrameLayout {
}
rect = new Rect();
location = new int[2];
popupLayout = new ActionBarPopupWindow.ActionBarPopupWindowLayout(getContext());
popupLayout = new ActionBarPopupWindow.ActionBarPopupWindowLayout(getContext(), verticalScrollBarEnabled);
popupLayout.setOnTouchListener((v, event) -> {
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
if (popupWindow != null && popupWindow.isShowing()) {
@ -444,6 +463,16 @@ public class ActionBarMenuItem extends FrameLayout {
yOffset = offset;
}
private View anchor;
public View getAnchor() {
return anchor;
}
public void setAnchor(View anchor) {
this.anchor = anchor;
}
public void toggleSubMenu() {
if (popupLayout == null || parentMenu != null && parentMenu.isActionMode && parentMenu.parentActionBar != null && !parentMenu.parentActionBar.isActionModeShowed()) {
return;
@ -922,8 +951,23 @@ public class ActionBarMenuItem extends FrameLayout {
private void updateOrShowPopup(boolean show, boolean update) {
int offsetY;
if (parentMenu != null) {
if (anchor != null) {
float scaleY = anchor.getScaleY();
offsetY = -(int) (anchor.getMeasuredHeight() * scaleY - anchor.getTranslationY() / scaleY) + additionalYOffset;
int height = AndroidUtilities.displayMetrics.heightPixels;
int[] location = new int[2];
anchor.getLocationOnScreen(location);
int y = location[1];
if (height - y < popupLayout.getMeasuredHeight() + offsetY) {
if (height - (height - y) >= popupLayout.getMeasuredHeight()) {
offsetY -= popupLayout.getMeasuredHeight();
} else if (popupLayout.getMeasuredHeight() > height) {
offsetY -= scaleY;
} else {
offsetY -= popupLayout.getMeasuredHeight() / 2;
}
}
} else if (parentMenu != null) {
offsetY = -parentMenu.parentActionBar.getMeasuredHeight() + parentMenu.getTop() + parentMenu.getPaddingTop() - (int) parentMenu.parentActionBar.getTranslationY();
} else {
float scaleY = getScaleY();
@ -935,7 +979,33 @@ public class ActionBarMenuItem extends FrameLayout {
popupLayout.scrollToTop();
}
if (parentMenu != null) {
if (anchor != null) {
if (subMenuOpenSide == 0) {
if (anchor.getParent() != null) {
View parent = (View) anchor.getParent();
if (show) {
popupWindow.showAsDropDown(parent, anchor.getLeft() + anchor.getMeasuredWidth() - popupLayout.getMeasuredWidth() + additionalXOffset, offsetY);
}
if (update) {
popupWindow.update(parent, anchor.getLeft() + anchor.getMeasuredWidth() - popupLayout.getMeasuredWidth() + additionalXOffset, offsetY, -1, -1);
}
}
} else if (subMenuOpenSide == 1) {
if (show) {
popupWindow.showAsDropDown(anchor, -AndroidUtilities.dp(8) + additionalXOffset, offsetY);
}
if (update) {
popupWindow.update(anchor, -AndroidUtilities.dp(8) + additionalXOffset, offsetY, -1, -1);
}
} else {
if (show) {
popupWindow.showAsDropDown(anchor, anchor.getMeasuredWidth() - popupLayout.getMeasuredWidth() + additionalXOffset, offsetY);
}
if (update) {
popupWindow.update(anchor, anchor.getMeasuredWidth() - popupLayout.getMeasuredWidth() + additionalXOffset, offsetY, -1, -1);
}
}
} else if (parentMenu != null) {
View parent = parentMenu.parentActionBar;
if (subMenuOpenSide == 0) {
if (SharedConfig.smoothKeyboard) {

View File

@ -21,6 +21,9 @@ import android.graphics.drawable.Drawable;
import android.os.Build;
import androidx.annotation.Keep;
import androidx.core.view.ViewCompat;
import androidx.core.widget.ScrollerCompat;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
@ -51,6 +54,7 @@ public class ActionBarPopupWindow extends PopupWindow {
private AnimatorSet windowAnimatorSet;
private boolean animationEnabled = allowAnimation;
private int dismissAnimationDuration = 150;
static {
Field f = null;
try {
@ -92,6 +96,10 @@ public class ActionBarPopupWindow extends PopupWindow {
protected Drawable backgroundDrawable;
public ActionBarPopupWindowLayout(Context context) {
this(context,false);
}
public ActionBarPopupWindowLayout(Context context, boolean verticalScrollBarEnabled) {
super(context);
backgroundDrawable = getResources().getDrawable(R.drawable.popup_fixed).mutate();
@ -102,7 +110,7 @@ public class ActionBarPopupWindow extends PopupWindow {
try {
scrollView = new ScrollView(context);
scrollView.setVerticalScrollBarEnabled(false);
scrollView.setVerticalScrollBarEnabled(verticalScrollBarEnabled);
addView(scrollView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT));
} catch (Throwable e) {
FileLog.e(e);
@ -111,7 +119,7 @@ public class ActionBarPopupWindow extends PopupWindow {
linearLayout = new LinearLayout(context);
linearLayout.setOrientation(LinearLayout.VERTICAL);
if (scrollView != null) {
scrollView.addView(linearLayout, new ScrollView.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
scrollView.addView(linearLayout, new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
} else {
addView(linearLayout, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT));
}

View File

@ -789,7 +789,7 @@ public class AlertDialog extends Dialog implements Drawable.Callback {
return;
}
Builder builder = new Builder(getContext());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("StopLoading", R.string.StopLoading));
builder.setPositiveButton(LocaleController.getString("WaitMore", R.string.WaitMore), null);
builder.setNegativeButton(LocaleController.getString("Stop", R.string.Stop), (dialogInterface, i) -> {

View File

@ -498,28 +498,28 @@ public class BottomSheet extends Dialog {
setBackground(Theme.getSelectorDrawable(false));
setPadding(AndroidUtilities.dp(16), 0, AndroidUtilities.dp(16), 0);
super.setGravity(Gravity.START | Gravity.CENTER_VERTICAL);
imageView = new ImageView(context);
imageView.setScaleType(ImageView.ScaleType.CENTER);
imageView.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_dialogIcon), PorterDuff.Mode.MULTIPLY));
addView(imageView, LayoutHelper.createLinear(56, 48, Gravity.CENTER_VERTICAL | (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT)));
addView(imageView, LayoutHelper.createLinear(56, 48));
textView = new TextView(context);
textView.setLines(1);
textView.setSingleLine(true);
textView.setGravity(Gravity.CENTER_HORIZONTAL);
textView.setGravity(Gravity.START | Gravity.CENTER_VERTICAL);
textView.setEllipsize(TextUtils.TruncateAt.END);
textView.setPadding(AndroidUtilities.dp(16),0,0,0);
if (type == 0) {
textView.setTextColor(Theme.getColor(Theme.key_dialogTextBlack));
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
addView(textView, LayoutHelper.createLinear(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL));
} else if (type == 1) {
textView.setGravity(Gravity.CENTER);
textView.setTextColor(Theme.getColor(Theme.key_dialogTextBlack));
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
addView(textView, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
}
addView(textView, LayoutHelper.createLinear(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT));
}
public void setTextColor(int color) {
@ -539,13 +539,6 @@ public class BottomSheet extends Dialog {
if (icon != 0) {
imageView.setImageResource(icon);
imageView.setVisibility(VISIBLE);
if (bigTitle) {
textView.setPadding(AndroidUtilities.dp(LocaleController.isRTL ? 21 : 72), 0, AndroidUtilities.dp(LocaleController.isRTL ? 72 : 21), 0);
imageView.setPadding(LocaleController.isRTL ? 0 : AndroidUtilities.dp(5), 0, LocaleController.isRTL ? AndroidUtilities.dp(5) : 5, 0);
} else {
textView.setPadding(AndroidUtilities.dp(LocaleController.isRTL ? 16 : 72), 0, AndroidUtilities.dp(LocaleController.isRTL ? 72 : 16), 0);
imageView.setPadding(0, 0, 0, 0);
}
} else {
imageView.setVisibility(GONE);
textView.setPadding(AndroidUtilities.dp(bigTitle ? 21 : 16), 0, AndroidUtilities.dp(bigTitle ? 21 : 16), 0);
@ -649,20 +642,20 @@ public class BottomSheet extends Dialog {
if (title != null) {
titleView = new TextView(getContext());
titleView.setText(title);
titleView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15);
titleView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL);
titleView.setMinHeight(AndroidUtilities.dp(25));
if (bigTitle) {
titleView.setSingleLine(true);
titleView.setEllipsize(TextUtils.TruncateAt.MIDDLE);
titleView.setTextColor(Theme.getColor(Theme.key_dialogTextBlack));
titleView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 20);
titleView.setTextColor(Theme.getColor(Theme.key_dialogTextBlue2));
titleView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
titleView.setPadding(AndroidUtilities.dp(21), AndroidUtilities.dp(6), AndroidUtilities.dp(21), AndroidUtilities.dp(8));
} else {
titleView.setTextColor(Theme.getColor(Theme.key_dialogTextGray2));
titleView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
titleView.setPadding(AndroidUtilities.dp(16), 0, AndroidUtilities.dp(16), AndroidUtilities.dp(8));
}
titleView.setGravity(Gravity.CENTER_VERTICAL);
containerView.addView(titleView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT));
containerView.addView(titleView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT,(LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 21, 15, 21, 0));
titleView.setOnTouchListener((v, event) -> true);
}
if (customView != null) {

View File

@ -661,7 +661,7 @@ public class ActionIntroActivity extends BaseFragment implements LocationControl
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("PermissionNoLocationPosition", R.string.PermissionNoLocationPosition));
builder.setNegativeButton(LocaleController.getString("PermissionOpenSettings", R.string.PermissionOpenSettings), (dialog, which) -> {
if (getParentActivity() == null) {
@ -715,7 +715,7 @@ public class ActionIntroActivity extends BaseFragment implements LocationControl
if (grantResults != null && grantResults.length != 0) {
if (grantResults[0] != PackageManager.PERMISSION_GRANTED) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("PermissionNoLocationPosition", R.string.PermissionNoLocationPosition));
builder.setNegativeButton(LocaleController.getString("PermissionOpenSettings", R.string.PermissionOpenSettings), (dialog, which) -> {
if (getParentActivity() == null) {
@ -740,7 +740,7 @@ public class ActionIntroActivity extends BaseFragment implements LocationControl
processOpenQrReader();
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("WalletPermissionNoCamera", R.string.WalletPermissionNoCamera));
builder.setNegativeButton(LocaleController.getString("PermissionOpenSettings", R.string.PermissionOpenSettings), (dialog, which) -> {
try {

View File

@ -3780,7 +3780,7 @@ public class ArticleViewer implements NotificationCenter.NotificationCenterDeleg
MediaController.saveFile(f.toString(), parentActivity, isMediaVideo(photoAdapter, currentIndex) ? 1 : 0, null, null);
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
builder.setMessage(LocaleController.getString("PleaseDownload", R.string.PleaseDownload));
showDialog(builder.create());
@ -11755,7 +11755,7 @@ public class ArticleViewer implements NotificationCenter.NotificationCenterDeleg
parentActivity.startActivityForResult(Intent.createChooser(intent, LocaleController.getString("ShareFile", R.string.ShareFile)), 500);
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
builder.setMessage(LocaleController.getString("PleaseDownload", R.string.PleaseDownload));
showDialog(builder.create());

View File

@ -446,7 +446,7 @@ public class CallLogActivity extends BaseFragment implements NotificationCenter.
if (getParentActivity() == null)
return;
new AlertDialog.Builder(getParentActivity())
.setTitle(LocaleController.getString("AppName", R.string.AppName))
.setTitle(LocaleController.getString("NekoX", R.string.NekoX))
.setMessage(LocaleController.getString("ConfirmDeleteCallLog", R.string.ConfirmDeleteCallLog))
.setPositiveButton(LocaleController.getString("Delete", R.string.Delete), (dialog, which) -> {
ArrayList<Integer> ids = new ArrayList<>();

View File

@ -141,7 +141,7 @@ public class CancelAccountDeletionActivity extends BaseFragment {
@Override
public View createView(Context context) {
actionBar.setTitle(LocaleController.getString("AppName", R.string.AppName));
actionBar.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
actionBar.setBackButtonImage(R.drawable.ic_ab_back);
actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() {
@Override
@ -369,7 +369,7 @@ public class CancelAccountDeletionActivity extends BaseFragment {
if (preferences.getBoolean("firstlogin", true) || getParentActivity().shouldShowRequestPermissionRationale(Manifest.permission.READ_PHONE_STATE)) {
preferences.edit().putBoolean("firstlogin", false).apply();
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
builder.setMessage(LocaleController.getString("AllowReadCall", R.string.AllowReadCall));
permissionsDialog = showDialog(builder.create());

View File

@ -143,7 +143,7 @@ public class ChangePhoneActivity extends BaseFragment {
@Override
public View createView(Context context) {
actionBar.setTitle(LocaleController.getString("AppName", R.string.AppName));
actionBar.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
actionBar.setBackButtonImage(R.drawable.ic_ab_back);
actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() {
@Override
@ -727,7 +727,7 @@ public class ChangePhoneActivity extends BaseFragment {
if (preferences.getBoolean("firstlogin", true) || getParentActivity().shouldShowRequestPermissionRationale(Manifest.permission.READ_PHONE_STATE)) {
preferences.edit().putBoolean("firstlogin", false).apply();
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
builder.setMessage(LocaleController.getString("AllowReadCall", R.string.AllowReadCall));
permissionsDialog = showDialog(builder.create());
@ -1458,7 +1458,7 @@ public class ChangePhoneActivity extends BaseFragment {
public boolean onBackPressed(boolean force) {
if (!force) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("StopVerification", R.string.StopVerification));
builder.setPositiveButton(LocaleController.getString("Continue", R.string.Continue), null);
builder.setNegativeButton(LocaleController.getString("Stop", R.string.Stop), (dialogInterface, i) -> {

View File

@ -1322,7 +1322,7 @@ public class ChannelAdminLogActivity extends BaseFragment implements Notificatio
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("IncorrectTheme", R.string.IncorrectTheme));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
showDialog(builder.create());
@ -1336,7 +1336,7 @@ public class ChannelAdminLogActivity extends BaseFragment implements Notificatio
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("IncorrectLocalization", R.string.IncorrectLocalization));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
showDialog(builder.create());
@ -1807,7 +1807,7 @@ public class ChannelAdminLogActivity extends BaseFragment implements Notificatio
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
if (message.type == 3) {
builder.setMessage(LocaleController.getString("NoPlayerInstalled", R.string.NoPlayerInstalled));

View File

@ -951,7 +951,7 @@ public class ChannelCreateActivity extends BaseFragment implements NotificationC
AdminedChannelCell cell = (AdminedChannelCell) view.getParent();
final TLRPC.Chat channel = cell.getCurrentChannel();
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
if (channel.megagroup) {
builder.setMessage(AndroidUtilities.replaceTags(LocaleController.formatString("RevokeLinkAlert", R.string.RevokeLinkAlert, MessagesController.getInstance(currentAccount).linkPrefix + "/" + channel.username, channel.title)));
} else {
@ -1075,7 +1075,7 @@ public class ChannelCreateActivity extends BaseFragment implements NotificationC
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
switch (error) {
case "USERNAME_INVALID":
builder.setMessage(LocaleController.getString("LinkInvalid", R.string.LinkInvalid));

View File

@ -3874,7 +3874,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
if (!preferences.getBoolean("secretbot", false)) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("SecretChatContextBotAlert", R.string.SecretChatContextBotAlert));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
showDialog(builder.create());
@ -4083,7 +4083,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
return false;
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("ClearSearch", R.string.ClearSearch));
builder.setPositiveButton(LocaleController.getString("ClearButton", R.string.ClearButton).toUpperCase(), (dialogInterface, i) -> mentionsAdapter.clearRecentHashtags());
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
@ -4960,7 +4960,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setMessage(LocaleController.getString("AreYouSureUnblockContact", R.string.AreYouSureUnblockContact));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialogInterface, i) -> getMessagesController().unblockUser(currentUser.id));
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
showDialog(builder.create());
}
@ -6956,7 +6956,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if (currentEncryptedChat != null && messagesController.secretWebpagePreview == 2) {
AndroidUtilities.runOnUIThread(() -> {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialog, which) -> {
messagesController.secretWebpagePreview = 1;
MessagesController.getGlobalMainSettings().edit().putInt("secretWebpage2", getMessagesController().secretWebpagePreview).apply();
@ -8355,7 +8355,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
if (grantResults != null && grantResults.length != 0 && grantResults[0] != PackageManager.PERMISSION_GRANTED) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("PermissionNoAudioVideo", R.string.PermissionNoAudioVideo));
builder.setNegativeButton(LocaleController.getString("PermissionOpenSettings", R.string.PermissionOpenSettings), (dialog, which) -> {
try {
@ -9972,7 +9972,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
obj.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionSetMessageTTL && getParentActivity() != null) {
if (AndroidUtilities.getPeerLayerVersion(currentEncryptedChat.layer) < 17 && currentEncryptedChat.ttl > 0 && currentEncryptedChat.ttl <= 60) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
builder.setMessage(LocaleController.formatString("CompatibilityChat", R.string.CompatibilityChat, currentUser.first_name, currentUser.first_name));
showDialog(builder.create());
@ -11023,7 +11023,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
if (reason == 0) {
builder.setMessage(LocaleController.getString("ChannelCantOpenPrivate", R.string.ChannelCantOpenPrivate));
} else if (reason == 1) {
@ -12946,7 +12946,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if (preferences.getLong("proxychannel", 0) != dialog_id) {
preferences.edit().putLong("proxychannel", dialog_id).apply();
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("UseProxySponsorInfo", R.string.UseProxySponsorInfo));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
showDialog(builder.create());
@ -14368,7 +14368,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("EditMessageError", R.string.EditMessageError));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
showDialog(builder.create());
@ -14596,7 +14596,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("IncorrectTheme", R.string.IncorrectTheme));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
showDialog(builder.create());
@ -14612,7 +14612,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("IncorrectLocalization", R.string.IncorrectLocalization));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
showDialog(builder.create());
@ -15449,7 +15449,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
if (message.type == 3) {
builder.setMessage(LocaleController.getString("NoPlayerInstalled", R.string.NoPlayerInstalled));
@ -15559,7 +15559,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
TLRPC.User user = getMessagesController().getUser(uid);
if (ask) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
String name;
if (user != null) {
name = ContactsController.formatName(user.first_name, user.last_name);
@ -17705,7 +17705,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
if (action == 1 && (channelParticipant instanceof TLRPC.TL_channelParticipantAdmin || participant instanceof TLRPC.TL_chatParticipantAdmin)) {
AlertDialog.Builder builder2 = new AlertDialog.Builder(getParentActivity());
builder2.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder2.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder2.setMessage(LocaleController.formatString("AdminWillBeRemoved", R.string.AdminWillBeRemoved, ContactsController.formatName(user.first_name, user.last_name)));
int finalAction = action;
builder2.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialog, which) -> {

View File

@ -536,7 +536,7 @@ public class ChatEditTypeActivity extends BaseFragment implements NotificationCe
AdminedChannelCell cell = (AdminedChannelCell) view.getParent();
final TLRPC.Chat channel = cell.getCurrentChannel();
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
if (isChannel) {
builder.setMessage(AndroidUtilities.replaceTags(LocaleController.formatString("RevokeLinkAlertChannel", R.string.RevokeLinkAlertChannel, getMessagesController().linkPrefix + "/" + channel.username, channel.title)));
} else {

View File

@ -884,7 +884,7 @@ public class ChatUsersActivity extends BaseFragment implements NotificationCente
final boolean canEdit = canEditAdmin;
final String rankFinal = rank;
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.formatString("AdminWillBeRemoved", R.string.AdminWillBeRemoved, UserObject.getUserName(user)));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialog, which) -> openRightsEdit(user.id, participant, ar, br, rankFinal, canEdit, selectType == 1 ? 0 : 1, false));
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
@ -1356,7 +1356,7 @@ public class ChatUsersActivity extends BaseFragment implements NotificationCente
} else {
if (actions.get(i) == 1 && canEditAdmin && (participant instanceof TLRPC.TL_channelParticipantAdmin || participant instanceof TLRPC.TL_chatParticipantAdmin)) {
AlertDialog.Builder builder2 = new AlertDialog.Builder(getParentActivity());
builder2.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder2.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder2.setMessage(LocaleController.formatString("AdminWillBeRemoved", R.string.AdminWillBeRemoved, UserObject.getUserName(user)));
builder2.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialog, which) -> openRightsEdit2(userId, date, participant, adminRights, bannedRights, rank, canEditAdmin, actions.get(i), false));
builder2.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);

View File

@ -315,7 +315,7 @@ public class AlertsCreator {
return null;
}
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(text);
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
return builder.show();
@ -451,7 +451,7 @@ public class AlertsCreator {
return null;
}
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(title == null ? LocaleController.getString("AppName", R.string.AppName) : title);
builder.setTitle(title == null ? LocaleController.getString("NekoX", R.string.NekoX) : title);
builder.setMessage(text);
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
return builder;
@ -1659,7 +1659,7 @@ public class AlertsCreator {
}
AlertDialog.Builder builder = new AlertDialog.Builder(fragment.getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
fragment.showDialog(builder.create(), true, null);
@ -1670,7 +1670,7 @@ public class AlertsCreator {
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(fragment.getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
if (result == 1) {
builder.setMessage(LocaleController.getString("ErrorSendRestrictedStickers", R.string.ErrorSendRestrictedStickers));
} else if (result == 2) {
@ -1694,7 +1694,7 @@ public class AlertsCreator {
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(fragment.getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
switch (error) {
case "PEER_FLOOD":
builder.setMessage(LocaleController.getString("NobodyLikesSpam2", R.string.NobodyLikesSpam2));

View File

@ -860,7 +860,7 @@ public class AudioPlayerAlert extends BottomSheet implements NotificationCenter.
parentActivity.startActivityForResult(Intent.createChooser(intent, LocaleController.getString("ShareFile", R.string.ShareFile)), 500);
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
builder.setMessage(LocaleController.getString("PleaseDownload", R.string.PleaseDownload));
builder.show();

View File

@ -194,7 +194,7 @@ public class BlockingUpdateView extends FrameLayout implements NotificationCente
public static boolean checkApkInstallPermissions(final Context context) {
if (Build.VERSION.SDK_INT >= 26 && !ApplicationLoader.applicationContext.getPackageManager().canRequestPackageInstalls()) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("ApkRestricted", R.string.ApkRestricted));
builder.setPositiveButton(LocaleController.getString("PermissionOpenSettings", R.string.PermissionOpenSettings), (dialogInterface, i) -> {
try {

View File

@ -4323,7 +4323,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("ClearRecentEmoji", R.string.ClearRecentEmoji));
builder.setPositiveButton(LocaleController.getString("ClearButton", R.string.ClearButton).toUpperCase(), (dialogInterface, i) -> emojiView.clearRecentEmoji());
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);

View File

@ -1296,7 +1296,7 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
return false;
}
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.formatString("ChatHintsDelete", R.string.ChatHintsDelete, ContactsController.formatName(button.currentUser.first_name, button.currentUser.last_name)));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialogInterface, i) -> MediaDataController.getInstance(currentAccount).removeInline(button.currentUser.id));
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);

View File

@ -426,7 +426,7 @@ public class EditTextEmoji extends FrameLayout implements NotificationCenter.Not
@Override
public void onClearEmojiRecent() {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("ClearRecentEmoji", R.string.ClearRecentEmoji));
builder.setPositiveButton(LocaleController.getString("ClearButton", R.string.ClearButton).toUpperCase(), (dialogInterface, i) -> emojiView.clearRecentEmoji());
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);

View File

@ -968,7 +968,7 @@ public class EmbedBottomSheet extends BottomSheet {
if (Build.VERSION.SDK_INT < 23 || Settings.canDrawOverlays(parentActivity)) {
return true;
} else {
new AlertDialog.Builder(parentActivity).setTitle(LocaleController.getString("AppName", R.string.AppName))
new AlertDialog.Builder(parentActivity).setTitle(LocaleController.getString("NekoX", R.string.NekoX))
.setMessage(LocaleController.getString("PermissionDrawAboveOtherApps", R.string.PermissionDrawAboveOtherApps))
.setPositiveButton(LocaleController.getString("PermissionOpenSettings", R.string.PermissionOpenSettings), (dialog, which) -> {
if (parentActivity != null) {

View File

@ -469,7 +469,7 @@ public class PhotoPaintView extends FrameLayout implements EntityView.EntityView
}
AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity);
builder.setMessage(LocaleController.getString("DiscardChanges", R.string.DiscardChanges));
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialogInterface, i) -> okRunnable.run());
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
photoViewer.showAlertDialog(builder);

View File

@ -98,7 +98,7 @@ public class TermsOfServiceView extends FrameLayout {
builder.setPositiveButton(LocaleController.getString("DeclineDeactivate", R.string.DeclineDeactivate), (dialog, which) -> {
AlertDialog.Builder builder12 = new AlertDialog.Builder(getContext());
builder12.setMessage(LocaleController.getString("TosDeclineDeleteAccount", R.string.TosDeclineDeleteAccount));
builder12.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder12.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder12.setPositiveButton(LocaleController.getString("Deactivate", R.string.Deactivate), (dialogInterface, i) -> {
final AlertDialog progressDialog = new AlertDialog(getContext(), 3);
progressDialog.setCanCacnel(false);
@ -119,7 +119,7 @@ public class TermsOfServiceView extends FrameLayout {
errorText += "\n" + error.text;
}
AlertDialog.Builder builder1 = new AlertDialog.Builder(getContext());
builder1.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder1.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder1.setMessage(errorText);
builder1.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
builder1.show();

View File

@ -144,7 +144,7 @@ public class VoIPHelper {
public static void permissionDenied(final Activity activity, final Runnable onFinish) {
if (!activity.shouldShowRequestPermissionRationale(Manifest.permission.RECORD_AUDIO)) {
AlertDialog dlg = new AlertDialog.Builder(activity)
.setTitle(LocaleController.getString("AppName", R.string.AppName))
.setTitle(LocaleController.getString("NekoX", R.string.NekoX))
.setMessage(LocaleController.getString("VoipNeedMicPermission", R.string.VoipNeedMicPermission))
.setPositiveButton(LocaleController.getString("OK", R.string.OK), null)
.setNegativeButton(LocaleController.getString("Settings", R.string.Settings), (dialog, which) -> {

View File

@ -512,7 +512,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setMessage(LocaleController.getString("InviteUser", R.string.InviteUser));
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
final String arg1 = usePhone;
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialogInterface, i) -> {
try {
@ -632,7 +632,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(channelId);
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
if (ChatObject.canAddAdmins(chat)) {
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("AddBotAsAdmin", R.string.AddBotAsAdmin));
builder.setPositiveButton(LocaleController.getString("MakeAdmin", R.string.MakeAdmin), (dialogInterface, i) -> {
if (delegate != null) {
@ -650,7 +650,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
}
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
String message = LocaleController.formatStringSimple(selectAlertString, UserObject.getUserName(user));
EditTextBoldCursor editText = null;
if (!user.bot && needForwardCount) {

View File

@ -2154,7 +2154,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
showDialog(permissionDialog = builder.create());
} else if (hasNotStoragePermission && activity.shouldShowRequestPermissionRationale(Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("PermissionStorage", R.string.PermissionStorage));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
showDialog(permissionDialog = builder.create());
@ -2171,7 +2171,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
return;
}
showDialog(new AlertDialog.Builder(getParentActivity())
.setTitle(LocaleController.getString("AppName", R.string.AppName))
.setTitle(LocaleController.getString("NekoX", R.string.NekoX))
.setMessage(LocaleController.getString("PermissionXiaomiLockscreen", R.string.PermissionXiaomiLockscreen))
.setPositiveButton(LocaleController.getString("PermissionOpenSettings", R.string.PermissionOpenSettings), (dialog, which) -> {
Intent intent = XiaomiUtilities.getPermissionManagerIntent();
@ -2577,7 +2577,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
Object item = dialogsSearchAdapter.getItem(position);
/*if (item instanceof String || dialogsSearchAdapter.isRecentSearchDisplayed()) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("ClearSearch", R.string.ClearSearch));
builder.setPositiveButton(LocaleController.getString("ClearButton", R.string.ClearButton).toUpperCase(), (dialogInterface, i) -> {
if (dialogsSearchAdapter.isRecentSearchDisplayed()) {
@ -3554,13 +3554,10 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
if (folderId != 0) {
title = LocaleController.getString("ArchivedChats", R.string.ArchivedChats);
} else {
title = LocaleController.getString("Nekogram", R.string.Nekogram);
title = LocaleController.getString("NekoX", R.string.NekoX);
}
}
if (FilterPopup.getInstance(currentAccount).getTotalUnreadCount() == 0) {
return LocaleController.getString("NekogramEmojiDialogs", R.string.NekogramEmojiDialogs) + " " + title;
}
return LocaleController.getString("NekogramEmojiDialogsUnread", R.string.NekogramEmojiDialogsUnread) + " " + title;
return title;
}
@Override

View File

@ -1222,7 +1222,7 @@ public class DocumentSelectActivity extends BaseFragment {
if (getParentActivity() == null) {
return;
}
new AlertDialog.Builder(getParentActivity()).setTitle(LocaleController.getString("AppName", R.string.AppName)).setMessage(error).setPositiveButton(LocaleController.getString("OK", R.string.OK), null).show();
new AlertDialog.Builder(getParentActivity()).setTitle(LocaleController.getString("NekoX", R.string.NekoX)).setMessage(error).setPositiveButton(LocaleController.getString("OK", R.string.OK), null).show();
}
@SuppressLint("NewApi")

View File

@ -269,7 +269,7 @@ public class ExternalActionActivity extends Activity implements ActionBarLayout.
}
AlertDialog.Builder builder = new AlertDialog.Builder(ExternalActionActivity.this);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("PleaseLoginPassport", R.string.PleaseLoginPassport));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
builder.show();

View File

@ -651,7 +651,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
}
if (chatType == ChatObject.CHAT_TYPE_CHAT && selectedContacts.size() == MessagesController.getInstance(currentAccount).maxGroupCount) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("SoftUserLimitAlert", R.string.SoftUserLimitAlert));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
showDialog(builder.create());
@ -672,7 +672,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(channelId);
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
if (ChatObject.canAddAdmins(chat)) {
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("AddBotAsAdmin", R.string.AddBotAsAdmin));
builder.setPositiveButton(LocaleController.getString("MakeAdmin", R.string.MakeAdmin), (dialogInterface, i) -> {
delegate2.needAddBot(user);

View File

@ -108,6 +108,7 @@ import org.telegram.ui.Components.SideMenultItemAnimator;
import org.telegram.ui.Components.StickersAlert;
import org.telegram.ui.Components.TermsOfServiceView;
import org.telegram.ui.Components.ThemeEditorView;
import org.telegram.ui.Components.URLSpanUserMention;
import java.io.File;
import java.util.ArrayList;
@ -1613,6 +1614,17 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
} catch (Exception e) {
FileLog.e(e);
}
} else if (url.startsWith("tg:user") || url.startsWith("tg://user")) {
try {
url = url.replace("tg:user", "tg://telegram.org").replace("tg://user", "tg://telegram.org");
data = Uri.parse(url);
int userId = Utilities.parseInt(data.getQueryParameter("id"));
if (userId != 0) {
push_user_id = userId;
}
} catch (Exception e) {
FileLog.e(e);
}
} else {
unsupportedUrl = url.replace("tg://", "").replace("tg:", "");
int index;
@ -1915,7 +1927,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.didReceiveSmsCode, code);
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(LaunchActivity.this);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(AndroidUtilities.replaceTags(LocaleController.formatString("OtherLoginCode", R.string.OtherLoginCode, code)));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
showAlertDialog(builder);
@ -2124,7 +2136,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
}
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(LaunchActivity.this);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
if (error.text.startsWith("FLOOD_WAIT")) {
builder.setMessage(LocaleController.getString("FloodWait", R.string.FloodWait));
} else {
@ -2178,7 +2190,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
}
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(LaunchActivity.this);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
if (error.text.startsWith("FLOOD_WAIT")) {
builder.setMessage(LocaleController.getString("FloodWait", R.string.FloodWait));
} else if (error.text.equals("USERS_TOO_MUCH")) {
@ -2808,7 +2820,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
private void showPermissionErrorAlert(String message) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(message);
builder.setNegativeButton(LocaleController.getString("PermissionOpenSettings", R.string.PermissionOpenSettings), (dialog, which) -> {
try {
@ -3028,7 +3040,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
if (reason != 2 && reason != 3) {
builder.setNegativeButton(LocaleController.getString("MoreInfo", R.string.MoreInfo), (dialogInterface, i) -> {
if (!mainFragmentsStack.isEmpty()) {
@ -3067,7 +3079,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
} else if (id == NotificationCenter.wasUnableToFindCurrentLocation) {
final HashMap<String, MessageObject> waitingForLocation = (HashMap<String, MessageObject>) args[0];
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
builder.setNegativeButton(LocaleController.getString("ShareYouLocationUnableManually", R.string.ShareYouLocationUnableManually), (dialogInterface, i) -> {
if (mainFragmentsStack.isEmpty()) {

View File

@ -1642,7 +1642,7 @@ public class LocationActivity extends BaseFragment implements NotificationCenter
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
if (byButton) {
builder.setMessage(LocaleController.getString("PermissionNoLocationPosition", R.string.PermissionNoLocationPosition));
} else {

View File

@ -294,7 +294,7 @@ public class LoginActivity extends BaseFragment {
String token = editText.getText().toString();
if (token.length() == 0) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidAccessToken", R.string.InvalidAccessToken));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("InvalidAccessToken", R.string.InvalidAccessToken));
return;
}
@ -328,11 +328,11 @@ public class LoginActivity extends BaseFragment {
} else {
if (error.text != null) {
if (error.text.contains("ACCESS_TOKEN_INVALID")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidAccessToken", R.string.InvalidAccessToken));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("InvalidAccessToken", R.string.InvalidAccessToken));
} else if (error.text.startsWith("FLOOD_WAIT")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("FloodWait", R.string.FloodWait));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("FloodWait", R.string.FloodWait));
} else if (error.code != -1000) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), error.text);
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), error.text);
}
}
}
@ -776,7 +776,7 @@ public class LoginActivity extends BaseFragment {
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
if (banned) {
builder.setMessage(LocaleController.getString("BannedPhoneNumber", R.string.BannedPhoneNumber));
} else {
@ -799,7 +799,7 @@ public class LoginActivity extends BaseFragment {
}
getParentActivity().startActivity(Intent.createChooser(mailer, "Send email..."));
} catch (Exception e) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("NoMailInstalled", R.string.NoMailInstalled));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("NoMailInstalled", R.string.NoMailInstalled));
}
});
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
@ -1734,7 +1734,7 @@ public class LoginActivity extends BaseFragment {
if (preferences.getBoolean("firstlogin", true) || getParentActivity().shouldShowRequestPermissionRationale(Manifest.permission.READ_PHONE_STATE) || getParentActivity().shouldShowRequestPermissionRationale(Manifest.permission.READ_CALL_LOG)) {
preferences.edit().putBoolean("firstlogin", false).apply();
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
if (!allowCall && (!allowCancelCall || !allowReadCallLog)) {
builder.setMessage(LocaleController.getString("AllowReadCallAndLog", R.string.AllowReadCallAndLog));
@ -1846,19 +1846,19 @@ public class LoginActivity extends BaseFragment {
if (error.text.contains("PHONE_NUMBER_INVALID")) {
needShowInvalidAlert(req.phone_number, false);
} else if (error.text.contains("PHONE_PASSWORD_FLOOD")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("FloodWait", R.string.FloodWait));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("FloodWait", R.string.FloodWait));
} else if (error.text.contains("PHONE_NUMBER_FLOOD")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("PhoneNumberFlood", R.string.PhoneNumberFlood));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("PhoneNumberFlood", R.string.PhoneNumberFlood));
} else if (error.text.contains("PHONE_NUMBER_BANNED")) {
needShowInvalidAlert(req.phone_number, true);
} else if (error.text.contains("PHONE_CODE_EMPTY") || error.text.contains("PHONE_CODE_INVALID")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidCode", R.string.InvalidCode));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("InvalidCode", R.string.InvalidCode));
} else if (error.text.contains("PHONE_CODE_EXPIRED")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("CodeExpired", R.string.CodeExpired));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("CodeExpired", R.string.CodeExpired));
} else if (error.text.startsWith("FLOOD_WAIT")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("FloodWait", R.string.FloodWait));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("FloodWait", R.string.FloodWait));
} else if (error.code != -1000) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), error.text);
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), error.text);
}
}
}
@ -1884,7 +1884,7 @@ public class LoginActivity extends BaseFragment {
if (preferences.getBoolean("firstloginshow", true) || getParentActivity().shouldShowRequestPermissionRationale(Manifest.permission.READ_PHONE_STATE)) {
preferences.edit().putBoolean("firstloginshow", false).apply();
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
builder.setMessage(LocaleController.getString("AllowFillNumber", R.string.AllowFillNumber));
permissionsShowDialog = showDialog(builder.create());
@ -2146,7 +2146,7 @@ public class LoginActivity extends BaseFragment {
mailer.putExtra(Intent.EXTRA_TEXT, "Phone: " + requestPhone + "\nApp version: " + version + "\nOS version: SDK " + Build.VERSION.SDK_INT + "\nDevice Name: " + Build.MANUFACTURER + Build.MODEL + "\nLocale: " + Locale.getDefault() + "\nError: " + lastError);
getContext().startActivity(Intent.createChooser(mailer, "Send email..."));
} catch (Exception e) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("NoMailInstalled", R.string.NoMailInstalled));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("NoMailInstalled", R.string.NoMailInstalled));
}
}
});
@ -2219,17 +2219,17 @@ public class LoginActivity extends BaseFragment {
} else {
if (error.text != null) {
if (error.text.contains("PHONE_NUMBER_INVALID")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber));
} else if (error.text.contains("PHONE_CODE_EMPTY") || error.text.contains("PHONE_CODE_INVALID")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidCode", R.string.InvalidCode));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("InvalidCode", R.string.InvalidCode));
} else if (error.text.contains("PHONE_CODE_EXPIRED")) {
onBackPressed(true);
setPage(0, true, null, true);
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("CodeExpired", R.string.CodeExpired));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("CodeExpired", R.string.CodeExpired));
} else if (error.text.startsWith("FLOOD_WAIT")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("FloodWait", R.string.FloodWait));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("FloodWait", R.string.FloodWait));
} else if (error.code != -1000) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("ErrorOccurred", R.string.ErrorOccurred) + "\n" + error.text);
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("ErrorOccurred", R.string.ErrorOccurred) + "\n" + error.text);
}
}
}
@ -2657,7 +2657,7 @@ public class LoginActivity extends BaseFragment {
bundle.putInt("has_recovery", password.has_recovery ? 1 : 0);
setPage(6, true, bundle, false);
} else {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), error1.text);
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), error1.text);
}
}), ConnectionsManager.RequestFlagFailOnServerErrors | ConnectionsManager.RequestFlagWithoutLogin);
destroyTimer();
@ -2678,9 +2678,9 @@ public class LoginActivity extends BaseFragment {
waitingForEvent = true;
if (currentType != 3) {
if (error.text.contains("PHONE_NUMBER_INVALID")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber));
} else if (error.text.contains("PHONE_CODE_EMPTY") || error.text.contains("PHONE_CODE_INVALID")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidCode", R.string.InvalidCode));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("InvalidCode", R.string.InvalidCode));
for (int a = 0; a < codeField.length; a++) {
codeField[a].setText("");
}
@ -2688,11 +2688,11 @@ public class LoginActivity extends BaseFragment {
} else if (error.text.contains("PHONE_CODE_EXPIRED")) {
onBackPressed(true);
setPage(0, true, null, true);
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("CodeExpired", R.string.CodeExpired));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("CodeExpired", R.string.CodeExpired));
} else if (error.text.startsWith("FLOOD_WAIT")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("FloodWait", R.string.FloodWait));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("FloodWait", R.string.FloodWait));
} else {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("ErrorOccurred", R.string.ErrorOccurred) + "\n" + error.text);
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("ErrorOccurred", R.string.ErrorOccurred) + "\n" + error.text);
}
}
}
@ -2949,9 +2949,9 @@ public class LoginActivity extends BaseFragment {
} else {
timeString = LocaleController.formatPluralString("Minutes", time / 60);
}
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
} else {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), error.text);
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), error.text);
}
}
}), ConnectionsManager.RequestFlagFailOnServerErrors | ConnectionsManager.RequestFlagWithoutLogin);
@ -2994,7 +2994,7 @@ public class LoginActivity extends BaseFragment {
setPage(5, true, params, false);
} else {
if (error.text.equals("2FA_RECENT_CONFIRM")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("ResetAccountCancelledAlert", R.string.ResetAccountCancelledAlert));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("ResetAccountCancelledAlert", R.string.ResetAccountCancelledAlert));
} else if (error.text.startsWith("2FA_CONFIRM_WAIT_")) {
Bundle params = new Bundle();
params.putString("phoneFormated", requestPhone);
@ -3004,7 +3004,7 @@ public class LoginActivity extends BaseFragment {
params.putInt("waitTime", Utilities.parseInt(error.text.replace("2FA_CONFIRM_WAIT_", "")));
setPage(8, true, params, false);
} else {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), error.text);
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), error.text);
}
}
}), ConnectionsManager.RequestFlagWithoutLogin | ConnectionsManager.RequestFlagFailOnServerErrors);
@ -3152,9 +3152,9 @@ public class LoginActivity extends BaseFragment {
} else {
timeString = LocaleController.formatPluralString("Minutes", time / 60);
}
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
} else {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), error.text);
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), error.text);
}
}
});
@ -3301,9 +3301,9 @@ public class LoginActivity extends BaseFragment {
setPage(5, true, params, false);
} else {
if (error.text.equals("2FA_RECENT_CONFIRM")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("ResetAccountCancelledAlert", R.string.ResetAccountCancelledAlert));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("ResetAccountCancelledAlert", R.string.ResetAccountCancelledAlert));
} else {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), error.text);
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), error.text);
}
}
}), ConnectionsManager.RequestFlagWithoutLogin | ConnectionsManager.RequestFlagFailOnServerErrors);
@ -3532,7 +3532,7 @@ public class LoginActivity extends BaseFragment {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialogInterface, i) -> onAuthSuccess((TLRPC.TL_auth_authorization) response));
builder.setMessage(LocaleController.getString("PasswordReset", R.string.PasswordReset));
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
Dialog dialog = showDialog(builder.create());
if (dialog != null) {
dialog.setCanceledOnTouchOutside(false);
@ -3549,9 +3549,9 @@ public class LoginActivity extends BaseFragment {
} else {
timeString = LocaleController.formatPluralString("Minutes", time / 60);
}
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
} else {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), error.text);
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), error.text);
}
}
}), ConnectionsManager.RequestFlagFailOnServerErrors | ConnectionsManager.RequestFlagWithoutLogin);
@ -4032,17 +4032,17 @@ public class LoginActivity extends BaseFragment {
} else {
needHideProgress(false);
if (error.text.contains("PHONE_NUMBER_INVALID")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber));
} else if (error.text.contains("PHONE_CODE_EMPTY") || error.text.contains("PHONE_CODE_INVALID")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidCode", R.string.InvalidCode));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("InvalidCode", R.string.InvalidCode));
} else if (error.text.contains("PHONE_CODE_EXPIRED")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("CodeExpired", R.string.CodeExpired));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("CodeExpired", R.string.CodeExpired));
} else if (error.text.contains("FIRSTNAME_INVALID")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidFirstName", R.string.InvalidFirstName));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("InvalidFirstName", R.string.InvalidFirstName));
} else if (error.text.contains("LASTNAME_INVALID")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidLastName", R.string.InvalidLastName));
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("InvalidLastName", R.string.InvalidLastName));
} else {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), error.text);
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), error.text);
}
}
}), ConnectionsManager.RequestFlagWithoutLogin | ConnectionsManager.RequestFlagFailOnServerErrors);

View File

@ -993,7 +993,7 @@ public class PassportActivity extends BaseFragment implements NotificationCenter
int num = a;
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setMessage(LocaleController.formatString("PassportNameCheckAlert", R.string.PassportNameCheckAlert, firstName, middleName, lastName));
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("Done", R.string.Done), (dialogInterface, i) -> {
inputFields[FIELD_NAME].setText(firstName);
inputFields[FIELD_MIDNAME].setText(middleName);
@ -1660,9 +1660,9 @@ public class PassportActivity extends BaseFragment implements NotificationCenter
} else {
timeString = LocaleController.formatPluralString("Minutes", time / 60);
}
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
} else {
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), error.text);
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), error.text);
}
}
}), ConnectionsManager.RequestFlagFailOnServerErrors | ConnectionsManager.RequestFlagWithoutLogin);
@ -1901,7 +1901,7 @@ public class PassportActivity extends BaseFragment implements NotificationCenter
if ("APP_VERSION_OUTDATED".equals(error1.text)) {
AlertsCreator.showUpdateAppAlert(getParentActivity(), LocaleController.getString("UpdateAppAlert", R.string.UpdateAppAlert), true);
} else {
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), error1.text);
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), error1.text);
}
showEditDoneProgress(true, false);
}
@ -1933,9 +1933,9 @@ public class PassportActivity extends BaseFragment implements NotificationCenter
} else {
timeString = LocaleController.formatPluralString("Minutes", time / 60);
}
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
} else {
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), error.text);
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), error.text);
}
}
});
@ -2392,7 +2392,7 @@ public class PassportActivity extends BaseFragment implements NotificationCenter
if ("APP_VERSION_OUTDATED".equals(error.text)) {
AlertsCreator.showUpdateAppAlert(getParentActivity(), LocaleController.getString("UpdateAppAlert", R.string.UpdateAppAlert), true);
} else {
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), error.text);
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), error.text);
}
}
}));
@ -3539,7 +3539,7 @@ public class PassportActivity extends BaseFragment implements NotificationCenter
finishFragment();
});
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
if (documentOnly && currentDocumentsType == null && currentType.type instanceof TLRPC.TL_secureValueTypeAddress) {
builder.setMessage(LocaleController.getString("PassportDeleteAddressAlert", R.string.PassportDeleteAddressAlert));
} else if (documentOnly && currentDocumentsType == null && currentType.type instanceof TLRPC.TL_secureValueTypePersonalDetails) {
@ -4890,7 +4890,7 @@ public class PassportActivity extends BaseFragment implements NotificationCenter
builder.setMessage(LocaleController.getString("PassportDeleteScan", R.string.PassportDeleteScan));
}
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialog, which) -> {
documentsCells.remove(document);
if (type == UPLOADING_TYPE_SELFIE) {
@ -5808,7 +5808,7 @@ public class PassportActivity extends BaseFragment implements NotificationCenter
if (errorRunnable != null) {
errorRunnable.onError(error.text, null);
}
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), error.text);
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), error.text);
} else {
if (documentOnly) {
if (documentRequiredType != null) {
@ -5970,7 +5970,7 @@ public class PassportActivity extends BaseFragment implements NotificationCenter
deleteValueInternal(requiredType, null, null, true, this::needHideProgress, (error, text) -> needHideProgress(), documentOnly);
});
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(phoneField ? LocaleController.getString("PassportDeletePhoneAlert", R.string.PassportDeletePhoneAlert) : LocaleController.getString("PassportDeleteEmailAlert", R.string.PassportDeleteEmailAlert));
showDialog(builder.create());
return;
@ -6268,7 +6268,7 @@ public class PassportActivity extends BaseFragment implements NotificationCenter
if (!permissionsItems.isEmpty()) {
if (getParentActivity().shouldShowRequestPermissionRationale(Manifest.permission.READ_PHONE_STATE)) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
builder.setMessage(LocaleController.getString("AllowReadCall", R.string.AllowReadCall));
permissionsDialog = showDialog(builder.create());
@ -6623,7 +6623,7 @@ public class PassportActivity extends BaseFragment implements NotificationCenter
}
if (grantResults != null && grantResults.length != 0 && grantResults[0] != PackageManager.PERMISSION_GRANTED) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("PermissionNoAudioVideo", R.string.PermissionNoAudioVideo));
builder.setNegativeButton(LocaleController.getString("PermissionOpenSettings", R.string.PermissionOpenSettings), (dialog, which) -> {
try {
@ -6793,7 +6793,7 @@ public class PassportActivity extends BaseFragment implements NotificationCenter
return;
}
if (uploadingFileType == UPLOADING_TYPE_DOCUMENTS && documents.size() >= 20) {
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), LocaleController.formatString("PassportUploadMaxReached", R.string.PassportUploadMaxReached, LocaleController.formatPluralString("Files", 20)));
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.formatString("PassportUploadMaxReached", R.string.PassportUploadMaxReached, LocaleController.formatPluralString("Files", 20)));
return;
}
createChatAttachView();
@ -7874,7 +7874,7 @@ public class PassportActivity extends BaseFragment implements NotificationCenter
public boolean onBackPressed(boolean force) {
if (!force) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("StopVerification", R.string.StopVerification));
builder.setPositiveButton(LocaleController.getString("Continue", R.string.Continue), null);
builder.setNegativeButton(LocaleController.getString("Stop", R.string.Stop), (dialogInterface, i) -> {

View File

@ -1812,7 +1812,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
private void showDownloadAlert() {
AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
boolean alreadyDownloading = currentMessageObject != null && currentMessageObject.isVideo() && FileLoader.getInstance(currentMessageObject.currentAccount).isLoadingFile(currentFileNames[0]);
if (alreadyDownloading) {
@ -3548,7 +3548,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
Object object = mentionsAdapter.getItem(position);
if (object instanceof String) {
AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("ClearSearch", R.string.ClearSearch));
builder.setPositiveButton(LocaleController.getString("ClearButton", R.string.ClearButton).toUpperCase(), (dialogInterface, i) -> mentionsAdapter.clearRecentHashtags());
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
@ -3596,7 +3596,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
if (Build.VERSION.SDK_INT < 23 || Settings.canDrawOverlays(parentActivity)) {
return true;
} else {
new AlertDialog.Builder(parentActivity).setTitle(LocaleController.getString("AppName", R.string.AppName))
new AlertDialog.Builder(parentActivity).setTitle(LocaleController.getString("NekoX", R.string.NekoX))
.setMessage(LocaleController.getString("PermissionDrawAboveOtherApps", R.string.PermissionDrawAboveOtherApps))
.setPositiveButton(LocaleController.getString("PermissionOpenSettings", R.string.PermissionOpenSettings), (dialog, which) -> {
if (parentActivity != null) {
@ -4403,7 +4403,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("CantPlayVideo", R.string.CantPlayVideo));
builder.setPositiveButton(LocaleController.getString("Open", R.string.Open), (dialog, which) -> {
try {
@ -5060,7 +5060,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
}
AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity);
builder.setMessage(LocaleController.getString("DiscardChanges", R.string.DiscardChanges));
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialogInterface, i) -> switchToEditMode(0));
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
showAlertDialog(builder);

View File

@ -545,7 +545,7 @@ public class PopupNotificationActivity extends Activity implements NotificationC
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("PermissionNoAudio", R.string.PermissionNoAudio));
builder.setNegativeButton(LocaleController.getString("PermissionOpenSettings", R.string.PermissionOpenSettings), (dialog, which) -> {
try {

View File

@ -567,7 +567,7 @@ public class PrivacyControlActivity extends BaseFragment implements Notification
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("PrivacyFloodControlError", R.string.PrivacyFloodControlError));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
showDialog(builder.create());
@ -853,7 +853,7 @@ public class PrivacyControlActivity extends BaseFragment implements Notification
} else {
builder.setMessage(LocaleController.getString("CustomHelp", R.string.CustomHelp));
}
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialogInterface, i) -> {
applyCurrentPrivacySettings();
preferences.edit().putBoolean("privacyAlertShowed", true).apply();

View File

@ -2240,7 +2240,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
int action = actions.get(i);
if (action == 1 && (channelParticipant instanceof TLRPC.TL_channelParticipantAdmin || participant instanceof TLRPC.TL_chatParticipantAdmin)) {
AlertDialog.Builder builder2 = new AlertDialog.Builder(getParentActivity());
builder2.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder2.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder2.setMessage(LocaleController.formatString("AdminWillBeRemoved", R.string.AdminWillBeRemoved, ContactsController.formatName(user.first_name, user.last_name)));
builder2.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialog, which) -> {
if (channelParticipant != null) {

View File

@ -636,7 +636,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
return false;
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setMessage(LocaleController.getString("ClearSearch", R.string.ClearSearch));
builder.setPositiveButton(LocaleController.getString("ClearButton", R.string.ClearButton).toUpperCase(), (dialogInterface, i) -> searchAdapter.clearRecent());
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
@ -705,7 +705,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
titleTextView.setGravity(Gravity.LEFT);
titleTextView.setTextColor(Theme.getColor(Theme.key_actionBarDefaultTitle));
titleTextView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
titleTextView.setText(BuildVars.DEBUG_VERSION ? "Telegram Beta" : LocaleController.getString("AppName", R.string.AppName));
titleTextView.setText(BuildVars.DEBUG_VERSION ? "Telegram Beta" : LocaleController.getString("NekoX", R.string.NekoX));
titleTextView.setAlpha(0.0f);
frameLayout.addView(titleTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.LEFT | Gravity.TOP));
@ -1556,7 +1556,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
}
AlertDialog.Builder builder1 = new AlertDialog.Builder(getParentActivity());
builder1.setMessage(LocaleController.getString("AreYouSure", R.string.AreYouSure));
builder1.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder1.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder1.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialogInterface, i) -> {
SharedConfig.pushAuthKey = null;
SharedConfig.pushAuthKeyId = null;
@ -2391,36 +2391,9 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
cell.getTextView().setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText3));
cell.getTextView().setMovementMethod(null);
cell.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider_bottom, Theme.key_windowBackgroundGrayShadow));
try {
PackageInfo pInfo = ApplicationLoader.applicationContext.getPackageManager().getPackageInfo(ApplicationLoader.applicationContext.getPackageName(), 0);
int code = pInfo.versionCode / 10;
String abi = "";
switch (pInfo.versionCode % 10) {
case 1:
case 3:
abi = "arm-v7a";
break;
case 2:
case 4:
abi = "x86";
break;
case 5:
case 7:
abi = "arm64-v8a";
break;
case 6:
case 8:
abi = "x86_64";
break;
case 0:
case 9:
abi = "universal " + Build.CPU_ABI + " " + Build.CPU_ABI2;
break;
}
cell.setText(String.format("%1$s %2$s", LocaleController.getString("Nekogram", R.string.Nekogram), String.format(Locale.US, "v%s (%d) %s", pInfo.versionName, code, abi)));
} catch (Exception e) {
FileLog.e(e);
}
String abi = new File(getParentActivity().getApplicationInfo().nativeLibraryDir).getName();
cell.setText(String.format("%1$s %2$s", LocaleController.getString("NekoX", R.string.NekoX), String.format(Locale.US, "v%s %s %s", BuildConfig.VERSION_NAME, abi, BuildConfig.BUILD_TYPE)));
cell.getTextView().setPadding(0, AndroidUtilities.dp(14), 0, AndroidUtilities.dp(14));
view = cell;
Drawable drawable = Theme.getThemedDrawable(mContext, R.drawable.greydivider_bottom, Theme.key_windowBackgroundGrayShadow);

View File

@ -1153,7 +1153,7 @@ public class ThemeActivity extends BaseFragment implements NotificationCenter.No
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
if (byButton) {
builder.setMessage(LocaleController.getString("PermissionNoLocationPosition", R.string.PermissionNoLocationPosition));
} else {

View File

@ -317,9 +317,9 @@ public class TwoStepVerificationActivity extends BaseFragment implements Notific
} else {
timeString = LocaleController.formatPluralString("Minutes", time / 60);
}
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
} else {
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), error.text);
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), error.text);
}
}
}), ConnectionsManager.RequestFlagFailOnServerErrors | ConnectionsManager.RequestFlagWithoutLogin);
@ -417,7 +417,7 @@ public class TwoStepVerificationActivity extends BaseFragment implements Notific
});
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setMessage(LocaleController.getString("ResendCodeInfo", R.string.ResendCodeInfo));
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
showDialog(builder.create());
}
@ -1037,7 +1037,7 @@ public class TwoStepVerificationActivity extends BaseFragment implements Notific
}
} else {
if ("EMAIL_INVALID".equals(error.text)) {
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("PasswordEmailInvalid", R.string.PasswordEmailInvalid));
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("PasswordEmailInvalid", R.string.PasswordEmailInvalid));
} else if (error.text.startsWith("FLOOD_WAIT")) {
int time = Utilities.parseInt(error.text);
String timeString;
@ -1046,9 +1046,9 @@ public class TwoStepVerificationActivity extends BaseFragment implements Notific
} else {
timeString = LocaleController.formatPluralString("Minutes", time / 60);
}
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
} else {
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), error.text);
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), error.text);
}
}
}
@ -1225,9 +1225,9 @@ public class TwoStepVerificationActivity extends BaseFragment implements Notific
} else {
timeString = LocaleController.formatPluralString("Minutes", time / 60);
}
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
} else {
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), error.text);
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), error.text);
}
});
}
@ -1317,7 +1317,7 @@ public class TwoStepVerificationActivity extends BaseFragment implements Notific
finishFragment();
});
builder.setMessage(LocaleController.getString("PasswordReset", R.string.PasswordReset));
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
Dialog dialog = showDialog(builder.create());
if (dialog != null) {
dialog.setCanceledOnTouchOutside(false);
@ -1334,9 +1334,9 @@ public class TwoStepVerificationActivity extends BaseFragment implements Notific
} else {
timeString = LocaleController.formatPluralString("Minutes", time / 60);
}
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
} else {
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), error.text);
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), error.text);
}
}
}), ConnectionsManager.RequestFlagFailOnServerErrors | ConnectionsManager.RequestFlagWithoutLogin);
@ -1391,9 +1391,9 @@ public class TwoStepVerificationActivity extends BaseFragment implements Notific
} else {
timeString = LocaleController.formatPluralString("Minutes", time / 60);
}
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, timeString));
} else {
showAlertWithText(LocaleController.getString("AppName", R.string.AppName), error.text);
showAlertWithText(LocaleController.getString("NekoX", R.string.NekoX), error.text);
}
}
}), ConnectionsManager.RequestFlagFailOnServerErrors | ConnectionsManager.RequestFlagWithoutLogin);

View File

@ -118,7 +118,7 @@ public class NekoConfig {
hidePhone = preferences.getBoolean("hidePhone", true);
ignoreBlocked = preferences.getBoolean("ignoreBlocked", false);
forceTablet = preferences.getBoolean("forceTablet", false);
typeface = preferences.getInt("typeface", Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? 1 : 0);
typeface = preferences.getInt("typeface", 0);
nameOrder = preferences.getInt("nameOrder", 1);
mapPreviewProvider = preferences.getInt("mapPreviewProvider", 0);
transparentStatusBar = preferences.getBoolean("transparentStatusBar", false);

View File

@ -433,7 +433,7 @@ public class NekoSettingsActivity extends BaseFragment {
errorText += "\n" + error.text;
}
AlertDialog.Builder builder1 = new AlertDialog.Builder(getParentActivity());
builder1.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder1.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
builder1.setMessage(errorText);
builder1.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
builder1.show();

View File

@ -34,7 +34,6 @@ import org.telegram.messenger.Utilities;
import org.telegram.ui.ActionBar.ActionBar;
import org.telegram.ui.ActionBar.ActionBarMenuItem;
import org.telegram.ui.ActionBar.BaseFragment;
import org.telegram.ui.ActionBar.BottomSheet;
import org.telegram.ui.ActionBar.Theme;
import org.telegram.ui.ActionBar.ThemeDescription;
import org.telegram.ui.Cells.TextInfoPrivacyCell;
@ -45,6 +44,7 @@ import org.telegram.ui.Components.LayoutHelper;
import java.util.ArrayList;
import kotlin.text.StringsKt;
import tw.nekomimi.nekogram.utils.PopupBuilder;
public class ShadowsocksRSettingsActivity extends BaseFragment {
@ -302,13 +302,9 @@ public class ShadowsocksRSettingsActivity extends BaseFragment {
methodField.setOnClickListener((v) -> {
BottomSheet.Builder select = new BottomSheet.Builder(context);
PopupBuilder select = new PopupBuilder(v);
select.setItems(ShadowsocksRLoader.Companion.getMethods(),(d,i) -> {
methodField.getValueTextView().setText(ShadowsocksRLoader.Companion.getMethods()[i]);
});
select.setItems(methodSet, methodField.getValueTextView()::setText);
select.show();
@ -324,13 +320,9 @@ public class ShadowsocksRSettingsActivity extends BaseFragment {
protocolField.setOnClickListener((v) -> {
BottomSheet.Builder select = new BottomSheet.Builder(context);
PopupBuilder select = new PopupBuilder(v);
select.setItems(ShadowsocksRLoader.Companion.getProtocols(),(d,i) -> {
protocolField.getValueTextView().setText(ShadowsocksRLoader.Companion.getProtocols()[i]);
});
select.setItems(ShadowsocksRLoader.Companion.getProtocols(), protocolField.getValueTextView()::setText);
select.show();
@ -348,13 +340,9 @@ public class ShadowsocksRSettingsActivity extends BaseFragment {
obfsField.setOnClickListener((v) -> {
BottomSheet.Builder select = new BottomSheet.Builder(context);
PopupBuilder select = new PopupBuilder(v);
select.setItems(ShadowsocksRLoader.Companion.getObfses(),(d,i) -> {
obfsField.getValueTextView().setText(ShadowsocksRLoader.Companion.getObfses()[i]);
});
select.setItems(ShadowsocksRLoader.Companion.getObfses(), obfsField.getValueTextView()::setText);
select.show();

View File

@ -26,9 +26,6 @@ import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import com.v2ray.ang.V2RayConfig;
import com.v2ray.ang.dto.AngConfig;
import org.telegram.messenger.AndroidUtilities;
import org.telegram.messenger.LocaleController;
import org.telegram.messenger.R;
@ -37,10 +34,8 @@ import org.telegram.messenger.Utilities;
import org.telegram.ui.ActionBar.ActionBar;
import org.telegram.ui.ActionBar.ActionBarMenuItem;
import org.telegram.ui.ActionBar.BaseFragment;
import org.telegram.ui.ActionBar.BottomSheet;
import org.telegram.ui.ActionBar.Theme;
import org.telegram.ui.ActionBar.ThemeDescription;
import org.telegram.ui.Cells.TextCheckCell;
import org.telegram.ui.Cells.TextInfoPrivacyCell;
import org.telegram.ui.Cells.TextSettingsCell;
import org.telegram.ui.Components.EditTextBoldCursor;
@ -49,6 +44,7 @@ import org.telegram.ui.Components.LayoutHelper;
import java.util.ArrayList;
import kotlin.text.StringsKt;
import tw.nekomimi.nekogram.utils.PopupBuilder;
public class ShadowsocksSettingsActivity extends BaseFragment {
@ -284,13 +280,9 @@ public class ShadowsocksSettingsActivity extends BaseFragment {
methodField.setOnClickListener((v) -> {
BottomSheet.Builder select = new BottomSheet.Builder(context);
PopupBuilder select = new PopupBuilder(v);
select.setItems(methodSet,(d,i) -> {
methodField.getValueTextView().setText(methodSet[i]);
});
select.setItems(methodSet, methodField.getValueTextView()::setText);
select.show();

View File

@ -13,16 +13,13 @@ import android.graphics.Canvas;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.os.Build;
import android.text.Editable;
import android.text.InputType;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
@ -40,20 +37,18 @@ import org.telegram.messenger.Utilities;
import org.telegram.ui.ActionBar.ActionBar;
import org.telegram.ui.ActionBar.ActionBarMenuItem;
import org.telegram.ui.ActionBar.BaseFragment;
import org.telegram.ui.ActionBar.BottomSheet;
import org.telegram.ui.ActionBar.Theme;
import org.telegram.ui.ActionBar.ThemeDescription;
import org.telegram.ui.Cells.TextCheckCell;
import org.telegram.ui.Cells.TextInfoPrivacyCell;
import org.telegram.ui.Cells.TextSettingsCell;
import org.telegram.ui.Components.AlertsCreator;
import org.telegram.ui.Components.EditTextBoldCursor;
import org.telegram.ui.Components.LayoutHelper;
import java.util.ArrayList;
import kotlin.NumbersKt;
import kotlin.text.StringsKt;
import tw.nekomimi.nekogram.utils.PopupBuilder;
public class VmessSettingsActivity extends BaseFragment {
@ -333,13 +328,9 @@ public class VmessSettingsActivity extends BaseFragment {
securityField.setOnClickListener((v) -> {
BottomSheet.Builder select = new BottomSheet.Builder(context);
PopupBuilder select = new PopupBuilder(v);
select.setItems(securitySet,(d,i) -> {
securityField.getValueTextView().setText(securitySet[i]);
});
select.setItems(securitySet, securityField.getValueTextView()::setText);
select.show();
@ -355,13 +346,9 @@ public class VmessSettingsActivity extends BaseFragment {
networkField.setOnClickListener((v) -> {
BottomSheet.Builder select = new BottomSheet.Builder(context);
PopupBuilder select = new PopupBuilder(v);
select.setItems(networkSet,(d,i) -> {
networkField.getValueTextView().setText(networkSet[i]);
});
select.setItems(networkSet, networkField.getValueTextView()::setText);
select.show();
@ -377,13 +364,9 @@ public class VmessSettingsActivity extends BaseFragment {
headTypeField.setOnClickListener((v) -> {
BottomSheet.Builder select = new BottomSheet.Builder(context);
PopupBuilder select = new PopupBuilder(v);
select.setItems(headTypeSet,(d,i) -> {
headTypeField.getValueTextView().setText(headTypeSet[i]);
});
select.setItems(headTypeSet, headTypeField.getValueTextView()::setText);
select.show();

View File

@ -8,6 +8,14 @@ object FileUtil {
fun readUtf8String(file: File) = file.readText()
@JvmStatic
fun writeUtf8String(text: String, save: File) = save.writeText(text)
fun writeUtf8String(text: String, save: File) {
if (save.isDirectory) save.deleteRecursively()
if (!save.isFile) save.createNewFile()
save.writeText(text)
}
}

View File

@ -0,0 +1,48 @@
package tw.nekomimi.nekogram.utils
import android.view.View
import org.telegram.ui.ActionBar.ActionBarMenuItem
import org.telegram.ui.ActionBar.Theme
class PopupBuilder(anchor: View) : ActionBarMenuItem(anchor.context, null, Theme.ACTION_BAR_WHITE_SELECTOR_COLOR, -0x4c4c4d) {
init {
setAnchor(anchor)
isVerticalScrollBarEnabled = true
}
@FunctionalInterface
interface ItemListener {
fun onClick(item: CharSequence)
}
fun setItems(items: Array<CharSequence>, listener: ItemListener) {
removeAllSubItems()
items.forEachIndexed { i, v ->
addSubItem(i, v)
}
setDelegate {
listener.onClick(items[it])
}
}
fun show() {
toggleSubMenu()
}
}

View File

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="NekoX" translatable="false">Nekogram X</string>
<string name="NekoXProxy">NekoX Public Proxy</string>
<string name="PublicPrefix">[ Public ]</string>
<string name="NekoXProxyInfo">It may take tens of seconds to load the NekoX Public built-in proxy :)</string>

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
git branch -D release
git checkout -b release
git push origin release -f
git checkout master
git tag -d "$1"
git tag "$1"
git push origin ":$1"
git push origin "$1"