Merge branch 'audiorecorder-3.2.57'
This commit is contained in:
commit
c172fac621
19 changed files with 141 additions and 33 deletions
|
|
@ -8,8 +8,8 @@ android {
|
|||
applicationId "com.github.axet.audiorecorder"
|
||||
minSdkVersion 9
|
||||
targetSdkVersion 26
|
||||
versionCode 314
|
||||
versionName "3.2.56"
|
||||
versionCode 315
|
||||
versionName "3.2.57"
|
||||
}
|
||||
signingConfigs {
|
||||
release {
|
||||
|
|
@ -52,5 +52,5 @@ android {
|
|||
|
||||
dependencies {
|
||||
testImplementation 'junit:junit:4.12'
|
||||
implementation 'com.github.axet:android-audio-library:1.0.148' // implementation project(':android-audio-library')
|
||||
implementation 'com.github.axet:android-audio-library:1.0.149' // implementation project(':android-audio-library')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,15 @@
|
|||
android:supportsRtl="true"
|
||||
android:theme="@style/RecThemeLight">
|
||||
<service android:name=".services.RecordingService" />
|
||||
<service
|
||||
android:name=".services.TileService"
|
||||
android:label="@string/tile_start_recording"
|
||||
android:icon="@drawable/ic_mic_24dp"
|
||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.quicksettings.action.QS_TILE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<activity
|
||||
android:name=".activities.SettingsActivity"
|
||||
|
|
|
|||
|
|
@ -75,6 +75,9 @@ public class RecordingActivity extends AppCompatThemeActivity {
|
|||
public static final String PAUSE_BUTTON = RecordingActivity.class.getCanonicalName() + ".PAUSE_BUTTON";
|
||||
public static final String ACTION_FINISH_RECORDING = BuildConfig.APPLICATION_ID + ".STOP_RECORDING";
|
||||
|
||||
public static String START_RECORDING = RecordingService.class.getCanonicalName() + ".START_RECORDING";
|
||||
public static String STOP_RECORDING = RecordingService.class.getCanonicalName() + ".STOP_RECORDING";
|
||||
|
||||
PhoneStateChangeListener pscl = new PhoneStateChangeListener();
|
||||
FileEncoder encoder;
|
||||
MediaSessionCompat msc;
|
||||
|
|
@ -184,6 +187,10 @@ public class RecordingActivity extends AppCompatThemeActivity {
|
|||
}
|
||||
}
|
||||
|
||||
public static void stopRecording(Context context) {
|
||||
context.sendBroadcast(new Intent(ACTION_FINISH_RECORDING));
|
||||
}
|
||||
|
||||
public class AutoClose implements Runnable {
|
||||
int count = 5;
|
||||
AlertDialog d;
|
||||
|
|
@ -412,6 +419,8 @@ public class RecordingActivity extends AppCompatThemeActivity {
|
|||
return;
|
||||
}
|
||||
|
||||
sendBroadcast(new Intent(START_RECORDING));
|
||||
|
||||
edit(false, false);
|
||||
|
||||
title.setText(Storage.getName(this, recording.targetUri));
|
||||
|
|
@ -640,6 +649,7 @@ public class RecordingActivity extends AppCompatThemeActivity {
|
|||
AudioApplication.from(this).recording = null;
|
||||
handler.removeCallbacks(receiver.connected);
|
||||
pitch.stop();
|
||||
sendBroadcast(new Intent(STOP_RECORDING));
|
||||
}
|
||||
|
||||
void edit(boolean show, boolean animate) {
|
||||
|
|
|
|||
|
|
@ -424,27 +424,31 @@ public class AudioApplication extends com.github.axet.audiolibrary.app.MainAppli
|
|||
edit.commit();
|
||||
}
|
||||
|
||||
void show(String title, String text) {
|
||||
PendingIntent main = PendingIntent.getService(this, 0,
|
||||
new Intent(this, MainActivity.class),
|
||||
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
RemoteNotificationCompat.Builder builder = new RemoteNotificationCompat.Builder(this, R.layout.notifictaion);
|
||||
builder.setViewVisibility(R.id.notification_record, View.GONE);
|
||||
builder.setViewVisibility(R.id.notification_pause, View.GONE);
|
||||
builder.setTheme(AudioApplication.getTheme(this, R.style.RecThemeLight, R.style.RecThemeDark))
|
||||
.setImageViewTint(R.id.icon_circle, builder.getThemeColor(R.attr.colorButtonNormal))
|
||||
.setTitle(title)
|
||||
.setText(text)
|
||||
.setMainIntent(main)
|
||||
.setChannel(channelStatus)
|
||||
.setSmallIcon(R.drawable.ic_mic);
|
||||
NotificationManagerCompat nm = NotificationManagerCompat.from(this);
|
||||
nm.notify((int) System.currentTimeMillis(), builder.build());
|
||||
}
|
||||
|
||||
@SuppressLint("RestrictedApi")
|
||||
void version_1_to_2() {
|
||||
Locale locale = Locale.getDefault();
|
||||
if (locale.toString().startsWith("ru")) {
|
||||
String title = "Программа переименована";
|
||||
String text = "'Аудио Рекордер' -> '" + getString(R.string.app_name) + "'";
|
||||
PendingIntent main = PendingIntent.getService(this, 0,
|
||||
new Intent(this, MainActivity.class),
|
||||
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
RemoteNotificationCompat.Builder builder = new RemoteNotificationCompat.Builder(this, R.layout.notifictaion);
|
||||
builder.setViewVisibility(R.id.notification_record, View.GONE);
|
||||
builder.setViewVisibility(R.id.notification_pause, View.GONE);
|
||||
builder.setTheme(AudioApplication.getTheme(this, R.style.RecThemeLight, R.style.RecThemeDark))
|
||||
.setImageViewTint(R.id.icon_circle, builder.getThemeColor(R.attr.colorButtonNormal))
|
||||
.setTitle(title)
|
||||
.setText(text)
|
||||
.setMainIntent(main)
|
||||
.setChannel(channelStatus)
|
||||
.setSmallIcon(R.drawable.ic_mic);
|
||||
NotificationManagerCompat nm = NotificationManagerCompat.from(this);
|
||||
nm.notify((int) System.currentTimeMillis(), builder.build());
|
||||
show(title, text);
|
||||
}
|
||||
SharedPreferences shared = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
SharedPreferences.Editor edit = shared.edit();
|
||||
|
|
@ -458,21 +462,7 @@ public class AudioApplication extends com.github.axet.audiolibrary.app.MainAppli
|
|||
if (locale.toString().startsWith("tr")) {
|
||||
String title = "Application renamed";
|
||||
String text = "'Audio Recorder' -> '" + getString(R.string.app_name) + "'";
|
||||
PendingIntent main = PendingIntent.getService(this, 0,
|
||||
new Intent(this, MainActivity.class),
|
||||
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
RemoteNotificationCompat.Builder builder = new RemoteNotificationCompat.Builder(this, R.layout.notifictaion);
|
||||
builder.setViewVisibility(R.id.notification_record, View.GONE);
|
||||
builder.setViewVisibility(R.id.notification_pause, View.GONE);
|
||||
builder.setTheme(AudioApplication.getTheme(this, R.style.RecThemeLight, R.style.RecThemeDark))
|
||||
.setImageViewTint(R.id.icon_circle, builder.getThemeColor(R.attr.colorButtonNormal))
|
||||
.setTitle(title)
|
||||
.setText(text)
|
||||
.setMainIntent(main)
|
||||
.setChannel(channelStatus)
|
||||
.setSmallIcon(R.drawable.ic_mic);
|
||||
NotificationManagerCompat nm = NotificationManagerCompat.from(this);
|
||||
nm.notify((int) System.currentTimeMillis(), builder.build());
|
||||
show(title, text);
|
||||
}
|
||||
SharedPreferences shared = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
SharedPreferences.Editor edit = shared.edit();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,71 @@
|
|||
package com.github.axet.audiorecorder.services;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.graphics.drawable.Icon;
|
||||
import android.service.quicksettings.Tile;
|
||||
|
||||
import com.github.axet.audiorecorder.R;
|
||||
import com.github.axet.audiorecorder.activities.RecordingActivity;
|
||||
import com.github.axet.audiorecorder.app.AudioApplication;
|
||||
|
||||
@TargetApi(24)
|
||||
public class TileService extends android.service.quicksettings.TileService {
|
||||
BroadcastReceiver receiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
updateTile();
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
IntentFilter ff = new IntentFilter();
|
||||
ff.addAction(RecordingActivity.START_RECORDING);
|
||||
ff.addAction(RecordingActivity.STOP_RECORDING);
|
||||
registerReceiver(receiver, ff);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartListening() {
|
||||
super.onStartListening();
|
||||
updateTile();
|
||||
}
|
||||
|
||||
void updateTile() {
|
||||
Tile tile = getQsTile();
|
||||
if (AudioApplication.from(this).recording != null) {
|
||||
tile.setIcon(Icon.createWithResource(this, R.drawable.ic_stop_black_24dp));
|
||||
tile.setLabel(getString(R.string.tile_stop_recording));
|
||||
} else {
|
||||
tile.setIcon(Icon.createWithResource(this, R.drawable.ic_mic_24dp));
|
||||
tile.setLabel(getString(R.string.tile_start_recording));
|
||||
}
|
||||
tile.setState(Tile.STATE_ACTIVE);
|
||||
tile.updateTile();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopListening() {
|
||||
super.onStopListening();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
unregisterReceiver(receiver);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick() {
|
||||
super.onClick();
|
||||
if (getQsTile().getLabel().equals(getString(R.string.tile_start_recording)))
|
||||
RecordingActivity.startActivity(this, false);
|
||||
else
|
||||
RecordingActivity.stopRecording(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -71,4 +71,6 @@
|
|||
<string name="mic_muted_error">Mic muted</string>
|
||||
<string name="mic_muted_pie">Android Pie and above prevent idle background apps from using microphone. Please disable selinux or install previous android version!</string>
|
||||
<string name="mic_paused">Mic paused by OS, recording time is less then data recorded, check if you device supports background recording or it is fast enougth for selected settings</string>
|
||||
<string name="tile_start_recording">Start Recording</string>
|
||||
<string name="tile_stop_recording">Stop Recording</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -65,4 +65,6 @@
|
|||
<string name="mic_muted_error">Mic muted</string>
|
||||
<string name="mic_muted_pie">Android Pie and above prevent idle background apps from using microphone. Please disable selinux or install previous android version!</string>
|
||||
<string name="mic_paused">Mic paused by OS, recording time is less then data recorded, check if you device supports background recording or it is fast enougth for selected settings</string>
|
||||
<string name="tile_start_recording">Start Recording</string>
|
||||
<string name="tile_stop_recording">Stop Recording</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -71,4 +71,6 @@
|
|||
<string name="mic_muted_error">Micro silenciado</string>
|
||||
<string name="mic_muted_pie">En Android Pie y posteriores, se está evitando que las aplicaciones en segundo plano utilicen el micrófono. Por favor, ¡desactive selinux o instale la versión anterior de Android!</string>
|
||||
<string name="mic_paused">Micro pausado por el sistema, el tiempo de grabación es menor que la fecha grabada, revise si su dispositivo soporta grabación en segundo plano o ajuste la configuración actual.</string>
|
||||
<string name="tile_start_recording">Start Recording</string>
|
||||
<string name="tile_stop_recording">Stop Recording</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -71,4 +71,6 @@
|
|||
<string name="mic_muted_error">Mic muted</string>
|
||||
<string name="mic_muted_pie">Android Pie and above prevent idle background apps from using microphone. Please disable selinux or install previous android version!</string>
|
||||
<string name="mic_paused">Mic paused by OS, recording time is less then data recorded, check if you device supports background recording or it is fast enougth for selected settings</string>
|
||||
<string name="tile_start_recording">Start Recording</string>
|
||||
<string name="tile_stop_recording">Stop Recording</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -71,4 +71,6 @@
|
|||
<string name="mic_muted_error">Mic muted</string>
|
||||
<string name="mic_muted_pie">Android Pie and above prevent idle background apps from using microphone. Please disable selinux or install previous android version!</string>
|
||||
<string name="mic_paused">Mic paused by OS, recording time is less then data recorded, check if you device supports background recording or it is fast enougth for selected settings</string>
|
||||
<string name="tile_start_recording">Start Recording</string>
|
||||
<string name="tile_stop_recording">Stop Recording</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -71,4 +71,6 @@
|
|||
<string name="mic_muted_error">Mic muted</string>
|
||||
<string name="mic_muted_pie">Android Pie and above prevent idle background apps from using microphone. Please disable selinux or install previous android version!</string>
|
||||
<string name="mic_paused">Mic paused by OS, recording time is less then data recorded, check if you device supports background recording or it is fast enougth for selected settings</string>
|
||||
<string name="tile_start_recording">Start Recording</string>
|
||||
<string name="tile_stop_recording">Stop Recording</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -71,4 +71,6 @@
|
|||
<string name="mic_muted_error">Mic muted</string>
|
||||
<string name="mic_muted_pie">Android Pie and above prevent idle background apps from using microphone. Please disable selinux or install previous android version!</string>
|
||||
<string name="mic_paused">Mic paused by OS, recording time is less then data recorded, check if you device supports background recording or it is fast enougth for selected settings</string>
|
||||
<string name="tile_start_recording">Start Recording</string>
|
||||
<string name="tile_stop_recording">Stop Recording</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -71,4 +71,6 @@
|
|||
<string name="mic_muted_error">Mic muted</string>
|
||||
<string name="mic_muted_pie">Android Pie and above prevent idle background apps from using microphone. Please disable selinux or install previous android version!</string>
|
||||
<string name="mic_paused">Mic paused by OS, recording time is less then data recorded, check if you device supports background recording or it is fast enougth for selected settings</string>
|
||||
<string name="tile_start_recording">Start Recording</string>
|
||||
<string name="tile_stop_recording">Stop Recording</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -71,4 +71,6 @@
|
|||
<string name="mic_muted_error">Mic muted</string>
|
||||
<string name="mic_muted_pie">Android Pie and above prevent idle background apps from using microphone. Please disable selinux or install previous android version!</string>
|
||||
<string name="mic_paused">Mic paused by OS, recording time is less then data recorded, check if you device supports background recording or it is fast enougth for selected settings</string>
|
||||
<string name="tile_start_recording">Start Recording</string>
|
||||
<string name="tile_stop_recording">Stop Recording</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -71,4 +71,6 @@
|
|||
<string name="mic_muted_error">Mic muted</string>
|
||||
<string name="mic_muted_pie">Android Pie and above prevent idle background apps from using microphone. Please disable selinux or install previous android version!</string>
|
||||
<string name="mic_paused">Mic paused by OS, recording time is less then data recorded, check if you device supports background recording or it is fast enougth for selected settings</string>
|
||||
<string name="tile_start_recording">Start Recording</string>
|
||||
<string name="tile_stop_recording">Stop Recording</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -73,4 +73,6 @@
|
|||
<string name="mic_muted_error">Mic muted</string>
|
||||
<string name="mic_muted_pie">Android Pie and above prevent idle background apps from using microphone. Please disable selinux or install previous android version!</string>
|
||||
<string name="mic_paused">Mic paused by OS, recording time is less then data recorded, check if you device supports background recording or it is fast enougth for selected settings</string>
|
||||
<string name="tile_start_recording">Start Recording</string>
|
||||
<string name="tile_stop_recording">Stop Recording</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -71,4 +71,6 @@
|
|||
<string name="mic_muted_error">Mikrofon sessiz</string>
|
||||
<string name="mic_muted_pie">Android Pie ve üstü, boşta çalışan arka plan uygulamalarının mikrofon kullanmasını önler. Lütfen selinux\'u devre dışı bırakın veya önceki android sürümünü yükleyin!</string>
|
||||
<string name="mic_paused">Mikrofon, işletim sistemi tarafından duraklatılmış. Kayıt süresi, kaydedilenden daha az. Cihazınızın arka plan kaydını desteklediğini veya seçilen ayarlar için yeterince hızlı olup olmadığını kontrol edin.</string>
|
||||
<string name="tile_start_recording">Start Recording</string>
|
||||
<string name="tile_stop_recording">Stop Recording</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -71,4 +71,6 @@
|
|||
<string name="mic_muted_error">麦克风静音</string>
|
||||
<string name="mic_muted_pie">Android Pie及以上版本可防止空闲后台应用使用麦克风。请禁用selinux或安装Android旧版本!</string>
|
||||
<string name="mic_paused">麦克风被占用,录制时间少于已录制数据,请确认您的设备是否支持后台录音,或调整当前设置。</string>
|
||||
<string name="tile_start_recording">Start Recording</string>
|
||||
<string name="tile_stop_recording">Stop Recording</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -71,4 +71,6 @@
|
|||
<string name="mic_muted_error">Mic muted</string>
|
||||
<string name="mic_muted_pie">Android Pie and above prevent idle background apps from using microphone. Please disable selinux or install previous android version!</string>
|
||||
<string name="mic_paused">Mic paused by OS, recording time is less then data recorded, check if you device supports background recording or it is fast enough for selected settings</string>
|
||||
<string name="tile_start_recording">Start Recording</string>
|
||||
<string name="tile_stop_recording">Stop Recording</string>
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue