Fixed compilation

This commit is contained in:
ByteHamster 2019-09-29 13:25:59 +02:00
parent 393d1fd646
commit 933790b0d3
4 changed files with 11 additions and 16 deletions

View File

@ -136,6 +136,7 @@ dependencies {
implementation "androidx.gridlayout:gridlayout:1.0.0"
implementation "androidx.recyclerview:recyclerview:1.0.0"
implementation "com.google.android.material:material:1.0.0"
annotationProcessor "androidx.annotation:annotation:1.1.0"
compileOnly "com.google.android.wearable:wearable:$wearableSupportVersion"
implementation "org.apache.commons:commons-lang3:$commonslangVersion"
implementation "commons-io:commons-io:$commonsioVersion"

View File

@ -311,9 +311,7 @@ public class CustomMRControllerDialog extends MediaRouteControllerDialog {
AccessibilityEventCompat.TYPE_ANNOUNCEMENT);
event.setPackageName(getContext().getPackageName());
event.setClassName(getClass().getName());
int resId = isPlaying ?
androidx.appcompat.mediarouter.R.string.mr_controller_pause :
androidx.appcompat.mediarouter.R.string.mr_controller_play;
int resId = isPlaying ? R.string.mr_controller_pause : R.string.mr_controller_play;
event.getText().add(getContext().getString(resId));
accessibilityManager.sendAccessibilityEvent(event);
}
@ -359,17 +357,17 @@ public class CustomMRControllerDialog extends MediaRouteControllerDialog {
if (route.getPresentationDisplay() != null &&
route.getPresentationDisplay().getDisplayId() != MediaRouter.RouteInfo.PRESENTATION_DISPLAY_ID_NONE) {
// The user is currently casting screen.
titleView.setText(androidx.appcompat.mediarouter.R.string.mr_controller_casting_screen);
titleView.setText(R.string.mr_controller_casting_screen);
showTitle = true;
} else if (state == null || state.getState() == PlaybackStateCompat.STATE_NONE) {
// Show "No media selected" as we don't yet know the playback state.
// (Only exception is bluetooth where we don't show anything.)
if (!route.isBluetooth()) {
titleView.setText(androidx.appcompat.mediarouter.R.string.mr_controller_no_media_selected);
titleView.setText(R.string.mr_controller_no_media_selected);
showTitle = true;
}
} else if (!hasTitle && !hasSubtitle) {
titleView.setText(androidx.appcompat.mediarouter.R.string.mr_controller_no_info_available);
titleView.setText(R.string.mr_controller_no_info_available);
showTitle = true;
} else {
if (hasTitle) {
@ -435,16 +433,12 @@ public class CustomMRControllerDialog extends MediaRouteControllerDialog {
| PlaybackStateCompat.ACTION_PLAY_PAUSE)) != 0;
if (isPlaying && supportsPause) {
playPauseButton.setVisibility(View.VISIBLE);
playPauseButton.setImageResource(getThemeResource(getContext(),
androidx.appcompat.mediarouter.R.attr.mediaRoutePauseDrawable));
playPauseButton.setContentDescription(getContext().getResources()
.getText(androidx.appcompat.mediarouter.R.string.mr_controller_pause));
playPauseButton.setImageResource(getThemeResource(getContext(), R.attr.mediaRoutePauseDrawable));
playPauseButton.setContentDescription(getContext().getResources().getText(R.string.mr_controller_pause));
} else if (!isPlaying && supportsPlay) {
playPauseButton.setVisibility(View.VISIBLE);
playPauseButton.setImageResource(getThemeResource(getContext(),
androidx.appcompat.mediarouter.R.attr.mediaRoutePlayDrawable));
playPauseButton.setContentDescription(getContext().getResources()
.getText(androidx.appcompat.mediarouter.R.string.mr_controller_play));
playPauseButton.setImageResource(getThemeResource(getContext(), R.attr.mediaRoutePlayDrawable));
playPauseButton.setContentDescription(getContext().getResources().getText(R.string.mr_controller_play));
} else {
playPauseButton.setVisibility(View.GONE);
}

View File

@ -58,6 +58,7 @@ android {
dependencies {
implementation "androidx.appcompat:appcompat:1.1.0"
implementation "androidx.preference:preference:1.1.0"
annotationProcessor "androidx.annotation:annotation:1.1.0"
implementation "android.arch.work:work-runtime:$workManagerVersion"
implementation "org.apache.commons:commons-lang3:$commonslangVersion"

View File

@ -16,7 +16,6 @@ import androidx.core.content.ContextCompat;
import android.support.v4.media.session.MediaSessionCompat;
import android.util.Log;
import android.view.KeyEvent;
import androidx.media.app.NotificationCompat;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import de.danoeh.antennapod.core.ClientConfig;
@ -195,7 +194,7 @@ public class PlaybackServiceNotificationBuilder extends NotificationCompat.Build
PendingIntent stopButtonPendingIntent = getPendingIntentForMediaAction(
KeyEvent.KEYCODE_MEDIA_STOP, numActions);
setStyle(new NotificationCompat.MediaStyle()
setStyle(new androidx.media.app.NotificationCompat.MediaStyle()
.setMediaSession(mediaSessionToken)
.setShowActionsInCompactView(compactActionList.toArray())
.setShowCancelButton(true)