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.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 'androidx.core:core-ktx:1.8.0'
|
||||
|
|
@ -91,10 +91,11 @@ dependencies {
|
|||
implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1'
|
||||
implementation 'com.github.QuadFlask:colorpicker:ef73ced217'
|
||||
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.android.volley:volley:1.2.1'
|
||||
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:converter-gson:2.9.0'
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import com.afollestad.materialdialogs.MaterialDialog;
|
|||
import com.dkanada.gramophone.R;
|
||||
import com.dkanada.gramophone.fragments.player.NowPlayingScreen;
|
||||
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 static final String TAG = NowPlayingPreferenceDialog.class.getSimpleName();
|
||||
|
|
@ -34,14 +34,12 @@ public class NowPlayingPreferenceDialog extends DialogFragment implements ViewPa
|
|||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
View view = LayoutInflater.from(getContext()).inflate(R.layout.preference_dialog_now_playing, null);
|
||||
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.addOnPageChangeListener(this);
|
||||
viewPager.setCurrentItem(PreferenceUtil.getInstance(getContext()).getNowPlayingScreen().ordinal());
|
||||
|
||||
pageIndicator.setViewPager(viewPager);
|
||||
pageIndicator.onPageSelected(viewPager.getCurrentItem());
|
||||
|
||||
return new MaterialDialog.Builder(requireActivity())
|
||||
.customView(view, false)
|
||||
|
|
|
|||
|
|
@ -5,21 +5,22 @@ import android.net.Uri;
|
|||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.dkanada.gramophone.R;
|
||||
import com.dkanada.gramophone.model.Song;
|
||||
import com.dkanada.gramophone.util.MusicUtil;
|
||||
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||
import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.PlaybackException;
|
||||
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.EventListener;
|
||||
import com.google.android.exoplayer2.MediaItem;
|
||||
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.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.cache.CacheDataSink;
|
||||
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
|
||||
|
|
@ -46,7 +47,7 @@ public class LocalPlayer implements Playback {
|
|||
private final ExecutorService executorService = Executors.newSingleThreadExecutor();
|
||||
|
||||
@SuppressWarnings("FieldCanBeLocal")
|
||||
private final EventListener eventListener = new EventListener() {
|
||||
private final Player.Listener eventListener = new Player.Listener() {
|
||||
@Override
|
||||
public void onPlayWhenReadyChanged(boolean playWhenReady, int reason) {
|
||||
Log.i(TAG, String.format("onPlayWhenReadyChanged: %b %d", playWhenReady, reason));
|
||||
|
|
@ -72,12 +73,12 @@ public class LocalPlayer implements Playback {
|
|||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerError(ExoPlaybackException error) {
|
||||
public void onPlayerError(PlaybackException error) {
|
||||
Log.i(TAG, String.format("onPlayerError: %s", error.getMessage()));
|
||||
|
||||
exoPlayer.clearMediaItems();
|
||||
|
|
@ -106,7 +107,7 @@ public class LocalPlayer implements Playback {
|
|||
|
||||
long cacheSize = PreferenceUtil.getInstance(context).getMediaCacheSize();
|
||||
LeastRecentlyUsedCacheEvictor recentlyUsedCache = new LeastRecentlyUsedCacheEvictor(cacheSize);
|
||||
ExoDatabaseProvider databaseProvider = new ExoDatabaseProvider(context);
|
||||
StandaloneDatabaseProvider databaseProvider = new StandaloneDatabaseProvider(context);
|
||||
|
||||
File cacheDirectory = new File(PreferenceUtil.getInstance(context).getLocationCache(), "exoplayer");
|
||||
simpleCache = new SimpleCache(cacheDirectory, recentlyUsedCache, databaseProvider);
|
||||
|
|
@ -184,7 +185,7 @@ public class LocalPlayer implements Playback {
|
|||
private DataSource.Factory buildDataSourceFactory() {
|
||||
return () -> new CacheDataSource(
|
||||
simpleCache,
|
||||
new DefaultDataSourceFactory(context, context.getPackageName(), null).createDataSource(),
|
||||
new DefaultDataSource.Factory(context).createDataSource(),
|
||||
new FileDataSource(),
|
||||
new CacheDataSink(simpleCache, 10 * 1024 * 1024),
|
||||
CacheDataSource.FLAG_BLOCK_ON_CACHE,
|
||||
|
|
@ -211,7 +212,7 @@ public class LocalPlayer implements Playback {
|
|||
@SuppressWarnings("ConstantConditions")
|
||||
public boolean isLoading() {
|
||||
MediaItem current = exoPlayer.getCurrentMediaItem();
|
||||
if (current != null && current.playbackProperties.uri.toString().contains("file://")) {
|
||||
if (current != null && current.localConfiguration.uri.toString().contains("file://")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -236,12 +237,12 @@ public class LocalPlayer implements Playback {
|
|||
|
||||
@Override
|
||||
public void previous() {
|
||||
exoPlayer.previous();
|
||||
exoPlayer.seekToPreviousMediaItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void next() {
|
||||
exoPlayer.next();
|
||||
exoPlayer.seekToNextMediaItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -16,17 +16,17 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<com.pixelcan.inkpageindicator.InkPageIndicator
|
||||
<me.relex.circleindicator.CircleIndicator
|
||||
android:id="@+id/page_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="32dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_margin="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:ipi_dotDiameter="8dp"
|
||||
app:ipi_dotGap="8dp"
|
||||
app:ipi_currentPageIndicatorColor="?android:textColorPrimary"
|
||||
app:ipi_pageIndicatorColor="?android:textColorHint" />
|
||||
app:ci_height="8dp"
|
||||
app:ci_width="8dp"
|
||||
app:ci_orientation="horizontal"
|
||||
app:ci_gravity="center" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
|
@ -14,7 +14,7 @@ buildscript {
|
|||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
maven {
|
||||
url 'https://jitpack.io'
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue