Skip to content

Commit

Permalink
Release 9.1.4
Browse files Browse the repository at this point in the history
App:
- Added option to enable gradient for avatars
- Updated translations

Themes:
- Added new values
- Fixed some bugs
  • Loading branch information
mi-g-alex committed Dec 3, 2022
1 parent 4a76155 commit 2c5a870
Show file tree
Hide file tree
Showing 32 changed files with 108 additions and 18 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId "com.c3r5b8.telegram_monet"
minSdk 31
targetSdk 33
versionCode 22092600
versionName '9.0.0'
versionCode 22120302
versionName '9.1.4'
resConfigs 'ar', 'bn_IN', 'de', 'es', 'fa_IR', 'fil', 'fr', 'hi', 'hr', 'in', 'it', 'iw', 'kab', 'ml', 'nl', 'pl', 'pt', 'pt_BR', 'ro', 'ru', 'tl', 'tr_TR', 'uk_UA', 'uz', 'vi', 'zh_CN'
}

Expand Down Expand Up @@ -51,7 +51,7 @@ android {
dependencies {
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
}

Expand Down
13 changes: 12 additions & 1 deletion app/src/main/assets/monet_dark.attheme
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ avatar_backgroundPink=n2_800
avatar_backgroundRed=n2_800
avatar_backgroundSaved=n2_800
avatar_backgroundViolet=n2_800
avatar_background2Blue=n2_800
avatar_background2Cyan=n2_800
avatar_background2Green=n2_800
avatar_background2Orange=n2_800
avatar_background2Pink=n2_800
avatar_background2Red=n2_800
avatar_background2Saved=n2_800
avatar_background2Violet=n2_800
avatar_nameInMessageBlue=a1_400
avatar_nameInMessageCyan=a1_400
avatar_nameInMessageGreen=a1_400
Expand Down Expand Up @@ -395,7 +403,7 @@ chat_secretTimeText=a1_0
chat_selectedBackground=a2_700
chat_sentError=monetRedDark
chat_sentErrorIcon=monetRedDark
chat_serviceBackground=n2_800
chat_serviceBackground=n1_700
chat_serviceBackgroundSelected=n1_900
chat_serviceIcon=a1_100
chat_serviceLink=a1_100
Expand Down Expand Up @@ -638,6 +646,8 @@ switchTrackBlueSelectorChecked=a1_100
switchTrackBlueThumb=a1_100
switchTrackBlueThumbChecked=n1_900
switchTrackChecked=a1_300
topics_unreadCounter=a1_100
topics_unreadCounterMuted=a2_600
undo_background=n2_800
undo_cancelColor=a1_100
undo_infoColor=a1_100
Expand Down Expand Up @@ -747,5 +757,6 @@ windowBackgroundWhiteRedText3=monetRedDark
windowBackgroundWhiteRedText4=monetRedDark
windowBackgroundWhiteRedText5=monetRedDark
windowBackgroundWhiteRedText6=monetRedDark
windowBackgroundWhiteYellowText=a1_100
windowBackgroundWhiteValueText=a1_100
end
13 changes: 12 additions & 1 deletion app/src/main/assets/monet_light.attheme
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ avatar_backgroundPink=a1_600
avatar_backgroundRed=a1_600
avatar_backgroundSaved=a1_600
avatar_backgroundViolet=a1_600
avatar_background2Blue=a1_600
avatar_background2Cyan=a1_600
avatar_background2Green=a1_600
avatar_background2Orange=a1_600
avatar_background2Pink=a1_600
avatar_background2Red=a1_600
avatar_background2Saved=a1_600
avatar_background2Violet=a1_600
avatar_nameInMessageBlue=a1_400
avatar_nameInMessageCyan=a1_400
avatar_nameInMessageGreen=a1_400
Expand Down Expand Up @@ -485,7 +493,7 @@ dialogTextHint=n1_300
dialogTextLink=a1_600
dialogTextRed=monetRedLight
dialogTextRed2=monetRedLight
dialogTopBackground=n1_50
dialogTopBackground=n1_500
dialog_inlineProgress=a1_600
dialog_inlineProgressBackground=n1_50
dialog_liveLocationProgress=a1_600
Expand Down Expand Up @@ -638,6 +646,8 @@ switchTrackBlueSelectorChecked=a1_600
switchTrackBlueThumb=n1_50
switchTrackBlueThumbChecked=n1_50
switchTrackChecked=a1_700
topics_unreadCounter=a1_600
topics_unreadCounterMuted=n1_50
undo_background=a1_600
undo_cancelColor=a1_200
undo_infoColor=n1_50
Expand Down Expand Up @@ -747,5 +757,6 @@ windowBackgroundWhiteRedText3=monetRedLight
windowBackgroundWhiteRedText4=monetRedLight
windowBackgroundWhiteRedText5=monetRedLight
windowBackgroundWhiteRedText6=monetRedLight
windowBackgroundWhiteYellowText=a1_600
windowBackgroundWhiteValueText=a1_600
end
55 changes: 43 additions & 12 deletions app/src/main/java/com/c3r5b8/telegram_monet/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class MainActivity : AppCompatActivity() {
//Buttons Telegram
val buttonTelegramDark: Button = findViewById(R.id.setup_dark_button)
val buttonTelegramLight: Button = findViewById(R.id.setup_light_button)
val useGradient : SwitchCompat = findViewById(R.id.switchGradient)
val useGradient: SwitchCompat = findViewById(R.id.switchGradient)
val useGradientAvatars: SwitchCompat = findViewById(R.id.switchGradientAvatars)

//Buttons TelegramX
val buttonTelegramXDark: Button = findViewById(R.id.setup_x_dark_button)
Expand Down Expand Up @@ -53,6 +54,17 @@ class MainActivity : AppCompatActivity() {
darkThemeImport = darkThemeImport.replace("noGradient", "chat_outBubbleGradient")
}

if(useGradientAvatars.isChecked) {
darkThemeImport = darkThemeImport.replace("avatar_backgroundBlue=n2_800", "avatar_backgroundBlue=n2_700")
darkThemeImport = darkThemeImport.replace("avatar_backgroundCyan=n2_800", "avatar_backgroundCyan=n2_700")
darkThemeImport = darkThemeImport.replace("avatar_backgroundGreen=n2_800", "avatar_backgroundGreen=n2_700")
darkThemeImport = darkThemeImport.replace("avatar_backgroundOrange=n2_800", "avatar_backgroundOrange=n2_700")
darkThemeImport = darkThemeImport.replace("avatar_backgroundPink=n2_800", "avatar_backgroundPink=n2_700")
darkThemeImport = darkThemeImport.replace("avatar_backgroundRed=n2_800", "avatar_backgroundRed=n2_700")
darkThemeImport = darkThemeImport.replace("avatar_backgroundSaved=n2_800", "avatar_backgroundSaved=n2_700")
darkThemeImport = darkThemeImport.replace("avatar_backgroundViolet=n2_800", "avatar_backgroundViolet=n2_700")
}

val themeString = changeTextTelegram(darkThemeImport, applicationContext)

File(applicationContext.cacheDir, fileName).writeText(text = themeString)
Expand All @@ -65,14 +77,26 @@ class MainActivity : AppCompatActivity() {
//Create telegram Light theme
buttonTelegramLight.setOnClickListener {
val lightMonetFile = "monet_light.attheme"
var lightThemeImport = application.assets.open(lightMonetFile).bufferedReader().readText()
var lightThemeImport =
application.assets.open(lightMonetFile).bufferedReader().readText()

val fileName = "Light Theme.attheme"

if (useGradient.isChecked) {
lightThemeImport = lightThemeImport.replace("noGradient", "chat_outBubbleGradient")
}

if(useGradientAvatars.isChecked) {
lightThemeImport = lightThemeImport.replace("avatar_backgroundBlue=a1_600", "avatar_backgroundBlue=a1_500")
lightThemeImport = lightThemeImport.replace("avatar_backgroundCyan=a1_600", "avatar_backgroundCyan=a1_500")
lightThemeImport = lightThemeImport.replace("avatar_backgroundGreen=a1_600", "avatar_backgroundGreen=a1_500")
lightThemeImport = lightThemeImport.replace("avatar_backgroundOrange=a1_600", "avatar_backgroundOrange=a1_500")
lightThemeImport = lightThemeImport.replace("avatar_backgroundPink=a1_600", "avatar_backgroundPink=a1_500")
lightThemeImport = lightThemeImport.replace("avatar_backgroundRed=a1_600", "avatar_backgroundRed=a1_500")
lightThemeImport = lightThemeImport.replace("avatar_backgroundSaved=a1_600", "avatar_backgroundSaved=a1_500")
lightThemeImport = lightThemeImport.replace("avatar_backgroundViolet=a1_600", "avatar_backgroundViolet=a1_500")
}

val themeString = changeTextTelegram(lightThemeImport, applicationContext)

File(applicationContext.cacheDir, fileName).writeText(text = themeString)
Expand Down Expand Up @@ -106,7 +130,8 @@ class MainActivity : AppCompatActivity() {
//Create telegramX Light theme
buttonTelegramXLight.setOnClickListener {
val lightMonetFile = "monet_x_light.tgx-theme"
val lightThemeImport = application.assets.open(lightMonetFile).bufferedReader().readText()
val lightThemeImport =
application.assets.open(lightMonetFile).bufferedReader().readText()
val themeString = changeTextTelegramX(lightThemeImport, applicationContext)
val fileName = "Light Theme.tgx-theme"

Expand Down Expand Up @@ -151,31 +176,37 @@ class MainActivity : AppCompatActivity() {
startActivity(Intent.createChooser(intent, theme))
}

private fun putData(){
val sharedPreferences: SharedPreferences = getSharedPreferences("switchSettings", MODE_PRIVATE)
private fun putData() {
val sharedPreferences: SharedPreferences =
getSharedPreferences("switchSettings", MODE_PRIVATE)
val sharedPreferencesEditor: SharedPreferences.Editor = sharedPreferences.edit()

val useGradient : SwitchCompat = findViewById(R.id.switchGradient)
val useGradient: SwitchCompat = findViewById(R.id.switchGradient)
val useGradientAvatars: SwitchCompat = findViewById(R.id.switchGradientAvatars)
val isAmoledMode: SwitchCompat = findViewById(R.id.switchAmoledPhone)

sharedPreferencesEditor.putBoolean("useGradient", useGradient.isChecked)
sharedPreferencesEditor.putBoolean("useGradientAvatars", useGradientAvatars.isChecked)
sharedPreferencesEditor.putBoolean("isAmoledMode", isAmoledMode.isChecked)
sharedPreferencesEditor.apply()
}

private fun getData(){
val sharedPreferences: SharedPreferences = getSharedPreferences("switchSettings", MODE_PRIVATE)
private fun getData() {
val sharedPreferences: SharedPreferences =
getSharedPreferences("switchSettings", MODE_PRIVATE)

val useGradient : SwitchCompat = findViewById(R.id.switchGradient)
val useGradient: SwitchCompat = findViewById(R.id.switchGradient)
val useGradientAvatars: SwitchCompat = findViewById(R.id.switchGradientAvatars)
val isAmoledMode: SwitchCompat = findViewById(R.id.switchAmoledPhone)

useGradient.isChecked =sharedPreferences.getBoolean("useGradient", false)
isAmoledMode.isChecked =sharedPreferences.getBoolean("isAmoledMode", false)
useGradient.isChecked = sharedPreferences.getBoolean("useGradient", false)
useGradientAvatars.isChecked = sharedPreferences.getBoolean("useGradientAvatars", false)
isAmoledMode.isChecked = sharedPreferences.getBoolean("isAmoledMode", false)
}

override fun onPause() {
super.onPause()
putData()
}

}
}
10 changes: 10 additions & 0 deletions app/src/main/res/layout/settings_card.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@
android:text="@string/settings_card_use_gradient"
android:textSize="16sp" />

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switchGradientAvatars"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="end"
android:layout_margin="5dp"
android:fontFamily="@font/google_sans_medium"
android:text="@string/settings_card_use_gradient_avatars"
android:textSize="16sp" />


</LinearLayout>

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">ضبط</string>
<string name="settings_card_title">الإعدادات</string>
<string name="settings_card_use_gradient">تمكين التدرج (Telegram)</string>
<string name="settings_card_use_gradient_avatars" translatable="false">تمكين التدرج للصور الرمزية</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-b+fil/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">I-set up</string>
<string name="settings_card_title">Mga setting</string>
<string name="settings_card_use_gradient">Paganahin ang gradient (Telegram)</string>
<string name="settings_card_use_gradient_avatars">Paganahin ang gradient para sa mga avatar</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-b+kab/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">Sebded</string>
<string name="settings_card_title">Iɣewwaṛen</string>
<string name="settings_card_use_gradient">Rmed tafesna n yini (Telegram)</string>
<string name="settings_card_use_gradient_avatars">Rmed tafesna i wavaṭaren</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-bn-rIN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">সেট করা</string>
<string name="settings_card_title">সেটিংস</string>
<string name="settings_card_use_gradient">গ্রেডিয়েন্ট সক্ষম করুন (টেলিগ্রাম)</string>
<string name="settings_card_use_gradient_avatars">অবতারের জন্য গ্রেডিয়েন্ট সক্ষম করুন</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">Einrichten</string>
<string name="settings_card_title">Einstellungen</string>
<string name="settings_card_use_gradient">Farbverlauf aktivieren (Telegram)</string>
<string name="settings_card_use_gradient_avatars">Farbverlauf für Avatare aktivieren</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">Configurar</string>
<string name="settings_card_title">Ajustes</string>
<string name="settings_card_use_gradient">Habilitar gradiente (Telegram)</string>
<string name="settings_card_use_gradient_avatars">Habilitar degradado para avatares</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-fa-rIR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">نصب</string>
<string name="settings_card_title">تنظیمات</string>
<string name="settings_card_use_gradient">فعال کردن گرادینت (تلگرام)</string>
<string name="settings_card_use_gradient_avatars">فعال کردن گرادیان برای تصاویر</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">Appliquer</string>
<string name="settings_card_title">Réglages</string>
<string name="settings_card_use_gradient">Activer le dégradé (Telegram)</string>
<string name="settings_card_use_gradient_avatars">Activer le dégradé pour les avatars</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-hi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">सेट करें</string>
<string name="settings_card_title">समायोजन</string>
<string name="settings_card_use_gradient">ग्रेडिएंट सक्षम करें (टेलीग्राम)</string>
<string name="settings_card_use_gradient_avatars">अवतारों के लिए ढाल सक्षम करें</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-hr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">Postavi</string>
<string name="settings_card_title">Postavke</string>
<string name="settings_card_use_gradient">Omogući gradijent (Telegram)</string>
<string name="settings_card_use_gradient_avatars">Omogući gradijent za avatare</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-in/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">Buat</string>
<string name="settings_card_title">Pengaturan</string>
<string name="settings_card_use_gradient">Aktifkan gradien (Telegram)</string>
<string name="settings_card_use_gradient_avatars">Aktifkan gradien untuk avatar</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">Imposta</string>
<string name="settings_card_title">Impostazioni</string>
<string name="settings_card_use_gradient">Abilita sfumatura (Telegram)</string>
<string name="settings_card_use_gradient_avatars">Abilita gradiente per avatar</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-iw/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">להגדיר</string>
<string name="settings_card_title">הגדרות</string>
<string name="settings_card_use_gradient">אפשר שיפוע (Telegram)</string>
<string name="settings_card_use_gradient_avatars">אפשר מעבר צבע עבור אווטרים</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-ml/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">സജ്ജമാക്കുക</string>
<string name="settings_card_title">ക്രമീകരണങ്ങൾ</string>
<string name="settings_card_use_gradient">ഗ്രേഡിയന്റ് പ്രവർത്തനക്ഷമമാക്കുക (ടെലിഗ്രാം)</string>
<string name="settings_card_use_gradient_avatars">അവതാരങ്ങള്ക്കു് ഗ്രേഡിയന്റ് സജ്ജമാക്കുക</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">Installatie</string>
<string name="settings_card_title">Instellingen</string>
<string name="settings_card_use_gradient">Verloop inschakelen (Telegram)</string>
<string name="settings_card_use_gradient_avatars">Kleurverloop voor avatars inschakelen</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">Ustaw</string>
<string name="settings_card_title">Ustawienia</string>
<string name="settings_card_use_gradient">Włącz gradient (Telegram)</string>
<string name="settings_card_use_gradient_avatars">Włącz gradient dla awatarów</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">Configurar</string>
<string name="settings_card_title">Definições</string>
<string name="settings_card_use_gradient">Ativar gradiente (Telegram)</string>
<string name="settings_card_use_gradient_avatars">Ativar gradiente para Avatares</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">Configurar</string>
<string name="settings_card_title">Definições</string>
<string name="settings_card_use_gradient">Ativar gradiente (Telegram)</string>
<string name="settings_card_use_gradient_avatars">Ativar gradiente para Avatares</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-ro/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">Setează</string>
<string name="settings_card_title">Setări</string>
<string name="settings_card_use_gradient">Activați gradientul (Telegram)</string>
<string name="settings_card_use_gradient_avatars">Activați gradientul pentru avatare</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
<string name="setup_card_button">Установить</string>
<string name="settings_card_title">Настройки</string>
<string name="settings_card_use_gradient">Включить градиент (Telegram)</string>
<string name="settings_card_use_gradient_avatars">Включить градиент для аватарок</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-tl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">ᜌᜒᜋᜓᜎᜈ᜔ </string>
<string name="settings_card_title">Mga setting</string>
<string name="settings_card_use_gradient">Paganahin ang gradient (Telegram)</string>
<string name="settings_card_use_gradient_avatars">Paganahin ang gradient para sa mga avatar</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-tr-rTR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">Kur</string>
<string name="settings_card_title">Ayarlar</string>
<string name="settings_card_use_gradient">Gradyanı etkinleştir (Telegram)</string>
<string name="settings_card_use_gradient_avatars">Avatarlar için degradeyi etkinleştir</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-uk-rUA/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">Застосувати</string>
<string name="settings_card_title">Налаштування</string>
<string name="settings_card_use_gradient">Увімкнути градієнт (Telegram)</string>
<string name="settings_card_use_gradient_avatars">Включити градієнт для аватарів</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-uz/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<string name="setup_card_button">O\'rnatish</string>
<string name="settings_card_title">Sozlamalar</string>
<string name="settings_card_use_gradient">Gradientni yoqish (Telegram)</string>
<string name="settings_card_use_gradient_avatars">Avatarlar uchun gradientni yoqish</string>
</resources>
Loading

0 comments on commit 2c5a870

Please sign in to comment.