修改logo和占位图
This commit is contained in:
parent
f58d8d8bf3
commit
3aac60e3ca
@ -18,7 +18,7 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
//com.hi.music.player
|
//com.hi.music.player
|
||||||
applicationId = "com.hi.music.player.test"
|
applicationId = "com.hi.music.player.test1"
|
||||||
minSdk = 23
|
minSdk = 23
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = 1
|
versionCode = 1
|
||||||
@ -70,7 +70,7 @@ dependencies {
|
|||||||
implementation("io.reactivex.rxjava2:rxandroid:2.1.1")
|
implementation("io.reactivex.rxjava2:rxandroid:2.1.1")
|
||||||
implementation("com.squareup.okhttp3:logging-interceptor:4.11.0")
|
implementation("com.squareup.okhttp3:logging-interceptor:4.11.0")
|
||||||
|
|
||||||
implementation("androidx.paging:paging-runtime-ktx:3.3.2")
|
// implementation("androidx.paging:paging-runtime-ktx:3.3.2")
|
||||||
|
|
||||||
implementation("com.github.bumptech.glide:glide:4.16.0")
|
implementation("com.github.bumptech.glide:glide:4.16.0")
|
||||||
// kapt("com.github.bumptech.glide:compiler:4.16.0")
|
// kapt("com.github.bumptech.glide:compiler:4.16.0")
|
||||||
@ -92,12 +92,6 @@ dependencies {
|
|||||||
implementation ("androidx.media3:media3-database:1.4.1")
|
implementation ("androidx.media3:media3-database:1.4.1")
|
||||||
//----------media3
|
//----------media3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// implementation ("com.geyifeng.immersionbar:immersionbar:3.2.2")
|
|
||||||
// implementation ("com.geyifeng.immersionbar:immersionbar-components:3.2.2")
|
|
||||||
|
|
||||||
|
|
||||||
//------------------firebase
|
//------------------firebase
|
||||||
implementation(platform("com.google.firebase:firebase-bom:33.1.1"))
|
implementation(platform("com.google.firebase:firebase-bom:33.1.1"))
|
||||||
implementation("com.google.firebase:firebase-crashlytics")
|
implementation("com.google.firebase:firebase-crashlytics")
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
"client_info": {
|
"client_info": {
|
||||||
"mobilesdk_app_id": "1:550960818622:android:96fd4141e43410fb24f1ef",
|
"mobilesdk_app_id": "1:550960818622:android:96fd4141e43410fb24f1ef",
|
||||||
"android_client_info": {
|
"android_client_info": {
|
||||||
"package_name": "com.hi.music.player.test"
|
"package_name": "com.hi.music.player.test1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"oauth_client": [],
|
"oauth_client": [],
|
||||||
|
|||||||
@ -17,9 +17,9 @@
|
|||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||||
android:fullBackupContent="@xml/backup_rules"
|
android:fullBackupContent="@xml/backup_rules"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/im_logo"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:roundIcon="@mipmap/ic_launcher"
|
android:roundIcon="@mipmap/im_logo"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.MusicApp"
|
android:theme="@style/Theme.MusicApp"
|
||||||
tools:targetApi="31">
|
tools:targetApi="31">
|
||||||
|
|||||||
@ -5,11 +5,15 @@ import android.content.Context;
|
|||||||
|
|
||||||
import androidx.annotation.OptIn;
|
import androidx.annotation.OptIn;
|
||||||
import androidx.media3.common.util.UnstableApi;
|
import androidx.media3.common.util.UnstableApi;
|
||||||
|
import androidx.media3.database.StandaloneDatabaseProvider;
|
||||||
|
import androidx.media3.datasource.cache.LeastRecentlyUsedCacheEvictor;
|
||||||
|
import androidx.media3.datasource.cache.SimpleCache;
|
||||||
|
|
||||||
import com.hi.music.player.api.MediaControllerStatusListener;
|
import com.hi.music.player.api.MediaControllerStatusListener;
|
||||||
import com.hi.music.player.firebase.RemoteConfigJava;
|
import com.hi.music.player.firebase.RemoteConfigJava;
|
||||||
import com.hi.music.player.firebase.Sp;
|
import com.hi.music.player.firebase.Sp;
|
||||||
import com.hi.music.player.helper.CommonUtils;
|
import com.hi.music.player.helper.CommonUtils;
|
||||||
|
import com.hi.music.player.media3.MyDownloadService;
|
||||||
import com.hi.music.player.media3.MyMediaControllerManager;
|
import com.hi.music.player.media3.MyMediaControllerManager;
|
||||||
import com.hi.music.player.objectbox.ObjectBoxManager;
|
import com.hi.music.player.objectbox.ObjectBoxManager;
|
||||||
|
|
||||||
@ -38,6 +42,9 @@ public class MusicApplication extends Application {
|
|||||||
Sp.init(this);
|
Sp.init(this);
|
||||||
RemoteConfigJava.getInstance().init(this);
|
RemoteConfigJava.getInstance().init(this);
|
||||||
ObjectBoxManager.init(this);
|
ObjectBoxManager.init(this);
|
||||||
|
|
||||||
|
StandaloneDatabaseProvider databaseProvider = new StandaloneDatabaseProvider(this);
|
||||||
|
MyDownloadService.init(this,databaseProvider);
|
||||||
MyMediaControllerManager.getInstance().init(new MediaControllerStatusListener() {
|
MyMediaControllerManager.getInstance().init(new MediaControllerStatusListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onMediaControllerComplete(boolean isOk) {
|
public void onMediaControllerComplete(boolean isOk) {
|
||||||
|
|||||||
@ -42,7 +42,7 @@ public class AdapterCategory extends BaseAdapter<ResponseCategory, ItemCategoryB
|
|||||||
Glide.with(MusicApplication.myApplication)
|
Glide.with(MusicApplication.myApplication)
|
||||||
.asDrawable()
|
.asDrawable()
|
||||||
.load(responseCategory.getCovert())
|
.load(responseCategory.getCovert())
|
||||||
.placeholder(R.drawable.placeholder)
|
.placeholder(R.mipmap.im_placeholder)
|
||||||
.into(vb.header);
|
.into(vb.header);
|
||||||
vb.tvTitle.setText(responseCategory.getTwoTitle());
|
vb.tvTitle.setText(responseCategory.getTwoTitle());
|
||||||
vb.tvSubtitle.setText(responseCategory.getTwoSubtitle());
|
vb.tvSubtitle.setText(responseCategory.getTwoSubtitle());
|
||||||
|
|||||||
@ -70,7 +70,7 @@ public class AdapterCategoryList extends BaseAdapter<ResponsePlayListInfo, ItemC
|
|||||||
Glide.with(MusicApplication.myApplication)
|
Glide.with(MusicApplication.myApplication)
|
||||||
.asDrawable()
|
.asDrawable()
|
||||||
.load(child.getSmallCovert())
|
.load(child.getSmallCovert())
|
||||||
.placeholder(R.drawable.placeholder)
|
.placeholder(R.mipmap.im_placeholder)
|
||||||
.listener(new RequestListener<Drawable>() {
|
.listener(new RequestListener<Drawable>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
||||||
|
|||||||
@ -48,7 +48,7 @@ public class AdapterDownloadSong extends BaseAdapter<Download, ItemLikeSongBindi
|
|||||||
.asDrawable()
|
.asDrawable()
|
||||||
.load(boxDownloadSong.getCovert())
|
.load(boxDownloadSong.getCovert())
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(4))))
|
.apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(4))))
|
||||||
.placeholder(R.drawable.placeholder)
|
.placeholder(R.mipmap.im_placeholder)
|
||||||
.listener(new RequestListener<Drawable>() {
|
.listener(new RequestListener<Drawable>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
||||||
|
|||||||
@ -36,10 +36,10 @@ public class AdapterHome extends BaseAdapter<ResponseHomeChild, ItemHomeBinding>
|
|||||||
ItemHomeBinding vb = itemHolder.getVb();
|
ItemHomeBinding vb = itemHolder.getVb();
|
||||||
ResponseHomeChild responseHomeChild = data.get(position);
|
ResponseHomeChild responseHomeChild = data.get(position);
|
||||||
vb.headTitle.setText(responseHomeChild.getHeaderTitle());
|
vb.headTitle.setText(responseHomeChild.getHeaderTitle());
|
||||||
CommonUtils.LogMsg("position="+position+"-----------headTitle-=" + responseHomeChild.getHeaderTitle());
|
|
||||||
List<ResponseSingle> singleList = responseHomeChild.getSingleList();
|
List<ResponseSingle> singleList = responseHomeChild.getSingleList();
|
||||||
List<ResponseCategory> categoryList = responseHomeChild.getCategoryList();
|
List<ResponseCategory> categoryList = responseHomeChild.getCategoryList();
|
||||||
|
CommonUtils.LogMsg("position="+position+"-----------headTitle-=" + responseHomeChild.getHeaderTitle()+"--singleList="+singleList+"---categoryList="+categoryList);
|
||||||
if (singleList != null && singleList.size() > 0) {
|
if (singleList != null && singleList.size() > 0) {
|
||||||
vb.recyclerSinger.setVisibility(View.VISIBLE);
|
vb.recyclerSinger.setVisibility(View.VISIBLE);
|
||||||
AdapterSinger adapterSinger = new AdapterSinger();
|
AdapterSinger adapterSinger = new AdapterSinger();
|
||||||
|
|||||||
@ -182,7 +182,7 @@ public class AdapterLikeSong extends BaseAdapter<BoxLikeSong, ItemLikeSongBindin
|
|||||||
.asDrawable()
|
.asDrawable()
|
||||||
.load(boxLikeSong.getCovert())
|
.load(boxLikeSong.getCovert())
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(4))))
|
.apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(4))))
|
||||||
.placeholder(R.drawable.placeholder)
|
.placeholder(R.mipmap.im_placeholder)
|
||||||
.listener(new RequestListener<Drawable>() {
|
.listener(new RequestListener<Drawable>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
||||||
|
|||||||
@ -84,7 +84,7 @@ public class AdapterPlayList extends BaseAdapter<ResponsePlayListInfo, ItemPlayL
|
|||||||
.asDrawable()
|
.asDrawable()
|
||||||
// .apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(10))))
|
// .apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(10))))
|
||||||
.load(covert)
|
.load(covert)
|
||||||
.placeholder(R.drawable.placeholder)
|
.placeholder(R.mipmap.im_placeholder)
|
||||||
.into(vb.imCovert);
|
.into(vb.imCovert);
|
||||||
|
|
||||||
MediaItem currentMediaItem = instance.getCurMediaItem();
|
MediaItem currentMediaItem = instance.getCurMediaItem();
|
||||||
|
|||||||
@ -44,7 +44,7 @@ public class AdapterResultListAlbum extends BaseAdapter<ResponseResultListChild,
|
|||||||
.asDrawable()
|
.asDrawable()
|
||||||
.load(listChild.getThumbnail())
|
.load(listChild.getThumbnail())
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(4))))
|
.apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(4))))
|
||||||
.placeholder(R.drawable.placeholder)
|
.placeholder(R.mipmap.im_placeholder)
|
||||||
.listener(new RequestListener<Drawable>() {
|
.listener(new RequestListener<Drawable>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
||||||
|
|||||||
@ -39,7 +39,7 @@ public class AdapterResultListSong extends BaseAdapter<ResponseResultListChild,
|
|||||||
.asDrawable()
|
.asDrawable()
|
||||||
.load(listChild.getThumbnail())
|
.load(listChild.getThumbnail())
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(4))))
|
.apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(4))))
|
||||||
.placeholder(R.drawable.placeholder)
|
.placeholder(R.mipmap.im_placeholder)
|
||||||
.listener(new RequestListener<Drawable>() {
|
.listener(new RequestListener<Drawable>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
||||||
|
|||||||
@ -41,7 +41,7 @@ public class AdapterSearchChild extends BaseAdapter<ResponseSearchChild, ItemSea
|
|||||||
.asDrawable()
|
.asDrawable()
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(13))))
|
.apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(13))))
|
||||||
.load(responseSearchChild.getSongCovert())
|
.load(responseSearchChild.getSongCovert())
|
||||||
.placeholder(R.drawable.placeholder)
|
.placeholder(R.mipmap.im_placeholder)
|
||||||
.listener(new RequestListener<Drawable>() {
|
.listener(new RequestListener<Drawable>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
||||||
|
|||||||
@ -41,7 +41,7 @@ public class AdapterSinger extends BaseAdapter<ResponseSingle, ItemSingerBinding
|
|||||||
.asDrawable()
|
.asDrawable()
|
||||||
.load(responseSingle.getSingerHead())
|
.load(responseSingle.getSingerHead())
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(4))))
|
.apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(4))))
|
||||||
.placeholder(R.drawable.placeholder)
|
.placeholder(R.mipmap.im_placeholder)
|
||||||
.listener(new RequestListener<Drawable>() {
|
.listener(new RequestListener<Drawable>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
||||||
|
|||||||
@ -57,7 +57,7 @@ public class DialogPlayList extends BaseDialog<DialogPlayListBinding> {
|
|||||||
.asDrawable()
|
.asDrawable()
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(10))))
|
.apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(10))))
|
||||||
.load(artworkUri)
|
.load(artworkUri)
|
||||||
.placeholder(R.drawable.placeholder)
|
.placeholder(R.mipmap.im_placeholder)
|
||||||
.listener(new RequestListener<Drawable>() {
|
.listener(new RequestListener<Drawable>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
||||||
|
|||||||
@ -10,9 +10,9 @@ public class ContextBody {
|
|||||||
private ThirdParty thirdParty = new ThirdParty();
|
private ThirdParty thirdParty = new ThirdParty();
|
||||||
|
|
||||||
|
|
||||||
public ThirdParty getThirdParty() {
|
// public ThirdParty getThirdParty() {
|
||||||
return thirdParty;
|
// return thirdParty;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public Client getClient() {
|
public Client getClient() {
|
||||||
return client;
|
return client;
|
||||||
|
|||||||
@ -41,6 +41,8 @@ public class MyDownloadService extends DownloadService {
|
|||||||
|
|
||||||
private static DownloadManager mDownloadManager;
|
private static DownloadManager mDownloadManager;
|
||||||
|
|
||||||
|
private static SimpleCache downloadCache;
|
||||||
|
|
||||||
public MyDownloadService() {
|
public MyDownloadService() {
|
||||||
super(FOREGROUND_NOTIFICATION_ID,
|
super(FOREGROUND_NOTIFICATION_ID,
|
||||||
DEFAULT_FOREGROUND_NOTIFICATION_UPDATE_INTERVAL,
|
DEFAULT_FOREGROUND_NOTIFICATION_UPDATE_INTERVAL,
|
||||||
@ -50,9 +52,13 @@ public class MyDownloadService extends DownloadService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static SimpleCache getDownloadCache() {
|
||||||
|
return downloadCache;
|
||||||
|
}
|
||||||
|
|
||||||
public static void init(Context context, StandaloneDatabaseProvider databaseProvider) {
|
public static void init(Context context, StandaloneDatabaseProvider databaseProvider) {
|
||||||
if (mDownloadManager == null) {
|
if (mDownloadManager == null) {
|
||||||
SimpleCache downloadCache = MyDownloadCacheManager.getMyCache(databaseProvider);
|
downloadCache = MyDownloadCacheManager.getMyCache(databaseProvider);
|
||||||
DefaultHttpDataSource.Factory factory = new DefaultHttpDataSource.Factory();
|
DefaultHttpDataSource.Factory factory = new DefaultHttpDataSource.Factory();
|
||||||
Executor downloadExecutor = Runnable::run;
|
Executor downloadExecutor = Runnable::run;
|
||||||
|
|
||||||
|
|||||||
@ -244,7 +244,7 @@ public class MyMediaControllerManager {
|
|||||||
MediaItem.Builder builder = mediaItemAt.buildUpon();
|
MediaItem.Builder builder = mediaItemAt.buildUpon();
|
||||||
builder.setMediaId(playUrl.getVideoId());
|
builder.setMediaId(playUrl.getVideoId());
|
||||||
builder.setUri(playUrl.getVideoUrlMedium());
|
builder.setUri(playUrl.getVideoUrlMedium());
|
||||||
builder.setCustomCacheKey(playUrl.getVideoUrlMedium());
|
// builder.setCustomCacheKey(playUrl.getVideoUrlMedium());
|
||||||
//针对于,已经从分类合集列表页面进入播放页面的数据(只有小的封面图)
|
//针对于,已经从分类合集列表页面进入播放页面的数据(只有小的封面图)
|
||||||
if (mediaItemAt.mediaMetadata.artworkUri == null) {
|
if (mediaItemAt.mediaMetadata.artworkUri == null) {
|
||||||
MediaMetadata.Builder builder1 = mediaItemAt.mediaMetadata.buildUpon();
|
MediaMetadata.Builder builder1 = mediaItemAt.mediaMetadata.buildUpon();
|
||||||
|
|||||||
@ -25,7 +25,7 @@ public class MyPlayCacheManager {
|
|||||||
long maxCacheSize = 100 * 1024 * 1024; // 缓存大小 100MB
|
long maxCacheSize = 100 * 1024 * 1024; // 缓存大小 100MB
|
||||||
StandaloneDatabaseProvider databaseProvider = new StandaloneDatabaseProvider(context);
|
StandaloneDatabaseProvider databaseProvider = new StandaloneDatabaseProvider(context);
|
||||||
playCache = new SimpleCache(cacheDir, new LeastRecentlyUsedCacheEvictor(maxCacheSize), databaseProvider);
|
playCache = new SimpleCache(cacheDir, new LeastRecentlyUsedCacheEvictor(maxCacheSize), databaseProvider);
|
||||||
MyDownloadService.init(context,databaseProvider);
|
// MyDownloadService.init(context,databaseProvider);
|
||||||
}
|
}
|
||||||
return playCache;
|
return playCache;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,9 +12,11 @@ import androidx.media3.common.util.UnstableApi;
|
|||||||
import androidx.media3.datasource.DataSource;
|
import androidx.media3.datasource.DataSource;
|
||||||
import androidx.media3.datasource.DataSpec;
|
import androidx.media3.datasource.DataSpec;
|
||||||
import androidx.media3.datasource.DefaultDataSource;
|
import androidx.media3.datasource.DefaultDataSource;
|
||||||
|
import androidx.media3.datasource.DefaultHttpDataSource;
|
||||||
import androidx.media3.datasource.ResolvingDataSource;
|
import androidx.media3.datasource.ResolvingDataSource;
|
||||||
import androidx.media3.datasource.TransferListener;
|
import androidx.media3.datasource.TransferListener;
|
||||||
import androidx.media3.datasource.cache.CacheDataSource;
|
import androidx.media3.datasource.cache.CacheDataSource;
|
||||||
|
import androidx.media3.datasource.cache.SimpleCache;
|
||||||
import androidx.media3.exoplayer.DefaultLoadControl;
|
import androidx.media3.exoplayer.DefaultLoadControl;
|
||||||
import androidx.media3.exoplayer.ExoPlayer;
|
import androidx.media3.exoplayer.ExoPlayer;
|
||||||
|
|
||||||
@ -26,17 +28,21 @@ import androidx.media3.session.MediaSessionService;
|
|||||||
|
|
||||||
import com.hi.music.player.helper.CommonUtils;
|
import com.hi.music.player.helper.CommonUtils;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
public class PlaybackService extends MediaSessionService {
|
public class PlaybackService extends MediaSessionService {
|
||||||
private MediaSession mediaSession = null;
|
private MediaSession mediaSession = null;
|
||||||
private ExoPlayer player;
|
private ExoPlayer player;
|
||||||
|
|
||||||
|
private SimpleCache playCache, downloadCache;
|
||||||
|
|
||||||
@OptIn(markerClass = UnstableApi.class)
|
@OptIn(markerClass = UnstableApi.class)
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
|
|
||||||
DynamicMediaSourceFactory customMediaSourceFactory = new DynamicMediaSourceFactory(getCacheDataSourceFactory(this));
|
DynamicMediaSourceFactory customMediaSourceFactory = new DynamicMediaSourceFactory(getCacheDataSourceFactory(this));
|
||||||
DefaultMediaSourceFactory defaultMediaSourceFactory1 = new DefaultMediaSourceFactory(getUrlFactory());
|
ProgressiveMediaSource.Factory factory = new ProgressiveMediaSource.Factory(getUrlFactory());
|
||||||
|
|
||||||
|
|
||||||
// 创建 DefaultLoadControl,配置缓冲参数
|
// 创建 DefaultLoadControl,配置缓冲参数
|
||||||
@ -53,7 +59,7 @@ public class PlaybackService extends MediaSessionService {
|
|||||||
CacheDataSource dataSource = cacheDataSourceFactory.createDataSource();
|
CacheDataSource dataSource = cacheDataSourceFactory.createDataSource();
|
||||||
|
|
||||||
player = new ExoPlayer.Builder(this)
|
player = new ExoPlayer.Builder(this)
|
||||||
.setMediaSourceFactory(mediaSourceFactory)
|
.setMediaSourceFactory(factory)
|
||||||
.setLoadControl(loadControl)
|
.setLoadControl(loadControl)
|
||||||
.build();
|
.build();
|
||||||
mediaSession = new MediaSession.Builder(this, player)
|
mediaSession = new MediaSession.Builder(this, player)
|
||||||
@ -66,26 +72,77 @@ public class PlaybackService extends MediaSessionService {
|
|||||||
@OptIn(markerClass = UnstableApi.class)
|
@OptIn(markerClass = UnstableApi.class)
|
||||||
private CacheDataSource.Factory getCacheDataSourceFactory(Context context) {
|
private CacheDataSource.Factory getCacheDataSourceFactory(Context context) {
|
||||||
DefaultDataSource.Factory factory = new DefaultDataSource.Factory(this);
|
DefaultDataSource.Factory factory = new DefaultDataSource.Factory(this);
|
||||||
|
playCache = MyPlayCacheManager.getInitPlayCache(context);
|
||||||
|
CacheDataSource.Factory factory1 = new CacheDataSource.Factory().setCache(playCache)
|
||||||
|
.setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory()
|
||||||
|
.setConnectTimeoutMs(16000)
|
||||||
|
.setReadTimeoutMs(8000)
|
||||||
|
.setUserAgent("Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0"))
|
||||||
|
.setEventListener(new CacheDataSource.EventListener() {
|
||||||
|
@Override
|
||||||
|
public void onCachedBytesRead(long cacheSizeBytes, long cachedBytesRead) {
|
||||||
|
CommonUtils.LogMsg("-----------缓存2 -PlayCache-" + cacheSizeBytes + "----cacheSizeBytes=" + cachedBytesRead);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCacheIgnored(int reason) {
|
||||||
|
CommonUtils.LogMsg("-----------缓存2忽略 PlayCache=" + reason);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
downloadCache = MyDownloadService.getDownloadCache();
|
||||||
return new CacheDataSource.Factory()
|
return new CacheDataSource.Factory()
|
||||||
.setCache(MyPlayCacheManager.getInitPlayCache(context))
|
.setCache(downloadCache)
|
||||||
.setUpstreamDataSourceFactory(factory)
|
.setUpstreamDataSourceFactory(factory1)
|
||||||
.setFlags(CacheDataSource.FLAG_BLOCK_ON_CACHE | CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR);
|
.setFlags(CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR)
|
||||||
|
.setEventListener(new CacheDataSource.EventListener() {
|
||||||
|
@Override
|
||||||
|
public void onCachedBytesRead(long cacheSizeBytes, long cachedBytesRead) {
|
||||||
|
CommonUtils.LogMsg("-----------缓存1 DownloadCache --" + cacheSizeBytes + "----cacheSizeBytes=" + cachedBytesRead);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCacheIgnored(int reason) {
|
||||||
|
CommonUtils.LogMsg("-----------缓存1忽略DownloadCache =" + reason);
|
||||||
|
}
|
||||||
|
});
|
||||||
// .setFlags(CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR);
|
// .setFlags(CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@OptIn(markerClass = UnstableApi.class)
|
@OptIn(markerClass = UnstableApi.class)
|
||||||
private DataSource.Factory getUrlFactory() {
|
private DataSource.Factory getUrlFactory() {
|
||||||
CommonUtils.LogMsg("--------getUrlFactory");
|
long chunkLength = 512 * 1024L;
|
||||||
return new ResolvingDataSource.Factory(getCacheDataSourceFactory(this), new ResolvingDataSource.Resolver() {
|
return new ResolvingDataSource.Factory(getCacheDataSourceFactory(this), new ResolvingDataSource.Resolver() {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataSpec resolveDataSpec(DataSpec dataSpec) {
|
public DataSpec resolveDataSpec(DataSpec dataSpec) {
|
||||||
|
CommonUtils.LogMsg("--------resolveDataSpec dataSpec.key=" + dataSpec.key+"---dataSpec.uri="+dataSpec.uri);
|
||||||
|
return dataSpec;
|
||||||
|
|
||||||
CommonUtils.LogMsg("--------resolveDataSpec=" + dataSpec.key);
|
// long length = 1L;
|
||||||
|
// String videoId = dataSpec.key;
|
||||||
|
// long position = dataSpec.position;
|
||||||
|
// if (dataSpec.length >= 0) {
|
||||||
|
// length = dataSpec.length;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (downloadCache.isCached(videoId,position,length)){
|
||||||
|
// CommonUtils.LogMsg("--------resolveDataSpec downloadCache" );
|
||||||
|
// return dataSpec;
|
||||||
|
// }else if(playCache.isCached(videoId,position,chunkLength)){
|
||||||
|
// CommonUtils.LogMsg("--------resolveDataSpec playCache" );
|
||||||
|
// return dataSpec;
|
||||||
|
// }else {
|
||||||
|
// CommonUtils.LogMsg("--------resolveDataSpec uri" );
|
||||||
|
// return dataSpec;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
String string = "https://rr5---sn-ab5sznzy.googlevideo.com//videoplayback?expire=1730814877&ei=PM8pZ_37PL6b2_gP1LeTsQY&ip=146.19.167.8&id=o-AOdAohYUdM95I2jXmxqV5-JBeVgnMYAS3AKn2fsaiz72&itag=18&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1730793277%2C&mh=Od&mm=31%2C29&mn=sn-ab5sznzy%2Csn-tt1e7nls&ms=au%2Crdu&mv=m&mvi=5&pl=24&rms=au%2Cau&gcr=us&initcwndbps=7066250&vprv=1&svpuc=1&xtags=heaudio%3Dtrue&mime=video%2Fmp4&rqh=1&cnr=14&ratebypass=yes&dur=181.394&lmt=1711913129189608&mt=1730792707&fvip=2&fexp=51312688%2C51326932&c=ANDROID&txp=4538434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cgcr%2Cvprv%2Csvpuc%2Cxtags%2Cmime%2Crqh%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AJfQdSswRgIhAMmdioipTMb9rGt1ZIzbhTPL0yWZGnuorRv7jOS9THllAiEAnkSJJhOkXt3SdMYmeNuRMEosaJl2H00SQxORzbbGRP4%3D&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=ACJ0pHgwRQIhANId6hdBj5z2g7IWnbCdzQ6MyYO_wit31Zaxh3VWahe7AiAIlubSJiPZP4deLNaBQ8eyT12Zf7nPkJ_ZZYBHeFf9XA%3D%3D";
|
@Override
|
||||||
return dataSpec.withUri(Uri.parse(dataSpec.key));
|
public Uri resolveReportedUri(Uri uri) {
|
||||||
|
CommonUtils.LogMsg("--------resolveDataSpec uri=" + uri);
|
||||||
|
return ResolvingDataSource.Resolver.super.resolveReportedUri(Uri.parse("---"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -768,7 +768,7 @@ public class JsonHelper {
|
|||||||
|
|
||||||
//模块标题
|
//模块标题
|
||||||
String title = getJsonTitle(musicCarouselShelfRenderer.getJSONObject("header").getJSONObject("musicCarouselShelfBasicHeaderRenderer").getJSONObject("title"), 0);
|
String title = getJsonTitle(musicCarouselShelfRenderer.getJSONObject("header").getJSONObject("musicCarouselShelfBasicHeaderRenderer").getJSONObject("title"), 0);
|
||||||
CommonUtils.LogMsg("----------模块标题=" + title);
|
|
||||||
responseHomeChild.setHeaderTitle(title);
|
responseHomeChild.setHeaderTitle(title);
|
||||||
JSONArray childContents = musicCarouselShelfRenderer.getJSONArray("contents");
|
JSONArray childContents = musicCarouselShelfRenderer.getJSONArray("contents");
|
||||||
|
|
||||||
@ -900,9 +900,11 @@ public class JsonHelper {
|
|||||||
}
|
}
|
||||||
responseHomeChild.setCategoryList(categoryList);
|
responseHomeChild.setCategoryList(categoryList);
|
||||||
responseHomeChild.setSingleList(singleList);
|
responseHomeChild.setSingleList(singleList);
|
||||||
}
|
|
||||||
childList.add(responseHomeChild);
|
childList.add(responseHomeChild);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
responseHome.setChildList(childList);
|
responseHome.setChildList(childList);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -43,11 +43,6 @@ public class RetrofitManager {
|
|||||||
|
|
||||||
musicApi = getRetrofit().create(MusicApi.class);
|
musicApi = getRetrofit().create(MusicApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// public <T> T getService(Class<T> cls){
|
|
||||||
// return getRetrofit().create(cls);
|
|
||||||
// }
|
|
||||||
private synchronized Retrofit getRetrofit() {
|
private synchronized Retrofit getRetrofit() {
|
||||||
if (retrofit == null) {
|
if (retrofit == null) {
|
||||||
long DEFAULT_TIMEOUT = 5;
|
long DEFAULT_TIMEOUT = 5;
|
||||||
@ -141,7 +136,7 @@ public class RetrofitManager {
|
|||||||
String visitorData = MusicApplication.getVisitorData();
|
String visitorData = MusicApplication.getVisitorData();
|
||||||
// client.setVisitorData("CgtWN1RXaURPN3LNZyiZK9e4BjIKCgJVUXIEGgAgPW%3D%3D");
|
// client.setVisitorData("CgtWN1RXaURPN3LNZyiZK9e4BjIKCgJVUXIEGgAgPW%3D%3D");
|
||||||
client.setVisitorData(visitorData);
|
client.setVisitorData(visitorData);
|
||||||
bodyPlay.getContext().getThirdParty().setEmbedUrl("https://www.youtube.com/watch?v="+videoId);
|
// bodyPlay.getContext().getThirdParty().setEmbedUrl("https://www.youtube.com/watch?v="+videoId);
|
||||||
|
|
||||||
|
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
|
|||||||
@ -167,6 +167,7 @@ public abstract class BaseActivity<T extends ViewBinding> extends AppCompatActiv
|
|||||||
CommonUtils.LogMsg("----------artworkUri="+artworkUri.toString());
|
CommonUtils.LogMsg("----------artworkUri="+artworkUri.toString());
|
||||||
Glide.with(MusicApplication.myApplication)
|
Glide.with(MusicApplication.myApplication)
|
||||||
.load(artworkUri.toString())
|
.load(artworkUri.toString())
|
||||||
|
.placeholder(R.mipmap.im_placeholder)
|
||||||
.transform(new CircleCrop())
|
.transform(new CircleCrop())
|
||||||
.into(panelVb.image);
|
.into(panelVb.image);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -208,7 +208,7 @@ public class CategoryListActivity extends BaseActivity<ActivityCategoryListBindi
|
|||||||
.asDrawable()
|
.asDrawable()
|
||||||
// .apply(bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(10))))
|
// .apply(bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(10))))
|
||||||
.load(url)
|
.load(url)
|
||||||
.placeholder(R.drawable.placeholder)
|
.placeholder(R.mipmap.im_placeholder)
|
||||||
.listener(new RequestListener<Drawable>() {
|
.listener(new RequestListener<Drawable>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
||||||
|
|||||||
@ -461,7 +461,7 @@ public class PlayActivity extends BaseActivity<ActivityPlayBinding> implements S
|
|||||||
Glide.with(MusicApplication.myApplication)
|
Glide.with(MusicApplication.myApplication)
|
||||||
.asDrawable()
|
.asDrawable()
|
||||||
.load(url)
|
.load(url)
|
||||||
.placeholder(R.drawable.placeholder)
|
.placeholder(R.mipmap.im_placeholder)
|
||||||
.listener(new RequestListener<Drawable>() {
|
.listener(new RequestListener<Drawable>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
||||||
@ -758,7 +758,7 @@ public class PlayActivity extends BaseActivity<ActivityPlayBinding> implements S
|
|||||||
.asDrawable()
|
.asDrawable()
|
||||||
// .apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(10))))
|
// .apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(10))))
|
||||||
.load(artworkUri)
|
.load(artworkUri)
|
||||||
.placeholder(R.drawable.placeholder)
|
.placeholder(R.mipmap.im_placeholder)
|
||||||
.listener(new RequestListener<Drawable>() {
|
.listener(new RequestListener<Drawable>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
||||||
|
|||||||
@ -64,7 +64,7 @@ public class ResultListActivity extends BaseActivity<ActivityResultListBinding>
|
|||||||
.asDrawable()
|
.asDrawable()
|
||||||
.load(result.getMainCovert())
|
.load(result.getMainCovert())
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(4))))
|
.apply(RequestOptions.bitmapTransform(new RoundedCorners(CommonUtils.dpToPx(4))))
|
||||||
.placeholder(R.drawable.placeholder)
|
.placeholder(R.mipmap.im_placeholder)
|
||||||
.listener(new RequestListener<Drawable>() {
|
.listener(new RequestListener<Drawable>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.hi.music.player.ui.fragmnt;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.RestrictionsManager;
|
import android.content.RestrictionsManager;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
@ -71,7 +72,13 @@ public class HomeFragment extends BaseFragment<FragmentHomeBinding> implements H
|
|||||||
vmHome = getFragmentScopeViewModel(VMHome.class);
|
vmHome = getFragmentScopeViewModel(VMHome.class);
|
||||||
adapterHome.addLoadingFooter();
|
adapterHome.addLoadingFooter();
|
||||||
vmHome.getHome();
|
vmHome.getHome();
|
||||||
|
Vb.tvRetry.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
adapterHome.addLoadingFooter();
|
||||||
|
vmHome.getHome();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
vmHome.data.observe(getViewLifecycleOwner(), new Observer<ResponseHome>() {
|
vmHome.data.observe(getViewLifecycleOwner(), new Observer<ResponseHome>() {
|
||||||
@Override
|
@Override
|
||||||
@ -79,27 +86,15 @@ public class HomeFragment extends BaseFragment<FragmentHomeBinding> implements H
|
|||||||
if (responseHome == null) {
|
if (responseHome == null) {
|
||||||
adapterHome.removeLoadingFooter();
|
adapterHome.removeLoadingFooter();
|
||||||
requestCount--;
|
requestCount--;
|
||||||
|
if(requestCount == 0){
|
||||||
|
Vb.layoutError.setVisibility(View.VISIBLE);
|
||||||
|
Vb.recyclerSongOfTheDay.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Vb.layoutError.setVisibility(View.GONE);
|
||||||
|
Vb.recyclerSongOfTheDay.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
Glide.with(requireContext())
|
|
||||||
.asDrawable()
|
|
||||||
.load(responseHome.getBackgroundUrl())
|
|
||||||
.placeholder(R.drawable.placeholder)
|
|
||||||
.error(R.drawable.placeholder)
|
|
||||||
.listener(new RequestListener<Drawable>() {
|
|
||||||
@Override
|
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onResourceReady(@NonNull Drawable resource, @NonNull Object model, Target<Drawable> target, @NonNull DataSource dataSource, boolean isFirstResource) {
|
|
||||||
// Vb.linearLayout.setBackground(resource);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.preload();
|
|
||||||
List<ResponseHomeChild> childList1 = responseHome.getChildList();
|
List<ResponseHomeChild> childList1 = responseHome.getChildList();
|
||||||
if (childList1 == null) return;
|
if (childList1 == null) return;
|
||||||
childList.addAll(childList1);
|
childList.addAll(childList1);
|
||||||
@ -159,13 +154,6 @@ public class HomeFragment extends BaseFragment<FragmentHomeBinding> implements H
|
|||||||
intent.putExtra(MyValue.KEY_ENTER_SOURCE, MyValue.TYPE_ENTER_SOURCE_MV);
|
intent.putExtra(MyValue.KEY_ENTER_SOURCE, MyValue.TYPE_ENTER_SOURCE_MV);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
// else if (pageType.equals(MyValue.PAGE_TYPE_ALBUM)) {
|
|
||||||
// Intent intent = new Intent(activity, CategoryListActivity.class);
|
|
||||||
// intent.putExtra(MyValue.KEY_CATEGORY_LIST_TYPE, pageType);
|
|
||||||
// intent.putExtra(MyValue.KEY_CATEGORY_LIST_SINGER_NAME, twoSubtitle);
|
|
||||||
// intent.putExtra(MyValue.KEY_CATEGORY_LIST_BROWSER_ID, browseId);
|
|
||||||
// startActivity(intent);
|
|
||||||
// }
|
|
||||||
else {
|
else {
|
||||||
Intent intent = new Intent(activity, CategoryListActivity.class);
|
Intent intent = new Intent(activity, CategoryListActivity.class);
|
||||||
intent.putExtra(MyValue.KEY_CATEGORY_LIST_TYPE, pageType);
|
intent.putExtra(MyValue.KEY_CATEGORY_LIST_TYPE, pageType);
|
||||||
|
|||||||
@ -64,8 +64,8 @@ public class ProfileFragment extends BaseFragment<FragmentProfileBinding> implem
|
|||||||
Glide.with(requireContext())
|
Glide.with(requireContext())
|
||||||
.asDrawable()
|
.asDrawable()
|
||||||
.load(boxLikeSong.getCovert())
|
.load(boxLikeSong.getCovert())
|
||||||
.placeholder(R.drawable.placeholder)
|
.placeholder(R.mipmap.im_placeholder)
|
||||||
.error(R.drawable.placeholder)
|
.error(R.mipmap.im_placeholder)
|
||||||
.into(Vb.likeCovert);
|
.into(Vb.likeCovert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -87,8 +87,8 @@ public class ProfileFragment extends BaseFragment<FragmentProfileBinding> implem
|
|||||||
Glide.with(requireContext())
|
Glide.with(requireContext())
|
||||||
.asDrawable()
|
.asDrawable()
|
||||||
.load(boxDownloadSong.getCovert())
|
.load(boxDownloadSong.getCovert())
|
||||||
.placeholder(R.drawable.placeholder)
|
.placeholder(R.mipmap.im_placeholder)
|
||||||
.error(R.drawable.placeholder)
|
.error(R.mipmap.im_placeholder)
|
||||||
.into(Vb.downloadCovert);
|
.into(Vb.downloadCovert);
|
||||||
} else {
|
} else {
|
||||||
Vb.downloadCovert.setVisibility(View.GONE);
|
Vb.downloadCovert.setVisibility(View.GONE);
|
||||||
|
|||||||
@ -107,16 +107,22 @@ public class SearchFragment extends BaseFragment<FragmentSearchBinding> implemen
|
|||||||
vmSearch.result.observe(getViewLifecycleOwner(), new Observer<List<ResponseSearch>>() {
|
vmSearch.result.observe(getViewLifecycleOwner(), new Observer<List<ResponseSearch>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onChanged(List<ResponseSearch> responseSearches) {
|
public void onChanged(List<ResponseSearch> responseSearches) {
|
||||||
|
Vb.pbloading.setVisibility(View.GONE);
|
||||||
if(responseSearches == null){
|
if(responseSearches == null){
|
||||||
|
Vb.recyclerResult.setVisibility(View.GONE);
|
||||||
|
Vb.layoutError.setVisibility(View.VISIBLE);
|
||||||
CommonUtils.LogMsg("------------更新结果 null");
|
CommonUtils.LogMsg("------------更新结果 null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Vb.recyclerResult.setVisibility(View.VISIBLE);
|
||||||
|
Vb.layoutError.setVisibility(View.GONE);
|
||||||
adapterSearch.setData(responseSearches);
|
adapterSearch.setData(responseSearches);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startQuery(String query){
|
private void startQuery(String query){
|
||||||
|
Vb.pbloading.setVisibility(View.VISIBLE);
|
||||||
Vb.recyclerSuggestion.setVisibility(View.GONE);
|
Vb.recyclerSuggestion.setVisibility(View.GONE);
|
||||||
Vb.recyclerResult.setVisibility(View.VISIBLE);
|
Vb.recyclerResult.setVisibility(View.VISIBLE);
|
||||||
vmSearch.getSearchResult(query);
|
vmSearch.getSearchResult(query);
|
||||||
|
|||||||
@ -1,61 +0,0 @@
|
|||||||
package com.hi.music.player.ui.paging;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.paging.PagingSource;
|
|
||||||
import androidx.paging.PagingState;
|
|
||||||
|
|
||||||
import com.hi.music.player.api.RequestListener;
|
|
||||||
import com.hi.music.player.helper.CommonUtils;
|
|
||||||
import com.hi.music.player.javabean.response.ResponseHome;
|
|
||||||
import com.hi.music.player.network.JsonHelper;
|
|
||||||
import com.hi.music.player.network.RetrofitManager;
|
|
||||||
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import io.reactivex.Single;
|
|
||||||
import kotlin.coroutines.Continuation;
|
|
||||||
import okhttp3.ResponseBody;
|
|
||||||
|
|
||||||
public class MyPagingSource extends PagingSource<Integer, ResponseHome> {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public Integer getRefreshKey(@NonNull PagingState<Integer, ResponseHome> pagingState) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public Object load(@NonNull LoadParams<Integer> loadParams, @NonNull Continuation<? super PagingSource.LoadResult<Integer, ResponseHome>> continuation) {
|
|
||||||
int nextPage = 1;
|
|
||||||
Integer key = loadParams.getKey();
|
|
||||||
if (key != null) {
|
|
||||||
nextPage = key + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// try {
|
|
||||||
// // 使用 Single 来处理异步请求
|
|
||||||
//
|
|
||||||
// List<ResponseHome> result = Single.<List<ResponseHome>>create(emitter -> {
|
|
||||||
// RetrofitManager.getInstance().getHomeData();
|
|
||||||
// })
|
|
||||||
// .blockingGet(); // 阻塞获取结果
|
|
||||||
//
|
|
||||||
// return new LoadResult.Page<>(
|
|
||||||
// result,
|
|
||||||
// page == 1 ? null : page - 1,
|
|
||||||
// result.isEmpty() ? null : page + 1
|
|
||||||
// );
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// return new LoadResult.Error<>(e);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -60,7 +60,7 @@
|
|||||||
android:layout_width="48dp"
|
android:layout_width="48dp"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:src="@mipmap/default_image" />
|
android:src="@mipmap/im_placeholder" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<!-- 中间的两排 TextView -->
|
<!-- 中间的两排 TextView -->
|
||||||
|
|||||||
@ -42,6 +42,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/card_im"
|
android:id="@+id/card_im"
|
||||||
|
app:cardBackgroundColor="@color/color_transparent"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
app:cardCornerRadius="10dp"
|
app:cardCornerRadius="10dp"
|
||||||
app:cardElevation="0dp">
|
app:cardElevation="0dp">
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/placeholder" />
|
android:src="@mipmap/im_placeholder" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/im_back"
|
android:id="@+id/im_back"
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:src="@drawable/placeholder" />
|
android:src="@mipmap/im_placeholder" />
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|||||||
@ -1,21 +1,21 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/linearLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
|
||||||
android:id="@+id/linearLayout"
|
|
||||||
android:background="@color/color_transparent"
|
android:background="@color/color_transparent"
|
||||||
|
android:orientation="vertical"
|
||||||
tools:context=".ui.fragmnt.HomeFragment">
|
tools:context=".ui.fragmnt.HomeFragment">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/app_name"
|
|
||||||
android:textSize="22sp"
|
|
||||||
android:padding="15dp"
|
android:padding="15dp"
|
||||||
android:textColor="@color/white"/>
|
android:text="@string/app_name"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="22sp" />
|
||||||
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
@ -25,4 +25,42 @@
|
|||||||
android:paddingStart="6dp" />
|
android:paddingStart="6dp" />
|
||||||
|
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/layout_error"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_error"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="200dp"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/net_error"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_retry"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/tv_error"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:background="@drawable/bg_retry_btn"
|
||||||
|
android:paddingStart="15dp"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:paddingEnd="15dp"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
|
android:text="@string/retry"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="17sp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@ -7,29 +7,29 @@
|
|||||||
tools:context=".ui.fragmnt.SearchFragment">
|
tools:context=".ui.fragmnt.SearchFragment">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
android:id="@+id/layout_et"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:layout_marginStart="22dp"
|
android:layout_marginStart="22dp"
|
||||||
android:layout_marginEnd="22dp"
|
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:id="@+id/layout_et"
|
android:layout_marginEnd="22dp"
|
||||||
android:background="@drawable/bg_search">
|
android:background="@drawable/bg_search">
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
android:id="@+id/et_search"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@null"
|
|
||||||
android:layout_toStartOf="@id/im_cancel"
|
android:layout_toStartOf="@id/im_cancel"
|
||||||
android:textColorHint="@color/seek_bg_color"
|
android:background="@null"
|
||||||
android:paddingStart="20dp"
|
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:focusableInTouchMode="true"
|
android:focusableInTouchMode="true"
|
||||||
android:id="@+id/et_search"
|
android:hint="@string/search_hint"
|
||||||
android:textColor="@color/white"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:inputType="text"
|
|
||||||
android:imeOptions="actionSearch"
|
android:imeOptions="actionSearch"
|
||||||
android:hint="@string/search_hint"/>
|
android:inputType="text"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:paddingStart="20dp"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textColorHint="@color/seek_bg_color" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/im_cancel"
|
android:id="@+id/im_cancel"
|
||||||
@ -42,22 +42,53 @@
|
|||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler_suggestion"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/layout_et"
|
android:layout_below="@id/layout_et"
|
||||||
android:layout_alignStart="@id/layout_et"
|
android:layout_alignStart="@id/layout_et"
|
||||||
android:layout_alignEnd="@id/layout_et"
|
android:layout_alignEnd="@id/layout_et" />
|
||||||
android:id="@+id/recycler_suggestion"/>
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler_result"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/layout_et"
|
android:layout_below="@id/layout_et"
|
||||||
android:layout_alignStart="@id/layout_et"
|
android:layout_alignStart="@id/layout_et"
|
||||||
android:layout_alignEnd="@id/layout_et"
|
android:layout_alignEnd="@id/layout_et"
|
||||||
android:visibility="gone"
|
android:visibility="gone" />
|
||||||
android:id="@+id/recycler_result"/>
|
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/layout_error"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_below="@id/layout_et"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_error"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:layout_marginTop="200dp"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/no_result"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/pbloading"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/layout_et"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="200dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:indeterminateTint="@color/white" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@ -16,7 +16,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/default_image" />
|
android:src="@mipmap/im_placeholder" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/overlay"
|
android:id="@+id/overlay"
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/default_image" />
|
android:src="@mipmap/im_placeholder" />
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/default_image" />
|
android:src="@mipmap/im_placeholder" />
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:background="@color/black"
|
android:background="@color/black"
|
||||||
android:src="@mipmap/default_image" />
|
android:src="@mipmap/im_placeholder" />
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/head_title"
|
android:id="@+id/head_title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="15dp"
|
android:layout_marginStart="15dp"
|
||||||
android:textColor="@color/text_color_1"
|
android:textColor="@color/text_color_1"
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:src="@drawable/placeholder" />
|
android:src="@mipmap/im_placeholder" />
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
android:id="@+id/header"
|
android:id="@+id/header"
|
||||||
android:layout_width="170dp"
|
android:layout_width="170dp"
|
||||||
android:layout_height="170dp"
|
android:layout_height="170dp"
|
||||||
android:src="@drawable/placeholder" />
|
android:src="@mipmap/im_placeholder" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_title"
|
android:id="@+id/tv_title"
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
android:scaleType="fitXY"
|
android:scaleType="fitXY"
|
||||||
android:layout_marginStart="14dp"
|
android:layout_marginStart="14dp"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:src="@drawable/placeholder" />
|
android:src="@mipmap/im_placeholder" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/layout_panel"
|
android:id="@+id/layout_panel"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="74dp"
|
android:layout_height="74dp"
|
||||||
@ -8,22 +9,30 @@
|
|||||||
android:paddingStart="14dp"
|
android:paddingStart="14dp"
|
||||||
android:paddingEnd="14dp">
|
android:paddingEnd="14dp">
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/cardimage"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
app:cardCornerRadius="200dp"
|
||||||
|
app:cardElevation="0dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/image"
|
android:id="@+id/image"
|
||||||
android:layout_width="52dp"
|
android:layout_width="52dp"
|
||||||
android:layout_height="52dp"
|
android:layout_height="52dp"
|
||||||
android:layout_centerVertical="true"
|
android:src="@mipmap/im_placeholder" />
|
||||||
android:layout_marginStart="2dp"
|
</androidx.cardview.widget.CardView>
|
||||||
android:src="@mipmap/ic_launcher" />
|
|
||||||
|
|
||||||
<com.hi.music.player.helper.CircularProgressBar
|
<com.hi.music.player.helper.CircularProgressBar
|
||||||
android:id="@+id/circular_pb"
|
android:id="@+id/circular_pb"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignTop="@id/image"
|
android:layout_alignStart="@id/cardimage"
|
||||||
android:layout_alignBottom="@id/image"
|
android:layout_alignTop="@id/cardimage"
|
||||||
android:layout_alignStart="@id/image"
|
android:layout_alignEnd="@id/cardimage"
|
||||||
android:layout_alignEnd="@id/image"
|
android:layout_alignBottom="@id/cardimage"
|
||||||
android:layout_gravity="center" />
|
android:layout_gravity="center" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -50,9 +59,9 @@
|
|||||||
android:id="@+id/singer"
|
android:id="@+id/singer"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/app_name"
|
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
|
android:text="@string/app_name"
|
||||||
android:textColor="@color/panel_singer_color"
|
android:textColor="@color/panel_singer_color"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@ -84,7 +93,7 @@
|
|||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:paddingStart="5dp"
|
android:paddingStart="5dp"
|
||||||
android:paddingEnd="5dp"
|
android:paddingEnd="5dp"
|
||||||
android:visibility="visible"
|
android:src="@drawable/icon_next_black"
|
||||||
android:src="@drawable/icon_next_black" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
BIN
app/src/main/res/mipmap-xxxhdpi/im_logo.jpg
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/im_logo.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 270 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/im_placeholder.jpg
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/im_placeholder.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 454 KiB |
@ -39,4 +39,6 @@
|
|||||||
<string name="text_like_song">Favorite Songs</string>
|
<string name="text_like_song">Favorite Songs</string>
|
||||||
<string name="text_offline_song">Offline Songs</string>
|
<string name="text_offline_song">Offline Songs</string>
|
||||||
<string name="text_has_downloaded">It\'s already downloaded</string>
|
<string name="text_has_downloaded">It\'s already downloaded</string>
|
||||||
|
<string name="net_error">An error occurred in the network request. Please try again.</string>
|
||||||
|
<string name="no_result">No results yet</string>
|
||||||
</resources>
|
</resources>
|
||||||
Loading…
Reference in New Issue
Block a user