From 74723ee7e8fdc64c2c9e627fb97f8d6b1f1b553f Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Mon, 13 Mar 2017 09:25:29 +0300 Subject: [PATCH] fix storage --- app/build.gradle | 2 +- .../axet/audiorecorder/activities/SettingsActivity.java | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 70046da..dfd8d55 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -45,5 +45,5 @@ dependencies { testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:25.2.0' compile 'com.android.support:support-v4:25.2.0' - compile 'com.github.axet:android-audio-library:0.0.8' // compile project(':android-audio-library') + compile 'com.github.axet:android-audio-library:0.0.9' // compile project(':android-audio-library') } diff --git a/app/src/main/java/com/github/axet/audiorecorder/activities/SettingsActivity.java b/app/src/main/java/com/github/axet/audiorecorder/activities/SettingsActivity.java index 1c0075b..915284a 100644 --- a/app/src/main/java/com/github/axet/audiorecorder/activities/SettingsActivity.java +++ b/app/src/main/java/com/github/axet/audiorecorder/activities/SettingsActivity.java @@ -24,6 +24,7 @@ import android.support.v7.app.ActionBar; import android.view.MenuItem; import android.widget.Toast; +import com.github.axet.audiolibrary.app.Storage; import com.github.axet.audiorecorder.R; import com.github.axet.audiorecorder.app.MainApplication; import com.github.axet.audiolibrary.encoders.Factory; @@ -61,6 +62,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity implements Sha @Override public boolean onPreferenceChange(Preference preference, Object value) { String stringValue = value.toString(); + String key = preference.getKey(); if (preference instanceof ListPreference) { // For list preferences, look up the correct display value in @@ -92,7 +94,12 @@ public class SettingsActivity extends AppCompatPreferenceActivity implements Sha } else { // For all other preferences, set the summary to the value's // simple string representation. - preference.setSummary(stringValue); + if (key.equals(MainApplication.PREFERENCE_STORAGE)) { // if storage is disabled, show local path + Storage storage = new Storage(preference.getContext()); + preference.setSummary(storage.getStoragePath().toString()); + } else { + preference.setSummary(stringValue); + } } return true; }