Commit faf6db49 authored by jyx's avatar jyx

添加UI图片

parent 7ac6ad33
......@@ -55,6 +55,12 @@ public class TUIConversationFragment extends Fragment {
private ConversationPresenter presenter;
// private ChatAc
protected void setChatActivity() {
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
......@@ -164,7 +170,8 @@ public class TUIConversationFragment extends Fragment {
})
.setNegativeButton(getContext().getString(com.tencent.qcloud.tuicore.R.string.cancel), new View.OnClickListener() {
@Override
public void onClick(View v) {}
public void onClick(View v) {
}
});
tipsDialog.show();
}
......
......@@ -133,7 +133,8 @@ public final class TUIConstants {
public static final String EVENT_SUB_KEY_MESSAGE_BOTTOM_CHANGED = "eventSubKeyMessageBottomChanged";
public static final String EVENT_SUB_KEY_MESSAGE_INFO_CHANGED = "eventSubKeyMessageInfoChanged";
public static final String C2C_CHAT_ACTIVITY_NAME = "TUIC2CChatActivity";
// public static final String C2C_CHAT_ACTIVITY_NAME = "TUIC2CChatActivity";
public static final String C2C_CHAT_ACTIVITY_NAME = "IMActivity";
public static final String GROUP_CHAT_ACTIVITY_NAME = "TUIGroupChatActivity";
public static final String CHAT_ID = "chatId";
......
......@@ -290,16 +290,16 @@ public abstract class BaseAppCompatActivity extends TransitionActivity {
* @param tintDrawable
*/
protected void setSystemBarTintDrawable(Drawable tintDrawable) {
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
// SystemBarTintManager mTintManager = new SystemBarTintManager(this);
// if (tintDrawable != null) {
// mTintManager.setStatusBarTintEnabled(true);
// mTintManager.setTintDrawable(tintDrawable);
// } else {
// mTintManager.setStatusBarTintEnabled(false);
// mTintManager.setTintDrawable(null);
// }
// }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
SystemBarTintManager mTintManager = new SystemBarTintManager(this);
if (tintDrawable != null) {
mTintManager.setStatusBarTintEnabled(true);
mTintManager.setTintDrawable(tintDrawable);
} else {
mTintManager.setStatusBarTintEnabled(false);
mTintManager.setTintDrawable(null);
}
}
}
/**
......@@ -308,16 +308,16 @@ public abstract class BaseAppCompatActivity extends TransitionActivity {
* @param on
*/
protected void setTranslucentStatus(boolean on) {
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
// Window win = getWindow();
// WindowManager.LayoutParams winParams = win.getAttributes();
// final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
// if (on) {
// winParams.flags |= bits;
// } else {
// winParams.flags &= ~bits;
// }
// win.setAttributes(winParams);
// }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window win = getWindow();
WindowManager.LayoutParams winParams = win.getAttributes();
final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
if (on) {
winParams.flags |= bits;
} else {
winParams.flags &= ~bits;
}
win.setAttributes(winParams);
}
}
}
......@@ -233,4 +233,13 @@ object GlideUtils {
fun loadThumbImageView(context: Context, path: String?, mImageView: ImageView) {
Glide.with(context).load("$path?x-oss-process=image/resize,p_20").into(mImageView)
}
//默认加载
fun loadThumbRoundImageView(mContext: Context, path: String?, mImageView: ImageView) {
Glide.with(mContext).load("$path?x-oss-process=image/resize,p_20").apply(
RequestOptions().transform(
CenterCrop(), RoundedCorners(BubbleUtils.dp2px(10))
)
).dontAnimate().into(mImageView)
}
}
\ No newline at end of file
......@@ -20,6 +20,7 @@ import com.duben.roseplaylet.net.V6Service;
import com.duben.roseplaylet.utils.AppPreferencesManager;
import com.duben.roseplaylet.utils.ForegroundOrBackground;
import com.duben.oaid.MiitHelper;
import com.mob.MobSDK;
import com.orhanobut.logger.AndroidLogAdapter;
import com.orhanobut.logger.FormatStrategy;
import com.orhanobut.logger.Logger;
......@@ -96,6 +97,9 @@ public class MintsApplication extends MultiDexApplication {
// bugly
CrashReport.initCrashReport(this, "d035276c5b", BuildConfig.DEBUG);
//Mob隐私授权接口
MobSDK.submitPolicyGrantResult(true);
}
/**
......
......@@ -12,6 +12,7 @@ import com.duben.roseplaylet.utils.DeviceUuidFactory
import com.duben.library.net.neterror.BaseSubscriber
import com.duben.library.net.neterror.Throwable
import com.duben.roseplaylet.common.AppConfig
import com.duben.roseplaylet.manager.IMHelper
import com.duben.roseplaylet.mvp.views.FirstView
import com.google.gson.JsonObject
import java.util.HashMap
......@@ -22,36 +23,37 @@ class FirstPresenter : BasePresenter<FirstView>() {
* 游客登录
*/
fun userLogin() {
// val vo = HashMap<String, Any>()
// vo["device"] = DeviceUuidFactory().deviceUuid.toString()
// AppHttpManager.getInstance(loanApplication)
// .call(loanService.visitorlogin(vo),
// object : BaseSubscriber<BaseResponse<UserBean>>() {
// override fun onCompleted() {
// if (isLinkView) return
// }
//
// override fun onError(e: Throwable) {
// if (isLinkView) return
// }
//
// override fun onNext(baseResponse: BaseResponse<UserBean>) {
// if (isLinkView) return
// view.hideLoading()
// val code = baseResponse.getStatus()
// val message = baseResponse.getMessage()
// val data: UserBean? = baseResponse.getData()
// when (code) {
// 200 -> if (data != null) {
// UserManager.getInstance().saveUserInfo(data)
// saveTerminalInfo()
// }
// else -> {
// view.showToast(message)
// }
// }
// }
// })
val vo = HashMap<String, Any>()
vo["device"] = DeviceUuidFactory().deviceUuid.toString()
AppHttpManager.getInstance(loanApplication)
.call(loanService.visitorlogin(vo),
object : BaseSubscriber<BaseResponse<UserBean>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.getStatus()
val message = baseResponse.getMessage()
val data: UserBean? = baseResponse.getData()
when (code) {
200 -> if (data != null) {
UserManager.getInstance().saveUserInfo(data)
saveTerminalInfo()
IMHelper.instance.getImMsg()
}
else -> {
view.showToast(message)
}
}
}
})
}
/**
......@@ -60,40 +62,39 @@ class FirstPresenter : BasePresenter<FirstView>() {
* @param context
*/
fun saveTerminalInfo() {
// val vo = HashMap<String, Any>()
// val deviceInfo: DeviceInfo = DeviceInfo.instance
// val macAddress: String = deviceInfo.getMacAddress()
// val mac = macAddress.replace(":", "")
// vo["mac"] = mac
// vo["mac1"] = macAddress
// vo["androidid"] = deviceInfo.getAndroidId(null)
// vo["imei"] = deviceInfo.iMEI
// vo["oaid"] = MintsApplication.OAID
// vo["os"] = if (deviceInfo.isHarmonyOS()) "android-HarmonyOS" else "android"
// vo["model"] = deviceInfo.newModel
// vo["uuid"] = DeviceUuidFactory().deviceUuid
// vo["osversion"] = deviceInfo.oSVersion
// vo["appversion"] = deviceInfo.versionName
// AppHttpManager.getInstance(loanApplication)
// .call(loanService.saveTerminalInfo(vo),
// object : BaseSubscriber<BaseResponse<Any>>() {
// override fun onCompleted() {
// if (isLinkView) return
// }
//
// override fun onError(e: Throwable) {
// if (isLinkView) return
// }
//
// override fun onNext(baseResponse: BaseResponse<Any>) {
// if (isLinkView) return
// val code = baseResponse.status
// when (code) {
// 200 -> {
// }
// }
// }
// })
val vo = HashMap<String, Any>()
val deviceInfo: DeviceInfo = DeviceInfo.instance
val macAddress: String = deviceInfo.getMacAddress()
val mac = macAddress.replace(":", "")
vo["mac"] = mac
vo["mac1"] = macAddress
vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI
vo["oaid"] = MintsApplication.OAID
vo["os"] = if (deviceInfo.isHarmonyOS()) "android-HarmonyOS" else "android"
vo["model"] = deviceInfo.newModel
vo["uuid"] = DeviceUuidFactory().deviceUuid
vo["osversion"] = deviceInfo.oSVersion
vo["appversion"] = deviceInfo.versionName
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo),
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return
val code = baseResponse.status
when (code) {
200 -> {
}
}
}
})
}
}
\ No newline at end of file
......@@ -80,9 +80,10 @@ class RealAuthPresenter : BasePresenter<RealAuthView>() {
})
}
fun setWechatQRCode(qrCode: String) {
fun setWechatQRCode(qrCode: String, infoWechat: String) {
val vo = hashMapOf<String, Any>()
vo["qrCode"] = qrCode
vo["infoWechat"] = infoWechat
AppHttpManager.getInstance(loanApplication)
.call(loanService.setWechatQRCode(vo),
object : BaseSubscriber<BaseResponse<FaceParam>>() {
......@@ -99,9 +100,10 @@ class RealAuthPresenter : BasePresenter<RealAuthView>() {
val message = baseResponse.message
when (code) {
200 -> {}
200 -> view.setWechatQRCodeSuc()
else -> {
view.showToast(message)
view.setWechatQRCodeFail()
}
}
}
......@@ -110,6 +112,7 @@ class RealAuthPresenter : BasePresenter<RealAuthView>() {
if (isLinkView) return
view.hideLoading()
view.showToast(e?.message)
view.setWechatQRCodeFail()
}
})
}
......
......@@ -9,6 +9,7 @@ import com.duben.roseplaylet.MintsApplication;
import com.duben.roseplaylet.common.AppConfig;
import com.duben.roseplaylet.common.DeviceInfo;
import com.duben.roseplaylet.manager.AppHttpManager;
import com.duben.roseplaylet.manager.IMHelper;
import com.duben.roseplaylet.manager.UserManager;
import com.duben.roseplaylet.mvp.model.BaseResponse;
import com.duben.roseplaylet.mvp.model.UserBean;
......@@ -68,6 +69,7 @@ public class TrackPresenter extends BaseTrackPresenter {
switch (baseResponse.getStatus()) {
case 200: {
UserManager.getInstance().saveUserInfo(baseResponse.getData());
IMHelper.Companion.getInstance().getImMsg();
}
}
}
......
......@@ -265,4 +265,37 @@ class UserProfilePresenter : BasePresenter<UserProfileView>() {
}
})
}
fun getShareUrl() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.shareUrl,
object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.showToast(e.message)
view.getShareUrlSucFail()
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> {
view.getShareUrlSuc(baseResponse.data.get("url").asString)
}
else -> {
view.showToast(message)
view.getShareUrlSucFail()
}
}
}
})
}
}
\ No newline at end of file
......@@ -7,7 +7,6 @@ import com.duben.roseplaylet.mvp.model.BannerList
import com.duben.roseplaylet.mvp.model.BaseResponse
import com.duben.roseplaylet.mvp.views.VipEnjoyView
/**
* @author Assen
* @date 2023/12/5
......@@ -15,12 +14,39 @@ import com.duben.roseplaylet.mvp.views.VipEnjoyView
*/
class VipEnjoyPresenter : BasePresenter<VipEnjoyView>() {
fun getVedio4List(page: Int, pageCount: Int) {
val vo = hashMapOf<String, Any>()
vo["page"] = page
vo["size"] = pageCount
fun topTabs() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.topTabs(),
object : BaseSubscriber<BaseResponse<BannerList>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<BannerList>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> {
view.topTabsSuc(baseResponse.data)
}
else -> {
view.showToast(message)
}
}
}
})
}
fun orders() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.vedio4List(vo),
.call(loanService.orders(),
object : BaseSubscriber<BaseResponse<BannerList>>() {
override fun onCompleted() {
if (isLinkView) return
......@@ -28,8 +54,6 @@ class VipEnjoyPresenter : BasePresenter<VipEnjoyView>() {
override fun onError(e: Throwable) {
if (isLinkView) return
view.showToast(e.message)
view.getVedio4ListFail()
}
override fun onNext(baseResponse: BaseResponse<BannerList>) {
......@@ -40,11 +64,10 @@ class VipEnjoyPresenter : BasePresenter<VipEnjoyView>() {
when (code) {
200 -> {
view.getVedio4ListSuc(baseResponse.data)
view.ordersSuc(baseResponse.data)
}
else -> {
view.showToast(message)
view.getVedio4ListFail()
}
}
}
......
......@@ -15,5 +15,6 @@ interface RealAuthView : BaseView {
fun getUserInfoFail()
fun setUserInfoSuc()
fun setUserInfoFail()
fun setWechatQRCodeSuc()
fun setWechatQRCodeFail()
}
\ No newline at end of file
......@@ -19,6 +19,8 @@ interface UserProfileView : BaseView {
fun toWhiteSuc()
fun toBlackSuc()
fun toLikeSuc(status: Int)
fun getShareUrlSuc(data: String)
fun getShareUrlSucFail()
}
......@@ -3,6 +3,6 @@ package com.duben.roseplaylet.mvp.views
import com.duben.roseplaylet.mvp.model.BannerList
interface VipEnjoyView : BaseView {
fun getVedio4ListSuc(bannerList: BannerList)
fun getVedio4ListFail()
fun topTabsSuc(data: BannerList?)
fun ordersSuc(data: BannerList?)
}
\ No newline at end of file
......@@ -3,7 +3,6 @@ package com.duben.roseplaylet.ui.activitys
import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View
import android.widget.TextView
import com.bytedance.hume.readapk.HumeSDK
import com.duben.roseplaylet.BuildConfig
import com.duben.roseplaylet.MintsApplication
......@@ -33,8 +32,6 @@ class AboutUsActivity : BaseActivity(), View.OnClickListener {
tvAboutasVersion.text =
getString(R.string.app_name) + " v" + ConstantUtil.getVersionName(context)
tv_title.text = if (BuildConfig.DEBUG) "测试-关于我们" else "关于我们"
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
ivAboutasIcon.setOnLongClickListener {
ToastUtil.showLong(
......@@ -78,12 +75,5 @@ class AboutUsActivity : BaseActivity(), View.OnClickListener {
iv_left_icon.setOnClickListener(this)
tvAboutasService.setOnClickListener(this)
tvAboutasPolicy.setOnClickListener(this)
findViewById<TextView>(R.id.tv_about_address).setOnLongClickListener {
return@setOnLongClickListener true
}
}
}
......@@ -108,7 +108,7 @@ class BasicUserProfileActivity : BaseActivity(), View.OnClickListener, BasicUser
showToast("请输入年龄!")
return
}
if (sex == 1 || sex == 2) {
if (sex != 1 || sex != 2) {
showToast("请选择性别!")
return
}
......
......@@ -20,11 +20,13 @@ import com.duben.roseplaylet.common.OssType
import com.duben.roseplaylet.common.UserProfile
import com.duben.roseplaylet.manager.FaceVerifyHelper
import com.duben.roseplaylet.manager.OssManager
import com.duben.roseplaylet.manager.UserManager
import com.duben.roseplaylet.mvp.model.*
import com.duben.roseplaylet.mvp.presenters.RealAuthPresenter
import com.duben.roseplaylet.mvp.views.RealAuthView
import com.duben.roseplaylet.ui.adapter.ProfileLabelAdapter
import com.duben.roseplaylet.ui.widgets.pick.SinglePickDialog
import com.duben.roseplaylet.utils.AddressData
import com.duben.roseplaylet.utils.GlideEngine
import com.duben.roseplaylet.utils.JobData
import com.google.gson.Gson
......@@ -53,11 +55,11 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
private val gson by lazy { Gson() }
private lateinit var sgTv: TextView
private lateinit var tzTv: TextView
private lateinit var sxTv: TextView
private lateinit var jyfwTv: TextView
private lateinit var zyTv: TextView
private lateinit var gxbqTv: TextView
private var userProfileData: UserProfileData? = null
private var gxbqAdapter: ProfileLabelAdapter? = null
......@@ -71,6 +73,9 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
private var jobOptions1Items: MutableList<JobBean>? = mutableListOf()
private var jopOptions2Items: MutableList<ArrayList<String>>? = mutableListOf()
private var addressOptions1Items: MutableList<JsonBean>? = mutableListOf()
private var addressOptions2Items: MutableList<ArrayList<String>>? = mutableListOf()
private var mSinglePickDialog: SinglePickDialog? = null
override fun getContentViewLayoutID() = R.layout.activity_real_auth
......@@ -86,14 +91,33 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
iv_left_icon.setImageResource(R.mipmap.ic_arrow_white)
line.visibility = View.GONE
initAddressData()
initJobData()
initProfile()
initGxbqRcy()
initListener()
if (UserManager.getInstance().idcardStatus == 1) {
// 用户已经完成人脸识别
changeStepStatus(3)
} else {
changeStepStatus(1)
}
}
private fun initAddressData() {
MainScope().launch {
withContext(Dispatchers.IO) {
val addressData = AddressData.getJsonData(this@RealAuthActivity)
try {
addressOptions1Items = addressData.options1Items as ArrayList<JsonBean>
addressOptions2Items = addressData.options2Items as ArrayList<ArrayList<String>>
} catch (e: Exception) {
e.printStackTrace()
}
}
}
}
private fun initJobData() {
MainScope().launch {
......@@ -123,13 +147,13 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
// 身高
layout_sg.findViewById<TextView>(R.id.label_start).text = UserProfile.PROFILE_SG.str
sgTv = layout_sg.findViewById(R.id.label_tv)
sxTv.text = "请选择您的身高"
sgTv.text = "请选择您的身高"
layout_sg.setOnClickListener(this)
// 体重
layout_tz.findViewById<TextView>(R.id.label_start).text = UserProfile.PROFILE_TZ.str
tzTv = layout_tz.findViewById(R.id.label_tv)
sxTv.text = "请选择您的体重"
tzTv.text = "请选择您的体重"
layout_tz.setOnClickListener(this)
// 身形
......@@ -152,7 +176,8 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
// 个性标签
layout_gxbq.findViewById<TextView>(R.id.label_start).text = UserProfile.PROFILE_GXBQ.str
layout_gxbq.findViewById<TextView>(R.id.label_tv).text = "请选择您的个性标签"
gxbqTv = layout_gxbq.findViewById(R.id.label_tv)
gxbqTv.text = "请选择您的个性标签"
layout_gxbq.setOnClickListener(this)
}
......@@ -195,7 +220,7 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
showPickDialog(UserProfile.PROFILE_SX.str, userProfileData?.appearance)
}
R.id.layout_jyfw -> {
showPickDialog(UserProfile.PROFILE_JYFW.str, userProfileData?.findCity)
showAddressDialog()
}
R.id.layout_zy -> {
showJobPick()
......@@ -237,6 +262,7 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
ll_step1.visibility = View.GONE
ll_step3.visibility = View.VISIBLE
ll_step4.visibility = View.GONE
realAuthPresenter.getUserInfo()
}
4 -> {
tv_step_1.setBackgroundResource(R.drawable.shape_orange_round)
......@@ -266,32 +292,34 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
}
2 -> {}
3 -> {
userProfileData?.let {
// 校验是否未选
if (TextUtils.isEmpty(userProfileData?.userHeight)) {
if (TextUtils.isEmpty(it.userHeight)) {
showToast("请选择您的身高")
return
}
if (TextUtils.isEmpty(userProfileData?.bodyWeight)) {
if (TextUtils.isEmpty(it.bodyWeight)) {
showToast("请选择您的体重")
return
}
if (TextUtils.isEmpty(userProfileData?.appearance)) {
if (TextUtils.isEmpty(it.appearance)) {
showToast("请选择您的身型")
return
}
if (TextUtils.isEmpty(userProfileData?.findCity)) {
if (TextUtils.isEmpty(it.findCity)) {
showToast("请选择您的交友范围")
return
}
if (TextUtils.isEmpty(userProfileData?.career)) {
if (TextUtils.isEmpty(it.career)) {
showToast("请选择您的职业")
return
}
if (TextUtils.isEmpty(userProfileData?.tagsCommon)) {
if (TextUtils.isEmpty(it.tagsCommon)) {
showToast("请选择您的个性标签")
return
}
realAuthPresenter.getUserInfo()
realAuthPresenter.setUserInfo(it)
}
}
4 -> {
if (TextUtils.isEmpty(wechatQrCodeUrl)) {
......@@ -342,6 +370,37 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
pvOptions.show()
}
private fun showAddressDialog() {
val provinceIndex = 0
val cityIndex = 0
// 弹出选择器
val pvOptions =
OptionsPickerBuilder(this) { options1, options2, _, v -> //返回的分别是三个级别的选中位置
val opt1tx =
if (addressOptions1Items!!.isNotEmpty()) addressOptions1Items!![options1]
.pickerViewText else ""
val opt2tx = if (addressOptions2Items!!.size > 0
&& addressOptions2Items!![options1].size > 0
) addressOptions2Items!![options1][options2] else ""
val tx = "$opt1tx-$opt2tx"
userProfileData?.findCity = tx
jyfwTv.text = tx
}
.setSelectOptions(provinceIndex, cityIndex)
.setDividerColor(Color.BLACK)
.setTextColorCenter(Color.BLACK) //设置选中项文字颜色
.setContentTextSize(20)
.build<Any>()
pvOptions.setPicker(
addressOptions1Items as List<Nothing>,
addressOptions2Items as List<Nothing>
)
pvOptions.show()
}
private fun showPickDialog(pickerType: String, defaultValue: String?) {
when (pickerType) {
UserProfile.PROFILE_SG.str -> {
......@@ -354,7 +413,8 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
mSinglePickDialog?.setPickResultListener(object :
SinglePickDialog.OnPickResultListener {
override fun onPickResult(result: String) {
userProfileData?.userHeight = result
sgTv.text = result
}
})
mSinglePickDialog?.show()
......@@ -369,7 +429,8 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
mSinglePickDialog?.setPickResultListener(object :
SinglePickDialog.OnPickResultListener {
override fun onPickResult(result: String) {
userProfileData?.bodyWeight = result
tzTv.text = result
}
})
mSinglePickDialog?.show()
......@@ -384,37 +445,8 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
mSinglePickDialog?.setPickResultListener(object :
SinglePickDialog.OnPickResultListener {
override fun onPickResult(result: String) {
}
})
mSinglePickDialog?.show()
}
UserProfile.PROFILE_JYFW.str -> {
mSinglePickDialog = SinglePickDialog(
this,
UserProfile.PROFILE_JYFW.str,
getPickerData(UserProfile.PROFILE_JYFW.str),
defaultValue
)
mSinglePickDialog?.setPickResultListener(object :
SinglePickDialog.OnPickResultListener {
override fun onPickResult(result: String) {
}
})
mSinglePickDialog?.show()
}
UserProfile.PROFILE_ZY.str -> {
mSinglePickDialog = SinglePickDialog(
this,
UserProfile.PROFILE_ZY.str,
getPickerData(UserProfile.PROFILE_ZY.str),
defaultValue
)
mSinglePickDialog?.setPickResultListener(object :
SinglePickDialog.OnPickResultListener {
override fun onPickResult(result: String) {
userProfileData?.appearance = result
sxTv.text = result
}
})
mSinglePickDialog?.show()
......@@ -481,18 +513,37 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
}
private fun initData() {
userProfileData?.let {
sgTv.text = it.userHeight
tzTv.text = it.bodyWeight
sxTv.text = it.appearance
jyfwTv.text = it.findCity
zyTv.text = it.career
if (!TextUtils.isEmpty(it.tagsCommon)) {
val tagsList = gson.fromJson(it.tagsCommon, Array<String>::class.java)
gxbqAdapter?.setNewInstance(tagsList.toCollection(ArrayList()))
}
}
}
override fun getUserInfoFail() {
}
override fun setUserInfoSuc() {
changeStepStatus(4)
}
override fun setUserInfoFail() {
}
override fun setWechatQRCodeSuc() {
showToast("恭喜您完成真人认证!")
finish()
}
override fun setWechatQRCodeFail() {}
private fun showAlbum() {
val windowAnimationStyle = PictureWindowAnimationStyle()
windowAnimationStyle.ofAllAnimation(
......@@ -590,8 +641,10 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
}
if (isWechatQrCodeUrl) {
wechatQrCodeUrl = imgPath!!
// realAuthPresenter.faceResult()
realAuthPresenter.setWechatQRCode(
wechatQrCodeUrl,
et_wechat_no.text.toString()
)
} else {
readAuthImageUrl = imgPath!!
realAuthPresenter.getFaceParam(readAuthImageUrl)
......@@ -638,6 +691,7 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
val tagsList =
gson.fromJson(userProfileData?.tagsCommon, Array<String>::class.java)
gxbqAdapter?.setNewInstance(tagsList.toCollection(ArrayList()))
gxbqTv.text = ""
}
}
}
......
......@@ -52,7 +52,6 @@ class ShareActivity : BaseActivity(), View.OnClickListener, InviteView {
invitePresenter.getRuserShareCode()
initView()
initListener()
}
......@@ -132,14 +131,11 @@ class ShareActivity : BaseActivity(), View.OnClickListener, InviteView {
* 图片分享
*/
private fun shareImgDialog() {
val shareDialog = ShareImageDialog(this, myShareUrl)
val shareDialog = ShareImageDialog(this, myShareUrl, userManager.shareCode)
shareDialog.setOnShareOKListener(object : ShareImageDialog.OnShareOKListener {
override fun onShareOk() {}
})
val content = ""
shareDialog.setShareAvatar("https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/ic_my_coin.png")
shareDialog.setShareTitle("Hi,我是用户" + userManager.name)
shareDialog.setShareContent(content)
shareDialog.show()
}
......
......@@ -6,7 +6,9 @@ import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.text.TextUtils
import android.view.LayoutInflater
import android.view.View
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager
import com.airbnb.lottie.LottieAnimationView
import com.airbnb.lottie.LottieComposition
......@@ -26,10 +28,10 @@ import com.duben.roseplaylet.mvp.presenters.UserProfilePresenter
import com.duben.roseplaylet.mvp.views.UserProfileView
import com.duben.roseplaylet.ui.activitys.base.BaseActivity
import com.duben.roseplaylet.ui.adapter.UserProfileAlbumAdapter
import com.duben.roseplaylet.ui.adapter.base.OnItemClickListener
import com.duben.roseplaylet.ui.preview.ImagePreviewActivity
import com.duben.roseplaylet.ui.widgets.*
import com.duben.roseplaylet.utils.ToastUtil
import com.duben.roseplaylet.utils.UIUtils
import com.duben.roseplaylet.utils.UcropUtils
import com.google.android.material.appbar.AppBarLayout
import com.google.gson.Gson
......@@ -45,9 +47,10 @@ import kotlin.math.abs
*/
class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileView {
private var albumData: ArrayList<String> = arrayListOf()
private var userProfileAlbumAdapter: UserProfileAlbumAdapter? = null
private var userSeeWechat = false
private var shareUrl = ""
private var userProfileAlbumAdapter: UserProfileAlbumAdapter? = null
private var toUid = ""
private var userIsMale = true
......@@ -74,6 +77,8 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
initAppBar()
initAlbumRcy()
initListener()
userProfilePresenter.getShareUrl()
}
override fun onResume() {
......@@ -103,6 +108,30 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
ll_impression.visibility = View.VISIBLE
tv_info_5.visibility = View.VISIBLE
}
val drawable1 = ContextCompat.getDrawable(this, R.mipmap.ic_profile_id)
val drawable2 = ContextCompat.getDrawable(this, R.mipmap.ic_profile_height)
val drawable3 = ContextCompat.getDrawable(this, R.mipmap.ic_profile_weight)
val drawable4 = ContextCompat.getDrawable(this, R.mipmap.ic_profile_position)
val drawable5 = ContextCompat.getDrawable(this, R.mipmap.ic_profile_sx)
val drawable6 = ContextCompat.getDrawable(this, R.mipmap.ic_profile_gxbq)
val drawable7 = ContextCompat.getDrawable(this, R.mipmap.ic_profile_job)
val size = UIUtils.dip2px(this, 35f)
drawable1?.setBounds(0, 0, size, size)
drawable2?.setBounds(0, 0, size, size)
drawable3?.setBounds(0, 0, size, size)
drawable4?.setBounds(0, 0, size, size)
drawable5?.setBounds(0, 0, size, size)
drawable6?.setBounds(0, 0, size, size)
drawable7?.setBounds(0, 0, size, size)
tv_info_1.setCompoundDrawablesWithIntrinsicBounds(drawable1, null, null, null)
tv_info_2.setCompoundDrawablesWithIntrinsicBounds(drawable2, null, null, null)
tv_info_3.setCompoundDrawablesWithIntrinsicBounds(drawable3, null, null, null)
tv_info_4.setCompoundDrawablesWithIntrinsicBounds(drawable4, null, null, null)
tv_info_5.setCompoundDrawablesWithIntrinsicBounds(drawable5, null, null, null)
tv_info_6.setCompoundDrawablesWithIntrinsicBounds(drawable6, null, null, null)
tv_info_7.setCompoundDrawablesWithIntrinsicBounds(drawable6, null, null, null)
tv_info_8.setCompoundDrawablesWithIntrinsicBounds(drawable7, null, null, null)
}
override fun onClick(v: View?) {
......@@ -111,13 +140,11 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
when (v?.id) {
R.id.iv_head_back -> finish()
R.id.iv_head_share -> {
shareDialog()
}
R.id.iv_head_more -> {
showToBlackDialog()
}
R.id.iv_like, R.id.tv_like_male -> {
userProfileData?.let {
if (UserManager.getInstance().vipFlag && UserManager.getInstance().userSex == 1) {
......@@ -134,25 +161,29 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
userProfilePresenter.toLike("" + it.uid, toLikeStatus)
}
}
R.id.tv_chat -> {
userProfileData?.let {
if (it.canChat) {
// 直接聊
IMHelper.instance.startChatActivity("" + it.uid, it.infoWechat)
return
}
// 自己是不是男性
if (UserManager.getInstance().userSex == 1) {
if (UserManager.getInstance().vipFlag) {
// 直接聊
IMHelper.instance.startChatActivity("" + it.uid, it.infoWechat)
} else {
// 男性 非VIP 弹解锁聊天弹框
showUnlockWechatDialog()
// showUnlockWechatDialog()
userProfilePresenter.seeWechat(toUid)
}
} else {
if (UserManager.getInstance().idcardStatus == 1) {
// 直接聊
IMHelper.instance.startChatActivity("" + it.uid, it.infoWechat)
} else {
// 女性 弹出认证弹框
UserHelper.instance.showRealAuthDialog()
}
}
}
}
R.id.tv_wechat -> {
userProfilePresenter.seeWechat(toUid)
}
......@@ -178,25 +209,25 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
private fun initData() {
userProfileData?.let {
if (!UserManager.getInstance().vipFlag) {
if (UserManager.getInstance().userSex == 1 && !UserManager.getInstance().vipFlag) {
// 当前用户是否为男性,且不是VIP
if (it.canSeeSurCount <= 0) {
// 设置模糊
setViewBlur()
} else {
blurview.visibility = View.GONE
}
// 只要不是VIP 就弹解锁资料
showProfileCountDialog(it.canSeeSurCount)
}
if (!TextUtils.isEmpty(it.images)) {
albumData.clear()
val albumData = arrayListOf<String>()
val array: Array<String> = gson.fromJson(it.images, Array<String>::class.java)
array.forEach { it2 ->
albumData.add(it2)
}
userProfileAlbumAdapter?.notifyDataSetChanged()
userProfileAlbumAdapter?.setNewInstance(albumData)
}
if (userIsMale) {
......@@ -210,17 +241,25 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
}
// 喜欢女生特质
if (!TextUtils.isEmpty(it.findDescribe)) {
tv_info_7.text = it.findDescribe
val array: Array<String> =
gson.fromJson(it.findDescribe, Array<String>::class.java)
val sb = StringBuilder()
array.forEach { it2 ->
sb.append("$it2 ")
}
tv_info_7.text = sb
} else {
tv_info_7.text = "秘密"
}
if (it.online) {
tv_online_male.visibility = View.VISIBLE
} else {
tv_online_male.visibility = View.GONE
}
// TODO 对方是否是VIP
// if (it.) {
// tv_label_vip.visibility = View.GONE
// }
} else {
GlideUtils.loadThumbImageView(this, it.headerUrl, iv_avatar_female)
if (TextUtils.isEmpty(it.introduce)) {
......@@ -238,7 +277,7 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
}
if (it.idcardStatus == 1) {
tv_label_auth.visibility = View.VISIBLE
iv_real_label.visibility = View.VISIBLE
}
}
......@@ -265,8 +304,15 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
}
if (!TextUtils.isEmpty(it.distance)) {
tv_label_distance.visibility = View.VISIBLE
tv_label_distance.text = it.distance + "km"
if (userIsMale) {
tv_label_distance_male.visibility = View.VISIBLE
tv_label_distance_male.text = it.distance + "km"
tv_label_distance_female.visibility = View.GONE
} else {
tv_label_distance_female.visibility = View.VISIBLE
tv_label_distance_female.text = "距你" + it.distance + "km"
tv_label_distance_male.visibility = View.GONE
}
}
tv_info_1.visibility = View.GONE
......@@ -291,7 +337,12 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
}
// 个性标签
if (!TextUtils.isEmpty(it.tagsCommon)) {
tv_info_6.text = it.tagsCommon
val array: Array<String> = gson.fromJson(it.tagsCommon, Array<String>::class.java)
val sb = StringBuilder()
array.forEach { it2 ->
sb.append("$it2 ")
}
tv_info_6.text = sb
} else {
tv_info_6.text = "秘密"
}
......@@ -306,14 +357,14 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
}
private fun initAlbumRcy() {
userProfileAlbumAdapter = UserProfileAlbumAdapter(this, albumData)
userProfileAlbumAdapter = UserProfileAlbumAdapter()
userProfileAlbumAdapter?.showAuth(userProfileData?.idcardStatus == 1)
userProfileAlbumAdapter?.setOnItemClickListener(object : OnItemClickListener {
override fun onItemClick(view: View?, position: Int) {
val emptyView = LayoutInflater.from(this).inflate(R.layout.item_empty_album, null)
userProfileAlbumAdapter?.setEmptyView(emptyView)
userProfileAlbumAdapter?.setOnItemClickListener { _, _, position ->
userProfileAlbumAdapter?.let {
if (it.images.size <= 1) return
val preData = arrayListOf<String>()
for (image in it.images) {
for (image in it.data) {
preData.add(image)
}
val bundle = Bundle()
......@@ -322,7 +373,6 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
readyGo(ImagePreviewActivity::class.java, bundle)
}
}
})
val layoutManager = LinearLayoutManager(context)
layoutManager.orientation = LinearLayoutManager.HORIZONTAL
rcy_profile_album.layoutManager = layoutManager
......@@ -336,6 +386,8 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
override fun seeWechatSuc(data: SeeWechat) {
if (data.canSee) {
if (userSeeWechat) {
// 用户想看微信
if (!data.hasWechat) {
// 没有微信号
showToast(data.errMsg)
......@@ -343,12 +395,27 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
// 直接看微信
showSeeWechatDialog(data.wechat)
}
} else {
// 用户想聊天 直接聊
userProfileData?.let {
IMHelper.instance.startChatActivity("" + it.uid, it.infoWechat)
}
}
} else {
// 弹解锁微信
showUnlockWechatDialog()
}
}
override fun getShareUrlSuc(url: String) {
shareUrl = url
}
override fun getShareUrlSucFail() {
}
override fun seeWechatFail() {}
override fun unlockInfoByCoinSuc() {
......@@ -357,6 +424,7 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
}
override fun unlockWechatSuc() {
}
override fun unlockWechatFail() {
......@@ -385,6 +453,17 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
super.onDestroy()
}
/**
* 链接分享
*/
private fun shareDialog() {
val shareDialog = ShareDialog(this, shareUrl)
shareDialog.setOnShareOKListener(object : ShareDialog.OnShareOKListener {
override fun onShareOk() {}
})
shareDialog.show()
}
private fun showSeeWechatDialog(wechatCode: String) {
userProfileData?.let {
SeeWechatDialog(this,
......@@ -399,7 +478,6 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
R.id.tv_send_btn -> {
//
}
R.id.tv_copy -> {
ToastUtil.show(MintsApplication.getContext(), "微信已复制到剪切板!")
UcropUtils.clipData(wechatCode)
......@@ -452,7 +530,6 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
R.id.tv_vip_coin -> {
userProfilePresenter.unlockWechat(toUid)
}
else -> {}
}
}
......
......@@ -86,8 +86,8 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
private void setDarkStatusBar() {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
getWindow().setStatusBarColor(getResources().getColor(R.color.red));
getWindow().setNavigationBarColor(getResources().getColor(R.color.red));
getWindow().setStatusBarColor(getResources().getColor(R.color.full_transparent));
getWindow().setNavigationBarColor(getResources().getColor(R.color.full_transparent));
int vis = getWindow().getDecorView().getSystemUiVisibility();
vis |= View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
getWindow().getDecorView().setSystemUiVisibility(vis);
......@@ -95,7 +95,6 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
public void statusBarDark(boolean isDark) {
ImmersionBar.with(this).transparentStatusBar();
// ImmersionBar.with(this).statusBarDarkFont(isDark, 0.5f).init();
}
@Override
......
......@@ -23,7 +23,7 @@ class CommonListAdapter : BaseQuickAdapter<UserData, BaseViewHolder>(R.layout.it
holder.getView<TextView>(R.id.tv_recommend_info).text =
item.age + " " + item.lastCity + " " + item.career
val tvRealLabel = holder.getView<TextView>(R.id.tv_real_label)
val tvRealLabel = holder.getView<ImageView>(R.id.tv_real_label)
if (item.idcardStatus == 1) {
tvRealLabel.visibility = View.VISIBLE
} else {
......
package com.duben.roseplaylet.ui.adapter
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.duben.library.utils.GlideUtils
import com.duben.roseplaylet.R
import com.duben.roseplaylet.ui.adapter.base.OnItemClickListener
import com.duben.roseplaylet.utils.LogUtil
class UserProfileAlbumAdapter(val context: Context, val images: List<String>) :
RecyclerView.Adapter<RecyclerView.ViewHolder>() {
companion object {
const val HOLDER_TYPE_EMPTY = 0
const val HOLDER_TYPE_IMAGE = 1
}
class UserProfileAlbumAdapter :
BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_user_profile_album) {
private var isShowAuth = false
private var mOnItemClickListener: OnItemClickListener? = null
fun showAuth(showAuth: Boolean) {
this.isShowAuth = showAuth
}
fun setOnItemClickListener(listener: OnItemClickListener) {
mOnItemClickListener = listener
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
if (viewType == OrderRecordAdapter.HOLDER_TYPE_EMPTY) {
val emptyView =
LayoutInflater.from(parent.context).inflate(R.layout.item_empty_cash, parent, false)
return EmptyHolder(emptyView)
}
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_user_profile_album, parent, false)
return ViewHolder(view)
}
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val tv_auth: TextView = view.findViewById(R.id.tv_auth)
val iv_photo: ImageView = view.findViewById(R.id.iv_photo)
}
inner class EmptyHolder(itemView: View) : RecyclerView.ViewHolder(itemView)
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
if (holder is EmptyHolder) {
return
}
val myholder = holder as ViewHolder
override fun convert(holder: BaseViewHolder, item: String) {
if (isShowAuth) {
myholder.tv_auth.visibility = View.VISIBLE
holder.getView<View>(R.id.tv_auth).visibility = View.VISIBLE
} else {
myholder.tv_auth.visibility = View.GONE
}
myholder.iv_photo.setOnClickListener {
mOnItemClickListener?.onItemClick(it, position)
holder.getView<View>(R.id.tv_auth).visibility = View.GONE
}
LogUtil.d("AAAAAA" + images[position])
GlideUtils.loadImageViewNoAnim2(context, images[position], myholder.iv_photo)
}
override fun getItemCount(): Int {
return if (images.isEmpty()) {
1
} else {
images.size
GlideUtils.loadThumbRoundImageView(
context,
item,
holder.getView(R.id.iv_photo)
)
}
}
override fun getItemViewType(position: Int): Int {
if (images.isEmpty()) {
return HOLDER_TYPE_EMPTY
}
return HOLDER_TYPE_IMAGE
}
}
\ No newline at end of file
......@@ -51,15 +51,12 @@ class CsjVedioFragment : LazyLoadBaseFragment(), View.OnClickListener, OnRefresh
var mSelectTabIndex = -1
private val tabsData = mutableListOf<HotStyleTypesBean>()
private var vpAdapter: CsjVideoPageAdapter? = null
private var alipayTime = 0
private val userManager by lazy { UserManager.getInstance() }
override fun getContentViewLayoutID() = R.layout.fragment_csjvedio
override fun initViewsAndEvents() {
}
override fun initViewsAndEvents() {}
override fun onFragmentFirstVisible() {
initVp()
......@@ -107,11 +104,12 @@ class CsjVedioFragment : LazyLoadBaseFragment(), View.OnClickListener, OnRefresh
requireActivity().runOnUiThread {
if (!TextUtils.isEmpty(userManager?.userID)) {
CsjDJXSdkManager.requestDramaCategoryList(object : CsjDJXSdkManager.CsjdramaCategoryListListener {
CsjDJXSdkManager.requestDramaCategoryList(object :
CsjDJXSdkManager.CsjdramaCategoryListListener {
override fun dramaCategoryListSuccess(list: MutableList<HotStyleTypesBean>) {
tabsData.clear()
tabsData.addAll(list)
LogUtil.d("mcg--->"+JsonUtil.toJson(list))
LogUtil.d("mcg--->" + JsonUtil.toJson(list))
if (tabsData.isNotEmpty()) {
mSelectTabIndex = 0
......@@ -130,10 +128,7 @@ class CsjVedioFragment : LazyLoadBaseFragment(), View.OnClickListener, OnRefresh
}
}
override fun dramaCategoryListFail() {
}
override fun dramaCategoryListFail() {}
})
}
}
......
......@@ -9,6 +9,7 @@ import androidx.fragment.app.Fragment
import com.duben.roseplaylet.R
import com.duben.roseplaylet.common.AppConfig
import com.duben.roseplaylet.common.Constant
import com.duben.roseplaylet.manager.TrackManager
import com.duben.roseplaylet.manager.UserManager
import com.duben.roseplaylet.mvp.presenters.FirstPresenter
import com.duben.roseplaylet.mvp.views.FirstView
......@@ -25,11 +26,6 @@ import kotlinx.android.synthetic.main.fragment_first.*
*/
class FirstFragment : LazyLoadBaseFragment(), FirstView {
companion object {
var currentPosition = 0
}
private var mSelectTabIndex = 0
private val tabsData = mutableListOf<String>()
private val fragments = mutableListOf<Fragment>()
private var vpAdapter: RecommendPageAdapter? = null
......@@ -52,9 +48,11 @@ class FirstFragment : LazyLoadBaseFragment(), FirstView {
override fun onFragmentResume() {
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_ONE) {
// if (TextUtils.isEmpty(userManager?.userID)) {
// firstPresenter.userLogin()
// }
if (TextUtils.isEmpty(userManager?.userID)) {
firstPresenter.userLogin()
} else {
TrackManager.getInstance().getBaseMsg()
}
}
}
......@@ -64,26 +62,33 @@ class FirstFragment : LazyLoadBaseFragment(), FirstView {
}
private fun initVp2() {
tabsData.add("推 荐")
tabsData.add("推荐")
tabsData.add("VIP专享")
fragments.clear()
fragments.add(CsjVedioFragment.newInstance())
fragments.add(MainFragment.newInstance())
fragments.add(VipEnjoyFragment.newInstance())
vpAdapter = RecommendPageAdapter(fragments, this)
vp2_recommend.adapter = vpAdapter
TabLayoutMediator(tab_recommend, vp2_recommend) { tab, position ->
// 初始化Tab
tab.id = position
tab.customView = getTabView(position)
if (tabsData.size > 0) {
if (position == 0) {
tab.customView = getTabView(tabsData[position], true)
} else {
tab.customView = getTabView(tabsData[position], false)
}
}
}.attach()
tab_recommend.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab?) {
currentPosition = tab!!.position
mSelectTabIndex = tab!!.id
updateTab(tab, true, mSelectTabIndex)
tab?.let {
updateTab(it.customView, true)
}
}
override fun onTabUnselected(tab: TabLayout.Tab?) {
updateTab(tab, false, mSelectTabIndex)
tab?.let { updateTab(it.customView, false) }
}
override fun onTabReselected(tab: TabLayout.Tab?) {
......@@ -95,34 +100,25 @@ class FirstFragment : LazyLoadBaseFragment(), FirstView {
vp2_recommend.isUserInputEnabled = false
}
private fun getTabView(position: Int): View {
val view = LayoutInflater.from(requireContext()).inflate(R.layout.item_recommend_tab, null)
view.findViewById<TextView>(R.id.item_tv).text = tabsData[position]
if (position == 0) {
view.findViewById<View>(R.id.item_line).background =
ContextCompat.getDrawable(requireContext(), R.drawable.shape_line_corner_red)
}
private fun getTabView(text: String, isSelected: Boolean): View {
val view = LayoutInflater.from(requireContext()).inflate(R.layout.item_square_tab, null)
view.findViewById<TextView>(R.id.item_tv).text = text
updateTab(view, isSelected)
return view
}
private fun updateTab(tab: TabLayout.Tab?, isSelected: Boolean, position: Int) {
tab?.customView?.let {
private fun updateTab(view: View?, isSelected: Boolean) {
view?.let {
val text = it.findViewById<TextView>(R.id.item_tv)
val line = it.findViewById<View>(R.id.item_line)
val bar = it.findViewById<View>(R.id.view_bar)
if (isSelected) {
line.visibility = View.VISIBLE
text.setTextColor(ContextCompat.getColor(requireContext(), R.color.black))
text.setTextColor(ContextCompat.getColor(requireContext(), R.color.color_E4C46C))
bar.visibility = View.VISIBLE
} else {
text.setTextColor(
ContextCompat.getColor(
requireContext(),
R.color.black
)
)
line.visibility = View.INVISIBLE
}
line.background =
ContextCompat.getDrawable(requireContext(), R.drawable.shape_line_corner_red)
text.setTextColor(ContextCompat.getColor(requireContext(), R.color.color_959595))
bar.visibility = View.INVISIBLE
}
}
}
}
\ No newline at end of file
package com.duben.roseplaylet.ui.fragment
import android.view.View
import com.duben.library.utils.nodoubleclick.AntiShake
import com.duben.roseplaylet.R
import com.duben.roseplaylet.manager.UserManager
import com.tencent.qcloud.tuikit.tuiconversation.classicui.page.TUIConversationFragment
class IMConversationFragment : TUIConversationFragment(), View.OnClickListener {
private val userManager by lazy { UserManager.getInstance() }
override fun onClick(v: View?) {
if (AntiShake.check(v?.id)) return
when (v?.id) {
R.id.tv_clear_noread -> {
// 清除未读
}
R.id.tv_clear_list -> {
// 清除列表
}
}
}
}
\ No newline at end of file
package com.duben.roseplaylet.ui.fragment
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.text.TextUtils
import android.view.LayoutInflater
import android.view.View
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager2.widget.ViewPager2
import com.duben.library.utils.GlideUtils
import com.duben.library.utils.nodoubleclick.AntiShake
import com.duben.roseplaylet.R
import com.duben.roseplaylet.ad.AdManager
import com.duben.roseplaylet.ad.banner.BannerManager
import com.duben.roseplaylet.common.AppConfig
import com.duben.roseplaylet.common.Constant
import com.duben.roseplaylet.manager.IMHelper
import com.duben.roseplaylet.manager.LocalVedioManager
import com.duben.roseplaylet.manager.TrackManager
import com.duben.roseplaylet.manager.UserManager
import com.duben.roseplaylet.mvp.model.*
import com.duben.roseplaylet.mvp.presenters.HomePresenter
import com.duben.roseplaylet.mvp.views.HomeView
import com.duben.roseplaylet.ui.activitys.AlipayTimeActivity
import com.duben.roseplaylet.ui.activitys.NineActivity
import com.duben.roseplaylet.ui.activitys.VipActivity
import com.duben.roseplaylet.ui.adapter.HomeVideoPageAdapter
import com.duben.roseplaylet.ui.adapter.ImageTitleAdapter
import com.duben.roseplaylet.ui.adapter.TopAdapter
import com.duben.roseplaylet.ui.fragment.base.LazyLoadBaseFragment
import com.duben.roseplaylet.ui.widgets.SimpleCountDownTimer
import com.duben.roseplaylet.utils.AppPreferencesManager
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator
import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import kotlinx.android.synthetic.main.fragment_main.*
import java.lang.reflect.Field
import java.util.*
import kotlin.concurrent.schedule
/**
* 描述:首页
......@@ -52,7 +26,6 @@ import kotlin.concurrent.schedule
class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnRefreshListener {
companion object {
fun newInstance(): Fragment {
val args = Bundle()
val fragment = MainFragment()
......@@ -61,17 +34,9 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
}
}
var mSelectTabIndex = -1
private val tabsData = mutableListOf<HotStyleTypesBean>()
private val bannerList = mutableListOf<BannerBean>()
private val topList = mutableListOf<VedioBean>()
private var vpAdapter: HomeVideoPageAdapter? = null
private var topAdapter: TopAdapter? = null
private var recommendVedioBean: RecoBean? = null
private var alipayTime = 0
private val homePresenter by lazy { HomePresenter() }
private val userManager by lazy { UserManager.getInstance() }
override fun getContentViewLayoutID() = R.layout.fragment_main
......@@ -80,16 +45,13 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
}
override fun onFragmentFirstVisible() {
initVp()
initListener()
loadData()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_ONE) {
if (AntiShake.check(banner?.id)) return
homePresenter.topTabs()
homePresenter.orders()
banner?.start()
}
/**
* 跳转到主页面
*/
private fun goToMainActivity() {
homePresenter.getSoltVedio()
}
override fun onDestroy() {
......@@ -98,29 +60,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
}
override fun onFragmentResume() {
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_ONE) {
if (AntiShake.check(banner?.id)) return
BannerManager.loadAd(requireActivity(), fl_main_banner)
banner?.start()
setWatchingStatus()
if (TextUtils.isEmpty(userManager?.userID)) {
//获取游客登录数据
homePresenter.userLogin()
} else {
homePresenter.topTabs()
homePresenter.orders()
if (userManager.vipFlag) {
homePresenter.signAfterSeconds()
}
// IMHelper.instance.getImMsg()
TrackManager.getInstance().getBaseMsg()
}
AppConfig.showVipAdDialog = false
}
}
override fun onFragmentPause() {
......@@ -129,177 +69,20 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
private fun initListener() {
srlMainPage.setOnRefreshListener(this)
iv_main_watching_close.setOnClickListener(this)
tv_main_watching_goto.setOnClickListener(this)
ll_lucky.setOnClickListener(this)
iv_kefu_main.setOnClickListener(this)
// context?.let {
// GlideUtils.loadImageViewGifForCenterCrop(
// it,
// "https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/ic_kefu_main.png",
// iv_kefu_main,
// 1
// )
// }
}
override fun onClick(v: View?) {
if (AntiShake.check(v?.id)) return
when (v?.id) {
R.id.iv_kefu_main -> {
val bundle = Bundle()
bundle.putInt(AlipayTimeActivity.ALIPAY_TIME, alipayTime)
readyGo(AlipayTimeActivity::class.java, bundle)
}
R.id.iv_main_watching_close -> {
LocalVedioManager.closeCacheVedio()
ll_main_watching_root.visibility = View.GONE
}
R.id.tv_main_watching_goto -> {
val cacheVedio = LocalVedioManager.getCacheVedio()
if (cacheVedio != null) {
LocalVedioManager.startVedioDetailActivityForType(requireActivity(), cacheVedio)
}
}
R.id.ll_lucky -> {
readyGo(NineActivity::class.java)
}
}
}
private fun loadData() {
Timer().schedule(200) {
requireActivity().runOnUiThread {
if (AntiShake.check(rv_main_list?.id)) return@runOnUiThread
if (!TextUtils.isEmpty(userManager?.userID)) {
homePresenter.getHomeV1Types()
}
}
}
}
private fun initVp() {
topAdapter = TopAdapter(topList)
val ma = LinearLayoutManager(requireContext())
ma.orientation = LinearLayoutManager.HORIZONTAL
rv_main_list.layoutManager = ma
rv_main_list.adapter = topAdapter
topAdapter?.setOnItemClickListener(object : TopAdapter.OnItemClickListener {
override fun onItemClick(position: Int) {
if (topList.size > 0) {
LocalVedioManager.startVedioDetailActivityForType(
requireActivity(),
topList[position]
)
}
}
})
vpAdapter = HomeVideoPageAdapter(tabsData, this)
vp2.adapter = vpAdapter
vp2.desensitization()
TabLayoutMediator(tablayout, vp2) { tab, position ->
// 初始化Tab
tab.id = position
if (tabsData.size > 0) {
tab.customView = getTabView(tabsData[position].type)
}
}.attach()
tablayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab?) {
updateTab(tab, true)
mSelectTabIndex = tab!!.id
}
override fun onTabUnselected(tab: TabLayout.Tab?) {
updateTab(tab, false)
}
override fun onTabReselected(tab: TabLayout.Tab?) {
}
})
vp2.offscreenPageLimit = 100
}
private fun updateTab(tab: TabLayout.Tab?, isSelected: Boolean) {
tab?.customView?.let {
val text = it.findViewById<TextView>(R.id.item_tv)
if (isSelected) {
text.setTextColor(ContextCompat.getColor(requireContext(), R.color.red))
} else {
text.setTextColor(ContextCompat.getColor(requireContext(), R.color.color_8D8F90))
}
}
}
private fun getTabView(text: String): View {
val view = LayoutInflater.from(requireContext()).inflate(R.layout.item_video_tab, null)
view.findViewById<TextView>(R.id.item_tv).text = text
return view
}
override fun onRefresh(refreshLayout: RefreshLayout) {
vpAdapter?.run {
if (getFragments().isNotEmpty()) {
val fragment = getFragments()[mSelectTabIndex]
if (fragment != null) {
(fragment as MovieFragment).onRefresh()
refreshLayout.finishRefresh()
}
}
}
}
fun setWatchingStatus() {
if (LocalVedioManager.isCacheVedio()) {
ll_main_watching_root.visibility = View.VISIBLE
ll_main_watching_root.setOnClickListener { }
val cacheVedio = LocalVedioManager.getCacheVedio()
if (cacheVedio != null) {
GlideUtils.loadImageViewGifForCenterCrop(
requireContext(),
cacheVedio.coverImage,
iv_main_watching_pic
)
tv_main_watching_name.text = cacheVedio.title
tv_main_watching_text1.text = "上次观看至第${cacheVedio.seeIndex}集"
if (cacheVedio.orderTags != null && cacheVedio.orderTags.size > 0) {
val sb = StringBuilder()
for (i in 0 until cacheVedio.orderTags.size) {
sb.append(cacheVedio.orderTags.get(i) + " ")
}
tv_main_watching_text2.text = "${sb}"
}
}
} else {
ll_main_watching_root.visibility = View.GONE
}
homePresenter.orders()
}
override fun getHomeV1MsgSuc(data: HotStyleTypesList) {
tabsData.clear()
tabsData.addAll(data.list)
if (tabsData.isNotEmpty()) {
mSelectTabIndex = 0
vpAdapter?.run {
notifyDataSetChanged()
Handler(Looper.getMainLooper()).postDelayed({
if (getFragments().isNotEmpty()) {
val fragment = getFragments()[mSelectTabIndex]
if (fragment != null) {
(fragment as MovieFragment).onRefresh()
}
}
}, 200)
}
}
}
override fun getHomeV1MsgSuc(data: HotStyleTypesList) {}
override fun topTabsSuc(data: BannerList?) {
if (data != null && data.list != null && data.list.size > 0) {
......@@ -315,87 +98,19 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
.setAdapter(ImageTitleAdapter(bannerList))
.setOnBannerListener { data2, position ->
val banner = data.list[position]
if (banner.createType == 4) {
// 九宫格
val bundle = Bundle()
bundle.putBoolean(NineActivity.IS_AD_SHOW, true)
readyGo(NineActivity::class.java, bundle)
} else {
LocalVedioManager.startVedioDetailActivityForType(requireActivity(), banner)
}
}
}
}
override fun ordersSuc(data: BannerList?) {
topList.clear()
if (data != null) {
topList.addAll(data.list)
}
topAdapter?.notifyDataSetChanged()
}
override fun ordersSuc(data: BannerList?) {}
override fun getSoltVedioSuc(data: IndexList?) {
// val firstVedio = AppPreferencesManager.get().getBoolean(Constant.IS_FIRST_VEDIO, true)
// if (data != null && data.vedioMsg != null && firstVedio) {
// AppPreferencesManager.get().put(Constant.IS_FIRST_VEDIO, false)
// LocalVedioManager.startVedioDetailActivityForType(requireActivity(), data.vedioMsg)
// } else {
// if (UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) {
//// homePresenter.getRecommendVedio()
////
// val bundle = Bundle()
// bundle.putBoolean(VipActivity.IS_MAIN, true)
// readyGo(VipActivity::class.java, bundle)
// }
// }
}
override fun getRecommendVedioSuc(data: RecoBean?) {
this.recommendVedioBean = data
}
override fun signAfterSecondsSuc(time: Int) {
this.alipayTime = time
// if (countDownTimer != null) {
// countDownTimer!!.cancel()
// countDownTimer = null
// }
if (time > 0) {
iv_kefu_main.visibility = View.VISIBLE
// countDownTimer =
// SimpleCountDownTimer(time.toLong() * 1000, tv_alipaytime).setOnFinishListener {
// iv_kefu_main?.visibility = View.GONE
// }.start() as SimpleCountDownTimer?
} else {
iv_kefu_main.visibility = View.GONE
}
}
override fun onFragmentResume(firstResume: Boolean) {
super.onFragmentResume(firstResume)
vpAdapter?.getFragments()?.get(mSelectTabIndex)?.onResume()
}
override fun onPause() {
super.onPause()
vpAdapter?.getFragments()?.get(mSelectTabIndex)?.onPause()
}
fun ViewPager2.desensitization() {
//动态设置ViewPager2 灵敏度
try {
val recyclerViewField: Field = ViewPager2::class.java.getDeclaredField("mRecyclerView")
recyclerViewField.isAccessible = true
val recyclerView = recyclerViewField.get(this) as RecyclerView
val touchSlopField: Field = RecyclerView::class.java.getDeclaredField("mTouchSlop")
touchSlopField.isAccessible = true
val touchSlop = touchSlopField.get(recyclerView) as Int
touchSlopField.set(recyclerView, touchSlop * 3) //6 is empirical value
} catch (ignore: java.lang.Exception) {
}
}
}
\ No newline at end of file
......@@ -23,8 +23,6 @@ class MessageFragment : LazyLoadBaseFragment(), View.OnClickListener {
private val fragmentsData = mutableListOf<Fragment>()
private var vpAdapter: MsgPageAdapter? = null
private val userManager by lazy { UserManager.getInstance() }
override fun getContentViewLayoutID() = R.layout.fragment_main_message
override fun initViewsAndEvents() {
......@@ -38,7 +36,7 @@ class MessageFragment : LazyLoadBaseFragment(), View.OnClickListener {
tabsData.add(String.format("聊天"))
// tabsData.add(String.format("系统消息"))
fragmentsData.add(TUIConversationFragment())
fragmentsData.add(IMConversationFragment())
// fragmentsData.add(SystemMsgFragment())
vpAdapter = MsgPageAdapter(tabsData, fragmentsData, requireActivity())
......
......@@ -20,6 +20,7 @@ import com.duben.roseplaylet.mvp.views.MyView
import com.duben.roseplaylet.ui.activitys.*
import com.duben.roseplaylet.ui.fragment.base.LazyLoadBaseFragment
import com.duben.roseplaylet.utils.SpanUtils
import com.duben.roseplaylet.utils.TimeRender
import com.duben.roseplaylet.utils.UIUtils
import kotlinx.android.synthetic.main.fragment_main_my.*
......@@ -78,7 +79,7 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
R.id.ll_edit_profile -> {
readyGo(EditProfileActivity::class.java)
}
R.id.ll_my_vip -> {
R.id.iv_my_vip -> {
if (!userManager.vipFlag) {
readyGo(VipActivity::class.java)
}
......@@ -135,6 +136,20 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
tv_my_id.text = "ID:" + data.idcode
GlideUtils.loadThumbImageView(requireContext(), data.headerUrl, civ_my_avatar)
if (data.expireTime > 0) {
rl_my_vip.visibility = View.VISIBLE
iv_my_vip.visibility = View.GONE
if (data.isForever) {
tv_vip_date.text = "有效期: 永久有效"
} else {
tv_vip_date.text =
"到期时间 ${TimeRender.formatDate(data.expireTime, TimeRender.DEFAULT_FORMAT)}"
}
} else {
rl_my_vip.visibility = View.VISIBLE
iv_my_vip.visibility = View.GONE
}
if (data.sex == 1) {
// 男性无认证页面
ll_my_auth.visibility = View.GONE
......@@ -165,7 +180,7 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
ll_my_ilike.setOnClickListener(this)
ll_my_likeme.setOnClickListener(this)
ll_my_seeme.setOnClickListener(this)
ll_my_vip.setOnClickListener(this)
iv_my_vip.setOnClickListener(this)
ll_my_wallet.setOnClickListener(this)
ll_my_invite.setOnClickListener(this)
ll_my_album.setOnClickListener(this)
......
......@@ -9,14 +9,15 @@ import com.duben.roseplaylet.R
import com.duben.roseplaylet.common.AppConfig
import com.duben.roseplaylet.common.Constant
import com.duben.roseplaylet.manager.LocalVedioManager
import com.duben.roseplaylet.mvp.model.BannerBean
import com.duben.roseplaylet.mvp.model.BannerList
import com.duben.roseplaylet.mvp.model.VedioBean
import com.duben.roseplaylet.mvp.presenters.VipEnjoyPresenter
import com.duben.roseplaylet.mvp.views.VipEnjoyView
import com.duben.roseplaylet.ui.adapter.ImageTitleAdapter
import com.duben.roseplaylet.ui.adapter.VipEnjoyAdapter
import com.duben.roseplaylet.ui.fragment.base.LazyLoadBaseFragment
import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import kotlinx.android.synthetic.main.fragment_vip_enjoy.*
......@@ -25,8 +26,7 @@ import kotlinx.android.synthetic.main.fragment_vip_enjoy.*
* @date 2023/12/5
* @desc VIP尊享页面
*/
class VipEnjoyFragment : LazyLoadBaseFragment(), OnLoadMoreListener, VipEnjoyView,
OnRefreshListener {
class VipEnjoyFragment : LazyLoadBaseFragment(), VipEnjoyView, OnRefreshListener {
companion object {
fun newInstance(): Fragment {
......@@ -40,8 +40,8 @@ class VipEnjoyFragment : LazyLoadBaseFragment(), OnLoadMoreListener, VipEnjoyVie
private val vipEnjoyPresenter by lazy { VipEnjoyPresenter() }
private lateinit var vipEnjoyAdapter: VipEnjoyAdapter
private var page = 1 // 分页
private var pageSize = Constant.PAGE_SIZE // 分页
private val bannerList = mutableListOf<BannerBean>()
override fun initViewsAndEvents() {
vipEnjoyPresenter.attachView(this)
......@@ -83,15 +83,22 @@ class VipEnjoyFragment : LazyLoadBaseFragment(), OnLoadMoreListener, VipEnjoyVie
private fun initListener() {
srl_enjoy.setEnableRefresh(true)
srl_enjoy.setOnLoadMoreListener(this)
srl_enjoy.setOnRefreshListener(this)
}
override fun onFragmentResume() {
banner?.start()
}
override fun onFragmentPause() {
banner?.stop()
}
private fun myRefresh() {
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_THREE) {
page = 1
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_ONE) {
srl_enjoy.resetNoMoreData()
vipEnjoyPresenter.getVedio4List(page, pageSize)
vipEnjoyPresenter.orders()
vipEnjoyPresenter.topTabs()
}
}
......@@ -99,34 +106,35 @@ class VipEnjoyFragment : LazyLoadBaseFragment(), OnLoadMoreListener, VipEnjoyVie
myRefresh()
}
override fun onLoadMore(refreshLayout: RefreshLayout) {
page = ++page
vipEnjoyPresenter.getVedio4List(page, pageSize)
override fun topTabsSuc(data: BannerList?) {
if (data != null && data.list != null && data.list.size > 0) {
bannerList.clear()
for (i in 0 until data.list.size) {
val bean = BannerBean()
bean.title = data.list[i].topTabsReamrk
bean.imageRes = data.list[i].typeImg
bannerList.add(bean)
}
banner.addBannerLifecycleObserver(this)
.setAdapter(ImageTitleAdapter(bannerList))
.setOnBannerListener { data2, position ->
val banner = data.list[position]
LocalVedioManager.startVedioDetailActivityForType(requireActivity(), banner)
}
}
}
override fun getVedio4ListSuc(data: BannerList) {
override fun ordersSuc(data: BannerList?) {
if (activity == null || requireActivity().isFinishing) {
srl_enjoy?.finishRefresh(true)
return
}
if (::vipEnjoyAdapter.isInitialized) {
if (page == 1) {
srl_enjoy.finishRefresh(true)
vipEnjoyAdapter.setNewInstance(data.list)
} else {
if (data.list.size < pageSize) {
srl_enjoy.finishLoadMoreWithNoMoreData()
} else {
srl_enjoy.finishLoadMore()
}
vipEnjoyAdapter.addData(data.list)
}
vipEnjoyAdapter.setNewInstance(data?.list)
}
}
override fun getVedio4ListFail() {
}
}
\ No newline at end of file
......@@ -16,6 +16,7 @@ import com.duben.library.utils.ConstantUtil
import com.duben.roseplaylet.MintsApplication
import com.duben.roseplaylet.R
import com.duben.roseplaylet.common.Constant
import com.duben.roseplaylet.utils.LogUtil
import com.duben.roseplaylet.utils.QRCodeUtil
import com.duben.roseplaylet.utils.ToastUtil
import java.util.*
......@@ -59,7 +60,6 @@ class ShareDialog(context: Context, private val shareUrl: String) :
tvDialogShareNext = findViewById<View>(R.id.tvDialogShareNext) as TextView
tvDialogShareTips = findViewById<View>(R.id.tvDialogShareTips) as TextView
val QRCode = QRCodeUtil.createQRCode(shareUrl, 50)
val inflater = LayoutInflater.from(context)
val view1 = inflater.inflate(R.layout.item_share_view, null)
......
......@@ -3,10 +3,8 @@ package com.duben.roseplaylet.ui.widgets
import android.app.Dialog
import android.content.Context
import android.graphics.Bitmap
import android.text.Spanned
import android.text.TextUtils
import android.view.*
import android.widget.CheckBox
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
......@@ -31,7 +29,8 @@ import kotlin.concurrent.schedule
class ShareImageDialog(
context: Context,
shareUrl: String
shareUrl: String,
shareCode: String,
) : Dialog(context, R.style.dialog) {
private val llDialogShareWx: LinearLayout
......@@ -50,7 +49,7 @@ class ShareImageDialog(
private val wechatMoments by lazy { ShareSDK.getPlatform(WechatMoments.NAME) }
init {
setContentView(R.layout.dialog_share)
setContentView(R.layout.dialog_share_image)
// 设置window属性
window?.let {
val lp = it.attributes
......@@ -79,22 +78,22 @@ class ShareImageDialog(
val QRCode = QRCodeUtil.createQRCode(shareUrl, 50)
val inflater = LayoutInflater.from(context)
val view1 = inflater.inflate(R.layout.item_share_view, null)
val view2 = inflater.inflate(R.layout.item_share_view, null)
// val view2 = inflater.inflate(R.layout.item_share_view, null)
view1.findViewById<View>(R.id.item_iv_bg).setBackgroundResource(R.mipmap.bg_share_1)
view2.findViewById<View>(R.id.item_iv_bg).setBackgroundResource(R.mipmap.bg_share_2)
// view2.findViewById<View>(R.id.item_iv_bg).setBackgroundResource(R.mipmap.bg_share_2)
view1.findViewById<ImageView>(R.id.item_iv_qrcode).setImageBitmap(QRCode)
view2.findViewById<ImageView>(R.id.item_iv_qrcode).setImageBitmap(QRCode)
view1.findViewById<TextView>(R.id.tv_share_code).text = "邀请码:${shareCode}"
// view2.findViewById<ImageView>(R.id.item_iv_qrcode).setImageBitmap(QRCode)
mViews = arrayListOf()
mViews.add(view1)
mViews.add(view2)
// mViews.add(view2)
pagerAdapter = SharePagerAdapter(mViews)
viewPager.adapter = pagerAdapter
val cb2 = view2.findViewById<CheckBox>(R.id.item_cb_check)
val cb1 = view1.findViewById<CheckBox>(R.id.item_cb_check)
cb1.isChecked = true
// val cb2 = view2.findViewById<CheckBox>(R.id.item_cb_check)
// val cb1 = view1.findViewById<CheckBox>(R.id.item_cb_check)
// cb1.isChecked = true
viewPager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
override fun onPageScrolled(
......@@ -105,13 +104,13 @@ class ShareImageDialog(
}
override fun onPageSelected(position: Int) {
if (position == 0) {
cb1.isChecked = true
cb2.isChecked = false
} else {
cb1.isChecked = false
cb2.isChecked = true
}
// if (position == 0) {
// cb1.isChecked = true
// cb2.isChecked = false
// } else {
// cb1.isChecked = false
// cb2.isChecked = true
// }
}
override fun onPageScrollStateChanged(state: Int) {}
......@@ -150,25 +149,13 @@ class ShareImageDialog(
fun setShareAvatar(imgSrc: String) {
mViews.forEach {
val avatar = it.findViewById<ImageView>(R.id.item_iv_avatar)
GlideUtils.loadImageViewLoding(context, imgSrc, avatar, R.mipmap.ic_my, R.mipmap.ic_my)
}
}
fun setShareTitle(title: String) {
mViews.forEach {
it.findViewById<TextView>(R.id.item_tv_name).text = title
}
}
fun setShareContent(content: String) {
mViews.forEach {
it.findViewById<TextView>(R.id.item_tv_info).text = content
}
}
fun setShareContent(content: Spanned) {
mViews.forEach {
it.findViewById<TextView>(R.id.item_tv_info).text = content
GlideUtils.loadImageViewLoding(
context,
imgSrc,
avatar,
R.mipmap.ic_launcher_main,
R.mipmap.ic_launcher_main
)
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:background="@color/black"
android:orientation="vertical">
<include layout="@layout/header_layout" />
......@@ -27,7 +26,7 @@
android:layout_marginTop="30dp"
android:layout_marginBottom="15dp"
android:text="@string/app_name"
android:textColor="#454A69"
android:textColor="@color/white"
android:textSize="13sp" />
<ImageView
......@@ -37,23 +36,6 @@
android:layout_gravity="center_horizontal"
android:src="@mipmap/ic_launcher_main" />
<!-- <FrameLayout-->
<!-- android:layout_width="200dp"-->
<!-- android:layout_height="200dp">-->
<!-- <com.mingshu.goldcow.ui.widgets.RunHalfView-->
<!-- android:layout_width="200dp"-->
<!-- android:layout_height="200dp" />-->
<!-- <TextView-->
<!-- android:layout_margin="10dp"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:background="@color/white" />-->
<!-- </FrameLayout>-->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
......
......@@ -38,7 +38,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:src="@mipmap/ic_alipay" />
android:src="@mipmap/ic_upload_img" />
</FrameLayout>
......
......@@ -74,7 +74,7 @@
android:id="@+id/tv_share_img"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="20dp"
android:layout_marginEnd="15dp"
android:layout_weight="1"
android:background="@drawable/shape_share_btn"
android:elevation="2dp"
......@@ -88,7 +88,7 @@
android:id="@+id/tv_share_url"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="20dp"
android:layout_marginStart="15dp"
android:layout_weight="1"
android:background="@drawable/shape_share_btn"
android:elevation="2dp"
......@@ -419,10 +419,11 @@
android:overScrollMode="never"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</LinearLayout>
<View style="@style/view_bottom" />
</LinearLayout>
</LinearLayout>
</com.duben.roseplaylet.ui.widgets.ElasticScrollView>
</LinearLayout>
......@@ -200,8 +200,7 @@
android:gravity="center_vertical"
android:text="@string/str_secret"
android:textColor="@color/gray"
android:textSize="16sp"
app:drawableStartCompat="@mipmap/ic_text_clear" />
android:textSize="16sp" />
<TextView
android:id="@+id/tv_info_2"
......@@ -212,8 +211,7 @@
android:gravity="center_vertical"
android:text="@string/str_secret"
android:textColor="@color/gray"
android:textSize="16sp"
app:drawableStartCompat="@mipmap/ic_text_clear" />
android:textSize="16sp" />
<TextView
android:id="@+id/tv_info_3"
......@@ -224,8 +222,7 @@
android:gravity="center_vertical"
android:text="@string/str_secret"
android:textColor="@color/gray"
android:textSize="16sp"
app:drawableStartCompat="@mipmap/ic_text_clear" />
android:textSize="16sp" />
<TextView
android:id="@+id/tv_info_4"
......@@ -236,8 +233,7 @@
android:gravity="center_vertical"
android:text="@string/str_secret"
android:textColor="@color/gray"
android:textSize="16sp"
app:drawableStartCompat="@mipmap/ic_text_clear" />
android:textSize="16sp" />
<TextView
android:id="@+id/tv_info_5"
......@@ -248,8 +244,7 @@
android:gravity="center_vertical"
android:text="@string/str_secret"
android:textColor="@color/gray"
android:textSize="16sp"
app:drawableStartCompat="@mipmap/ic_text_clear" />
android:textSize="16sp" />
<TextView
android:id="@+id/tv_info_6"
......@@ -260,8 +255,7 @@
android:gravity="center_vertical"
android:text="@string/str_secret"
android:textColor="@color/gray"
android:textSize="16sp"
app:drawableStartCompat="@mipmap/ic_text_clear" />
android:textSize="16sp" />
<TextView
android:id="@+id/tv_info_7"
......@@ -272,8 +266,7 @@
android:gravity="center_vertical"
android:text="@string/str_secret"
android:textColor="@color/gray"
android:textSize="16sp"
app:drawableStartCompat="@mipmap/ic_text_clear" />
android:textSize="16sp" />
<TextView
android:id="@+id/tv_info_8"
......@@ -284,8 +277,7 @@
android:gravity="center_vertical"
android:text="@string/str_secret"
android:textColor="@color/gray"
android:textSize="16sp"
app:drawableStartCompat="@mipmap/ic_text_clear" />
android:textSize="16sp" />
</LinearLayout>
<TextView
......@@ -314,24 +306,22 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_height="40dp"
android:layout_gravity="bottom"
android:layout_marginBottom="30dp"
android:orientation="horizontal"
android:paddingStart="20dp"
android:paddingEnd="20dp">
<TextView
<ImageView
android:id="@+id/tv_wechat"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="15dp"
android:layout_weight="1"
android:background="@drawable/shape_profile_chat"
android:elevation="1dp"
android:gravity="center"
android:text="她的微信"
android:textColor="@color/color_0B0907"
android:scaleType="fitXY"
android:src="@mipmap/ic_button_wechat"
android:textSize="16sp" />
<TextView
......@@ -347,17 +337,16 @@
android:textColor="@color/color_0B0907"
android:textSize="16sp" />
<TextView
<ImageView
android:id="@+id/tv_chat"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:layout_weight="1"
android:background="@drawable/shape_profile_chat"
android:elevation="1dp"
android:gravity="center"
android:text="私聊"
android:textColor="@color/color_0B0907"
android:scaleType="fitXY"
android:src="@mipmap/ic_button_chat"
android:textSize="16sp" />
</LinearLayout>
......
......@@ -27,7 +27,7 @@
android:layout_margin="10dp"
android:background="@drawable/shape_bg_black"
android:elevation="2dp"
android:text="发布心情"
android:text="发布签名"
android:textColor="@color/white"
android:textStyle="bold" />
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:gravity="center"
android:orientation="vertical">
android:gravity="center">
<LinearLayout
<FrameLayout
android:id="@+id/ll_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/iv_avatar"
android:background="@drawable/shape_bg_profile_count"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="真人认证"
android:textColor="@color/white"
android:textSize="20sp" />
android:layout_height="wrap_content">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginTop="20dp"
android:src="@mipmap/ic_my_avat" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:paddingStart="30dp"
android:paddingEnd="30dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawablePadding="10dp"
android:text="认证图标"
android:textColor="@color/white"
android:textSize="16sp"
app:drawableStartCompat="@mipmap/ic_call_wx" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawablePadding="10dp"
android:text="优先推荐"
android:textColor="@color/white"
android:textSize="16sp"
app:drawableStartCompat="@mipmap/ic_call_wx" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:paddingStart="30dp"
android:paddingEnd="30dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawablePadding="10dp"
android:text="免费私聊男士"
android:textColor="@color/white"
android:textSize="16sp"
app:drawableStartCompat="@mipmap/ic_call_wx" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawablePadding="10dp"
android:text="免费发布动态"
android:textColor="@color/white"
android:textSize="16sp"
app:drawableStartCompat="@mipmap/ic_call_wx" />
</LinearLayout>
android:layout_height="400dp"
android:src="@mipmap/bg_real_auth" />
<TextView
android:id="@+id/tv_to_auth"
android:layout_width="260dp"
android:layout_height="45dp"
android:layout_marginTop="20dp"
android:layout_gravity="center_horizontal|bottom"
android:layout_marginBottom="30dp"
android:background="@drawable/shape_profile_chat"
android:gravity="center"
android:text="真人认证"
android:textColor="@color/black"
android:textSize="18sp" />
</LinearLayout>
</FrameLayout>
<ImageView
android:id="@+id/iv_close"
......
......@@ -67,7 +67,7 @@
android:paddingBottom="4dp"
android:text="复制"
android:textColor="@color/black"
android:textSize="16sp" />
android:textSize="14sp" />
</LinearLayout>
......
......@@ -69,8 +69,6 @@
android:textSize="12sp"
android:visibility="gone" />
<View style="@style/view_line_808080" />
<TextView
android:id="@+id/tvDialogShareNext"
android:layout_width="match_parent"
......
......@@ -9,11 +9,9 @@
<androidx.viewpager.widget.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="450dp"
android:layout_marginBottom="30dp"
android:layout_height="match_parent"
android:layout_marginBottom="180dp"
android:clipToPadding="false"
android:paddingStart="60dp"
android:paddingEnd="60dp"
app:layout_constraintBottom_toTopOf="@+id/linearLayout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
......@@ -22,8 +20,8 @@
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_tab_friends"
android:layout_height="150dp"
android:background="@drawable/shape_share"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
......@@ -53,7 +51,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="微信"
android:textColor="@color/black"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
......@@ -76,7 +74,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="朋友圈"
android:textColor="@color/black"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
......@@ -91,15 +89,13 @@
android:textSize="12sp"
android:visibility="gone" />
<View style="@style/line_3" />
<TextView
android:id="@+id/tvDialogShareNext"
android:layout_width="match_parent"
android:layout_height="40dp"
android:gravity="center"
android:text="取消"
android:textColor="@color/black"
android:textColor="@color/white"
android:textSize="18sp" />
</LinearLayout>
......
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f0f2f5">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@mipmap/bg_main"
app:layout_constraintTop_toTopOf="parent" />
android:background="@color/black"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
......@@ -27,16 +21,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_behavior=".ui.widgets.AppBarLayoutBehavior">
android:orientation="vertical">
<com.google.android.material.tabs.TabLayout
android:id="@+id/tablayout"
......@@ -54,14 +42,6 @@
app:tabPaddingStart="6dp"
app:tabRippleColor="@null" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/vp2"
android:layout_width="match_parent"
......@@ -69,25 +49,19 @@
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:id="@+id/ll_main_watching_root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_bg_black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
android:visibility="gone">
<ImageView
android:id="@+id/iv_main_watching_pic"
......@@ -161,5 +135,4 @@
android:textStyle="bold" />
</RelativeLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
\ No newline at end of file
......@@ -3,15 +3,16 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/black"
android:gravity="center_horizontal"
android:orientation="vertical">
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_recommend"
android:layout_marginTop="20dp"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_gravity="left"
android:layout_marginTop="20dp"
app:tabBackground="@null"
app:tabIndicatorHeight="0dp"
app:tabMode="scrollable"
......
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f0f2f5">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@mipmap/bg_main"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
android:layout_marginBottom="10dp"
android:text="剧场"
android:textColor="@color/black"
android:textSize="18sp"
android:textStyle="bold" />
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/srlMainPage"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
app:srlAccentColor="@color/black">
<com.scwang.smartrefresh.header.MaterialHeader
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_behavior=".ui.widgets.AppBarLayoutBehavior">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:contentScrim="@android:color/transparent"
app:layout_scrollFlags="scroll|enterAlwaysCollapsed">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -65,227 +25,21 @@
android:layout_width="match_parent"
android:layout_height="210dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="20dp"
android:layout_marginRight="16dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="18dp"
android:layout_marginRight="16dp"
android:background="@drawable/shape_bg_write"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:text="排行榜"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_main_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginTop="30dp"
android:layout_marginRight="4dp"
android:layout_marginBottom="10dp"
android:overScrollMode="never" />
</LinearLayout>
<FrameLayout
android:id="@+id/fl_main_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="15dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="15dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_marginLeft="16dp"
android:gravity="center"
android:text="分类"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout>
<com.google.android.material.tabs.TabLayout
android:id="@+id/tablayout"
android:layout_width="wrap_content"
android:layout_height="38dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:paddingTop="-10dp"
app:tabBackground="@null"
app:tabIndicatorHeight="0dp"
app:tabMaxWidth="200dp"
app:tabMinWidth="20dp"
app:tabMode="scrollable"
app:tabPaddingEnd="6dp"
app:tabPaddingStart="6dp"
app:tabRippleColor="@null" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/vp2"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_main_watching_root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_bg_black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<ImageView
android:id="@+id/iv_main_watching_pic"
android:layout_width="60dp"
android:layout_height="70dp"
android:layout_margin="5dp"
android:scaleType="fitXY" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/tv_main_watching_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:singleLine="true"
android:text="我去平行时空我去平行时空"
android:textColor="@color/white"
android:textSize="15sp" />
<TextView
android:id="@+id/tv_main_watching_text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="2dp"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_main_watching_text2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textColor="@color/graya"
android:textSize="10sp" />
</LinearLayout>
<RelativeLayout
android:layout_width="110dp"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_main_watching_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:padding="6dp"
android:src="@mipmap/ic_quit_white" />
<TextView
android:id="@+id/tv_main_watching_goto"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:background="@drawable/shape_red"
android:gravity="center"
android:paddingTop="8dp"
android:paddingBottom="10dp"
android:text="继续观看"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />
</RelativeLayout>
</LinearLayout>
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/iv_kefu_main"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="120dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:lottie_autoPlay="true"
app:lottie_fileName="main_alipay.json"
app:lottie_loop="true" />
<LinearLayout
android:id="@+id/ll_lucky"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_marginBottom="120dp"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<ImageView
android:id="@+id/iv_lucky_gif"
android:layout_width="80dp"
android:layout_height="70dp"
android:src="@mipmap/ic_get_mobile" />
<TextView
android:id="@+id/tv_lucky_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:background="@drawable/shape_bg_black2"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="0/5"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
\ No newline at end of file
......@@ -38,7 +38,6 @@
android:id="@+id/tv_clear_noread"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="清除未读"
android:textColor="@color/white" />
......@@ -48,7 +47,8 @@
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="清除列表"
android:textColor="@color/white" />
android:textColor="@color/white"
android:visibility="gone" />
</LinearLayout>
......
......@@ -191,13 +191,31 @@
</LinearLayout>
<ImageView
android:id="@+id/ll_my_vip"
android:id="@+id/iv_my_vip"
android:layout_width="match_parent"
android:layout_height="80dp"
android:orientation="vertical"
android:scaleType="fitXY"
android:src="@mipmap/ic_my_vip_label" />
<RelativeLayout
android:id="@+id/rl_my_vip"
android:layout_width="match_parent"
android:layout_height="80dp"
android:visibility="gone">
<TextView
android:id="@+id/tv_vip_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginStart="20dp"
android:layout_marginBottom="15dp"
android:text="到期时间"
android:textColor="@color/color_31343B"
android:textSize="16sp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
......@@ -376,11 +394,11 @@
android:orientation="horizontal"
android:visibility="gone">
<!-- <ImageView-->
<!-- android:layout_width="25dp"-->
<!-- android:layout_height="25dp"-->
<!-- android:layout_marginEnd="10dp"-->
<!-- android:src="@mipmap/ic_my_wechat" />-->
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginEnd="10dp"
android:src="@mipmap/ic_my_wechat" />
<TextView
android:layout_width="0dp"
......
......@@ -4,25 +4,10 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@mipmap/bg_main"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="70dp"
android:layout_marginStart="@dimen/dp_10"
android:paddingTop="20dp"
android:src="@mipmap/ic_enjoy_label" />
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/srl_enjoy"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="70dp"
android:layout_height="wrap_content"
app:srlAccentColor="@color/black"
app:srlPrimaryColor="#f0f2f5">
......@@ -30,25 +15,36 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<FrameLayout
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.youth.banner.Banner
android:id="@+id/banner"
android:layout_width="match_parent"
android:layout_height="210dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="10dp"
android:layout_marginRight="16dp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_enjoy"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="14dp"
android:layout_marginTop="10dp"
android:layout_marginRight="14dp"
android:minHeight="800dp"
android:overScrollMode="never" />
</FrameLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<com.scwang.smartrefresh.layout.footer.ClassicsFooter
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srlAccentColor="@color/black"
app:srlPrimaryColor="#f0f2f5" />
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</FrameLayout>
\ No newline at end of file
......@@ -33,20 +33,14 @@
android:textColor="@color/white"
android:textSize="18sp" />
<TextView
<ImageView
android:id="@+id/tv_real_label"
android:layout_width="wrap_content"
android:layout_width="55dp"
android:layout_height="20dp"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:layout_toEndOf="@id/tv_recommend_name"
android:background="@drawable/shape_green"
android:gravity="center"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:text="真人"
android:textColor="@color/white"
android:textSize="12sp" />
android:src="@mipmap/ic_label_real" />
<TextView
android:id="@+id/tv_recommend_info"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="70dp"
android:layout_marginTop="20dp"
android:src="@mipmap/icon_list_null" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="暂无数据"
android:textColor="@color/graya"
android:textSize="14sp" />
</LinearLayout>
\ No newline at end of file
......@@ -41,7 +41,7 @@
android:layout_marginTop="4dp"
android:lines="2"
android:text="我去平行时空"
android:textColor="@color/black"
android:textColor="@color/white"
android:textSize="13sp" />
<TextView
......
......@@ -9,67 +9,61 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
<RelativeLayout
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_margin="6dp"
android:background="@drawable/shape_gold_card"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="20dp"
android:padding="6dp">
<com.duben.roseplaylet.ui.widgets.CircleImageView
android:id="@+id/item_iv_avatar"
android:layout_width="34dp"
android:layout_height="34dp"
android:layout_centerVertical="true"
app:layout_constraintBottom_toBottomOf="@+id/item_iv_qrcode"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_toEndOf="@id/item_iv_avatar"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/item_iv_qrcode"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="@+id/item_iv_avatar"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/item_tv_name"
android:id="@+id/tv_share_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:lines="1"
android:textColor="@color/black"
android:textSize="11sp" />
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:textColor="@color/color_F6DA8F"
android:textStyle="bold" />
<ImageView
android:id="@+id/item_iv_qrcode"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_below="@id/tv_share_code"
android:src="@mipmap/ic_launcher_main" />
<ImageView
android:id="@+id/item_iv_avatar"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_below="@id/tv_share_code"
android:layout_alignParentEnd="true"
android:src="@mipmap/ic_launcher_main" />
<TextView
android:id="@+id/item_tv_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:textSize="8sp" />
android:layout_below="@id/item_iv_qrcode"
android:layout_alignStart="@id/item_iv_qrcode"
android:layout_alignEnd="@id/item_iv_qrcode"
android:layout_marginTop="5dp"
android:text="扫码下载"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:id="@+id/item_iv_qrcode"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/item_iv_avatar"
android:layout_alignStart="@id/item_iv_avatar"
android:layout_alignEnd="@id/item_iv_avatar"
android:layout_marginTop="5dp"
android:text="@string/app_name"
android:textColor="@color/white"
android:textSize="12sp" />
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
</com.duben.roseplaylet.ui.widgets.CornerView>
......@@ -81,6 +75,7 @@
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:buttonTint="@color/color_FF9837"
android:clickable="false" />
android:clickable="false"
android:visibility="gone" />
</FrameLayout>
\ No newline at end of file
......@@ -57,7 +57,7 @@
android:ellipsize="end"
android:maxLines="1"
android:text="重回80年代"
android:textColor="@color/black"
android:textColor="@color/white"
app:layout_constraintStart_toStartOf="@id/image_iv"
app:layout_constraintTop_toBottomOf="@id/image_iv" />
......
......@@ -61,6 +61,14 @@
android:text="@string/app_name"
android:textColor="@color/white" />
<ImageView
android:id="@+id/iv_real_label"
android:layout_width="55dp"
android:layout_height="20dp"
android:layout_marginStart="10dp"
android:src="@mipmap/ic_label_real"
android:visibility="gone" />
<TextView
android:id="@+id/tv_label_vip"
android:layout_width="wrap_content"
......@@ -76,21 +84,6 @@
android:textSize="12sp"
android:visibility="gone" />
<TextView
android:id="@+id/tv_label_auth"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:background="@drawable/shape_label_auth"
android:paddingStart="10dp"
android:paddingTop="2dp"
android:paddingEnd="10dp"
android:paddingBottom="2dp"
android:text="真人"
android:textColor="@color/color_159823"
android:textSize="12sp"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
......@@ -129,7 +122,7 @@
android:visibility="gone" />
<TextView
android:id="@+id/tv_label_distance"
android:id="@+id/tv_label_distance_male"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
......@@ -140,6 +133,19 @@
android:paddingBottom="2dp"
android:text="172cm"
android:textColor="@color/color_E5C565"
android:textSize="12sp"
android:visibility="gone" />
<TextView
android:id="@+id/tv_label_distance_female"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:paddingStart="6dp"
android:paddingTop="2dp"
android:paddingEnd="6dp"
android:paddingBottom="2dp"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
......
......@@ -15,8 +15,7 @@
android:id="@+id/iv_head_back"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginStart="10dp"
android:src="@mipmap/ic_arrow_white"
android:src="@mipmap/ic_profile_back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/v_bar" />
......@@ -51,20 +50,20 @@
<ImageView
android:id="@+id/iv_head_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="10dp"
android:src="@mipmap/ic_label_right"
android:src="@mipmap/ic_profile_more"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/v_bar" />
<ImageView
android:id="@+id/iv_head_share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="10dp"
android:src="@mipmap/ic_label_right"
android:src="@mipmap/ic_profile_share"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/iv_head_more"
app:layout_constraintTop_toBottomOf="@id/v_bar" />
......
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