diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/AppIconsSelectorCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/AppIconsSelectorCell.java index 1c1272095..ba8fb77d8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/AppIconsSelectorCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/AppIconsSelectorCell.java @@ -81,6 +81,7 @@ public class AppIconsSelectorCell extends RecyclerListView implements Notificati holderView.bind(icon); holderView.iconView.setBackground(Theme.createSimpleSelectorRoundRectDrawable(AndroidUtilities.dp(ICONS_ROUND_RADIUS), Color.TRANSPARENT, Theme.getColor(Theme.key_listSelector), Color.BLACK)); holderView.iconView.setForeground(icon.foreground); + holderView.iconView.setIsNekoXIcon(icon.isNekoX()); } @Override @@ -289,6 +290,7 @@ public class AppIconsSelectorCell extends RecyclerListView implements Notificati } public static class AdaptiveIconImageView extends ImageView { + private boolean isNekoXIcon = false; private Drawable foreground; private Path path = new Path(); private int outerPadding = AndroidUtilities.dp(5); @@ -303,6 +305,10 @@ public class AppIconsSelectorCell extends RecyclerListView implements Notificati invalidate(); } + public void setIsNekoXIcon(boolean value) { + this.isNekoXIcon = value; + } + @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); @@ -325,11 +331,12 @@ public class AppIconsSelectorCell extends RecyclerListView implements Notificati public void draw(Canvas canvas) { canvas.save(); canvas.clipPath(path); - canvas.scale(1f + backgroundOuterPadding / (float) getWidth(), 1f + backgroundOuterPadding / (float) getHeight(), getWidth() / 2f, getHeight() / 2f); + if (!this.isNekoXIcon) + canvas.scale(1f + backgroundOuterPadding / (float) getWidth(), 1f + backgroundOuterPadding / (float) getHeight(), getWidth() / 2f, getHeight() / 2f); super.draw(canvas); canvas.restore(); - if (foreground != null) { + if (foreground != null && !this.isNekoXIcon) { foreground.setBounds(-outerPadding, -outerPadding, getWidth() + outerPadding, getHeight() + outerPadding); foreground.draw(canvas); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/AppIconBulletinLayout.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/AppIconBulletinLayout.java index 7c03890e4..735c4f23a 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/AppIconBulletinLayout.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/AppIconBulletinLayout.java @@ -34,10 +34,12 @@ public class AppIconBulletinLayout extends Bulletin.ButtonLayout { textView.setTypeface(Typeface.SANS_SERIF); addView(textView, LayoutHelper.createFrameRelatively(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.START | Gravity.CENTER_VERTICAL, 56, 0, 16, 0)); + // NekoX: try to fix NekoX icon imageView.setImageDrawable(ContextCompat.getDrawable(context, icon.background)); imageView.setOuterPadding(AndroidUtilities.dp(8)); imageView.setBackgroundOuterPadding(AndroidUtilities.dp(24)); imageView.setForeground(icon.foreground); + imageView.setIsNekoXIcon(icon.isNekoX()); textView.setText(AndroidUtilities.replaceTags(LocaleController.formatString(R.string.AppIconChangedTo, LocaleController.getString(icon.title)))); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/PremiumAppIconsPreviewView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/PremiumAppIconsPreviewView.java index 6a2b0eb07..d5da67fbb 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/PremiumAppIconsPreviewView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/PremiumAppIconsPreviewView.java @@ -55,6 +55,7 @@ public class PremiumAppIconsPreviewView extends FrameLayout implements PagerHead AdaptiveIconImageView iconImageView = new AdaptiveIconImageView(ctx, i); iconImageView.setLayoutParams(LayoutHelper.createFrame(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER, 0, 52, 0, 0)); iconImageView.setForeground(icon.foreground); + iconImageView.setIsNekoXIcon(icon.isNekoX()); iconImageView.setBackgroundResource(icon.background); iconImageView.setPadding(AndroidUtilities.dp(8)); iconImageView.setBackgroundOuterPadding(AndroidUtilities.dp(32)); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LauncherIconController.java b/TMessagesProj/src/main/java/org/telegram/ui/LauncherIconController.java index 6451e336e..a3c38bf2d 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LauncherIconController.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LauncherIconController.java @@ -34,12 +34,12 @@ public class LauncherIconController { } public enum LauncherIcon { - DEFAULT("DefaultIcon", R.drawable.icon_background_sa, R.mipmap.icon_foreground_sa, R.string.AppIconDefault), + DEFAULT("DefaultIcon", R.drawable.ic_launcher_foreground, R.mipmap.ic_launcher, R.string.AppIconDefault), VINTAGE("VintageIcon", R.drawable.icon_6_background_sa, R.mipmap.icon_6_foreground_sa, R.string.AppIconVintage), AQUA("AquaIcon", R.drawable.icon_4_background_sa, R.mipmap.icon_foreground_sa, R.string.AppIconAqua), - PREMIUM("PremiumIcon", R.drawable.icon_3_background_sa, R.mipmap.icon_3_foreground_sa, R.string.AppIconPremium, true), - TURBO("TurboIcon", R.drawable.icon_5_background_sa, R.mipmap.icon_5_foreground_sa, R.string.AppIconTurbo, true), - NOX("NoxIcon", R.drawable.icon_2_background_sa, R.mipmap.icon_foreground_sa, R.string.AppIconNox, true); + PREMIUM("PremiumIcon", R.drawable.icon_3_background_sa, R.mipmap.icon_3_foreground_sa, R.string.AppIconPremium), + TURBO("TurboIcon", R.drawable.icon_5_background_sa, R.mipmap.icon_5_foreground_sa, R.string.AppIconTurbo), + NOX("NoxIcon", R.drawable.icon_2_background_sa, R.mipmap.icon_foreground_sa, R.string.AppIconNox); public final String key; public final int background; @@ -67,5 +67,9 @@ public class LauncherIconController { this.title = title; this.premium = premium; } + + public boolean isNekoX() { + return this == DEFAULT; + } } } diff --git a/TMessagesProj/src/main/res/drawable-hdpi/ic_launcher_dr.png b/TMessagesProj/src/main/res/drawable-hdpi/ic_launcher_dr.png new file mode 100644 index 000000000..6e16733c9 Binary files /dev/null and b/TMessagesProj/src/main/res/drawable-hdpi/ic_launcher_dr.png differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/ic_launcher_dr.png b/TMessagesProj/src/main/res/drawable-mdpi/ic_launcher_dr.png new file mode 100644 index 000000000..ef397fd79 Binary files /dev/null and b/TMessagesProj/src/main/res/drawable-mdpi/ic_launcher_dr.png differ diff --git a/TMessagesProj/src/main/res/drawable-xxxhdpi/ic_launcher_dr.png b/TMessagesProj/src/main/res/drawable-xxxhdpi/ic_launcher_dr.png new file mode 100644 index 000000000..881369185 Binary files /dev/null and b/TMessagesProj/src/main/res/drawable-xxxhdpi/ic_launcher_dr.png differ diff --git a/TMessagesProj/src/main/res/mipmap-anydpi-v26/icon_2_launcher.xml b/TMessagesProj/src/main/res/mipmap-anydpi-v26/icon_2_launcher.xml index 9f6262518..f542f0ff4 100644 --- a/TMessagesProj/src/main/res/mipmap-anydpi-v26/icon_2_launcher.xml +++ b/TMessagesProj/src/main/res/mipmap-anydpi-v26/icon_2_launcher.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/TMessagesProj/src/main/res/mipmap-anydpi-v26/icon_2_launcher_round.xml b/TMessagesProj/src/main/res/mipmap-anydpi-v26/icon_2_launcher_round.xml index f2f3cdbe1..cbd78ebac 100644 --- a/TMessagesProj/src/main/res/mipmap-anydpi-v26/icon_2_launcher_round.xml +++ b/TMessagesProj/src/main/res/mipmap-anydpi-v26/icon_2_launcher_round.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/TMessagesProj/src/main/res/mipmap-anydpi-v26/icon_4_launcher.xml b/TMessagesProj/src/main/res/mipmap-anydpi-v26/icon_4_launcher.xml index 996130674..a14110d78 100644 --- a/TMessagesProj/src/main/res/mipmap-anydpi-v26/icon_4_launcher.xml +++ b/TMessagesProj/src/main/res/mipmap-anydpi-v26/icon_4_launcher.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/TMessagesProj/src/main/res/mipmap-anydpi-v26/icon_4_launcher_round.xml b/TMessagesProj/src/main/res/mipmap-anydpi-v26/icon_4_launcher_round.xml index 8088534f5..4503bc735 100644 --- a/TMessagesProj/src/main/res/mipmap-anydpi-v26/icon_4_launcher_round.xml +++ b/TMessagesProj/src/main/res/mipmap-anydpi-v26/icon_4_launcher_round.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/TMessagesProj/src/main/res/mipmap-hdpi/icon_foreground.png b/TMessagesProj/src/main/res/mipmap-hdpi/icon_foreground.png new file mode 100644 index 000000000..04d68f67c Binary files /dev/null and b/TMessagesProj/src/main/res/mipmap-hdpi/icon_foreground.png differ diff --git a/TMessagesProj/src/main/res/mipmap-hdpi/icon_foreground_round.png b/TMessagesProj/src/main/res/mipmap-hdpi/icon_foreground_round.png new file mode 100644 index 000000000..0902d4184 Binary files /dev/null and b/TMessagesProj/src/main/res/mipmap-hdpi/icon_foreground_round.png differ diff --git a/TMessagesProj/src/main/res/mipmap-mdpi/icon_foreground.png b/TMessagesProj/src/main/res/mipmap-mdpi/icon_foreground.png new file mode 100644 index 000000000..d15e45acf Binary files /dev/null and b/TMessagesProj/src/main/res/mipmap-mdpi/icon_foreground.png differ diff --git a/TMessagesProj/src/main/res/mipmap-mdpi/icon_foreground_round.png b/TMessagesProj/src/main/res/mipmap-mdpi/icon_foreground_round.png new file mode 100644 index 000000000..e82b7d0f7 Binary files /dev/null and b/TMessagesProj/src/main/res/mipmap-mdpi/icon_foreground_round.png differ diff --git a/TMessagesProj/src/main/res/mipmap-xhdpi/icon_foreground.png b/TMessagesProj/src/main/res/mipmap-xhdpi/icon_foreground.png new file mode 100644 index 000000000..44a050d0c Binary files /dev/null and b/TMessagesProj/src/main/res/mipmap-xhdpi/icon_foreground.png differ diff --git a/TMessagesProj/src/main/res/mipmap-xhdpi/icon_foreground_round.png b/TMessagesProj/src/main/res/mipmap-xhdpi/icon_foreground_round.png new file mode 100644 index 000000000..0e35d7802 Binary files /dev/null and b/TMessagesProj/src/main/res/mipmap-xhdpi/icon_foreground_round.png differ diff --git a/TMessagesProj/src/main/res/mipmap-xxhdpi/icon_foreground.png b/TMessagesProj/src/main/res/mipmap-xxhdpi/icon_foreground.png new file mode 100644 index 000000000..df3c8aa44 Binary files /dev/null and b/TMessagesProj/src/main/res/mipmap-xxhdpi/icon_foreground.png differ diff --git a/TMessagesProj/src/main/res/mipmap-xxhdpi/icon_foreground_round.png b/TMessagesProj/src/main/res/mipmap-xxhdpi/icon_foreground_round.png new file mode 100644 index 000000000..eb7062e47 Binary files /dev/null and b/TMessagesProj/src/main/res/mipmap-xxhdpi/icon_foreground_round.png differ diff --git a/TMessagesProj/src/main/res/mipmap-xxxhdpi/icon_foreground.png b/TMessagesProj/src/main/res/mipmap-xxxhdpi/icon_foreground.png new file mode 100644 index 000000000..f07164647 Binary files /dev/null and b/TMessagesProj/src/main/res/mipmap-xxxhdpi/icon_foreground.png differ diff --git a/TMessagesProj/src/main/res/mipmap-xxxhdpi/icon_foreground_round.png b/TMessagesProj/src/main/res/mipmap-xxxhdpi/icon_foreground_round.png new file mode 100644 index 000000000..a2c257e27 Binary files /dev/null and b/TMessagesProj/src/main/res/mipmap-xxxhdpi/icon_foreground_round.png differ