Merge branch 'audiorecorder-3.2.43'

This commit is contained in:
Alexey Kuznetsov 2018-12-11 11:32:36 +03:00
commit 88c9ddcb65
2 changed files with 6 additions and 13 deletions

View file

@ -10,8 +10,8 @@ android {
applicationId "com.github.axet.audiorecorder"
minSdkVersion 9
targetSdkVersion 26
versionCode 300
versionName "3.2.42"
versionCode 301
versionName "3.2.43"
}
signingConfigs {
release {
@ -57,5 +57,5 @@ android {
dependencies {
testImplementation 'junit:junit:4.12'
implementation 'com.github.axet:android-audio-library:1.0.141' // implementation project(':android-audio-library')
implementation 'com.github.axet:android-audio-library:1.0.142' // implementation project(':android-audio-library')
}

View file

@ -21,6 +21,7 @@ import com.github.axet.androidlibrary.app.NotificationManagerCompat;
import com.github.axet.androidlibrary.widgets.OptimizationPreferenceCompat;
import com.github.axet.androidlibrary.widgets.ProximityShader;
import com.github.axet.androidlibrary.widgets.RemoteNotificationCompat;
import com.github.axet.androidlibrary.widgets.RemoteViewsCompat;
import com.github.axet.audiolibrary.app.Storage;
import com.github.axet.audiorecorder.R;
import com.github.axet.audiorecorder.activities.MainActivity;
@ -101,14 +102,6 @@ public class RecordingService extends Service {
context.stopService(new Intent(context, RecordingService.class));
}
public static void mergeRemoteViews(RemoteViews view, RemoteViews a) {
try {
view.getClass().getDeclaredMethod("mergeRemoteViews", RemoteViews.class).invoke(view, a);
} catch (Exception e) {
Log.e(TAG, "merge", e);
}
}
public RecordingService() {
}
@ -193,9 +186,9 @@ public class RecordingService extends Service {
if (notificationIntent != null && notificationIntent.hasExtra("duration") && notificationIntent.getBooleanExtra("recording", false)) { // speed up
RemoteViews a = new RemoteViews(getPackageName(), notification.contentView.getLayoutId());
a.setTextViewText(R.id.title, title);
mergeRemoteViews(notification.contentView, a);
RemoteViewsCompat.mergeRemoteViews(notification.contentView, a);
if (Build.VERSION.SDK_INT >= 16 && notification.bigContentView != null)
mergeRemoteViews(notification.bigContentView, a);
RemoteViewsCompat.mergeRemoteViews(notification.bigContentView, a);
return notification;
}
}