simplify service folder structure

This commit is contained in:
dkanada 2021-05-04 00:21:13 +09:00
commit fc6a71b2c0
8 changed files with 15 additions and 14 deletions

View file

@ -74,7 +74,7 @@
android:name=".service.LoginService"
android:enabled="true" />
<receiver android:name=".service.MediaButtonIntentReceiver">
<receiver android:name=".service.receivers.MediaButtonIntentReceiver">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>

View file

@ -43,11 +43,12 @@ import com.dkanada.gramophone.glide.CustomGlideRequest;
import com.dkanada.gramophone.helper.ShuffleHelper;
import com.dkanada.gramophone.model.Playlist;
import com.dkanada.gramophone.model.Song;
import com.dkanada.gramophone.service.notification.PlayingNotification;
import com.dkanada.gramophone.service.notification.PlayingNotificationImpl;
import com.dkanada.gramophone.service.notification.PlayingNotificationImpl24;
import com.dkanada.gramophone.service.notifications.PlayingNotification;
import com.dkanada.gramophone.service.notifications.PlayingNotificationMarshmallow;
import com.dkanada.gramophone.service.notifications.PlayingNotificationNougat;
import com.dkanada.gramophone.service.playback.LocalPlayer;
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.Util;
import com.dkanada.gramophone.views.widgets.AppWidgetAlbum;
@ -539,9 +540,9 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
public void initNotification() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && !PreferenceUtil.getInstance(this).getClassicNotification()) {
playingNotification = new PlayingNotificationImpl24();
playingNotification = new PlayingNotificationNougat();
} else {
playingNotification = new PlayingNotificationImpl();
playingNotification = new PlayingNotificationMarshmallow();
}
playingNotification.init(this);

View file

@ -1,4 +1,4 @@
package com.dkanada.gramophone.service.notification;
package com.dkanada.gramophone.service.notifications;
import android.app.Notification;
import android.app.NotificationChannel;

View file

@ -1,4 +1,4 @@
package com.dkanada.gramophone.service.notification;
package com.dkanada.gramophone.service.notifications;
import android.app.Notification;
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.PreferenceUtil;
public class PlayingNotificationImpl extends PlayingNotification {
public class PlayingNotificationMarshmallow extends PlayingNotification {
private Target<BitmapPaletteWrapper> target;

View file

@ -1,4 +1,4 @@
package com.dkanada.gramophone.service.notification;
package com.dkanada.gramophone.service.notifications;
import android.app.PendingIntent;
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_TOGGLE;
public class PlayingNotificationImpl24 extends PlayingNotification {
public class PlayingNotificationNougat extends PlayingNotification {
@Override
public synchronized void update() {
stopped = false;

View file

@ -7,7 +7,6 @@ import android.widget.Toast;
import com.dkanada.gramophone.R;
import com.dkanada.gramophone.model.Song;
import com.dkanada.gramophone.service.UnknownMediaSourceFactory;
import com.dkanada.gramophone.util.MusicUtil;
import com.dkanada.gramophone.util.PreferenceUtil;
import com.google.android.exoplayer2.ExoPlaybackException;

View file

@ -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.drm.DrmSessionManager

View file

@ -11,7 +11,7 @@
// 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.content.BroadcastReceiver;
@ -27,6 +27,7 @@ import android.view.KeyEvent;
import androidx.core.content.ContextCompat;
import com.dkanada.gramophone.BuildConfig;
import com.dkanada.gramophone.service.MusicService;
/**
* Used to control headset playback.