Commit 10b31189 authored by jyx's avatar jyx

喜马拉雅测试

parent bc482a8d
......@@ -94,6 +94,12 @@ android {
}
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
lintOptions {
//lint 遇到 error 时继续 构建
//abortOnError false
......@@ -202,7 +208,6 @@ dependencies {
// TalkingDada
implementation files('libs/SaaS_AppAnalytics_Android_SDK_V4.0.36.jar')
// 一览视频
// implementation("com.yilan.sdk:ui:3.0.0.3") {
implementation("com.yilan.sdk:ui:3.1.0.4") {
exclude group: 'com.yilan.sdk', module: 'toutiao'
exclude group: 'com.yilan.sdk', module: 'gdt'
......@@ -255,11 +260,10 @@ dependencies {
// implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
// 喜马拉雅
// v4包
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.squareup.okio:okio:1.15.0'
implementation files('libs/TingPhoneOpenSDK_7.4.1.jar')
implementation files('libs/XmDownload_2.0.jar')
implementation files('libs/XmlyOAuth2SDK_V2.0.jar')
// testImplementation 'junit:junit:4.13'
......
......@@ -16,6 +16,7 @@ class XmlyPageAdapter(val xmlyPageList: Any?) :
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
......
......@@ -7,6 +7,10 @@ import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.ui.adapter.MessageFragAdapter
import com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment
import com.mints.goodmoney.utils.LogUtil
import com.ximalaya.ting.android.opensdk.datatrasfer.CommonRequest
import com.ximalaya.ting.android.opensdk.datatrasfer.IDataCallBack
import com.ximalaya.ting.android.opensdk.model.category.CategoryList
import kotlinx.android.synthetic.main.fragment_main_xmly.*
/**
......@@ -15,6 +19,9 @@ import kotlinx.android.synthetic.main.fragment_main_xmly.*
*/
class XmlyFragment : LazyLoadBaseFragment() {
// 听书分类数据
private var mCategoryList: CategoryList? = null
override fun getContentViewLayoutID() = R.layout.fragment_main_xmly
override fun initViewsAndEvents() {
......@@ -28,9 +35,25 @@ class XmlyFragment : LazyLoadBaseFragment() {
initView()
}
private fun loadData() {
// 获取分类数据
val vo = hashMapOf<String, String>()
CommonRequest.getCategories(vo, object : IDataCallBack<CategoryList> {
override fun onSuccess(p0: CategoryList?) {
mCategoryList = p0
}
override fun onError(p0: Int, p1: String?) {
LogUtil.e(p1)
}
})
}
override fun onFragmentResume() {
super.onFragmentResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_MAIN) {
loadData()
}
}
......
package com.mints.goodmoney.ui.fragment
import androidx.recyclerview.widget.GridLayoutManager
import com.fly.scenemodule.util.GsonUtils
import com.mints.goodmoney.R
import com.mints.goodmoney.ui.adapter.XmlyPageAdapter
import com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment
import com.mints.goodmoney.utils.LogUtil
import com.ximalaya.ting.android.opensdk.constants.DTransferConstants
import com.ximalaya.ting.android.opensdk.datatrasfer.CommonRequest
import com.ximalaya.ting.android.opensdk.datatrasfer.IDataCallBack
import com.ximalaya.ting.android.opensdk.model.album.AlbumList
import kotlinx.android.synthetic.main.fragment_main_xmly_page.*
/**
* 描述:喜马拉雅封面
* 作者:孟崔广
*/
class XmlyPageFragment(val data: Int) : LazyLoadBaseFragment() {
class XmlyPageFragment(private val categoryId: Int) : LazyLoadBaseFragment() {
private lateinit var xmlyPageAdapter: XmlyPageAdapter
private var mAlbumList: AlbumList? = null
private var mPage = 1
private var mCount = 10
override fun getContentViewLayoutID() = R.layout.fragment_main_xmly_page
override fun initViewsAndEvents() {
}
private fun loadData() {
val vo = hashMapOf<String, String>()
// 专辑id
vo[DTransferConstants.CATEGORY_ID] = categoryId.toString()
// 1-最火 2-最新 3-最多播放
vo[DTransferConstants.CALC_DIMENSION] = "1"
vo[DTransferConstants.PAGE] = mPage.toString()
vo["count"] = mCount.toString()
CommonRequest.getAlbumList(vo, object : IDataCallBack<AlbumList> {
override fun onSuccess(p0: AlbumList?) {
mAlbumList = p0
}
override fun onError(p0: Int, p1: String?) {
LogUtil.e(p1)
}
})
}
override fun onFragmentFirstVisible() {
super.onFragmentFirstVisible()
showToast("" + data)
showToast("" + categoryId)
//recyclerview 加载封面
initRvView()
//recyclerview 事件监听
loadData()
}
private fun initRvView() {
......
......@@ -42,6 +42,12 @@
android:layout_height="wrap_content"
android:text="播放专辑内容" />
<Button
android:id="@+id/btn5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="播放音频" />
</LinearLayout>
</com.mints.goodmoney.ui.widgets.ElasticScrollView>
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/xmlyPageVip"
android:layout_width="match_parent"
android:layout_height="match_parent"
......
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