diff --git a/app/build.gradle b/app/build.gradle index f19e74a..55bb6b1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "ir.ham3da.darya" minSdkVersion 21 targetSdkVersion 29 - versionCode 19 - versionName "2.2.1" + versionCode 21 + versionName "2.3.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { @@ -35,11 +35,11 @@ dependencies { implementation 'androidx.annotation:annotation:1.1.0' implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' implementation 'androidx.fragment:fragment:1.2.4' - implementation 'androidx.preference:preference:1.1.0' + implementation 'androidx.preference:preference:1.1.1' implementation 'androidx.viewpager2:viewpager2:1.0.0' - implementation 'com.google.firebase:firebase-core:17.3.0' - implementation 'com.google.firebase:firebase-messaging:20.1.5' - implementation 'com.google.firebase:firebase-analytics:17.3.0' + implementation 'com.google.firebase:firebase-core:17.4.2' + implementation 'com.google.firebase:firebase-messaging:20.2.0' + implementation 'com.google.firebase:firebase-analytics:17.4.2' testImplementation 'junit:junit:4.13' androidTestImplementation 'androidx.test.ext:junit:1.1.1' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 2ca8e46..c2f0d8e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -18,22 +18,37 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" + tools:ignore="GoogleAppIndexingWarning"> - - - + + + + android:label="@string/download_declaim" + android:theme="@style/AppTheme.ActionBar" + /> + android:theme="@style/AppTheme.NoActionBar" + /> App info

Short description

The Sea of Poetry is a valuable library of poetry of Persian great poets.

-The Sea of Poetry is free software, meaning that users can use, modify, and +The Sea of Poetry is free application, meaning that users can use, modify, and share application under the terms of the GPLv3 created by the Free Software Foundation (FSF). diff --git a/app/src/main/assets/about_fa.htm b/app/src/main/assets/about_fa.htm index b53ce41..7d9f473 100644 --- a/app/src/main/assets/about_fa.htm +++ b/app/src/main/assets/about_fa.htm @@ -12,7 +12,7 @@ a { - color: blue; + color: $link_color; text-decoration: none; } .serif @@ -22,7 +22,8 @@ html { color: black; - background-color: #FFFFFF; + background-color: $background_color; + color: $text_color; font-family: 'IRANSans', serif; font-size: $fontSize; } diff --git a/app/src/main/assets/help_en.htm b/app/src/main/assets/help_en.htm index abde6a5..0d9daa3 100644 --- a/app/src/main/assets/help_en.htm +++ b/app/src/main/assets/help_en.htm @@ -13,7 +13,7 @@ a { - color: blue; + color: $link_color; text-decoration: none; } .serif @@ -22,11 +22,12 @@ } html { - color: black; - background-color: #FFFFFF; + background-color: $background_color; + color: $text_color; font-family: 'IRANSans', serif; font-size: $fontSize; } + body { margin: 10px; @@ -48,7 +49,19 @@ { height: 24px; width: 24px; + margin:4px 4px; +} +.icon +{ + display: inline-block; + width: 32px; + height: 32px; + text-align: center; + border-radius: 50%; + vertical-align: middle; + background-color: #fff; } + @@ -57,15 +70,15 @@

Add new collection of poems

To add a new collection of poems, first turn on your device's Internet and then touch the - + button to pop up a new collection. In this section you can add poems of your favorite poets to the app.

Search the poems

Touch the - - button to search in the poems database. Then enter the search word and touch the search button() + + button to search in the poems database. Then enter the search word and touch the search button() to see the search result. You can also change the search settings on the search - page by touching the + page by touching the button. By limiting search, the app's search speed will increase. We recommend that you select the collection of poems by touching or Select all when limiting search settings after selecting a poet.

@@ -77,12 +90,12 @@

Declaims(Poems audio)

Some of the poems in the app database contain audio files (such as Hafiz and Saadi's sonnets) stored in the Ganjoor Internet repository. While reading the poems of these poets, touch the - + button to download their audio files. You can listen to the poems after downloading the audio files. The downloaded files will be stored -in the phone storage on the path: Android -/data/ir.ham3da.darya and removed by removing their app.

-

Report software errors

+in the phone storage on the path: Android/data/ir.ham3da.darya and removed by removing their app. +

+

Report application errors

Please report application bugs to us. Our email: ham3da.j@gmail.com

 

diff --git a/app/src/main/assets/help_fa.htm b/app/src/main/assets/help_fa.htm index 05a40cb..8599c3d 100644 --- a/app/src/main/assets/help_fa.htm +++ b/app/src/main/assets/help_fa.htm @@ -13,7 +13,7 @@ a { - color: blue; + color: $link_color; text-decoration: none; } .serif @@ -22,8 +22,8 @@ } html { - color: black; - background-color: #FFFFFF; + background-color: $background_color; + color: $text_color; font-family: 'IRANSans', serif; font-size: $fontSize; } @@ -48,29 +48,43 @@ { height: 24px; width: 24px; - margin:0; + margin:4px 4px; } - +.icon +{ + display: inline-block; + width: 32px; + height: 32px; + text-align: center; + border-radius: 50%; + vertical-align: middle; + background-color: #fff; +} + +

افزودن مجموعه اشعار جدید

برای افزودن مجموعه اشعار جدید ابتدا اینترنت دستگاه خود را روشن کنید و سپس دکمه - را + را لمس کنید تا پنجره مربوط به دریافت مجموعه‌های جدید ظاهر شود. در این بخش شما می‌توانید آثار شاعران مورد نظرتان را به نرم‌افزار اضافه نمایید.

جستجو در بین اشعار

برای جستجو در بین اشعار دکمه - را - لمس کنید؛ سپس در صفحه ظاهر شده کلمه مورد جستجو را وارد نمایید و دکمه - را لمس نمایید - تا نتیجه جستجو را مشاهده نمایید. - همچنین در صفحه جستجو با لمس دکمه - می‌توانید تنظیمات جستجو را تغییر دهید. با محدود کردن جستجو سرعت جستجوگر برنامه - بیشتر خواهد شد. توصیه میکنیم در هنگام محدود کردن تنظیمات جستجو بعد از انتخاب - شاعر، مجموعه شعرها را نیز با لمس کردن انتخاب نمایید و یا گزینه انتخاب همه - را علامت بزنید.

+ +را +لمس کنید؛ سپس در صفحه ظاهر شده کلمه مورد جستجو را وارد نمایید و دکمه +را لمس نمایید +تا نتیجه جستجو را مشاهده نمایید. +همچنین در صفحه جستجو با لمس دکمه +می‌توانید تنظیمات جستجو را تغییر دهید. با محدود کردن جستجو سرعت جستجوگر برنامه +بیشتر خواهد شد. توصیه میکنیم در هنگام محدود کردن تنظیمات جستجو بعد از انتخاب +شاعر، مجموعه شعرها را نیز با لمس کردن انتخاب نمایید و یا گزینه انتخاب همه +را علامت بزنید.

جا به جایی بین شعرها

جدای از اینکه شما می‌توانید از طریق لیست اشعار، شعر مورد نظر خود را فراخوانی کنید؛ برای رفتن به شعر بعدی یا قبلی می‌توانید از طریق کشیدن انگشت لمس خود @@ -80,7 +94,8 @@

خوانش‌ها

برخی از اشعار موجود در بانک اطلاعاتی نرم افزار دارای فایل صوتی می باشند(مانند غزلیات حافظ و سعدی) که در مخزن اینترنتی گنجور ذخیره شده‌اند. در صورت تمایل می‌توانید هنگام مرور اشعار این شاعران، در بخش نمایش شعر با لمس دکمه - + نسبت به دریافت خوانش‌ها اقدام نمایید. پس از دریافت فایل صوتی می‌توانید در بخش نمایش شعرها، روخوانی شعر مورد نظر را گوش کنید. فایلهای دریافت شده در حافظه گوشی در مسیر: Android/data/ir.ham3da.darya ذخیره خواهند شد @@ -91,5 +106,4 @@

گزارش مشکلات نرم‌افزار

ham3da.j@gmail.com

 

- \ No newline at end of file diff --git a/app/src/main/assets/pr_po_en.htm b/app/src/main/assets/pr_po_en.htm index c08f581..05306ff 100644 --- a/app/src/main/assets/pr_po_en.htm +++ b/app/src/main/assets/pr_po_en.htm @@ -13,7 +13,7 @@ a { - color: blue; + color: $link_color; text-decoration: none; } .serif @@ -22,8 +22,8 @@ } html { - color: black; - background-color: #FFFFFF; + background-color: $background_color; + color: $text_color; font-family: 'IRANSans', serif; font-size: $fontSize; } diff --git a/app/src/main/assets/pr_po_fa.htm b/app/src/main/assets/pr_po_fa.htm index 249f136..1ffadf7 100644 --- a/app/src/main/assets/pr_po_fa.htm +++ b/app/src/main/assets/pr_po_fa.htm @@ -13,7 +13,7 @@ a { - color: blue; + color: $link_color; text-decoration: none; } .serif @@ -22,8 +22,8 @@ } html { - color: black; - background-color: #FFFFFF; + background-color: $background_color; + color: $text_color; font-family: 'IRANSans', serif; font-size: $fontSize; } diff --git a/app/src/main/java/ir/ham3da/darya/ActivityAudioCollection.java b/app/src/main/java/ir/ham3da/darya/ActivityAudioCollection.java index 6d2d0aa..bbb1cf8 100644 --- a/app/src/main/java/ir/ham3da/darya/ActivityAudioCollection.java +++ b/app/src/main/java/ir/ham3da/darya/ActivityAudioCollection.java @@ -89,6 +89,7 @@ public boolean onOptionsItemSelected(@NonNull MenuItem item) { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + UtilFunctions.changeTheme(this, true); setContentView(R.layout.activity_audio_collection); ActionBar actionBar = getSupportActionBar(); diff --git a/app/src/main/java/ir/ham3da/darya/ActivityCate.java b/app/src/main/java/ir/ham3da/darya/ActivityCate.java index a1a5983..fcfd362 100644 --- a/app/src/main/java/ir/ham3da/darya/ActivityCate.java +++ b/app/src/main/java/ir/ham3da/darya/ActivityCate.java @@ -13,6 +13,7 @@ import androidx.annotation.NonNull; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.widget.Toolbar; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -31,6 +32,7 @@ import ir.ham3da.darya.ganjoor.GanjoorDbBrowser; import ir.ham3da.darya.ganjoor.GanjoorPoem; import ir.ham3da.darya.ganjoor.GanjoorPoet; +import ir.ham3da.darya.utility.AppSettings; import ir.ham3da.darya.utility.SetLanguage; import ir.ham3da.darya.utility.UtilFunctions; @@ -61,6 +63,7 @@ public class ActivityCate extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + UtilFunctions.changeTheme(this); setContentView(R.layout.activity_cate); Toolbar toolbar = findViewById(R.id.toolbar_cate); diff --git a/app/src/main/java/ir/ham3da/darya/ActivityCollection.java b/app/src/main/java/ir/ham3da/darya/ActivityCollection.java index 54b2e47..4ff57c4 100644 --- a/app/src/main/java/ir/ham3da/darya/ActivityCollection.java +++ b/app/src/main/java/ir/ham3da/darya/ActivityCollection.java @@ -166,7 +166,7 @@ protected void attachBaseContext(Context newBase) { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - + UtilFunctions.changeTheme(this, true); setContentView(R.layout.activity_collection); diff --git a/app/src/main/java/ir/ham3da/darya/ActivityImageEdit.java b/app/src/main/java/ir/ham3da/darya/ActivityImageEdit.java index 83c0400..68776cd 100644 --- a/app/src/main/java/ir/ham3da/darya/ActivityImageEdit.java +++ b/app/src/main/java/ir/ham3da/darya/ActivityImageEdit.java @@ -145,11 +145,9 @@ protected void shareImage() { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + UtilFunctions.changeTheme(this, true); setContentView(R.layout.activity_image_edit); - - - AppSettings.Init(this); String signature = AppSettings.getSignature(); @@ -165,15 +163,10 @@ protected void onCreate(Bundle savedInstanceState) { poemText = getIntent().getStringExtra("poemText"); String poetName = getIntent().getStringExtra("poetName"); - PhotoEditorView mPhotoEditorView = findViewById(R.id.photoEditorView); - fontId = AppSettings.getPoemsFont(); - mTextIranSansTf = AppFontManager.getTypeface(this, fontId); - initViews(); - mPropertiesBSFragment = new PropertiesBSFragment(); mEmojiBSFragment = new EmojiBSFragment(); mStickerBSFragment = new StickerBSFragment(); @@ -208,13 +201,9 @@ protected void onCreate(Bundle savedInstanceState) { } mPhotoEditor.addText(poemText, textStyleBuilder); - // mPhotoEditor.addText(signature, textStyleBuilder); - mPhotoEditor.setOnPhotoEditorListener(this); - - } private void initViews() { diff --git a/app/src/main/java/ir/ham3da/darya/ActivityInfo2.java b/app/src/main/java/ir/ham3da/darya/ActivityInfo2.java index c620ec9..ebd303d 100644 --- a/app/src/main/java/ir/ham3da/darya/ActivityInfo2.java +++ b/app/src/main/java/ir/ham3da/darya/ActivityInfo2.java @@ -37,6 +37,7 @@ public class ActivityInfo2 extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + UtilFunctions.changeTheme(this); setContentView(R.layout.activity_info2); Toolbar toolbar = findViewById(R.id.toolbar_info); diff --git a/app/src/main/java/ir/ham3da/darya/ActivityMain.java b/app/src/main/java/ir/ham3da/darya/ActivityMain.java index 07e4168..a91f336 100644 --- a/app/src/main/java/ir/ham3da/darya/ActivityMain.java +++ b/app/src/main/java/ir/ham3da/darya/ActivityMain.java @@ -2,6 +2,8 @@ import android.content.Context; import android.content.Intent; +import android.content.res.Configuration; +import android.content.res.Resources; import android.os.Build; import android.os.Bundle; import android.os.Handler; @@ -16,6 +18,7 @@ import androidx.annotation.StringRes; import androidx.appcompat.app.ActionBarDrawerToggle; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.widget.Toolbar; import androidx.core.view.GravityCompat; import androidx.drawerlayout.widget.DrawerLayout; @@ -61,17 +64,31 @@ protected void attachBaseContext(Context newBase) { super.attachBaseContext(newContext); } + + + @Override + public void applyOverrideConfiguration(Configuration overrideConfiguration) + { + if (overrideConfiguration != null) { + int uiMode = overrideConfiguration.uiMode; + overrideConfiguration.setTo(getBaseContext().getResources().getConfiguration()); + overrideConfiguration.uiMode = uiMode; + } + super.applyOverrideConfiguration(overrideConfiguration); + } + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - + UtilFunctions.changeTheme(this); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { SetLanguage.wrap(this); } + + // setTheme(R.style.LightTheme); setContentView(R.layout.activity_main); - AppSettings.Init(this); LangSettingList langSetting = AppSettings.getLangSettingList(this); currentLocalIndex = langSetting.getId(); diff --git a/app/src/main/java/ir/ham3da/darya/ActivityPoem.java b/app/src/main/java/ir/ham3da/darya/ActivityPoem.java index aa1ffed..218ce10 100644 --- a/app/src/main/java/ir/ham3da/darya/ActivityPoem.java +++ b/app/src/main/java/ir/ham3da/darya/ActivityPoem.java @@ -173,6 +173,7 @@ public boolean requestAudioFocus(AudioManager.OnAudioFocusChangeListener focusCh protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + UtilFunctions.changeTheme(this); setContentView(R.layout.activity_poem); Toolbar toolbar = findViewById(R.id.toolbar_poem); diff --git a/app/src/main/java/ir/ham3da/darya/ActivityPuzzle.java b/app/src/main/java/ir/ham3da/darya/ActivityPuzzle.java index b0be5ff..6a81b47 100644 --- a/app/src/main/java/ir/ham3da/darya/ActivityPuzzle.java +++ b/app/src/main/java/ir/ham3da/darya/ActivityPuzzle.java @@ -66,6 +66,7 @@ public class ActivityPuzzle extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + UtilFunctions.changeTheme(this, true); setContentView(R.layout.activity_puzzle); AppSettings.Init(this); diff --git a/app/src/main/java/ir/ham3da/darya/ActivitySearch.java b/app/src/main/java/ir/ham3da/darya/ActivitySearch.java index 1cde70d..9b5885e 100644 --- a/app/src/main/java/ir/ham3da/darya/ActivitySearch.java +++ b/app/src/main/java/ir/ham3da/darya/ActivitySearch.java @@ -67,8 +67,8 @@ public class ActivitySearch extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + UtilFunctions.changeTheme(this); setContentView(R.layout.activity_search); - progressBar_loader = findViewById(R.id.progressBar_loader); UtilFunctions1 = new UtilFunctions(this); diff --git a/app/src/main/java/ir/ham3da/darya/ActivitySettings.java b/app/src/main/java/ir/ham3da/darya/ActivitySettings.java index 9620453..5388d2c 100644 --- a/app/src/main/java/ir/ham3da/darya/ActivitySettings.java +++ b/app/src/main/java/ir/ham3da/darya/ActivitySettings.java @@ -1,6 +1,8 @@ package ir.ham3da.darya; + import android.app.Dialog; import android.content.Context; +import android.content.res.Configuration; import android.os.Build; import android.os.Bundle; import android.text.InputType; @@ -25,6 +27,8 @@ import androidx.preference.ListPreference; import androidx.preference.Preference; import androidx.preference.PreferenceFragmentCompat; +import androidx.preference.SwitchPreference; +import androidx.preference.SwitchPreferenceCompat; import java.lang.reflect.Array; import java.util.ArrayList; @@ -40,29 +44,35 @@ import ir.ham3da.darya.utility.LangSettingList; import ir.ham3da.darya.utility.LinkItem; import ir.ham3da.darya.utility.SetLanguage; +import ir.ham3da.darya.utility.UtilFunctions; -public class ActivitySettings extends AppCompatActivity { - +public class ActivitySettings extends AppCompatActivity +{ - static Preference pref_op_db, pref_setFont; + static Preference pref_op_db, pref_setFont; + static boolean nightTheme ; -// static Preference pref_rand_poem; + // static Preference pref_rand_poem; int currentLocalIndex; GanjoorDbBrowser GanjoorDbBrowser1; - public void setRandomPoemText() { + + public void setRandomPoemText() + { } - public static String getRandomPoetsName(GanjoorDbBrowser GanjoorDbBrowser1) { + public static String getRandomPoetsName(GanjoorDbBrowser GanjoorDbBrowser1) + { List names = new ArrayList<>(); String randomSelectedPoets = AppSettings.getRandomSelectedPoets(); List poets = GanjoorDbBrowser1.getPoets(randomSelectedPoets); - for (GanjoorPoet poet : poets) { + for (GanjoorPoet poet : poets) + { names.add(poet._Name); } String names2 = TextUtils.join(" - ", names); @@ -70,12 +80,14 @@ public static String getRandomPoetsName(GanjoorDbBrowser GanjoorDbBrowser1) { } - public static String getRandomPoetsNameFromCat(GanjoorDbBrowser GanjoorDbBrowser1) { + public static String getRandomPoetsNameFromCat(GanjoorDbBrowser GanjoorDbBrowser1) + { List names = new ArrayList<>(); String randomSelectedCategories = AppSettings.getRandomSelectedCategories(); List poets = GanjoorDbBrowser1.getPoetsFromCat(randomSelectedCategories); - for (GanjoorPoet poet : poets) { + for (GanjoorPoet poet : poets) + { names.add(poet._Name); } String names2 = TextUtils.join(" - ", names); @@ -84,15 +96,33 @@ public static String getRandomPoetsNameFromCat(GanjoorDbBrowser GanjoorDbBrowser @Override - protected void attachBaseContext(Context newBase) { + protected void attachBaseContext(Context newBase) + { super.attachBaseContext(SetLanguage.wrap(newBase)); } @Override - protected void onCreate(Bundle savedInstanceState) { + public void applyOverrideConfiguration(Configuration overrideConfiguration) + { + if (overrideConfiguration != null) { + int uiMode = overrideConfiguration.uiMode; + overrideConfiguration.setTo(getBaseContext().getResources().getConfiguration()); + overrideConfiguration.uiMode = uiMode; + } + super.applyOverrideConfiguration(overrideConfiguration); + } + + @Override + protected void onCreate(Bundle savedInstanceState) + { super.onCreate(savedInstanceState); + UtilFunctions.changeTheme(this, true); + AppSettings.Init(this); + nightTheme = AppSettings.checkThemeIsDark(); + - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) + { SetLanguage.wrap(this); } @@ -110,26 +140,31 @@ protected void onCreate(Bundle savedInstanceState) { ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { + if (actionBar != null) + { actionBar.setDisplayHomeAsUpEnabled(true); } setTitle(R.string.action_settings); } - public static class SettingsFragment extends PreferenceFragmentCompat { + public static class SettingsFragment extends PreferenceFragmentCompat + { @Override - public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { + public void onCreatePreferences(Bundle savedInstanceState, String rootKey) + { + final ActivitySettings activitySettings = (ActivitySettings) getActivity(); setPreferencesFromResource(R.xml.root_preferences, rootKey); - GanjoorDbBrowser GanjoorDbBrowser1 = new GanjoorDbBrowser(getContext()); EditTextPreference prefTextSize = findPreference("TextSize"); + final float textSize = AppSettings.getTextSize(); - if (prefTextSize != null) { + if (prefTextSize != null) + { String textSizeStr = String.format(Locale.getDefault(), "%.0f", textSize); @@ -144,48 +179,48 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { App globalVariable = (App) getContext().getApplicationContext(); globalVariable.setUpdatePoetList(true); globalVariable.setUpdateFavList(true); - String textSizeStr1 = String.format(Locale.getDefault(), "%.0f", Float.parseFloat( newValue.toString()) ); - prefTextSize.setTitle( getContext().getString(R.string.Text_size )+ " (" + textSizeStr1 + ")"); + String textSizeStr1 = String.format(Locale.getDefault(), "%.0f", Float.parseFloat(newValue.toString())); + prefTextSize.setTitle(getContext().getString(R.string.Text_size) + " (" + textSizeStr1 + ")"); return true; }); } + SwitchPreferenceCompat night_theme = findPreference("night_theme"); + if (night_theme != null) + { + night_theme.setOnPreferenceChangeListener((preference, newValue) -> { + + if(nightTheme != (boolean)newValue) + { + activitySettings.recreate(); + } + return true; + }); + } ListPreference listPreference = findPreference("randomSelectedCat"); - if(listPreference != null) + if (listPreference != null) { String listPreference_title = getString(R.string.please_select); listPreference.setTitle(listPreference_title + " (" + listPreference.getEntry() + ")"); listPreference.setOnPreferenceChangeListener((preference, newValue) -> { - - - int i = ((ListPreference)preference).findIndexOfValue(newValue.toString()); - CharSequence[] entries = ((ListPreference)preference).getEntries(); - - - + int i = ((ListPreference) preference).findIndexOfValue(newValue.toString()); + CharSequence[] entries = ((ListPreference) preference).getEntries(); listPreference.setTitle(listPreference_title + " (" + entries[i] + ")"); return true; }); } - - final ActivitySettings activitySettings = (ActivitySettings) getActivity(); - LangSettingList LangSettingList1 = AppSettings.getLangSettingList(getContext()); - Preference preferenceLang = findPreference("langSettingList"); - if (preferenceLang != null) { preferenceLang.setTitle(preferenceLang.getTitle() + " (" + LangSettingList1.getText() + ")"); - preferenceLang.setOnPreferenceClickListener(preference -> { - activitySettings.openLangDailog(preference); return false; }); @@ -193,7 +228,6 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { } - pref_op_db = findPreference("optimize_db"); pref_op_db.setOnPreferenceClickListener(preference -> { activitySettings.optimizeDatabase(); @@ -204,12 +238,9 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { int fontId = AppSettings.getPoemsFont(); - // ArrayList fonts = activitySettings.getFontsList(); - + // ArrayList fonts = activitySettings.getFontsList(); String fontName = AppFontManager.getFontName(getContext(), fontId); - pref_setFont.setTitle(pref_setFont.getTitle() + " (" + fontName + ")"); - pref_setFont.setOnPreferenceClickListener(preference -> { activitySettings.openFontDailog(preference); @@ -223,12 +254,13 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { @Override - protected void onPause() { + protected void onPause() + { super.onPause(); } - protected ArrayList getFontsList() + protected ArrayList getFontsList() { ArrayList links = AppFontManager.getFontsList(this); return links; @@ -237,7 +269,7 @@ protected ArrayList getFontsList() protected void openFontDailog(Preference preference) { - final Dialog dialog = new Dialog(preference.getContext()); + final Dialog dialog = new Dialog(preference.getContext()); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.dialog_listview); @@ -268,7 +300,7 @@ protected void openFontDailog(Preference preference) String fontName = AppFontManager.getFontName(getBaseContext(), position); - preference.setTitle(getString(R.string.change_poem_font) + " (" + fontName + ")"); + preference.setTitle(getString(R.string.change_poem_font) + " (" + fontName + ")"); }); @@ -311,7 +343,8 @@ protected void openLangDailog(Preference preference) dialog.dismiss(); AppSettings.saveLanguageSettings(position); - if (currentLocalIndex != position) { + if (currentLocalIndex != position) + { currentLocalIndex = position; recreate(); @@ -322,34 +355,39 @@ protected void openLangDailog(Preference preference) okBtn.setOnClickListener(v -> dialog.dismiss()); - dialog.show(); + dialog.show(); } @Override - protected void onResume() { + protected void onResume() + { super.onResume(); } @Override - public void onBackPressed() { + public void onBackPressed() + { super.onBackPressed(); Bungee.slideDown(this); } @Override - public boolean onCreateOptionsMenu(Menu menu) { + public boolean onCreateOptionsMenu(Menu menu) + { getMenuInflater().inflate(R.menu.setting_menu, menu); return true; } @Override - public boolean onOptionsItemSelected(@NonNull MenuItem item) { + public boolean onOptionsItemSelected(@NonNull MenuItem item) + { int id = item.getItemId(); - if (android.R.id.home == id) { + if (android.R.id.home == id) + { finish(); Bungee.slideDown(this); } @@ -359,13 +397,14 @@ public boolean onOptionsItemSelected(@NonNull MenuItem item) { protected void optimizeDatabase() { final CustomProgress customProgressDlg = new CustomProgress(this); - customProgressDlg.showProgress(getString(R.string.optimize_db), getString(R.string.please_wait2) , false, false, true); + customProgressDlg.showProgress(getString(R.string.optimize_db), getString(R.string.please_wait2), false, false, true); new Thread(() -> { try { GanjoorDbBrowser1.Vacum(); - } catch (Exception e) { + } catch (Exception e) + { e.printStackTrace(); } customProgressDlg.dismiss(); diff --git a/app/src/main/java/ir/ham3da/darya/ActivityWeb.java b/app/src/main/java/ir/ham3da/darya/ActivityWeb.java index 62747fb..43ff1a1 100644 --- a/app/src/main/java/ir/ham3da/darya/ActivityWeb.java +++ b/app/src/main/java/ir/ham3da/darya/ActivityWeb.java @@ -13,6 +13,7 @@ import android.webkit.WebView; import ir.ham3da.darya.utility.SetLanguage; +import ir.ham3da.darya.utility.UtilFunctions; public class ActivityWeb extends AppCompatActivity { @@ -21,7 +22,7 @@ public class ActivityWeb extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - + UtilFunctions.changeTheme(this, true); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { SetLanguage.wrap(this); } diff --git a/app/src/main/java/ir/ham3da/darya/App.java b/app/src/main/java/ir/ham3da/darya/App.java index bc43e9d..acedf4c 100644 --- a/app/src/main/java/ir/ham3da/darya/App.java +++ b/app/src/main/java/ir/ham3da/darya/App.java @@ -2,14 +2,20 @@ import android.app.Application; import android.content.Context; +import android.util.Log; +import androidx.appcompat.app.AppCompatDelegate; + import com.google.firebase.analytics.FirebaseAnalytics; +import ir.ham3da.darya.utility.AppSettings; import ir.ham3da.darya.utility.SetLanguage; public class App extends Application { + + private boolean updatePoetList, updateFavList = false; private FirebaseAnalytics mFirebaseAnalytics; @@ -33,12 +39,15 @@ public void setUpdateFavList(boolean status) updateFavList = status; } - + static { + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); + } @Override public void onCreate() { - // SetLanguage.wrap(this); + //SetLanguage.wrap(this); super.onCreate(); + AppSettings.Init(this); mFirebaseAnalytics = FirebaseAnalytics.getInstance(this); } diff --git a/app/src/main/java/ir/ham3da/darya/adaptors/AdaptorBooks.java b/app/src/main/java/ir/ham3da/darya/adaptors/AdaptorBooks.java index 87a8e82..ca647d8 100644 --- a/app/src/main/java/ir/ham3da/darya/adaptors/AdaptorBooks.java +++ b/app/src/main/java/ir/ham3da/darya/adaptors/AdaptorBooks.java @@ -5,6 +5,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.LinearLayout; import android.widget.TextView; import androidx.cardview.widget.CardView; @@ -136,7 +137,7 @@ public int getItemCount() { public class ViewHolder extends RecyclerView.ViewHolder { public TextView book_name; - public CardView bookCardView; + public LinearLayout bookCardView; public ViewHolder(View itemView) { super(itemView); diff --git a/app/src/main/java/ir/ham3da/darya/adaptors/CateRecycleAdaptor.java b/app/src/main/java/ir/ham3da/darya/adaptors/CateRecycleAdaptor.java index 4f28c02..72ac212 100644 --- a/app/src/main/java/ir/ham3da/darya/adaptors/CateRecycleAdaptor.java +++ b/app/src/main/java/ir/ham3da/darya/adaptors/CateRecycleAdaptor.java @@ -8,6 +8,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; @@ -78,7 +79,7 @@ public class ViewHolder extends RecyclerView.ViewHolder { public TextView item_text; public ImageView avatar_item; - public CardView cateCardView; + public LinearLayout cateCardView; public ViewHolder(View itemView) { diff --git a/app/src/main/java/ir/ham3da/darya/adaptors/CategoryRecycleAdaptor.java b/app/src/main/java/ir/ham3da/darya/adaptors/CategoryRecycleAdaptor.java index 5a1098d..54abd65 100644 --- a/app/src/main/java/ir/ham3da/darya/adaptors/CategoryRecycleAdaptor.java +++ b/app/src/main/java/ir/ham3da/darya/adaptors/CategoryRecycleAdaptor.java @@ -7,6 +7,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; @@ -102,7 +103,7 @@ public class ViewHolder extends RecyclerView.ViewHolder { public TextView item_first_verse; public ImageView avatar_item; - public CardView cateCardView; + public LinearLayout cateCardView; public ViewHolder(View itemView) diff --git a/app/src/main/java/ir/ham3da/darya/adaptors/PoemVerseRecycleAdaptor.java b/app/src/main/java/ir/ham3da/darya/adaptors/PoemVerseRecycleAdaptor.java index bb5f451..c21ddfa 100644 --- a/app/src/main/java/ir/ham3da/darya/adaptors/PoemVerseRecycleAdaptor.java +++ b/app/src/main/java/ir/ham3da/darya/adaptors/PoemVerseRecycleAdaptor.java @@ -10,6 +10,7 @@ import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.AnimationUtils; +import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; @@ -304,7 +305,7 @@ public int getItemViewType(int position) { public class ViewHolder extends RecyclerView.ViewHolder { - public CardView versCardView; + public LinearLayout versCardView; public RelativeLayout verse_layout; public TextView verse_text1, verse_text2; // public CheckBox CheckBox1; diff --git a/app/src/main/java/ir/ham3da/darya/adaptors/PoemsRecycleAdaptor.java b/app/src/main/java/ir/ham3da/darya/adaptors/PoemsRecycleAdaptor.java index f0dbb9f..5bb277c 100644 --- a/app/src/main/java/ir/ham3da/darya/adaptors/PoemsRecycleAdaptor.java +++ b/app/src/main/java/ir/ham3da/darya/adaptors/PoemsRecycleAdaptor.java @@ -1,35 +1,38 @@ package ir.ham3da.darya.adaptors; - import android.content.Context; - import android.content.Intent; - import android.util.TypedValue; - import android.view.LayoutInflater; - import android.view.View; - import android.view.ViewGroup; - import android.widget.ImageView; - import android.widget.TextView; - - import androidx.cardview.widget.CardView; - import androidx.recyclerview.widget.RecyclerView; - - import java.util.List; - - import ir.ham3da.darya.utility.AppFontManager; - import ir.ham3da.darya.utility.AppSettings; - import ir.ham3da.darya.Bungee; - import ir.ham3da.darya.ganjoor.GanjoorPoem; - import ir.ham3da.darya.ActivityPoem; - import ir.ham3da.darya.R; - -public class PoemsRecycleAdaptor extends RecyclerView.Adapter { +import android.content.Context; +import android.content.Intent; +import android.util.TypedValue; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + +import ir.ham3da.darya.utility.AppFontManager; +import ir.ham3da.darya.utility.AppSettings; +import ir.ham3da.darya.Bungee; +import ir.ham3da.darya.ganjoor.GanjoorPoem; +import ir.ham3da.darya.ActivityPoem; +import ir.ham3da.darya.R; + +public class PoemsRecycleAdaptor extends RecyclerView.Adapter +{ private List GanjoorPoemList; private Context context1; private float textSize; int fontId; - public PoemsRecycleAdaptor(List GanjoorPoemList, Context context) { + + public PoemsRecycleAdaptor(List GanjoorPoemList, Context context) + { this.GanjoorPoemList = GanjoorPoemList; this.context1 = context; AppSettings.Init(context); @@ -53,7 +56,8 @@ public void onBindViewHolder(PoemsRecycleAdaptor.ViewHolder holder, int position final int poem_id = GanjoorPoem1._ID; - if( !GanjoorPoem1._FirstVerse.isEmpty()) { + if (!GanjoorPoem1._FirstVerse.isEmpty()) + { holder.item_first_verse.setText(GanjoorPoem1._FirstVerse); holder.item_first_verse.setVisibility(View.VISIBLE); } @@ -80,12 +84,13 @@ public int getItemCount() } - public class ViewHolder extends RecyclerView.ViewHolder { + public class ViewHolder extends RecyclerView.ViewHolder + { public TextView item_text; public TextView item_first_verse; public ImageView avatar_item; - public CardView cateCardView; + public LinearLayout cateCardView; public ViewHolder(View itemView) { diff --git a/app/src/main/java/ir/ham3da/darya/utility/AppSettings.java b/app/src/main/java/ir/ham3da/darya/utility/AppSettings.java index 12996b6..6eeb716 100644 --- a/app/src/main/java/ir/ham3da/darya/utility/AppSettings.java +++ b/app/src/main/java/ir/ham3da/darya/utility/AppSettings.java @@ -513,6 +513,20 @@ public static String getSearchBooksAsString() { } + /** + * check Theme Is Dark + * + * @return boolean + */ + public static boolean checkThemeIsDark() { + if (PreferenceManager1 == null) { + return false; + } + boolean res = PreferenceManager1.getKey("night_theme", false); + + return res; + } + /** * get Game Sound Status * diff --git a/app/src/main/java/ir/ham3da/darya/utility/MyDialogs.java b/app/src/main/java/ir/ham3da/darya/utility/MyDialogs.java index 83a689c..44fb528 100644 --- a/app/src/main/java/ir/ham3da/darya/utility/MyDialogs.java +++ b/app/src/main/java/ir/ham3da/darya/utility/MyDialogs.java @@ -175,6 +175,18 @@ public void ShowContactUs() { public void showHelp() { try { float textSize = AppSettings.getTextSize(); + String background_color = "#ffffff"; + String text_color = "#000"; + String link_color = "blue"; + + + if(AppSettings.checkThemeIsDark()) + { + background_color = "#101d24"; + text_color = "#fff"; + link_color = "#FFC107"; + } + String title = this.context.getString(R.string.help); String CurrentLang = Locale.getDefault().getLanguage(); @@ -189,6 +201,9 @@ public void showHelp() { String text = new String(buffer); text = text.replace("$fontSize", textSize + "px"); + text = text.replace("$background_color", background_color); + text = text.replace("$text_color", text_color ); + text = text.replace("$link_color", link_color ); Intent intent = new Intent(context, ActivityWeb.class); intent.putExtra("title", title); @@ -208,6 +223,17 @@ public void showPolicy() { try { float textSize = AppSettings.getTextSize(); String title = this.context.getString(R.string.about); + String background_color = "#ffffff"; + String text_color = "#000"; + String link_color = "blue"; + + + if(AppSettings.checkThemeIsDark()) + { + background_color = "#101d24"; + text_color = "#fff"; + link_color = "#FFC107"; + } String CurrentLang = Locale.getDefault().getLanguage(); String file_name = "pr_po_" + CurrentLang + ".htm"; @@ -224,6 +250,9 @@ public void showPolicy() { text = text.replace("$name", context.getString(R.string.app_name)); text = text.replace("$fontSize", textSize + "px"); + text = text.replace("$background_color", background_color); + text = text.replace("$text_color", text_color ); + text = text.replace("$link_color", link_color ); Intent intent = new Intent(context, ActivityWeb.class); intent.putExtra("title", title); @@ -245,6 +274,17 @@ public void showAbout() try { float textSize = AppSettings.getTextSize(); String title = this.context.getString(R.string.about); + String background_color = "#ffffff"; + String text_color = "#000"; + String link_color = "blue"; + + + if(AppSettings.checkThemeIsDark()) + { + background_color = "#101d24"; + text_color = "#fff"; + link_color = "#FFC107"; + } String CurrentLang = Locale.getDefault().getLanguage(); @@ -262,6 +302,9 @@ public void showAbout() text = text.replace("$name", context.getString(R.string.app_name)); text = text.replace("$fontSize", textSize + "px"); + text = text.replace("$background_color", background_color); + text = text.replace("$text_color", text_color ); + text = text.replace("$link_color", link_color ); Intent intent = new Intent(context, ActivityWeb.class); intent.putExtra("title", title); diff --git a/app/src/main/java/ir/ham3da/darya/utility/UtilFunctions.java b/app/src/main/java/ir/ham3da/darya/utility/UtilFunctions.java index 9b55adc..ba12455 100644 --- a/app/src/main/java/ir/ham3da/darya/utility/UtilFunctions.java +++ b/app/src/main/java/ir/ham3da/darya/utility/UtilFunctions.java @@ -11,6 +11,8 @@ import android.net.NetworkCapabilities; import android.net.NetworkInfo; import android.net.Uri; + +import androidx.appcompat.app.AppCompatDelegate; import androidx.core.content.res.ResourcesCompat; import android.os.Build; import android.os.StrictMode; @@ -49,7 +51,7 @@ public class UtilFunctions { private ClipboardManager myClipboard; private ClipData myClip; - private static int Store = 5; + private static int Store = 0; public UtilFunctions(Context mCtx) { @@ -627,4 +629,46 @@ public static int spToPx(float sp, Context context) { } + public static void changeTheme(Context context) + { + AppSettings.Init(context); + if(AppSettings.checkThemeIsDark()) + { + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); + //context.setTheme(R.style.AppTheme_NoActionBar); + } + else + { + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); + //context.setTheme(R.style.AppTheme_NoActionBar); + } + } + public static void changeTheme(Context context, boolean WithActionBar) + { + AppSettings.Init(context); + if(AppSettings.checkThemeIsDark()) + { + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); + if(WithActionBar) + { + //context.setTheme(R.style.AppTheme_ActionBar); + } + else + { + // context.setTheme(R.style.AppTheme); + } + } + else + { + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); + if(WithActionBar) + { + //context.setTheme(R.style.AppTheme_ActionBar); + } + else + { + // context.setTheme(R.style.AppTheme); + } + } + } } diff --git a/app/src/main/res/drawable-hdpi/ic_file_download_black_24dp.png b/app/src/main/res/drawable-hdpi/ic_file_download_black_24dp.png deleted file mode 100644 index 3e51cb2..0000000 Binary files a/app/src/main/res/drawable-hdpi/ic_file_download_black_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/ic_file_download_black_24dp.png b/app/src/main/res/drawable-mdpi/ic_file_download_black_24dp.png deleted file mode 100644 index 4c7d7dc..0000000 Binary files a/app/src/main/res/drawable-mdpi/ic_file_download_black_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_file_download_black_24dp.png b/app/src/main/res/drawable-xhdpi/ic_file_download_black_24dp.png deleted file mode 100644 index 3d1298a..0000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_file_download_black_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_file_download_black_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_file_download_black_24dp.png deleted file mode 100644 index dff5e82..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_file_download_black_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_file_download_black_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_file_download_black_24dp.png deleted file mode 100644 index 8e193f7..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/ic_file_download_black_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable/bg_spinner_dropdown.xml b/app/src/main/res/drawable/bg_spinner_dropdown.xml index 4781bb9..19309da 100644 --- a/app/src/main/res/drawable/bg_spinner_dropdown.xml +++ b/app/src/main/res/drawable/bg_spinner_dropdown.xml @@ -4,18 +4,17 @@ + - - + - - + diff --git a/app/src/main/res/drawable/bg_white_rounded.xml b/app/src/main/res/drawable/bg_white_rounded.xml index 53af0cd..c5da198 100644 --- a/app/src/main/res/drawable/bg_white_rounded.xml +++ b/app/src/main/res/drawable/bg_white_rounded.xml @@ -1,6 +1,6 @@ - + - + + android:color="?attr/ListTextColor" /> - - + + diff --git a/app/src/main/res/drawable/circle_background_views.xml b/app/src/main/res/drawable/circle_background_views.xml index f254035..2cc697d 100644 --- a/app/src/main/res/drawable/circle_background_views.xml +++ b/app/src/main/res/drawable/circle_background_views.xml @@ -1,5 +1,5 @@ - + diff --git a/app/src/main/res/drawable/color_pressed.xml b/app/src/main/res/drawable/color_pressed.xml new file mode 100644 index 0000000..5904967 --- /dev/null +++ b/app/src/main/res/drawable/color_pressed.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/color_selected.xml b/app/src/main/res/drawable/color_selected.xml new file mode 100644 index 0000000..94a1a17 --- /dev/null +++ b/app/src/main/res/drawable/color_selected.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_brightness_3_black_24dp.xml b/app/src/main/res/drawable/ic_brightness_3_black_24dp.xml new file mode 100644 index 0000000..2c2f0c5 --- /dev/null +++ b/app/src/main/res/drawable/ic_brightness_3_black_24dp.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_brightness_3_gray_24dp.xml b/app/src/main/res/drawable/ic_brightness_3_gray_24dp.xml new file mode 100644 index 0000000..967153c --- /dev/null +++ b/app/src/main/res/drawable/ic_brightness_3_gray_24dp.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_check_black_24dp.xml b/app/src/main/res/drawable/ic_check_black_24dp.xml index 3c728c5..27c435a 100644 --- a/app/src/main/res/drawable/ic_check_black_24dp.xml +++ b/app/src/main/res/drawable/ic_check_black_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/ic_clear_black_24dp.xml b/app/src/main/res/drawable/ic_clear_my_black_24dp.xml similarity index 88% rename from app/src/main/res/drawable/ic_clear_black_24dp.xml rename to app/src/main/res/drawable/ic_clear_my_black_24dp.xml index ede4b71..bc3ab3d 100644 --- a/app/src/main/res/drawable/ic_clear_black_24dp.xml +++ b/app/src/main/res/drawable/ic_clear_my_black_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/ic_file_download_black_24dp.xml b/app/src/main/res/drawable/ic_file_download_black_24dp.xml index 492b41d..215ee0f 100644 --- a/app/src/main/res/drawable/ic_file_download_black_24dp.xml +++ b/app/src/main/res/drawable/ic_file_download_black_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/ic_mic_black_36dp.xml b/app/src/main/res/drawable/ic_mic_black_36dp.xml index aaa6b5d..f5b8f01 100644 --- a/app/src/main/res/drawable/ic_mic_black_36dp.xml +++ b/app/src/main/res/drawable/ic_mic_black_36dp.xml @@ -1,4 +1,4 @@ - + diff --git a/app/src/main/res/drawable/ic_more_vert_black_24dp.xml b/app/src/main/res/drawable/ic_more_vert_black_24dp.xml index f964102..b9844e3 100644 --- a/app/src/main/res/drawable/ic_more_vert_black_24dp.xml +++ b/app/src/main/res/drawable/ic_more_vert_black_24dp.xml @@ -1,5 +1,5 @@ - + diff --git a/app/src/main/res/drawable/ic_pause_black_24dp.xml b/app/src/main/res/drawable/ic_pause_black_24dp.xml index 7824cae..55c929c 100644 --- a/app/src/main/res/drawable/ic_pause_black_24dp.xml +++ b/app/src/main/res/drawable/ic_pause_black_24dp.xml @@ -1,5 +1,5 @@ - - + diff --git a/app/src/main/res/drawable/ic_play_arrow_black_24dp.xml b/app/src/main/res/drawable/ic_play_arrow_black_24dp.xml index 3100224..ab266c6 100644 --- a/app/src/main/res/drawable/ic_play_arrow_black_24dp.xml +++ b/app/src/main/res/drawable/ic_play_arrow_black_24dp.xml @@ -1,5 +1,5 @@ - + diff --git a/app/src/main/res/drawable/ic_search_black_36dp.xml b/app/src/main/res/drawable/ic_search_black_36dp.xml index 28f04e7..a7b3288 100644 --- a/app/src/main/res/drawable/ic_search_black_36dp.xml +++ b/app/src/main/res/drawable/ic_search_black_36dp.xml @@ -1,4 +1,4 @@ - + diff --git a/app/src/main/res/drawable/ic_text_fields_black_24dp.xml b/app/src/main/res/drawable/ic_text_fields_black_24dp.xml index dd81ddf..4abb997 100644 --- a/app/src/main/res/drawable/ic_text_fields_black_24dp.xml +++ b/app/src/main/res/drawable/ic_text_fields_black_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/ic_update_black_24dp.xml b/app/src/main/res/drawable/ic_update_black_24dp.xml index a1a7cbd..744b22a 100644 --- a/app/src/main/res/drawable/ic_update_black_24dp.xml +++ b/app/src/main/res/drawable/ic_update_black_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/ic_volume_down_black_24dp.xml b/app/src/main/res/drawable/ic_volume_down_black_24dp.xml index 290a0cf..28868ad 100644 --- a/app/src/main/res/drawable/ic_volume_down_black_24dp.xml +++ b/app/src/main/res/drawable/ic_volume_down_black_24dp.xml @@ -1,5 +1,5 @@ - + diff --git a/app/src/main/res/drawable/selector_attentions_list_item.xml b/app/src/main/res/drawable/selector_attentions_list_item.xml index 6cd11d5..fe7adc8 100644 --- a/app/src/main/res/drawable/selector_attentions_list_item.xml +++ b/app/src/main/res/drawable/selector_attentions_list_item.xml @@ -2,9 +2,9 @@ - - + + - + \ No newline at end of file diff --git a/app/src/main/res/drawable/verse_drawable.xml b/app/src/main/res/drawable/verse_drawable.xml new file mode 100644 index 0000000..6a4c383 --- /dev/null +++ b/app/src/main/res/drawable/verse_drawable.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_audio_collection.xml b/app/src/main/res/layout/activity_audio_collection.xml index 6ece918..0af050d 100644 --- a/app/src/main/res/layout/activity_audio_collection.xml +++ b/app/src/main/res/layout/activity_audio_collection.xml @@ -41,7 +41,8 @@ android:clipToPadding="true" android:paddingBottom="5dip" android:scrollbars="vertical" - tools:listitem="@layout/item_audio" /> + tools:listitem="@layout/item_audio" + android:background="?attr/colorPrimaryBG"/> diff --git a/app/src/main/res/layout/activity_cate.xml b/app/src/main/res/layout/activity_cate.xml index a24bba9..ec1fa6d 100644 --- a/app/src/main/res/layout/activity_cate.xml +++ b/app/src/main/res/layout/activity_cate.xml @@ -16,8 +16,8 @@ android:layout_height="match_parent" android:scrollbars="vertical" android:layoutAnimation="@anim/layout_animation_fall_down" - app:layout_behavior="@string/appbar_scrolling_view_behavior"> - + app:layout_behavior="@string/appbar_scrolling_view_behavior" + android:background="?attr/colorPrimaryBG" /> + tools:listitem="@layout/item_collection" + android:background="?attr/colorPrimaryBG"/> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_info2.xml b/app/src/main/res/layout/activity_info2.xml index 4150e96..536a17c 100644 --- a/app/src/main/res/layout/activity_info2.xml +++ b/app/src/main/res/layout/activity_info2.xml @@ -5,7 +5,9 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" - tools:context=".ActivityInfo2"> + tools:context=".ActivityInfo2" + android:background="?attr/listBackgroundColor" + > - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_poem.xml b/app/src/main/res/layout/activity_poem.xml index 2bb4a2b..d20c0cf 100644 --- a/app/src/main/res/layout/activity_poem.xml +++ b/app/src/main/res/layout/activity_poem.xml @@ -41,10 +41,10 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/include" - android:background="@color/white" android:layoutAnimation="@anim/layout_animation_fall_down" app:layout_behavior="@string/appbar_scrolling_view_behavior" - tools:listitem="@layout/item_vers" /> + tools:listitem="@layout/item_vers" + /> diff --git a/app/src/main/res/layout/activity_puzzle.xml b/app/src/main/res/layout/activity_puzzle.xml index 83176a8..d653f6b 100644 --- a/app/src/main/res/layout/activity_puzzle.xml +++ b/app/src/main/res/layout/activity_puzzle.xml @@ -55,7 +55,7 @@ android:layout_alignParentStart="true" android:layout_marginStart="5dp" android:src="@drawable/ic_reward" - android:tint="@color/red500" /> + android:tint="?attr/PuzzleIncorrectColor" /> @@ -85,8 +85,8 @@ android:gravity="center" android:padding="10dp" android:scrollbars="vertical" - android:text="متن شعر" - android:textColor="@color/black" + android:text="@string/verse" + android:textColor="?attr/ListTextColor" android:textSize="15sp" /> + android:textColor="?attr/PuzzleIncorrectColor" /> diff --git a/app/src/main/res/layout/activity_search.xml b/app/src/main/res/layout/activity_search.xml index 0bf0e61..dd40beb 100644 --- a/app/src/main/res/layout/activity_search.xml +++ b/app/src/main/res/layout/activity_search.xml @@ -66,7 +66,7 @@ android:layout_centerVertical="true" android:layout_marginStart="36dp" android:layout_marginEnd="36dp" - android:background="@color/white" + android:background="?attr/SearchInputGB" android:gravity="start|center" android:hint="@string/search_hint" android:imeOptions="actionSearch" @@ -75,7 +75,7 @@ android:paddingEnd="10dp" android:paddingBottom="5dp" android:singleLine="true" - android:textColor="@color/title_color" + android:textColor="?attr/ListTextColor" android:textColorHint="@android:color/darker_gray" /> + tools:listitem="@layout/item_search_result" + android:background="?attr/colorPrimaryBG" /> + tools:showIn="@layout/activity_info2" + + > + android:textColor="?attr/ListTextColor" /> \ No newline at end of file diff --git a/app/src/main/res/layout/custom_dialog2.xml b/app/src/main/res/layout/custom_dialog2.xml index 75032d1..abd0cf4 100644 --- a/app/src/main/res/layout/custom_dialog2.xml +++ b/app/src/main/res/layout/custom_dialog2.xml @@ -3,13 +3,14 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical"> + android:orientation="vertical" + android:background="?attr/listBackgroundColor" > + android:textColor="?attr/ListTextColor" /> \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_list_item.xml b/app/src/main/res/layout/dialog_list_item.xml index 92da948..743f352 100644 --- a/app/src/main/res/layout/dialog_list_item.xml +++ b/app/src/main/res/layout/dialog_list_item.xml @@ -4,7 +4,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + > @@ -42,6 +43,6 @@ \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_listview.xml b/app/src/main/res/layout/dialog_listview.xml index cee223d..dda7d05 100644 --- a/app/src/main/res/layout/dialog_listview.xml +++ b/app/src/main/res/layout/dialog_listview.xml @@ -4,13 +4,14 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical"> + android:orientation="vertical" + android:background="?attr/listBackgroundColor"> + android:layout_height="match_parent" + android:background="?attr/listBackgroundColor"> + android:background="?attr/ListDivider"/>