diff --git a/app/build.gradle b/app/build.gradle index bc2acb9..0de56e9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -63,7 +63,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:fbcf12e609' + implementation 'com.github.SimpleMobileTools:Simple-Commons:8ee6c0c17b' implementation 'org.greenrobot:eventbus:3.3.1' implementation 'com.github.Armen101:AudioRecordView:1.0.4' implementation 'androidx.documentfile:documentfile:1.0.1' diff --git a/app/src/main/kotlin/com/simplemobiletools/voicerecorder/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/voicerecorder/activities/MainActivity.kt index b4f4e8c..3660463 100644 --- a/app/src/main/kotlin/com/simplemobiletools/voicerecorder/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/voicerecorder/activities/MainActivity.kt @@ -2,8 +2,6 @@ package com.simplemobiletools.voicerecorder.activities import android.content.Intent import android.os.Bundle -import android.view.Menu -import android.view.MenuItem import android.widget.ImageView import android.widget.TextView import com.simplemobiletools.commons.extensions.* @@ -24,6 +22,7 @@ class MainActivity : SimpleActivity() { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) appLaunched(BuildConfig.APPLICATION_ID) + setupOptionsMenu() if (checkAppSideloading()) { return @@ -50,8 +49,9 @@ class MainActivity : SimpleActivity() { override fun onResume() { super.onResume() - getPagerAdapter()?.onResume() setupTabColors() + setupToolbar(main_toolbar) + getPagerAdapter()?.onResume() } override fun onPause() { @@ -72,19 +72,15 @@ class MainActivity : SimpleActivity() { } } - override fun onCreateOptionsMenu(menu: Menu): Boolean { - menuInflater.inflate(R.menu.menu, menu) - updateMenuItemColors(menu) - return true - } - - override fun onOptionsItemSelected(item: MenuItem): Boolean { - when (item.itemId) { - R.id.settings -> launchSettings() - R.id.about -> launchAbout() - else -> return super.onOptionsItemSelected(item) + private fun setupOptionsMenu() { + main_toolbar.setOnMenuItemClickListener { menuItem -> + when (menuItem.itemId) { + R.id.settings -> launchSettings() + R.id.about -> launchAbout() + else -> return@setOnMenuItemClickListener false + } + return@setOnMenuItemClickListener true } - return true } private fun tryInitVoiceRecorder() { @@ -142,7 +138,7 @@ class MainActivity : SimpleActivity() { updateBottomTabItemColors(inactiveView, false) main_tabs_holder.getTabAt(view_pager.currentItem)?.select() - val bottomBarColor = getBottomTabsBackgroundColor() + val bottomBarColor = getBottomNavigationBackgroundColor() main_tabs_holder.setBackgroundColor(bottomBarColor) updateNavigationBarColor(bottomBarColor) } diff --git a/app/src/main/kotlin/com/simplemobiletools/voicerecorder/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/voicerecorder/activities/SettingsActivity.kt index f8cade3..decf82a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/voicerecorder/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/voicerecorder/activities/SettingsActivity.kt @@ -6,6 +6,7 @@ import com.simplemobiletools.commons.dialogs.ChangeDateTimeFormatDialog import com.simplemobiletools.commons.dialogs.FilePickerDialog import com.simplemobiletools.commons.dialogs.RadioGroupDialog import com.simplemobiletools.commons.extensions.* +import com.simplemobiletools.commons.helpers.NavigationIcon import com.simplemobiletools.commons.helpers.isQPlus import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.voicerecorder.R @@ -23,6 +24,7 @@ class SettingsActivity : SimpleActivity() { override fun onResume() { super.onResume() + setupToolbar(settings_toolbar, NavigationIcon.Arrow) setupPurchaseThankYou() setupCustomizeColors() @@ -33,7 +35,7 @@ class SettingsActivity : SimpleActivity() { setupExtension() setupBitrate() setupRecordAfterLaunch() - updateTextColors(settings_scrollview) + updateTextColors(settings_nested_scrollview) arrayOf(settings_color_customization_label, settings_general_settings_label).forEach { it.setTextColor(getProperPrimaryColor()) diff --git a/app/src/main/kotlin/com/simplemobiletools/voicerecorder/activities/WidgetRecordDisplayConfigureActivity.kt b/app/src/main/kotlin/com/simplemobiletools/voicerecorder/activities/WidgetRecordDisplayConfigureActivity.kt index ca0cd02..5864a5f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/voicerecorder/activities/WidgetRecordDisplayConfigureActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/voicerecorder/activities/WidgetRecordDisplayConfigureActivity.kt @@ -58,6 +58,8 @@ class WidgetRecordDisplayConfigureActivity : SimpleActivity() { if (mFeatureLockedDialog != null && isOrWasThankYouInstalled()) { mFeatureLockedDialog?.dismissDialog() } + + setupToolbar(config_toolbar) } private fun initVariables() { diff --git a/app/src/main/kotlin/com/simplemobiletools/voicerecorder/dialogs/RenameRecordingDialog.kt b/app/src/main/kotlin/com/simplemobiletools/voicerecorder/dialogs/RenameRecordingDialog.kt index 3baaf3b..ce523e7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/voicerecorder/dialogs/RenameRecordingDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/voicerecorder/dialogs/RenameRecordingDialog.kt @@ -22,13 +22,13 @@ class RenameRecordingDialog(val activity: BaseSimpleActivity, val recording: Rec rename_recording_title.setText(recording.title.substringBeforeLast('.')) } - AlertDialog.Builder(activity) + activity.getAlertDialogBuilder() .setPositiveButton(R.string.ok, null) .setNegativeButton(R.string.cancel, null) - .create().apply { - activity.setupDialogStuff(view, this, R.string.rename) { - showKeyboard(view.rename_recording_title) - getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener { + .apply { + activity.setupDialogStuff(view, this, R.string.rename) { alertDialog -> + alertDialog.showKeyboard(view.rename_recording_title) + alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener { val newTitle = view.rename_recording_title.value if (newTitle.isEmpty()) { activity.toast(R.string.empty_name) @@ -49,7 +49,7 @@ class RenameRecordingDialog(val activity: BaseSimpleActivity, val recording: Rec activity.runOnUiThread { callback() - dismiss() + alertDialog.dismiss() } } } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 671193e..d9e067b 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,23 +1,46 @@ - - + + + + + + + app:layout_behavior="@string/appbar_scrolling_view_behavior"> - + - + + + + diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index c9967d1..f370bca 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -1,214 +1,239 @@ - + android:layout_height="match_parent"> - + android:layout_height="wrap_content"> - + android:layout_height="?attr/actionBarSize" + android:background="@color/color_primary" + app:title="@string/settings" + app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" /> + + + + - + android:text="@string/color_customization" /> - + + + android:background="@drawable/ripple_all_corners"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/app/src/main/res/layout/dialog_rename_recording.xml b/app/src/main/res/layout/dialog_rename_recording.xml index fab5881..4a4a0d1 100644 --- a/app/src/main/res/layout/dialog_rename_recording.xml +++ b/app/src/main/res/layout/dialog_rename_recording.xml @@ -4,14 +4,26 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - android:padding="@dimen/activity_margin"> + android:paddingTop="@dimen/medium_margin"> - + android:layout_marginStart="@dimen/activity_margin" + android:layout_marginTop="@dimen/small_margin" + android:layout_marginEnd="@dimen/activity_margin" + android:layout_marginBottom="@dimen/activity_margin" + android:hint="@string/title"> + + + diff --git a/app/src/main/res/layout/widget_record_display_config.xml b/app/src/main/res/layout/widget_record_display_config.xml index ae01761..1b85214 100644 --- a/app/src/main/res/layout/widget_record_display_config.xml +++ b/app/src/main/res/layout/widget_record_display_config.xml @@ -1,66 +1,81 @@ - + android:layout_height="match_parent"> + + + + + + + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_margin="@dimen/activity_margin"> + + + + + - + android:id="@+id/config_widget_color" + android:layout_width="@dimen/widget_colorpicker_size" + android:layout_height="@dimen/widget_colorpicker_size" + android:layout_above="@+id/config_save" + android:layout_margin="@dimen/tiny_margin" /> - - - - - + + + + +