From 46b55c4b11b427cffd8ef03f6772d146dc7b5c41 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Tue, 11 Dec 2018 11:32:28 +0300 Subject: [PATCH 1/2] add mergeremoteview --- app/build.gradle | 2 +- .../audiorecorder/services/RecordingService.java | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b12506c..31e52bc 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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') } diff --git a/app/src/main/java/com/github/axet/audiorecorder/services/RecordingService.java b/app/src/main/java/com/github/axet/audiorecorder/services/RecordingService.java index ffbc8f1..00c9bc8 100644 --- a/app/src/main/java/com/github/axet/audiorecorder/services/RecordingService.java +++ b/app/src/main/java/com/github/axet/audiorecorder/services/RecordingService.java @@ -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; } } From aba7f2f85f4ba11f6a06e019b849615c91dc13b2 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Tue, 11 Dec 2018 11:32:36 +0300 Subject: [PATCH 2/2] Bump version audiorecorder-3.2.43 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 31e52bc..2cb90c2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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 {