[prefs] logo in monet colors
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="108dp"
|
||||
android:width="108dp"
|
||||
android:viewportWidth="108.0"
|
||||
android:viewportHeight="108.0">
|
||||
<path
|
||||
android:fillColor="@color/ic_background_beta"
|
||||
android:pathData="M54,54m-54,0a54,54 0,1 1,108 0a54,54 0,1 1,-108 0" />
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M70.803,32.191C75.023,30.798 77.525,33.057 76.183,37.293C72.812,47.94 66.196,67.363 61.988,79.627C60.888,82.832 55.788,82.707 54.509,79.569C52.314,74.184 49.08,67.918 44.669,63.35C40.45,58.982 34.543,55.824 29.297,53.666C26.103,52.352 25.991,46.982 29.271,45.9L70.803,32.191Z"
|
||||
android:fillAlpha="0.7" />
|
||||
</vector>
|
||||
@@ -11,8 +11,11 @@
|
||||
|
||||
package com.exteragram.messenger.components;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffColorFilter;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.widget.FrameLayout;
|
||||
@@ -20,6 +23,7 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.exteragram.messenger.ExteraUtils;
|
||||
import com.exteragram.messenger.monet.MonetHelper;
|
||||
|
||||
import org.telegram.messenger.AndroidUtilities;
|
||||
import org.telegram.messenger.BuildVars;
|
||||
@@ -30,17 +34,14 @@ import org.telegram.ui.Components.LayoutHelper;
|
||||
|
||||
public class InfoSettingsCell extends FrameLayout {
|
||||
|
||||
private final TextView textView;
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
public InfoSettingsCell(Context context) {
|
||||
super(context);
|
||||
|
||||
textView = new TextView(context);
|
||||
TextView textView = new TextView(context);
|
||||
textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText));
|
||||
textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
|
||||
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);
|
||||
textView.setText(ExteraUtils.getAppName() + " | v" + BuildVars.BUILD_VERSION_STRING);
|
||||
textView.setText(String.format("%s | %s", ExteraUtils.getAppName(), BuildVars.BUILD_VERSION_STRING));
|
||||
textView.setLines(1);
|
||||
textView.setMaxLines(1);
|
||||
textView.setSingleLine(true);
|
||||
@@ -60,20 +61,26 @@ public class InfoSettingsCell extends FrameLayout {
|
||||
valueTextView.setPadding(0, 0, 0, 0);
|
||||
addView(valueTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER | Gravity.TOP, 60, 178, 60, 20));
|
||||
|
||||
ImageView imageView = new ImageView(context);
|
||||
imageView.setScaleType(ImageView.ScaleType.CENTER);
|
||||
imageView.setImageResource(R.drawable.ic_logo_foreground);
|
||||
addView(imageView, LayoutHelper.createFrame(108, 108, Gravity.CENTER | Gravity.TOP, 0, 20, 0, 0));
|
||||
Drawable arrow = context.getResources().getDrawable(R.drawable.ic_logo_foreground).mutate();
|
||||
Theme.ThemeInfo theme = Theme.getActiveTheme();
|
||||
int color = BuildVars.isBetaApp() ? 0xff747F9F : 0xffF54142;
|
||||
|
||||
if (theme.isMonet() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
color = MonetHelper.getColor(theme.isDark() ? "n1_800" : "a1_100");
|
||||
arrow.setColorFilter(new PorterDuffColorFilter(MonetHelper.getColor(theme.isDark() ? "a1_100" : "n2_700"), PorterDuff.Mode.MULTIPLY));
|
||||
} else {
|
||||
arrow.setAlpha((int) (70 * 2.55f));
|
||||
}
|
||||
|
||||
ImageView logo = new ImageView(context);
|
||||
logo.setScaleType(ImageView.ScaleType.CENTER);
|
||||
logo.setBackground(Theme.createCircleDrawable(AndroidUtilities.dp(108), color));
|
||||
logo.setImageDrawable(arrow);
|
||||
addView(logo, LayoutHelper.createFrame(108, 108, Gravity.CENTER | Gravity.TOP, 0, 20, 0, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
super.onMeasure(MeasureSpec.makeMeasureSpec(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
textView.invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,7 @@
|
||||
android:width="108dp"
|
||||
android:viewportWidth="108.0"
|
||||
android:viewportHeight="108.0">
|
||||
<path
|
||||
android:fillColor="@color/ic_background"
|
||||
android:pathData="M54,54m-54,0a54,54 0,1 1,108 0a54,54 0,1 1,-108 0" />
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M70.803,32.191C75.023,30.798 77.525,33.057 76.183,37.293C72.812,47.94 66.196,67.363 61.988,79.627C60.888,82.832 55.788,82.707 54.509,79.569C52.314,74.184 49.08,67.918 44.669,63.35C40.45,58.982 34.543,55.824 29.297,53.666C26.103,52.352 25.991,46.982 29.271,45.9L70.803,32.191Z"
|
||||
android:fillAlpha="0.7" />
|
||||
android:pathData="M70.803,32.191C75.023,30.798 77.525,33.057 76.183,37.293C72.812,47.94 66.196,67.363 61.988,79.627C60.888,82.832 55.788,82.707 54.509,79.569C52.314,74.184 49.08,67.918 44.669,63.35C40.45,58.982 34.543,55.824 29.297,53.666C26.103,52.352 25.991,46.982 29.271,45.9L70.803,32.191Z" />
|
||||
</vector>
|
||||
|
||||
Reference in New Issue
Block a user