Commit c5af94d3 by 洪国微

资源浅醉重命名

parents 076c6a58 de7c3efd
......@@ -117,6 +117,7 @@ android {
signingConfig signingConfigs.ydl
}
xlzx {
applicationId rootProject.ext.xlzx_app["applicationId"]
versionName rootProject.ext.xlzx_app["versionName"]
......@@ -167,9 +168,15 @@ dependencies {
if (true) {
//开发模式
api project(':m-user')
implementation modularPublication('com.ydl:m-user-api')
api project(':m-tests')
api project(':m-consultant')
implementation modularPublication('com.ydl:m-consultant-api')
api project(':m-confide')
// api "com.ydl:m-consultant-api:0.0.2"
// api 'com.ydl:m-consultant-module-ydl:0.0.18@aar'
api (project(':ydl-platform')){
transitive = true
}
......
......@@ -24,6 +24,8 @@ import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.ExpertSearchActivity.Companion.HOT_SEARCH_DOCTOR_NAME
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.fm.api.service.IFMService
import com.yidianling.tests.home.TestHomeActivity
import kotlinx.android.synthetic.main.activity_main.*
......@@ -76,15 +78,15 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
.withBoolean("isFromGuide", true)
.navigation()
}
// bt_to_consultant.setOnClickListener {
// ARouter.getInstance()
// .build("/consult/hot_search")
// .withString(
// HOT_SEARCH_DOCTOR_NAME,
// this.resources?.getString(R.string.platform_search_hint)
// )
// .navigation()
// }
bt_to_consultant.setOnClickListener {
ARouter.getInstance()
.build("/consult/hot_search")
.withString(
HOT_SEARCH_DOCTOR_NAME,
this.resources?.getString(R.string.platform_search_hint)
)
.navigation()
}
bt_to_music.setOnClickListener {
startActivity(Intent(this, MusicPlayActivity::class.java))
}
......@@ -128,7 +130,6 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
}
override fun reLoadData() {
mPresenter?.loadUsers()
}
......@@ -168,16 +169,24 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
override fun onResume() {
super.onResume()
MobclickAgent.onResume(this)
ModularServiceManager.provide(IConsultantService::class.java).showConsultAssistantDialog(this)
}
override fun onPause() {
super.onPause()
override fun onDestroy() {
if (serviceConnection != null) {
unbindService(serviceConnection)
}
super.onDestroy()
ModularServiceManager.provide(IConsultantService::class.java).hideConsultAssistantDialog()
}
// override fun onDestroy() {
// if (serviceConnection != null) {
// unbindService(serviceConnection)
// }
// super.onDestroy()
// }
private inner class PlayServiceConnection : ServiceConnection {
override fun onServiceConnected(name: ComponentName, service: IBinder) {
playService = (service as PlayService.PlayBinder).service
......
......@@ -5,6 +5,7 @@ import android.app.Application;
import android.content.Context;
import android.content.Intent;
import com.ydl.devicesidlib.DeviceIDHelper;
import com.ydl.media.audio.PlayService;
import com.ydl.ydlcommon.base.delegate.IAppLifecycles;
import com.ydl.ydlcommon.utils.YdlBuryPointUtil;
......@@ -28,6 +29,9 @@ public class DemoAppLifecycles implements IAppLifecycles {
//数据埋点初始化--一定要放在主进程中
YdlBuryPointUtil.init(application);
//设备ID初始化
DeviceIDHelper.getInstance().init(application);
//Flutter 初始化需要在主线程中执行
FlutterMain.startInitialization(application);
......
......@@ -27,6 +27,7 @@ public final class DemoGlobalConfig implements IConfigModule {
public void applyOptions(@NotNull Context context, @NotNull GlobalConfig.Builder builder) {
builder.setFrom( "ydl".equals(BuildConfig.FLAVOR) ?YDLConstants.FROM_YDL :YDLConstants.FROM_XLZX)
.addUrl("github", APP_DOMAIN)
.setEnv(YDLConstants.ENV_TEST)
.setDebug(BuildConfig.DEBUG);
}
}
......@@ -32,7 +32,7 @@ class DemoModel : BaseModel(), DemoContract.Model {
return YDLHttpUtils.obtainApi(DemoService::class.java)
.getUsers(1, 10)
//使用接口缓存
.compose(YDLHttpUtils.transformCache("users"))
// .compose(YDLHttpUtils.transformCache("users"))
}
@OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
......
......@@ -182,7 +182,7 @@ ext {
//功能组件 <<--- 再发这些,发完改这里的版本号
"ydl-webview" : 'com.ydl:ydl-webview:0.0.18@aar',
"ydl-media" : 'com.ydl:ydl-media:0.0.7@aar',
"ydl-audioim" : 'com.ydl:m-audioim:0.0.9@aar',
"ydl-audioim" : 'com.ydl:m-audioim:0.0.10@aar',
"ydl-pay" : 'com.ydl:ydl-pay:0.0.2@aar',
//业务组件 <<--- 最后发这些(只发改过的)
......
......@@ -8,7 +8,7 @@ apply plugin: 'plugin.resTools' // 资源重命名插件
// 配置资源重命名插件
resConfig {
new_prefix = 'audioim_' // 资源前缀
old_prefix = 'audio_home_' // 老前缀,可为''空字符串
old_prefix = '' // 老前缀,可为''空字符串
}
kapt {
......@@ -37,6 +37,9 @@ android {
flavorDimensions "versionCode"
}
//前缀的名字
resourcePrefix "audioim_"
buildTypes {
release {
minifyEnabled false
......
IS_PUBLISH=true
VERSION_NAME=0.0.9
\ No newline at end of file
VERSION_NAME=0.0.10
\ No newline at end of file
......@@ -61,7 +61,7 @@ import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.activity_audio_home.*
import kotlinx.android.synthetic.main.audioim_activity_audio_home.*
import java.util.concurrent.TimeUnit
......@@ -293,7 +293,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
}
override fun layoutResId(): Int {
return R.layout.activity_audio_home
return R.layout.audioim_activity_audio_home
}
override fun initDataAndEvent() {
......@@ -314,7 +314,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
}
private fun setWindowStatusBarColor() {
StatusBarUtils.setWindowStatusBarColor(this, R.color.color_40353535)
StatusBarUtils.setWindowStatusBarColor(this, R.color.audioim_color_40353535)
}
@SuppressLint("InvalidWakeLockTag")
......@@ -365,8 +365,8 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
if (!TextUtils.isEmpty(expertHeadUrl)) {
var option = SimpleImageOpConfiger()
option.errorPic = R.drawable.head_place_hold_pic
option.loadingPic = R.drawable.head_place_hold_pic
option.errorPic = R.drawable.audioim_head_place_hold_pic
option.loadingPic = R.drawable.audioim_head_place_hold_pic
option.transform = 0
YDLImageCacheManager.showImage(this, expertHeadUrl, iv_head, option)
}
......@@ -387,10 +387,10 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
iv_hands_free.setOnClickListener {
if (iv_hands_free.isSelected) {
iv_hands_free.isSelected = false
iv_hands_free.setImageResource(R.drawable.audio_home_img_hands_free_unuse)
iv_hands_free.setImageResource(R.drawable.audioim_img_hands_free_unuse)
} else {
iv_hands_free.isSelected = true
iv_hands_free.setImageResource(R.drawable.audio_home_img_hands_free)
iv_hands_free.setImageResource(R.drawable.audioim_img_hands_free)
}
//已经接通
......@@ -500,7 +500,9 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
} else if (permission.shouldShowRequestPermissionRationale) {
requestPermission()
} else {
ToastHelper.show(getString(R.string.need_storage_permission_hint))
ToastHelper.show(getString(R.string.audioim_need_storage_permission_hint))
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
val uri = Uri.fromParts("package", packageName, null)
intent.data = uri
......@@ -541,7 +543,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
}, {
waittingStatus()
if (!isConnectSuccess){
// iv_hang_up.setImageResource(R.mipmap.ico_close)
// iv_hang_up.setImageResource(R.mipmap.audioim_ico_close)
//关闭音乐
stopPlaying()
//提示切换传统线路
......@@ -676,7 +678,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
private fun waittingStatus() {
//挂断按钮可点击
iv_hang_up.isEnabled = true
iv_hang_up.setImageResource(R.drawable.audio_home_img_hang_up)
iv_hang_up.setImageResource(R.drawable.audioim_img_hang_up)
if (!isConnectSuccess) {
//页面等待文案调整
tv_waiting.visibility = View.GONE
......@@ -685,8 +687,10 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
}
//切换线路按钮可见
tv_change_route.isEnabled = true
tv_change_route.setTextColor(ContextCompat.getColor(this, R.color.white_f))
tv_change_route.setCompoundDrawablesWithIntrinsicBounds(null, null, ContextCompat.getDrawable(this, R.drawable.audio_home_img_choose_arrow), null)
tv_change_route.setTextColor(ContextCompat.getColor(this, R.color.platform_white))
tv_change_route.setCompoundDrawablesWithIntrinsicBounds(null, null, ContextCompat.getDrawable(this, R.drawable.audioim_img_choose_arrow), null)
}
/**
......@@ -736,9 +740,9 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
mPlayer = AudioPlayer(this)
}
if ((Math.random() * 10 + 1).toInt() >= 5) {
mPlayer!!.setTwoDataAndStart(R.raw.audio_music_1, R.raw.loop_music)
mPlayer!!.setTwoDataAndStart(R.raw.audioim_audio_music_1, R.raw.audioim_loop_music)
} else {
mPlayer!!.setTwoDataAndStart(R.raw.audio_music_2, R.raw.loop_music)
mPlayer!!.setTwoDataAndStart(R.raw.audioim_audio_music_2, R.raw.audioim_loop_music)
}
}
......@@ -749,7 +753,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
if (mPlayer == null) {
mPlayer = AudioPlayer(this)
}
mPlayer!!.setDataSource(R.raw.hand_down_music)
mPlayer!!.setDataSource(R.raw.audioim_hand_down_music)
mPlayer!!.switchPlayType(iv_hands_free.isSelected)
mPlayer!!.setCompletionListener(MediaPlayer.OnCompletionListener {
//通话剩余时间不足60s时,默认
......@@ -820,8 +824,8 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
if (localRemainTime!! <= 60) {
if (tv_change_route.isEnabled) {
tv_change_route.isEnabled = false
tv_change_route.setTextColor(ContextCompat.getColor(this, R.color.color_50ffffff))
tv_change_route.setCompoundDrawablesWithIntrinsicBounds(null, null, ContextCompat.getDrawable(this, R.drawable.audio_home_img_choose_arrow_unuse), null)
tv_change_route.setTextColor(ContextCompat.getColor(this, R.color.audioim_color_50ffffff))
tv_change_route.setCompoundDrawablesWithIntrinsicBounds(null, null, ContextCompat.getDrawable(this, R.drawable.audioim_img_choose_arrow_unuse), null)
}
}
tv_remain_time.text = DateUtils.formatTime(localRemainTime.toString())
......@@ -844,9 +848,9 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
mPlayer = AudioPlayer(this)
}
if (3 == min) {
mPlayer!!.setDataSource(R.raw.last_3_min)
mPlayer!!.setDataSource(R.raw.audioim_last_3_min)
} else {
mPlayer!!.setDataSource(R.raw.last_1_min)
mPlayer!!.setDataSource(R.raw.audioim_last_1_min)
}
mPlayer!!.switchPlayType(iv_hands_free.isSelected)
mPlayer!!.start(false, false)
......
......@@ -5,7 +5,7 @@ import android.app.Dialog
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import com.ydl.audioim.R
import kotlinx.android.synthetic.main.dialog_axb_confirm.*
import kotlinx.android.synthetic.main.audioim_dialog_axb_confirm.*
/**
* @author jiucheng
......@@ -28,9 +28,9 @@ class AxbConfirmDialog : Dialog {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (this.type==2){
setContentView(R.layout.dialog_autoaxb_confirm)
setContentView(R.layout.audioim_dialog_autoaxb_confirm)
}else{
setContentView(R.layout.dialog_axb_confirm)
setContentView(R.layout.audioim_dialog_axb_confirm)
}
setCanceledOnTouchOutside(false)
......
......@@ -12,7 +12,7 @@
android:layout_width="28dp"
android:layout_height="28dp"
android:layout_gravity="right"
android:src="@drawable/ico_close" />
android:src="@drawable/audioim_ico_close" />
<LinearLayout
android:layout_width="match_parent"
......@@ -21,7 +21,7 @@
android:gravity="center_horizontal"
android:layout_marginTop="20dp"
android:paddingTop="21dp"
android:background="@drawable/audio_home_autoaxb_background"
android:background="@drawable/audioim_autoaxb_background"
android:orientation="vertical">
......@@ -31,7 +31,7 @@
android:layout_marginTop="6dp"
android:layout_marginLeft="21dp"
android:layout_marginRight="21dp"
android:src="@drawable/switch_axb" />
android:src="@drawable/audioim_switch_axb" />
<TextView
android:layout_width="wrap_content"
......@@ -55,7 +55,7 @@
android:layout_width="4dp"
android:layout_height="4dp"
android:layout_gravity="center_vertical"
android:background="@drawable/audio_circle_blue_4">
android:background="@drawable/audioim_audio_circle_blue_4">
</TextView>
<TextView
android:layout_width="wrap_content"
......@@ -70,7 +70,7 @@
android:layout_width="4dp"
android:layout_height="4dp"
android:layout_gravity="center_vertical"
android:background="@drawable/audio_circle_blue_4">
android:background="@drawable/audioim_audio_circle_blue_4">
</TextView>
</LinearLayout>
......@@ -80,14 +80,14 @@
android:layout_width="182dp"
android:layout_height="38dp"
android:layout_marginTop="40dp"
android:background="@drawable/audio_home_button_autoaxb_background">
android:background="@drawable/audioim_home_button_autoaxb_background">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center_horizontal"
android:drawableLeft="@drawable/audio_home_ic_phone"
android:drawableLeft="@drawable/audioim_ic_phone"
android:drawablePadding="6dp"
android:gravity="center_horizontal"
android:text="呼叫"
......
......@@ -20,13 +20,13 @@
android:layout_marginTop="7dp"
android:layout_marginRight="10dp"
android:padding="5dp"
android:src="@drawable/audio_home_ic_close_24dp" />
android:src="@drawable/audioim_ic_close_24dp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:src="@drawable/audio_home_privacy_ico" />
android:src="@drawable/audioim_privacy_ico" />
<TextView
android:layout_width="wrap_content"
......@@ -87,14 +87,14 @@
android:layout_height="40dp"
android:layout_marginTop="11dp"
android:layout_marginBottom="20dp"
android:background="@drawable/audio_home_privacy_background">
android:background="@drawable/audioim_privacy_background">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center_horizontal"
android:drawableLeft="@drawable/audio_home_ic_phone"
android:drawableLeft="@drawable/audioim_ic_phone"
android:gravity="center_horizontal"
android:text="呼叫"
android:textColor="@color/platform_white"
......@@ -105,4 +105,4 @@
</LinearLayout>
</android.support.v7.widget.CardView>
\ No newline at end of file
</android.support.v7.widget.CardView>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="color_40353535">#66353535</color>
<color name="color_80353535">#CC353535</color>
<color name="color_50ffffff">#B3ffffff</color>
<color name="color_30FFFFFF">#4DFFFFFF</color>
<color name="color_70FFFFFF">#B3FFFFFF</color>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="audioim_color_40353535">#66353535</color>
<color name="audioim_color_80353535">#CC353535</color>
<color name="audioim_color_50ffffff">#B3ffffff</color>
<color name="audioim_color_30FFFFFF">#4DFFFFFF</color>
<color name="audioim_color_70FFFFFF">#B3FFFFFF</color>
</resources>
<resources>
<string name="app_name">av</string>
<string name="need_storage_permission_hint">App正常工作需要内部存储使用权限,请开启</string>
</resources>
<resources>
<string name="audioim_app_name">av</string>
<string name="audioim_need_storage_permission_hint">App正常工作需要内部存储使用权限,请开启</string>
</resources>
......@@ -2,6 +2,14 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'plugin.resTools' // 资源重命名插件
// 配置资源重命名插件
resConfig {
new_prefix = 'confide_' // 资源前缀
old_prefix = '' // 老前缀,可为''空字符串
}
kapt {
arguments {
arg("AROUTER_MODULE_NAME", project.getName())
......@@ -54,18 +62,6 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets {
main {
res.srcDirs = [
'src/main/res/layouts/confidehome',
'src/main/res/layouts',
'src/main/res'
]
}
}
}
dependencies {
......
......@@ -8,7 +8,7 @@ modular {
groupId = "com.ydl"
artifactId = "m-confide-module-xlzx"
// 上报的业务模块 aar 包的版本号
version = "0.0.11"
version = "0.0.12"
}
ydl{
......@@ -16,7 +16,7 @@ modular {
groupId = "com.ydl"
artifactId = "m-confide-module-ydl"
// 上报的业务模块 aar 包的版本号
version = "0.0.11"
version = "0.0.12"
}
}
......
......@@ -3,8 +3,9 @@
<application>
<activity android:name=".home.ConfideHomeActivity"
android:screenOrientation="portrait">
android:screenOrientation="portrait"
android:theme="@style/confide_NoTitleTheme"
>
</activity>
</application>
</manifest>
package com.ydl.confide.home
import android.content.Context
import android.os.Build
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
import android.support.v7.widget.SimpleItemAnimator
import android.view.View
import android.widget.LinearLayout
import com.alibaba.android.arouter.facade.annotation.Route
import com.jcodecraeer.xrecyclerview.ProgressStyle
import com.jcodecraeer.xrecyclerview.XRecyclerView
import com.ydl.ydl_image.listener.YDLImageRecyclerOnScrollListener
import com.ydl.confide.R
import com.ydl.confide.home.adapter.ConfideHomeAdapter
import com.ydl.confide.home.bean.ConfideHomeAllFiltersBean
......@@ -23,14 +24,16 @@ import com.ydl.confide.home.listener.ConfideHomeRecycleViewListener
import com.ydl.confide.home.listener.ConfideHomeRecyleSuspendListener
import com.ydl.confide.home.presenter.ConfideHomePresenterImpl
import com.ydl.confide.home.util.ConfideHomeUtils
import com.ydl.ydl_image.listener.YDLImageRecyclerOnScrollListener
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.ydl.ydlcommon.view.DrawableRightTextView
import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager
import com.yidianling.common.tools.RxImageTool
import com.yidianling.router.RouterManager
import kotlinx.android.synthetic.main.confidehome_home_activity.*
import kotlinx.android.synthetic.main.confidehome_title_bar.*
import kotlinx.android.synthetic.main.confide_home_activity.*
import kotlinx.android.synthetic.main.confide_title_bar.*
/**
* @author yuanwai
......@@ -112,7 +115,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
}
override fun layoutResId(): Int {
return R.layout.confidehome_home_activity
return R.layout.confide_home_activity
}
/**
......@@ -122,7 +125,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
//重置页
page = 2
allFiltersBean!!.page = page
mPresenter.confideHomeRequest()
mPresenter.confideHomeRequest(true)
}
/**
......@@ -174,6 +177,21 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
initClick()
initQuickConsultDialog()
initStatus();
}
/**
* 初始化状态栏位置
*/
private fun initStatus() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {//4.4以下不支持状态栏变色
StatusBarUtils.setTransparentForImageView(this, null)
val statusBarHeight = StatusBarUtils.getStatusBarHeight(this)
val lp1 = rl_confide_title_layout.layoutParams as LinearLayout.LayoutParams
lp1.height = (RxImageTool.dp2px(48f) + statusBarHeight)
rl_confide_title_layout.setPadding(0, statusBarHeight, 0, 0)
}
}
/**
......@@ -245,7 +263,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
rv_list.layoutManager = layoutManager
rv_list.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader)
rv_list.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader)
rv_list.setArrowImageView(R.drawable.confidehome_downgrey)
rv_list.setArrowImageView(R.drawable.confide_downgrey)
rv_list.setLoadingListener(this)
rv_list.adapter = mConfideAdapter
}
......
......@@ -97,7 +97,7 @@ class ConfideHomeAdapter(private val mContext: Context,
return ConfideHomeListenAndFoundViewHolder(ConfideHomeListenAndFoundView(parent.context, confideHomeEvent))
}
else -> {
return EmptyViewHolder(View.inflate(parent.context, R.layout.confidehome_empty, null))
return EmptyViewHolder(View.inflate(parent.context, R.layout.confide_empty, null))
}
}
}
......
......@@ -93,7 +93,7 @@ interface IConfideHomeContract{
/**
* 倾诉首页数据请求
*/
fun confideHomeRequest()
fun confideHomeRequest(isRefresh:Boolean = true)
/**
* 为你推荐列表(筛选调用)
......
package com.ydl.confide.home.popwindow
import android.content.Context
import android.graphics.Typeface
import android.graphics.drawable.BitmapDrawable
import android.support.v7.widget.GridLayoutManager
import android.support.v7.widget.LinearLayoutManager
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.PopupWindow
import com.yidianling.common.tools.RxImageTool
import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeFiterItemBean
import com.ydl.confide.home.popwindow.adapter.ConfideHomeGoodAdapter
import com.ydl.ydlcommon.view.SpaceItemDecorator
import kotlinx.android.synthetic.main.confidehome_good_popup_window.view.*
import com.yidianling.common.tools.RxImageTool
import kotlinx.android.synthetic.main.confide_good_popup_window.view.*
......@@ -33,7 +32,7 @@ class ConfideHomeGoodPopupWindow(context: Context, goodsList: ArrayList<ConfideH
private var selectedGoodsList: ArrayList<ConfideHomeFiterItemBean>? = null
init {
val view = LayoutInflater.from(context).inflate(R.layout.confidehome_good_popup_window, null)
val view = LayoutInflater.from(context).inflate(R.layout.confide_good_popup_window, null)
this.contentView = view
this.isFocusable = true
@Suppress("DEPRECATION")
......
package com.ydl.confide.home.popwindow
import android.content.Context
import android.graphics.Typeface
import android.graphics.drawable.BitmapDrawable
import android.support.v7.widget.GridLayoutManager
import android.support.v7.widget.LinearLayoutManager
......@@ -11,13 +10,13 @@ import android.view.View
import android.view.ViewGroup
import android.widget.PopupWindow
import android.widget.TextView
import com.yidianling.common.tools.RxImageTool
import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeAllFiltersBean
import com.ydl.confide.home.bean.ConfideHomeFiterItemBean
import com.ydl.confide.home.popwindow.adapter.ConfideHomeGoodAdapter
import com.ydl.ydlcommon.view.SpaceItemDecorator
import kotlinx.android.synthetic.main.confidehome_sexage_popup_window.view.*
import com.yidianling.common.tools.RxImageTool
import kotlinx.android.synthetic.main.confide_sexage_popup_window.view.*
/**
* @author yuanwai
......@@ -43,7 +42,7 @@ class ConfideHomeSexAgePopupWindow(context: Context, sexData: ArrayList<ConfideH
private var mAllFiltersBean : ConfideHomeAllFiltersBean? = null
init {
val view = LayoutInflater.from(context).inflate(R.layout.confidehome_sexage_popup_window, null)
val view = LayoutInflater.from(context).inflate(R.layout.confide_sexage_popup_window, null)
this.contentView = view
this.isFocusable = true
@Suppress("DEPRECATION")
......@@ -164,10 +163,10 @@ class ConfideHomeSexAgePopupWindow(context: Context, sexData: ArrayList<ConfideH
*/
private fun setSelect(tvSex1: TextView,boolean: Boolean){
if (boolean){
tvSex1.setBackgroundResource(R.drawable.confidehome_filter_select_sel)
tvSex1.setTextColor(tvSex1.context.resources.getColor(R.color.baby_blue))
tvSex1.setBackgroundResource(R.drawable.confide_filter_select_sel)
tvSex1.setTextColor(tvSex1.context.resources.getColor(R.color.confide_main_theme))
}else{
tvSex1.setBackgroundResource(R.drawable.confidehome_filter_select_nor)
tvSex1.setBackgroundResource(R.drawable.confide_filter_select_nor)
tvSex1.setTextColor(tvSex1.context.resources.getColor(R.color._6))
}
}
......
......@@ -10,7 +10,7 @@ import android.widget.PopupWindow
import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeFiterItemBean
import com.ydl.confide.home.popwindow.adapter.ConfideHomeSortAdapter
import kotlinx.android.synthetic.main.confidehome_sort_popup_window.view.*
import kotlinx.android.synthetic.main.confide_sort_popup_window.view.*
/**
* @author yuanwai
......@@ -25,7 +25,7 @@ class ConfideHomeSortPopupWindow(val context: Context, private val sortItems: Ar
private var adapter: ConfideHomeSortAdapter? = null
init {
val view = LayoutInflater.from(context).inflate(R.layout.confidehome_sort_popup_window, null)
val view = LayoutInflater.from(context).inflate(R.layout.confide_sort_popup_window, null)
this.contentView = view
this.isFocusable = true
@Suppress("DEPRECATION")
......
......@@ -8,7 +8,7 @@ import android.view.ViewGroup
import android.widget.TextView
import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeFiterItemBean
import kotlinx.android.synthetic.main.confidehome_good_item.view.*
import kotlinx.android.synthetic.main.confide_good_item.view.*
/**
* @author yuanwai
......@@ -25,9 +25,9 @@ class ConfideHomeGoodAdapter(private val context: Context, private val goods: Ar
holder.tvGoodName.text = goods[position].name
holder.tvGoodName.isSelected = selectedGood.contains(category)
if (holder.tvGoodName.isSelected) {
holder.tvGoodName.setBackgroundResource(R.drawable.confidehome_filter_select_sel)
holder.tvGoodName.setBackgroundResource(R.drawable.confide_filter_select_sel)
} else {
holder.tvGoodName.setBackgroundResource(R.drawable.confidehome_filter_select_nor)
holder.tvGoodName.setBackgroundResource(R.drawable.confide_filter_select_nor)
}
}
}
......@@ -38,7 +38,7 @@ class ConfideHomeGoodAdapter(private val context: Context, private val goods: Ar
}
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder {
val itemView = LayoutInflater.from(context).inflate(R.layout.confidehome_good_item, parent, false)
val itemView = LayoutInflater.from(context).inflate(R.layout.confide_good_item, parent, false)
return ViewHolder(itemView)
}
......
package com.ydl.confide.home.popwindow.adapter
import android.content.Context
import android.graphics.Color
import android.support.v4.content.ContextCompat
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
......@@ -10,7 +9,7 @@ import android.view.ViewGroup
import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeFiterItemBean
import com.ydl.confide.home.popwindow.ConfideHomeSortPopupWindow
import kotlinx.android.synthetic.main.confidehome_sort_item.view.*
import kotlinx.android.synthetic.main.confide_sort_item.view.*
/**
* @author yuanwai
......@@ -27,7 +26,7 @@ class ConfideHomeSortAdapter(private val context: Context,
override fun getItemCount(): Int = sortItems.size
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder {
val itemView = LayoutInflater.from(context).inflate(R.layout.confidehome_sort_item, parent, false)
val itemView = LayoutInflater.from(context).inflate(R.layout.confide_sort_item, parent, false)
return ViewHolder(itemView)
}
......@@ -36,7 +35,7 @@ class ConfideHomeSortAdapter(private val context: Context,
if (holder != null) {
holder.tvSort.text = item.name
if (item.id == selectedSort.id) {
holder.tvSort.setTextColor(Color.parseColor("#1DA1F2"))
holder.tvSort.setTextColor(context.resources.getColor(R.color.confide_main_theme))
}else{
holder.tvSort.setTextColor(ContextCompat.getColor(context, R.color._6))
}
......
......@@ -4,7 +4,6 @@ import android.content.Context
import android.text.TextUtils
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.yidianling.common.tools.RxNetTool
import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.contract.IConfideHomeContract
import com.ydl.confide.home.http.ConfideRecommendParam
......@@ -13,12 +12,14 @@ import com.ydl.confide.home.util.ConfideHomeUtils
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.ydl.ydlcommon.mvp.lce.ILceView
import com.ydl.ydlcommon.mvp.base.IView
import com.ydl.ydlcommon.utils.RxLifecycleUtils
import com.ydl.ydlcommon.utils.YDLAsyncUtils
import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.yidianling.common.tools.RxNetTool
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
/**
* @author yuanwai
......@@ -65,7 +66,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid
mView.confideHomeResponse(list)
}
}
confideHomeRequest()
confideHomeRequest(false)
}
})
}
......@@ -73,7 +74,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid
/**
* 请求首页数据
*/
override fun confideHomeRequest() {
override fun confideHomeRequest(isRefresh:Boolean) {
if (!RxNetTool.isConnected(mView.getContext())){
mView.confideHomeRequestFail()
return
......@@ -81,9 +82,20 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid
val disposable = mModel.confideHomeRequest()
.map { it }
.filter { it != null }
.compose(RxUtils.applySchedulers(mView))
.compose(RxLifecycleUtils.bindToLifecycle(mView!!))//使用 Rxlifecycle,使 Disposable 和 Activity 一起销毁
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.doOnSubscribe {
if (!isRefresh){
mView.showLoading()//显示进度条
}
}
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doFinally {
if (!isRefresh){
mView.hideLoading()//隐藏进度条
}
}.compose(RxLifecycleUtils.bindToLifecycle(mView))
.subscribe(Consumer {
mView.confideHomeResponse(it)
updateCache(it)
......@@ -128,7 +140,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid
val disposable = mModel.recommendList(param)
.map { it }
.filter { it != null }
.compose(RxUtils.applySchedulers(mView))
.compose(RxUtils.applySchedulers(mView as IView))
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
mView.recommendListResponse(it)
......@@ -150,7 +162,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid
val disposable = mModel.recommendList(param)
.map { it }
.filter { it != null }
.compose(RxUtils.applySchedulers(mView))
.compose(RxUtils.applySchedulers(mView as IView))
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
mView.recommendListMoreResponse(it)
......
......@@ -44,7 +44,7 @@ class ConfideHomeBannerSection(var context: Context, private var confideHomeEven
BannerViewHolder(ConfideHomeBannerView(context,confideHomeEvent))
}
else -> {
EmptyViewHolder(View.inflate(context,R.layout.view_empty,null))
EmptyViewHolder(View.inflate(context,R.layout.confide_view_empty,null))
}
}
}
......
......@@ -45,7 +45,7 @@ class ConfideHomeCategorySection(var context: Context, var confideHomeEvent : IC
CategoryViewHolder(ConfideHomeCategoryView(context,confideHomeEvent,homeView))
}
else -> {
EmptyViewHolder(View.inflate(context,R.layout.view_empty,null))
EmptyViewHolder(View.inflate(context,R.layout.confide_view_empty,null))
}
}
}
......
......@@ -66,7 +66,7 @@ class ConfideHomeFilterSection(var context: Context,var view : IConfideHomeContr
var dp15 = RxImageTool.dip2px(15f)
param.setMargins(dp15,0,dp15,0)
var footerView = View(context)
footerView.setBackgroundColor(context.resources.getColor(R.color.confidehome_filters_line))
footerView.setBackgroundColor(context.resources.getColor(R.color.confide_filters_line))
footerView.layoutParams = param
return FooterViewHolder(footerView)
}else{
......
......@@ -37,7 +37,7 @@ class ConfideHomeFooterSection(var context: Context, private var confideHomeEven
FooterViewHolder(ConfideHomeFooterView(context,confideHomeEvent))
}
else -> {
EmptyViewHolder(View.inflate(context,R.layout.view_empty,null))
EmptyViewHolder(View.inflate(context,R.layout.confide_view_empty,null))
}
}
}
......
......@@ -59,7 +59,7 @@ class ConfideHomeRecommendExpertSection(var context: Context, var confideHomeEve
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): RecyclerView.ViewHolder {
if (viewType == combineType(IConfideHomeConfig.SECTION_CONSULTANT, HEADER)) {
return HeadViewHolder(LayoutInflater.from(context).inflate(R.layout.confidehome_recommend_expert_head, parent, false))
return HeadViewHolder(LayoutInflater.from(context).inflate(R.layout.confide_recommend_expert_head, parent, false))
} else {
return ConfideHomeRecommendExpertViewHolder(ConfideHomeRecommendExpertView(context, confideHomeEvent))
}
......
......@@ -11,7 +11,6 @@ import android.view.View
import android.view.animation.AnimationUtils
import android.view.animation.LinearInterpolator
import android.widget.ImageView
import com.yidianling.common.tools.LogUtil
import com.ydl.confide.R
import com.ydl.confide.home.adapter.ConfideHomeAdapter
import com.ydl.confide.home.bean.ConfideHomeAllFiltersBean
......@@ -27,6 +26,7 @@ import com.ydl.confide.home.widget.ConfideHomeFilterView
import com.ydl.confide.home.widget.ConfidePlayerFloatView
import com.ydl.ydlcommon.adapter.section.SectionAdapter
import com.ydl.ydlcommon.utils.MainUtils
import com.yidianling.common.tools.LogUtil
import java.io.BufferedInputStream
import java.io.IOException
import java.io.InputStream
......@@ -461,8 +461,8 @@ class ConfideHomeUtils {
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_grey_500_18dp, 0)
}
IConfideHomeConfig.FILTER_STATUS_FILTERED, IConfideHomeConfig.FILTER_STATUS_OPEN -> {
tv.setTextColor(ContextCompat.getColor(mContext, R.color.baby_blue))
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_green_18dp, 0)
tv.setTextColor(ContextCompat.getColor(mContext, R.color.confide_main_theme))
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.confide_ic_arrow_drop_down_green_18dp, 0)
}
}
}
......@@ -475,7 +475,7 @@ class ConfideHomeUtils {
tv.setTextColor(ContextCompat.getColor(mContext, R.color._6))
}
IConfideHomeConfig.FILTER_STATUS_FILTERED, IConfideHomeConfig.FILTER_STATUS_OPEN -> {
tv.setTextColor(ContextCompat.getColor(mContext, R.color.baby_blue))
tv.setTextColor(ContextCompat.getColor(mContext, R.color.confide_main_theme))
}
}
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_grey_500_18dp, 0)
......@@ -488,7 +488,7 @@ class ConfideHomeUtils {
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_grey_500_18dp, 0)
}
IConfideHomeConfig.FILTER_STATUS_FILTERED, IConfideHomeConfig.FILTER_STATUS_OPEN -> {
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_green_18dp, 0)
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.confide_ic_arrow_drop_down_green_18dp, 0)
}
}
}
......@@ -497,7 +497,7 @@ class ConfideHomeUtils {
* 启动 播放动画
*/
fun startPlayAnim(context: Context, imageView: ImageView) {
var animation = AnimationUtils.loadAnimation(context, R.anim.confidehome_play_anim)
var animation = AnimationUtils.loadAnimation(context, R.anim.confide_play_anim)
var lin = LinearInterpolator()//设置动画匀速运动
animation.interpolator = lin
imageView.startAnimation(animation)
......
......@@ -10,7 +10,7 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.event.IConfideHomeEvent
import com.ydl.ydlcommon.view.banner.GlideImageLoader
import kotlinx.android.synthetic.main.confidehome_banner_view.view.*
import kotlinx.android.synthetic.main.confide_banner_view.view.*
/**
* @author yuanwai
......@@ -39,7 +39,7 @@ class ConfideHomeBannerView(context: Context,
private fun initView() {
val params = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
View.inflate(context, R.layout.confidehome_banner_view, this)
View.inflate(context, R.layout.confide_banner_view, this)
layoutParams = params
margin = RxImageTool.dip2px(2.5f)
}
......@@ -67,7 +67,7 @@ class ConfideHomeBannerView(context: Context,
for (index in 0..count) {
urlLists.add((mDataList as ArrayList<ConfideHomeBodyBean>)[index].bannerImageUrl!!)
}
banner.setImageLoader(GlideImageLoader(R.color.new_divide_color,6)).setImages(urlLists).start()
banner.setImageLoader(GlideImageLoader(R.color.confide_new_divide_color,6)).setImages(urlLists).start()
banner.setOnBannerListener {
confideHomeEvent!!.bannerClick((mDataList as ArrayList<ConfideHomeBodyBean>)[it].bannerLinkUrl, it, (mDataList as ArrayList<ConfideHomeBodyBean>)[it].bannerTitle)
......
......@@ -6,13 +6,13 @@ import android.support.v7.widget.CardView
import android.text.TextUtils
import android.util.AttributeSet
import android.view.View
import com.ydl.ydl_image.module.GlideApp
import com.yidianling.common.tools.RxImageTool
import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.contract.IConfideHomeContract
import com.ydl.confide.home.event.IConfideHomeEvent
import kotlinx.android.synthetic.main.confidehome_item_category.view.*
import com.ydl.ydl_image.module.GlideApp
import com.yidianling.common.tools.RxImageTool
import kotlinx.android.synthetic.main.confide_item_category.view.*
/**
* @author yuanwai
......@@ -32,7 +32,7 @@ class ConfideHomeCategoryItemView(mContext: Context, @Nullable attrs: AttributeS
}
private fun initView() {
View.inflate(context, R.layout.confidehome_item_category, this)
View.inflate(context, R.layout.confide_item_category, this)
dp35 = RxImageTool.dip2px(35f)
}
......
......@@ -10,7 +10,7 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.contract.IConfideHomeContract
import com.ydl.confide.home.event.IConfideHomeEvent
import kotlinx.android.synthetic.main.confidehome_category_view.view.*
import kotlinx.android.synthetic.main.confide_category_view.view.*
/**
* @author yuanwai
......@@ -30,10 +30,10 @@ class ConfideHomeCategoryView(mContext: Context,
private fun initView(){
var params = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,RxImageTool.dip2px(106f))
View.inflate(context, R.layout.confidehome_category_view,this)
View.inflate(context, R.layout.confide_category_view,this)
layoutParams = params
orientation = HORIZONTAL
setBackgroundResource(R.color.confidehome_category_bg)
setBackgroundResource(R.color.confide_category_bg)
}
fun initData(bean: ConfideHomeDataBean?){
......
......@@ -9,13 +9,13 @@ import android.view.Gravity
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.yidianling.common.tools.RxImageTool
import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.contract.IConfideHomeContract
import com.ydl.ydlcommon.utils.ScreenUtil
import com.ydl.ydlcommon.view.DrawableRightTextView
import com.yidianling.common.tools.RxImageTool
/**
* @author yuanwai
......@@ -93,7 +93,7 @@ class ConfideHomeFilterView(mContext: Context, @Nullable attrs: AttributeSet?, d
textView.text = bodyBean.filterName
textView.setTag(R.id.tv_title,bodyBean)
if ("排序" == bodyBean.filterName){
textView.setTextColor(ContextCompat.getColor(context, R.color.baby_blue))
textView.setTextColor(ContextCompat.getColor(context, R.color.confide_main_theme))
// textView.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_arrow_drop_down_green_18dp, 0)
}
textView.setOnClickListener {
......@@ -127,7 +127,7 @@ class ConfideHomeFilterView(mContext: Context, @Nullable attrs: AttributeSet?, d
var view = getChildAt(index)
if (view is DrawableRightTextView){
if ("排序" == view.text){
view.setTextColor(ContextCompat.getColor(context, R.color.baby_blue))
view.setTextColor(ContextCompat.getColor(context, R.color.confide_main_theme))
}else{
view.setTextColor(ContextCompat.getColor(context, R.color._6))
}
......
......@@ -7,7 +7,7 @@ import android.widget.LinearLayout
import android.widget.RelativeLayout
import com.ydl.confide.R
import com.ydl.confide.home.event.IConfideHomeEvent
import kotlinx.android.synthetic.main.confidehome_footer.view.*
import kotlinx.android.synthetic.main.confide_footer.view.*
/**
* @author yuanwai
......@@ -27,7 +27,7 @@ class ConfideHomeFooterView(var mContext: Context,var confideHomeEvent : IConfid
*/
private fun initView() {
var params = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT)
View.inflate(context, R.layout.confidehome_footer,this)
View.inflate(context, R.layout.confide_footer,this)
tv_footer.setOnClickListener {
confideHomeEvent.consultantMoreClick("app://listen/list")
}
......
......@@ -9,7 +9,7 @@ import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.config.IConfideHomeConfig
import com.ydl.confide.home.event.IConfideHomeEvent
import kotlinx.android.synthetic.main.confidehome_item_header.view.*
import kotlinx.android.synthetic.main.confide_item_header.view.*
@Suppress("DEPRECATION")
/**
......@@ -27,7 +27,7 @@ class ConfideHomeHeadView(context: Context, private var confideHomeEvent: IConfi
private fun initView() {
orientation = HORIZONTAL
View.inflate(context, R.layout.confidehome_item_header, this)
View.inflate(context, R.layout.confide_item_header, this)
var params = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, RxImageTool.dip2px(25f))
params.setMargins(0, RxImageTool.dip2px(30f), 0, RxImageTool.dip2px(18f))
layoutParams = params
......@@ -46,18 +46,18 @@ class ConfideHomeHeadView(context: Context, private var confideHomeEvent: IConfi
when (bean.type) {
IConfideHomeConfig.TYPE_RECOMMEND -> {
setPadding(0, RxImageTool.dip2px(30f), 0, 0)
iv_recently_talk.setImageResource(R.drawable.confidehome_recommend)
iv_recently_talk.setImageResource(R.drawable.confide_recommend)
iv_recently_title.text = bean.head.title
iv_recently_more.visibility = View.GONE
}
IConfideHomeConfig.TYPE_RECENTLY_CONFIDED -> {
setPadding(0, RxImageTool.dip2px(30f), 0, RxImageTool.dip2px(18f))
iv_recently_talk.setImageResource(R.drawable.confidehome_zuijin)
iv_recently_talk.setImageResource(R.drawable.confide_zuijin)
iv_recently_title.text = bean.head.title
iv_recently_more.visibility = View.GONE
}
IConfideHomeConfig.TYPE_SOUND -> {
iv_recently_talk.setImageResource(R.drawable.confidehome_listen)
iv_recently_talk.setImageResource(R.drawable.confide_listen)
iv_recently_title.text = bean.head.title
iv_recently_more.visibility = View.GONE
}
......
......@@ -9,7 +9,7 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.config.IConfideHomeConfig
import com.ydl.confide.home.event.IConfideHomeEvent
import com.ydl.confide.home.util.ConfideHomeUtils
import kotlinx.android.synthetic.main.confidehome_listen_and_found_item_view.view.*
import kotlinx.android.synthetic.main.confide_listen_and_found_item_view.view.*
/**
* @author yuanwai
......@@ -24,7 +24,7 @@ class ConfideHomeListenAndFoundItemView(mContext: Context, private var confideHo
}
private fun initView() {
View.inflate(context, R.layout.confidehome_listen_and_found_item_view, this)
View.inflate(context, R.layout.confide_listen_and_found_item_view, this)
}
/**
......@@ -66,15 +66,15 @@ class ConfideHomeListenAndFoundItemView(mContext: Context, private var confideHo
when (bodyBean.confideLine) {//1在线 2离线 3通话中
1 -> {
tv_isLine.text = "在线"
tv_isLine.setBackgroundResource(R.drawable.confidehome_bg_main_color)
tv_isLine.setBackgroundResource(R.drawable.confide_bg_main_color)
}
2 -> {
tv_isLine.text = "离线"
tv_isLine.setBackgroundResource(R.drawable.confidehome_bg_color_666666)
tv_isLine.setBackgroundResource(R.drawable.confide_bg_color_666666)
}
3 -> {
tv_isLine.text = "通话中"
tv_isLine.setBackgroundResource(R.drawable.confidehome_bg_color_ff8f38)
tv_isLine.setBackgroundResource(R.drawable.confide_bg_color_ff8f38)
}
else -> {
......@@ -111,9 +111,9 @@ class ConfideHomeListenAndFoundItemView(mContext: Context, private var confideHo
*/
private fun setSex(bodyBean: ConfideHomeBodyBean) {
if (bodyBean.confideSex == 1) {
img_sex.setImageResource(R.drawable.confidehome_new_male)
img_sex.setImageResource(R.drawable.confide_new_male)
} else {
img_sex.setImageResource(R.drawable.confidehome_new_female)
img_sex.setImageResource(R.drawable.confide_new_female)
}
}
......@@ -151,16 +151,16 @@ class ConfideHomeListenAndFoundItemView(mContext: Context, private var confideHo
private fun setConfideButton(bodyBean: ConfideHomeBodyBean) {
when (bodyBean.confideLine) {//1.在线 2.离线 3.通话中 4.继续倾诉
1 -> {
tv_confide.setBackgroundResource(R.drawable.confidehome_line_1)
tv_confide.setBackgroundResource(R.drawable.confide_line_1)
}
2 -> {
tv_confide.setBackgroundResource(R.drawable.confidehome_line_2)
tv_confide.setBackgroundResource(R.drawable.confide_line_2)
}
3 -> {
tv_confide.setBackgroundResource(R.drawable.confidehome_line_3)
tv_confide.setBackgroundResource(R.drawable.confide_line_3)
}
4 ->{
tv_confide.setBackgroundResource(R.drawable.confidehome_line_4)
tv_confide.setBackgroundResource(R.drawable.confide_line_4)
}
}
}
......
......@@ -6,7 +6,7 @@ import android.widget.FrameLayout
import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.event.IConfideHomeEvent
import kotlinx.android.synthetic.main.confidehome_banner.view.*
import kotlinx.android.synthetic.main.confide_banner.view.*
/**
* @author Jim
......@@ -28,7 +28,7 @@ class ConfideHomeListenAndFoundView(context: Context, private var confideHomeEve
}
private fun initView() {
View.inflate(context, R.layout.confidehome_banner, this)
View.inflate(context, R.layout.confide_banner, this)
}
fun initData(bean: ConfideHomeDataBean) {
......
......@@ -13,7 +13,7 @@ import com.yidianling.common.tools.RxImageTool
import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.event.IConfideHomeEvent
import kotlinx.android.synthetic.main.confidehome_recent_view.view.*
import kotlinx.android.synthetic.main.confide_recent_view.view.*
/**
* @author yuanwai
......@@ -35,7 +35,7 @@ class ConfideHomeRecentView(mContext: Context, private var confideHomeEvent: ICo
*/
private fun initView() {
initLayoutParam()
View.inflate(context, R.layout.confidehome_recent_view, this)
View.inflate(context, R.layout.confide_recent_view, this)
}
......@@ -71,9 +71,9 @@ class ConfideHomeRecentView(mContext: Context, private var confideHomeEvent: ICo
img_icon.setTag(R.id.img_icon, bodyBean.confidedIcon)
}
if (bodyBean.confideSex == 1) {
img_sex.setImageResource(R.drawable.confidehome_new_male)
img_sex.setImageResource(R.drawable.confide_new_male)
} else {
img_sex.setImageResource(R.drawable.confidehome_new_female)
img_sex.setImageResource(R.drawable.confide_new_female)
}
tv_name.text = bodyBean.confidedName
tv_history.text = bodyBean.confideHistory
......
......@@ -17,7 +17,7 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.config.IConfideHomeConfig
import com.ydl.confide.home.event.IConfideHomeEvent
import com.ydl.ydlcommon.utils.ScreenUtil
import kotlinx.android.synthetic.main.confidehome_recommend_expert_item_view.view.*
import kotlinx.android.synthetic.main.confide_recommend_expert_item_view.view.*
/**
* @author yuanwai
......@@ -38,7 +38,7 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH
}
private fun initView() {
View.inflate(context, R.layout.confidehome_recommend_expert_item_view, this)
View.inflate(context, R.layout.confide_recommend_expert_item_view, this)
bgWidth = ScreenUtil.screenWidth - RxImageTool.dip2px(30f)
dp100 = RxImageTool.dip2px(100f)
dp16 = RxImageTool.dip2px(16f)
......@@ -108,15 +108,15 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH
when (bodyBean.confideLine) {//1在线 2离线 3通话中 4继续通话
1, 4 -> {
tv_isLine.text = "在线"
tv_isLine.setBackgroundResource(R.drawable.confidehome_bg_main_color)
tv_isLine.setBackgroundResource(R.drawable.confide_bg_main_color)
}
2 -> {
tv_isLine.text = "离线"
tv_isLine.setBackgroundResource(R.drawable.confidehome_bg_color_666666)
tv_isLine.setBackgroundResource(R.drawable.confide_bg_color_666666)
}
3 -> {
tv_isLine.text = "通话中"
tv_isLine.setBackgroundResource(R.drawable.confidehome_bg_color_ff8f38)
tv_isLine.setBackgroundResource(R.drawable.confide_bg_color_ff8f38)
}
}
}
......@@ -145,9 +145,9 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH
img_play.visibility = View.VISIBLE
}
if (confideIsPlay) {
img_play.setImageResource(R.drawable.confidehome_playing)
img_play.setImageResource(R.drawable.confide_playing)
} else {
img_play.setImageResource(R.drawable.confidehome_sond_play)
img_play.setImageResource(R.drawable.confide_sond_play)
}
img_play.setOnClickListener {
if (confideIsPlay) {
......@@ -163,9 +163,9 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH
*/
private fun setSex(bodyBean: ConfideHomeBodyBean) {
if (bodyBean.confideSex == 1) {
img_sex.setImageResource(R.drawable.confidehome_new_male)
img_sex.setImageResource(R.drawable.confide_new_male)
} else {
img_sex.setImageResource(R.drawable.confidehome_new_female)
img_sex.setImageResource(R.drawable.confide_new_female)
}
}
......@@ -215,7 +215,7 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH
textView.setTextColor(Color.parseColor("#808080"))
textView.gravity = Gravity.CENTER
textView.setPadding(dp3, 0, dp3, 0)
textView.setBackgroundResource(R.drawable.confidehome_bg_tag)
textView.setBackgroundResource(R.drawable.confide_bg_tag)
textView.layoutParams = params
textView.text = tag
flowlayout_tag.addView(textView)
......
......@@ -7,7 +7,7 @@ import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.event.IConfideHomeEvent
import com.ydl.confide.home.widget.adapter.RecommendExpertAdapter
import kotlinx.android.synthetic.main.confidehome_recommend_expert_view.view.*
import kotlinx.android.synthetic.main.confide_recommend_expert_view.view.*
/**
* @author yuanwai
......@@ -33,7 +33,7 @@ class ConfideHomeRecommendExpertView(context : Context, private var confideHomeE
}
private fun initView(){
View.inflate(context, R.layout.confidehome_recommend_expert_view,this)
View.inflate(context, R.layout.confide_recommend_expert_view,this)
}
fun initData(bean: ConfideHomeDataBean?){
......
......@@ -18,7 +18,7 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.config.IConfideHomeConfig
import com.ydl.confide.home.contract.IConfideHomeContract
import com.ydl.confide.home.event.IConfideHomeEvent
import kotlinx.android.synthetic.main.confidehome_recommend_view.view.*
import kotlinx.android.synthetic.main.confide_recommend_view.view.*
/**
* @author yuanwai
......@@ -41,7 +41,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
private fun initView() {
var params = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(context, R.layout.confidehome_recommend_view, this)
View.inflate(context, R.layout.confide_recommend_view, this)
dp96 = RxImageTool.dip2px(96f)
dp16 = RxImageTool.dip2px(16f)
dp4 = RxImageTool.dip2px(4f)
......@@ -92,15 +92,15 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
when (bodyBean.confideLine) {//1在线 2离线 3通话中
1, 4 -> {
tv_isLine.text = "在线"
tv_isLine.setBackgroundResource(R.drawable.confidehome_bg_main_color)
tv_isLine.setBackgroundResource(R.drawable.confide_bg_main_color)
}
2 -> {
tv_isLine.text = "离线"
tv_isLine.setBackgroundResource(R.drawable.confidehome_bg_color_666666)
tv_isLine.setBackgroundResource(R.drawable.confide_bg_color_666666)
}
3 -> {
tv_isLine.text = "通话中"
tv_isLine.setBackgroundResource(R.drawable.confidehome_bg_color_ff8f38)
tv_isLine.setBackgroundResource(R.drawable.confide_bg_color_ff8f38)
}
// 4 -> {
// tv_confide.text = "继续倾诉"
......@@ -133,9 +133,9 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
iv_play.visibility = View.VISIBLE
}
if (bodyBean.confideIsPlay) {
iv_play.setImageResource(R.drawable.confidehome_playing)
iv_play.setImageResource(R.drawable.confide_playing)
} else {
iv_play.setImageResource(R.drawable.confidehome_sond_play)
iv_play.setImageResource(R.drawable.confide_sond_play)
}
iv_play.setOnClickListener {
if (bodyBean.confideIsPlay!!) {
......@@ -151,9 +151,9 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
*/
private fun setSex(bodyBean: ConfideHomeBodyBean) {
if (bodyBean.confideSex == 1) {
img_sex.setImageResource(R.drawable.confidehome_new_male)
img_sex.setImageResource(R.drawable.confide_new_male)
} else {
img_sex.setImageResource(R.drawable.confidehome_new_female)
img_sex.setImageResource(R.drawable.confide_new_female)
}
}
......@@ -216,7 +216,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
textView.setTextColor(Color.parseColor("#808080"))
textView.gravity = Gravity.CENTER
textView.setPadding(dp3, 0, dp3, 0)
textView.setBackgroundResource(R.drawable.confidehome_bg_tag)
textView.setBackgroundResource(R.drawable.confide_bg_tag)
textView.layoutParams = params
textView.text = tag
flowlayout_tag.addView(textView)
......@@ -230,16 +230,16 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
private fun setConfideButton(bodyBean: ConfideHomeBodyBean) {
when (bodyBean.confideLine) {//1在线 2离线 3通话中 4继续倾诉
1 -> {
tv_confide.setBackgroundResource(R.drawable.confidehome_line_1)
tv_confide.setBackgroundResource(R.drawable.confide_line_1)
}
2 -> {
tv_confide.setBackgroundResource(R.drawable.confidehome_line_2)
tv_confide.setBackgroundResource(R.drawable.confide_line_2)
}
3 -> {
tv_confide.setBackgroundResource(R.drawable.confidehome_line_3)
tv_confide.setBackgroundResource(R.drawable.confide_line_3)
}
4 -> {
tv_confide.setBackgroundResource(R.drawable.confidehome_line_4)
tv_confide.setBackgroundResource(R.drawable.confide_line_4)
}
}
tv_confide.setOnClickListener {
......
......@@ -48,7 +48,7 @@ public class ConfidePlayerFloatView extends FrameLayout {
wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
dp3= RxImageTool.dip2px(3f);
mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop() + 5;
View view = inflate(context, R.layout.confidehome_playing_float_btn, this);
View view = inflate(context, R.layout.confide_playing_float_btn, this);
playHead = view.findViewById(R.id.play_head);
playState = view.findViewById(R.id.play_state);
playClose = findViewById(R.id.play_close);
......@@ -168,7 +168,7 @@ public class ConfidePlayerFloatView extends FrameLayout {
} else {
if (!isMove) {
if (isFmPlay) {
playState.setImageResource(R.drawable.confidehome_play_stop);
playState.setImageResource(R.drawable.confide_play_stop);
playState.setPadding(dp3,dp3,dp3,dp3);
playClose.setVisibility(VISIBLE);
dividerLine.setVisibility(VISIBLE);
......@@ -176,7 +176,7 @@ public class ConfidePlayerFloatView extends FrameLayout {
mPlayCallBack.click(false);
}
} else {
playState.setImageResource(R.drawable.confidehome_play_pause);
playState.setImageResource(R.drawable.confide_play_pause);
playState.setPadding(dp3,dp3,dp3,dp3);
playClose.setVisibility(GONE);
dividerLine.setVisibility(GONE);
......@@ -229,12 +229,12 @@ public class ConfidePlayerFloatView extends FrameLayout {
public void updatePlayState(Boolean isPlaying) {
this.isFmPlay = isPlaying;
if (isPlaying) {
playState.setImageResource(R.drawable.confidehome_play_pause);
playState.setImageResource(R.drawable.confide_play_pause);
playState.setPadding(dp3,dp3,dp3,dp3);
playClose.setVisibility(GONE);
dividerLine.setVisibility(VISIBLE);
} else {
playState.setImageResource(R.drawable.confidehome_play_stop);
playState.setImageResource(R.drawable.confide_play_stop);
playState.setPadding(dp3,dp3,dp3,dp3);
playClose.setVisibility(VISIBLE);
}
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/baby_blue" android:state_selected="true" android:state_enabled="true"/>
<item android:color="@color/confide_main_theme" android:state_selected="true" android:state_enabled="true"/>
<item android:color="@color/_6" android:state_enabled="true"/>
</selector>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment