migrate to maven central and bump exoplayer version
This commit is contained in:
parent
fb3102c06b
commit
02bda4b7dc
5 changed files with 28 additions and 28 deletions
|
|
@ -63,7 +63,7 @@ dependencies {
|
||||||
|
|
||||||
implementation 'com.github.jellyfin.jellyfin-apiclient-java:android:0.7.3'
|
implementation 'com.github.jellyfin.jellyfin-apiclient-java:android:0.7.3'
|
||||||
implementation 'com.github.woltapp:blurhash:f41a23cc50'
|
implementation 'com.github.woltapp:blurhash:f41a23cc50'
|
||||||
implementation 'com.google.android.exoplayer:exoplayer:2.14.2'
|
implementation 'com.google.android.exoplayer:exoplayer:2.16.1'
|
||||||
implementation 'com.google.android.material:material:1.6.1'
|
implementation 'com.google.android.material:material:1.6.1'
|
||||||
|
|
||||||
implementation 'androidx.core:core-ktx:1.8.0'
|
implementation 'androidx.core:core-ktx:1.8.0'
|
||||||
|
|
@ -91,10 +91,11 @@ dependencies {
|
||||||
implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1'
|
implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1'
|
||||||
implementation 'com.github.QuadFlask:colorpicker:ef73ced217'
|
implementation 'com.github.QuadFlask:colorpicker:ef73ced217'
|
||||||
implementation 'com.github.codekidX:storage-chooser:2.0.4.4'
|
implementation 'com.github.codekidX:storage-chooser:2.0.4.4'
|
||||||
implementation 'com.pacioianu.david:ink-page-indicator:1.3.0'
|
implementation 'me.relex:circleindicator:2.1.6'
|
||||||
implementation 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:1.0.0'
|
implementation 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:1.0.0'
|
||||||
|
implementation 'com.android.volley:volley:1.2.1'
|
||||||
implementation 'com.android.support:multidex:1.0.3'
|
implementation 'com.android.support:multidex:1.0.3'
|
||||||
implementation 'com.melegy.redscreenofdeath:red-screen-of-death:0.1.2'
|
implementation 'com.mlegy.redscreenofdeath:red-screen-of-death:0.1.3'
|
||||||
|
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import com.afollestad.materialdialogs.MaterialDialog;
|
||||||
import com.dkanada.gramophone.R;
|
import com.dkanada.gramophone.R;
|
||||||
import com.dkanada.gramophone.fragments.player.NowPlayingScreen;
|
import com.dkanada.gramophone.fragments.player.NowPlayingScreen;
|
||||||
import com.dkanada.gramophone.util.PreferenceUtil;
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
import com.pixelcan.inkpageindicator.InkPageIndicator;
|
import me.relex.circleindicator.CircleIndicator;
|
||||||
|
|
||||||
public class NowPlayingPreferenceDialog extends DialogFragment implements ViewPager.OnPageChangeListener {
|
public class NowPlayingPreferenceDialog extends DialogFragment implements ViewPager.OnPageChangeListener {
|
||||||
public static final String TAG = NowPlayingPreferenceDialog.class.getSimpleName();
|
public static final String TAG = NowPlayingPreferenceDialog.class.getSimpleName();
|
||||||
|
|
@ -34,14 +34,12 @@ public class NowPlayingPreferenceDialog extends DialogFragment implements ViewPa
|
||||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||||
View view = LayoutInflater.from(getContext()).inflate(R.layout.preference_dialog_now_playing, null);
|
View view = LayoutInflater.from(getContext()).inflate(R.layout.preference_dialog_now_playing, null);
|
||||||
ViewPager viewPager = view.findViewById(R.id.now_playing_screen_view_pager);
|
ViewPager viewPager = view.findViewById(R.id.now_playing_screen_view_pager);
|
||||||
InkPageIndicator pageIndicator = view.findViewById(R.id.page_indicator);
|
CircleIndicator pageIndicator = view.findViewById(R.id.page_indicator);
|
||||||
|
|
||||||
viewPager.setAdapter(new NowPlayingScreenAdapter(getContext()));
|
viewPager.setAdapter(new NowPlayingScreenAdapter(getContext()));
|
||||||
viewPager.addOnPageChangeListener(this);
|
viewPager.addOnPageChangeListener(this);
|
||||||
viewPager.setCurrentItem(PreferenceUtil.getInstance(getContext()).getNowPlayingScreen().ordinal());
|
viewPager.setCurrentItem(PreferenceUtil.getInstance(getContext()).getNowPlayingScreen().ordinal());
|
||||||
|
|
||||||
pageIndicator.setViewPager(viewPager);
|
pageIndicator.setViewPager(viewPager);
|
||||||
pageIndicator.onPageSelected(viewPager.getCurrentItem());
|
|
||||||
|
|
||||||
return new MaterialDialog.Builder(requireActivity())
|
return new MaterialDialog.Builder(requireActivity())
|
||||||
.customView(view, false)
|
.customView(view, false)
|
||||||
|
|
|
||||||
|
|
@ -5,21 +5,22 @@ import android.net.Uri;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
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.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.C;
|
import com.google.android.exoplayer2.C;
|
||||||
|
import com.google.android.exoplayer2.PlaybackException;
|
||||||
import com.google.android.exoplayer2.audio.AudioAttributes;
|
import com.google.android.exoplayer2.audio.AudioAttributes;
|
||||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
|
||||||
import com.google.android.exoplayer2.Player;
|
import com.google.android.exoplayer2.Player;
|
||||||
import com.google.android.exoplayer2.Player.EventListener;
|
|
||||||
import com.google.android.exoplayer2.MediaItem;
|
import com.google.android.exoplayer2.MediaItem;
|
||||||
import com.google.android.exoplayer2.SimpleExoPlayer;
|
import com.google.android.exoplayer2.SimpleExoPlayer;
|
||||||
import com.google.android.exoplayer2.database.ExoDatabaseProvider;
|
import com.google.android.exoplayer2.database.StandaloneDatabaseProvider;
|
||||||
import com.google.android.exoplayer2.source.DefaultMediaSourceFactory;
|
import com.google.android.exoplayer2.source.DefaultMediaSourceFactory;
|
||||||
import com.google.android.exoplayer2.upstream.DataSource;
|
import com.google.android.exoplayer2.upstream.DataSource;
|
||||||
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
|
import com.google.android.exoplayer2.upstream.DefaultDataSource;
|
||||||
import com.google.android.exoplayer2.upstream.FileDataSource;
|
import com.google.android.exoplayer2.upstream.FileDataSource;
|
||||||
import com.google.android.exoplayer2.upstream.cache.CacheDataSink;
|
import com.google.android.exoplayer2.upstream.cache.CacheDataSink;
|
||||||
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
|
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
|
||||||
|
|
@ -46,7 +47,7 @@ public class LocalPlayer implements Playback {
|
||||||
private final ExecutorService executorService = Executors.newSingleThreadExecutor();
|
private final ExecutorService executorService = Executors.newSingleThreadExecutor();
|
||||||
|
|
||||||
@SuppressWarnings("FieldCanBeLocal")
|
@SuppressWarnings("FieldCanBeLocal")
|
||||||
private final EventListener eventListener = new EventListener() {
|
private final Player.Listener eventListener = new Player.Listener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPlayWhenReadyChanged(boolean playWhenReady, int reason) {
|
public void onPlayWhenReadyChanged(boolean playWhenReady, int reason) {
|
||||||
Log.i(TAG, String.format("onPlayWhenReadyChanged: %b %d", playWhenReady, reason));
|
Log.i(TAG, String.format("onPlayWhenReadyChanged: %b %d", playWhenReady, reason));
|
||||||
|
|
@ -72,12 +73,12 @@ public class LocalPlayer implements Playback {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPositionDiscontinuity(int reason) {
|
public void onPositionDiscontinuity(@NonNull Player.PositionInfo oldPosition, @NonNull Player.PositionInfo newPosition, int reason) {
|
||||||
Log.i(TAG, String.format("onPositionDiscontinuity: %d", reason));
|
Log.i(TAG, String.format("onPositionDiscontinuity: %d", reason));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerError(ExoPlaybackException error) {
|
public void onPlayerError(PlaybackException error) {
|
||||||
Log.i(TAG, String.format("onPlayerError: %s", error.getMessage()));
|
Log.i(TAG, String.format("onPlayerError: %s", error.getMessage()));
|
||||||
|
|
||||||
exoPlayer.clearMediaItems();
|
exoPlayer.clearMediaItems();
|
||||||
|
|
@ -106,7 +107,7 @@ public class LocalPlayer implements Playback {
|
||||||
|
|
||||||
long cacheSize = PreferenceUtil.getInstance(context).getMediaCacheSize();
|
long cacheSize = PreferenceUtil.getInstance(context).getMediaCacheSize();
|
||||||
LeastRecentlyUsedCacheEvictor recentlyUsedCache = new LeastRecentlyUsedCacheEvictor(cacheSize);
|
LeastRecentlyUsedCacheEvictor recentlyUsedCache = new LeastRecentlyUsedCacheEvictor(cacheSize);
|
||||||
ExoDatabaseProvider databaseProvider = new ExoDatabaseProvider(context);
|
StandaloneDatabaseProvider databaseProvider = new StandaloneDatabaseProvider(context);
|
||||||
|
|
||||||
File cacheDirectory = new File(PreferenceUtil.getInstance(context).getLocationCache(), "exoplayer");
|
File cacheDirectory = new File(PreferenceUtil.getInstance(context).getLocationCache(), "exoplayer");
|
||||||
simpleCache = new SimpleCache(cacheDirectory, recentlyUsedCache, databaseProvider);
|
simpleCache = new SimpleCache(cacheDirectory, recentlyUsedCache, databaseProvider);
|
||||||
|
|
@ -184,7 +185,7 @@ public class LocalPlayer implements Playback {
|
||||||
private DataSource.Factory buildDataSourceFactory() {
|
private DataSource.Factory buildDataSourceFactory() {
|
||||||
return () -> new CacheDataSource(
|
return () -> new CacheDataSource(
|
||||||
simpleCache,
|
simpleCache,
|
||||||
new DefaultDataSourceFactory(context, context.getPackageName(), null).createDataSource(),
|
new DefaultDataSource.Factory(context).createDataSource(),
|
||||||
new FileDataSource(),
|
new FileDataSource(),
|
||||||
new CacheDataSink(simpleCache, 10 * 1024 * 1024),
|
new CacheDataSink(simpleCache, 10 * 1024 * 1024),
|
||||||
CacheDataSource.FLAG_BLOCK_ON_CACHE,
|
CacheDataSource.FLAG_BLOCK_ON_CACHE,
|
||||||
|
|
@ -211,7 +212,7 @@ public class LocalPlayer implements Playback {
|
||||||
@SuppressWarnings("ConstantConditions")
|
@SuppressWarnings("ConstantConditions")
|
||||||
public boolean isLoading() {
|
public boolean isLoading() {
|
||||||
MediaItem current = exoPlayer.getCurrentMediaItem();
|
MediaItem current = exoPlayer.getCurrentMediaItem();
|
||||||
if (current != null && current.playbackProperties.uri.toString().contains("file://")) {
|
if (current != null && current.localConfiguration.uri.toString().contains("file://")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -236,12 +237,12 @@ public class LocalPlayer implements Playback {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void previous() {
|
public void previous() {
|
||||||
exoPlayer.previous();
|
exoPlayer.seekToPreviousMediaItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void next() {
|
public void next() {
|
||||||
exoPlayer.next();
|
exoPlayer.seekToNextMediaItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -16,17 +16,17 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
<com.pixelcan.inkpageindicator.InkPageIndicator
|
<me.relex.circleindicator.CircleIndicator
|
||||||
android:id="@+id/page_indicator"
|
android:id="@+id/page_indicator"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="48dp"
|
||||||
android:layout_margin="32dp"
|
android:layout_margin="16dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:ipi_dotDiameter="8dp"
|
app:ci_height="8dp"
|
||||||
app:ipi_dotGap="8dp"
|
app:ci_width="8dp"
|
||||||
app:ipi_currentPageIndicatorColor="?android:textColorPrimary"
|
app:ci_orientation="horizontal"
|
||||||
app:ipi_pageIndicatorColor="?android:textColorHint" />
|
app:ci_gravity="center" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
@ -14,7 +14,7 @@ buildscript {
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
mavenCentral()
|
||||||
maven {
|
maven {
|
||||||
url 'https://jitpack.io'
|
url 'https://jitpack.io'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue