From 3f4cc8a56dec5842742305dc450fc1786d59a89a Mon Sep 17 00:00:00 2001 From: Emre Esen Date: Wed, 14 Feb 2024 14:22:37 +0300 Subject: [PATCH 1/5] [DEV][version upgrade] --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 44ccfbd..0307ea0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -39,8 +39,8 @@ android { applicationId "com.sn.snfilemanager" minSdk 26 targetSdk 34 - versionCode 2 - versionName "1.0.0-beta2" + versionCode 3 + versionName "1.0.0-beta3" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } From 876f0346bb52716b751a77e5be3e99dae0ed3679 Mon Sep 17 00:00:00 2001 From: Emre Esen Date: Wed, 14 Feb 2024 15:20:25 +0300 Subject: [PATCH 2/5] [DEV][tr language support added] --- .../snfilemanager/job/media/MoveMediaJob.kt | 2 +- app/src/main/res/values-tr/strings.xml | 97 +++++++++++++++++++ app/src/main/res/values/strings.xml | 7 +- 3 files changed, 101 insertions(+), 5 deletions(-) create mode 100644 app/src/main/res/values-tr/strings.xml diff --git a/app/src/main/java/com/sn/snfilemanager/job/media/MoveMediaJob.kt b/app/src/main/java/com/sn/snfilemanager/job/media/MoveMediaJob.kt index 66aaeea..cd14604 100644 --- a/app/src/main/java/com/sn/snfilemanager/job/media/MoveMediaJob.kt +++ b/app/src/main/java/com/sn/snfilemanager/job/media/MoveMediaJob.kt @@ -78,7 +78,7 @@ class MoveMediaJob( private fun updateProgress() { val progress = ((movedItemCount.toDouble() / totalItemCount.toDouble()) * 100).toInt() - val title = if (isCopy) R.string.copy else R.string.move + val title = if (isCopy) R.string.copy_key else R.string.move postNotification(title, progress) } } diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml new file mode 100644 index 0000000..8765579 --- /dev/null +++ b/app/src/main/res/values-tr/strings.xml @@ -0,0 +1,97 @@ + + + Sn Dosya Yöneticisi + Devam + Açık kaynak lisansı + Gizlilik politikası + Ayarlar + Versiyon + Ana Ekran + Filtre + Ara + Hakkında + Dosyalar + Arşivler + Tasarım ve davranış ayarlarınızı özelleştirin + Resimler + Sesler + Videolar + Belgeler + Apk dosyaları + Kategoriler + Bellek + Diğer + Dahili bellek + Dahili + Harici Bellek + Kullanılabilir bellek %s + Harici bellek bulunamadı + %d öğe seçildi + Hepsini seç + İptal + Resim adını girin + Hiçbir şey bulunamadı + "Aramak istediğiniz resmin adını yazın" + Uygulamanın dosya işlemlerini gerçekleştirebilmesi için erişim izinlerinin verilmesi gerekir + Uygulama gerekli izinler olmadan düzgün çalışamaz. Lütfen ayarlara gidin ve gerekli izinleri sağlayın + İzin vermek için tıklayın + Ayarlara git + Uygula + Hepsi + Onayla + Taşı + Bu dosyalarda çakışma bulundu + Sil + Kopyala + Paylaş + Detay + Atla + İkisinide sakla + Üstüne yaz + Hepsine uygula + Evet + Hayır + Emin misiniz ? + Seçilen dosyalar silinecek + Yol seçilmedi + "Burada bir şey yok" + Paylaşım yapabilecek uygulama bulunamadı + Maksimum dosya sayısını aştınız + Tamam + Ad + Yol + Boyut + Seçilen Öğe Sayısı + Toplam Boyut + Alt Öğe Sayısı + Birlikte Aç + Dosyayı açabilecek uygulama bulunamadı + Son Düzenleme + Eklenme Tarihi + Yükleniyor + Obb ve data dizinleri manipülasyona kapalıdır + Uygulama detaylarını görüntüleyin + Tema + Uygulama temasını değiştirin + Arayüz + Davranış + Gizli dosyalar + Gösteriliyor + Gizleniyor + Kopyalanıyor + Taşınıyor + Siliniyor + Tamamlandı + İzin uyarısı + Kopyalama, silme vb işlemlerin ilerlemesini görmek için bildirimlere izin vermeniz gerekir + Bu klasörü görüntüleme izniniz yok + En az 3 karakter + Aramaya başlamak için en az 3 karakter girin + Hedef ve kaynak aynı olamaz + Klasör seçin + Github\'ta görüntüle + Lisanslar + Github + Lisans + Üçüncü taraf lisansları + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7cd5813..3030803 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -34,8 +34,8 @@ Enter the name of the image Nothing found "Type the name of the image you want to search" - %s - %s - %s + %s + %s - %s Access permissions must be granted before the application can perform file operations The application cannot work properly without the necessary permissions. Please go to settings and provide necessary permissions Click to allow @@ -46,9 +46,8 @@ Move Conflict found in these files Delete - Copy + Copy Share - More Detail Skip Keep both From ffd510faf9883cb6d9cc2b32c714707187fac47e Mon Sep 17 00:00:00 2001 From: Emre Esen Date: Wed, 14 Feb 2024 19:10:35 +0300 Subject: [PATCH 3/5] [DEV][theme prefererences language support] --- .../com/sn/snfilemanager/BaseApplication.kt | 2 +- .../feature/settings/SettingsFragment.kt | 3 ++- .../feature/settings/SettingsUtils.kt | 21 ++++++++++++------- app/src/main/res/values-tr/array.xml | 8 +++++++ app/src/main/res/values-tr/strings.xml | 3 +++ app/src/main/res/values/strings.xml | 3 +++ app/src/main/res/xml/preferences.xml | 2 +- 7 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 app/src/main/res/values-tr/array.xml diff --git a/app/src/main/java/com/sn/snfilemanager/BaseApplication.kt b/app/src/main/java/com/sn/snfilemanager/BaseApplication.kt index 0f02061..07f67f8 100644 --- a/app/src/main/java/com/sn/snfilemanager/BaseApplication.kt +++ b/app/src/main/java/com/sn/snfilemanager/BaseApplication.kt @@ -9,6 +9,6 @@ class BaseApplication : Application() { override fun onCreate() { super.onCreate() val theme = SettingsUtils.resolveThemeMode(this) - SettingsUtils.changeTheme(theme) + SettingsUtils.changeTheme(applicationContext, theme) } } diff --git a/app/src/main/java/com/sn/snfilemanager/feature/settings/SettingsFragment.kt b/app/src/main/java/com/sn/snfilemanager/feature/settings/SettingsFragment.kt index 3e49c87..e99fc81 100644 --- a/app/src/main/java/com/sn/snfilemanager/feature/settings/SettingsFragment.kt +++ b/app/src/main/java/com/sn/snfilemanager/feature/settings/SettingsFragment.kt @@ -27,7 +27,8 @@ class SettingsFragment : PreferenceFragmentCompat() { when (key) { SettingsUtils.SN_THEME_MODE -> { SettingsUtils.changeTheme( - themeListPreference?.value ?: SettingsUtils.SYSTEM, + requireContext(), + themeListPreference?.value ?: SettingsUtils.SYSTEM.asString(context), ) } diff --git a/app/src/main/java/com/sn/snfilemanager/feature/settings/SettingsUtils.kt b/app/src/main/java/com/sn/snfilemanager/feature/settings/SettingsUtils.kt index d51ff68..d4b8b95 100644 --- a/app/src/main/java/com/sn/snfilemanager/feature/settings/SettingsUtils.kt +++ b/app/src/main/java/com/sn/snfilemanager/feature/settings/SettingsUtils.kt @@ -3,18 +3,20 @@ package com.sn.snfilemanager.feature.settings import android.content.Context import androidx.appcompat.app.AppCompatDelegate import androidx.preference.PreferenceManager +import com.sn.snfilemanager.R +import com.sn.snfilemanager.core.util.StringValue object SettingsUtils { const val SN_THEME_MODE = "sn.theme.mode" const val SN_HIDDEN_FILE = "sn.hidden.file" - const val SYSTEM = "System" - private const val DARK = "Dark" - private const val LIGHT = "Light" + val SYSTEM = StringValue.StringResource(R.string.system) + private val DARK = StringValue.StringResource(R.string.dark) + private val LIGHT = StringValue.StringResource(R.string.light) fun resolveThemeMode(context: Context): String { return PreferenceManager.getDefaultSharedPreferences(context) - .getString(SN_THEME_MODE, SYSTEM).toString() + .getString(SN_THEME_MODE, SYSTEM.asString(context)).toString() } fun resolveHiddenFiles(context: Context): Boolean { @@ -22,17 +24,20 @@ object SettingsUtils { .getBoolean(SN_HIDDEN_FILE, false) } - fun changeTheme(theme: String) { + fun changeTheme( + context: Context, + theme: String, + ) { when (theme) { - SYSTEM -> { + SYSTEM.asString(context) -> { AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM) } - DARK -> { + DARK.asString(context) -> { AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES) } - LIGHT -> { + LIGHT.asString(context) -> { AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO) } } diff --git a/app/src/main/res/values-tr/array.xml b/app/src/main/res/values-tr/array.xml new file mode 100644 index 0000000..eb1368f --- /dev/null +++ b/app/src/main/res/values-tr/array.xml @@ -0,0 +1,8 @@ + + + + Sistem + Koyu + Açık + + \ No newline at end of file diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 8765579..10f1c22 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -94,4 +94,7 @@ Github Lisans Üçüncü taraf lisansları + Sistem + Koyu + Açık \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3030803..bde6984 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -98,4 +98,7 @@ Github License Third party licenses + System + Dark + Light \ No newline at end of file diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index c95edf9..69614a4 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -12,7 +12,7 @@ app:title="@string/title_interface"> Date: Thu, 15 Feb 2024 23:08:19 +0300 Subject: [PATCH 4/5] [DEV][toolbar an placeholder ui imp] --- app/build.gradle | 2 +- .../snfilemanager/core/base/BaseFragment.kt | 3 + .../core/extensions/ImageView.kt | 64 ++++++++++--------- .../feature/home/HomeFragment.kt | 6 ++ .../feature/media/adapter/MediaItemAdapter.kt | 1 + .../layer_placeholder_transparent.xml | 22 +++++++ .../main/res/drawable/layer_transparent.xml | 7 ++ app/src/main/res/layout/fragment_about.xml | 2 +- .../main/res/layout/fragment_files_list.xml | 7 +- app/src/main/res/layout/fragment_home.xml | 5 +- app/src/main/res/layout/fragment_media.xml | 6 +- app/src/main/res/layout/item_bread_crumb.xml | 1 + app/src/main/res/layout/toolbar_settings.xml | 28 +++----- app/src/main/res/values-tr/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 15 files changed, 100 insertions(+), 56 deletions(-) create mode 100644 app/src/main/res/drawable/layer_placeholder_transparent.xml create mode 100644 app/src/main/res/drawable/layer_transparent.xml diff --git a/app/build.gradle b/app/build.gradle index 0307ea0..981dc5f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -72,7 +72,7 @@ android { dependencies { implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'com.google.android.material:material:1.8.0' + implementation 'com.google.android.material:material:1.11.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.legacy:legacy-support-v4:1.0.0' diff --git a/app/src/main/java/com/sn/snfilemanager/core/base/BaseFragment.kt b/app/src/main/java/com/sn/snfilemanager/core/base/BaseFragment.kt index 6a849d3..7bc2aa8 100644 --- a/app/src/main/java/com/sn/snfilemanager/core/base/BaseFragment.kt +++ b/app/src/main/java/com/sn/snfilemanager/core/base/BaseFragment.kt @@ -43,6 +43,9 @@ abstract class BaseFragment : Fragme getMenuResId()?.let { menuId -> initMenu(menuId, toolbar) } + toolbar.setNavigationOnClickListener { + findNavController().popBackStack() + } } return binding.root } diff --git a/app/src/main/java/com/sn/snfilemanager/core/extensions/ImageView.kt b/app/src/main/java/com/sn/snfilemanager/core/extensions/ImageView.kt index 996a918..6c610ff 100644 --- a/app/src/main/java/com/sn/snfilemanager/core/extensions/ImageView.kt +++ b/app/src/main/java/com/sn/snfilemanager/core/extensions/ImageView.kt @@ -12,38 +12,40 @@ import com.sn.snfilemanager.R fun ImageView.loadWithGlide( videoPath: Any, + placeholderResId: Int? = R.drawable.layer_placeholder, readyOrFailed: ((e: GlideException?) -> Unit)? = null, ) { - Glide.with(context) - .asBitmap() - .load(videoPath) - // .fitCenter() - .placeholder(R.drawable.layer_placeholder) - .error(R.drawable.layer_broken_placeholder) - .diskCacheStrategy(DiskCacheStrategy.RESOURCE) - .addListener( - object : RequestListener { - override fun onLoadFailed( - e: GlideException?, - model: Any?, - target: Target?, - isFirstResource: Boolean, - ): Boolean { - readyOrFailed?.invoke(e) - return false - } + val builder = + Glide.with(context) + .asBitmap() + .load(videoPath) + // .fitCenter() + .error(R.drawable.layer_broken_placeholder) + .diskCacheStrategy(DiskCacheStrategy.RESOURCE) + .addListener( + object : RequestListener { + override fun onLoadFailed( + e: GlideException?, + model: Any?, + target: Target?, + isFirstResource: Boolean, + ): Boolean { + readyOrFailed?.invoke(e) + return false + } - override fun onResourceReady( - resource: Bitmap?, - model: Any?, - target: Target?, - dataSource: DataSource?, - isFirstResource: Boolean, - ): Boolean { - readyOrFailed?.invoke(null) - return false - } - }, - ) - .into(this) + override fun onResourceReady( + resource: Bitmap?, + model: Any?, + target: Target?, + dataSource: DataSource?, + isFirstResource: Boolean, + ): Boolean { + readyOrFailed?.invoke(null) + return false + } + }, + ) + placeholderResId?.let { builder.placeholder(it) } + builder.into(this) } diff --git a/app/src/main/java/com/sn/snfilemanager/feature/home/HomeFragment.kt b/app/src/main/java/com/sn/snfilemanager/feature/home/HomeFragment.kt index 8970f12..45a498d 100644 --- a/app/src/main/java/com/sn/snfilemanager/feature/home/HomeFragment.kt +++ b/app/src/main/java/com/sn/snfilemanager/feature/home/HomeFragment.kt @@ -13,6 +13,7 @@ import androidx.annotation.RequiresApi import androidx.appcompat.widget.Toolbar import androidx.core.app.NotificationManagerCompat import androidx.core.content.ContextCompat +import androidx.core.content.ContextCompat.getColor import com.sn.mediastorepv.data.MediaType import com.sn.snfilemanager.R import com.sn.snfilemanager.core.base.BaseFragment @@ -47,6 +48,7 @@ class HomeFragment : BaseFragment() { override fun onResume() { super.onResume() initPermission() + setStatusBarColor() } override fun onMenuItemSelected(menuItemId: Int) = @@ -214,6 +216,10 @@ class HomeFragment : BaseFragment() { } } + private fun setStatusBarColor() { + binding.appBar.setBackgroundColor(getColor(requireContext(), R.color.bg_color)) + } + private fun initMenuButtonListener() { with(binding) { ibImages.click { diff --git a/app/src/main/java/com/sn/snfilemanager/feature/media/adapter/MediaItemAdapter.kt b/app/src/main/java/com/sn/snfilemanager/feature/media/adapter/MediaItemAdapter.kt index 4eafc62..a70cd7d 100644 --- a/app/src/main/java/com/sn/snfilemanager/feature/media/adapter/MediaItemAdapter.kt +++ b/app/src/main/java/com/sn/snfilemanager/feature/media/adapter/MediaItemAdapter.kt @@ -184,6 +184,7 @@ class MediaItemAdapter( private fun bindVideo(data: Media) { (binding as ItemVideoBinding).ivImage.loadWithGlide( data.uri, + R.drawable.layer_placeholder_transparent, ) { exception -> if (exception == null) { binding.ivPlay.visible() diff --git a/app/src/main/res/drawable/layer_placeholder_transparent.xml b/app/src/main/res/drawable/layer_placeholder_transparent.xml new file mode 100644 index 0000000..bb21155 --- /dev/null +++ b/app/src/main/res/drawable/layer_placeholder_transparent.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/layer_transparent.xml b/app/src/main/res/drawable/layer_transparent.xml new file mode 100644 index 0000000..97e8165 --- /dev/null +++ b/app/src/main/res/drawable/layer_transparent.xml @@ -0,0 +1,7 @@ + + + + diff --git a/app/src/main/res/layout/fragment_about.xml b/app/src/main/res/layout/fragment_about.xml index 26927dc..f4e6d38 100644 --- a/app/src/main/res/layout/fragment_about.xml +++ b/app/src/main/res/layout/fragment_about.xml @@ -21,13 +21,13 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/bg_color" - android:elevation="@dimen/_1sdp" app:liftOnScroll="true"> @@ -37,7 +42,7 @@ android:id="@+id/breadcrumb_bar" android:layout_width="match_parent" android:layout_height="@dimen/_30sdp" - android:layout_marginTop="@dimen/_3sdp" + android:background="@color/bg_color" android:paddingVertical="@dimen/_15sdp" android:visibility="@{vm.searchStateLiveData.peekContent().first == true ? View.GONE : View.VISIBLE}" /> diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 55d120b..425975e 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -10,11 +10,12 @@ tools:context=".feature.home.HomeFragment"> + app:liftOnScroll="true" + app:liftOnScrollColor="@null"> diff --git a/app/src/main/res/layout/item_bread_crumb.xml b/app/src/main/res/layout/item_bread_crumb.xml index 1a5b064..915ab64 100644 --- a/app/src/main/res/layout/item_bread_crumb.xml +++ b/app/src/main/res/layout/item_bread_crumb.xml @@ -3,6 +3,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginTop="@dimen/_3sdp" android:gravity="top" android:orientation="horizontal"> diff --git a/app/src/main/res/layout/toolbar_settings.xml b/app/src/main/res/layout/toolbar_settings.xml index 4879e48..340b678 100644 --- a/app/src/main/res/layout/toolbar_settings.xml +++ b/app/src/main/res/layout/toolbar_settings.xml @@ -4,25 +4,15 @@ android:layout_height="wrap_content" android:orientation="vertical"> - - - - - - + android:layout_height="?attr/actionBarSize" + app:contentInsetStart="0dp" + app:contentInsetStartWithNavigation="0dp" + app:navigationContentDescription="@string/settings" + app:navigationIcon="@drawable/ic_arrow_back" + app:title="@string/settings" + app:titleTextColor="@color/first_text_color" /> \ No newline at end of file diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 10f1c22..9d02f7c 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -94,6 +94,7 @@ Github Lisans Üçüncü taraf lisansları + Medya Sistem Koyu Açık diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bde6984..3b4fa1f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -98,6 +98,7 @@ Github License Third party licenses + Media System Dark Light From 6eb5a18053f83e4641fff5d3a2ad026bc4f3ac9c Mon Sep 17 00:00:00 2001 From: emreesen27 <45034416+emreesen27@users.noreply.github.com> Date: Fri, 16 Feb 2024 20:06:56 +0300 Subject: [PATCH 5/5] [DEV][Update CHANGELOG.md] --- CHANGELOG.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9645c12..baea749 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,14 @@ +## v1.0.0-beta3 (16.02.2024) + +* UI improvement +* Turkish language support added + ## v1.0.0-beta2 (14.02.2024) * Start screen is completed * About screen added -* Minor ui fix +* Minor UI fix ## v1.0.0-beta1 (12.02.2024) -* Initial release \ No newline at end of file +* Initial release