Commit 65c8a8bd by konghaorui

测评模块资源重命名

parent c76c0b51
...@@ -169,6 +169,7 @@ dependencies { ...@@ -169,6 +169,7 @@ dependencies {
//开发模式 //开发模式
api project(':m-consultant') api project(':m-consultant')
api project(':m-user') api project(':m-user')
api project(':m-tests')
api (project(':ydl-platform')){ api (project(':ydl-platform')){
transitive = true transitive = true
} }
......
...@@ -3,17 +3,13 @@ apply plugin: 'kotlin-android' ...@@ -3,17 +3,13 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
//apply plugin: 'plugin.resTools' // 资源重命名插件 apply plugin: 'plugin.resTools' // 资源重命名插件
// 配置插件dsl // 配置资源重命名插件
//resConfig { resConfig {
// new_prefix = 'tests_' // 资源前缀 new_prefix = 'tests_' // 资源前缀
// old_prefix = '' // 老前缀,可为''空字符串 old_prefix = '' // 老前缀,可为''空字符串
// // === below use default }
// // resFolderPath 资源目录
// // srcFolderPath 源代码目录
// // manifestFilePath 清单文件目录
//}
kapt { kapt {
arguments { arguments {
...@@ -49,7 +45,7 @@ android { ...@@ -49,7 +45,7 @@ android {
} }
//前缀的名字 //前缀的名字
// resourcePrefix "tests_" resourcePrefix "tests_"
//Flavor 信息 //Flavor 信息
publishNonDefault true publishNonDefault true
...@@ -58,16 +54,6 @@ android { ...@@ -58,16 +54,6 @@ android {
xlzx {} xlzx {}
} }
sourceSets {
main {
res.srcDirs = [
'src/main/res/layouts/testhome',
'src/main/res/layouts',
'src/main/res'
]
}
}
} }
dependencies { dependencies {
......
...@@ -8,38 +8,19 @@ ...@@ -8,38 +8,19 @@
<activity <activity
android:name=".list.view.TestCategoryListActivity" android:name=".list.view.TestCategoryListActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/NoTitleTheme" android:theme="@style/platform_NoTitleTheme"
/> />
<activity <activity
android:name=".answer.TestAnswerActivity"
android:screenOrientation="portrait" />
<activity
android:name=".detail.TestDetailActivity"
android:screenOrientation="portrait" />
<!-- 跳转测评详情 中间页面-->
<activity
android:name=".detail.jump.JumpTestDetailActivity"
android:screenOrientation="portrait"
android:theme="@style/Transparent" />
<activity
android:name=".SelectConversationActivity" android:name=".SelectConversationActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity <activity
android:name=".result.TestResultActivity"
android:screenOrientation="portrait" />
<activity
android:name=".search.TestSearchActivity" android:name=".search.TestSearchActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/NoTitleTheme" android:theme="@style/platform_NoTitleTheme"
/> />
<!--测评首页--> <!--测评首页-->
<activity <activity
android:name=".home.TestHomeActivity" android:name=".home.TestHomeActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<!--跳转测试结果 中间页-->
<activity
android:name=".result.jump.JumpTestResultActivity"
android:screenOrientation="portrait"
android:theme="@style/Transparent" />
</application> </application>
</manifest> </manifest>
...@@ -11,16 +11,17 @@ import android.widget.Toast ...@@ -11,16 +11,17 @@ import android.widget.Toast
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.ydl_image.module.GlideApp import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydl_image.transform.GlideCircleTransform import com.ydl.ydl_image.transform.GlideCircleTransform
import com.yidianling.router.im.IMRequestCallback
import com.yidianling.tests.router.TestsIn
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.dialog.NormalDialog
import com.ydl.ydlcommon.http.YdlRetrofitUtils
import com.ydl.ydlcommon.http.api.Command
import com.ydl.ydlcommon.router.YdlCommonOut import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.utils.NetworkParamsUtils
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.ydl.ydlcommon.view.dialog.NormalDialog
import com.yidianling.router.im.IMRequestCallback
import com.yidianling.tests.home.param.RecentCmd
import com.yidianling.tests.router.TestsIn
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.activity_select_conversation.* import kotlinx.android.synthetic.main.tests_activity_select_conversation.*
import java.util.* import java.util.*
/** /**
...@@ -29,7 +30,7 @@ import java.util.* ...@@ -29,7 +30,7 @@ import java.util.*
@Route(path = "/test/select_conversation") @Route(path = "/test/select_conversation")
class SelectConversationActivity : BaseActivity() { class SelectConversationActivity : BaseActivity() {
override fun layoutResId(): Int { override fun layoutResId(): Int {
return R.layout.activity_select_conversation return R.layout.tests_activity_select_conversation
} }
override fun initDataAndEvent() { override fun initDataAndEvent() {
...@@ -76,7 +77,7 @@ class SelectConversationActivity : BaseActivity() { ...@@ -76,7 +77,7 @@ class SelectConversationActivity : BaseActivity() {
} }
override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View { override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {
val view = LayoutInflater.from(mContext).inflate(R.layout.ui_select_conversation_item, null, false) val view = LayoutInflater.from(mContext).inflate(R.layout.tests_ui_select_conversation_item, null, false)
val s = view.findViewById<ImageView>(R.id.sdv_head) as ImageView val s = view.findViewById<ImageView>(R.id.sdv_head) as ImageView
val n = view.findViewById<TextView>(R.id.name) as TextView val n = view.findViewById<TextView>(R.id.name) as TextView
GlideApp.with(mContext) GlideApp.with(mContext)
...@@ -122,7 +123,7 @@ class SelectConversationActivity : BaseActivity() { ...@@ -122,7 +123,7 @@ class SelectConversationActivity : BaseActivity() {
} }
private fun getData() { private fun getData() {
val cmd = Command.RecentCmd() val cmd = RecentCmd()
TestRetrofitApi.getTestRetrofitApi().getRecentExpertList(NetworkParamsUtils.getMaps(cmd)) TestRetrofitApi.getTestRetrofitApi().getRecentExpertList(NetworkParamsUtils.getMaps(cmd))
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
......
...@@ -26,8 +26,8 @@ import com.yidianling.tests.home.presenter.TestHomePresenterImpl ...@@ -26,8 +26,8 @@ import com.yidianling.tests.home.presenter.TestHomePresenterImpl
import com.yidianling.tests.home.utils.TestHomeUtils import com.yidianling.tests.home.utils.TestHomeUtils
import com.yidianling.tests.home.widget.SwipeToLoadHelper import com.yidianling.tests.home.widget.SwipeToLoadHelper
import de.greenrobot.event.EventBus import de.greenrobot.event.EventBus
import kotlinx.android.synthetic.main.testhome_activity.* import kotlinx.android.synthetic.main.tests_testhome_activity.*
import kotlinx.android.synthetic.main.testhome_bar.* import kotlinx.android.synthetic.main.tests_testhome_bar.*
import org.json.JSONObject import org.json.JSONObject
/** /**
...@@ -76,7 +76,7 @@ class TestHomeActivity : BaseMvpActivity<ITestHomeContract.View,ITestHomeContrac ...@@ -76,7 +76,7 @@ class TestHomeActivity : BaseMvpActivity<ITestHomeContract.View,ITestHomeContrac
} }
override fun layoutResId(): Int { override fun layoutResId(): Int {
return R.layout.testhome_activity return R.layout.tests_testhome_activity
} }
override fun initDataAndEvent() { override fun initDataAndEvent() {
......
...@@ -5,7 +5,7 @@ import android.view.View ...@@ -5,7 +5,7 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import com.yidianling.tests.R import com.yidianling.tests.R
import com.yidianling.tests.home.config.ITestHomeConfig import com.yidianling.tests.home.config.ITestHomeConfig
import kotlinx.android.synthetic.main.testhome_item_load_more.view.* import kotlinx.android.synthetic.main.tests_testhome_item_load_more.view.*
/** /**
...@@ -49,7 +49,7 @@ class AdapterWrapper(private val mAdapter: RecyclerView.Adapter<RecyclerView.Vie ...@@ -49,7 +49,7 @@ class AdapterWrapper(private val mAdapter: RecyclerView.Adapter<RecyclerView.Vie
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
if (viewType == ITEM_TYPE_LOAD) { if (viewType == ITEM_TYPE_LOAD) {
if (mWrapperHolder == null) { if (mWrapperHolder == null) {
var view = View.inflate(parent.context, R.layout.testhome_item_load_more, null) var view = View.inflate(parent.context, R.layout.tests_testhome_item_load_more, null)
view.setOnClickListener(this) view.setOnClickListener(this)
mWrapperHolder = WrapperHolder(view) mWrapperHolder = WrapperHolder(view)
} }
...@@ -132,7 +132,7 @@ class AdapterWrapper(private val mAdapter: RecyclerView.Adapter<RecyclerView.Vie ...@@ -132,7 +132,7 @@ class AdapterWrapper(private val mAdapter: RecyclerView.Adapter<RecyclerView.Vie
} }
fun setMoreDrawable(){ fun setMoreDrawable(){
val drawable = itemView.context.resources.getDrawable(R.drawable.testhome_more) val drawable = itemView.context.resources.getDrawable(R.drawable.tests_testhome_more)
/// 这一步必须要做,否则不会显示. /// 这一步必须要做,否则不会显示.
drawable.setBounds(0, 0, drawable.minimumWidth, drawable.minimumHeight) drawable.setBounds(0, 0, drawable.minimumWidth, drawable.minimumHeight)
itemView.item_load_tv.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null) itemView.item_load_tv.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null)
......
...@@ -86,7 +86,7 @@ class TestHomeAdapter(private val mContext: Context, ...@@ -86,7 +86,7 @@ class TestHomeAdapter(private val mContext: Context,
return RecommendedFirstViewHolder(TestHomeRecommendedFirstView(parent.context, testHomeEvent)) return RecommendedFirstViewHolder(TestHomeRecommendedFirstView(parent.context, testHomeEvent))
} }
else -> { else -> {
return EmptyViewHolder(View.inflate(parent.context, R.layout.testhome_empty, null)) return EmptyViewHolder(View.inflate(parent.context, R.layout.tests_testhome_empty, null))
} }
} }
} }
......
package com.yidianling.tests.home.param;
import com.ydl.ydlcommon.data.http.BaseCommand;
/**
* Created by haorui on 2019-11-01.
* Des:
*/
public class RecentCmd extends BaseCommand {
public RecentCmd() {
}
}
\ No newline at end of file
...@@ -168,7 +168,7 @@ class TestHomeUtils { ...@@ -168,7 +168,7 @@ class TestHomeUtils {
} else { } else {
hitBuffer.append(iHits.toInt()) hitBuffer.append(iHits.toInt())
} }
hitBuffer.append(context.resources.getString(R.string.testhome_hit)) hitBuffer.append(context.resources.getString(R.string.tests_testhome_hit))
return hitBuffer.toString() return hitBuffer.toString()
} }
...@@ -204,7 +204,7 @@ class TestHomeUtils { ...@@ -204,7 +204,7 @@ class TestHomeUtils {
} else { } else {
numBuffer.append(iNum.toInt()) numBuffer.append(iNum.toInt())
} }
numBuffer.append(context.resources.getString(R.string.testhome_peopletest)) numBuffer.append(context.resources.getString(R.string.tests_testhome_peopletest))
return numBuffer.toString() return numBuffer.toString()
} }
...@@ -237,8 +237,8 @@ class TestHomeUtils { ...@@ -237,8 +237,8 @@ class TestHomeUtils {
*/ */
fun priceStyle(context: Context, textView: TextView, content: String, subIndex: Int, EndIndex: Int) { fun priceStyle(context: Context, textView: TextView, content: String, subIndex: Int, EndIndex: Int) {
val sp = SpannableString(content) val sp = SpannableString(content)
sp.setSpan(TextAppearanceSpan(context, R.style.style_price_start), 0, subIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) sp.setSpan(TextAppearanceSpan(context, R.style.tests_style_price_start), 0, subIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
sp.setSpan(TextAppearanceSpan(context, R.style.style_price_end), subIndex, EndIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) sp.setSpan(TextAppearanceSpan(context, R.style.tests_style_price_end), subIndex, EndIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
textView.text = sp textView.text = sp
} }
/** /**
...@@ -246,8 +246,8 @@ class TestHomeUtils { ...@@ -246,8 +246,8 @@ class TestHomeUtils {
*/ */
fun priceStyleNew(context: Context, textView: TextView, content: String, subIndex: Int, EndIndex: Int) { fun priceStyleNew(context: Context, textView: TextView, content: String, subIndex: Int, EndIndex: Int) {
val sp = SpannableString(content) val sp = SpannableString(content)
sp.setSpan(TextAppearanceSpan(context, R.style.style_price_end), 0, subIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) sp.setSpan(TextAppearanceSpan(context, R.style.tests_style_price_end), 0, subIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
sp.setSpan(TextAppearanceSpan(context, R.style.style_price_start), subIndex, EndIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) sp.setSpan(TextAppearanceSpan(context, R.style.tests_style_price_start), subIndex, EndIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
textView.text = sp textView.text = sp
} }
......
...@@ -51,7 +51,7 @@ class TestHomeBannerAdapter( ...@@ -51,7 +51,7 @@ class TestHomeBannerAdapter(
imageView.scaleType = ImageView.ScaleType.FIT_XY imageView.scaleType = ImageView.ScaleType.FIT_XY
GlideApp.with(mContext) GlideApp.with(mContext)
.load(item.bannerImageUrl) .load(item.bannerImageUrl)
.placeholder(R.drawable.testhome_banner_nor) .placeholder(R.drawable.tests_testhome_banner_nor)
.centerCrop() .centerCrop()
.into(imageView) .into(imageView)
(mImageViews as ArrayList<ImageView>).add(imageView) (mImageViews as ArrayList<ImageView>).add(imageView)
......
...@@ -10,7 +10,7 @@ import com.yidianling.tests.R ...@@ -10,7 +10,7 @@ import com.yidianling.tests.R
import com.yidianling.tests.home.bean.TestHomeBodyBean import com.yidianling.tests.home.bean.TestHomeBodyBean
import com.yidianling.tests.home.bean.TestHomeDataBean import com.yidianling.tests.home.bean.TestHomeDataBean
import com.yidianling.tests.home.event.ITestHomeEvent import com.yidianling.tests.home.event.ITestHomeEvent
import kotlinx.android.synthetic.main.testhome_banner_view.view.* import kotlinx.android.synthetic.main.tests_testhome_banner_view.view.*
/** /**
* @author yuanwai * @author yuanwai
...@@ -44,7 +44,7 @@ class TestHomeBannerView(context: Context?, testHomeEvent: ITestHomeEvent) : Fra ...@@ -44,7 +44,7 @@ class TestHomeBannerView(context: Context?, testHomeEvent: ITestHomeEvent) : Fra
private fun initView() { private fun initView() {
val params = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) val params = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
View.inflate(context, R.layout.testhome_banner_view, this) View.inflate(context, R.layout.tests_testhome_banner_view, this)
layoutParams = params layoutParams = params
dp14 = RxImageTool.dip2px(14f) dp14 = RxImageTool.dip2px(14f)
dp4 = RxImageTool.dip2px(4f) dp4 = RxImageTool.dip2px(4f)
...@@ -82,7 +82,7 @@ class TestHomeBannerView(context: Context?, testHomeEvent: ITestHomeEvent) : Fra ...@@ -82,7 +82,7 @@ class TestHomeBannerView(context: Context?, testHomeEvent: ITestHomeEvent) : Fra
for (index in 0..count) { for (index in 0..count) {
urlLists.add((mDataList as ArrayList<TestHomeBodyBean>)[index].bannerImageUrl!!) urlLists.add((mDataList as ArrayList<TestHomeBodyBean>)[index].bannerImageUrl!!)
} }
banner.setImageLoader(GlideImageLoader(R.drawable.testhome_banner_nor)).setImages(urlLists).start() banner.setImageLoader(GlideImageLoader(R.drawable.tests_testhome_banner_nor)).setImages(urlLists).start()
banner.setOnBannerListener { banner.setOnBannerListener {
testHomeEvent!!.bannerClick((mDataList as ArrayList<TestHomeBodyBean>)[it].bannerLinkUrl, it, (mDataList as ArrayList<TestHomeBodyBean>)[it].bannerName) testHomeEvent!!.bannerClick((mDataList as ArrayList<TestHomeBodyBean>)[it].bannerLinkUrl, it, (mDataList as ArrayList<TestHomeBodyBean>)[it].bannerName)
...@@ -138,10 +138,10 @@ class TestHomeBannerView(context: Context?, testHomeEvent: ITestHomeEvent) : Fra ...@@ -138,10 +138,10 @@ class TestHomeBannerView(context: Context?, testHomeEvent: ITestHomeEvent) : Fra
// //
// if (index == 0) { // if (index == 0) {
// imageWidth = dp14 // imageWidth = dp14
// imageView.setBackgroundResource(R.drawable.testhome_tip_select) // imageView.setBackgroundResource(R.drawable.tests_testhome_tip_select)
// } else { // } else {
// imageWidth = dp4 // imageWidth = dp4
// imageView.setBackgroundResource(R.drawable.testhome_tip_unselect) // imageView.setBackgroundResource(R.drawable.tests_testhome_tip_unselect)
// } // }
// var layoutParams = LinearLayout.LayoutParams(imageWidth, dp4) // var layoutParams = LinearLayout.LayoutParams(imageWidth, dp4)
// imageView.scaleType = ImageView.ScaleType.FIT_XY // imageView.scaleType = ImageView.ScaleType.FIT_XY
...@@ -170,10 +170,10 @@ class TestHomeBannerView(context: Context?, testHomeEvent: ITestHomeEvent) : Fra ...@@ -170,10 +170,10 @@ class TestHomeBannerView(context: Context?, testHomeEvent: ITestHomeEvent) : Fra
// } // }
// if (i == selectItems) { // if (i == selectItems) {
// imageWidth = dp14 // imageWidth = dp14
// imageView.setBackgroundResource(R.drawable.testhome_tip_select) // imageView.setBackgroundResource(R.drawable.tests_testhome_tip_select)
// } else { // } else {
// imageWidth = dp4 // imageWidth = dp4
// imageView.setBackgroundResource(R.drawable.testhome_tip_unselect) // imageView.setBackgroundResource(R.drawable.tests_testhome_tip_unselect)
// } // }
// var params = LinearLayout.LayoutParams(imageWidth, dp4) // var params = LinearLayout.LayoutParams(imageWidth, dp4)
// params.leftMargin = margin // params.leftMargin = margin
......
...@@ -17,7 +17,7 @@ import com.yidianling.tests.home.bean.TestHomeCategoryBean ...@@ -17,7 +17,7 @@ import com.yidianling.tests.home.bean.TestHomeCategoryBean
import com.yidianling.tests.home.bean.TestHomeDataBean import com.yidianling.tests.home.bean.TestHomeDataBean
import com.yidianling.tests.home.event.ITestHomeEvent import com.yidianling.tests.home.event.ITestHomeEvent
import com.ydl.ydlcommon.utils.ScreenUtil import com.ydl.ydlcommon.utils.ScreenUtil
import kotlinx.android.synthetic.main.testhome_category_view.view.* import kotlinx.android.synthetic.main.tests_testhome_category_view.view.*
import java.util.* import java.util.*
/** /**
...@@ -91,7 +91,7 @@ class TestHomeCategoryView(mContext: Context, testHomeEvent: ITestHomeEvent) : L ...@@ -91,7 +91,7 @@ class TestHomeCategoryView(mContext: Context, testHomeEvent: ITestHomeEvent) : L
*/ */
private fun initView() { private fun initView() {
orientation = VERTICAL orientation = VERTICAL
View.inflate(context, R.layout.testhome_category_view, this) View.inflate(context, R.layout.tests_testhome_category_view, this)
val params = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) val params = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params layoutParams = params
initArgs() initArgs()
...@@ -191,7 +191,7 @@ class TestHomeCategoryView(mContext: Context, testHomeEvent: ITestHomeEvent) : L ...@@ -191,7 +191,7 @@ class TestHomeCategoryView(mContext: Context, testHomeEvent: ITestHomeEvent) : L
* 加载图片 * 加载图片
*/ */
private fun bindIconData(imageView: ImageView, categoryBean: TestHomeCategoryBean) { private fun bindIconData(imageView: ImageView, categoryBean: TestHomeCategoryBean) {
GlideApp.with(context).load(categoryBean.categoryUrl).placeholder(R.drawable.testhome_type_nor) GlideApp.with(context).load(categoryBean.categoryUrl).placeholder(R.drawable.tests_testhome_type_nor)
.centerCrop().into(imageView) .centerCrop().into(imageView)
} }
...@@ -240,7 +240,7 @@ class TestHomeCategoryView(mContext: Context, testHomeEvent: ITestHomeEvent) : L ...@@ -240,7 +240,7 @@ class TestHomeCategoryView(mContext: Context, testHomeEvent: ITestHomeEvent) : L
lineParam.rightMargin = dp15 lineParam.rightMargin = dp15
lineParam.topMargin = multiple * (imageViewWidth + dp8 + textViewHeight) + dp8 lineParam.topMargin = multiple * (imageViewWidth + dp8 + textViewHeight) + dp8
lineView = View(context) lineView = View(context)
lineView!!.setBackgroundColor(resources.getColor(R.color.testhome_line)) lineView!!.setBackgroundColor(resources.getColor(R.color.tests_testhome_line))
lineView!!.layoutParams = lineParam lineView!!.layoutParams = lineParam
} }
......
...@@ -13,7 +13,7 @@ import com.yidianling.tests.R ...@@ -13,7 +13,7 @@ import com.yidianling.tests.R
import com.yidianling.tests.home.bean.TestHomeBodyBean import com.yidianling.tests.home.bean.TestHomeBodyBean
import com.yidianling.tests.home.event.ITestHomeEvent import com.yidianling.tests.home.event.ITestHomeEvent
import com.yidianling.tests.home.utils.TestHomeUtils import com.yidianling.tests.home.utils.TestHomeUtils
import kotlinx.android.synthetic.main.testhome_dailyitem_view.view.* import kotlinx.android.synthetic.main.tests_testhome_dailyitem_view.view.*
/** /**
* @author yuanwai * @author yuanwai
...@@ -40,7 +40,7 @@ class TestHomeDailyHorizoItemView(mContext: Context, testHomeEvent: ITestHomeEve ...@@ -40,7 +40,7 @@ class TestHomeDailyHorizoItemView(mContext: Context, testHomeEvent: ITestHomeEve
*/ */
private fun initView() { private fun initView() {
var params = LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT) var params = LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)
View.inflate(context, R.layout.testhome_dailyitem_view, this) View.inflate(context, R.layout.tests_testhome_dailyitem_view, this)
var dp6 = RxImageTool.dip2px(6f) var dp6 = RxImageTool.dip2px(6f)
if (isRight!!) { if (isRight!!) {
params.setMargins(dp6, RxImageTool.dip2px(5f), RxImageTool.dip2px(15f), RxImageTool.dip2px(5f)) params.setMargins(dp6, RxImageTool.dip2px(5f), RxImageTool.dip2px(15f), RxImageTool.dip2px(5f))
...@@ -57,7 +57,7 @@ class TestHomeDailyHorizoItemView(mContext: Context, testHomeEvent: ITestHomeEve ...@@ -57,7 +57,7 @@ class TestHomeDailyHorizoItemView(mContext: Context, testHomeEvent: ITestHomeEve
*/ */
fun initData(bodyBean: TestHomeBodyBean, position: Int) { fun initData(bodyBean: TestHomeBodyBean, position: Int) {
GlideApp.with(context).load(bodyBean.dailyImageUrl) GlideApp.with(context).load(bodyBean.dailyImageUrl)
.placeholder(R.drawable.testhome_list_nor) .placeholder(R.drawable.tests_testhome_list_nor)
.centerCrop().into(img_icon) .centerCrop().into(img_icon)
tv_title.text = bodyBean.dailyTitle tv_title.text = bodyBean.dailyTitle
tv_content.text = TestHomeUtils.getNum(context, bodyBean.dailyContent) tv_content.text = TestHomeUtils.getNum(context, bodyBean.dailyContent)
...@@ -80,13 +80,13 @@ class TestHomeDailyHorizoItemView(mContext: Context, testHomeEvent: ITestHomeEve ...@@ -80,13 +80,13 @@ class TestHomeDailyHorizoItemView(mContext: Context, testHomeEvent: ITestHomeEve
|| "0.0" == price || "0.0" == price
|| "0.00" == price){ || "0.00" == price){
tv_price.text = "免费" tv_price.text = "免费"
tv_price.setBackgroundResource(R.drawable.testhome_recom_price_bg) tv_price.setBackgroundResource(R.drawable.tests_testhome_recom_price_bg)
tv_price.setTextColor(Color.parseColor("#34CD65")) tv_price.setTextColor(Color.parseColor("#34CD65"))
} else { } else {
var newPrice = TestHomeUtils.getOriginalPrice(tv_coupon_money,price,couponMoney) var newPrice = TestHomeUtils.getOriginalPrice(tv_coupon_money,price,couponMoney)
var priceContent = "¥$newPrice" var priceContent = "¥$newPrice"
TestHomeUtils.priceStyleNew(context, tv_price, priceContent, 1, priceContent.length) TestHomeUtils.priceStyleNew(context, tv_price, priceContent, 1, priceContent.length)
tv_price.setBackgroundResource(R.drawable.testhome_null) tv_price.setBackgroundResource(R.drawable.tests_testhome_null)
} }
} }
} }
\ No newline at end of file
...@@ -6,7 +6,7 @@ import android.widget.HorizontalScrollView ...@@ -6,7 +6,7 @@ import android.widget.HorizontalScrollView
import com.yidianling.tests.R import com.yidianling.tests.R
import com.yidianling.tests.home.bean.TestHomeBodyBean import com.yidianling.tests.home.bean.TestHomeBodyBean
import com.yidianling.tests.home.event.ITestHomeEvent import com.yidianling.tests.home.event.ITestHomeEvent
import kotlinx.android.synthetic.main.testhome_dailyhorizo_view.view.* import kotlinx.android.synthetic.main.tests_testhome_dailyhorizo_view.view.*
/** /**
* @author yuanwai * @author yuanwai
...@@ -29,7 +29,7 @@ class TestHomeDailyHorizoView(mContext: Context, testHomeEvent: ITestHomeEvent) ...@@ -29,7 +29,7 @@ class TestHomeDailyHorizoView(mContext: Context, testHomeEvent: ITestHomeEvent)
* 界面初始化 * 界面初始化
*/ */
private fun initView() { private fun initView() {
View.inflate(context, R.layout.testhome_dailyhorizo_view, this) View.inflate(context, R.layout.tests_testhome_dailyhorizo_view, this)
isVerticalScrollBarEnabled = false isVerticalScrollBarEnabled = false
isHorizontalScrollBarEnabled = false isHorizontalScrollBarEnabled = false
} }
......
...@@ -9,7 +9,7 @@ import com.yidianling.tests.R ...@@ -9,7 +9,7 @@ import com.yidianling.tests.R
import com.yidianling.tests.home.bean.TestHomeDataBean import com.yidianling.tests.home.bean.TestHomeDataBean
import com.yidianling.tests.home.contract.ITestHomeContract import com.yidianling.tests.home.contract.ITestHomeContract
import com.yidianling.tests.home.event.ITestHomeEvent import com.yidianling.tests.home.event.ITestHomeEvent
import kotlinx.android.synthetic.main.testhome_daily_view.view.* import kotlinx.android.synthetic.main.tests_testhome_daily_view.view.*
/** /**
* @author yuanwai * @author yuanwai
...@@ -51,8 +51,8 @@ class TestHomeDailyView(mContext: Context, ...@@ -51,8 +51,8 @@ class TestHomeDailyView(mContext: Context,
private fun initView() { private fun initView() {
var params = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) var params = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params layoutParams = params
mView = View.inflate(context, R.layout.testhome_daily_view, this) mView = View.inflate(context, R.layout.tests_testhome_daily_view, this)
testhome_dailyRight.setOnClickListener { tests_testhome_dailyRight.setOnClickListener {
testHomeView!!.dailyChange() testHomeView!!.dailyChange()
} }
} }
...@@ -105,7 +105,7 @@ class TestHomeDailyView(mContext: Context, ...@@ -105,7 +105,7 @@ class TestHomeDailyView(mContext: Context,
} else { } else {
var params = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) var params = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
dailyHorizoView = TestHomeDailyHorizoView(context, testHomeEvent!!) dailyHorizoView = TestHomeDailyHorizoView(context, testHomeEvent!!)
dailyHorizoView.id = R.id.testhome_daily dailyHorizoView.id = R.id.tests_testhome_daily
dailyHorizoView.couponMoney = this.couponMoney dailyHorizoView.couponMoney = this.couponMoney
dailyHorizoView.initData(mDataBean!!.body!!) dailyHorizoView.initData(mDataBean!!.body!!)
params.addRule(BELOW, R.id.tv_title) params.addRule(BELOW, R.id.tv_title)
...@@ -123,8 +123,8 @@ class TestHomeDailyView(mContext: Context, ...@@ -123,8 +123,8 @@ class TestHomeDailyView(mContext: Context,
hasLine = true hasLine = true
var param = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, RxImageTool.dip2px(9f)) var param = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, RxImageTool.dip2px(9f))
var bottomLine = View(context) var bottomLine = View(context)
bottomLine.setBackgroundColor(resources.getColor(R.color.testhome_line)) bottomLine.setBackgroundColor(resources.getColor(R.color.tests_testhome_line))
param.addRule(BELOW, R.id.testhome_daily) param.addRule(BELOW, R.id.tests_testhome_daily)
bottomLine.layoutParams = param bottomLine.layoutParams = param
addView(bottomLine) addView(bottomLine)
} }
......
...@@ -13,8 +13,8 @@ import android.widget.FrameLayout ...@@ -13,8 +13,8 @@ import android.widget.FrameLayout
import com.yidianling.tests.R import com.yidianling.tests.R
import com.yidianling.tests.home.bean.TestHomeBodyBean import com.yidianling.tests.home.bean.TestHomeBodyBean
import com.yidianling.tests.home.event.ITestHomeEvent import com.yidianling.tests.home.event.ITestHomeEvent
import kotlinx.android.synthetic.main.testhome_realtest_view_in.view.* import kotlinx.android.synthetic.main.tests_testhome_realtest_view_in.view.*
import kotlinx.android.synthetic.main.testhome_realtest_view_out.view.* import kotlinx.android.synthetic.main.tests_testhome_realtest_view_out.view.*
/** /**
* @author yuanwai * @author yuanwai
...@@ -70,8 +70,8 @@ class TestHomeRealTestView(mContext : Context,testHomeEvent : ITestHomeEvent) : ...@@ -70,8 +70,8 @@ class TestHomeRealTestView(mContext : Context,testHomeEvent : ITestHomeEvent) :
*/ */
private fun initView() { private fun initView() {
var params = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT) var params = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT)
view_out = View.inflate(context, R.layout.testhome_realtest_view_out,null) view_out = View.inflate(context, R.layout.tests_testhome_realtest_view_out,null)
view_in = View.inflate(context, R.layout.testhome_realtest_view_in,null) view_in = View.inflate(context, R.layout.tests_testhome_realtest_view_in,null)
addView(view_out) addView(view_out)
addView(view_in) addView(view_in)
layoutParams = params layoutParams = params
...@@ -174,11 +174,11 @@ class TestHomeRealTestView(mContext : Context,testHomeEvent : ITestHomeEvent) : ...@@ -174,11 +174,11 @@ class TestHomeRealTestView(mContext : Context,testHomeEvent : ITestHomeEvent) :
private fun getName(name : String?) : String{ private fun getName(name : String?) : String{
var nameBuffer = StringBuffer() var nameBuffer = StringBuffer()
nameBuffer.append(resources.getString(R.string.testhome_just)) nameBuffer.append(resources.getString(R.string.tests_testhome_just))
nameBuffer.append(" ") nameBuffer.append(" ")
nameBuffer.append(name) nameBuffer.append(name)
nameBuffer.append(" ") nameBuffer.append(" ")
nameBuffer.append(resources.getString(R.string.testhome_test)) nameBuffer.append(resources.getString(R.string.tests_testhome_test))
return nameBuffer.toString() return nameBuffer.toString()
} }
......
...@@ -10,6 +10,7 @@ import android.widget.FrameLayout ...@@ -10,6 +10,7 @@ import android.widget.FrameLayout
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import com.ydl.ydl_image.module.GlideApp import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.utils.ScreenUtil
import com.yidianling.common.tools.LogUtil import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxImageTool import com.yidianling.common.tools.RxImageTool
import com.yidianling.tests.R import com.yidianling.tests.R
...@@ -17,8 +18,7 @@ import com.yidianling.tests.home.bean.TestHomeBodyBean ...@@ -17,8 +18,7 @@ import com.yidianling.tests.home.bean.TestHomeBodyBean
import com.yidianling.tests.home.bean.TestHomeDataBean import com.yidianling.tests.home.bean.TestHomeDataBean
import com.yidianling.tests.home.event.ITestHomeEvent import com.yidianling.tests.home.event.ITestHomeEvent
import com.yidianling.tests.home.utils.TestHomeUtils import com.yidianling.tests.home.utils.TestHomeUtils
import com.ydl.ydlcommon.utils.ScreenUtil import kotlinx.android.synthetic.main.tests_testhome_recommend_first_view.view.*
import kotlinx.android.synthetic.main.testhome_recommend_first_view.view.*
/** /**
* @author yuanwai * @author yuanwai
...@@ -47,7 +47,7 @@ class TestHomeRecommendedFirstView(mContext: Context, testHomeEvent: ITestHomeEv ...@@ -47,7 +47,7 @@ class TestHomeRecommendedFirstView(mContext: Context, testHomeEvent: ITestHomeEv
* 界面初始化 * 界面初始化
*/ */
private fun initView() { private fun initView() {
View.inflate(context, R.layout.testhome_recommend_first_view, this) View.inflate(context, R.layout.tests_testhome_recommend_first_view, this)
imgWidth = ScreenUtil.screenWidth - RxImageTool.dip2px(30f) imgWidth = ScreenUtil.screenWidth - RxImageTool.dip2px(30f)
initImageParam() initImageParam()
addTitle() addTitle()
...@@ -62,11 +62,11 @@ class TestHomeRecommendedFirstView(mContext: Context, testHomeEvent: ITestHomeEv ...@@ -62,11 +62,11 @@ class TestHomeRecommendedFirstView(mContext: Context, testHomeEvent: ITestHomeEv
params.leftMargin = RxImageTool.dip2px(15f) params.leftMargin = RxImageTool.dip2px(15f)
params.topMargin = RxImageTool.dip2px(30f) params.topMargin = RxImageTool.dip2px(30f)
val titleView = TextView(context) val titleView = TextView(context)
titleView.id = R.id.testhome_recommenTitle titleView.id = R.id.tests_testhome_recommenTitle
titleView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18f) titleView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18f)
titleView.setTextColor(resources.getColor(R.color.testhome_title)) titleView.setTextColor(resources.getColor(R.color.tests_testhome_title))
val drawable = resources.getDrawable(R.drawable.testhome_hot) val drawable = resources.getDrawable(R.drawable.tests_testhome_hot)
/// 这一步必须要做,否则不会显示. /// 这一步必须要做,否则不会显示.
drawable.setBounds(0, 0, drawable.minimumWidth, drawable.minimumHeight) drawable.setBounds(0, 0, drawable.minimumWidth, drawable.minimumHeight)
titleView.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null) titleView.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null)
...@@ -81,7 +81,7 @@ class TestHomeRecommendedFirstView(mContext: Context, testHomeEvent: ITestHomeEv ...@@ -81,7 +81,7 @@ class TestHomeRecommendedFirstView(mContext: Context, testHomeEvent: ITestHomeEv
return return
} }
//设置标题 //设置标题
findViewById<TextView>(R.id.testhome_recommenTitle).text = dataBean.head!!.title findViewById<TextView>(R.id.tests_testhome_recommenTitle).text = dataBean.head!!.title
//设置推荐列表数据 //设置推荐列表数据
initRecommeded(dataBean.body!![0], position) initRecommeded(dataBean.body!![0], position)
} }
...@@ -99,7 +99,7 @@ class TestHomeRecommendedFirstView(mContext: Context, testHomeEvent: ITestHomeEv ...@@ -99,7 +99,7 @@ class TestHomeRecommendedFirstView(mContext: Context, testHomeEvent: ITestHomeEv
tv_recomContent.text = bodyBean.recommendedContent tv_recomContent.text = bodyBean.recommendedContent
setPrice(bodyBean.recommendedPrice) setPrice(bodyBean.recommendedPrice)
tv_recomNum.text = TestHomeUtils.getNum(context, bodyBean.recommendedNum) tv_recomNum.text = TestHomeUtils.getNum(context, bodyBean.recommendedNum)
GlideApp.with(context).load(bodyBean.recommendedUrl).placeholder(R.drawable.testhome_banner_nor) GlideApp.with(context).load(bodyBean.recommendedUrl).placeholder(R.drawable.tests_testhome_banner_nor)
.into(img_recom) .into(img_recom)
LogUtil.e("宽:${img_recom.measuredWidth};高${img_recom.measuredHeight}") LogUtil.e("宽:${img_recom.measuredWidth};高${img_recom.measuredHeight}")
tv_Hits.text = TestHomeUtils.getHits(context, bodyBean.recommendedHits) tv_Hits.text = TestHomeUtils.getHits(context, bodyBean.recommendedHits)
...@@ -117,13 +117,13 @@ class TestHomeRecommendedFirstView(mContext: Context, testHomeEvent: ITestHomeEv ...@@ -117,13 +117,13 @@ class TestHomeRecommendedFirstView(mContext: Context, testHomeEvent: ITestHomeEv
tv_recomPrice.visibility = View.VISIBLE tv_recomPrice.visibility = View.VISIBLE
if ("免费" == price) { if ("免费" == price) {
tv_recomPrice.text = price tv_recomPrice.text = price
tv_recomPrice.setBackgroundResource(R.drawable.testhome_recom_price_bg) tv_recomPrice.setBackgroundResource(R.drawable.tests_testhome_recom_price_bg)
tv_recomPrice.setTextColor(Color.parseColor("#34CD65")) tv_recomPrice.setTextColor(Color.parseColor("#34CD65"))
} else { } else {
var newPrice = TestHomeUtils.getOriginalPrice(tv_coupon_money,price,couponMoney) var newPrice = TestHomeUtils.getOriginalPrice(tv_coupon_money,price,couponMoney)
var priceContent = "¥$newPrice" var priceContent = "¥$newPrice"
TestHomeUtils.priceStyleNew(context, tv_recomPrice, priceContent, 1, priceContent.length) TestHomeUtils.priceStyleNew(context, tv_recomPrice, priceContent, 1, priceContent.length)
tv_recomPrice.setBackgroundResource(R.drawable.testhome_null) tv_recomPrice.setBackgroundResource(R.drawable.tests_testhome_null)
} }
} }
......
...@@ -13,7 +13,7 @@ import com.yidianling.tests.home.bean.TestHomeBodyBean ...@@ -13,7 +13,7 @@ import com.yidianling.tests.home.bean.TestHomeBodyBean
import com.yidianling.tests.home.bean.TestHomeDataBean import com.yidianling.tests.home.bean.TestHomeDataBean
import com.yidianling.tests.home.event.ITestHomeEvent import com.yidianling.tests.home.event.ITestHomeEvent
import com.yidianling.tests.home.utils.TestHomeUtils import com.yidianling.tests.home.utils.TestHomeUtils
import kotlinx.android.synthetic.main.testhome_recommended_view.view.* import kotlinx.android.synthetic.main.tests_testhome_recommended_view.view.*
/** /**
* @author yuanwai * @author yuanwai
...@@ -38,7 +38,7 @@ class TestHomeRecommendedView(mContext: Context, testHomeEvent: ITestHomeEvent) ...@@ -38,7 +38,7 @@ class TestHomeRecommendedView(mContext: Context, testHomeEvent: ITestHomeEvent)
* 界面初始化 * 界面初始化
*/ */
private fun initView() { private fun initView() {
View.inflate(context, R.layout.testhome_recommended_view, this) View.inflate(context, R.layout.tests_testhome_recommended_view, this)
dp2 = RxImageTool.dip2px(2f) dp2 = RxImageTool.dip2px(2f)
dp5 = RxImageTool.dip2px(5f) dp5 = RxImageTool.dip2px(5f)
} }
...@@ -64,7 +64,7 @@ class TestHomeRecommendedView(mContext: Context, testHomeEvent: ITestHomeEvent) ...@@ -64,7 +64,7 @@ class TestHomeRecommendedView(mContext: Context, testHomeEvent: ITestHomeEvent)
setPrice(bodyBean.recommendedPrice) setPrice(bodyBean.recommendedPrice)
tv_recomNum.text = TestHomeUtils.getNum(context, bodyBean.recommendedNum) tv_recomNum.text = TestHomeUtils.getNum(context, bodyBean.recommendedNum)
GlideApp.with(context).load(bodyBean.recommendedUrl) GlideApp.with(context).load(bodyBean.recommendedUrl)
.placeholder(R.drawable.testhome_list_nor) .placeholder(R.drawable.tests_testhome_list_nor)
.centerCrop().into(img_recom) .centerCrop().into(img_recom)
tv_Hits.text = TestHomeUtils.getHits(context, bodyBean.recommendedHits) tv_Hits.text = TestHomeUtils.getHits(context, bodyBean.recommendedHits)
setOnClickListener { setOnClickListener {
...@@ -81,7 +81,7 @@ class TestHomeRecommendedView(mContext: Context, testHomeEvent: ITestHomeEvent) ...@@ -81,7 +81,7 @@ class TestHomeRecommendedView(mContext: Context, testHomeEvent: ITestHomeEvent)
if ("免费" == price){ if ("免费" == price){
tv_recomPrice.setPadding(dp5!!,dp2!!,dp5!!,dp2!!) tv_recomPrice.setPadding(dp5!!,dp2!!,dp5!!,dp2!!)
tv_recomPrice.text = price tv_recomPrice.text = price
tv_recomPrice.setBackgroundResource(R.drawable.testhome_recom_price_bg) tv_recomPrice.setBackgroundResource(R.drawable.tests_testhome_recom_price_bg)
tv_recomPrice.setTextColor(Color.parseColor("#34CD65")) tv_recomPrice.setTextColor(Color.parseColor("#34CD65"))
tv_coupon_money.visibility = View.GONE tv_coupon_money.visibility = View.GONE
}else{ }else{
...@@ -89,7 +89,7 @@ class TestHomeRecommendedView(mContext: Context, testHomeEvent: ITestHomeEvent) ...@@ -89,7 +89,7 @@ class TestHomeRecommendedView(mContext: Context, testHomeEvent: ITestHomeEvent)
tv_recomPrice.setPadding(0,dp2!!,dp5!!,dp2!!) tv_recomPrice.setPadding(0,dp2!!,dp5!!,dp2!!)
var priceContent = "¥$newPrice" var priceContent = "¥$newPrice"
TestHomeUtils.priceStyleNew(context,tv_recomPrice,priceContent, 1, priceContent.length) TestHomeUtils.priceStyleNew(context,tv_recomPrice,priceContent, 1, priceContent.length)
tv_recomPrice.setBackgroundResource(R.drawable.testhome_null) tv_recomPrice.setBackgroundResource(R.drawable.tests_testhome_null)
} }
} }
} }
\ No newline at end of file
...@@ -31,7 +31,7 @@ import com.yidianling.tests.list.view.adapter.TestListPagerAdapter ...@@ -31,7 +31,7 @@ import com.yidianling.tests.list.view.adapter.TestListPagerAdapter
import com.yidianling.tests.list.view.widget.CategoryPopupWindow import com.yidianling.tests.list.view.widget.CategoryPopupWindow
import com.yidianling.tests.router.TestsIn import com.yidianling.tests.router.TestsIn
import com.yidianling.tests.search.TestSearchActivity import com.yidianling.tests.search.TestSearchActivity
import kotlinx.android.synthetic.main.activity_test_category_list.* import kotlinx.android.synthetic.main.tests_activity_test_category_list.*
@Route(path = "/ceshi/category_list") @Route(path = "/ceshi/category_list")
class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListActivityPresenter>(), TestListActivityView, PopupWindow.OnDismissListener { class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListActivityPresenter>(), TestListActivityView, PopupWindow.OnDismissListener {
...@@ -95,7 +95,7 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA ...@@ -95,7 +95,7 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
} }
override fun layoutResId(): Int { override fun layoutResId(): Int {
return R.layout.activity_test_category_list return R.layout.tests_activity_test_category_list
} }
override fun initDataAndEvent() { override fun initDataAndEvent() {
......
...@@ -23,13 +23,13 @@ import com.yidianling.tests.list.presenter.TestListActivityPresenter ...@@ -23,13 +23,13 @@ import com.yidianling.tests.list.presenter.TestListActivityPresenter
import com.yidianling.tests.list.view.adapter.TestListPagerAdapter import com.yidianling.tests.list.view.adapter.TestListPagerAdapter
import com.yidianling.tests.router.TestsIn import com.yidianling.tests.router.TestsIn
import com.yidianling.tests.search.TestSearchActivity import com.yidianling.tests.search.TestSearchActivity
import kotlinx.android.synthetic.main.activity_test_list.* import kotlinx.android.synthetic.main.tests_activity_test_list.*
@Route(path = "/ceshi/list") @Route(path = "/ceshi/list")
class TestListActivity : BaseMvpActivity<TestListActivityView, TestListActivityPresenter>(), TestListActivityView { class TestListActivity : BaseMvpActivity<TestListActivityView, TestListActivityPresenter>(), TestListActivityView {
override fun layoutResId(): Int { override fun layoutResId(): Int {
return R.layout.activity_test_list return R.layout.tests_activity_test_list
} }
override fun initDataAndEvent() { override fun initDataAndEvent() {
......
...@@ -38,7 +38,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers ...@@ -38,7 +38,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable import io.reactivex.disposables.Disposable
import io.reactivex.functions.Consumer import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.fragment_test_list.* import kotlinx.android.synthetic.main.tests_fragment_test_list.*
import java.util.* import java.util.*
class TestListFragment : BaseFragment(), MyBaseAdapter.OnItemClickListener<Test> { class TestListFragment : BaseFragment(), MyBaseAdapter.OnItemClickListener<Test> {
...@@ -52,7 +52,7 @@ class TestListFragment : BaseFragment(), MyBaseAdapter.OnItemClickListener<Test> ...@@ -52,7 +52,7 @@ class TestListFragment : BaseFragment(), MyBaseAdapter.OnItemClickListener<Test>
} }
override fun layoutResId(): Int { override fun layoutResId(): Int {
return R.layout.fragment_test_list return R.layout.tests_fragment_test_list
} }
private var category: String? = null //测试类型id private var category: String? = null //测试类型id
...@@ -152,7 +152,7 @@ class TestListFragment : BaseFragment(), MyBaseAdapter.OnItemClickListener<Test> ...@@ -152,7 +152,7 @@ class TestListFragment : BaseFragment(), MyBaseAdapter.OnItemClickListener<Test>
.put("test_type", categoryName ?: "") .put("test_type", categoryName ?: "")
.burryPoint("testClick") .burryPoint("testClick")
if (v == null || data == null) { if (v == null || data == null) {
ToastUtil.toastShort(getString(R.string.wrong_args)) ToastUtil.toastShort(getString(R.string.tests_wrong_args))
return return
} }
//如果列表是待支付 的话 则跳转 支付界面 //如果列表是待支付 的话 则跳转 支付界面
......
...@@ -10,7 +10,7 @@ import android.view.ViewGroup ...@@ -10,7 +10,7 @@ import android.view.ViewGroup
import android.widget.TextView import android.widget.TextView
import com.yidianling.tests.R import com.yidianling.tests.R
import com.yidianling.tests.list.model.bean.CategotyPopItem import com.yidianling.tests.list.model.bean.CategotyPopItem
import kotlinx.android.synthetic.main.item_tab_pop_sort.view.* import kotlinx.android.synthetic.main.tests_item_tab_pop_sort.view.*
/** /**
* Created by zqk on 17-9-20. * Created by zqk on 17-9-20.
...@@ -24,7 +24,7 @@ class CategoryConditionRecyclerViewAdapter(private val context: Context, ...@@ -24,7 +24,7 @@ class CategoryConditionRecyclerViewAdapter(private val context: Context,
var lastSelectText : String ?= null var lastSelectText : String ?= null
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder { override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder {
val itemView = LayoutInflater.from(context).inflate(R.layout.item_tab_pop_sort, parent, false) val itemView = LayoutInflater.from(context).inflate(R.layout.tests_item_tab_pop_sort, parent, false)
return ViewHolder(itemView) return ViewHolder(itemView)
} }
......
...@@ -15,8 +15,8 @@ import com.yidianling.tests.R ...@@ -15,8 +15,8 @@ import com.yidianling.tests.R
import com.yidianling.tests.home.utils.TestHomeUtils import com.yidianling.tests.home.utils.TestHomeUtils
import com.yidianling.tests.list.model.bean.Test import com.yidianling.tests.list.model.bean.Test
import kotlinx.android.synthetic.main.testlist_item_view.view.* import kotlinx.android.synthetic.main.tests_testlist_item_view.view.*
import kotlinx.android.synthetic.main.view_footview_loadmore.view.* import kotlinx.android.synthetic.main.tests_view_footview_loadmore.view.*
/** /**
...@@ -77,7 +77,7 @@ class TestListRecyclerAdapter(private val context: Context, ...@@ -77,7 +77,7 @@ class TestListRecyclerAdapter(private val context: Context,
.dontAnimate() .dontAnimate()
.dontTransform() .dontTransform()
// .diskCacheStrategy(DiskCacheStrategy.ALL) // .diskCacheStrategy(DiskCacheStrategy.ALL)
.placeholder(R.drawable.default_img) .placeholder(R.drawable.tests_default_img)
.into(holder.ivCover) .into(holder.ivCover)
holder.tvTitle.text = test.name holder.tvTitle.text = test.name
holder.tvTestCount.text =TestHomeUtils.getNumNew(context, test.count) holder.tvTestCount.text =TestHomeUtils.getNumNew(context, test.count)
...@@ -90,11 +90,11 @@ class TestListRecyclerAdapter(private val context: Context, ...@@ -90,11 +90,11 @@ class TestListRecyclerAdapter(private val context: Context,
holder.pbLoading.visibility = View.VISIBLE holder.pbLoading.visibility = View.VISIBLE
holder.ivNoMoreLeft.visibility = View.GONE holder.ivNoMoreLeft.visibility = View.GONE
holder.ivNoMoreRight.visibility = View.GONE holder.ivNoMoreRight.visibility = View.GONE
holder.tvContent.text = context.getString(R.string.loading) holder.tvContent.text = context.getString(R.string.tests_loading)
} else { } else {
holder.pbLoading.visibility = View.GONE holder.pbLoading.visibility = View.GONE
holder.tvContent.text = context.getString(R.string.load_end) holder.tvContent.text = context.getString(R.string.tests_load_end)
holder.ivNoMoreLeft.visibility = View.VISIBLE holder.ivNoMoreLeft.visibility = View.VISIBLE
holder.ivNoMoreRight.visibility = View.VISIBLE holder.ivNoMoreRight.visibility = View.VISIBLE
} }
...@@ -117,14 +117,14 @@ class TestListRecyclerAdapter(private val context: Context, ...@@ -117,14 +117,14 @@ class TestListRecyclerAdapter(private val context: Context,
tvCoupon.visibility = View.GONE tvCoupon.visibility = View.GONE
textView.setPadding(dp5!!,dp2!!,dp5!!,dp2!!) textView.setPadding(dp5!!,dp2!!,dp5!!,dp2!!)
textView.text = "免费" textView.text = "免费"
textView.setBackgroundResource(R.drawable.testhome_recom_price_bg) textView.setBackgroundResource(R.drawable.tests_testhome_recom_price_bg)
textView.setTextColor(Color.parseColor("#34CD65")) textView.setTextColor(Color.parseColor("#34CD65"))
}else{ }else{
var newPrice = TestHomeUtils.getOriginalPrice(tvCoupon,price,couponMoney) var newPrice = TestHomeUtils.getOriginalPrice(tvCoupon,price,couponMoney)
textView.setPadding(0,dp5!!,dp5!!,0) textView.setPadding(0,dp5!!,dp5!!,0)
var priceContent = "¥$newPrice" var priceContent = "¥$newPrice"
TestHomeUtils.priceStyleNew(context,textView,priceContent, 1, priceContent.length) TestHomeUtils.priceStyleNew(context,textView,priceContent, 1, priceContent.length)
textView.setBackgroundResource(R.drawable.testhome_null) textView.setBackgroundResource(R.drawable.tests_testhome_null)
} }
} }
...@@ -134,13 +134,13 @@ class TestListRecyclerAdapter(private val context: Context, ...@@ -134,13 +134,13 @@ class TestListRecyclerAdapter(private val context: Context,
} else if (viewType == TYPE_NORMAL) { } else if (viewType == TYPE_NORMAL) {
var view :View ?=null var view :View ?=null
if (pageType== PAGE_TYPE_CATEGORY){ if (pageType== PAGE_TYPE_CATEGORY){
view = LayoutInflater.from(parent?.context).inflate(R.layout.item_category_testlist_view, parent, false) view = LayoutInflater.from(parent?.context).inflate(R.layout.tests_item_category_testlist_view, parent, false)
}else { }else {
view = LayoutInflater.from(parent?.context).inflate(R.layout.testlist_item_view, parent, false) view = LayoutInflater.from(parent?.context).inflate(R.layout.tests_testlist_item_view, parent, false)
} }
NormalViewHolder(view!!) NormalViewHolder(view!!)
} else { } else {
val view = LayoutInflater.from(parent?.context).inflate(R.layout.view_footview_loadmore, parent, false) val view = LayoutInflater.from(parent?.context).inflate(R.layout.tests_view_footview_loadmore, parent, false)
FootViewHolder(view) FootViewHolder(view)
} }
} }
......
...@@ -9,7 +9,7 @@ import android.widget.PopupWindow ...@@ -9,7 +9,7 @@ import android.widget.PopupWindow
import com.yidianling.tests.R import com.yidianling.tests.R
import com.yidianling.tests.list.model.bean.CategotyPopItem import com.yidianling.tests.list.model.bean.CategotyPopItem
import com.yidianling.tests.list.view.adapter.CategoryConditionRecyclerViewAdapter import com.yidianling.tests.list.view.adapter.CategoryConditionRecyclerViewAdapter
import kotlinx.android.synthetic.main.ui_category_sort_popup_window.view.* import kotlinx.android.synthetic.main.tests_ui_category_sort_popup_window.view.*
/** /**
* 排序弹窗 * 排序弹窗
...@@ -23,7 +23,7 @@ class CategoryPopupWindow(val context: Context, ...@@ -23,7 +23,7 @@ class CategoryPopupWindow(val context: Context,
var adapter: CategoryConditionRecyclerViewAdapter var adapter: CategoryConditionRecyclerViewAdapter
init { init {
val view = LayoutInflater.from(context).inflate(R.layout.ui_category_sort_popup_window, null) val view = LayoutInflater.from(context).inflate(R.layout.tests_ui_category_sort_popup_window, null)
this.contentView = view this.contentView = view
this.isFocusable = true this.isFocusable = true
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
......
...@@ -7,7 +7,7 @@ import android.view.ViewGroup ...@@ -7,7 +7,7 @@ import android.view.ViewGroup
import com.ydl.ydlcommon.adapter.MyBaseAdapter import com.ydl.ydlcommon.adapter.MyBaseAdapter
import com.yidianling.tests.R import com.yidianling.tests.R
import com.yidianling.tests.list.model.bean.Test import com.yidianling.tests.list.model.bean.Test
import kotlinx.android.synthetic.main.item_hot_test.view.* import kotlinx.android.synthetic.main.tests_item_hot_test.view.*
/** /**
* HotTestListAdapter * HotTestListAdapter
...@@ -41,10 +41,10 @@ class HotTestListAdapter(val hotTestList: MutableList<Test>) : RecyclerView.Adap ...@@ -41,10 +41,10 @@ class HotTestListAdapter(val hotTestList: MutableList<Test>) : RecyclerView.Adap
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): RecyclerView.ViewHolder { override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): RecyclerView.ViewHolder {
return if (viewType == TYPE_NORMAL) { return if (viewType == TYPE_NORMAL) {
val view = LayoutInflater.from(parent!!.context).inflate(R.layout.item_hot_test, parent, false) val view = LayoutInflater.from(parent!!.context).inflate(R.layout.tests_item_hot_test, parent, false)
NormalViewHolder(view) NormalViewHolder(view)
} else { } else {
val view = LayoutInflater.from(parent!!.context).inflate(R.layout.item_hot_test_header, parent, false) val view = LayoutInflater.from(parent!!.context).inflate(R.layout.tests_item_hot_test_header, parent, false)
object : RecyclerView.ViewHolder(view) {} object : RecyclerView.ViewHolder(view) {}
} }
} }
......
...@@ -29,8 +29,8 @@ import com.yidianling.tests.list.model.bean.RecommendSearchItemBean ...@@ -29,8 +29,8 @@ import com.yidianling.tests.list.model.bean.RecommendSearchItemBean
import com.yidianling.tests.list.model.bean.Test import com.yidianling.tests.list.model.bean.Test
import com.yidianling.tests.list.view.adapter.TestListRecyclerAdapter import com.yidianling.tests.list.view.adapter.TestListRecyclerAdapter
import de.greenrobot.event.EventBus import de.greenrobot.event.EventBus
import kotlinx.android.synthetic.main.activity_test_search.* import kotlinx.android.synthetic.main.tests_activity_test_search.*
import kotlinx.android.synthetic.main.item_hot_search.view.* import kotlinx.android.synthetic.main.tests_item_hot_search.view.*
class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(), TestSearchView, View.OnClickListener { class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(), TestSearchView, View.OnClickListener {
...@@ -41,7 +41,7 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>( ...@@ -41,7 +41,7 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
} }
override fun layoutResId(): Int { override fun layoutResId(): Int {
return R.layout.activity_test_search return R.layout.tests_activity_test_search
} }
override fun initDataAndEvent() { override fun initDataAndEvent() {
...@@ -105,8 +105,8 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>( ...@@ -105,8 +105,8 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
RouterManager.getTestsRouter()?.testDetailH5(data.id.toString()) RouterManager.getTestsRouter()?.testDetailH5(data.id.toString())
} }
headerHotSearch = View.inflate(this, R.layout.header_hot_search, null) as LinearLayout?; headerHotSearch = View.inflate(this, R.layout.tests_header_hot_search, null) as LinearLayout?;
searchHeader = View.inflate(this, R.layout.header_search_list, null); searchHeader = View.inflate(this, R.layout.tests_header_search_list, null);
tvSearchHint = searchHeader?.findViewById(R.id.tv_search_hint); tvSearchHint = searchHeader?.findViewById(R.id.tv_search_hint);
flHotSearch = headerHotSearch?.findViewById(R.id.flHotSearch) flHotSearch = headerHotSearch?.findViewById(R.id.flHotSearch)
...@@ -177,7 +177,7 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>( ...@@ -177,7 +177,7 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
private fun doSearch() { private fun doSearch() {
keyword = etSearch.text.toString() keyword = etSearch.text.toString()
if (TextUtils.isEmpty(keyword)) { if (TextUtils.isEmpty(keyword)) {
ToastUtil.toastShort(getString(R.string.no_search_keyword_hint)) ToastUtil.toastShort(getString(R.string.tests_no_search_keyword_hint))
return return
} }
hideSoftInput() hideSoftInput()
...@@ -232,7 +232,7 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>( ...@@ -232,7 +232,7 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
headerHotSearch?.visibility = View.VISIBLE headerHotSearch?.visibility = View.VISIBLE
flHotSearch?.removeAllViews() flHotSearch?.removeAllViews()
for (index in keywordData.indices) { for (index in keywordData.indices) {
val view = LayoutInflater.from(this).inflate(R.layout.item_recommend_hot_search, flHotSearch, false) val view = LayoutInflater.from(this).inflate(R.layout.tests_item_recommend_hot_search, flHotSearch, false)
view.tvHotSearch.text = keywordData[index].keyWord view.tvHotSearch.text = keywordData[index].keyWord
view.setOnClickListener { view.setOnClickListener {
etSearch.setText(keywordData[index].keyWord) etSearch.setText(keywordData[index].keyWord)
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:drawable="@drawable/ic_test_checked"/>
<item android:state_checked="false" android:drawable="@drawable/ic_test_unchecked"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:drawable="@drawable/tests_ic_test_checked"/>
<item android:state_checked="false" android:drawable="@drawable/tests_ic_test_unchecked"/>
</selector>
...@@ -4,5 +4,5 @@ ...@@ -4,5 +4,5 @@
<size <size
android:width="1dp" android:width="1dp"
android:height="1dp" /> android:height="1dp" />
<solid android:color="@color/colorDivider" /> <solid android:color="@color/tests_colorDivider" />
</shape> </shape>
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
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"
tools:ignore="ResourceName">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/platform_title_bar_height"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:right_iv="@drawable/more_green"
app:right_start_icon="@drawable/share"
app:pa_title_text="测试介绍" />
<ScrollView
android:id="@+id/scrollView"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@+id/btnStartTest"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title_bar"
tools:visibility="visible">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:paddingBottom="16dp">
<ImageView
android:id="@+id/ivCover"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:contentDescription="@null"
android:scaleType="fitCenter" />
<TextView
android:id="@+id/tvTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ivCover"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="16dp"
android:textAlignment="center"
android:textSize="20sp"
android:textStyle="bold"
tools:text="简易工作压力量表" />
<LinearLayout
android:id="@+id/llInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tvTitle"
android:gravity="center_horizontal"
android:orientation="horizontal">
<TextView
android:id="@+id/tvTestCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:drawableLeft="@drawable/ic_edit"
android:drawablePadding="8dp"
android:drawableStart="@drawable/ic_edit"
android:textColor="@color/color_black_ff999999"
android:textSize="12sp"
tools:text="3796人测过" />
<TextView
android:id="@+id/tvQuestionNum"
android:layout_width="wrap_content"
android:layout_height="16dp"
android:layout_marginLeft="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:drawableLeft="@drawable/ic_item"
android:drawablePadding="8dp"
android:drawableStart="@drawable/ic_item"
android:textColor="@color/color_black_ff999999"
android:textSize="12sp"
tools:text="10个问题" />
</LinearLayout>
<TextView
android:id="@+id/tvDesc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/llInfo"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="16dp"
android:lineSpacingExtra="8sp"
android:textColor="@color/platform_color_black_333333"
android:textSize="16sp"
tools:text="每个人都会遇到压力,您想知道自己的压力状态吗?赶紧点击测试一下吧!" />
<TextView
android:id="@+id/tvTestTips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tvDesc"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:text="@string/testdetail_tips"
android:textColor="@color/color_black_ff999999"
android:textSize="12sp" />
<TextView
android:id="@+id/tvDigmenTips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tvTestTips"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:text="@string/testdetail_tips"
android:textColor="@color/color_black_ff999999"
android:textSize="12sp"
android:visibility="gone"
tools:visibility="visible" />
</RelativeLayout>
</ScrollView>
<Button
android:id="@+id/btnStartTest"
style="?android:attr/borderlessButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/bg_btn_no_corner_green"
android:text="@string/start_test"
android:textColor="@color/white"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<FrameLayout
android:id="@+id/flLoading"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/white"
android:paddingBottom="60dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title_bar"
tools:visibility="gone">
<ProgressBar
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
</FrameLayout>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
...@@ -19,13 +19,13 @@ ...@@ -19,13 +19,13 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:src="@drawable/icon_test_back" android:src="@drawable/tests_icon_test_back"
/> />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="32dp" android:layout_height="32dp"
android:background="@drawable/bg_test_search_input" android:background="@drawable/tests_bg_test_search_input"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
> >
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
android:layout_height="13dp" android:layout_height="13dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="12dp" android:layout_marginLeft="12dp"
android:src="@drawable/search_gray"/> android:src="@drawable/tests_search_gray"/>
<TextView <TextView
android:id="@+id/tv_test_search" android:id="@+id/tv_test_search"
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="@string/search" android:text="@string/tests_search"
android:textColor="#BFBFBF" android:textColor="#BFBFBF"
android:textSize="@dimen/platform_default_text_size_small" android:textSize="@dimen/platform_default_text_size_small"
android:textStyle="normal" android:textStyle="normal"
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<com.ydl.ydlcommon.view.DrawableRightTextView <com.ydl.ydlcommon.view.DrawableRightTextView
android:id="@+id/dr_sort" android:id="@+id/dr_sort"
style="@style/FilterTextViewStyle" style="@style/tests_FilterTextViewStyle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="44dp" android:layout_height="44dp"
android:layout_marginLeft="@dimen/platform_dp_16" android:layout_marginLeft="@dimen/platform_dp_16"
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
<com.ydl.ydlcommon.view.DrawableRightTextView <com.ydl.ydlcommon.view.DrawableRightTextView
android:id="@+id/dr_filter" android:id="@+id/dr_filter"
style="@style/FilterTextViewStyle" style="@style/tests_FilterTextViewStyle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="44dp" android:layout_height="44dp"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp" android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
android:id="@+id/titleBar" android:id="@+id/titleBar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/platform_title_bar_height" android:layout_height="@dimen/platform_title_bar_height"
app:bm_line_color="@color/transparent" app:pa_bm_line_color="@color/transparent"
app:pa_left_start_icon="@drawable/platform_toolbar_back" app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:right_iv="@drawable/more12x" app:pa_right_iv="@drawable/platform_more12x"
app:right_start_icon="@drawable/icon_navsearch_green" app:pa_right_start_icon="@drawable/tests_icon_navsearch_green"
app:pa_title_text="心理测试" /> app:pa_title_text="心理测试" />
<LinearLayout <LinearLayout
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
android:layout_height="@dimen/platform_dp_17" android:layout_height="@dimen/platform_dp_17"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/platform_dp_15" android:layout_marginStart="@dimen/platform_dp_15"
android:background="@drawable/test_redpacket" /> android:background="@drawable/tests_test_redpacket" />
<TextView <TextView
android:id="@+id/tvTestRedPacketTips" android:id="@+id/tvTestRedPacketTips"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -45,9 +45,9 @@ ...@@ -45,9 +45,9 @@
android:id="@+id/tabLayout" android:id="@+id/tabLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="40dp"
app:tabIndicatorColor="@color/platform_platform_google_green" app:tabIndicatorColor="@color/platform_google_green"
app:tabMode="scrollable" app:tabMode="scrollable"
app:tabSelectedTextColor="@color/platform_platform_google_green" /> app:tabSelectedTextColor="@color/platform_google_green" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/bg_test_search_input" android:background="@drawable/tests_bg_test_search_input"
android:drawableStart="@drawable/search_gray" android:drawableStart="@drawable/tests_search_gray"
android:drawableLeft="@drawable/search_gray" android:drawableLeft="@drawable/tests_search_gray"
android:drawablePadding="8dp" android:drawablePadding="8dp"
android:ems="10" android:ems="10"
android:hint="输入标题与内容" android:hint="输入标题与内容"
......
...@@ -39,13 +39,13 @@ ...@@ -39,13 +39,13 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@null" android:contentDescription="@null"
android:src="@drawable/blank" /> android:src="@drawable/tests_blank" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:text="@string/no_test_record_hint" android:text="@string/tests_no_test_record_hint"
android:textColor="@color/color_grey_888888" /> android:textColor="@color/tests_color_grey_888888" />
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
android:layout_below="@+id/cv_recom" android:layout_below="@+id/cv_recom"
android:layout_marginTop="14dp" android:layout_marginTop="14dp"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:background="@drawable/testhome_recom_price_bg" android:background="@drawable/tests_testhome_recom_price_bg"
android:gravity="center" android:gravity="center"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:paddingTop="1dp" android:paddingTop="1dp"
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
android:id="@+id/tv_coupon_money" android:id="@+id/tv_coupon_money"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_corner_border_orange" android:background="@drawable/tests_bg_corner_border_orange"
android:textColor="#FF5A4C" android:textColor="#FF5A4C"
tools:text="券已抵扣5元" tools:text="券已抵扣5元"
android:layout_toRightOf="@id/tv_price" android:layout_toRightOf="@id/tv_price"
......
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:padding="16dp" android:padding="16dp"
android:text="@string/recommend_test" android:text="@string/tests_recommend_test"
android:textColor="@color/platform_color_black_333333" /> android:textColor="@color/platform_color_black_333333" />
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
android:layout_marginBottom="6dp" android:layout_marginBottom="6dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:layout_marginRight="8dp" android:layout_marginRight="8dp"
android:background="@drawable/bg_gray_radius_20" android:background="@drawable/tests_bg_gray_radius_20"
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
android:paddingLeft="15dp" android:paddingLeft="15dp"
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:visibility="gone" /> android:visibility="gone" />
<include layout="@layout/testhome_bar" /> <include layout="@layout/tests_testhome_bar" />
</FrameLayout> </FrameLayout>
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout> </FrameLayout>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="162dp" android:layout_height="162dp"
android:background="@drawable/testhome_bg" /> android:background="@drawable/tests_testhome_bg" />
<android.support.v7.widget.CardView xmlns:app="http://schemas.android.com/apk/res-auto" <android.support.v7.widget.CardView xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:pa_indicator_different_width="14dp" app:pa_indicator_different_width="14dp"
app:pa_indicator_drawable_selected="@drawable/testhome_tip_select" app:pa_indicator_drawable_selected="@drawable/tests_testhome_tip_select"
app:pa_indicator_drawable_unselected="@drawable/testhome_tip_unselect" app:pa_indicator_drawable_unselected="@drawable/tests_testhome_tip_unselect"
app:pa_indicator_height="5dp" app:pa_indicator_height="5dp"
app:pa_indicator_margin="1.25dp" app:pa_indicator_margin="1.25dp"
app:pa_is_selected_same_unselected="false" /> app:pa_is_selected_same_unselected="false" />
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
android:id="@+id/v_bg" android:id="@+id/v_bg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:background="@drawable/testhome_bg" /> android:background="@drawable/tests_testhome_bg" />
<LinearLayout <LinearLayout
android:id="@+id/ll_bar_root" android:id="@+id/ll_bar_root"
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:background="@drawable/testhome_back" /> android:background="@drawable/tests_testhome_back" />
<RelativeLayout <RelativeLayout
android:id="@+id/rl_search" android:id="@+id/rl_search"
...@@ -31,14 +31,14 @@ ...@@ -31,14 +31,14 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/testhome_bar_search_bg" android:background="@drawable/tests_testhome_bar_search_bg"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:drawableLeft="@drawable/testhome_search" android:drawableLeft="@drawable/tests_testhome_search"
android:drawablePadding="4dp" android:drawablePadding="4dp"
android:hint="输入关键字查找测评" android:hint="输入关键字查找测评"
android:textColorHint="#B3ffffff" android:textColorHint="#B3ffffff"
...@@ -53,6 +53,6 @@ ...@@ -53,6 +53,6 @@
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
android:padding="5dp" android:padding="5dp"
android:src="@drawable/testhome_mine" /> android:src="@drawable/tests_testhome_mine" />
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
...@@ -9,18 +9,18 @@ ...@@ -9,18 +9,18 @@
android:layout_marginTop="30dp" android:layout_marginTop="30dp"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:drawablePadding="5dp" android:drawablePadding="5dp"
android:drawableLeft="@drawable/testhome_everyday" android:drawableLeft="@drawable/tests_testhome_everyday"
tools:text="每日精选" /> tools:text="每日精选" />
<TextView <TextView
android:id="@id/testhome_dailyRight" android:id="@id/tests_testhome_dailyRight"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="19dp" android:layout_height="19dp"
android:layout_marginTop="30dp" android:layout_marginTop="30dp"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:gravity="center" android:gravity="center"
android:text="@string/testhome_dailychange" android:text="@string/tests_testhome_dailychange"
android:textSize="10dp" android:textSize="10dp"
android:textColor="#666" android:textColor="#666"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
android:background="@drawable/testhome_dailychange_bg"/> android:background="@drawable/tests_testhome_dailychange_bg"/>
</merge> </merge>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_marginTop="@dimen/platform_dp_10" android:layout_marginTop="@dimen/platform_dp_10"
android:background="@drawable/testhome_recom_price_bg" android:background="@drawable/tests_testhome_recom_price_bg"
android:gravity="center" android:gravity="center"
android:paddingBottom="2dp" android:paddingBottom="2dp"
android:paddingLeft="5dp" android:paddingLeft="5dp"
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
android:id="@+id/tv_coupon_money" android:id="@+id/tv_coupon_money"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_corner_border_orange" android:background="@drawable/tests_bg_corner_border_orange"
android:textColor="#FF5A4C" android:textColor="#FF5A4C"
tools:text="券已抵扣5元" tools:text="券已抵扣5元"
android:layout_toRightOf="@id/tv_price" android:layout_toRightOf="@id/tv_price"
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:background="@drawable/testhome_category"/> android:background="@drawable/tests_testhome_category"/>
<TextView <TextView
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:background="@drawable/testhome_category"/> android:background="@drawable/tests_testhome_category"/>
<TextView <TextView
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_marginTop="@dimen/platform_dp_10" android:layout_marginTop="@dimen/platform_dp_10"
android:background="@drawable/testhome_recom_price_bg" android:background="@drawable/tests_testhome_recom_price_bg"
android:gravity="center" android:gravity="center"
android:paddingBottom="2dp" android:paddingBottom="2dp"
android:paddingLeft="5dp" android:paddingLeft="5dp"
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
android:id="@+id/tv_coupon_money" android:id="@+id/tv_coupon_money"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_corner_border_orange" android:background="@drawable/tests_bg_corner_border_orange"
android:textColor="#FF5A4C" android:textColor="#FF5A4C"
tools:text="券已抵扣5元" tools:text="券已抵扣5元"
android:layout_toRightOf="@id/tv_recomPrice" android:layout_toRightOf="@id/tv_recomPrice"
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
android:id="@+id/tv_recomTitle" android:id="@+id/tv_recomTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_16" android:textSize="16sp"
android:textStyle="bold" android:textStyle="bold"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
...@@ -42,14 +42,14 @@ ...@@ -42,14 +42,14 @@
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:textSize="11dp" android:textSize="11dp"
android:textColor="#34CD65" android:textColor="#34CD65"
android:background="@drawable/testhome_recom_price_bg" android:background="@drawable/tests_testhome_recom_price_bg"
tools:text="免费"/> tools:text="免费"/>
<TextView <TextView
android:id="@+id/tv_coupon_money" android:id="@+id/tv_coupon_money"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_corner_border_orange" android:background="@drawable/tests_bg_corner_border_orange"
android:textColor="#FF5A4C" android:textColor="#FF5A4C"
tools:text="券已抵扣5元" tools:text="券已抵扣5元"
android:layout_toRightOf="@id/tv_recomPrice" android:layout_toRightOf="@id/tv_recomPrice"
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
android:layout_below="@+id/cv_recom" android:layout_below="@+id/cv_recom"
android:layout_marginTop="@dimen/platform_dp_12" android:layout_marginTop="@dimen/platform_dp_12"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:background="@drawable/testhome_recom_price_bg" android:background="@drawable/tests_testhome_recom_price_bg"
android:gravity="center" android:gravity="center"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:paddingTop="2dp" android:paddingTop="2dp"
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
android:id="@+id/tv_coupon_money" android:id="@+id/tv_coupon_money"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_corner_border_orange" android:background="@drawable/tests_bg_corner_border_orange"
android:textColor="#FF5A4C" android:textColor="#FF5A4C"
tools:text="券已抵扣5元" tools:text="券已抵扣5元"
android:layout_toRightOf="@id/tv_price" android:layout_toRightOf="@id/tv_price"
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="4dp" android:layout_marginRight="4dp"
android:src="@drawable/icon_no_more_left" android:src="@drawable/tests_icon_no_more_left"
android:visibility="gone" android:visibility="gone"
/> />
...@@ -39,6 +39,6 @@ ...@@ -39,6 +39,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="4dp" android:layout_marginLeft="4dp"
android:src="@drawable/icon_no_more_right" android:src="@drawable/tests_icon_no_more_right"
android:visibility="gone"/> android:visibility="gone"/>
</LinearLayout> </LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="testhome_line">#F0F0F0</color>
<color name="testhome_title">#666</color>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="testhome_dailytitle" type="id"/>
<item name="testhome_dailyRight" type="id"/>
<item name="testhome_recommenTitle" type="id"/>
<item name="testhome_daily" type="id"/>
<item name="testhome_ll_tips" type="id"/>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="testhome_dailychange">换一换</string>
<string name="testhome_just">刚刚</string>
<string name="testhome_test">测试了</string>
<string name="testhome_hit">人气</string>
<string name="testhome_peopletest">人测过</string>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="color_grey_888888">#888888</color> <color name="tests_color_grey_888888">#888888</color>
<color name="colorDivider">#ebebeb</color> <color name="tests_colorDivider">#ebebeb</color>
<color name="color_black_333333">#333333</color> <color name="tests_color_black_333333">#333333</color>
<color name="color_black_ff999999">#999999</color> <color name="tests_color_black_ff999999">#999999</color>
<color name="tests_testhome_line">#F0F0F0</color>
<color name="tests_testhome_title">#666</color>
</resources> </resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="tests_testhome_dailytitle" type="id"/>
<item name="tests_testhome_dailyRight" type="id"/>
<item name="tests_testhome_recommenTitle" type="id"/>
<item name="tests_testhome_daily" type="id"/>
<item name="tests_testhome_ll_tips" type="id"/>
</resources>
\ No newline at end of file
<resources> <resources >
<string name="app_name">tests</string> <string name="tests_app_name">tests</string>
<string name="start_test">立即测试</string> <string name="tests_start_test" >立即测试</string>
<string name="test_result">测试结果</string> <string name="tests_test_result">测试结果</string>
<string name="test_again">重新测试</string> <string name="tests_test_again">重新测试</string>
<string name="send_to_expert">专家解读</string> <string name="tests_send_to_expert">专家解读</string>
<string name="test_answer">测试回答</string> <string name="tests_test_answer">测试回答</string>
<string name="introduction">说明</string> <string name="tests_introduction">说明</string>
<string name="last_question">上一题</string> <string name="tests_last_question">上一题</string>
<string name="no_test_record_hint">还没有测试记录哦</string> <string name="tests_no_test_record_hint">还没有测试记录哦</string>
<string name="recommend_test">推荐测试</string> <string name="tests_recommend_test">推荐测试</string>
<string name="test_count">%d人测过</string> <string name="tests_test_count">%d人测过</string>
<string name="questions">%d个问题</string> <string name="tests_questions">%d个问题</string>
<string name="wrong_args">参数异常</string> <string name="tests_wrong_args">参数异常</string>
<string name="no_search_keyword_hint">请输入关键字</string> <string name="tests_no_search_keyword_hint">请输入关键字</string>
<string name="gson_parse_error">解析错误</string> <string name="tests_gson_parse_error">解析错误</string>
<string name="test_either">我也要测试</string> <string name="tests_test_either">我也要测试</string>
<string name="dialog_loading">加载中…</string> <string name="tests_dialog_loading">加载中…</string>
<string name="load_end">没有更多了</string> <string name="tests_load_end">没有更多了</string>
<string name="loading">正在加载中…</string> <string name="tests_loading">正在加载中…</string>
<string name="search">搜索</string> <string name="tests_search">搜索</string>
<string name="testdetail_tips">*温馨提示:测评报告生成后不可重复测试</string> <string name="tests_testdetail_tips">*温馨提示:测评报告生成后不可重复测试</string>
<string name="tests_testhome_dailychange">换一换</string>
<string name="tests_testhome_just">刚刚</string>
<string name="tests_testhome_test">测试了</string>
<string name="tests_testhome_hit">人气</string>
<string name="tests_testhome_peopletest">人测过</string>
</resources> </resources>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!----> <!---->
<style name="style_price_start"> <style name="tests_style_price_start">
<item name="android:textSize">16sp</item> <item name="android:textSize">16sp</item>
<item name="android:textColor">#FF5B05</item> <item name="android:textColor">#FF5B05</item>
<item name="android:textStyle">bold</item> <item name="android:textStyle">bold</item>
</style> </style>
<style name="style_price_end"> <style name="tests_style_price_end">
<item name="android:textSize">10sp</item> <item name="android:textSize">10sp</item>
<item name="android:textColor">#FF5B05</item> <item name="android:textColor">#FF5B05</item>
</style> </style>
<style name="FilterTextViewStyle"> <style name="tests_FilterTextViewStyle">
<item name="android:layout_height">40dp</item> <item name="android:layout_height">40dp</item>
<item name="android:textSize">14sp</item> <item name="android:textSize">14sp</item>
<item name="android:background">?android:attr/selectableItemBackground</item> <item name="android:background">?android:attr/selectableItemBackground</item>
......
...@@ -2,6 +2,13 @@ apply plugin: 'com.android.library' ...@@ -2,6 +2,13 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
//apply plugin: 'plugin.resTools' // 资源重命名插件
//
//// 配置资源重命名插件
//resConfig {
// new_prefix = 'user_' // 资源前缀
// old_prefix = '' // 老前缀,可为''空字符串
//}
kapt { kapt {
arguments { arguments {
...@@ -36,6 +43,11 @@ android { ...@@ -36,6 +43,11 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
} }
//前缀的名字
// resourcePrefix "user_"
//Flavor 信息
publishNonDefault true publishNonDefault true
productFlavors { productFlavors {
ydl {} ydl {}
...@@ -46,7 +58,6 @@ android { ...@@ -46,7 +58,6 @@ android {
main { main {
manifest.srcFile 'src/main/AndroidManifest.xml' manifest.srcFile 'src/main/AndroidManifest.xml'
res.srcDirs = [ res.srcDirs = [
'src/main/res/layouts',
'src/main/res' 'src/main/res'
] ]
} }
......
### YDL - 音乐播放器功能组件
#### AudioPlayer
| 方法名 | 介绍 | 备注 |
| --------------------------- | ---------------------------- | ------------------------------------------------------------ |
| playMode | 设置播放模式,默认为列表循环 | //列表循环 LIST_LOOP(0) <br />//随机播放 SHUFFLE(1) <br />//单曲循环 SINGLE_LOOP(2) <br />//单曲播放 SINGLE(3) |
| autoSaveProgress | 是否自动保存播放进度 | Boolean |
| addOnPlayEventListener | 添加播放监听 | 见下介绍 |
| removeOnPlayEventListener | 移除播放监听 | |
| **addPlayList** | 添加播放列表 | |
| getMusicList | 获取播放列表 | |
| **playPause** | 暂停或者播放音乐 | |
| singlePlay | 单曲模式播放音乐 | |
| addAndPlay | 添加后自动播放 | |
| play(position: Int) | 加载指定索引的音乐 | |
| delete(position: Int)<br /> | 从列表里移除播放音乐 | |
| next | 下一首 | |
| prev | 上一首 | |
| seekTo | 跳转到指定的时间位置 | @param percent 百分比<br />@param position 时间点 |
| getDuration | 获取音乐时长 | |
#### OnPlayerEventListener
| 方法名 | 介绍 | 备注 |
| ----------------- | ------------ | ------------------------------------------------------- |
| onChange | 切换歌曲 | |
| onPlayerStart | 继续播放 | |
| onPlayerPause | 暂停播放 | |
| onPublish | 更新进度 | percent : 播放百分比<br />currentPosition:当前播放位置 |
| onBufferingUpdate | 缓冲百分比 | |
| onPrepared | 准备完成 | duration:音乐时长 |
| onComplete | 单曲播放完成 | |
...@@ -344,8 +344,8 @@ class AudioPlayer private constructor() { ...@@ -344,8 +344,8 @@ class AudioPlayer private constructor() {
if (isIdle) { if (isIdle) {
return return
} }
pausePlayer() pausePlayer()
musicList.clear()
mediaPlayer!!.reset() mediaPlayer!!.reset()
state = STATE_IDLE state = STATE_IDLE
} }
...@@ -422,6 +422,9 @@ class AudioPlayer private constructor() { ...@@ -422,6 +422,9 @@ class AudioPlayer private constructor() {
return musicList return musicList
} }
/**
* 获取音乐时长
*/
fun getDuration(): Long{ fun getDuration(): Long{
return if (isPlaying) mediaPlayer!!.duration else 0 return if (isPlaying) mediaPlayer!!.duration else 0
} }
......
...@@ -39,7 +39,7 @@ interface OnPlayerEventListener { ...@@ -39,7 +39,7 @@ interface OnPlayerEventListener {
/** /**
* 准备完成 * 准备完成
* *
* duration:时长 * duration:音乐时长
*/ */
fun onPrepared(duration:Long) fun onPrepared(duration:Long)
......
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