From 439fc6d72c56ff7344297fbf6bd2ac83677bdc77 Mon Sep 17 00:00:00 2001 From: David Luhmer Date: Wed, 31 Oct 2018 20:30:22 +0100 Subject: [PATCH 01/10] adjust text-color (fix #677) --- .../main/res/layout/subscription_detail_list_item_card_view.xml | 2 +- .../src/main/res/layout/subscription_detail_list_item_text.xml | 2 +- .../main/res/layout/subscription_detail_list_item_thumbnail.xml | 2 +- News-Android-App/src/main/res/values/colors.xml | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/News-Android-App/src/main/res/layout/subscription_detail_list_item_card_view.xml b/News-Android-App/src/main/res/layout/subscription_detail_list_item_card_view.xml index 6b6b68ac..69c70f8d 100644 --- a/News-Android-App/src/main/res/layout/subscription_detail_list_item_card_view.xml +++ b/News-Android-App/src/main/res/layout/subscription_detail_list_item_card_view.xml @@ -101,7 +101,7 @@ android:textAlignment="viewStart" android:ellipsize="end" tools:text="Body" - android:textColor="@color/material_grey_600" + android:textColor="@color/text_medium_emphasis" android:textSize="14sp" android:autoLink="none" android:layout_below="@+id/summary" diff --git a/News-Android-App/src/main/res/layout/subscription_detail_list_item_text.xml b/News-Android-App/src/main/res/layout/subscription_detail_list_item_text.xml index b81c81ef..1b502fcc 100644 --- a/News-Android-App/src/main/res/layout/subscription_detail_list_item_text.xml +++ b/News-Android-App/src/main/res/layout/subscription_detail_list_item_text.xml @@ -97,7 +97,7 @@ android:textAlignment="viewStart" android:ellipsize="end" tools:text="Body" - android:textColor="@color/material_grey_600" + android:textColor="@color/text_medium_emphasis" android:textSize="14sp" android:autoLink="none" android:layout_below="@+id/summary" diff --git a/News-Android-App/src/main/res/layout/subscription_detail_list_item_thumbnail.xml b/News-Android-App/src/main/res/layout/subscription_detail_list_item_thumbnail.xml index 3f391d50..a0f4f9c9 100644 --- a/News-Android-App/src/main/res/layout/subscription_detail_list_item_thumbnail.xml +++ b/News-Android-App/src/main/res/layout/subscription_detail_list_item_thumbnail.xml @@ -71,7 +71,7 @@ android:layout_marginBottom="8dp" android:maxLines="5" android:textAlignment="viewStart" - android:textColor="@color/material_grey_600" + android:textColor="@color/text_medium_emphasis" android:textSize="15sp" android:textStyle="normal" tools:text="Anruf-Info djkas dhask dhas dashdajs dha dhas dhas djka a jsa das djsa djas dash djas dashdja sljda dhjas ja dkla da ja da djas djkasas jkas dklas dsa djla hkjdsahkdas hd ashjdas jsak dsada" /> diff --git a/News-Android-App/src/main/res/values/colors.xml b/News-Android-App/src/main/res/values/colors.xml index 3bbdceb9..66547d25 100644 --- a/News-Android-App/src/main/res/values/colors.xml +++ b/News-Android-App/src/main/res/values/colors.xml @@ -15,6 +15,7 @@ @color/options_menu_item + #a0000000 #9E9E9E #757575 #212121 From a9483eb4f2cd98f6b0be015c4cda86ffb9da6635 Mon Sep 17 00:00:00 2001 From: David Luhmer Date: Wed, 31 Oct 2018 20:41:47 +0100 Subject: [PATCH 02/10] use white text-color for dark theme --- News-Android-App/src/main/res/values-night/colors.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/News-Android-App/src/main/res/values-night/colors.xml b/News-Android-App/src/main/res/values-night/colors.xml index cb4535dd..160e558f 100644 --- a/News-Android-App/src/main/res/values-night/colors.xml +++ b/News-Android-App/src/main/res/values-night/colors.xml @@ -19,6 +19,8 @@ #1D2D44 #006AA3 + #a0ffffff + @color/nextcloudBlue @color/nextcloudBlue #8698af From 23a3bdd05af8589f125bf8a8957cb8c93ce33186 Mon Sep 17 00:00:00 2001 From: Nextcloud bot Date: Thu, 1 Nov 2018 01:51:05 +0000 Subject: [PATCH 03/10] [tx-robot] updated from transifex --- News-Android-App/src/main/res/values-de-rDE/strings.xml | 3 +++ News-Android-App/src/main/res/values-de/strings.xml | 3 +++ News-Android-App/src/main/res/values-it/strings.xml | 3 +++ News-Android-App/src/main/res/values-pt-rBR/strings.xml | 3 +++ News-Android-App/src/main/res/values-tr/strings.xml | 3 +++ 5 files changed, 15 insertions(+) diff --git a/News-Android-App/src/main/res/values-de-rDE/strings.xml b/News-Android-App/src/main/res/values-de-rDE/strings.xml index 349a4e90..881d5886 100644 --- a/News-Android-App/src/main/res/values-de-rDE/strings.xml +++ b/News-Android-App/src/main/res/values-de-rDE/strings.xml @@ -152,6 +152,9 @@ Kein Podcast ausgewählt Keine Kapitel verfügbar Wiedergabegeschwindigkeit + Podcast wird herunterladen + + Anzeige Nachtmodus diff --git a/News-Android-App/src/main/res/values-de/strings.xml b/News-Android-App/src/main/res/values-de/strings.xml index 5773d51e..f6219a13 100644 --- a/News-Android-App/src/main/res/values-de/strings.xml +++ b/News-Android-App/src/main/res/values-de/strings.xml @@ -153,6 +153,9 @@ Benötigt keine Übersetzung. Für Android wird nur die formelle Übersetzung verwendet (de_DE). Benötigt keine Übersetzung. Für Android wird nur die formelle Übersetzung verwendet (de_DE). Benötigt keine Übersetzung. Für Android wird nur die formelle Übersetzung verwendet (de_DE). + Podcast wird herunterladen + + Benötigt keine Übersetzung. Für Android wird nur die formelle Übersetzung verwendet (de_DE). Benötigt keine Übersetzung. Für Android wird nur die formelle Übersetzung verwendet (de_DE). diff --git a/News-Android-App/src/main/res/values-it/strings.xml b/News-Android-App/src/main/res/values-it/strings.xml index 6fc3eb16..8bfbbb48 100644 --- a/News-Android-App/src/main/res/values-it/strings.xml +++ b/News-Android-App/src/main/res/values-it/strings.xml @@ -152,6 +152,9 @@ Nessun podcast selezionato Nessun capitolo disponibile Velocità di riproduzione + Scaricamento podcast + + Schermo Modalità notte diff --git a/News-Android-App/src/main/res/values-pt-rBR/strings.xml b/News-Android-App/src/main/res/values-pt-rBR/strings.xml index 06f13848..7421a107 100644 --- a/News-Android-App/src/main/res/values-pt-rBR/strings.xml +++ b/News-Android-App/src/main/res/values-pt-rBR/strings.xml @@ -152,6 +152,9 @@ Nenhum podcast selecionado Nenhum capítulo disponível Velocidade do Playback + Baixando podcast + + Exibir Modo Noturno diff --git a/News-Android-App/src/main/res/values-tr/strings.xml b/News-Android-App/src/main/res/values-tr/strings.xml index 457dbad2..bc521123 100644 --- a/News-Android-App/src/main/res/values-tr/strings.xml +++ b/News-Android-App/src/main/res/values-tr/strings.xml @@ -152,6 +152,9 @@ Herhangi bir podcast seçilmemiş Kullanılabilecek bir bölüm yok Oynatma Hızı + Podcast indiriliyor + + Görüntüle Gece Kipi From e2ff49a964698856df60799b8e3b540e5a1cf7cb Mon Sep 17 00:00:00 2001 From: David Luhmer Date: Thu, 1 Nov 2018 13:13:27 +0100 Subject: [PATCH 04/10] fix notifications / improve lifecycle / add support for bluetooth playback etc. --- .../src/debug/AndroidManifest.xml | 7 - .../podcast/YoutubePlaybackService.java | 2 +- News-Android-App/src/main/AndroidManifest.xml | 38 +++- .../NewsDetailActivity.java | 2 +- .../owncloudnewsreader/PodcastFragment.java | 50 +++-- .../PodcastFragmentActivity.java | 191 ++++++++++++---- .../podcast/UpdatePodcastStatusEvent.java | 8 +- .../PodcastNotificationToggle.java | 28 --- .../owncloudnewsreader/model/MediaItem.java | 1 + .../owncloudnewsreader/model/PodcastItem.java | 3 +- .../owncloudnewsreader/model/TTSItem.java | 7 +- .../NextcloudNotificationManager.java | 72 +++++- .../services/PodcastPlaybackService.java | 205 ++++++++++++++---- .../podcast/MediaPlayerPlaybackService.java | 2 +- .../services/podcast/PlaybackService.java | 4 +- .../services/podcast/TTSPlaybackService.java | 2 +- .../view/PodcastNotification.java | 118 ++++------ 17 files changed, 502 insertions(+), 238 deletions(-) delete mode 100644 News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/events/podcast/broadcastreceiver/PodcastNotificationToggle.java diff --git a/News-Android-App/src/debug/AndroidManifest.xml b/News-Android-App/src/debug/AndroidManifest.xml index 0fe41daf..308ad046 100644 --- a/News-Android-App/src/debug/AndroidManifest.xml +++ b/News-Android-App/src/debug/AndroidManifest.xml @@ -85,13 +85,6 @@ - - - - - - - @@ -201,13 +195,37 @@ android:name=".widget.WidgetService" android:exported="false" android:permission="android.permission.BIND_REMOTEVIEWS" /> + + + android:exported="true" > + + + + + + + + + + + + + + = android.os.Build.VERSION_CODES.O) { int importance = NotificationManager.IMPORTANCE_DEFAULT; NotificationChannel mChannel = new NotificationChannel(channelId, channelId, importance); + mChannel.setSound(null, null); + mChannel.enableVibration(false); + //mChannel.setShowBadge(false); //mChannel.enableLights(true); notificationManager.createNotificationChannel(mChannel); } diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/PodcastPlaybackService.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/PodcastPlaybackService.java index ad5afb3d..03a12434 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/PodcastPlaybackService.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/PodcastPlaybackService.java @@ -1,17 +1,34 @@ package de.luhmer.owncloudnewsreader.services; -import android.app.Service; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; import android.content.Intent; -import android.os.Binder; +import android.media.AudioManager; +import android.os.Bundle; import android.os.Handler; -import android.os.IBinder; +import android.os.ResultReceiver; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; +import android.support.v4.media.MediaBrowserCompat; +import android.support.v4.media.MediaBrowserServiceCompat; +import android.support.v4.media.MediaMetadataCompat; +import android.support.v4.media.session.MediaButtonReceiver; +import android.support.v4.media.session.MediaSessionCompat; +import android.support.v4.media.session.PlaybackStateCompat; import android.telephony.PhoneStateListener; import android.telephony.TelephonyManager; import android.util.Log; +import android.view.KeyEvent; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; +import java.util.ArrayList; +import java.util.List; + +import de.luhmer.owncloudnewsreader.NewsReaderListActivity; +import de.luhmer.owncloudnewsreader.R; import de.luhmer.owncloudnewsreader.events.podcast.NewPodcastPlaybackListener; import de.luhmer.owncloudnewsreader.events.podcast.PodcastCompletedEvent; import de.luhmer.owncloudnewsreader.events.podcast.RegisterVideoOutput; @@ -29,23 +46,27 @@ import de.luhmer.owncloudnewsreader.services.podcast.TTSPlaybackService; import de.luhmer.owncloudnewsreader.services.podcast.YoutubePlaybackService; import de.luhmer.owncloudnewsreader.view.PodcastNotification; -public class PodcastPlaybackService extends Service { +import static android.view.KeyEvent.KEYCODE_MEDIA_STOP; + +public class PodcastPlaybackService extends MediaBrowserServiceCompat { public static final String MEDIA_ITEM = "MediaItem"; private static final String TAG = "PodcastPlaybackService"; + + public static final String PLAYBACK_SPEED_FLOAT = "PLAYBACK_SPEED"; + public static final String CURRENT_PODCAST_ITEM_MEDIA_ITEM= "CURRENT_PODCAST_ITEM"; private PodcastNotification podcastNotification; private EventBus eventBus; private Handler mHandler; private PlaybackService mPlaybackService; + private MediaSessionCompat mSession; public static final float PLAYBACK_SPEEDS[] = { 0.25f, 0.5f, 0.75f, 1.0f, 1.25f, 1.5f, 1.75f, 2.0f, 2.5f, 3.0f }; private float currentPlaybackSpeed = 1; - // Binder given to clients - private final IBinder mBinder = new LocalBinder(); public MediaItem getCurrentlyPlayingPodcast() { if(mPlaybackService != null) { @@ -58,20 +79,18 @@ public class PodcastPlaybackService extends Service { return mPlaybackService != null; } - /** - * Class used for the client Binder. Because we know this service always - * runs in the same process as its clients, we don't need to deal with IPC. - */ - public class LocalBinder extends Binder { - public PodcastPlaybackService getService() { - // Return this instance of LocalService so clients can call public methods - return PodcastPlaybackService.this; - } + @Nullable + @Override + public BrowserRoot onGetRoot(@NonNull String s, int i, @Nullable Bundle bundle) { + return new MediaBrowserServiceCompat.BrowserRoot( + getString(R.string.app_name),// Name visible in Android Auto + null); } @Override - public IBinder onBind(Intent intent) { - return mBinder; + public void onLoadChildren(@NonNull String s, @NonNull Result> result) { + Log.d(TAG, "onLoadChildren() called with: s = [" + s + "], result = [" + result + "]"); + result.sendResult(new ArrayList()); } @Override @@ -98,16 +117,31 @@ public class PodcastPlaybackService extends Service { mgr.listen(phoneStateListener, PhoneStateListener.LISTEN_CALL_STATE); } - podcastNotification = new PodcastNotification(this); + initMediaSessions(); + + podcastNotification = new PodcastNotification(this, mSession); mHandler = new Handler(); eventBus = EventBus.getDefault(); eventBus.register(this); - eventBus.post(new PodcastPlaybackServiceStarted()); + //eventBus.post(new PodcastPlaybackServiceStarted()); mHandler.postDelayed(mUpdateTimeTask, 0); + setSessionToken(mSession.getSessionToken()); + + Intent intent = new Intent(this, NewsReaderListActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + PendingIntent pi = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); + mSession.setSessionActivity(pi); + //startForeground(PodcastNotification.NOTIFICATION_ID, podcastNotification.getNotification()); + + /* + //Handles headphones coming unplugged. cannot be done through a manifest receiver + IntentFilter filter = new IntentFilter(AudioManager.ACTION_AUDIO_BECOMING_NOISY); + registerReceiver(mNoisyReceiver, filter); + */ } @Override @@ -127,31 +161,35 @@ public class PodcastPlaybackService extends Service { @Override public int onStartCommand(Intent intent, int flags, int startId) { + MediaButtonReceiver.handleIntent(mSession, intent); + if (intent != null) { - if(mPlaybackService != null) { + if (mPlaybackService != null) { mPlaybackService.destroy(); mPlaybackService = null; } - MediaItem mediaItem = (MediaItem) intent.getSerializableExtra(MEDIA_ITEM); + if(intent.hasExtra(MEDIA_ITEM)) { + MediaItem mediaItem = (MediaItem) intent.getSerializableExtra(MEDIA_ITEM); - if (mediaItem instanceof PodcastItem) { - if(((PodcastItem)mediaItem).isYoutubeVideo()) { - mPlaybackService = new YoutubePlaybackService(this, podcastStatusListener, mediaItem); - } else { - mPlaybackService = new MediaPlayerPlaybackService(this, podcastStatusListener, mediaItem); + if (mediaItem instanceof PodcastItem) { + if (((PodcastItem) mediaItem).isYoutubeVideo()) { + mPlaybackService = new YoutubePlaybackService(this, podcastStatusListener, mediaItem); + } else { + mPlaybackService = new MediaPlayerPlaybackService(this, podcastStatusListener, mediaItem); + } + } else if (mediaItem instanceof TTSItem) { + mPlaybackService = new TTSPlaybackService(this, podcastStatusListener, mediaItem); } - } else if(mediaItem instanceof TTSItem) { - mPlaybackService = new TTSPlaybackService(this, podcastStatusListener, mediaItem); + + podcastNotification.podcastChanged(); + sendMediaStatus(); + + mPlaybackService.playbackSpeedChanged(currentPlaybackSpeed); } - - podcastNotification.podcastChanged(); - sendMediaStatus(); - - mPlaybackService.playbackSpeedChanged(currentPlaybackSpeed); } - return Service.START_STICKY; + return super.onStartCommand(intent, flags, startId); } private PlaybackService.PodcastStatusListener podcastStatusListener = new PlaybackService.PodcastStatusListener() { @@ -275,24 +313,29 @@ public class PodcastPlaybackService extends Service { UpdatePodcastStatusEvent audioPodcastEvent; if(mPlaybackService == null) { - audioPodcastEvent = new UpdatePodcastStatusEvent(0, 0, PlaybackService.Status.NOT_INITIALIZED, "", PlaybackService.VideoType.None, -1, -1); + audioPodcastEvent = new UpdatePodcastStatusEvent(0, 0, PlaybackService.Status.NOT_INITIALIZED, "", "", PlaybackService.VideoType.None, -1, -1); } else { audioPodcastEvent = new UpdatePodcastStatusEvent( mPlaybackService.getCurrentDuration(), mPlaybackService.getTotalDuration(), mPlaybackService.getStatus(), + mPlaybackService.getMediaItem().link, mPlaybackService.getMediaItem().title, mPlaybackService.getVideoType(), mPlaybackService.getMediaItem().itemId, getPlaybackSpeed()); } eventBus.post(audioPodcastEvent); + + if(audioPodcastEvent.isPlaying()) { + startForeground(PodcastNotification.NOTIFICATION_ID, podcastNotification.getNotification()); + } else { + stopForeground(false); + } } - public class PodcastPlaybackServiceStarted { - - } + //public class PodcastPlaybackServiceStarted { } PhoneStateListener phoneStateListener = new PhoneStateListener() { @Override @@ -308,4 +351,90 @@ public class PodcastPlaybackService extends Service { super.onCallStateChanged(state, incomingNumber); } }; + + + private final class MediaSessionCallback extends MediaSessionCompat.Callback { + @Override + public void onPlay() { + EventBus.getDefault().post(new TogglePlayerStateEvent()); + } + + @Override + public void onPause() { + EventBus.getDefault().post(new TogglePlayerStateEvent()); + } + + @Override + public void onCommand(String command, Bundle extras, ResultReceiver cb) { + if (command.equals(PLAYBACK_SPEED_FLOAT)) { + Bundle b = new Bundle(); + b.putFloat(PLAYBACK_SPEED_FLOAT, currentPlaybackSpeed); + cb.send(0, b); + } else if(command.equals(CURRENT_PODCAST_ITEM_MEDIA_ITEM)) { + Bundle b = new Bundle(); + b.putSerializable(CURRENT_PODCAST_ITEM_MEDIA_ITEM, mPlaybackService.getMediaItem()); + cb.send(0, b); + } + super.onCommand(command, extras, cb); + } + + @Override + public boolean onMediaButtonEvent(Intent mediaButtonEvent) { + Log.d(TAG, mediaButtonEvent.getAction()); + + if(mediaButtonEvent.hasExtra("android.intent.extra.KEY_EVENT")) { + KeyEvent keyEvent = mediaButtonEvent.getParcelableExtra("android.intent.extra.KEY_EVENT"); + Log.d(TAG, keyEvent.toString()); + + // Stop requested (e.g. notification was swiped away) + if(keyEvent.getKeyCode() == KEYCODE_MEDIA_STOP) { + stopSelf(); + /* + boolean isPlaying = mSession.getController().getPlaybackState().getState() == PlaybackStateCompat.STATE_PLAYING; + if(isPlaying) { + EventBus.getDefault().post(new TogglePlayerStateEvent()); + } + */ + } + } + return super.onMediaButtonEvent(mediaButtonEvent); + } + } + + private void initMediaSessions() { + //String packageName = PodcastNotificationToggle.class.getPackage().getName(); + //ComponentName receiver = new ComponentName(packageName, PodcastNotificationToggle.class.getName()); + ComponentName mediaButtonReceiver = new ComponentName(this, MediaButtonReceiver.class); + mSession = new MediaSessionCompat(this, "PlayerService", mediaButtonReceiver, null); + mSession.setFlags(MediaSessionCompat.FLAG_HANDLES_MEDIA_BUTTONS | + MediaSessionCompat.FLAG_HANDLES_TRANSPORT_CONTROLS); + mSession.setPlaybackState(new PlaybackStateCompat.Builder() + .setState(PlaybackStateCompat.STATE_PAUSED, 0, 0) + .setActions(PlaybackStateCompat.ACTION_PLAY_PAUSE).build()); + + mSession.setCallback(new MediaSessionCallback()); + + //Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON); + //mediaButtonIntent.setClass(mContext, MediaButtonReceiver.class); + //PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, mediaButtonIntent, 0); + //mSession.setMediaButtonReceiver(pendingIntent); + + + AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); + audioManager.requestAudioFocus(new AudioManager.OnAudioFocusChangeListener() { + @Override + public void onAudioFocusChange(int focusChange) { + // Ignore + } + }, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN); + + //MediaControllerCompat controller = mSession.getController(); + + //mSession.setActive(true); + + mSession.setMetadata(new MediaMetadataCompat.Builder() + .putString(MediaMetadataCompat.METADATA_KEY_ARTIST, "") + .putString(MediaMetadataCompat.METADATA_KEY_TITLE, "") + .build()); + } } diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/podcast/MediaPlayerPlaybackService.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/podcast/MediaPlayerPlaybackService.java index 554ca99e..8962d592 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/podcast/MediaPlayerPlaybackService.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/podcast/MediaPlayerPlaybackService.java @@ -24,7 +24,7 @@ public class MediaPlayerPlaybackService extends PlaybackService { private View parentResizableView; public MediaPlayerPlaybackService(final Context context, PodcastStatusListener podcastStatusListener, MediaItem mediaItem) { - super(context, podcastStatusListener, mediaItem); + super(podcastStatusListener, mediaItem); mMediaPlayer = new MediaPlayer(); mMediaPlayer.setOnErrorListener(new MediaPlayer.OnErrorListener() { diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/podcast/PlaybackService.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/podcast/PlaybackService.java index e0995454..a926e7ac 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/podcast/PlaybackService.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/podcast/PlaybackService.java @@ -1,7 +1,5 @@ package de.luhmer.owncloudnewsreader.services.podcast; -import android.content.Context; - import de.luhmer.owncloudnewsreader.model.MediaItem; /** @@ -22,7 +20,7 @@ public abstract class PlaybackService { private PodcastStatusListener podcastStatusListener; private MediaItem mediaItem; - public PlaybackService(Context context, PodcastStatusListener podcastStatusListener, MediaItem mediaItem) { + public PlaybackService(PodcastStatusListener podcastStatusListener, MediaItem mediaItem) { this.podcastStatusListener = podcastStatusListener; this.mediaItem = mediaItem; } diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/podcast/TTSPlaybackService.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/podcast/TTSPlaybackService.java index 658baf8e..8e328525 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/podcast/TTSPlaybackService.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/podcast/TTSPlaybackService.java @@ -18,7 +18,7 @@ public class TTSPlaybackService extends PlaybackService implements TextToSpeech. private TextToSpeech ttsController; public TTSPlaybackService(Context context, PodcastStatusListener podcastStatusListener, MediaItem mediaItem) { - super(context, podcastStatusListener, mediaItem); + super(podcastStatusListener, mediaItem); try { ttsController = new TextToSpeech(context, this); diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/view/PodcastNotification.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/view/PodcastNotification.java index 9273bd5f..78a10368 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/view/PodcastNotification.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/view/PodcastNotification.java @@ -2,11 +2,7 @@ package de.luhmer.owncloudnewsreader.view; import android.app.Notification; import android.app.NotificationManager; -import android.app.PendingIntent; -import android.content.ComponentName; import android.content.Context; -import android.content.Intent; -import android.media.AudioManager; import android.os.Build; import android.support.v4.app.NotificationCompat; import android.support.v4.media.MediaMetadataCompat; @@ -14,17 +10,12 @@ import android.support.v4.media.session.MediaSessionCompat; import android.support.v4.media.session.PlaybackStateCompat; import android.util.Log; -import com.nostra13.universalimageloader.core.DisplayImageOptions; - import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import java.util.Locale; -import de.luhmer.owncloudnewsreader.R; -import de.luhmer.owncloudnewsreader.events.podcast.TogglePlayerStateEvent; import de.luhmer.owncloudnewsreader.events.podcast.UpdatePodcastStatusEvent; -import de.luhmer.owncloudnewsreader.events.podcast.broadcastreceiver.PodcastNotificationToggle; import de.luhmer.owncloudnewsreader.model.MediaItem; import de.luhmer.owncloudnewsreader.notification.NextcloudNotificationManager; import de.luhmer.owncloudnewsreader.services.PodcastPlaybackService; @@ -41,21 +32,20 @@ public class PodcastNotification { private final Context mContext; private final NotificationManager notificationManager; - private final NotificationCompat.Builder notificationBuilder; + private NotificationCompat.Builder notificationBuilder; private final String CHANNEL_ID = "Podcast Notification"; - //private MediaSessionManager mManager; private MediaSessionCompat mSession; - //private MediaControllerCompat mController; - private int lastDrawableId = -1; - + private PlaybackService.Status lastStatus = PlaybackService.Status.NOT_INITIALIZED; public final static int NOTIFICATION_ID = 1111; - public PodcastNotification(Context context) { + public PodcastNotification(Context context, MediaSessionCompat session) { this.mContext = context; + this.mSession = session; this.notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - this.notificationBuilder = NextcloudNotificationManager.buildPodcastNotification(mContext, CHANNEL_ID); + + this.notificationBuilder = NextcloudNotificationManager.buildPodcastNotification(mContext, CHANNEL_ID, mSession); EventBus.getDefault().register(this); } @@ -66,7 +56,6 @@ public class PodcastNotification { } } - @Subscribe public void onEvent(UpdatePodcastStatusEvent podcast) { if(mSession == null) { @@ -74,12 +63,12 @@ public class PodcastNotification { return; } - int drawableId = podcast.isPlaying() ? android.R.drawable.ic_media_pause : android.R.drawable.ic_media_play; - String actionText = podcast.isPlaying() ? "Pause" : "Play"; - if(lastDrawableId != drawableId) { - lastDrawableId = drawableId; + if (podcast.getStatus() != lastStatus) { + lastStatus = podcast.getStatus(); + + /* notificationBuilder.setContentTitle(podcast.getTitle()); notificationBuilder.mActions.clear(); notificationBuilder.addAction( @@ -88,7 +77,9 @@ public class PodcastNotification { PendingIntent.getBroadcast(mContext, 0, new Intent(mContext, PodcastNotificationToggle.class), PendingIntent.FLAG_ONE_SHOT)); + */ + /* if(podcast.isPlaying()) { //Prevent the Podcast Player from getting killed because of low memory //For more info see: http://developer.android.com/reference/android/app/Service.html#startForeground(int, android.app.Notification) @@ -100,6 +91,7 @@ public class PodcastNotification { notificationBuilder.setOngoing(false); // cancelable } + */ //Lock screen notification /* @@ -108,7 +100,9 @@ public class PodcastNotification { .build()); */ - if(podcast.isPlaying()) { + + mSession.setActive(true); + if (podcast.isPlaying()) { mSession.setPlaybackState(new PlaybackStateCompat.Builder() .setState(PlaybackStateCompat.STATE_PLAYING, podcast.getCurrent(), 1.0f) .setActions(PlaybackStateCompat.ACTION_PAUSE).build()); @@ -117,6 +111,18 @@ public class PodcastNotification { .setState(PlaybackStateCompat.STATE_PAUSED, podcast.getCurrent(), 0.0f) .setActions(PlaybackStateCompat.ACTION_PLAY).build()); } + + //mSession.setActive(podcast.isPlaying()); + + + notificationBuilder = NextcloudNotificationManager.buildPodcastNotification(mContext, CHANNEL_ID, mSession); + + //int drawableId = podcast.isPlaying() ? android.R.drawable.ic_media_pause : android.R.drawable.ic_media_play; + //String actionText = podcast.isPlaying() ? "Pause" : "Play"; + //notificationBuilder.addAction(new NotificationCompat.Action(drawableId, actionText, intent)); + + + notificationManager.notify(NOTIFICATION_ID, notificationBuilder.build()); } @@ -156,76 +162,42 @@ public class PodcastNotification { } public void podcastChanged() { - initMediaSessions(); - } - - private void initMediaSessions() { - String packageName = PodcastNotificationToggle.class.getPackage().getName(); - ComponentName receiver = new ComponentName(packageName, PodcastNotificationToggle.class.getName()); - mSession = new MediaSessionCompat(mContext, "PlayerService", receiver, null); - mSession.setFlags(MediaSessionCompat.FLAG_HANDLES_MEDIA_BUTTONS | - MediaSessionCompat.FLAG_HANDLES_TRANSPORT_CONTROLS); - mSession.setPlaybackState(new PlaybackStateCompat.Builder() - .setState(PlaybackStateCompat.STATE_PAUSED, 0, 0) - .setActions(PlaybackStateCompat.ACTION_PLAY_PAUSE).build()); - - MediaItem podcastItem = ((PodcastPlaybackService)mContext).getCurrentlyPlayingPodcast(); + /* String favIconUrl = podcastItem.favIcon; DisplayImageOptions displayImageOptions = new DisplayImageOptions.Builder(). showImageOnLoading(R.drawable.default_feed_icon_light). showImageForEmptyUri(R.drawable.default_feed_icon_light). showImageOnFail(R.drawable.default_feed_icon_light). build(); + */ //TODO networkOnMainThreadExceptionHere! //Bitmap bmpAlbumArt = ImageLoader.getInstance().loadImageSync(favIconUrl, displayImageOptions); mSession.setMetadata(new MediaMetadataCompat.Builder() - .putString(MediaMetadataCompat.METADATA_KEY_ARTIST, "Test") - .putString(MediaMetadataCompat.METADATA_KEY_ALBUM, "Test") - .putString(MediaMetadataCompat.METADATA_KEY_TITLE, "Test") - //.putString(MediaMetadataCompat.METADATA_KEY_TITLE, podcastItem.title) - .putLong(MediaMetadataCompat.METADATA_KEY_DURATION, 100) - //.putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, bmpAlbumArt) - /* .putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, - BitmapFactory.decodeResource(mContext.getResources(), R.drawable.ic_launcher)) */ + .putString(MediaMetadataCompat.METADATA_KEY_ARTIST, podcastItem.author) + .putString(MediaMetadataCompat.METADATA_KEY_TITLE, podcastItem.title) .build()); - mSession.setCallback(new MediaSessionCallback()); + /* + mSession.setMetadata(new MediaMetadataCompat.Builder() + .putString(MediaMetadataCompat.METADATA_KEY_ARTIST, "NA") + .putString(MediaMetadataCompat.METADATA_KEY_ALBUM, "") + .putString(MediaMetadataCompat.METADATA_KEY_TITLE, "NA") + //.putString(MediaMetadataCompat.METADATA_KEY_TITLE, podcastItem.title) + .putLong(MediaMetadataCompat.METADATA_KEY_DURATION, 100) + //.putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, bmpAlbumArt) + //.putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, BitmapFactory.decodeResource(mContext.getResources(), R.drawable.ic_launcher)) + .build()); + */ - - AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); - audioManager.requestAudioFocus(new AudioManager.OnAudioFocusChangeListener() { - @Override - public void onAudioFocusChange(int focusChange) { - // Ignore - } - }, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN); - - - - //MediaControllerCompat controller = mSession.getController(); - - mSession.setActive(true); + this.notificationBuilder = NextcloudNotificationManager.buildPodcastNotification(mContext, CHANNEL_ID, mSession); + notificationManager.notify(NOTIFICATION_ID, notificationBuilder.build()); } public Notification getNotification() { return notificationBuilder.build(); } - - - private final class MediaSessionCallback extends MediaSessionCompat.Callback { - @Override - public void onPlay() { - EventBus.getDefault().post(new TogglePlayerStateEvent()); - } - - @Override - public void onPause() { - EventBus.getDefault().post(new TogglePlayerStateEvent()); - } - } - } From 003c34bb52fbcdaa95cc994a65a3c76f887653da Mon Sep 17 00:00:00 2001 From: Nextcloud bot Date: Fri, 2 Nov 2018 01:52:26 +0000 Subject: [PATCH 05/10] [tx-robot] updated from transifex --- News-Android-App/src/main/res/values-fr/strings.xml | 8 +++++++- News-Android-App/src/main/res/values-nl/strings.xml | 12 ++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/News-Android-App/src/main/res/values-fr/strings.xml b/News-Android-App/src/main/res/values-fr/strings.xml index cb62e490..752d54fa 100644 --- a/News-Android-App/src/main/res/values-fr/strings.xml +++ b/News-Android-App/src/main/res/values-fr/strings.xml @@ -25,6 +25,8 @@ Télécharger les images + d\'articles + Affichage de la version en cache + Favori Lu @@ -37,6 +39,7 @@ Paramètres de synchronisation Ajouter un nouveau flux Lire à haute voix + Télécharger les articles hors ligne Il y a %d nouvel article non lu Il y a %d nouveaux articles non lus @@ -149,6 +152,9 @@ Aucun podcast sélectionné Aucun chapitre disponible Vitesse de lecture + Téléchargement du podcast + + Affichage Mode nuit @@ -172,7 +178,7 @@ Navigateur intégré Navigateur externe - Miniatures + Vignettes Petit Par défaut diff --git a/News-Android-App/src/main/res/values-nl/strings.xml b/News-Android-App/src/main/res/values-nl/strings.xml index 5a3ad9c5..2824f258 100644 --- a/News-Android-App/src/main/res/values-nl/strings.xml +++ b/News-Android-App/src/main/res/values-nl/strings.xml @@ -25,6 +25,8 @@ Downloaden afbeeldingen Download meer berichten + Tonen van cached versie + Gemarkeerd Lees @@ -37,6 +39,7 @@ Sync Settings Voeg nieuwe feed toe Voorlezen + Download artikels offline U hebt %d nieuw ongelezen bericht Je hebt %d nieuwe ongelezen berichten @@ -149,9 +152,12 @@ Geen podcast geselecteerd Geen hoofdstukken beschikbaar Afspeelsnelheid + Downloaden podcast + + Weergeven - Nochtmodus + Nachtmodus Feed lijst overzicht Fontgrootte Browser @@ -176,6 +182,8 @@ Verkorte tekst Volledige tekst Weblayout + Kaart weergave + Klein Standaard @@ -207,7 +215,7 @@ Fout - het lijkt erop dat je nieuwsapp niet is geïnstalleerd of geactiveerd op je server. Volg eerst de instructies hier om de nieuwsapp op je server te installeren: %1$s + Het lijkt erop dat je nieuwsapp niet is geïnstalleerd of geactiveerd op je server. Volg eerst de instructies hier om de nieuwsapp op je server te installeren: %1$s Er ging iets verkeerd :( De Web News App gaf Versie \"0\". Bekijk alsjeblieft het volgende bug report: https://github.com/nextcloud/news/issues/5#issuecomment-242883795 Deze app versie is niet compatibel met je Nextcloud Nieuws App. Werk de Nieuws App en het Appframework bij. From 3f5940f51e440d7fee85df314bd1fb630418cecf Mon Sep 17 00:00:00 2001 From: David Luhmer Date: Fri, 2 Nov 2018 21:34:32 +0100 Subject: [PATCH 06/10] fix codacy issues --- .../PodcastFragmentActivity.java | 29 ++++++------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/PodcastFragmentActivity.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/PodcastFragmentActivity.java index eed1017e..ac4e824c 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/PodcastFragmentActivity.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/PodcastFragmentActivity.java @@ -76,12 +76,9 @@ public class PodcastFragmentActivity extends AppCompatActivity implements IPlayP private static final String TAG = PodcastFragmentActivity.class.getCanonicalName(); - @Inject - SharedPreferences mPrefs; - @Inject - ApiProvider mApi; - @Inject - public MemorizingTrustManager mMTM; + @Inject protected SharedPreferences mPrefs; + @Inject protected ApiProvider mApi; + @Inject protected MemorizingTrustManager mMTM; private MediaBrowserCompat mMediaBrowser; private EventBus eventBus; @@ -90,9 +87,9 @@ public class PodcastFragmentActivity extends AppCompatActivity implements IPlayP private int appWidth; @BindView(R.id.videoPodcastSurfaceWrapper) - ZoomableRelativeLayout rlVideoPodcastSurfaceWrapper; + protected ZoomableRelativeLayout rlVideoPodcastSurfaceWrapper; @BindView(R.id.sliding_layout) - PodcastSlidingUpPanelLayout sliding_layout; + protected PodcastSlidingUpPanelLayout sliding_layout; //YouTubePlayerFragment youtubeplayerfragment; private boolean currentlyPlaying = false; @@ -275,15 +272,10 @@ public class PodcastFragmentActivity extends AppCompatActivity implements IPlayP MediaControllerCompat.setMediaController(PodcastFragmentActivity.this, mediaController); // Finish building the UI - buildTransportControls(); + //buildTransportControls(); } catch (RemoteException e) { - e.printStackTrace(); - // TODO handle exception + Log.e(TAG, "Connecting to podcast service failed!", e); } - - - - } @Override @@ -299,11 +291,10 @@ public class PodcastFragmentActivity extends AppCompatActivity implements IPlayP } }; + /* private void buildTransportControls() { // Grab the view for the play/pause button - /* - int pbState = MediaControllerCompat.getMediaController(PodcastFragmentActivity.this).getPlaybackState().getState(); if (pbState == PlaybackStateCompat.STATE_PLAYING) { MediaControllerCompat.getMediaController(PodcastFragmentActivity.this).getTransportControls().pause(); @@ -318,8 +309,6 @@ public class PodcastFragmentActivity extends AppCompatActivity implements IPlayP // Register a Callback to stay in sync mediaController.registerCallback(controllerCallback); - */ - } MediaControllerCompat.Callback controllerCallback = @@ -330,7 +319,7 @@ public class PodcastFragmentActivity extends AppCompatActivity implements IPlayP @Override public void onPlaybackStateChanged(PlaybackStateCompat state) {} }; - + */ public PodcastSlidingUpPanelLayout getSlidingLayout() { return sliding_layout; From 783b95d5ffc8c71f7d84d9eb6d818cccef50cdcd Mon Sep 17 00:00:00 2001 From: David Luhmer Date: Fri, 2 Nov 2018 22:26:17 +0100 Subject: [PATCH 07/10] refactoring --- .../java/de/luhmer/owncloudnewsreader/PodcastFragment.java | 5 +++-- .../luhmer/owncloudnewsreader/PodcastFragmentActivity.java | 2 -- .../owncloudnewsreader/services/PodcastPlaybackService.java | 4 ++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/PodcastFragment.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/PodcastFragment.java index bb6a65d7..de73b9ad 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/PodcastFragment.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/PodcastFragment.java @@ -265,10 +265,11 @@ public class PodcastFragment extends Fragment { boolean hasTitleInCache = false; @OnClick(R.id.fl_playPausePodcastWrapper) void playPause() { - if(!hasTitleInCache) + if(!hasTitleInCache) { Toast.makeText(getActivity(), "Please select a title first", Toast.LENGTH_SHORT).show(); - else + } else { eventBus.post(new TogglePlayerStateEvent()); + } } @OnClick(R.id.btn_playPausePodcastSlider) void playPauseSlider() { diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/PodcastFragmentActivity.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/PodcastFragmentActivity.java index ac4e824c..1fc9695e 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/PodcastFragmentActivity.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/PodcastFragmentActivity.java @@ -17,10 +17,8 @@ import android.os.ResultReceiver; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; import android.support.v4.media.MediaBrowserCompat; -import android.support.v4.media.MediaMetadataCompat; import android.support.v4.media.session.MediaControllerCompat; import android.support.v4.media.session.MediaSessionCompat; -import android.support.v4.media.session.PlaybackStateCompat; import android.support.v4.view.GravityCompat; import android.support.v7.app.AppCompatActivity; import android.util.Log; diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/PodcastPlaybackService.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/PodcastPlaybackService.java index 03a12434..bd3706bf 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/PodcastPlaybackService.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/PodcastPlaybackService.java @@ -153,6 +153,7 @@ public class PodcastPlaybackService extends MediaBrowserServiceCompat { mgr.listen(phoneStateListener, PhoneStateListener.LISTEN_NONE); } + mHandler.removeCallbacks(mUpdateTimeTask); podcastNotification.cancel(); super.onDestroy(); @@ -168,6 +169,7 @@ public class PodcastPlaybackService extends MediaBrowserServiceCompat { mPlaybackService.destroy(); mPlaybackService = null; } + mHandler.removeCallbacks(mUpdateTimeTask); if(intent.hasExtra(MEDIA_ITEM)) { MediaItem mediaItem = (MediaItem) intent.getSerializableExtra(MEDIA_ITEM); @@ -226,6 +228,7 @@ public class PodcastPlaybackService extends MediaBrowserServiceCompat { @Subscribe public void onEvent(TogglePlayerStateEvent event) { + Log.d(TAG, "onEvent() called with: event = [" + event + "]"); if(event.getState() == TogglePlayerStateEvent.State.Toggle) { if (isPlaying()) { Log.v(TAG, "calling pause()"); @@ -388,6 +391,7 @@ public class PodcastPlaybackService extends MediaBrowserServiceCompat { // Stop requested (e.g. notification was swiped away) if(keyEvent.getKeyCode() == KEYCODE_MEDIA_STOP) { + pause(); stopSelf(); /* boolean isPlaying = mSession.getController().getPlaybackState().getState() == PlaybackStateCompat.STATE_PLAYING; From 203b805a81bbc4210f8f8d740e576dace7bc6812 Mon Sep 17 00:00:00 2001 From: Nextcloud bot Date: Sat, 3 Nov 2018 01:50:37 +0000 Subject: [PATCH 08/10] [tx-robot] updated from transifex --- News-Android-App/src/main/res/values-es/strings.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/News-Android-App/src/main/res/values-es/strings.xml b/News-Android-App/src/main/res/values-es/strings.xml index f13e28b5..e8ec57e9 100644 --- a/News-Android-App/src/main/res/values-es/strings.xml +++ b/News-Android-App/src/main/res/values-es/strings.xml @@ -25,6 +25,8 @@ Descargar imágenes Descargar más artículos + Mostrando versión en caché + Destacado Leer @@ -37,6 +39,7 @@ Ajustes de sincronización Añadir nueva fuente Recopilar información + Descargar los artículos sin conexión Tienes %d elemento nuevo sin leer Tienes %d elementos nuevos sin leer @@ -149,6 +152,9 @@ Ningún podcast seleccionado No hay capítulos disponibles Velocidad de reproducción + Descargando podcast + + Mostrar Modo Oscuro @@ -172,6 +178,12 @@ Navegador integrado Navegador externo + Miniaturas + Texto sencillo + Texto completo + Disposición web + Vista de tarjetas + Pequeño Por defecto From 282cd875e967d7c566e44c3b9c68e075afa18d67 Mon Sep 17 00:00:00 2001 From: Nextcloud bot Date: Sun, 4 Nov 2018 01:55:22 +0000 Subject: [PATCH 09/10] [tx-robot] updated from transifex --- .../src/main/res/values-ja-rJP/strings.xml | 48 +++++++++++++++++++ .../src/main/res/values-sr/strings.xml | 3 ++ 2 files changed, 51 insertions(+) diff --git a/News-Android-App/src/main/res/values-ja-rJP/strings.xml b/News-Android-App/src/main/res/values-ja-rJP/strings.xml index 2c02cbf0..682cfaea 100644 --- a/News-Android-App/src/main/res/values-ja-rJP/strings.xml +++ b/News-Android-App/src/main/res/values-ja-rJP/strings.xml @@ -26,6 +26,7 @@ 共有 読込 Podcast を再生 + ブラウザで開く 共有 サーバー設定 保存 @@ -101,6 +102,10 @@ 一般 ソート順 + 新 -> 旧 + 旧 -> 新 + + タイトル キャッシュをクリアしています。 キャッシュをクリアしています…しばらくお待ちください。 未同期の変更があります。とにかくキャッシュをリセットしますか? @@ -120,11 +125,38 @@ Podcast が選択されていません チャプターがありません + 再生速度 表示 + ナイトモード フィードリストのレイアウト + フォントサイズ + ブラウザ + + + + + ライト / ダーク(時刻に基づく) + ライト + ダーク + + 内蔵のChromeカスタムタブ + 組み込みブラウザ + 外部ブラウザ + + サムネイル + ウェブレイアウト + カード表示 + + + + デフォルト + + 巨大 + 再生 一時停止 + 再生速度 巻戻し 早送り 展開 @@ -158,4 +190,20 @@ + しない + WiFiのみ + WiFi & モバイル + WiFi接続がない場合は尋ねる + + 5 分 + 15 分 + 30 分 + 45 分 + 1 時間 + 2 時間 + 3 時間 + 6 時間 + 12 時間 + 24 時間 + diff --git a/News-Android-App/src/main/res/values-sr/strings.xml b/News-Android-App/src/main/res/values-sr/strings.xml index a9834ae9..37680522 100644 --- a/News-Android-App/src/main/res/values-sr/strings.xml +++ b/News-Android-App/src/main/res/values-sr/strings.xml @@ -157,6 +157,9 @@ Није изабрана подемисија Нема доступних поглавља Брзина пуштања + Преузимам подкаст + + Приказ Ноћни режим From a2af9f500506dbcf6d4098979c82329d9575eac2 Mon Sep 17 00:00:00 2001 From: Unpublished Date: Sun, 4 Nov 2018 12:58:54 +0100 Subject: [PATCH 10/10] fix build --- .../services/podcast/YoutubePlaybackService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/News-Android-App/src/oss/java/de/luhmer/owncloudnewsreader/services/podcast/YoutubePlaybackService.java b/News-Android-App/src/oss/java/de/luhmer/owncloudnewsreader/services/podcast/YoutubePlaybackService.java index caa53c57..74d338e4 100644 --- a/News-Android-App/src/oss/java/de/luhmer/owncloudnewsreader/services/podcast/YoutubePlaybackService.java +++ b/News-Android-App/src/oss/java/de/luhmer/owncloudnewsreader/services/podcast/YoutubePlaybackService.java @@ -11,7 +11,7 @@ import de.luhmer.owncloudnewsreader.model.MediaItem; public class YoutubePlaybackService extends PlaybackService { public YoutubePlaybackService(Context context, PodcastStatusListener podcastStatusListener, MediaItem mediaItem) { - super(context, podcastStatusListener, mediaItem); + super(podcastStatusListener, mediaItem); setStatus(Status.FAILED); }