Commit 0631366d authored by jyx's avatar jyx

喜马拉雅专辑页实现

parent f9017629
......@@ -125,6 +125,7 @@ object Constant {
const val CARRIER_ZHANGYUE_CHALLENGE = "ZHANGYUE_CHALLENGE" //看小说挑战
const val CARRIER_BLESSINGBAG = "BLESSINGBAG" //首页福袋
const val CARRIER_BLESSINGBAG_DOUBLE = "BLESSINGBAG_DOUBLE" //首页福袋翻倍
const val CARRIER_XMLY_CHALLENGE = "XMLY_CHALLENGE" //喜马拉雅听书
const val CHALLENGE_SHAREFRIEND = "CHALLENGE_SHAREFRIEND" //邀请好友
......
......@@ -63,4 +63,13 @@ public class TrackManager {
trackPresenter.drawcashVideo();
}
}
/**
* 喜马拉雅听书时间
*/
public void addXmlyTime(int second) {
if (trackPresenter != null) {
trackPresenter.addCarrierTypeTime(second);
}
}
}
package com.mints.goodmoney.mvp.model;
import java.io.Serializable;
import java.util.List;
public class XmlyUnlockBean implements Serializable {
private List<String> list;
public List<String> getList() {
return list;
}
public void setList(List<String> list) {
this.list = list;
}
}
package com.mints.goodmoney.mvp.presenters;
import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.manager.AppHttpManager;
import com.mints.goodmoney.mvp.model.BaseResponse;
import com.mints.library.net.neterror.BaseSubscriber;
......@@ -80,4 +81,30 @@ public class TrackPresenter extends BaseTrackPresenter {
}
});
}
/**
* 喜马拉雅听书时间
*/
public void addCarrierTypeTime(int second) {
HashMap<String, Object> vo = new HashMap<>();
vo.put("time", second);
vo.put("carrierType", Constant.CARRIER_XMLY_CHALLENGE);
AppHttpManager.getInstance(loanApplication)
.call(loanService.addCarrierTypeTime(vo),
new BaseSubscriber<BaseResponse<Object>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(BaseResponse<Object> baseResponse) {
}
});
}
}
package com.mints.goodmoney.mvp.presenters
import com.google.gson.JsonObject
import com.mints.goodmoney.manager.AppHttpManager
import com.mints.goodmoney.mvp.model.BaseResponse
import com.mints.goodmoney.mvp.model.XmlyUnlockBean
import com.mints.goodmoney.mvp.views.XmlyPlayView
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
import java.util.*
class XmlyPlayPresenter : BasePresenter<XmlyPlayView>() {
fun getXmlyUnlockMsg(uid: String, category: String, album: String) {
val vo = HashMap<String, Any>()
vo["uid"] = uid
vo["category"] = category
vo["album"] = album
AppHttpManager.getInstance(loanApplication)
.call(loanService.getXmlyUnlockMsg(vo),
object : BaseSubscriber<BaseResponse<XmlyUnlockBean>>() {
override fun onCompleted() {
}
override fun onError(e: Throwable) {
}
override fun onNext(baseResponse: BaseResponse<XmlyUnlockBean>) {
if (isLinkView) return
val code = baseResponse.status
val data = baseResponse.data
when (code) {
200 -> {
if (data != null) {
view.getXmlyUnlockMsgSuc(data.list)
}
}
else -> view.showToast(baseResponse.message)
}
}
})
}
fun pushXmlyUnlockMsg(uid: String, category: String, album: String, entry: String) {
val vo = HashMap<String, Any>()
vo["uid"] = uid
vo["category"] = category
vo["album"] = album
vo["entry"] = entry
AppHttpManager.getInstance(loanApplication)
.call(loanService.pushXmlyUnlockMsg(vo),
object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() {
}
override fun onError(e: Throwable) {
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return
val code = baseResponse.status
val data = baseResponse.data
when (code) {
200 -> {
if (data != null) {
view.pushXmlyUnlockMsgSuc()
}
}
else -> view.showToast(baseResponse.message)
}
}
})
}
}
\ No newline at end of file
package com.mints.goodmoney.mvp.views
interface XmlyPlayView : BaseView {
fun getXmlyUnlockMsgSuc(list: List<String>)
fun pushXmlyUnlockMsgSuc()
}
......@@ -22,6 +22,7 @@ import com.mints.goodmoney.mvp.model.UserTaskMsgBean;
import com.mints.goodmoney.mvp.model.Version;
import com.mints.goodmoney.mvp.model.WalkBean;
import com.mints.goodmoney.mvp.model.WaterBean;
import com.mints.goodmoney.mvp.model.XmlyUnlockBean;
import com.mints.goodmoney.utils.AESUtils;
import com.orhanobut.logger.Logger;
......@@ -452,6 +453,30 @@ public interface LoanService {
@POST("api/riskinfo/save")
Observable<BaseResponse<Object>> riskinfo(@Body Map<String, Object> vo);
/**
* 获取喜马拉雅解锁记录
*
* @return
*/
@POST("api/getXmlyUnlockMsg")
Observable<BaseResponse<XmlyUnlockBean>> getXmlyUnlockMsg(@Body Map<String, Object> vo);
/**
* 记录喜马拉雅解锁记录
*
* @return
*/
@POST("api/pushXmlyUnlockMsg")
Observable<BaseResponse<Object>> pushXmlyUnlockMsg(@Body Map<String, Object> vo);
/**
* 记录喜马拉雅解锁记录
*
* @return
*/
@POST("api/addCarrierTypeTime")
Observable<BaseResponse<Object>> addCarrierTypeTime(@Body Map<String, Object> vo);
/**
* 默认http工厂
*/
......
package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.Toast
import com.fly.scenemodule.util.GsonUtils
import com.mints.goodmoney.R
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.adapter.XmlyPlayAdapter
import com.mints.goodmoney.utils.LogUtil
import com.ximalaya.ting.android.opensdk.constants.DTransferConstants
import com.ximalaya.ting.android.opensdk.datatrasfer.CommonRequest
......@@ -37,23 +39,41 @@ class XmlyActivity : BaseActivity(), View.OnClickListener {
private val TAG = XmlyActivity::class.java.simpleName
private val json = "{\"album_id\":4519297,\"album_intro\":\"最全最快最省时,热点新闻早知道\",\"album_title\":\"新闻早餐\",\"can_download\":true,\"category_id\":1,\"cover_url_large\":\"https://imgopen.xmcdn.com/group18/M01/19/DE/wKgJKleDXj2QJYOuAAFbNixU8BI237.png!op_type\\u003d5\\u0026upload_type\\u003dalbum\\u0026device_type\\u003dios\\u0026name\\u003dmobile_large\\u0026magick\\u003dpng\",\"cover_url_middle\":\"https://imgopen.xmcdn.com/group18/M01/19/DE/wKgJKleDXj2QJYOuAAFbNixU8BI237.png!op_type\\u003d5\\u0026upload_type\\u003dalbum\\u0026device_type\\u003dios\\u0026name\\u003dmedium\\u0026magick\\u003dpng\",\"cover_url_small\":\"https://imgopen.xmcdn.com/group18/M01/19/DE/wKgJKleDXj2QJYOuAAFbNixU8BI237.png!op_type\\u003d5\\u0026upload_type\\u003dalbum\\u0026device_type\\u003dios\\u0026name\\u003dmobile_small\\u0026magick\\u003dpng\",\"current_page\":1,\"params\":{\"count\":\"110\",\"total_page\":\"16\",\"album_id\":\"4519297\",\"page\":\"1\",\"track_base_url\":\"http://api.ximalaya.com/openapi-gateway-app/albums/browse\"},\"total_count\":1690,\"total_page\":16,\"tracks\":[{\"subordinated_album\":{\"id\":4519297,\"album_title\":\"新闻早餐\",\"cover_url_large\":\"https://imgopen.xmcdn.com/group18/M01/19/DE/wKgJKleDXj2QJYOuAAFbNixU8BI237.png!op_type\\u003d5\\u0026upload_type\\u003dalbum\\u0026device_type\\u003dios\\u0026name\\u003dmobile_large\\u0026magick\\u003dpng\",\"cover_url_middle\":\"https://imgopen.xmcdn.com/group18/M01/19/DE/wKgJKleDXj2QJYOuAAFbNixU8BI237.png!op_type\\u003d5\\u0026upload_type\\u003dalbum\\u0026device_type\\u003dios\\u0026name\\u003dmedium\\u0026magick\\u003dpng\",\"cover_url_small\":\"https://imgopen.xmcdn.com/group18/M01/19/DE/wKgJKleDXj2QJYOuAAFbNixU8BI237.png!op_type\\u003d5\\u0026upload_type\\u003dalbum\\u0026device_type\\u003dios\\u0026name\\u003dmobile_small\\u0026magick\\u003dpng\",\"serializeStatus\":0,\"uptoDateTime\":0},\"announcer\":{\"anchorGrade\":0,\"id\":52622741,\"avatar_url\":\"https://imgopen.xmcdn.com/group20/M05/19/EA/wKgJJ1eDW1_QCA5MAABNXnIlT3I433.png!op_type\\u003d3\\u0026columns\\u003d110\\u0026rows\\u003d110\",\"follower_count\":0,\"following_count\":0,\"kind\":\"user\",\"nickname\":\"东方网\",\"released_album_count\":0,\"released_track_count\":0,\"vcategory_id\":0,\"is_verified\":true,\"verifyType\":0},\"authorized\":false,\"blockIndex\":0,\"blockNum\":0,\"business_type\":0,\"can_download\":true,\"category_id\":1,\"channelId\":0,\"chargeFileSize\":0,\"comment_count\":50,\"cover_url_large\":\"https://imgopen.xmcdn.com/group18/M01/19/DE/wKgJKleDXj2QJYOuAAFbNixU8BI237.png!op_type\\u003d3\\u0026columns\\u003d640\\u0026rows\\u003d640\",\"cover_url_middle\":\"https://imgopen.xmcdn.com/group18/M01/19/DE/wKgJKleDXj2QJYOuAAFbNixU8BI237.png!op_type\\u003d3\\u0026columns\\u003d180\\u0026rows\\u003d180\",\"cover_url_small\":\"https://imgopen.xmcdn.com/group18/M01/19/DE/wKgJKleDXj2QJYOuAAFbNixU8BI237.png!op_type\\u003d3\\u0026columns\\u003d100\\u0026rows\\u003d100\",\"created_at\":1608589201000,\"discountedPrice\":0.0,\"download_count\":0,\"downloadCreated\":0,\"download_size\":1556152,\"downloadStatus\":-2,\"downloadTime\":0,\"download_url\":\"https://aod.cos.tx.xmcdn.com/storages/bd75-audiofreehighqps/CA/1F/CMCoOR8DtpvoABe-uABzoyHy.m4a\",\"downloadedSize\":0,\"duration\":501,\"extraa\":false,\"favorite_count\":215,\"is_free\":false,\"hasCopyRight\":true,\"has_sample\":false,\"insertSequence\":0,\"isAutoPaused\":false,\"isChecked\":false,\"isLike\":false,\"is_paid\":false,\"is_trailer\":false,\"isVideo\":false,\"liveRoomId\":0,\"order_num\":0,\"orderPositionInAlbum\":0,\"orderPositon\":-1,\"play_count\":154050,\"play_size_24_m4a\":\"1556152\",\"play_size_32\":2441525,\"play_size_64\":4451177,\"play_size_64_m4a\":\"4069015\",\"play_size_amr\":452166,\"play_source\":0,\"play_url_24_m4a\":\"\",\"play_url_32\":\"\",\"play_url_64\":\"\",\"play_url_64_m4a\":\"\",\"play_url_amr\":\"\",\"price\":0.0,\"priceTypeEnum\":0,\"priceTypeId\":0,\"programId\":0,\"protocolVersion\":0,\"radioId\":0,\"sample_duration\":0,\"scheduleId\":0,\"source\":1,\"templateId\":0,\"timeline\":0,\"topic_id\":0,\"trackActivityId\":0,\"track_intro\":\"\",\"trackStatus\":-1,\"track_tags\":\"\",\"track_title\":\"港媒:被通缉的罗冠聪宣称决定向英国政府申请“政治庇护” | 新闻早餐 2020.12.22\",\"type\":0,\"uid\":0,\"updateStatus\":false,\"updated_at\":1608589201000,\"vip_first_status\":\"0\",\"id\":367441649,\"isWeikeTrack\":false,\"kind\":\"track\",\"lastPlayedMills\":-1,\"weikeLessonId\":0,\"weikeRoomId\":0}]}"
private var mCategoryList: CategoryList? = null
private var mTrackList: TrackList? = null
private lateinit var mPlayerManager: XmPlayerManager
override fun getContentViewLayoutID() = R.layout.activity_xmly_test
private val mUpdateProgress = true
private lateinit var xmlyPlayAdapter: XmlyPlayAdapter
private var xmlyData: MutableList<Track> = mutableListOf()
// 分页
private var xmlyPage = 1
private val PAGE_SIZE = 10
override fun getContentViewLayoutID() = R.layout.activity_xmly_play
override fun isApplyKitKatTranslucency() = false
private var mAlbumId = 0L
companion object {
const val ALBUM_ID = "album_id"
}
override fun getBundleExtras(extras: Bundle) {
mAlbumId = extras.getLong(ALBUM_ID)
}
override fun initViewsAndEvents() {
tv_title.text = "喜马拉雅测试"
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
mPlayerManager = XmPlayerManager.getInstance(this)
val mNotification = XmNotificationCreater.getInstanse(this).initNotification(this.applicationContext, XmlyActivity::class.java)
val mNotification = XmNotificationCreater.getInstanse(this)
.initNotification(this.applicationContext, XmlyActivity::class.java)
// 如果之前贵方使用了 `XmPlayerManager.init(int id, Notification notification)` 这个初始化的方式
// 请参考`4.8 播放器通知栏使用`重新添加新的通知栏布局,否则直接升级可能导致在部分手机播放时崩溃
// 如果不想使用sdk内部搞好的notification,或者想自建notification 可以使用下面的 init()函数进行初始化
......@@ -115,17 +135,17 @@ class XmlyActivity : BaseActivity(), View.OnClickListener {
// vo[DTransferConstants.PAGE] = "1"
// vo["count"] = "200"
vo[DTransferConstants.ALBUM_ID] = "4519297"
vo[DTransferConstants.ALBUM_ID] = mAlbumId.toString()
vo[DTransferConstants.PAGE] = "1"
vo[DTransferConstants.PAGE_SIZE] = "200"
vo[DTransferConstants.PAGE_SIZE] = "20"
CommonRequest.getTracks(vo, object : IDataCallBack<TrackList> {
override fun onSuccess(p0: TrackList?) {
//// val toJson = GsonUtils.toJson(p0)
val toJson = GsonUtils.toJson(p0)
// val fromJson = GsonUtils.fromJson<TrackList>(json, TrackList::class.java)
// mTrackList = fromJson
//// LogUtil.d(toJson)
LogUtil.d(toJson)
if (p0 != null && p0.getTracks() != null &&p0.getTracks().size != 0) {
if (p0 != null && p0.getTracks() != null && p0.getTracks().size != 0) {
if (mTrackList == null) {
mTrackList = p0
} else {
......@@ -160,7 +180,7 @@ class XmlyActivity : BaseActivity(), View.OnClickListener {
// track.dataId = (-1 * track.trackTitle.hashCode()).toLong()
// val tarcks = arrayListOf<Track>()
// tarcks.add(track)
if(mTrackList!=null&&mTrackList!!.tracks!=null){
if (mTrackList != null && mTrackList!!.tracks != null) {
mPlayerManager.playList(mTrackList!!.tracks, 1)
}
......
......@@ -8,6 +8,7 @@ import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mints.goodmoney.R
import com.mints.goodmoney.utils.ToolUtil
import com.mints.library.utils.GlideUtils
import com.ximalaya.ting.android.opensdk.model.album.Album
......@@ -34,7 +35,7 @@ class XmlyPageAdapter(val xmlyPageList: MutableList<Album>) :
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val album = xmlyPageList[position]
holder.tvXmlyPageContent.text = album.recommendReason
holder.tvXmlyPagecount.text = album.playCount.toString()
holder.tvXmlyPagecount.text = ToolUtil.formatNum(album.playCount.toString(), false)
GlideUtils.loadImageView(holder.itemView.context, album.coverUrlLarge, holder.ivXmlyPage)
holder.itemView.setOnClickListener {
......
......@@ -4,12 +4,14 @@ import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mints.goodmoney.R
import com.mints.goodmoney.utils.ToolUtil
import com.ximalaya.ting.android.opensdk.model.track.Track
class XmlyPlayAdapter(val xmlyPageList: MutableList<Track>) :
class XmlyPlayAdapter(val xmlyPageList: MutableList<Track>, val xmlyUnlockList: List<String>) :
RecyclerView.Adapter<XmlyPlayAdapter.ViewHolder>() {
lateinit var context: Context
......@@ -20,7 +22,7 @@ class XmlyPlayAdapter(val xmlyPageList: MutableList<Track>) :
val tvIndex: TextView = view.findViewById(R.id.tv_index)
val tvTitle: TextView = view.findViewById(R.id.tv_title)
val tvCount: TextView = view.findViewById(R.id.tv_count)
val tvFree: TextView = view.findViewById(R.id.tv_free)
val ivIsLock: ImageView = view.findViewById(R.id.iv_islock)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
......@@ -33,8 +35,16 @@ class XmlyPlayAdapter(val xmlyPageList: MutableList<Track>) :
val track = xmlyPageList[position]
holder.tvIndex.text = (position + 1).toString()
holder.tvTitle.text = track.trackTitle
holder.tvCount.text = track.playCount.toString()
holder.tvFree.text = track.isFree.toString()
holder.tvCount.text = ToolUtil.formatNum(track.playCount.toString(), false)
for (s in xmlyUnlockList) {
if (position == 0 || position == 1) {
holder.ivIsLock.setImageResource(R.mipmap.icon_unlock)
} else if (position == s.toInt() - 1) {
holder.ivIsLock.setImageResource(R.mipmap.icon_unlock)
} else {
holder.ivIsLock.setImageResource(R.mipmap.icon_lock)
}
}
holder.itemView.setOnClickListener {
if (::mOnItemClickListener.isInitialized) {
......
......@@ -2,10 +2,7 @@ package com.mints.goodmoney.ui.fragment
import android.os.Bundle
import androidx.recyclerview.widget.GridLayoutManager
import com.fly.scenemodule.util.GsonUtils
import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.ui.activitys.AwardActivity
import com.mints.goodmoney.ui.activitys.XmlyPlayActivity
import com.mints.goodmoney.ui.adapter.XmlyPageAdapter
import com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment
......@@ -80,6 +77,7 @@ class XmlyPageFragment(private val categoryId: Long) : LazyLoadBaseFragment(),
override fun onItemClick(position: Int) {
val bundle = Bundle()
bundle.putLong(XmlyPlayActivity.ALBUM_ID, xmlyData[position].id)
bundle.putLong(XmlyPlayActivity.CATEGORY_ID, categoryId)
readyGo(XmlyPlayActivity::class.java, bundle)
}
......
......@@ -17,6 +17,7 @@ import android.text.TextUtils;
import com.ximalaya.ting.android.opensdk.constants.ConstantsOpenSdk;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
......@@ -26,18 +27,22 @@ import java.util.Locale;
* ClassName:ToolUtil
*
* @author chadwii
* @version
* @since Ver 1.1
* @Date 2015-4-9 5:17:32
*
* @see
* @since Ver 1.1
*/
public class ToolUtil {
/**one hour in ms*/
/**
* one hour in ms
*/
private static final int ONE_HOUR = 1 * 60 * 60 * 1000;
/**one minute in ms*/
/**
* one minute in ms
*/
private static final int ONE_MIN = 1 * 60 * 1000;
/**one second in ms*/
/**
* one second in ms
*/
private static final int ONE_SECOND = 1 * 1000;
private static int sScreenWidth;
......@@ -72,7 +77,9 @@ public class ToolUtil {
return sScreenHeight;
}
/**HH:mm:ss*/
/**
* HH:mm:ss
*/
public static String formatTime(long ms) {
StringBuilder sb = new StringBuilder();
int hour = (int) (ms / ONE_HOUR);
......@@ -112,9 +119,9 @@ public class ToolUtil {
public static int isInTime(String time) throws IllegalArgumentException {
if (TextUtils.isEmpty(time) || !time.contains("-")
|| !time.contains(":")) {
if(ConstantsOpenSdk.isDebug) {
if (ConstantsOpenSdk.isDebug) {
throw new IllegalArgumentException("Illegal Argument arg:" + time);
}else {
} else {
return -2;
}
}
......@@ -154,15 +161,81 @@ public class ToolUtil {
}
} catch (ParseException e) {
e.printStackTrace();
if(ConstantsOpenSdk.isDebug) {
if (ConstantsOpenSdk.isDebug) {
throw new IllegalArgumentException("Illegal Argument arg:"
+ time);
}else {
} else {
return -2;
}
}
}
return -2;
}
/**
* <pre>
* 数字格式化显示
* 小于万默认显示 大于万以1.7万方式显示最大是9999.9万
* 大于亿以1.1亿方式显示最大没有限制都是亿单位
* make by dongxh 2017年12月28日上午10:05:22
* </pre>
*
* @param num 格式化的数字
* @param kBool 是否格式化千,为true,并且num大于999就显示999+,小于等于999就正常显示
* @return
*/
public static String formatNum(String num, Boolean kBool) {
StringBuffer sb = new StringBuffer();
if (num == null)
return "0";
if (kBool == null)
kBool = false;
BigDecimal b0 = new BigDecimal("1000");
BigDecimal b1 = new BigDecimal("10000");
BigDecimal b2 = new BigDecimal("100000000");
BigDecimal b3 = new BigDecimal(num);
String formatNumStr = "";
String nuit = "";
// 以千为单位处理
if (kBool) {
if (b3.compareTo(b0) == 0 || b3.compareTo(b0) == 1) {
return "999+";
}
return num;
}
// 以万为单位处理
if (b3.compareTo(b1) == -1) {
sb.append(b3.toString());
} else if ((b3.compareTo(b1) == 0 && b3.compareTo(b1) == 1)
|| b3.compareTo(b2) == -1) {
formatNumStr = b3.divide(b1).toString();
nuit = "万";
} else if (b3.compareTo(b2) == 0 || b3.compareTo(b2) == 1) {
formatNumStr = b3.divide(b2).toString();
nuit = "亿";
}
if (!"".equals(formatNumStr)) {
int i = formatNumStr.indexOf(".");
if (i == -1) {
sb.append(formatNumStr).append(nuit);
} else {
i = i + 1;
String v = formatNumStr.substring(i, i + 1);
if (!v.equals("0")) {
sb.append(formatNumStr.substring(0, i + 1)).append(nuit);
} else {
sb.append(formatNumStr.substring(0, i - 1)).append(nuit);
}
}
}
if (sb.length() == 0)
return "0";
return sb.toString();
}
}
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 背景图 -->
<item android:id="@android:id/background">
<shape>
<stroke
android:width="@dimen/dp_1"
android:color="#E5E5E5" />
<corners android:radius="@dimen/dp_5" />
<solid android:color="#FAFAFA" />
<gradient
android:angle="0"
android:centerColor="#FBFBFB"
android:endColor="#FBFBFB"
android:startColor="#FBFBFB" />
</shape>
</item>
<!-- 第二进度条的背景色 -->
<item android:id="@android:id/secondaryProgress">
<clip>
<shape android:shape="rectangle">
<solid android:color="#E9DDB6" />
<corners android:radius="@dimen/dp_5" />
</shape>
</clip>
</item>
<!-- <item android:id="@+android:id/background" android:drawable="@drawable/bar_dn" /> -->
<!-- 可拖动的进度条颜色 -->
<item android:id="@android:id/progress">
<clip>
<shape>
<stroke
android:width="@dimen/dp_1"
android:color="#E5E5E5" />
<corners android:radius="@dimen/dp_5" />
<gradient
android:angle="0"
android:centerColor="#FB560C"
android:endColor="#DE4313"
android:startColor="#FEC163" />
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
......@@ -9,119 +8,129 @@
<include layout="@layout/header_layout" />
<androidx.constraintlayout.widget.ConstraintLayout
<RelativeLayout
android:id="@+id/control_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="116dp"
android:gravity="center"
android:padding="10dp">
<ImageView
android:id="@+id/sound_cover"
android:layout_width="110dp"
android:layout_height="110dp"
android:layout_alignParentStart="true"
android:scaleType="fitCenter"
android:src="@mipmap/ic_launcher" />
<TextView
android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginBottom="6dp"
android:layout_toEndOf="@id/sound_cover"
android:maxLines="1"
android:text=" - "
android:textColor="@color/color_333" />
<TextView
android:id="@+id/time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/message"
android:layout_marginStart="10dp"
android:layout_marginBottom="6dp"
android:layout_toEndOf="@id/sound_cover"
android:maxLines="1"
android:text="[ - / - ]"
android:textColor="@color/color_333" />
<SeekBar
android:id="@+id/seek_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/time"
android:layout_alignParentEnd="true"
android:layout_toEndOf="@+id/sound_cover"
android:maxHeight="10dp"
android:minHeight="10dp"
android:paddingStart="6dp"
android:paddingEnd="6dp"
android:progressDrawable="@drawable/seekbar_progress_color"
android:saveEnabled="false"
android:splitTrack="false"
android:thumb="@mipmap/icon_seekbar_block"
android:thumbOffset="0dp" />
<ProgressBar
android:id="@+id/buffering_progress"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:visibility="gone" />
<RelativeLayout
android:id="@+id/control_bar"
<ImageButton
android:id="@+id/pre_sound"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/seek_bar"
android:layout_alignParentBottom="true"
android:background="@color/transparent"
android:paddingStart="6dp"
android:paddingEnd="6dp"
android:scaleType="fitCenter"
android:src="@mipmap/pre_icon_transparent_normal" />
<ImageButton
android:id="@+id/play_or_pause"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/pre_sound"
android:layout_toRightOf="@+id/pre_sound"
android:background="@color/transparent"
android:paddingStart="6dp"
android:paddingEnd="6dp"
android:scaleType="fitCenter"
android:src="@mipmap/widget_play_normal" />
<ImageButton
android:id="@+id/next_sound"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignTop="@+id/pre_sound"
android:layout_toEndOf="@+id/play_or_pause"
android:background="@color/transparent"
android:paddingStart="6dp"
android:paddingEnd="6dp"
android:scaleType="fitCenter"
android:src="@mipmap/next_icon_transparent_normal" />
</RelativeLayout>
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/srl_xmly"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srlAccentColor="@color/gray"
app:srlPrimaryColor="@color/color_50E8E8E8">
<com.scwang.smartrefresh.layout.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="120dp"
android:gravity="center"
android:padding="10dp"
app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteX="3dp">
<ImageView
android:id="@+id/sound_cover"
android:layout_width="110dp"
android:layout_height="110dp"
android:layout_alignParentLeft="true"
android:scaleType="fitCenter"
android:src="@mipmap/ic_draw_phone" />
<TextView
android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@id/sound_cover"
android:maxLines="1"
android:text="no play sound"
android:textColor="@color/color_333" />
<TextView
android:id="@+id/time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/message"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@id/sound_cover"
android:maxLines="1"
android:textColor="@color/color_333" />
<SeekBar
android:id="@+id/seek_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/time"
android:layout_alignParentRight="true"
android:layout_marginBottom="10dp"
android:layout_toRightOf="@+id/sound_cover"
android:maxHeight="10dp"
android:minHeight="10dp" />
<ProgressBar
android:id="@+id/buffering_progress"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:visibility="gone" />
<ImageButton
android:id="@+id/pre_sound"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/seek_bar"
android:layout_alignParentBottom="true"
android:scaleType="fitCenter"
android:src="@mipmap/pre_icon_transparent_normal" />
<ImageButton
android:id="@+id/play_or_pause"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/pre_sound"
android:layout_toRightOf="@+id/pre_sound"
android:scaleType="fitCenter"
android:src="@mipmap/widget_play_normal" />
<ImageButton
android:id="@+id/next_sound"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignTop="@+id/pre_sound"
android:layout_toRightOf="@+id/play_or_pause"
android:scaleType="fitCenter"
android:src="@mipmap/next_icon_transparent_normal" />
</RelativeLayout>
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/srl_xmly"
android:layout_height="wrap_content" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/xmlyPageVip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/control_bar"
app:srlAccentColor="@color/gray"
app:srlPrimaryColor="@color/color_50E8E8E8">
<com.scwang.smartrefresh.layout.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/xmlyPageVip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:overScrollMode="never" />
<com.scwang.smartrefresh.layout.footer.ClassicsFooter
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
android:background="@null"
android:overScrollMode="never" />
<com.scwang.smartrefresh.layout.footer.ClassicsFooter
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout>
......@@ -9,7 +9,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:text="1"
android:textColor="@color/color_333"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
......@@ -22,7 +21,6 @@
android:layout_marginStart="20dp"
android:ellipsize="end"
android:maxLines="2"
android:text="111111111111111"
android:textColor="@color/color_333"
android:textSize="16sp"
app:layout_constraintBottom_toTopOf="@id/tv_count"
......@@ -45,17 +43,14 @@
app:layout_constraintStart_toEndOf="@+id/tv_index"
app:layout_constraintTop_toBottomOf="@id/tv_title" />
<TextView
android:id="@+id/tv_free"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:gravity="center_vertical"
android:text="7.2亿"
android:textColor="@color/color_AAA"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/tv_count"
app:layout_constraintStart_toEndOf="@+id/tv_count"
app:layout_constraintTop_toTopOf="@+id/tv_count" />
<ImageView
android:id="@+id/iv_islock"
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_marginEnd="20dp"
android:src="@mipmap/icon_unlock"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment