simplify service folder structure
This commit is contained in:
parent
7eeb9f73f1
commit
fc6a71b2c0
8 changed files with 15 additions and 14 deletions
|
|
@ -74,7 +74,7 @@
|
||||||
android:name=".service.LoginService"
|
android:name=".service.LoginService"
|
||||||
android:enabled="true" />
|
android:enabled="true" />
|
||||||
|
|
||||||
<receiver android:name=".service.MediaButtonIntentReceiver">
|
<receiver android:name=".service.receivers.MediaButtonIntentReceiver">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MEDIA_BUTTON" />
|
<action android:name="android.intent.action.MEDIA_BUTTON" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
|
||||||
|
|
@ -43,11 +43,12 @@ import com.dkanada.gramophone.glide.CustomGlideRequest;
|
||||||
import com.dkanada.gramophone.helper.ShuffleHelper;
|
import com.dkanada.gramophone.helper.ShuffleHelper;
|
||||||
import com.dkanada.gramophone.model.Playlist;
|
import com.dkanada.gramophone.model.Playlist;
|
||||||
import com.dkanada.gramophone.model.Song;
|
import com.dkanada.gramophone.model.Song;
|
||||||
import com.dkanada.gramophone.service.notification.PlayingNotification;
|
import com.dkanada.gramophone.service.notifications.PlayingNotification;
|
||||||
import com.dkanada.gramophone.service.notification.PlayingNotificationImpl;
|
import com.dkanada.gramophone.service.notifications.PlayingNotificationMarshmallow;
|
||||||
import com.dkanada.gramophone.service.notification.PlayingNotificationImpl24;
|
import com.dkanada.gramophone.service.notifications.PlayingNotificationNougat;
|
||||||
import com.dkanada.gramophone.service.playback.LocalPlayer;
|
import com.dkanada.gramophone.service.playback.LocalPlayer;
|
||||||
import com.dkanada.gramophone.service.playback.Playback;
|
import com.dkanada.gramophone.service.playback.Playback;
|
||||||
|
import com.dkanada.gramophone.service.receivers.MediaButtonIntentReceiver;
|
||||||
import com.dkanada.gramophone.util.PreferenceUtil;
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
import com.dkanada.gramophone.util.Util;
|
import com.dkanada.gramophone.util.Util;
|
||||||
import com.dkanada.gramophone.views.widgets.AppWidgetAlbum;
|
import com.dkanada.gramophone.views.widgets.AppWidgetAlbum;
|
||||||
|
|
@ -539,9 +540,9 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
|
||||||
|
|
||||||
public void initNotification() {
|
public void initNotification() {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && !PreferenceUtil.getInstance(this).getClassicNotification()) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && !PreferenceUtil.getInstance(this).getClassicNotification()) {
|
||||||
playingNotification = new PlayingNotificationImpl24();
|
playingNotification = new PlayingNotificationNougat();
|
||||||
} else {
|
} else {
|
||||||
playingNotification = new PlayingNotificationImpl();
|
playingNotification = new PlayingNotificationMarshmallow();
|
||||||
}
|
}
|
||||||
|
|
||||||
playingNotification.init(this);
|
playingNotification.init(this);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.dkanada.gramophone.service.notification;
|
package com.dkanada.gramophone.service.notifications;
|
||||||
|
|
||||||
import android.app.Notification;
|
import android.app.Notification;
|
||||||
import android.app.NotificationChannel;
|
import android.app.NotificationChannel;
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.dkanada.gramophone.service.notification;
|
package com.dkanada.gramophone.service.notifications;
|
||||||
|
|
||||||
import android.app.Notification;
|
import android.app.Notification;
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
|
|
@ -32,7 +32,7 @@ import com.dkanada.gramophone.util.ImageUtil;
|
||||||
import com.dkanada.gramophone.util.ThemeUtil;
|
import com.dkanada.gramophone.util.ThemeUtil;
|
||||||
import com.dkanada.gramophone.util.PreferenceUtil;
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
|
|
||||||
public class PlayingNotificationImpl extends PlayingNotification {
|
public class PlayingNotificationMarshmallow extends PlayingNotification {
|
||||||
|
|
||||||
private Target<BitmapPaletteWrapper> target;
|
private Target<BitmapPaletteWrapper> target;
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.dkanada.gramophone.service.notification;
|
package com.dkanada.gramophone.service.notifications;
|
||||||
|
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
|
|
@ -28,7 +28,7 @@ import static com.dkanada.gramophone.service.MusicService.ACTION_REWIND;
|
||||||
import static com.dkanada.gramophone.service.MusicService.ACTION_SKIP;
|
import static com.dkanada.gramophone.service.MusicService.ACTION_SKIP;
|
||||||
import static com.dkanada.gramophone.service.MusicService.ACTION_TOGGLE;
|
import static com.dkanada.gramophone.service.MusicService.ACTION_TOGGLE;
|
||||||
|
|
||||||
public class PlayingNotificationImpl24 extends PlayingNotification {
|
public class PlayingNotificationNougat extends PlayingNotification {
|
||||||
@Override
|
@Override
|
||||||
public synchronized void update() {
|
public synchronized void update() {
|
||||||
stopped = false;
|
stopped = false;
|
||||||
|
|
@ -7,7 +7,6 @@ import android.widget.Toast;
|
||||||
|
|
||||||
import com.dkanada.gramophone.R;
|
import com.dkanada.gramophone.R;
|
||||||
import com.dkanada.gramophone.model.Song;
|
import com.dkanada.gramophone.model.Song;
|
||||||
import com.dkanada.gramophone.service.UnknownMediaSourceFactory;
|
|
||||||
import com.dkanada.gramophone.util.MusicUtil;
|
import com.dkanada.gramophone.util.MusicUtil;
|
||||||
import com.dkanada.gramophone.util.PreferenceUtil;
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
import com.google.android.exoplayer2.ExoPlaybackException;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.dkanada.gramophone.service
|
package com.dkanada.gramophone.service.playback
|
||||||
|
|
||||||
import com.google.android.exoplayer2.MediaItem
|
import com.google.android.exoplayer2.MediaItem
|
||||||
import com.google.android.exoplayer2.drm.DrmSessionManager
|
import com.google.android.exoplayer2.drm.DrmSessionManager
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
// Modified for Phonograph by Karim Abou Zeid (kabouzeid).
|
// Modified for Phonograph by Karim Abou Zeid (kabouzeid).
|
||||||
|
|
||||||
package com.dkanada.gramophone.service;
|
package com.dkanada.gramophone.service.receivers;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
|
|
@ -27,6 +27,7 @@ import android.view.KeyEvent;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
import com.dkanada.gramophone.BuildConfig;
|
import com.dkanada.gramophone.BuildConfig;
|
||||||
|
import com.dkanada.gramophone.service.MusicService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to control headset playback.
|
* Used to control headset playback.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue