Commit 86325d4b by 徐健
parents eeb12209 257c5c1c
...@@ -8,7 +8,7 @@ apply plugin: 'plugin.resTools' // 资源重命名插件 ...@@ -8,7 +8,7 @@ apply plugin: 'plugin.resTools' // 资源重命名插件
// 配置资源重命名插件 // 配置资源重命名插件
resConfig { resConfig {
new_prefix = 'audioim_' // 资源前缀 new_prefix = 'audioim_' // 资源前缀
old_prefix = 'audio_home_' // 老前缀,可为''空字符串 old_prefix = '' // 老前缀,可为''空字符串
} }
kapt { kapt {
...@@ -37,6 +37,9 @@ android { ...@@ -37,6 +37,9 @@ android {
flavorDimensions "versionCode" flavorDimensions "versionCode"
} }
//前缀的名字
resourcePrefix "audioim_"
buildTypes { buildTypes {
release { release {
minifyEnabled false minifyEnabled false
......
...@@ -62,7 +62,7 @@ import io.reactivex.Observable ...@@ -62,7 +62,7 @@ import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers 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 import java.util.concurrent.TimeUnit
...@@ -294,7 +294,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi ...@@ -294,7 +294,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
} }
override fun layoutResId(): Int { override fun layoutResId(): Int {
return R.layout.activity_audio_home return R.layout.audioim_activity_audio_home
} }
override fun initDataAndEvent() { override fun initDataAndEvent() {
...@@ -315,7 +315,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi ...@@ -315,7 +315,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
} }
private fun setWindowStatusBarColor() { private fun setWindowStatusBarColor() {
StatusBarUtils.setWindowStatusBarColor(this, R.color.color_40353535) StatusBarUtils.setWindowStatusBarColor(this, R.color.audioim_color_40353535)
} }
@SuppressLint("InvalidWakeLockTag") @SuppressLint("InvalidWakeLockTag")
...@@ -366,8 +366,8 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi ...@@ -366,8 +366,8 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
if (!TextUtils.isEmpty(expertHeadUrl)) { if (!TextUtils.isEmpty(expertHeadUrl)) {
var option = SimpleImageOpConfiger() var option = SimpleImageOpConfiger()
option.errorPic = R.drawable.head_place_hold_pic option.errorPic = R.drawable.audioim_head_place_hold_pic
option.loadingPic = R.drawable.head_place_hold_pic option.loadingPic = R.drawable.audioim_head_place_hold_pic
option.transform = 0 option.transform = 0
YDLImageCacheManager.showImage(this, expertHeadUrl, iv_head, option) YDLImageCacheManager.showImage(this, expertHeadUrl, iv_head, option)
} }
...@@ -388,10 +388,10 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi ...@@ -388,10 +388,10 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
iv_hands_free.setOnClickListener { iv_hands_free.setOnClickListener {
if (iv_hands_free.isSelected) { if (iv_hands_free.isSelected) {
iv_hands_free.isSelected = false 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 { } else {
iv_hands_free.isSelected = true 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)
} }
//已经接通 //已经接通
...@@ -501,7 +501,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi ...@@ -501,7 +501,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
} else if (permission.shouldShowRequestPermissionRationale) { } else if (permission.shouldShowRequestPermissionRationale) {
requestPermission() requestPermission()
} else { } else {
ToastUtil.toastLong(this, getString(R.string.need_storage_permission_hint)) ToastUtil.toastLong(this, getString(R.string.audioim_need_storage_permission_hint))
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS) val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
val uri = Uri.fromParts("package", packageName, null) val uri = Uri.fromParts("package", packageName, null)
intent.data = uri intent.data = uri
...@@ -672,7 +672,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi ...@@ -672,7 +672,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
private fun waittingStatus() { private fun waittingStatus() {
//挂断按钮可点击 //挂断按钮可点击
iv_hang_up.isEnabled = true 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) { if (!isConnectSuccess) {
//页面等待文案调整 //页面等待文案调整
tv_waiting.visibility = View.GONE tv_waiting.visibility = View.GONE
...@@ -682,7 +682,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi ...@@ -682,7 +682,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
//切换线路按钮可见 //切换线路按钮可见
tv_change_route.isEnabled = true tv_change_route.isEnabled = true
tv_change_route.setTextColor(ContextCompat.getColor(this, R.color.white)) tv_change_route.setTextColor(ContextCompat.getColor(this, R.color.white))
tv_change_route.setCompoundDrawablesWithIntrinsicBounds(null, null, ContextCompat.getDrawable(this, R.drawable.audio_home_img_choose_arrow), null) tv_change_route.setCompoundDrawablesWithIntrinsicBounds(null, null, ContextCompat.getDrawable(this, R.drawable.audioim_img_choose_arrow), null)
} }
/** /**
...@@ -732,9 +732,9 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi ...@@ -732,9 +732,9 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
mPlayer = AudioPlayer(this) mPlayer = AudioPlayer(this)
} }
if ((Math.random() * 10 + 1).toInt() >= 5) { 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 { } 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)
} }
} }
...@@ -745,7 +745,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi ...@@ -745,7 +745,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
if (mPlayer == null) { if (mPlayer == null) {
mPlayer = AudioPlayer(this) 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!!.switchPlayType(iv_hands_free.isSelected)
mPlayer!!.setCompletionListener(MediaPlayer.OnCompletionListener { mPlayer!!.setCompletionListener(MediaPlayer.OnCompletionListener {
//通话剩余时间不足60s时,默认 //通话剩余时间不足60s时,默认
...@@ -816,8 +816,8 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi ...@@ -816,8 +816,8 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
if (localRemainTime!! <= 60) { if (localRemainTime!! <= 60) {
if (tv_change_route.isEnabled) { if (tv_change_route.isEnabled) {
tv_change_route.isEnabled = false tv_change_route.isEnabled = false
tv_change_route.setTextColor(ContextCompat.getColor(this, R.color.color_50ffffff)) tv_change_route.setTextColor(ContextCompat.getColor(this, R.color.audioim_color_50ffffff))
tv_change_route.setCompoundDrawablesWithIntrinsicBounds(null, null, ContextCompat.getDrawable(this, R.drawable.audio_home_img_choose_arrow_unuse), null) 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()) tv_remain_time.text = DateUtils.formatTime(localRemainTime.toString())
...@@ -840,9 +840,9 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi ...@@ -840,9 +840,9 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
mPlayer = AudioPlayer(this) mPlayer = AudioPlayer(this)
} }
if (3 == min) { if (3 == min) {
mPlayer!!.setDataSource(R.raw.last_3_min) mPlayer!!.setDataSource(R.raw.audioim_last_3_min)
} else { } else {
mPlayer!!.setDataSource(R.raw.last_1_min) mPlayer!!.setDataSource(R.raw.audioim_last_1_min)
} }
mPlayer!!.switchPlayType(iv_hands_free.isSelected) mPlayer!!.switchPlayType(iv_hands_free.isSelected)
mPlayer!!.start(false, false) mPlayer!!.start(false, false)
......
...@@ -5,7 +5,7 @@ import android.app.Dialog ...@@ -5,7 +5,7 @@ import android.app.Dialog
import android.graphics.drawable.ColorDrawable import android.graphics.drawable.ColorDrawable
import android.os.Bundle import android.os.Bundle
import com.ydl.audioim.R import com.ydl.audioim.R
import kotlinx.android.synthetic.main.dialog_axb_confirm.* import kotlinx.android.synthetic.main.audioim_dialog_axb_confirm.*
/** /**
* @author jiucheng * @author jiucheng
...@@ -25,7 +25,7 @@ class AxbConfirmDialog : Dialog { ...@@ -25,7 +25,7 @@ class AxbConfirmDialog : Dialog {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.dialog_axb_confirm) setContentView(R.layout.audioim_dialog_axb_confirm)
setCanceledOnTouchOutside(false) setCanceledOnTouchOutside(false)
window.setBackgroundDrawable(ColorDrawable()) window.setBackgroundDrawable(ColorDrawable())
ic_close.setOnClickListener { ic_close.setOnClickListener {
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="280dp" android:layout_width="280dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
app:cardCornerRadius="15dp"> app:cardCornerRadius="15dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
android:id="@+id/ic_close" android:id="@+id/ic_close"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="right" android:layout_gravity="right"
android:layout_marginTop="7dp" android:layout_marginTop="7dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:padding="5dp" android:padding="5dp"
android:src="@drawable/audio_home_ic_close_24dp" /> android:src="@drawable/audioim_ic_close_24dp" />
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
android:src="@drawable/audio_home_privacy_ico" /> android:src="@drawable/audioim_privacy_ico" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:text="号码隐私保护" android:text="号码隐私保护"
android:textColor="@color/platform_color_333333" android:textColor="@color/platform_color_333333"
android:textSize="17sp" android:textSize="17sp"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:text="您的真实号码全程保密,请安心呼叫" android:text="您的真实号码全程保密,请安心呼叫"
android:textColor="@color/platform_color_333333" android:textColor="@color/platform_color_333333"
android:visibility="visible" android:visibility="visible"
android:textSize="13sp" /> android:textSize="13sp" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:gravity="center" android:gravity="center"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:text="呼出号码与注册号码需为同一手机号" android:text="呼出号码与注册号码需为同一手机号"
android:textColor="@color/platform_color_999999" android:textColor="@color/platform_color_999999"
android:textSize="13sp" /> android:textSize="13sp" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:gravity="center" android:gravity="center"
android:text="否则无法接通" android:text="否则无法接通"
android:textColor="@color/platform_color_999999" android:textColor="@color/platform_color_999999"
android:textSize="13sp" /> android:textSize="13sp" />
<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="50dp" android:layout_marginTop="50dp"
android:gravity="bottom" android:gravity="bottom"
android:text="壹点灵全程保护您的隐私" android:text="壹点灵全程保护您的隐私"
android:textColor="@color/platform_color_999999" android:textColor="@color/platform_color_999999"
android:textSize="10sp" /> android:textSize="10sp" />
<RelativeLayout <RelativeLayout
android:id="@+id/rl_ensure" android:id="@+id/rl_ensure"
android:layout_width="210dp" android:layout_width="210dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_marginTop="11dp" android:layout_marginTop="11dp"
android:layout_marginBottom="20dp" android:layout_marginBottom="20dp"
android:background="@drawable/audio_home_privacy_background"> android:background="@drawable/audioim_privacy_background">
<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:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:drawableLeft="@drawable/audio_home_ic_phone" android:drawableLeft="@drawable/audioim_ic_phone"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:text="呼叫" android:text="呼叫"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="17sp" android:textSize="17sp"
android:textStyle="bold" /> android:textStyle="bold" />
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>
\ 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_40353535">#66353535</color> <color name="audioim_color_40353535">#66353535</color>
<color name="color_80353535">#CC353535</color> <color name="audioim_color_80353535">#CC353535</color>
<color name="color_50ffffff">#B3ffffff</color> <color name="audioim_color_50ffffff">#B3ffffff</color>
<color name="color_30FFFFFF">#4DFFFFFF</color> <color name="audioim_color_30FFFFFF">#4DFFFFFF</color>
<color name="color_70FFFFFF">#B3FFFFFF</color> <color name="audioim_color_70FFFFFF">#B3FFFFFF</color>
</resources> </resources>
\ No newline at end of file
<resources> <resources>
<string name="app_name">av</string> <string name="audioim_app_name">av</string>
<string name="need_storage_permission_hint">App正常工作需要内部存储使用权限,请开启</string> <string name="audioim_need_storage_permission_hint">App正常工作需要内部存储使用权限,请开启</string>
</resources> </resources>
...@@ -2,6 +2,14 @@ apply plugin: 'com.android.library' ...@@ -2,6 +2,14 @@ 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 = 'confide_' // 资源前缀
old_prefix = '' // 老前缀,可为''空字符串
}
kapt { kapt {
arguments { arguments {
arg("AROUTER_MODULE_NAME", project.getName()) arg("AROUTER_MODULE_NAME", project.getName())
...@@ -54,18 +62,6 @@ android { ...@@ -54,18 +62,6 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility 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 { dependencies {
......
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
<application> <application>
<activity android:name=".home.ConfideHomeActivity" <activity android:name=".home.ConfideHomeActivity"
android:screenOrientation="portrait"> android:screenOrientation="portrait"
android:theme="@style/confide_NoTitleTheme"
>
</activity> </activity>
</application> </application>
</manifest> </manifest>
package com.ydl.confide.home package com.ydl.confide.home
import android.content.Context import android.content.Context
import android.os.Build
import android.support.v7.widget.LinearLayoutManager import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView import android.support.v7.widget.RecyclerView
import android.support.v7.widget.SimpleItemAnimator import android.support.v7.widget.SimpleItemAnimator
import android.view.View import android.view.View
import android.widget.LinearLayout
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.jcodecraeer.xrecyclerview.ProgressStyle import com.jcodecraeer.xrecyclerview.ProgressStyle
import com.jcodecraeer.xrecyclerview.XRecyclerView import com.jcodecraeer.xrecyclerview.XRecyclerView
import com.ydl.ydl_image.listener.YDLImageRecyclerOnScrollListener
import com.yidianling.common.tools.RxImageTool
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.home.adapter.ConfideHomeAdapter import com.ydl.confide.home.adapter.ConfideHomeAdapter
import com.ydl.confide.home.bean.ConfideHomeAllFiltersBean import com.ydl.confide.home.bean.ConfideHomeAllFiltersBean
...@@ -24,13 +24,16 @@ import com.ydl.confide.home.listener.ConfideHomeRecycleViewListener ...@@ -24,13 +24,16 @@ import com.ydl.confide.home.listener.ConfideHomeRecycleViewListener
import com.ydl.confide.home.listener.ConfideHomeRecyleSuspendListener import com.ydl.confide.home.listener.ConfideHomeRecyleSuspendListener
import com.ydl.confide.home.presenter.ConfideHomePresenterImpl import com.ydl.confide.home.presenter.ConfideHomePresenterImpl
import com.ydl.confide.home.util.ConfideHomeUtils 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.mvp.lce.BaseLceActivity
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.ydl.ydlcommon.view.DrawableRightTextView import com.ydl.ydlcommon.view.DrawableRightTextView
import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager
import com.yidianling.common.tools.RxImageTool
import com.yidianling.router.RouterManager import com.yidianling.router.RouterManager
import kotlinx.android.synthetic.main.confidehome_home_activity.* import kotlinx.android.synthetic.main.confide_home_activity.*
import kotlinx.android.synthetic.main.confidehome_title_bar.* import kotlinx.android.synthetic.main.confide_title_bar.*
/** /**
* @author yuanwai * @author yuanwai
...@@ -112,7 +115,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -112,7 +115,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
} }
override fun layoutResId(): Int { 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 ...@@ -122,7 +125,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
//重置页 //重置页
page = 2 page = 2
allFiltersBean!!.page = page allFiltersBean!!.page = page
mPresenter.confideHomeRequest() mPresenter.confideHomeRequest(true)
} }
/** /**
...@@ -174,6 +177,21 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -174,6 +177,21 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
initClick() initClick()
initQuickConsultDialog() 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 ...@@ -245,7 +263,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
rv_list.layoutManager = layoutManager rv_list.layoutManager = layoutManager
rv_list.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader) rv_list.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader)
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.setLoadingListener(this)
rv_list.adapter = mConfideAdapter rv_list.adapter = mConfideAdapter
} }
......
...@@ -97,7 +97,7 @@ class ConfideHomeAdapter(private val mContext: Context, ...@@ -97,7 +97,7 @@ class ConfideHomeAdapter(private val mContext: Context,
return ConfideHomeListenAndFoundViewHolder(ConfideHomeListenAndFoundView(parent.context, confideHomeEvent)) return ConfideHomeListenAndFoundViewHolder(ConfideHomeListenAndFoundView(parent.context, confideHomeEvent))
} }
else -> { 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{ ...@@ -93,7 +93,7 @@ interface IConfideHomeContract{
/** /**
* 倾诉首页数据请求 * 倾诉首页数据请求
*/ */
fun confideHomeRequest() fun confideHomeRequest(isRefresh:Boolean = true)
/** /**
* 为你推荐列表(筛选调用) * 为你推荐列表(筛选调用)
......
package com.ydl.confide.home.popwindow package com.ydl.confide.home.popwindow
import android.content.Context import android.content.Context
import android.graphics.Typeface
import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.BitmapDrawable
import android.support.v7.widget.GridLayoutManager import android.support.v7.widget.GridLayoutManager
import android.support.v7.widget.LinearLayoutManager import android.support.v7.widget.LinearLayoutManager
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.PopupWindow import android.widget.PopupWindow
import com.yidianling.common.tools.RxImageTool
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeFiterItemBean import com.ydl.confide.home.bean.ConfideHomeFiterItemBean
import com.ydl.confide.home.popwindow.adapter.ConfideHomeGoodAdapter import com.ydl.confide.home.popwindow.adapter.ConfideHomeGoodAdapter
import com.ydl.ydlcommon.view.SpaceItemDecorator 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 ...@@ -33,7 +32,7 @@ class ConfideHomeGoodPopupWindow(context: Context, goodsList: ArrayList<ConfideH
private var selectedGoodsList: ArrayList<ConfideHomeFiterItemBean>? = null private var selectedGoodsList: ArrayList<ConfideHomeFiterItemBean>? = null
init { 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.contentView = view
this.isFocusable = true this.isFocusable = true
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
......
package com.ydl.confide.home.popwindow package com.ydl.confide.home.popwindow
import android.content.Context import android.content.Context
import android.graphics.Typeface
import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.BitmapDrawable
import android.support.v7.widget.GridLayoutManager import android.support.v7.widget.GridLayoutManager
import android.support.v7.widget.LinearLayoutManager import android.support.v7.widget.LinearLayoutManager
...@@ -11,13 +10,13 @@ import android.view.View ...@@ -11,13 +10,13 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.PopupWindow import android.widget.PopupWindow
import android.widget.TextView import android.widget.TextView
import com.yidianling.common.tools.RxImageTool
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeAllFiltersBean import com.ydl.confide.home.bean.ConfideHomeAllFiltersBean
import com.ydl.confide.home.bean.ConfideHomeFiterItemBean import com.ydl.confide.home.bean.ConfideHomeFiterItemBean
import com.ydl.confide.home.popwindow.adapter.ConfideHomeGoodAdapter import com.ydl.confide.home.popwindow.adapter.ConfideHomeGoodAdapter
import com.ydl.ydlcommon.view.SpaceItemDecorator 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 * @author yuanwai
...@@ -43,7 +42,7 @@ class ConfideHomeSexAgePopupWindow(context: Context, sexData: ArrayList<ConfideH ...@@ -43,7 +42,7 @@ class ConfideHomeSexAgePopupWindow(context: Context, sexData: ArrayList<ConfideH
private var mAllFiltersBean : ConfideHomeAllFiltersBean? = null private var mAllFiltersBean : ConfideHomeAllFiltersBean? = null
init { 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.contentView = view
this.isFocusable = true this.isFocusable = true
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
...@@ -164,10 +163,10 @@ class ConfideHomeSexAgePopupWindow(context: Context, sexData: ArrayList<ConfideH ...@@ -164,10 +163,10 @@ class ConfideHomeSexAgePopupWindow(context: Context, sexData: ArrayList<ConfideH
*/ */
private fun setSelect(tvSex1: TextView,boolean: Boolean){ private fun setSelect(tvSex1: TextView,boolean: Boolean){
if (boolean){ if (boolean){
tvSex1.setBackgroundResource(R.drawable.confidehome_filter_select_sel) tvSex1.setBackgroundResource(R.drawable.confide_filter_select_sel)
tvSex1.setTextColor(tvSex1.context.resources.getColor(R.color.baby_blue)) tvSex1.setTextColor(tvSex1.context.resources.getColor(R.color.confide_main_theme))
}else{ }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)) tvSex1.setTextColor(tvSex1.context.resources.getColor(R.color._6))
} }
} }
......
...@@ -10,7 +10,7 @@ import android.widget.PopupWindow ...@@ -10,7 +10,7 @@ import android.widget.PopupWindow
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeFiterItemBean import com.ydl.confide.home.bean.ConfideHomeFiterItemBean
import com.ydl.confide.home.popwindow.adapter.ConfideHomeSortAdapter 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 * @author yuanwai
...@@ -25,7 +25,7 @@ class ConfideHomeSortPopupWindow(val context: Context, private val sortItems: Ar ...@@ -25,7 +25,7 @@ class ConfideHomeSortPopupWindow(val context: Context, private val sortItems: Ar
private var adapter: ConfideHomeSortAdapter? = null private var adapter: ConfideHomeSortAdapter? = null
init { 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.contentView = view
this.isFocusable = true this.isFocusable = true
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
......
...@@ -8,7 +8,7 @@ import android.view.ViewGroup ...@@ -8,7 +8,7 @@ import android.view.ViewGroup
import android.widget.TextView import android.widget.TextView
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeFiterItemBean 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 * @author yuanwai
...@@ -25,9 +25,9 @@ class ConfideHomeGoodAdapter(private val context: Context, private val goods: Ar ...@@ -25,9 +25,9 @@ class ConfideHomeGoodAdapter(private val context: Context, private val goods: Ar
holder.tvGoodName.text = goods[position].name holder.tvGoodName.text = goods[position].name
holder.tvGoodName.isSelected = selectedGood.contains(category) holder.tvGoodName.isSelected = selectedGood.contains(category)
if (holder.tvGoodName.isSelected) { if (holder.tvGoodName.isSelected) {
holder.tvGoodName.setBackgroundResource(R.drawable.confidehome_filter_select_sel) holder.tvGoodName.setBackgroundResource(R.drawable.confide_filter_select_sel)
} else { } 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 ...@@ -38,7 +38,7 @@ class ConfideHomeGoodAdapter(private val context: Context, private val goods: Ar
} }
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder { 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) return ViewHolder(itemView)
} }
......
package com.ydl.confide.home.popwindow.adapter package com.ydl.confide.home.popwindow.adapter
import android.content.Context import android.content.Context
import android.graphics.Color
import android.support.v4.content.ContextCompat import android.support.v4.content.ContextCompat
import android.support.v7.widget.RecyclerView import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater import android.view.LayoutInflater
...@@ -10,7 +9,7 @@ import android.view.ViewGroup ...@@ -10,7 +9,7 @@ import android.view.ViewGroup
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeFiterItemBean import com.ydl.confide.home.bean.ConfideHomeFiterItemBean
import com.ydl.confide.home.popwindow.ConfideHomeSortPopupWindow 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 * @author yuanwai
...@@ -27,7 +26,7 @@ class ConfideHomeSortAdapter(private val context: Context, ...@@ -27,7 +26,7 @@ class ConfideHomeSortAdapter(private val context: Context,
override fun getItemCount(): Int = sortItems.size override fun getItemCount(): Int = sortItems.size
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder { 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) return ViewHolder(itemView)
} }
...@@ -36,7 +35,7 @@ class ConfideHomeSortAdapter(private val context: Context, ...@@ -36,7 +35,7 @@ class ConfideHomeSortAdapter(private val context: Context,
if (holder != null) { if (holder != null) {
holder.tvSort.text = item.name holder.tvSort.text = item.name
if (item.id == selectedSort.id) { if (item.id == selectedSort.id) {
holder.tvSort.setTextColor(Color.parseColor("#1DA1F2")) holder.tvSort.setTextColor(context.resources.getColor(R.color.confide_main_theme))
}else{ }else{
holder.tvSort.setTextColor(ContextCompat.getColor(context, R.color._6)) holder.tvSort.setTextColor(ContextCompat.getColor(context, R.color._6))
} }
......
...@@ -4,7 +4,6 @@ import android.content.Context ...@@ -4,7 +4,6 @@ import android.content.Context
import android.text.TextUtils import android.text.TextUtils
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import com.yidianling.common.tools.RxNetTool
import com.ydl.confide.home.bean.ConfideHomeDataBean import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.contract.IConfideHomeContract import com.ydl.confide.home.contract.IConfideHomeContract
import com.ydl.confide.home.http.ConfideRecommendParam import com.ydl.confide.home.http.ConfideRecommendParam
...@@ -13,12 +12,14 @@ import com.ydl.confide.home.util.ConfideHomeUtils ...@@ -13,12 +12,14 @@ import com.ydl.confide.home.util.ConfideHomeUtils
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.mvp.base.BasePresenter 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.RxLifecycleUtils
import com.ydl.ydlcommon.utils.YDLAsyncUtils import com.ydl.ydlcommon.utils.YDLAsyncUtils
import com.ydl.ydlcommon.utils.YDLCacheUtils import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.yidianling.common.tools.RxNetTool
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
/** /**
* @author yuanwai * @author yuanwai
...@@ -65,7 +66,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid ...@@ -65,7 +66,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid
mView.confideHomeResponse(list) mView.confideHomeResponse(list)
} }
} }
confideHomeRequest() confideHomeRequest(false)
} }
}) })
} }
...@@ -73,7 +74,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid ...@@ -73,7 +74,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid
/** /**
* 请求首页数据 * 请求首页数据
*/ */
override fun confideHomeRequest() { override fun confideHomeRequest(isRefresh:Boolean) {
if (!RxNetTool.isConnected(mView.getContext())){ if (!RxNetTool.isConnected(mView.getContext())){
mView.confideHomeRequestFail() mView.confideHomeRequestFail()
return return
...@@ -81,9 +82,20 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid ...@@ -81,9 +82,20 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid
val disposable = mModel.confideHomeRequest() val disposable = mModel.confideHomeRequest()
.map { it } .map { it }
.filter { it != null } .filter { it != null }
.compose(RxUtils.applySchedulers(mView)) .subscribeOn(Schedulers.io())
.compose(RxLifecycleUtils.bindToLifecycle(mView!!))//使用 Rxlifecycle,使 Disposable 和 Activity 一起销毁 .doOnSubscribe {
.observeOn(AndroidSchedulers.mainThread()) if (!isRefresh){
mView.showLoading()//显示进度条
}
}
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doFinally {
if (!isRefresh){
mView.hideLoading()//隐藏进度条
}
}.compose(RxLifecycleUtils.bindToLifecycle(mView))
.subscribe(Consumer { .subscribe(Consumer {
mView.confideHomeResponse(it) mView.confideHomeResponse(it)
updateCache(it) updateCache(it)
...@@ -128,7 +140,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid ...@@ -128,7 +140,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid
val disposable = mModel.recommendList(param) val disposable = mModel.recommendList(param)
.map { it } .map { it }
.filter { it != null } .filter { it != null }
.compose(RxUtils.applySchedulers(mView)) .compose(RxUtils.applySchedulers(mView as IView))
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer { .subscribe(Consumer {
mView.recommendListResponse(it) mView.recommendListResponse(it)
...@@ -150,7 +162,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid ...@@ -150,7 +162,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid
val disposable = mModel.recommendList(param) val disposable = mModel.recommendList(param)
.map { it } .map { it }
.filter { it != null } .filter { it != null }
.compose(RxUtils.applySchedulers(mView)) .compose(RxUtils.applySchedulers(mView as IView))
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer { .subscribe(Consumer {
mView.recommendListMoreResponse(it) mView.recommendListMoreResponse(it)
......
...@@ -44,7 +44,7 @@ class ConfideHomeBannerSection(var context: Context, private var confideHomeEven ...@@ -44,7 +44,7 @@ class ConfideHomeBannerSection(var context: Context, private var confideHomeEven
BannerViewHolder(ConfideHomeBannerView(context,confideHomeEvent)) BannerViewHolder(ConfideHomeBannerView(context,confideHomeEvent))
} }
else -> { 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 ...@@ -45,7 +45,7 @@ class ConfideHomeCategorySection(var context: Context, var confideHomeEvent : IC
CategoryViewHolder(ConfideHomeCategoryView(context,confideHomeEvent,homeView)) CategoryViewHolder(ConfideHomeCategoryView(context,confideHomeEvent,homeView))
} }
else -> { 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 ...@@ -66,7 +66,7 @@ class ConfideHomeFilterSection(var context: Context,var view : IConfideHomeContr
var dp15 = RxImageTool.dip2px(15f) var dp15 = RxImageTool.dip2px(15f)
param.setMargins(dp15,0,dp15,0) param.setMargins(dp15,0,dp15,0)
var footerView = View(context) 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 footerView.layoutParams = param
return FooterViewHolder(footerView) return FooterViewHolder(footerView)
}else{ }else{
......
...@@ -37,7 +37,7 @@ class ConfideHomeFooterSection(var context: Context, private var confideHomeEven ...@@ -37,7 +37,7 @@ class ConfideHomeFooterSection(var context: Context, private var confideHomeEven
FooterViewHolder(ConfideHomeFooterView(context,confideHomeEvent)) FooterViewHolder(ConfideHomeFooterView(context,confideHomeEvent))
} }
else -> { 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 ...@@ -59,7 +59,7 @@ class ConfideHomeRecommendExpertSection(var context: Context, var confideHomeEve
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): RecyclerView.ViewHolder { override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): RecyclerView.ViewHolder {
if (viewType == combineType(IConfideHomeConfig.SECTION_CONSULTANT, HEADER)) { 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 { } else {
return ConfideHomeRecommendExpertViewHolder(ConfideHomeRecommendExpertView(context, confideHomeEvent)) return ConfideHomeRecommendExpertViewHolder(ConfideHomeRecommendExpertView(context, confideHomeEvent))
} }
......
...@@ -11,7 +11,6 @@ import android.view.View ...@@ -11,7 +11,6 @@ import android.view.View
import android.view.animation.AnimationUtils import android.view.animation.AnimationUtils
import android.view.animation.LinearInterpolator import android.view.animation.LinearInterpolator
import android.widget.ImageView import android.widget.ImageView
import com.yidianling.common.tools.LogUtil
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.home.adapter.ConfideHomeAdapter import com.ydl.confide.home.adapter.ConfideHomeAdapter
import com.ydl.confide.home.bean.ConfideHomeAllFiltersBean import com.ydl.confide.home.bean.ConfideHomeAllFiltersBean
...@@ -27,6 +26,7 @@ import com.ydl.confide.home.widget.ConfideHomeFilterView ...@@ -27,6 +26,7 @@ import com.ydl.confide.home.widget.ConfideHomeFilterView
import com.ydl.confide.home.widget.ConfidePlayerFloatView import com.ydl.confide.home.widget.ConfidePlayerFloatView
import com.ydl.ydlcommon.adapter.section.SectionAdapter import com.ydl.ydlcommon.adapter.section.SectionAdapter
import com.ydl.ydlcommon.utils.MainUtils import com.ydl.ydlcommon.utils.MainUtils
import com.yidianling.common.tools.LogUtil
import java.io.BufferedInputStream import java.io.BufferedInputStream
import java.io.IOException import java.io.IOException
import java.io.InputStream import java.io.InputStream
...@@ -461,8 +461,8 @@ class ConfideHomeUtils { ...@@ -461,8 +461,8 @@ class ConfideHomeUtils {
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_grey_500_18dp, 0) tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_grey_500_18dp, 0)
} }
IConfideHomeConfig.FILTER_STATUS_FILTERED, IConfideHomeConfig.FILTER_STATUS_OPEN -> { 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_green_18dp, 0) tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.confide_ic_arrow_drop_down_green_18dp, 0)
} }
} }
} }
...@@ -475,7 +475,7 @@ class ConfideHomeUtils { ...@@ -475,7 +475,7 @@ class ConfideHomeUtils {
tv.setTextColor(ContextCompat.getColor(mContext, R.color._6)) tv.setTextColor(ContextCompat.getColor(mContext, R.color._6))
} }
IConfideHomeConfig.FILTER_STATUS_FILTERED, IConfideHomeConfig.FILTER_STATUS_OPEN -> { 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) tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_grey_500_18dp, 0)
...@@ -488,7 +488,7 @@ class ConfideHomeUtils { ...@@ -488,7 +488,7 @@ class ConfideHomeUtils {
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_grey_500_18dp, 0) tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_grey_500_18dp, 0)
} }
IConfideHomeConfig.FILTER_STATUS_FILTERED, IConfideHomeConfig.FILTER_STATUS_OPEN -> { 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 { ...@@ -497,7 +497,7 @@ class ConfideHomeUtils {
* 启动 播放动画 * 启动 播放动画
*/ */
fun startPlayAnim(context: Context, imageView: ImageView) { 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()//设置动画匀速运动 var lin = LinearInterpolator()//设置动画匀速运动
animation.interpolator = lin animation.interpolator = lin
imageView.startAnimation(animation) imageView.startAnimation(animation)
......
...@@ -10,7 +10,7 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean ...@@ -10,7 +10,7 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.bean.ConfideHomeDataBean import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.event.IConfideHomeEvent import com.ydl.confide.home.event.IConfideHomeEvent
import com.ydl.ydlcommon.view.banner.GlideImageLoader 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 * @author yuanwai
...@@ -39,7 +39,7 @@ class ConfideHomeBannerView(context: Context, ...@@ -39,7 +39,7 @@ class ConfideHomeBannerView(context: Context,
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.confidehome_banner_view, this) View.inflate(context, R.layout.confide_banner_view, this)
layoutParams = params layoutParams = params
margin = RxImageTool.dip2px(2.5f) margin = RxImageTool.dip2px(2.5f)
} }
...@@ -67,7 +67,7 @@ class ConfideHomeBannerView(context: Context, ...@@ -67,7 +67,7 @@ class ConfideHomeBannerView(context: Context,
for (index in 0..count) { for (index in 0..count) {
urlLists.add((mDataList as ArrayList<ConfideHomeBodyBean>)[index].bannerImageUrl!!) 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 { banner.setOnBannerListener {
confideHomeEvent!!.bannerClick((mDataList as ArrayList<ConfideHomeBodyBean>)[it].bannerLinkUrl, it, (mDataList as ArrayList<ConfideHomeBodyBean>)[it].bannerTitle) 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 ...@@ -6,13 +6,13 @@ import android.support.v7.widget.CardView
import android.text.TextUtils import android.text.TextUtils
import android.util.AttributeSet import android.util.AttributeSet
import android.view.View 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.R
import com.ydl.confide.home.bean.ConfideHomeBodyBean import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.contract.IConfideHomeContract import com.ydl.confide.home.contract.IConfideHomeContract
import com.ydl.confide.home.event.IConfideHomeEvent 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 * @author yuanwai
...@@ -32,7 +32,7 @@ class ConfideHomeCategoryItemView(mContext: Context, @Nullable attrs: AttributeS ...@@ -32,7 +32,7 @@ class ConfideHomeCategoryItemView(mContext: Context, @Nullable attrs: AttributeS
} }
private fun initView() { 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) dp35 = RxImageTool.dip2px(35f)
} }
......
...@@ -10,7 +10,7 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean ...@@ -10,7 +10,7 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.bean.ConfideHomeDataBean import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.contract.IConfideHomeContract import com.ydl.confide.home.contract.IConfideHomeContract
import com.ydl.confide.home.event.IConfideHomeEvent 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 * @author yuanwai
...@@ -30,10 +30,10 @@ class ConfideHomeCategoryView(mContext: Context, ...@@ -30,10 +30,10 @@ class ConfideHomeCategoryView(mContext: Context,
private fun initView(){ private fun initView(){
var params = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,RxImageTool.dip2px(106f)) 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 layoutParams = params
orientation = HORIZONTAL orientation = HORIZONTAL
setBackgroundResource(R.color.confidehome_category_bg) setBackgroundResource(R.color.confide_category_bg)
} }
fun initData(bean: ConfideHomeDataBean?){ fun initData(bean: ConfideHomeDataBean?){
......
...@@ -9,13 +9,13 @@ import android.view.Gravity ...@@ -9,13 +9,13 @@ import android.view.Gravity
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.LinearLayout import android.widget.LinearLayout
import com.yidianling.common.tools.RxImageTool
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeBodyBean import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.bean.ConfideHomeDataBean import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.contract.IConfideHomeContract import com.ydl.confide.home.contract.IConfideHomeContract
import com.ydl.ydlcommon.utils.ScreenUtil import com.ydl.ydlcommon.utils.ScreenUtil
import com.ydl.ydlcommon.view.DrawableRightTextView import com.ydl.ydlcommon.view.DrawableRightTextView
import com.yidianling.common.tools.RxImageTool
/** /**
* @author yuanwai * @author yuanwai
...@@ -93,7 +93,7 @@ class ConfideHomeFilterView(mContext: Context, @Nullable attrs: AttributeSet?, d ...@@ -93,7 +93,7 @@ class ConfideHomeFilterView(mContext: Context, @Nullable attrs: AttributeSet?, d
textView.text = bodyBean.filterName textView.text = bodyBean.filterName
textView.setTag(R.id.tv_title,bodyBean) textView.setTag(R.id.tv_title,bodyBean)
if ("排序" == bodyBean.filterName){ 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.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_arrow_drop_down_green_18dp, 0)
} }
textView.setOnClickListener { textView.setOnClickListener {
...@@ -127,7 +127,7 @@ class ConfideHomeFilterView(mContext: Context, @Nullable attrs: AttributeSet?, d ...@@ -127,7 +127,7 @@ class ConfideHomeFilterView(mContext: Context, @Nullable attrs: AttributeSet?, d
var view = getChildAt(index) var view = getChildAt(index)
if (view is DrawableRightTextView){ if (view is DrawableRightTextView){
if ("排序" == view.text){ if ("排序" == view.text){
view.setTextColor(ContextCompat.getColor(context, R.color.baby_blue)) view.setTextColor(ContextCompat.getColor(context, R.color.confide_main_theme))
}else{ }else{
view.setTextColor(ContextCompat.getColor(context, R.color._6)) view.setTextColor(ContextCompat.getColor(context, R.color._6))
} }
......
...@@ -7,7 +7,7 @@ import android.widget.LinearLayout ...@@ -7,7 +7,7 @@ import android.widget.LinearLayout
import android.widget.RelativeLayout import android.widget.RelativeLayout
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.home.event.IConfideHomeEvent 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 * @author yuanwai
...@@ -27,7 +27,7 @@ class ConfideHomeFooterView(var mContext: Context,var confideHomeEvent : IConfid ...@@ -27,7 +27,7 @@ class ConfideHomeFooterView(var mContext: Context,var confideHomeEvent : IConfid
*/ */
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.inflate(context, R.layout.confidehome_footer,this) View.inflate(context, R.layout.confide_footer,this)
tv_footer.setOnClickListener { tv_footer.setOnClickListener {
confideHomeEvent.consultantMoreClick("app://listen/list") confideHomeEvent.consultantMoreClick("app://listen/list")
} }
......
...@@ -9,7 +9,7 @@ import com.ydl.confide.R ...@@ -9,7 +9,7 @@ import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeDataBean import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.config.IConfideHomeConfig import com.ydl.confide.home.config.IConfideHomeConfig
import com.ydl.confide.home.event.IConfideHomeEvent 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") @Suppress("DEPRECATION")
/** /**
...@@ -27,7 +27,7 @@ class ConfideHomeHeadView(context: Context, private var confideHomeEvent: IConfi ...@@ -27,7 +27,7 @@ class ConfideHomeHeadView(context: Context, private var confideHomeEvent: IConfi
private fun initView() { private fun initView() {
orientation = HORIZONTAL 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)) var params = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, RxImageTool.dip2px(25f))
params.setMargins(0, RxImageTool.dip2px(30f), 0, RxImageTool.dip2px(18f)) params.setMargins(0, RxImageTool.dip2px(30f), 0, RxImageTool.dip2px(18f))
layoutParams = params layoutParams = params
...@@ -46,18 +46,18 @@ class ConfideHomeHeadView(context: Context, private var confideHomeEvent: IConfi ...@@ -46,18 +46,18 @@ class ConfideHomeHeadView(context: Context, private var confideHomeEvent: IConfi
when (bean.type) { when (bean.type) {
IConfideHomeConfig.TYPE_RECOMMEND -> { IConfideHomeConfig.TYPE_RECOMMEND -> {
setPadding(0, RxImageTool.dip2px(30f), 0, 0) 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_title.text = bean.head.title
iv_recently_more.visibility = View.GONE iv_recently_more.visibility = View.GONE
} }
IConfideHomeConfig.TYPE_RECENTLY_CONFIDED -> { IConfideHomeConfig.TYPE_RECENTLY_CONFIDED -> {
setPadding(0, RxImageTool.dip2px(30f), 0, RxImageTool.dip2px(18f)) 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_title.text = bean.head.title
iv_recently_more.visibility = View.GONE iv_recently_more.visibility = View.GONE
} }
IConfideHomeConfig.TYPE_SOUND -> { 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_title.text = bean.head.title
iv_recently_more.visibility = View.GONE iv_recently_more.visibility = View.GONE
} }
......
...@@ -9,7 +9,7 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean ...@@ -9,7 +9,7 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.config.IConfideHomeConfig import com.ydl.confide.home.config.IConfideHomeConfig
import com.ydl.confide.home.event.IConfideHomeEvent import com.ydl.confide.home.event.IConfideHomeEvent
import com.ydl.confide.home.util.ConfideHomeUtils 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 * @author yuanwai
...@@ -24,7 +24,7 @@ class ConfideHomeListenAndFoundItemView(mContext: Context, private var confideHo ...@@ -24,7 +24,7 @@ class ConfideHomeListenAndFoundItemView(mContext: Context, private var confideHo
} }
private fun initView() { 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 ...@@ -66,15 +66,15 @@ class ConfideHomeListenAndFoundItemView(mContext: Context, private var confideHo
when (bodyBean.confideLine) {//1在线 2离线 3通话中 when (bodyBean.confideLine) {//1在线 2离线 3通话中
1 -> { 1 -> {
tv_isLine.text = "在线" tv_isLine.text = "在线"
tv_isLine.setBackgroundResource(R.drawable.confidehome_bg_main_color) tv_isLine.setBackgroundResource(R.drawable.confide_bg_main_color)
} }
2 -> { 2 -> {
tv_isLine.text = "离线" tv_isLine.text = "离线"
tv_isLine.setBackgroundResource(R.drawable.confidehome_bg_color_666666) tv_isLine.setBackgroundResource(R.drawable.confide_bg_color_666666)
} }
3 -> { 3 -> {
tv_isLine.text = "通话中" tv_isLine.text = "通话中"
tv_isLine.setBackgroundResource(R.drawable.confidehome_bg_color_ff8f38) tv_isLine.setBackgroundResource(R.drawable.confide_bg_color_ff8f38)
} }
else -> { else -> {
...@@ -111,9 +111,9 @@ class ConfideHomeListenAndFoundItemView(mContext: Context, private var confideHo ...@@ -111,9 +111,9 @@ class ConfideHomeListenAndFoundItemView(mContext: Context, private var confideHo
*/ */
private fun setSex(bodyBean: ConfideHomeBodyBean) { private fun setSex(bodyBean: ConfideHomeBodyBean) {
if (bodyBean.confideSex == 1) { if (bodyBean.confideSex == 1) {
img_sex.setImageResource(R.drawable.confidehome_new_male) img_sex.setImageResource(R.drawable.confide_new_male)
} else { } 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 ...@@ -151,16 +151,16 @@ class ConfideHomeListenAndFoundItemView(mContext: Context, private var confideHo
private fun setConfideButton(bodyBean: ConfideHomeBodyBean) { private fun setConfideButton(bodyBean: ConfideHomeBodyBean) {
when (bodyBean.confideLine) {//1.在线 2.离线 3.通话中 4.继续倾诉 when (bodyBean.confideLine) {//1.在线 2.离线 3.通话中 4.继续倾诉
1 -> { 1 -> {
tv_confide.setBackgroundResource(R.drawable.confidehome_line_1) tv_confide.setBackgroundResource(R.drawable.confide_line_1)
} }
2 -> { 2 -> {
tv_confide.setBackgroundResource(R.drawable.confidehome_line_2) tv_confide.setBackgroundResource(R.drawable.confide_line_2)
} }
3 -> { 3 -> {
tv_confide.setBackgroundResource(R.drawable.confidehome_line_3) tv_confide.setBackgroundResource(R.drawable.confide_line_3)
} }
4 ->{ 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 ...@@ -6,7 +6,7 @@ import android.widget.FrameLayout
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeDataBean import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.event.IConfideHomeEvent 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 * @author Jim
...@@ -28,7 +28,7 @@ class ConfideHomeListenAndFoundView(context: Context, private var confideHomeEve ...@@ -28,7 +28,7 @@ class ConfideHomeListenAndFoundView(context: Context, private var confideHomeEve
} }
private fun initView() { private fun initView() {
View.inflate(context, R.layout.confidehome_banner, this) View.inflate(context, R.layout.confide_banner, this)
} }
fun initData(bean: ConfideHomeDataBean) { fun initData(bean: ConfideHomeDataBean) {
......
...@@ -13,7 +13,7 @@ import com.yidianling.common.tools.RxImageTool ...@@ -13,7 +13,7 @@ import com.yidianling.common.tools.RxImageTool
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeDataBean import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.event.IConfideHomeEvent 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 * @author yuanwai
...@@ -35,7 +35,7 @@ class ConfideHomeRecentView(mContext: Context, private var confideHomeEvent: ICo ...@@ -35,7 +35,7 @@ class ConfideHomeRecentView(mContext: Context, private var confideHomeEvent: ICo
*/ */
private fun initView() { private fun initView() {
initLayoutParam() 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 ...@@ -71,9 +71,9 @@ class ConfideHomeRecentView(mContext: Context, private var confideHomeEvent: ICo
img_icon.setTag(R.id.img_icon, bodyBean.confidedIcon) img_icon.setTag(R.id.img_icon, bodyBean.confidedIcon)
} }
if (bodyBean.confideSex == 1) { if (bodyBean.confideSex == 1) {
img_sex.setImageResource(R.drawable.confidehome_new_male) img_sex.setImageResource(R.drawable.confide_new_male)
} else { } else {
img_sex.setImageResource(R.drawable.confidehome_new_female) img_sex.setImageResource(R.drawable.confide_new_female)
} }
tv_name.text = bodyBean.confidedName tv_name.text = bodyBean.confidedName
tv_history.text = bodyBean.confideHistory tv_history.text = bodyBean.confideHistory
......
...@@ -17,7 +17,7 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean ...@@ -17,7 +17,7 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.config.IConfideHomeConfig import com.ydl.confide.home.config.IConfideHomeConfig
import com.ydl.confide.home.event.IConfideHomeEvent import com.ydl.confide.home.event.IConfideHomeEvent
import com.ydl.ydlcommon.utils.ScreenUtil 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 * @author yuanwai
...@@ -38,7 +38,7 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH ...@@ -38,7 +38,7 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH
} }
private fun initView() { 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) bgWidth = ScreenUtil.screenWidth - RxImageTool.dip2px(30f)
dp100 = RxImageTool.dip2px(100f) dp100 = RxImageTool.dip2px(100f)
dp16 = RxImageTool.dip2px(16f) dp16 = RxImageTool.dip2px(16f)
...@@ -108,15 +108,15 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH ...@@ -108,15 +108,15 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH
when (bodyBean.confideLine) {//1在线 2离线 3通话中 4继续通话 when (bodyBean.confideLine) {//1在线 2离线 3通话中 4继续通话
1, 4 -> { 1, 4 -> {
tv_isLine.text = "在线" tv_isLine.text = "在线"
tv_isLine.setBackgroundResource(R.drawable.confidehome_bg_main_color) tv_isLine.setBackgroundResource(R.drawable.confide_bg_main_color)
} }
2 -> { 2 -> {
tv_isLine.text = "离线" tv_isLine.text = "离线"
tv_isLine.setBackgroundResource(R.drawable.confidehome_bg_color_666666) tv_isLine.setBackgroundResource(R.drawable.confide_bg_color_666666)
} }
3 -> { 3 -> {
tv_isLine.text = "通话中" 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 ...@@ -145,9 +145,9 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH
img_play.visibility = View.VISIBLE img_play.visibility = View.VISIBLE
} }
if (confideIsPlay) { if (confideIsPlay) {
img_play.setImageResource(R.drawable.confidehome_playing) img_play.setImageResource(R.drawable.confide_playing)
} else { } else {
img_play.setImageResource(R.drawable.confidehome_sond_play) img_play.setImageResource(R.drawable.confide_sond_play)
} }
img_play.setOnClickListener { img_play.setOnClickListener {
if (confideIsPlay) { if (confideIsPlay) {
...@@ -163,9 +163,9 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH ...@@ -163,9 +163,9 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH
*/ */
private fun setSex(bodyBean: ConfideHomeBodyBean) { private fun setSex(bodyBean: ConfideHomeBodyBean) {
if (bodyBean.confideSex == 1) { if (bodyBean.confideSex == 1) {
img_sex.setImageResource(R.drawable.confidehome_new_male) img_sex.setImageResource(R.drawable.confide_new_male)
} else { } 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 ...@@ -215,7 +215,7 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH
textView.setTextColor(Color.parseColor("#808080")) textView.setTextColor(Color.parseColor("#808080"))
textView.gravity = Gravity.CENTER textView.gravity = Gravity.CENTER
textView.setPadding(dp3, 0, dp3, 0) textView.setPadding(dp3, 0, dp3, 0)
textView.setBackgroundResource(R.drawable.confidehome_bg_tag) textView.setBackgroundResource(R.drawable.confide_bg_tag)
textView.layoutParams = params textView.layoutParams = params
textView.text = tag textView.text = tag
flowlayout_tag.addView(textView) flowlayout_tag.addView(textView)
......
...@@ -7,7 +7,7 @@ import com.ydl.confide.R ...@@ -7,7 +7,7 @@ import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeDataBean import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.event.IConfideHomeEvent import com.ydl.confide.home.event.IConfideHomeEvent
import com.ydl.confide.home.widget.adapter.RecommendExpertAdapter 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 * @author yuanwai
...@@ -33,7 +33,7 @@ class ConfideHomeRecommendExpertView(context : Context, private var confideHomeE ...@@ -33,7 +33,7 @@ class ConfideHomeRecommendExpertView(context : Context, private var confideHomeE
} }
private fun initView(){ 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?){ fun initData(bean: ConfideHomeDataBean?){
......
...@@ -18,7 +18,7 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean ...@@ -18,7 +18,7 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.config.IConfideHomeConfig import com.ydl.confide.home.config.IConfideHomeConfig
import com.ydl.confide.home.contract.IConfideHomeContract import com.ydl.confide.home.contract.IConfideHomeContract
import com.ydl.confide.home.event.IConfideHomeEvent 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 * @author yuanwai
...@@ -41,7 +41,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con ...@@ -41,7 +41,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
private fun initView() { private fun initView() {
var params = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) var params = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params layoutParams = params
View.inflate(context, R.layout.confidehome_recommend_view, this) View.inflate(context, R.layout.confide_recommend_view, this)
dp96 = RxImageTool.dip2px(96f) dp96 = RxImageTool.dip2px(96f)
dp16 = RxImageTool.dip2px(16f) dp16 = RxImageTool.dip2px(16f)
dp4 = RxImageTool.dip2px(4f) dp4 = RxImageTool.dip2px(4f)
...@@ -92,15 +92,15 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con ...@@ -92,15 +92,15 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
when (bodyBean.confideLine) {//1在线 2离线 3通话中 when (bodyBean.confideLine) {//1在线 2离线 3通话中
1, 4 -> { 1, 4 -> {
tv_isLine.text = "在线" tv_isLine.text = "在线"
tv_isLine.setBackgroundResource(R.drawable.confidehome_bg_main_color) tv_isLine.setBackgroundResource(R.drawable.confide_bg_main_color)
} }
2 -> { 2 -> {
tv_isLine.text = "离线" tv_isLine.text = "离线"
tv_isLine.setBackgroundResource(R.drawable.confidehome_bg_color_666666) tv_isLine.setBackgroundResource(R.drawable.confide_bg_color_666666)
} }
3 -> { 3 -> {
tv_isLine.text = "通话中" tv_isLine.text = "通话中"
tv_isLine.setBackgroundResource(R.drawable.confidehome_bg_color_ff8f38) tv_isLine.setBackgroundResource(R.drawable.confide_bg_color_ff8f38)
} }
// 4 -> { // 4 -> {
// tv_confide.text = "继续倾诉" // tv_confide.text = "继续倾诉"
...@@ -133,9 +133,9 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con ...@@ -133,9 +133,9 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
iv_play.visibility = View.VISIBLE iv_play.visibility = View.VISIBLE
} }
if (bodyBean.confideIsPlay) { if (bodyBean.confideIsPlay) {
iv_play.setImageResource(R.drawable.confidehome_playing) iv_play.setImageResource(R.drawable.confide_playing)
} else { } else {
iv_play.setImageResource(R.drawable.confidehome_sond_play) iv_play.setImageResource(R.drawable.confide_sond_play)
} }
iv_play.setOnClickListener { iv_play.setOnClickListener {
if (bodyBean.confideIsPlay!!) { if (bodyBean.confideIsPlay!!) {
...@@ -151,9 +151,9 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con ...@@ -151,9 +151,9 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
*/ */
private fun setSex(bodyBean: ConfideHomeBodyBean) { private fun setSex(bodyBean: ConfideHomeBodyBean) {
if (bodyBean.confideSex == 1) { if (bodyBean.confideSex == 1) {
img_sex.setImageResource(R.drawable.confidehome_new_male) img_sex.setImageResource(R.drawable.confide_new_male)
} else { } 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 ...@@ -216,7 +216,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
textView.setTextColor(Color.parseColor("#808080")) textView.setTextColor(Color.parseColor("#808080"))
textView.gravity = Gravity.CENTER textView.gravity = Gravity.CENTER
textView.setPadding(dp3, 0, dp3, 0) textView.setPadding(dp3, 0, dp3, 0)
textView.setBackgroundResource(R.drawable.confidehome_bg_tag) textView.setBackgroundResource(R.drawable.confide_bg_tag)
textView.layoutParams = params textView.layoutParams = params
textView.text = tag textView.text = tag
flowlayout_tag.addView(textView) flowlayout_tag.addView(textView)
...@@ -230,16 +230,16 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con ...@@ -230,16 +230,16 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
private fun setConfideButton(bodyBean: ConfideHomeBodyBean) { private fun setConfideButton(bodyBean: ConfideHomeBodyBean) {
when (bodyBean.confideLine) {//1在线 2离线 3通话中 4继续倾诉 when (bodyBean.confideLine) {//1在线 2离线 3通话中 4继续倾诉
1 -> { 1 -> {
tv_confide.setBackgroundResource(R.drawable.confidehome_line_1) tv_confide.setBackgroundResource(R.drawable.confide_line_1)
} }
2 -> { 2 -> {
tv_confide.setBackgroundResource(R.drawable.confidehome_line_2) tv_confide.setBackgroundResource(R.drawable.confide_line_2)
} }
3 -> { 3 -> {
tv_confide.setBackgroundResource(R.drawable.confidehome_line_3) tv_confide.setBackgroundResource(R.drawable.confide_line_3)
} }
4 -> { 4 -> {
tv_confide.setBackgroundResource(R.drawable.confidehome_line_4) tv_confide.setBackgroundResource(R.drawable.confide_line_4)
} }
} }
tv_confide.setOnClickListener { tv_confide.setOnClickListener {
......
...@@ -48,7 +48,7 @@ public class ConfidePlayerFloatView extends FrameLayout { ...@@ -48,7 +48,7 @@ public class ConfidePlayerFloatView extends FrameLayout {
wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE); wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
dp3= RxImageTool.dip2px(3f); dp3= RxImageTool.dip2px(3f);
mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop() + 5; 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); playHead = view.findViewById(R.id.play_head);
playState = view.findViewById(R.id.play_state); playState = view.findViewById(R.id.play_state);
playClose = findViewById(R.id.play_close); playClose = findViewById(R.id.play_close);
...@@ -168,7 +168,7 @@ public class ConfidePlayerFloatView extends FrameLayout { ...@@ -168,7 +168,7 @@ public class ConfidePlayerFloatView extends FrameLayout {
} else { } else {
if (!isMove) { if (!isMove) {
if (isFmPlay) { if (isFmPlay) {
playState.setImageResource(R.drawable.confidehome_play_stop); playState.setImageResource(R.drawable.confide_play_stop);
playState.setPadding(dp3,dp3,dp3,dp3); playState.setPadding(dp3,dp3,dp3,dp3);
playClose.setVisibility(VISIBLE); playClose.setVisibility(VISIBLE);
dividerLine.setVisibility(VISIBLE); dividerLine.setVisibility(VISIBLE);
...@@ -176,7 +176,7 @@ public class ConfidePlayerFloatView extends FrameLayout { ...@@ -176,7 +176,7 @@ public class ConfidePlayerFloatView extends FrameLayout {
mPlayCallBack.click(false); mPlayCallBack.click(false);
} }
} else { } else {
playState.setImageResource(R.drawable.confidehome_play_pause); playState.setImageResource(R.drawable.confide_play_pause);
playState.setPadding(dp3,dp3,dp3,dp3); playState.setPadding(dp3,dp3,dp3,dp3);
playClose.setVisibility(GONE); playClose.setVisibility(GONE);
dividerLine.setVisibility(GONE); dividerLine.setVisibility(GONE);
...@@ -229,12 +229,12 @@ public class ConfidePlayerFloatView extends FrameLayout { ...@@ -229,12 +229,12 @@ public class ConfidePlayerFloatView extends FrameLayout {
public void updatePlayState(Boolean isPlaying) { public void updatePlayState(Boolean isPlaying) {
this.isFmPlay = isPlaying; this.isFmPlay = isPlaying;
if (isPlaying) { if (isPlaying) {
playState.setImageResource(R.drawable.confidehome_play_pause); playState.setImageResource(R.drawable.confide_play_pause);
playState.setPadding(dp3,dp3,dp3,dp3); playState.setPadding(dp3,dp3,dp3,dp3);
playClose.setVisibility(GONE); playClose.setVisibility(GONE);
dividerLine.setVisibility(VISIBLE); dividerLine.setVisibility(VISIBLE);
} else { } else {
playState.setImageResource(R.drawable.confidehome_play_stop); playState.setImageResource(R.drawable.confide_play_stop);
playState.setPadding(dp3,dp3,dp3,dp3); playState.setPadding(dp3,dp3,dp3,dp3);
playClose.setVisibility(VISIBLE); playClose.setVisibility(VISIBLE);
} }
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <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"/> <item android:color="@color/_6" android:state_enabled="true"/>
</selector> </selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/dp_3"/> <corners android:radius="@dimen/confide_dp_3"/>
<stroke android:color="#ff5b05" android:width="1px"/> <stroke android:color="#ff5b05" android:width="1px"/>
</shape> </shape>
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
android:shape="rectangle" android:shape="rectangle"
android:useLevel="false"> android:useLevel="false">
<solid android:color="#1DA1F2"/> <solid android:color="@color/confide_main_theme"/>
<corners android:radius="10dp"/> <corners android:radius="10dp"/>
......
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