diff --git a/app/build.gradle b/app/build.gradle
index 08c134d..fc947ee 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -8,8 +8,8 @@ android {
applicationId "com.github.axet.audiorecorder"
minSdkVersion 9
targetSdkVersion 23
- versionCode 119
- versionName "1.4.17"
+ versionCode 120
+ versionName "1.4.18"
}
signingConfigs {
release {
@@ -43,5 +43,5 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
- compile 'com.github.axet:android-audio-library:0.0.20' // compile project(':android-audio-library')
+ compile 'com.github.axet:android-audio-library:0.0.21' // compile project(':android-audio-library')
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 50bf023..a7b0c45 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -14,7 +14,7 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
- android:theme="@style/AppThemeLight">
+ android:theme="@style/RecThemeLight">
+ android:theme="@style/RecThemeLight.NoActionBar">
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 661fefb..929684c 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
@@ -13,14 +13,16 @@ import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
-import android.preference.ListPreference;
-import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceFragment;
-import android.preference.PreferenceManager;
-import android.preference.RingtonePreference;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.ActionBar;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.preference.ListPreference;
+import android.support.v7.preference.Preference;
+import android.support.v7.preference.PreferenceFragmentCompat;
+import android.support.v7.preference.PreferenceManager;
+import android.support.v7.preference.PreferenceScreen;
import android.view.MenuItem;
import android.widget.Toast;
@@ -45,7 +47,7 @@ import java.util.List;
* href="http://developer.android.com/guide/topics/ui/settings.html">Settings
* API Guide for more information on developing a Settings UI.
*/
-public class SettingsActivity extends AppCompatPreferenceActivity implements SharedPreferences.OnSharedPreferenceChangeListener {
+public class SettingsActivity extends AppCompatActivity implements SharedPreferences.OnSharedPreferenceChangeListener {
public static T[] removeElement(Class c, T[] aa, int i) {
List ll = Arrays.asList(aa);
@@ -76,21 +78,6 @@ public class SettingsActivity extends AppCompatPreferenceActivity implements Sha
? listPreference.getEntries()[index]
: null);
- } else if (preference instanceof RingtonePreference) {
- // For ringtone preferences, look up the correct display value
- // using RingtoneManager.
- Ringtone ringtone = RingtoneManager.getRingtone(
- preference.getContext(), Uri.parse(stringValue));
-
- if (ringtone == null) {
- // Clear the summary if there was a lookup error.
- preference.setSummary(null);
- } else {
- // Set the summary to reflect the new ringtone display
- // name.
- String name = ringtone.getTitle(preference.getContext());
- preference.setSummary(name);
- }
} else {
// For all other preferences, set the summary to the value's
// simple string representation.
@@ -130,6 +117,33 @@ public class SettingsActivity extends AppCompatPreferenceActivity implements Sha
.getString(preference.getKey(), ""));
}
+ static void initPrefs(PreferenceManager pm, PreferenceScreen screen) {
+ Context context = screen.getContext();
+ ListPreference enc = (ListPreference) pm.findPreference(MainApplication.PREFERENCE_ENCODING);
+ String v = enc.getValue();
+ CharSequence[] ee = Factory.getEncodingTexts(context);
+ CharSequence[] vv = Factory.getEncodingValues(context);
+ if (ee.length > 1) {
+ enc.setEntries(ee);
+ enc.setEntryValues(vv);
+
+ int i = enc.findIndexOfValue(v);
+ if (i == -1) {
+ enc.setValueIndex(0);
+ } else {
+ enc.setValueIndex(i);
+ }
+
+ bindPreferenceSummaryToValue(enc);
+ } else {
+ screen.removePreference(enc);
+ }
+
+ bindPreferenceSummaryToValue(pm.findPreference(MainApplication.PREFERENCE_RATE));
+ bindPreferenceSummaryToValue(pm.findPreference(MainApplication.PREFERENCE_THEME));
+ bindPreferenceSummaryToValue(pm.findPreference(MainApplication.PREFERENCE_CHANNELS));
+ }
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -139,35 +153,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity implements Sha
final SharedPreferences shared = PreferenceManager.getDefaultSharedPreferences(this);
shared.registerOnSharedPreferenceChangeListener(this);
- if (Build.VERSION.SDK_INT < 11) {
- addPreferencesFromResource(R.xml.pref_general);
-
- ListPreference enc = (ListPreference) findPreference(MainApplication.PREFERENCE_ENCODING);
- String v = enc.getValue();
- CharSequence[] ee = Factory.getEncodingTexts(this);
- CharSequence[] vv = Factory.getEncodingValues(this);
- if (ee.length > 1) {
- enc.setEntries(ee);
- enc.setEntryValues(vv);
-
- int i = enc.findIndexOfValue(v);
- if (i == -1) {
- enc.setValueIndex(0);
- } else {
- enc.setValueIndex(i);
- }
-
- bindPreferenceSummaryToValue(enc);
- } else {
- getPreferenceScreen().removePreference(enc);
- }
-
- bindPreferenceSummaryToValue(findPreference(MainApplication.PREFERENCE_RATE));
- bindPreferenceSummaryToValue(findPreference(MainApplication.PREFERENCE_THEME));
- bindPreferenceSummaryToValue(findPreference(MainApplication.PREFERENCE_CHANNELS));
- } else {
- getFragmentManager().beginTransaction().replace(android.R.id.content, new GeneralPreferenceFragment()).commit();
- }
+ getSupportFragmentManager().beginTransaction().replace(android.R.id.content, new GeneralPreferenceFragment()).commit();
}
/**
@@ -182,23 +168,6 @@ public class SettingsActivity extends AppCompatPreferenceActivity implements Sha
}
}
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean onIsMultiPane() {
- return isXLargeTablet(this);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- @TargetApi(Build.VERSION_CODES.HONEYCOMB)
- public void onBuildHeaders(List target) {
-// loadHeadersFromResource(R.xml.pref_headers, target);
- }
-
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
@@ -213,6 +182,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity implements Sha
* This method stops fragment injection in malicious applications.
* Make sure to deny any unknown fragments here.
*/
+ @TargetApi(11)
protected boolean isValidFragment(String fragmentName) {
return PreferenceFragment.class.getName().equals(fragmentName)
|| GeneralPreferenceFragment.class.getName().equals(fragmentName);
@@ -258,40 +228,15 @@ public class SettingsActivity extends AppCompatPreferenceActivity implements Sha
* This fragment shows general preferences only. It is used when the
* activity is showing a two-pane settings UI.
*/
- @TargetApi(11)
- public static class GeneralPreferenceFragment extends PreferenceFragment {
+ public static class GeneralPreferenceFragment extends PreferenceFragmentCompat {
public GeneralPreferenceFragment() {
}
@Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- addPreferencesFromResource(R.xml.pref_general);
+ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
setHasOptionsMenu(true);
-
- ListPreference enc = (ListPreference) findPreference(MainApplication.PREFERENCE_ENCODING);
- String v = enc.getValue();
- CharSequence[] ee = Factory.getEncodingTexts(getActivity());
- CharSequence[] vv = Factory.getEncodingValues(getActivity());
- if (ee.length > 1) {
- enc.setEntries(ee);
- enc.setEntryValues(vv);
-
- int i = enc.findIndexOfValue(v);
- if (i == -1) {
- enc.setValueIndex(0);
- } else {
- enc.setValueIndex(i);
- }
-
- bindPreferenceSummaryToValue(enc);
- } else {
- getPreferenceScreen().removePreference(enc);
- }
-
- bindPreferenceSummaryToValue(findPreference(MainApplication.PREFERENCE_RATE));
- bindPreferenceSummaryToValue(findPreference(MainApplication.PREFERENCE_THEME));
- bindPreferenceSummaryToValue(findPreference(MainApplication.PREFERENCE_CHANNELS));
+ addPreferencesFromResource(R.xml.pref_general);
+ initPrefs(getPreferenceManager(), getPreferenceScreen());
}
@Override
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 8542005..f67a429 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -1,2 +1,21 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/xml-ru-v14/pref_general.xml b/app/src/main/res/xml-ru-v14/pref_general.xml
deleted file mode 100644
index 0e05a3a..0000000
--- a/app/src/main/res/xml-ru-v14/pref_general.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/xml-ru/pref_general.xml b/app/src/main/res/xml-ru/pref_general.xml
index fcc8b91..7ae2fe9 100644
--- a/app/src/main/res/xml-ru/pref_general.xml
+++ b/app/src/main/res/xml-ru/pref_general.xml
@@ -1,6 +1,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml
index 6144273..525b546 100644
--- a/app/src/main/res/xml/pref_general.xml
+++ b/app/src/main/res/xml/pref_general.xml
@@ -1,6 +1,6 @@
-
-
+ android:title="Pause during calls" />
-