From 2f74a947edd24b7f7fab817fee3ec55ca3414e29 Mon Sep 17 00:00:00 2001 From: Emre Esen Date: Tue, 13 Feb 2024 20:16:38 +0300 Subject: [PATCH 1/6] [DEV][about feature is completed] --- .gitignore | 1 + app/.gitignore | 3 +- .../snfilemanager/core/extensions/Context.kt | 8 ++ .../feature/about/AboutFragment.kt | 45 +++++++ .../feature/about/AboutViewModel.kt | 19 +++ .../feature/home/HomeFragment.kt | 3 + .../feature/settings/SettingsFragment.kt | 8 -- .../feature/settings/SettingsToolbar.kt | 26 ++++ .../feature/settings/SettingsUtils.kt | 3 - .../view/component/HrImageButton.kt | 13 +- .../view/dialog/license/License.kt | 7 + .../view/dialog/license/LicenseAdapter.kt | 95 +++++++++++++ .../view/dialog/license/LicenseDialog.kt | 52 ++++++++ .../main/res/drawable/ic_app_icon_small.xml | 15 +++ app/src/main/res/drawable/ic_circle_small.xml | 10 ++ app/src/main/res/drawable/ic_github.xml | 15 +++ app/src/main/res/drawable/ic_info_small.xml | 13 ++ app/src/main/res/drawable/ic_license.xml | 13 ++ app/src/main/res/drawable/ic_privacy.xml | 55 ++++++++ app/src/main/res/layout/dialog_license.xml | 51 +++++++ app/src/main/res/layout/fragment_about.xml | 126 ++++++++++++++++++ app/src/main/res/layout/item_license.xml | 52 ++++++++ app/src/main/res/layout/item_preference.xml | 3 +- .../res/layout/item_switch_preference.xml | 2 +- app/src/main/res/layout/toolbar_settings.xml | 28 ++++ app/src/main/res/navigation/navigation.xml | 12 +- app/src/main/res/values/strings.xml | 6 + app/src/main/res/xml/preferences.xml | 12 +- 28 files changed, 672 insertions(+), 24 deletions(-) create mode 100644 app/src/main/java/com/sn/snfilemanager/feature/about/AboutFragment.kt create mode 100644 app/src/main/java/com/sn/snfilemanager/feature/about/AboutViewModel.kt create mode 100644 app/src/main/java/com/sn/snfilemanager/feature/settings/SettingsToolbar.kt create mode 100644 app/src/main/java/com/sn/snfilemanager/view/dialog/license/License.kt create mode 100644 app/src/main/java/com/sn/snfilemanager/view/dialog/license/LicenseAdapter.kt create mode 100644 app/src/main/java/com/sn/snfilemanager/view/dialog/license/LicenseDialog.kt create mode 100644 app/src/main/res/drawable/ic_app_icon_small.xml create mode 100644 app/src/main/res/drawable/ic_circle_small.xml create mode 100644 app/src/main/res/drawable/ic_github.xml create mode 100644 app/src/main/res/drawable/ic_info_small.xml create mode 100644 app/src/main/res/drawable/ic_license.xml create mode 100644 app/src/main/res/drawable/ic_privacy.xml create mode 100644 app/src/main/res/layout/dialog_license.xml create mode 100644 app/src/main/res/layout/fragment_about.xml create mode 100644 app/src/main/res/layout/item_license.xml create mode 100644 app/src/main/res/layout/toolbar_settings.xml diff --git a/.gitignore b/.gitignore index feed2e4..2df6459 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ .cxx local.properties app/release/ +app/google-services.json diff --git a/app/.gitignore b/app/.gitignore index 42afabf..65d12b9 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -1 +1,2 @@ -/build \ No newline at end of file +/build +google-services.json \ No newline at end of file diff --git a/app/src/main/java/com/sn/snfilemanager/core/extensions/Context.kt b/app/src/main/java/com/sn/snfilemanager/core/extensions/Context.kt index d165577..2ba9ea2 100644 --- a/app/src/main/java/com/sn/snfilemanager/core/extensions/Context.kt +++ b/app/src/main/java/com/sn/snfilemanager/core/extensions/Context.kt @@ -107,3 +107,11 @@ fun Context.shareFiles(uris: List): Boolean { false } } + +fun Context.startActivitySafely(intent: Intent) { + try { + startActivity(intent) + } catch (e: ActivityNotFoundException) { + // Todo + } +} diff --git a/app/src/main/java/com/sn/snfilemanager/feature/about/AboutFragment.kt b/app/src/main/java/com/sn/snfilemanager/feature/about/AboutFragment.kt new file mode 100644 index 0000000..78b2288 --- /dev/null +++ b/app/src/main/java/com/sn/snfilemanager/feature/about/AboutFragment.kt @@ -0,0 +1,45 @@ +package com.sn.snfilemanager.feature.about + +import android.content.Intent +import android.net.Uri +import androidx.navigation.fragment.findNavController +import com.sn.snfilemanager.core.base.BaseFragment +import com.sn.snfilemanager.core.extensions.click +import com.sn.snfilemanager.core.extensions.startActivitySafely +import com.sn.snfilemanager.databinding.FragmentAboutBinding +import com.sn.snfilemanager.view.dialog.license.LicenseDialog + +class AboutFragment : BaseFragment() { + override fun getViewModelClass() = AboutViewModel::class.java + + override fun getViewBinding() = FragmentAboutBinding.inflate(layoutInflater) + + companion object { + const val GITHUB_URL = + "https://github.com/emreesen27/Android-Sn-File-Manager" + const val PRIVACY_URL = + "https://github.com/emreesen27/Android-Sn-File-Manager/blob/develop/PRIVACY.md" + } + + override fun setupViews() { + binding.vm = viewModel + binding.lifecycleOwner = viewLifecycleOwner + initClicks() + } + + private fun initClicks() { + binding.toolbar.setNavigationOnClickListener { findNavController().popBackStack() } + binding.btnGithub.click { openUrl(GITHUB_URL) } + binding.btnLicense.click { showLicensesDialog() } + binding.btnPrivacy.click { openUrl(PRIVACY_URL) } + } + + private fun showLicensesDialog() { + LicenseDialog().show(childFragmentManager, LicenseDialog.TAG) + } + + private fun openUrl(url: String) { + val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) + context?.startActivitySafely(intent) + } +} diff --git a/app/src/main/java/com/sn/snfilemanager/feature/about/AboutViewModel.kt b/app/src/main/java/com/sn/snfilemanager/feature/about/AboutViewModel.kt new file mode 100644 index 0000000..a19cc2c --- /dev/null +++ b/app/src/main/java/com/sn/snfilemanager/feature/about/AboutViewModel.kt @@ -0,0 +1,19 @@ +package com.sn.snfilemanager.feature.about + +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.ViewModel +import com.sn.snfilemanager.BuildConfig + +class AboutViewModel : ViewModel() { + private val _versionLiveData: MutableLiveData = MutableLiveData() + val versionLiveData: LiveData = _versionLiveData + + init { + getVersion() + } + + private fun getVersion() { + _versionLiveData.value = BuildConfig.VERSION_NAME + } +} 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 91a4c48..8970f12 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 @@ -290,6 +290,9 @@ class HomeFragment : BaseFragment() { btnSettings.click { navigate(HomeFragmentDirections.actionSettings()) } + btnAbout.click { + navigate(HomeFragmentDirections.actionAbout()) + } } } } 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 7cd6cfd..83001e8 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 @@ -4,7 +4,6 @@ import android.content.SharedPreferences import android.content.SharedPreferences.OnSharedPreferenceChangeListener import android.os.Bundle import androidx.preference.ListPreference -import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import androidx.preference.SwitchPreferenceCompat import com.sn.snfilemanager.R @@ -19,13 +18,6 @@ class SettingsFragment : PreferenceFragmentCompat() { ) { setPreferencesFromResource(R.xml.preferences, rootKey) - val aboutButton: Preference? = findPreference(SettingsUtils.SN_ABOUT) - aboutButton?.setOnPreferenceClickListener { - // todo - // findNavController().navigate(SettingsFragmentDirections.actionSettingsToAbout()) - true - } - val themeListPreference: ListPreference? = findPreference(SettingsUtils.SN_THEME_MODE) val hiddenFilePreference: SwitchPreferenceCompat? = findPreference(SettingsUtils.SN_HIDDEN_FILE) diff --git a/app/src/main/java/com/sn/snfilemanager/feature/settings/SettingsToolbar.kt b/app/src/main/java/com/sn/snfilemanager/feature/settings/SettingsToolbar.kt new file mode 100644 index 0000000..83a9188 --- /dev/null +++ b/app/src/main/java/com/sn/snfilemanager/feature/settings/SettingsToolbar.kt @@ -0,0 +1,26 @@ +package com.sn.snfilemanager.feature.settings + +import android.content.Context +import android.util.AttributeSet +import androidx.navigation.findNavController +import androidx.preference.Preference +import androidx.preference.PreferenceViewHolder +import com.google.android.material.appbar.MaterialToolbar +import com.sn.snfilemanager.R + +class SettingsToolbar + @JvmOverloads + constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0, + ) : Preference(context, attrs, defStyleAttr) { + override fun onBindViewHolder(holder: PreferenceViewHolder) { + super.onBindViewHolder(holder) + + val toolbar = holder.findViewById(R.id.toolbar_settings) as MaterialToolbar + toolbar.setNavigationOnClickListener { + toolbar.findNavController().popBackStack() + } + } + } 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 074a449..d51ff68 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 @@ -5,10 +5,7 @@ import androidx.appcompat.app.AppCompatDelegate import androidx.preference.PreferenceManager object SettingsUtils { - const val SECRETIVE_REPOSITORY_LINK = "https://github.com/emreesen27/Secretive" - const val SN_THEME_MODE = "sn.theme.mode" - const val SN_ABOUT = "sn.about" const val SN_HIDDEN_FILE = "sn.hidden.file" const val SYSTEM = "System" diff --git a/app/src/main/java/com/sn/snfilemanager/view/component/HrImageButton.kt b/app/src/main/java/com/sn/snfilemanager/view/component/HrImageButton.kt index 04b0ef6..a3c38be 100644 --- a/app/src/main/java/com/sn/snfilemanager/view/component/HrImageButton.kt +++ b/app/src/main/java/com/sn/snfilemanager/view/component/HrImageButton.kt @@ -6,6 +6,8 @@ import androidx.appcompat.widget.AppCompatImageView import androidx.constraintlayout.widget.ConstraintLayout import com.google.android.material.textview.MaterialTextView import com.sn.snfilemanager.R +import com.sn.snfilemanager.core.extensions.gone +import com.sn.snfilemanager.core.extensions.visible class HrImageButton @JvmOverloads @@ -23,10 +25,11 @@ class HrImageButton titleTextView.text = value } - var subTitle: String + var subTitle: String? get() = subTitleTextView.text.toString() set(value) { subTitleTextView.text = value + checkSubTitle() } init { @@ -44,4 +47,12 @@ class HrImageButton attributes.recycle() } + + private fun checkSubTitle() { + if (subTitle.isNullOrEmpty()) { + subTitleTextView.gone() + } else { + subTitleTextView.visible() + } + } } diff --git a/app/src/main/java/com/sn/snfilemanager/view/dialog/license/License.kt b/app/src/main/java/com/sn/snfilemanager/view/dialog/license/License.kt new file mode 100644 index 0000000..fe002c6 --- /dev/null +++ b/app/src/main/java/com/sn/snfilemanager/view/dialog/license/License.kt @@ -0,0 +1,7 @@ +package com.sn.snfilemanager.view.dialog.license + +data class License( + val name: String, + val url: String, + val license: String, +) diff --git a/app/src/main/java/com/sn/snfilemanager/view/dialog/license/LicenseAdapter.kt b/app/src/main/java/com/sn/snfilemanager/view/dialog/license/LicenseAdapter.kt new file mode 100644 index 0000000..464d29e --- /dev/null +++ b/app/src/main/java/com/sn/snfilemanager/view/dialog/license/LicenseAdapter.kt @@ -0,0 +1,95 @@ +package com.sn.snfilemanager.view.dialog.license + +import android.content.Context +import android.content.Intent +import android.net.Uri +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.recyclerview.widget.RecyclerView +import com.sn.snfilemanager.core.extensions.click +import com.sn.snfilemanager.core.extensions.startActivitySafely +import com.sn.snfilemanager.databinding.ItemLicenseBinding + +class LicenseAdapter(private val context: Context) : + RecyclerView.Adapter() { + private val licenses: List = + listOf( + License( + "Glide", + "https://github.com/bumptech/glide", + "https://github.com/bumptech/glide/blob/master/LICENSE", + ), + License( + "Nested Progress", + "https://github.com/emreesen27/Android-Nested-Progress", + "https://github.com/emreesen27/Android-Nested-Progress/blob/master/LICENSE", + ), + License( + "Toasty", + "https://github.com/GrenderG/Toasty", + "https://github.com/GrenderG/Toasty/blob/master/LICENSE", + ), + License( + "Lottie Android", + "https://github.com/airbnb/lottie-android", + "https://github.com/airbnb/lottie-android/blob/master/LICENSE", + ), + License( + "Ssp", + "https://github.com/intuit/ssp", + "https://github.com/intuit/ssp/blob/master/LICENSE", + ), + License( + "Android Animation", + "https://github.com/gayanvoice/android-animations", + "https://github.com/gayanvoice/android-animations/blob/master/LICENSE", + ), + ) + + override fun onCreateViewHolder( + parent: ViewGroup, + viewType: Int, + ): LicenseAdapter.LicenseViewHolder { + val binding = + ItemLicenseBinding.inflate(LayoutInflater.from(parent.context), parent, false) + return LicenseViewHolder(binding) + } + + override fun onBindViewHolder( + holder: LicenseAdapter.LicenseViewHolder, + position: Int, + ) { + holder.bind(licenses[position]) + } + + override fun getItemCount(): Int { + return licenses.size + } + + inner class LicenseViewHolder(private val binding: ItemLicenseBinding) : + RecyclerView.ViewHolder(binding.root) { + init { + binding.mtvGithub.click { + if (adapterPosition != RecyclerView.NO_POSITION) { + val clickedLicense = licenses[adapterPosition] + openUrl(clickedLicense.url) + } + } + binding.mtvLicense.click { + if (adapterPosition != RecyclerView.NO_POSITION) { + val clickedLicense = licenses[adapterPosition] + openUrl(clickedLicense.license) + } + } + } + + fun bind(model: License) { + binding.mtvName.text = model.name + } + } + + private fun openUrl(url: String) { + val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) + context.startActivitySafely(intent) + } +} diff --git a/app/src/main/java/com/sn/snfilemanager/view/dialog/license/LicenseDialog.kt b/app/src/main/java/com/sn/snfilemanager/view/dialog/license/LicenseDialog.kt new file mode 100644 index 0000000..3cf9418 --- /dev/null +++ b/app/src/main/java/com/sn/snfilemanager/view/dialog/license/LicenseDialog.kt @@ -0,0 +1,52 @@ +package com.sn.snfilemanager.view.dialog.license + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.fragment.app.DialogFragment +import com.sn.snfilemanager.R +import com.sn.snfilemanager.core.extensions.click +import com.sn.snfilemanager.databinding.DialogLicenseBinding + +class LicenseDialog : DialogFragment() { + companion object { + const val TAG = "LICENSE_DIALOG" + } + + private val binding: DialogLicenseBinding by lazy { + DialogLicenseBinding.inflate(layoutInflater) + } + + override fun onStart() { + super.onStart() + dialog?.window?.setLayout( + ConstraintLayout.LayoutParams.MATCH_PARENT, + ConstraintLayout.LayoutParams.MATCH_PARENT, + ) + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setStyle(STYLE_NO_TITLE, R.style.DialogTheme_transparent) + dialog?.window?.setBackgroundDrawableResource(R.drawable.dialog_rounded) + } + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle?, + ): View { + return binding.root + } + + override fun onViewCreated( + view: View, + savedInstanceState: Bundle?, + ) { + super.onViewCreated(view, savedInstanceState) + binding.recycler.adapter = LicenseAdapter(requireContext()) + binding.ivClose.click { dismiss() } + } +} diff --git a/app/src/main/res/drawable/ic_app_icon_small.xml b/app/src/main/res/drawable/ic_app_icon_small.xml new file mode 100644 index 0000000..8d92bcb --- /dev/null +++ b/app/src/main/res/drawable/ic_app_icon_small.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_circle_small.xml b/app/src/main/res/drawable/ic_circle_small.xml new file mode 100644 index 0000000..a47d58b --- /dev/null +++ b/app/src/main/res/drawable/ic_circle_small.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_github.xml b/app/src/main/res/drawable/ic_github.xml new file mode 100644 index 0000000..a916142 --- /dev/null +++ b/app/src/main/res/drawable/ic_github.xml @@ -0,0 +1,15 @@ + + + diff --git a/app/src/main/res/drawable/ic_info_small.xml b/app/src/main/res/drawable/ic_info_small.xml new file mode 100644 index 0000000..0d972c0 --- /dev/null +++ b/app/src/main/res/drawable/ic_info_small.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/drawable/ic_license.xml b/app/src/main/res/drawable/ic_license.xml new file mode 100644 index 0000000..0975d4f --- /dev/null +++ b/app/src/main/res/drawable/ic_license.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/drawable/ic_privacy.xml b/app/src/main/res/drawable/ic_privacy.xml new file mode 100644 index 0000000..2f269d7 --- /dev/null +++ b/app/src/main/res/drawable/ic_privacy.xml @@ -0,0 +1,55 @@ + + + + + + + + + diff --git a/app/src/main/res/layout/dialog_license.xml b/app/src/main/res/layout/dialog_license.xml new file mode 100644 index 0000000..08380ef --- /dev/null +++ b/app/src/main/res/layout/dialog_license.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_about.xml b/app/src/main/res/layout/fragment_about.xml new file mode 100644 index 0000000..26927dc --- /dev/null +++ b/app/src/main/res/layout/fragment_about.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_license.xml b/app/src/main/res/layout/item_license.xml new file mode 100644 index 0000000..ced86be --- /dev/null +++ b/app/src/main/res/layout/item_license.xml @@ -0,0 +1,52 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_preference.xml b/app/src/main/res/layout/item_preference.xml index b4436fa..79984b5 100644 --- a/app/src/main/res/layout/item_preference.xml +++ b/app/src/main/res/layout/item_preference.xml @@ -4,7 +4,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginHorizontal="@dimen/_10sdp" - android:layout_marginTop="@dimen/_8sdp" + android:layout_marginTop="@dimen/_5sdp" android:layout_marginBottom="@dimen/_3sdp" android:orientation="vertical" android:padding="5dp"> @@ -23,6 +23,7 @@ android:id="@android:id/summary" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/_15sdp" android:fontFamily="@font/adamina" android:paddingHorizontal="@dimen/_3sdp" android:textColor="@color/second_text_color" diff --git a/app/src/main/res/layout/item_switch_preference.xml b/app/src/main/res/layout/item_switch_preference.xml index e8c5833..6e5c0aa 100644 --- a/app/src/main/res/layout/item_switch_preference.xml +++ b/app/src/main/res/layout/item_switch_preference.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginHorizontal="@dimen/_10sdp" - android:layout_marginTop="@dimen/_8sdp" + android:layout_marginTop="@dimen/_5sdp" android:layout_marginBottom="@dimen/_3sdp" android:padding="5dp"> diff --git a/app/src/main/res/layout/toolbar_settings.xml b/app/src/main/res/layout/toolbar_settings.xml new file mode 100644 index 0000000..4879e48 --- /dev/null +++ b/app/src/main/res/layout/toolbar_settings.xml @@ -0,0 +1,28 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/navigation/navigation.xml b/app/src/main/res/navigation/navigation.xml index 30f5383..a7b3f27 100644 --- a/app/src/main/res/navigation/navigation.xml +++ b/app/src/main/res/navigation/navigation.xml @@ -51,6 +51,10 @@ android:id="@+id/action_settings" app:destination="@+id/settings_fragment" /> + + + app:argType="string" /> @@ -89,7 +93,7 @@ + app:argType="string" /> + + \ 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 e07eec7..7cd5813 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -7,6 +7,7 @@ Open source license Privacy policy Settings + Version Home Filter Search @@ -93,4 +94,9 @@ Please enter at least 3 characters to start searching Target and source cannot be the same Choose a directory + View on Github + Licenses + Github + License + Third party licenses \ 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 314a2c0..c95edf9 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -2,6 +2,11 @@ + + @@ -32,11 +37,4 @@ - - \ No newline at end of file From 84367dbb03956ee04d708a4d53c59084541d6001 Mon Sep 17 00:00:00 2001 From: Emre Esen Date: Wed, 14 Feb 2024 00:43:54 +0300 Subject: [PATCH 2/6] [FIX][changelog url fix] --- .github/workflows/deploy_release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy_release.yml b/.github/workflows/deploy_release.yml index e6be418..b5aa752 100644 --- a/.github/workflows/deploy_release.yml +++ b/.github/workflows/deploy_release.yml @@ -41,7 +41,6 @@ jobs: env: BUILD_TOOLS_VERSION: "34.0.0" - # Upload the signed APK as an artifact - name: Upload Signed APK uses: actions/upload-artifact@v2 with: @@ -64,7 +63,7 @@ jobs: release_name: Release ${{ steps.android_version.outputs.VERSION_NAME }} body: | This is the release APK for version ${{ steps.android_version.outputs.VERSION_NAME }}. - See here for changes in version -> [Changelog](https://github.com/emreesen27/Android-Sn-File-Manager/blob/master/CHANGELOG) + See here for changes in version -> [Changelog](https://github.com/emreesen27/Android-Sn-File-Manager/blob/master/CHANGELOG.md) - name: Upload Release Asset id: upload-release-asset From c061c79ce302e33d1ccebde9576cfa0753e73bda Mon Sep 17 00:00:00 2001 From: Emre Esen Date: Wed, 14 Feb 2024 00:44:28 +0300 Subject: [PATCH 3/6] [FIX][minor ui fix] --- app/src/main/res/drawable/ic_github.xml | 1 + app/src/main/res/drawable/ic_info_small.xml | 1 + app/src/main/res/drawable/ic_license.xml | 1 + app/src/main/res/drawable/ic_privacy.xml | 1 + app/src/main/res/layout/item_preference.xml | 2 -- app/src/main/res/layout/item_preference_title.xml | 2 +- app/src/main/res/layout/item_switch_preference.xml | 2 -- 7 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/res/drawable/ic_github.xml b/app/src/main/res/drawable/ic_github.xml index a916142..25637ab 100644 --- a/app/src/main/res/drawable/ic_github.xml +++ b/app/src/main/res/drawable/ic_github.xml @@ -2,6 +2,7 @@ xmlns:tools="http://schemas.android.com/tools" android:width="24dp" android:height="24dp" + android:alpha="0.8" android:viewportWidth="24" android:viewportHeight="24"> @@ -25,7 +24,6 @@ android:layout_height="wrap_content" android:layout_marginBottom="@dimen/_15sdp" android:fontFamily="@font/adamina" - android:paddingHorizontal="@dimen/_3sdp" android:textColor="@color/second_text_color" android:textSize="@dimen/_10ssp" tools:text="@string/app_name" /> diff --git a/app/src/main/res/layout/item_preference_title.xml b/app/src/main/res/layout/item_preference_title.xml index ccf84ec..b449968 100644 --- a/app/src/main/res/layout/item_preference_title.xml +++ b/app/src/main/res/layout/item_preference_title.xml @@ -13,6 +13,6 @@ android:layout_height="wrap_content" android:fontFamily="@font/adamina" android:textColor="@color/main_color" - android:textSize="@dimen/_13ssp" /> + android:textSize="@dimen/_12ssp" /> \ No newline at end of file diff --git a/app/src/main/res/layout/item_switch_preference.xml b/app/src/main/res/layout/item_switch_preference.xml index 6e5c0aa..b22f87f 100644 --- a/app/src/main/res/layout/item_switch_preference.xml +++ b/app/src/main/res/layout/item_switch_preference.xml @@ -14,7 +14,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:fontFamily="@font/adamina" - android:padding="@dimen/_3sdp" android:textColor="@color/first_text_color" android:textSize="@dimen/_12ssp" app:layout_constraintStart_toStartOf="parent" @@ -26,7 +25,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:fontFamily="@font/adamina" - android:paddingHorizontal="@dimen/_3sdp" android:textColor="@color/second_text_color" android:textSize="@dimen/_10ssp" app:layout_constraintBottom_toBottomOf="parent" From e768387f1a04e8906692bd9e3facac06840b2704 Mon Sep 17 00:00:00 2001 From: Emre Esen Date: Wed, 14 Feb 2024 01:06:27 +0300 Subject: [PATCH 4/6] [FIX][start screen imp. and butons text fix] --- .../java/com/sn/snfilemanager/MainActivity.kt | 2 +- .../sn/snfilemanager/core/{ => util}/Config.kt | 2 +- .../com/sn/snfilemanager/core/util/Constant.kt | 10 ++++++++++ .../snfilemanager/feature/about/AboutFragment.kt | 9 ++------- .../files/presentation/FilesListViewModel.kt | 2 +- .../feature/settings/SettingsFragment.kt | 2 +- .../snfilemanager/feature/start/StartFragment.kt | 15 ++++++++++++--- app/src/main/res/layout/dialog_permission.xml | 2 ++ app/src/main/res/layout/fragment_permission.xml | 2 ++ app/src/main/res/layout/fragment_start.xml | 2 ++ 10 files changed, 34 insertions(+), 14 deletions(-) rename app/src/main/java/com/sn/snfilemanager/core/{ => util}/Config.kt (58%) create mode 100644 app/src/main/java/com/sn/snfilemanager/core/util/Constant.kt diff --git a/app/src/main/java/com/sn/snfilemanager/MainActivity.kt b/app/src/main/java/com/sn/snfilemanager/MainActivity.kt index 40cbcd3..c8b481c 100644 --- a/app/src/main/java/com/sn/snfilemanager/MainActivity.kt +++ b/app/src/main/java/com/sn/snfilemanager/MainActivity.kt @@ -4,7 +4,7 @@ import android.os.Bundle import androidx.activity.viewModels import androidx.appcompat.app.AppCompatActivity import androidx.navigation.findNavController -import com.sn.snfilemanager.core.Config +import com.sn.snfilemanager.core.util.Config import com.sn.snfilemanager.core.extensions.observe import com.sn.snfilemanager.databinding.ActivityMainBinding import com.sn.snfilemanager.feature.settings.SettingsUtils diff --git a/app/src/main/java/com/sn/snfilemanager/core/Config.kt b/app/src/main/java/com/sn/snfilemanager/core/util/Config.kt similarity index 58% rename from app/src/main/java/com/sn/snfilemanager/core/Config.kt rename to app/src/main/java/com/sn/snfilemanager/core/util/Config.kt index 4dc8522..94655e3 100644 --- a/app/src/main/java/com/sn/snfilemanager/core/Config.kt +++ b/app/src/main/java/com/sn/snfilemanager/core/util/Config.kt @@ -1,4 +1,4 @@ -package com.sn.snfilemanager.core +package com.sn.snfilemanager.core.util object Config { var hiddenFile: Boolean = false diff --git a/app/src/main/java/com/sn/snfilemanager/core/util/Constant.kt b/app/src/main/java/com/sn/snfilemanager/core/util/Constant.kt new file mode 100644 index 0000000..86dade5 --- /dev/null +++ b/app/src/main/java/com/sn/snfilemanager/core/util/Constant.kt @@ -0,0 +1,10 @@ +package com.sn.snfilemanager.core.util + +object Constant { + const val GITHUB_URL = + "https://github.com/emreesen27/Android-Sn-File-Manager" + const val PRIVACY_URL = + "https://github.com/emreesen27/Android-Sn-File-Manager/blob/develop/PRIVACY.md" + const val OPEN_SOURCE_LICENSE = + "https://github.com/emreesen27/Android-Sn-File-Manager/blob/develop/LICENSE" +} \ No newline at end of file diff --git a/app/src/main/java/com/sn/snfilemanager/feature/about/AboutFragment.kt b/app/src/main/java/com/sn/snfilemanager/feature/about/AboutFragment.kt index 78b2288..d628b04 100644 --- a/app/src/main/java/com/sn/snfilemanager/feature/about/AboutFragment.kt +++ b/app/src/main/java/com/sn/snfilemanager/feature/about/AboutFragment.kt @@ -6,6 +6,8 @@ import androidx.navigation.fragment.findNavController import com.sn.snfilemanager.core.base.BaseFragment import com.sn.snfilemanager.core.extensions.click import com.sn.snfilemanager.core.extensions.startActivitySafely +import com.sn.snfilemanager.core.util.Constant.GITHUB_URL +import com.sn.snfilemanager.core.util.Constant.PRIVACY_URL import com.sn.snfilemanager.databinding.FragmentAboutBinding import com.sn.snfilemanager.view.dialog.license.LicenseDialog @@ -14,13 +16,6 @@ class AboutFragment : BaseFragment() { override fun getViewBinding() = FragmentAboutBinding.inflate(layoutInflater) - companion object { - const val GITHUB_URL = - "https://github.com/emreesen27/Android-Sn-File-Manager" - const val PRIVACY_URL = - "https://github.com/emreesen27/Android-Sn-File-Manager/blob/develop/PRIVACY.md" - } - override fun setupViews() { binding.vm = viewModel binding.lifecycleOwner = viewLifecycleOwner diff --git a/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListViewModel.kt b/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListViewModel.kt index c41115e..b9c180d 100644 --- a/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListViewModel.kt +++ b/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListViewModel.kt @@ -8,7 +8,7 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.sn.mediastorepv.data.ConflictStrategy import com.sn.mediastorepv.data.MediaType -import com.sn.snfilemanager.core.Config +import com.sn.snfilemanager.core.util.Config import com.sn.snfilemanager.core.base.BaseResult import com.sn.snfilemanager.core.util.Event import com.sn.snfilemanager.core.util.RootPath 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 83001e8..3e49c87 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 @@ -7,7 +7,7 @@ import androidx.preference.ListPreference import androidx.preference.PreferenceFragmentCompat import androidx.preference.SwitchPreferenceCompat import com.sn.snfilemanager.R -import com.sn.snfilemanager.core.Config +import com.sn.snfilemanager.core.util.Config class SettingsFragment : PreferenceFragmentCompat() { private lateinit var mListenerOptions: OnSharedPreferenceChangeListener diff --git a/app/src/main/java/com/sn/snfilemanager/feature/start/StartFragment.kt b/app/src/main/java/com/sn/snfilemanager/feature/start/StartFragment.kt index 39eb755..ce7cc6c 100644 --- a/app/src/main/java/com/sn/snfilemanager/feature/start/StartFragment.kt +++ b/app/src/main/java/com/sn/snfilemanager/feature/start/StartFragment.kt @@ -1,8 +1,13 @@ package com.sn.snfilemanager.feature.start +import android.content.Intent +import android.net.Uri import com.sn.snfilemanager.BuildConfig import com.sn.snfilemanager.core.base.BaseFragment import com.sn.snfilemanager.core.extensions.click +import com.sn.snfilemanager.core.extensions.startActivitySafely +import com.sn.snfilemanager.core.util.Constant.OPEN_SOURCE_LICENSE +import com.sn.snfilemanager.core.util.Constant.PRIVACY_URL import com.sn.snfilemanager.databinding.FragmentStartBinding import dagger.hilt.android.AndroidEntryPoint @@ -29,9 +34,13 @@ class StartFragment : BaseFragment() { } } - // Todo click implementation private fun clicksPolicy() { - binding.mtvPrivacyPolicy.click { } - binding.mtvOpenSourcePolicy.click { } + binding.mtvPrivacyPolicy.click { openUrl(PRIVACY_URL) } + binding.mtvOpenSourcePolicy.click { openUrl(OPEN_SOURCE_LICENSE) } + } + + private fun openUrl(url: String) { + val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) + context?.startActivitySafely(intent) } } diff --git a/app/src/main/res/layout/dialog_permission.xml b/app/src/main/res/layout/dialog_permission.xml index 30af4ab..8e2fe35 100644 --- a/app/src/main/res/layout/dialog_permission.xml +++ b/app/src/main/res/layout/dialog_permission.xml @@ -46,7 +46,9 @@ android:fontFamily="@font/adamina" android:padding="10dp" android:text="@string/click_to_allow" + android:textAllCaps="false" android:textColor="@color/white" + android:textSize="@dimen/_12ssp" app:layout_constraintBottom_toBottomOf="@+id/container" app:layout_constraintEnd_toEndOf="@+id/container" app:layout_constraintStart_toStartOf="@+id/container" /> diff --git a/app/src/main/res/layout/fragment_permission.xml b/app/src/main/res/layout/fragment_permission.xml index 9baf33d..24ca3f7 100644 --- a/app/src/main/res/layout/fragment_permission.xml +++ b/app/src/main/res/layout/fragment_permission.xml @@ -59,6 +59,8 @@ android:backgroundTint="@color/main_color" android:fontFamily="@font/adamina" android:padding="10dp" + android:textAllCaps="false" + android:textSize="@dimen/_12ssp" android:text="@string/continue_key" android:textColor="@color/white" app:layout_constraintBottom_toBottomOf="parent" diff --git a/app/src/main/res/layout/fragment_start.xml b/app/src/main/res/layout/fragment_start.xml index 90bab49..c392999 100644 --- a/app/src/main/res/layout/fragment_start.xml +++ b/app/src/main/res/layout/fragment_start.xml @@ -96,7 +96,9 @@ android:fontFamily="@font/adamina" android:padding="10dp" android:text="@string/continue_key" + android:textAllCaps="false" android:textColor="@color/white" + android:textSize="@dimen/_12ssp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> From 4b3f453aea3bd58530cea40b3d3c34be612eba88 Mon Sep 17 00:00:00 2001 From: Emre Esen Date: Wed, 14 Feb 2024 01:07:05 +0300 Subject: [PATCH 5/6] [FIX][lint fix] --- app/src/main/java/com/sn/snfilemanager/MainActivity.kt | 2 +- app/src/main/java/com/sn/snfilemanager/core/util/Constant.kt | 2 +- .../feature/files/presentation/FilesListViewModel.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/sn/snfilemanager/MainActivity.kt b/app/src/main/java/com/sn/snfilemanager/MainActivity.kt index c8b481c..100ed84 100644 --- a/app/src/main/java/com/sn/snfilemanager/MainActivity.kt +++ b/app/src/main/java/com/sn/snfilemanager/MainActivity.kt @@ -4,8 +4,8 @@ import android.os.Bundle import androidx.activity.viewModels import androidx.appcompat.app.AppCompatActivity import androidx.navigation.findNavController -import com.sn.snfilemanager.core.util.Config import com.sn.snfilemanager.core.extensions.observe +import com.sn.snfilemanager.core.util.Config import com.sn.snfilemanager.databinding.ActivityMainBinding import com.sn.snfilemanager.feature.settings.SettingsUtils import dagger.hilt.android.AndroidEntryPoint diff --git a/app/src/main/java/com/sn/snfilemanager/core/util/Constant.kt b/app/src/main/java/com/sn/snfilemanager/core/util/Constant.kt index 86dade5..755beaf 100644 --- a/app/src/main/java/com/sn/snfilemanager/core/util/Constant.kt +++ b/app/src/main/java/com/sn/snfilemanager/core/util/Constant.kt @@ -7,4 +7,4 @@ object Constant { "https://github.com/emreesen27/Android-Sn-File-Manager/blob/develop/PRIVACY.md" const val OPEN_SOURCE_LICENSE = "https://github.com/emreesen27/Android-Sn-File-Manager/blob/develop/LICENSE" -} \ No newline at end of file +} diff --git a/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListViewModel.kt b/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListViewModel.kt index b9c180d..3a76f35 100644 --- a/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListViewModel.kt +++ b/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListViewModel.kt @@ -8,8 +8,8 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.sn.mediastorepv.data.ConflictStrategy import com.sn.mediastorepv.data.MediaType -import com.sn.snfilemanager.core.util.Config import com.sn.snfilemanager.core.base.BaseResult +import com.sn.snfilemanager.core.util.Config import com.sn.snfilemanager.core.util.Event import com.sn.snfilemanager.core.util.RootPath import com.sn.snfilemanager.feature.files.data.FileModel From 81d2edb3b555774c92ff3c4fe61b035231a5e683 Mon Sep 17 00:00:00 2001 From: Emre Esen Date: Wed, 14 Feb 2024 01:15:03 +0300 Subject: [PATCH 6/6] [DEV][v1.0.0-beta2 is completed] --- CHANGELOG.md | 6 ++++++ app/build.gradle | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92d90b7..9645c12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v1.0.0-beta2 (14.02.2024) + +* Start screen is completed +* About screen added +* Minor ui fix + ## v1.0.0-beta1 (12.02.2024) * Initial release \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 6d95687..44ccfbd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -39,8 +39,8 @@ android { applicationId "com.sn.snfilemanager" minSdk 26 targetSdk 34 - versionCode 1 - versionName "1.0.0-beta1" + versionCode 2 + versionName "1.0.0-beta2" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" }