From 5a73565182f98c4e728b9bc27e41dc395a5438ce Mon Sep 17 00:00:00 2001 From: Prathamesh More Date: Sat, 9 Oct 2021 13:46:21 +0530 Subject: [PATCH] Added backup & restore in settings --- .../retromusic/fragments/settings/MainSettingsFragment.kt | 2 ++ .../code/name/monkey/retromusic/util/NavigationUtil.kt | 5 +++++ app/src/main/res/layout/fragment_main_settings.xml | 8 ++++++++ .../src/main/res/values/colors_material_design.xml | 2 ++ 4 files changed, 17 insertions(+) diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/settings/MainSettingsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/settings/MainSettingsFragment.kt index 30b39fa5..c8ecf904 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/settings/MainSettingsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/settings/MainSettingsFragment.kt @@ -45,6 +45,7 @@ class MainSettingsFragment : Fragment(), View.OnClickListener { R.id.otherSettings -> findNavController().navigate(R.id.action_mainSettingsFragment_to_otherSettingsFragment) R.id.aboutSettings -> findNavController().navigate(R.id.action_mainSettingsFragment_to_aboutActivity) R.id.nowPlayingSettings -> findNavController().navigate(R.id.action_mainSettingsFragment_to_nowPlayingSettingsFragment) + R.id.backup_restore_settings -> NavigationUtil.gotoBackup(requireActivity()) } } @@ -68,6 +69,7 @@ class MainSettingsFragment : Fragment(), View.OnClickListener { binding.notificationSettings.setOnClickListener(this) binding.otherSettings.setOnClickListener(this) binding.aboutSettings.setOnClickListener(this) + binding.backupRestoreSettings.setOnClickListener(this) binding.buyProContainer.apply { if (App.isProVersion()) hide() else show() diff --git a/app/src/main/java/code/name/monkey/retromusic/util/NavigationUtil.kt b/app/src/main/java/code/name/monkey/retromusic/util/NavigationUtil.kt index ffba5bdd..b0a14077 100755 --- a/app/src/main/java/code/name/monkey/retromusic/util/NavigationUtil.kt +++ b/app/src/main/java/code/name/monkey/retromusic/util/NavigationUtil.kt @@ -23,6 +23,7 @@ import androidx.core.app.ActivityCompat import androidx.navigation.findNavController import code.name.monkey.retromusic.R import code.name.monkey.retromusic.activities.* +import code.name.monkey.retromusic.activities.backup.BackupActivity import code.name.monkey.retromusic.activities.bugreport.BugReportActivity import code.name.monkey.retromusic.helper.MusicPlayerRemote.audioSessionId import com.google.android.material.bottomsheet.BottomSheetBehavior @@ -77,6 +78,10 @@ object NavigationUtil { ActivityCompat.startActivity(activity, Intent(activity, WhatsNewActivity::class.java), null) } + fun gotoBackup(activity: Activity) { + ActivityCompat.startActivity(activity, Intent(activity, BackupActivity::class.java), null) + } + fun openEqualizer(activity: Activity) { stockEqualizer(activity) } diff --git a/app/src/main/res/layout/fragment_main_settings.xml b/app/src/main/res/layout/fragment_main_settings.xml index 774ec074..ef396711 100644 --- a/app/src/main/res/layout/fragment_main_settings.xml +++ b/app/src/main/res/layout/fragment_main_settings.xml @@ -160,6 +160,14 @@ app:settingListItemText="@string/other_settings_summary" app:settingListItemTitle="@string/others" /> + #2196F3 #2979FF + #26c6da + #00C853 #4CAF50