mirror of
https://github.com/SimpleMobileTools/Simple-Voice-Recorder.git
synced 2025-03-13 09:50:06 +01:00
updating commons and target SDK to 31
This commit is contained in:
parent
5dcb4a6a37
commit
eb6c4f98a5
@ -9,12 +9,12 @@ if (keystorePropertiesFile.exists()) {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
compileSdkVersion 31
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.simplemobiletools.voicerecorder"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 30
|
||||
targetSdkVersion 31
|
||||
versionCode 19
|
||||
versionName "5.6.5"
|
||||
setProperty("archivesBaseName", "voice-recorder")
|
||||
@ -62,7 +62,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:99c8b8c007'
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:e3376e4f56'
|
||||
implementation 'org.greenrobot:eventbus:3.2.0'
|
||||
implementation 'com.github.Armen101:AudioRecordView:1.0.4'
|
||||
implementation 'androidx.documentfile:documentfile:1.0.1'
|
||||
|
@ -22,6 +22,7 @@
|
||||
<application
|
||||
android:name=".App"
|
||||
android:allowBackup="true"
|
||||
android:appCategory="audio"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_launcher_name"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
@ -31,6 +32,7 @@
|
||||
|
||||
<activity
|
||||
android:name=".activities.WidgetRecordDisplayConfigureActivity"
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/MyWidgetConfigTheme">
|
||||
<intent-filter>
|
||||
@ -40,6 +42,7 @@
|
||||
|
||||
<receiver
|
||||
android:name=".helpers.MyWidgetRecordDisplayProvider"
|
||||
android:exported="true"
|
||||
android:icon="@drawable/ic_microphone_vector">
|
||||
<intent-filter>
|
||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||
@ -52,21 +55,25 @@
|
||||
|
||||
<activity
|
||||
android:name=".activities.BackgroundRecordActivity"
|
||||
android:exported="false"
|
||||
android:theme="@android:style/Theme.NoDisplay" />
|
||||
|
||||
<activity
|
||||
android:name=".activities.SplashActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/SplashTheme" />
|
||||
|
||||
<activity
|
||||
android:name=".activities.MainActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
|
||||
<activity
|
||||
android:name=".activities.SettingsActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/settings"
|
||||
android:parentActivityName=".activities.MainActivity" >
|
||||
android:parentActivityName=".activities.MainActivity">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
|
||||
@ -76,11 +83,13 @@
|
||||
|
||||
<activity
|
||||
android:name="com.simplemobiletools.commons.activities.AboutActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/about"
|
||||
android:parentActivityName=".activities.MainActivity" />
|
||||
|
||||
<activity
|
||||
android:name="com.simplemobiletools.commons.activities.CustomizationActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/customize_colors"
|
||||
android:parentActivityName=".activities.SettingsActivity" />
|
||||
|
||||
@ -97,6 +106,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Red"
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher_red"
|
||||
android:roundIcon="@mipmap/ic_launcher_red"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -110,6 +120,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Pink"
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher_pink"
|
||||
android:roundIcon="@mipmap/ic_launcher_pink"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -123,6 +134,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Purple"
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher_purple"
|
||||
android:roundIcon="@mipmap/ic_launcher_purple"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -136,6 +148,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Deep_purple"
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher_deep_purple"
|
||||
android:roundIcon="@mipmap/ic_launcher_deep_purple"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -149,6 +162,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Indigo"
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher_indigo"
|
||||
android:roundIcon="@mipmap/ic_launcher_indigo"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -162,6 +176,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Blue"
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher_blue"
|
||||
android:roundIcon="@mipmap/ic_launcher_blue"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -175,6 +190,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Light_blue"
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher_light_blue"
|
||||
android:roundIcon="@mipmap/ic_launcher_light_blue"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -188,6 +204,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Cyan"
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher_cyan"
|
||||
android:roundIcon="@mipmap/ic_launcher_cyan"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -201,6 +218,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Teal"
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher_teal"
|
||||
android:roundIcon="@mipmap/ic_launcher_teal"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -214,6 +232,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Green"
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher_green"
|
||||
android:roundIcon="@mipmap/ic_launcher_green"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -227,6 +246,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Light_green"
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher_light_green"
|
||||
android:roundIcon="@mipmap/ic_launcher_light_green"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -240,6 +260,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Lime"
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher_lime"
|
||||
android:roundIcon="@mipmap/ic_launcher_lime"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -253,6 +274,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Yellow"
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher_yellow"
|
||||
android:roundIcon="@mipmap/ic_launcher_yellow"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -266,6 +288,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Amber"
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher_amber"
|
||||
android:roundIcon="@mipmap/ic_launcher_amber"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -279,6 +302,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Orange"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -291,6 +315,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Deep_orange"
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher_deep_orange"
|
||||
android:roundIcon="@mipmap/ic_launcher_deep_orange"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -304,6 +329,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Brown"
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher_brown"
|
||||
android:roundIcon="@mipmap/ic_launcher_brown"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -317,6 +343,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Blue_grey"
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher_blue_grey"
|
||||
android:roundIcon="@mipmap/ic_launcher_blue_grey"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -330,6 +357,7 @@
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Grey_black"
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:icon="@mipmap/ic_launcher_grey_black"
|
||||
android:roundIcon="@mipmap/ic_launcher_grey_black"
|
||||
android:targetActivity=".activities.SplashActivity">
|
||||
@ -339,6 +367,5 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity-alias>
|
||||
|
||||
</application>
|
||||
</manifest>
|
||||
|
@ -105,11 +105,11 @@ class MainActivity : SimpleActivity() {
|
||||
|
||||
main_tabs_holder.onTabSelectionChanged(
|
||||
tabUnselectedAction = {
|
||||
it.icon?.applyColorFilter(config.textColor)
|
||||
it.icon?.applyColorFilter(getProperTextColor())
|
||||
},
|
||||
tabSelectedAction = {
|
||||
view_pager.currentItem = it.position
|
||||
it.icon?.applyColorFilter(getAdjustedPrimaryColor())
|
||||
it.icon?.applyColorFilter(getProperPrimaryColor())
|
||||
}
|
||||
)
|
||||
}
|
||||
@ -118,10 +118,10 @@ class MainActivity : SimpleActivity() {
|
||||
|
||||
private fun setupTabColors() {
|
||||
main_tabs_holder.apply {
|
||||
background = ColorDrawable(config.backgroundColor)
|
||||
setSelectedTabIndicatorColor(getAdjustedPrimaryColor())
|
||||
getTabAt(view_pager.currentItem)?.icon?.applyColorFilter(getAdjustedPrimaryColor())
|
||||
getTabAt(getInactiveTabIndex())?.icon?.applyColorFilter(config.textColor)
|
||||
background = ColorDrawable(getProperBackgroundColor())
|
||||
setSelectedTabIndicatorColor(getProperPrimaryColor())
|
||||
getTabAt(view_pager.currentItem)?.icon?.applyColorFilter(getProperPrimaryColor())
|
||||
getTabAt(getInactiveTabIndex())?.icon?.applyColorFilter(getProperTextColor())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,11 +36,11 @@ class SettingsActivity : SimpleActivity() {
|
||||
updateTextColors(settings_scrollview)
|
||||
|
||||
arrayOf(settings_color_customization_label, settings_general_settings_label).forEach {
|
||||
it.setTextColor(getAdjustedPrimaryColor())
|
||||
it.setTextColor(getProperPrimaryColor())
|
||||
}
|
||||
|
||||
arrayOf(settings_color_customization_holder, settings_general_settings_holder).forEach {
|
||||
it.background.applyColorFilter(baseConfig.backgroundColor.getContrastColor())
|
||||
it.background.applyColorFilter(getProperBackgroundColor().getContrastColor())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,7 +200,7 @@ class RecordingsAdapter(
|
||||
}
|
||||
|
||||
if (recording.id == currRecordingId) {
|
||||
recording_title.setTextColor(context.getAdjustedPrimaryColor())
|
||||
recording_title.setTextColor(context.getProperPrimaryColor())
|
||||
}
|
||||
|
||||
recording_title.text = recording.title
|
||||
|
@ -29,7 +29,6 @@ import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
class PlayerFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerFragment(context, attributeSet), RefreshRecordingsListener {
|
||||
private val FAST_FORWARD_SKIP_MS = 10000
|
||||
@ -46,7 +45,7 @@ class PlayerFragment(context: Context, attributeSet: AttributeSet) : MyViewPager
|
||||
if (prevSavePath.isNotEmpty() && context!!.config.saveRecordingsFolder != prevSavePath) {
|
||||
setupAdapter()
|
||||
} else {
|
||||
getRecordingsAdapter()?.updateTextColor(context.config.textColor)
|
||||
getRecordingsAdapter()?.updateTextColor(context.getProperTextColor())
|
||||
}
|
||||
|
||||
storePrevPath()
|
||||
@ -366,7 +365,7 @@ class PlayerFragment(context: Context, attributeSet: AttributeSet) : MyViewPager
|
||||
|
||||
private fun getToggleButtonIcon(isPlaying: Boolean): Drawable {
|
||||
val drawable = if (isPlaying) R.drawable.ic_pause_vector else R.drawable.ic_play_vector
|
||||
return resources.getColoredDrawableWithColor(drawable, context.getAdjustedPrimaryColor().getContrastColor())
|
||||
return resources.getColoredDrawableWithColor(drawable, context.getProperPrimaryColor().getContrastColor())
|
||||
}
|
||||
|
||||
private fun skip(forward: Boolean) {
|
||||
@ -393,16 +392,16 @@ class PlayerFragment(context: Context, attributeSet: AttributeSet) : MyViewPager
|
||||
}
|
||||
|
||||
private fun setupColors() {
|
||||
val adjustedPrimaryColor = context.getAdjustedPrimaryColor()
|
||||
recordings_fastscroller.updateColors(adjustedPrimaryColor)
|
||||
val properPrimaryColor = context.getProperPrimaryColor()
|
||||
recordings_fastscroller.updateColors(properPrimaryColor)
|
||||
context.updateTextColors(player_holder)
|
||||
|
||||
val textColor = context.config.textColor
|
||||
val textColor = context.getProperTextColor()
|
||||
arrayListOf(previous_btn, next_btn).forEach {
|
||||
it.applyColorFilter(textColor)
|
||||
}
|
||||
|
||||
play_pause_btn.background.applyColorFilter(adjustedPrimaryColor)
|
||||
play_pause_btn.background.applyColorFilter(properPrimaryColor)
|
||||
play_pause_btn.setImageDrawable(getToggleButtonIcon(false))
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,6 @@ import android.util.AttributeSet
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.commons.helpers.isNougatPlus
|
||||
import com.simplemobiletools.voicerecorder.R
|
||||
import com.simplemobiletools.voicerecorder.extensions.config
|
||||
import com.simplemobiletools.voicerecorder.helpers.*
|
||||
import com.simplemobiletools.voicerecorder.models.Events
|
||||
import com.simplemobiletools.voicerecorder.services.RecorderService
|
||||
@ -64,19 +63,19 @@ class RecorderFragment(context: Context, attributeSet: AttributeSet) : MyViewPag
|
||||
}
|
||||
|
||||
private fun setupColors() {
|
||||
val adjustedPrimaryColor = context.getAdjustedPrimaryColor()
|
||||
val properPrimaryColor = context.getProperPrimaryColor()
|
||||
toggle_recording_button.apply {
|
||||
setImageDrawable(getToggleButtonIcon())
|
||||
background.applyColorFilter(adjustedPrimaryColor)
|
||||
background.applyColorFilter(properPrimaryColor)
|
||||
}
|
||||
|
||||
toggle_pause_button.apply {
|
||||
setImageDrawable(resources.getColoredDrawableWithColor(R.drawable.ic_pause_vector, adjustedPrimaryColor.getContrastColor()))
|
||||
background.applyColorFilter(adjustedPrimaryColor)
|
||||
setImageDrawable(resources.getColoredDrawableWithColor(R.drawable.ic_pause_vector, properPrimaryColor.getContrastColor()))
|
||||
background.applyColorFilter(properPrimaryColor)
|
||||
}
|
||||
|
||||
recorder_visualizer.chunkColor = adjustedPrimaryColor
|
||||
recording_duration.setTextColor(context.config.textColor)
|
||||
recorder_visualizer.chunkColor = properPrimaryColor
|
||||
recording_duration.setTextColor(context.getProperTextColor())
|
||||
}
|
||||
|
||||
private fun updateRecordingDuration(duration: Int) {
|
||||
@ -85,7 +84,7 @@ class RecorderFragment(context: Context, attributeSet: AttributeSet) : MyViewPag
|
||||
|
||||
private fun getToggleButtonIcon(): Drawable {
|
||||
val drawable = if (status == RECORDING_RUNNING || status == RECORDING_PAUSED) R.drawable.ic_stop_vector else R.drawable.ic_microphone_vector
|
||||
return resources.getColoredDrawableWithColor(drawable, context.getAdjustedPrimaryColor().getContrastColor())
|
||||
return resources.getColoredDrawableWithColor(drawable, context.getProperPrimaryColor().getContrastColor())
|
||||
}
|
||||
|
||||
private fun toggleRecording() {
|
||||
|
@ -1,6 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:ignore="AppCompatResource">
|
||||
<item
|
||||
android:id="@+id/cab_rename"
|
||||
android:icon="@drawable/ic_rename_vector"
|
||||
@ -13,11 +15,13 @@
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/cab_open_with"
|
||||
android:showAsAction="never"
|
||||
android:title="@string/open_with"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/cab_delete"
|
||||
android:icon="@drawable/ic_delete_vector"
|
||||
android:showAsAction="never"
|
||||
android:title="@string/delete"
|
||||
app:showAsAction="ifRoom" />
|
||||
</menu>
|
||||
|
@ -8,7 +8,7 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.0.4'
|
||||
classpath 'com.android.tools.build:gradle:7.1.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
|
||||
|
Loading…
x
Reference in New Issue
Block a user