Merge branch 'audiorecorder-3.4.1'
This commit is contained in:
commit
7100a222f9
6 changed files with 29 additions and 11 deletions
|
|
@ -9,8 +9,8 @@ android {
|
|||
applicationId "com.github.axet.audiorecorder"
|
||||
minSdkVersion 9
|
||||
targetSdkVersion 29
|
||||
versionCode 350
|
||||
versionName "3.4.0"
|
||||
versionCode 351
|
||||
versionName "3.4.1"
|
||||
}
|
||||
signingConfigs {
|
||||
release {
|
||||
|
|
@ -53,7 +53,7 @@ android {
|
|||
|
||||
dependencies {
|
||||
testImplementation 'junit:junit:4.12'
|
||||
implementation 'com.github.axet:android-audio-library:1.0.178' // implementation project(':android-audio-library')
|
||||
implementation 'com.github.axet:android-audio-library:1.0.179' // implementation project(':android-audio-library')
|
||||
implementation ('com.github.axet:wget:1.7.0') { exclude group: 'org.json', module: 'json' }
|
||||
assets('com.google.android.exoplayer:exoplayer:2.7.3') { exclude group: 'com.android.support' }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
android:requestLegacyExternalStorage="true"
|
||||
android:roundIcon="@mipmap/ic_launcher"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/RecThemeLight">
|
||||
android:theme="@android:style/Theme.Translucent">
|
||||
<service android:name=".services.RecordingService" />
|
||||
<service android:name=".services.EncodingService" />
|
||||
<service android:name=".services.ControlsService" />
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
android:exported="true"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleInstance"
|
||||
android:theme="@style/RecThemeLight.NoActionBar">
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar">
|
||||
<meta-data
|
||||
android:name="android.app.searchable"
|
||||
android:resource="@xml/searchable" />
|
||||
|
|
|
|||
|
|
@ -70,8 +70,6 @@ public class MainActivity extends AppCompatThemeActivity {
|
|||
|
||||
public static void startActivity(Context context) {
|
||||
Intent i = new Intent(context, MainActivity.class);
|
||||
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
i.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
context.startActivity(i);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -152,8 +152,6 @@ public class RecordingActivity extends AppCompatThemeActivity {
|
|||
Intent i = new Intent(context, RecordingActivity.class);
|
||||
if (pause)
|
||||
i.setAction(RecordingActivity.START_PAUSE);
|
||||
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
i.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
context.startActivity(i);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -119,8 +119,8 @@ public class SettingsActivity extends AppCompatSettingsThemeActivity implements
|
|||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
MainActivity.startActivity(this);
|
||||
finish();
|
||||
MainActivity.startActivity(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import android.view.WindowManager;
|
|||
import android.widget.RemoteViews;
|
||||
|
||||
import com.github.axet.androidlibrary.app.AlarmManager;
|
||||
import com.github.axet.androidlibrary.app.NotificationManagerCompat;
|
||||
import com.github.axet.androidlibrary.app.ProximityShader;
|
||||
import com.github.axet.androidlibrary.preferences.OptimizationPreferenceCompat;
|
||||
import com.github.axet.androidlibrary.services.PersistentService;
|
||||
|
|
@ -91,7 +92,28 @@ public class ControlsService extends PersistentService {
|
|||
intent = new Intent();
|
||||
else
|
||||
intent = null;
|
||||
super.updateIcon(intent);
|
||||
NotificationManagerCompat nm = NotificationManagerCompat.from(context);
|
||||
if (intent != null || isOptimization()) {
|
||||
Notification n = build(intent);
|
||||
if (notification == null) {
|
||||
nm.notify(id, n);
|
||||
} else {
|
||||
String co = NotificationChannelCompat.getChannelId(notification);
|
||||
String cn = NotificationChannelCompat.getChannelId(n);
|
||||
if (co == null && cn != null || co != null && cn == null || co != null && cn != null && !co.equals(cn))
|
||||
nm.cancel(id);
|
||||
nm.notify(id, n);
|
||||
}
|
||||
notification = n;
|
||||
} else {
|
||||
hideIcon();
|
||||
}
|
||||
}
|
||||
|
||||
public void hideIcon() {
|
||||
NotificationManagerCompat nm = NotificationManagerCompat.from(context);
|
||||
nm.cancel(id);
|
||||
notification = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue