Fix custom sound setting summary

The full path to the file was displayed. Only the file name is displayed now.
This commit is contained in:
Trevor Slocum 2023-03-27 20:45:37 -07:00
parent d0550611f2
commit 0cb0b18a8e
3 changed files with 43 additions and 21 deletions

View File

@ -1,12 +1,12 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion '30.0.3'
compileSdkVersion 33
buildToolsVersion '33.0.2'
defaultConfig {
minSdkVersion 16
targetSdkVersion 29 // Must not increase until storage permissions are updated
targetSdkVersion 33
versionCode 166
versionName "1.6.6"
@ -75,14 +75,14 @@ android {
}
dependencies {
implementation 'androidx.core:core:1.3.2'
implementation 'androidx.core:core:1.9.0'
implementation 'androidx.legacy:legacy-support-core-utils:1.0.0'
implementation 'androidx.legacy:legacy-support-core-ui:1.0.0'
implementation 'androidx.media:media:1.2.1'
implementation 'androidx.media:media:1.6.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'androidx.fragment:fragment:1.3.2'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.fragment:fragment:1.5.6'
implementation 'androidx.recyclerview:recyclerview:1.3.0'
implementation 'com.google.android.material:material:1.8.0'
implementation 'net.openid:appauth:0.7.1'
implementation 'com.opencsv:opencsv:5.2'
implementation 'com.squareup.okio:okio:2.8.0'

View File

@ -41,7 +41,8 @@
android:name=".MainActivity"
android:configChanges="keyboard|keyboardHidden|screenSize|orientation"
android:label="@string/appNameShort"
android:launchMode="singleTask">
android:launchMode="singleTask"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -57,6 +58,7 @@
android:label="@string/settings"
android:launchMode="singleTop"
android:parentActivityName=".MainActivity"
android:exported="false"
tools:ignore="UnusedAttribute">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
@ -66,6 +68,7 @@
android:name=".AuthResultActivity"
android:configChanges="keyboard|keyboardHidden|screenSize|orientation"
android:label="@string/signInToMediNET"
android:exported="false"
android:launchMode="singleTop">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
@ -88,7 +91,8 @@
android:name=".MediNETActivity"
android:configChanges="keyboard|keyboardHidden|screenSize|orientation"
android:label=""
android:launchMode="singleTop">
android:launchMode="singleTop"
android:exported="false">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="sh.ftp.rocketninelabs.meditationassistant.MainActivity" />
@ -96,7 +100,8 @@
<activity
android:name=".CompleteActivity"
android:configChanges="keyboard|keyboardHidden|screenSize|orientation"
android:label="@string/sessioncomplete">
android:label="@string/sessioncomplete"
android:exported="false">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="sh.ftp.rocketninelabs.meditationassistant.MainActivity" />
@ -104,7 +109,8 @@
<activity
android:name=".AboutActivity"
android:configChanges="keyboard|keyboardHidden|screenSize|orientation"
android:label="@string/about">
android:label="@string/about"
android:exported="false">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="sh.ftp.rocketninelabs.meditationassistant.MainActivity" />
@ -112,7 +118,8 @@
<activity
android:name=".ProgressActivity"
android:configChanges="keyboard|keyboardHidden|screenSize|orientation"
android:label="@string/progress">
android:label="@string/progress"
android:exported="false">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="sh.ftp.rocketninelabs.meditationassistant.MainActivity" />
@ -120,7 +127,8 @@
<activity
android:name=".PresetWidgetActivity"
android:excludeFromRecents="true"
android:theme="@style/MeditationDarkDialogTheme">
android:theme="@style/MeditationDarkDialogTheme"
android:exported="false">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
@ -128,7 +136,8 @@
<activity
android:name="com.nononsenseapps.filepicker.FilePickerActivity"
android:label="@string/appNameShort"
android:theme="@style/FilePickerTheme">
android:theme="@style/FilePickerTheme"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
@ -178,7 +187,8 @@
<receiver
android:name=".WidgetPresetProvider1"
android:label="@string/widgetpreset1x1">
android:label="@string/widgetpreset1x1"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
@ -189,7 +199,8 @@
</receiver>
<receiver
android:name=".WidgetPresetProvider2"
android:label="@string/widgetpreset2x1">
android:label="@string/widgetpreset2x1"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
@ -200,7 +211,8 @@
</receiver>
<receiver
android:name=".WidgetPresetProvider3"
android:label="@string/widgetpreset3x1">
android:label="@string/widgetpreset3x1"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
@ -211,7 +223,8 @@
</receiver>
<receiver
android:name=".WidgetStreakProvider2"
android:label="@string/widgetstreak2x1">
android:label="@string/widgetstreak2x1"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
@ -222,7 +235,8 @@
</receiver>
<receiver
android:name=".WidgetStreakProvider3"
android:label="@string/widgetstreak3x1">
android:label="@string/widgetstreak3x1"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>

View File

@ -41,6 +41,7 @@ import androidx.core.content.ContextCompat;
import net.margaritov.preference.colorpicker.ColorPickerPreference;
import java.net.URLDecoder;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
@ -878,11 +879,18 @@ public class SettingsActivity extends PreferenceActivity {
return getString(R.string.noSound);
}
String decodedSound;
try {
return java.net.URLDecoder.decode(meditation_sound.substring(meditation_sound.lastIndexOf("/") + 1), "UTF-8");
decodedSound = URLDecoder.decode(meditation_sound);
} catch (Exception e) {
return meditation_sound;
}
int index = decodedSound.lastIndexOf("/");
if (index == -1) {
return decodedSound;
}
return decodedSound.substring(index+1);
}
private void bindPreferenceSummaryToValue(Preference preference) {