add silence option dialog for api23+
This commit is contained in:
parent
3a245fa2d5
commit
f05ddff7cc
9 changed files with 21 additions and 16 deletions
|
|
@ -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.64' // compile project(':android-audio-library')
|
||||
compile 'com.github.axet:android-audio-library:0.0.65' // compile project(':android-audio-library')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
|
||||
|
||||
<application
|
||||
android:name=".app.MainApplication"
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.github.axet.audiorecorder.activities;
|
|||
|
||||
import android.Manifest;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
|
|
@ -18,14 +19,17 @@ import android.preference.PreferenceFragment;
|
|||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.preference.CheckBoxPreference;
|
||||
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.support.v7.preference.SwitchPreferenceCompat;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.github.axet.androidlibrary.widgets.SilencePreferenceCompat;
|
||||
import com.github.axet.audiolibrary.app.Storage;
|
||||
import com.github.axet.audiorecorder.R;
|
||||
import com.github.axet.audiorecorder.app.MainApplication;
|
||||
|
|
@ -119,7 +123,7 @@ public class SettingsActivity extends AppCompatActivity implements SharedPrefere
|
|||
}
|
||||
|
||||
static void initPrefs(PreferenceManager pm, PreferenceScreen screen) {
|
||||
Context context = screen.getContext();
|
||||
final Context context = screen.getContext();
|
||||
ListPreference enc = (ListPreference) pm.findPreference(MainApplication.PREFERENCE_ENCODING);
|
||||
String v = enc.getValue();
|
||||
CharSequence[] ee = Factory.getEncodingTexts(context);
|
||||
|
|
@ -228,7 +232,6 @@ public class SettingsActivity extends AppCompatActivity implements SharedPrefere
|
|||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
final SharedPreferences shared = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
shared.unregisterOnSharedPreferenceChangeListener(this);
|
||||
}
|
||||
|
|
@ -267,7 +270,8 @@ public class SettingsActivity extends AppCompatActivity implements SharedPrefere
|
|||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
SilencePreferenceCompat silent = (SilencePreferenceCompat) findPreference(MainApplication.PREFERENCE_SILENT);
|
||||
silent.onResume();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@
|
|||
android:summary="Stoppe Aufnahme bei Anrufannahme und setze nach Auflegen fort"
|
||||
android:title="Pausieren während Telefonaten" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
<com.github.axet.androidlibrary.widgets.SilencePreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="silence"
|
||||
android:summary="Aktiviere Audio-Profil \'Nicht Stören\' während Aufnahmen"
|
||||
android:title="Ruhe-Modus" />
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@
|
|||
android:summary="Ferma la registrazione quando rispondi a chiamate e continua quando metti giù"
|
||||
android:title="Pausa durante le chiamate" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
<com.github.axet.androidlibrary.widgets.SilencePreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="silence"
|
||||
android:summary="Metti in cellulare in 'silenzioso' durante le registrazioni"
|
||||
android:title="Silenzioso" />
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@
|
|||
android:summary="着信して通話をする間、録音を停止します"
|
||||
android:title="着信時に一時停止" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
<com.github.axet.androidlibrary.widgets.SilencePreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="silence"
|
||||
android:summary="録音中、電話を 'マナーモード' にします"
|
||||
android:title="マナーモード" />
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@
|
|||
android:summary="e voltar a gravar quando a chamada for desligada"
|
||||
android:title="Pausar durante chamadas" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
<com.github.axet.androidlibrary.widgets.SilencePreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="silence"
|
||||
android:summary="Silenciar o aparelho durante a gravação"
|
||||
android:title="Modo silencioso" />
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@
|
|||
android:summary="2015-12-31 22:11:34"
|
||||
android:title="Имя нового файла" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
<com.github.axet.androidlibrary.widgets.SilencePreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="call"
|
||||
android:summary="Останавливать запись на время разговора по телефону"
|
||||
android:title="Пауза на время разговора" />
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@
|
|||
android:summary="Stop recording on answering and continue on hangup"
|
||||
android:title="Pause During Calls" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
<com.github.axet.androidlibrary.widgets.SilencePreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="silence"
|
||||
android:summary="Put phone in 'silence mode' during recording"
|
||||
android:title="Silence Mode" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue