Commit 8b1b7a54 authored by jyx's avatar jyx

代码优化

parent 7815a1d6
......@@ -47,7 +47,7 @@ public class TUIC2CChatFragment extends TUIBaseChatFragment {
initView();
TUIChatConfigClassic.hideItemsWhenLongPressMessage(TUIChatConfigClassic.SELECT);
// TUIChatConfigClassic.hideItemsWhenLongPressMessage(TUIChatConfigClassic.SELECT);
return baseView;
}
......
......@@ -3,6 +3,7 @@ package com.tencent.qcloud.tuikit.tuiconversation;
import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import com.google.auto.service.AutoService;
import com.tencent.imsdk.v2.V2TIMConversation;
import com.tencent.imsdk.v2.V2TIMConversationListener;
......@@ -28,6 +29,7 @@ import com.tencent.qcloud.tuikit.tuiconversation.commonutil.TUIConversationLog;
import com.tencent.qcloud.tuikit.tuiconversation.interfaces.ConversationEventListener;
import com.tencent.qcloud.tuikit.tuiconversation.interfaces.ConversationGroupNotifyListener;
import com.tencent.qcloud.tuikit.tuiconversation.presenter.ConversationPresenter;
import java.lang.ref.SoftReference;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -131,10 +133,12 @@ public class TUIConversationService implements TUIInitializer, ITUIService, ITUI
if (!TextUtils.isEmpty(chatId)) {
conversationEventListener.setConversationTop(chatId, isTop, new IUIKitCallback<Void>() {
@Override
public void onSuccess(Void data) {}
public void onSuccess(Void data) {
}
@Override
public void onError(String module, int errCode, String errMsg) {}
public void onError(String module, int errCode, String errMsg) {
}
});
}
} else if (TextUtils.equals(TUIConstants.TUIConversation.METHOD_GET_TOTAL_UNREAD_COUNT, method)) {
......
......@@ -63,6 +63,11 @@ public class TUIConversationFragment extends Fragment {
return presenter;
}
protected ConversationPresenter getProvider() {
return presenter;
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
......
......@@ -208,6 +208,9 @@ public class ConversationPresenter {
}
protected void onLoadConversationCompleted(List<ConversationInfo> conversationInfoList) {
for (ConversationInfo conversationInfo : conversationInfoList) {
System.out.println("AAAAAAAAAA" + conversationInfo.getConversationId());
}
onNewConversation(conversationInfoList, false);
if (adapter != null) {
adapter.onLoadingStateChanged(false);
......
......@@ -272,7 +272,9 @@
<activity
android:name=".ui.activitys.C2CIMActivity"
android:exported="false"
android:screenOrientation="portrait" />
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustNothing|stateHidden" />
<activity
android:name=".ui.activitys.CommonDataActivity"
......
......@@ -15,6 +15,7 @@ import com.bumptech.glide.request.RequestOptions
import com.bumptech.glide.request.target.SimpleTarget
import com.bumptech.glide.request.transition.Transition
import com.bumptech.glide.signature.ObjectKey
import com.duben.roseplaylet.R
import com.duben.roseplaylet.utils.BubbleUtils
import jp.wasabeef.glide.transformations.BlurTransformation
......@@ -230,15 +231,36 @@ object GlideUtils {
}
fun loadThumbImageView(context: Context, path: String?, mImageView: ImageView) {
Glide.with(context).load("$path?x-oss-process=image/resize,p_20").into(mImageView)
Glide.with(context).load("$path?x-oss-process=image/resize,p_20")
.apply(
RequestOptions().placeholder(R.mipmap.ic_my_avat)
.error(R.mipmap.ic_my_avat)
).into(mImageView)
}
//默认加载
fun loadThumbRoundImageView(mContext: Context, path: String?, mImageView: ImageView) {
fun loadThumbRoundImageView(
mContext: Context,
path: String?,
mImageView: ImageView,
defaultImage: Int = R.mipmap.ic_my_avat
) {
Glide.with(mContext).load("$path?x-oss-process=image/resize,p_20").apply(
RequestOptions().transform(
CenterCrop(),
RoundedCorners(BubbleUtils.dp2px(10))
).placeholder(defaultImage)
.error(defaultImage)
).dontAnimate().into(mImageView)
}
//默认加载
fun loadHighRoundImageView(mContext: Context, path: String?, mImageView: ImageView) {
Glide.with(mContext).load(path).apply(
RequestOptions().transform(
CenterCrop(), RoundedCorners(BubbleUtils.dp2px(10))
)
).placeholder(R.mipmap.ic_my_avat)
.error(R.mipmap.ic_my_avat)
).dontAnimate().into(mImageView)
}
}
\ No newline at end of file
......@@ -66,7 +66,7 @@ class FaceVerifyHelper private constructor() {
data.putString(WbCloudFaceContant.COMPARE_TYPE, WbCloudFaceContant.ID_CARD)
//sdk log开关,默认关闭,debug调试sdk问题的时候可以打开,打开日志开关需要外部存储权限
//【特别注意】上线前请务必关闭sdk log开关!!!
data.putBoolean(WbCloudFaceContant.IS_ENABLE_LOG, true)
data.putBoolean(WbCloudFaceContant.IS_ENABLE_LOG, false)
Log.d(TAG, "WbCloudFaceVerifySdk initSdk")
//【特别注意】请使用activity context拉起sdk
//【特别注意】请在主线程拉起sdk!
......
......@@ -5,17 +5,22 @@ import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.view.LayoutInflater
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.duben.library.net.neterror.BaseSubscriber
import com.duben.library.net.neterror.Throwable
import com.duben.roseplaylet.MintsApplication
import com.duben.roseplaylet.R
import com.duben.roseplaylet.mvp.model.BaseResponse
import com.duben.roseplaylet.mvp.model.IM_MSG
import com.duben.roseplaylet.ui.activitys.C2CIMActivity
import com.duben.roseplaylet.utils.LogUtil
import com.duben.roseplaylet.utils.RxBus
import com.duben.roseplaylet.utils.ToastUtil
import com.duben.roseplaylet.utils.UcropUtils
import com.google.gson.JsonObject
import com.tencent.imsdk.v2.V2TIMConversation
import com.tencent.imsdk.v2.V2TIMManagerImpl
import com.tencent.imsdk.v2.V2TIMValueCallback
import com.tencent.qcloud.tuicore.TUIConfig
import com.tencent.qcloud.tuicore.TUIConstants
import com.tencent.qcloud.tuicore.interfaces.TUICallback
......@@ -68,13 +73,18 @@ class IMHelper private constructor() {
val appContext = MintsApplication.getContext()
//隐藏更多菜单中选项(全局)
TUIChatConfigClassic.hideItemsInMoreMenu(TUIChatConfigClassic.CUSTOM)
TUIChatConfigClassic.hideItemsInMoreMenu(
TUIChatConfigClassic.CUSTOM,
TUIChatConfigClassic.FILE
)
//设置会话列表、cell 背景色
TUIConversationConfigClassic.setListBackground(ColorDrawable(appContext.resources.getColor(R.color.color_07060C)))
TUIConversationConfigClassic.setCellBackground(ColorDrawable(appContext.resources.getColor(R.color.color_07060C)))
TUIConversationConfigClassic.setPinnedCellBackground(
ColorDrawable(appContext.resources.getColor(R.color.color_07060C))
)
// 设置会话列表、圆角半径
TUIConversationConfigClassic.setAvatarCornerRadius(100)
//展示在线状态 -旗舰版能用
//TUIConversationConfigClassic.setShowUserOnlineStatusIcon(true)
//展示未读红点
......@@ -84,18 +94,40 @@ class IMHelper private constructor() {
// TUIChatConfigClassic.setMessageReadReceiptNeeded(true)
//设置系统通知消息文字的字体、颜色和背景色,针对所有系统通知消息生效
TUIChatConfigClassic.setSystemMessageTextColor(Color.WHITE)
TUIChatConfigClassic.setSystemMessageFontSize(23)
TUIChatConfigClassic.setSystemMessageFontSize(22)
TUIChatConfigClassic.setSystemMessageBackground(
ColorDrawable(appContext.resources.getColor(R.color.color_07060C))
)
// 用户头像大小、圆角半径
TUIConfigClassic.setMessageListAvatarSize(120)
TUIConfigClassic.setMessageListAvatarRadius(120)
// 聊天界面背景色
TUIChatConfigClassic.setBackground(ColorDrawable(appContext.resources.getColor(R.color.color_07060C)))
TUIConfigClassic.setSendBubbleBackground(appContext.resources.getDrawable(R.drawable.shape_bg_market))
TUIConfigClassic.setReceiveBubbleBackground(appContext.resources.getDrawable(R.drawable.shape_bg_market))
TUIChatConfigClassic.setSendTextMessageColor(Color.WHITE)
TUIChatConfigClassic.setReceiveTextMessageColor(Color.BLACK)
TUIConfigClassic.setSendBubbleBackground(
ContextCompat.getDrawable(appContext, R.drawable.shape_chat_bubble_right)
)
TUIConfigClassic.setReceiveBubbleBackground(
ContextCompat.getDrawable(appContext, R.drawable.shape_chat_bubble_left)
)
TUIChatConfigClassic.setSendTextMessageColor(
ContextCompat.getColor(appContext, R.color.color_F9F9F9)
)
TUIChatConfigClassic.setReceiveTextMessageColor(
ContextCompat.getColor(appContext, R.color.color_15141A)
)
TUIChatConfigClassic.hideItemsWhenLongPressMessage(
TUIChatConfigClassic.REPLY,
TUIChatConfigClassic.QUOTE,
TUIChatConfigClassic.EMOJI_REACTION,
TUIChatConfigClassic.PIN,
TUIChatConfigClassic.RECALL,
TUIChatConfigClassic.TRANSLATE,
TUIChatConfigClassic.CONVERT,
TUIChatConfigClassic.FORWARD,
TUIChatConfigClassic.SELECT,
TUIChatConfigClassic.SPEAKER_MODE_SWITCH
)
setCustomTopView("")
}
......@@ -115,6 +147,7 @@ class IMHelper private constructor() {
object : TUICallback() {
override fun onSuccess() {
LogUtil.i("LoginWrapper ", "imLogin onSuccess")
getUnreadMsgCount()
}
override fun onError(errorCode: Int, errorMessage: String) {
......@@ -126,6 +159,21 @@ class IMHelper private constructor() {
})
}
fun getUnreadMsgCount() {
V2TIMManagerImpl.getConversationManager()
.getTotalUnreadMessageCount(object : V2TIMValueCallback<Long> {
override fun onSuccess(t: Long?) {
val imMsg = IM_MSG()
imMsg.unReadMsgCount = t
RxBus.getDefault().post(imMsg)
}
override fun onError(code: Int, desc: String?) {
}
})
}
private fun setCustomTopView(wxCode: String) {
val tipsView = LayoutInflater.from(MintsApplication.getContext())
.inflate(R.layout.custom_tips_view, null)
......
package com.duben.roseplaylet.manager
import android.content.Intent
import android.os.Handler
import android.os.Looper
import com.duben.roseplaylet.MintsApplication
import com.duben.roseplaylet.ui.activitys.BasicUserProfileActivity
import com.duben.roseplaylet.ui.activitys.VipActivity
import com.duben.roseplaylet.ui.widgets.RealAuthDialog
import com.duben.roseplaylet.utils.ToastUtil
......@@ -45,8 +46,11 @@ class UserHelper private constructor() {
}
fun showRealAuthDialog() {
Handler(Looper.getMainLooper()).post {
// 主线程
RealAuthDialog(ActivityPageManager.getInstance().currentActivity).show()
}
}
fun receiveErrorCode(code: Int) {
val appContext = MintsApplication.getContext()
......
......@@ -46,6 +46,15 @@ public class HallList implements Serializable {
private int likeStatus;
private boolean vip;
private boolean online;
private String tagsCommon;
public String getTagsCommon() {
return tagsCommon;
}
public void setTagsCommon(String tagsCommon) {
this.tagsCommon = tagsCommon;
}
public boolean isOnline() {
return online;
......
package com.duben.roseplaylet.mvp.model
data class IM_MSG(
var unReadMsgCount: Long? = 0L
)
......@@ -8,6 +8,7 @@ import com.duben.roseplaylet.mvp.model.SharePageMsg
import com.duben.roseplaylet.mvp.model.ShareRankList
import com.duben.roseplaylet.mvp.views.InviteView
import com.google.gson.JsonObject
import java.util.HashMap
class InvitePresenter : BasePresenter<InviteView>() {
......@@ -44,6 +45,41 @@ class InvitePresenter : BasePresenter<InviteView>() {
})
}
fun updateRuserShareCode(shareCode: String) {
val vo = HashMap<String, Any>()
vo["shareCode"] = shareCode
AppHttpManager.getInstance(loanApplication)
.call(loanService.updateRuserShareCode(vo),
object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.showToast(e.message)
view.updateRuserShareCodeFail()
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> {
view.updateRuserShareCodeSuc()
}
else -> {
view.showToast(message)
view.updateRuserShareCodeFail()
}
}
}
})
}
fun getShareOrders() {
AppHttpManager.getInstance(loanApplication)
......
......@@ -16,4 +16,7 @@ interface InviteView : BaseView {
fun getRuserShareCodeSuc(data: Any)
fun getRuserShareCodeSucFail()
fun updateRuserShareCodeSuc()
fun updateRuserShareCodeFail()
}
\ No newline at end of file
......@@ -115,6 +115,10 @@ class BasicUserProfileActivity : BaseActivity(), View.OnClickListener, BasicUser
return
}
if (avatarUrl.isNullOrEmpty()) {
avatarUrl = ""
}
basicUserProfilePresenter.initBasicInfo("$age-1-1", nickname, sex, avatarUrl!!)
}
}
......
......@@ -75,14 +75,6 @@ class C2CIMActivity : TUIBaseChatActivity() {
chatView.viewline.visibility = View.GONE
chatView.inputView.setBgColor(resources.getColor(R.color.color_171619))
if (UserManager.getInstance().userSex == 1) {
// 默认不能聊天
chatView.inputView.setInterceptTouchEvent(true)
chatView.inputView.setOnClickListener {
showUnlockWechatDialog()
}
}
val titleBarLayout = chatView.titleBar
titleBarLayout.setBgColor(resources.getColor(R.color.color_15141A))
titleBarLayout.middleTitle.setTextColor(Color.WHITE)
......@@ -115,12 +107,18 @@ class C2CIMActivity : TUIBaseChatActivity() {
}
else -> {
setCustomTopView("****")
setUserCanChat(false)
}
}
}
override fun onError(e: Throwable?) {}
override fun onError(e: Throwable?) {
setUserCanChat(false)
}
})
} else {
// 女性用户和男性聊天
hideCustomView()
}
}
......@@ -150,6 +148,7 @@ class C2CIMActivity : TUIBaseChatActivity() {
}
private fun setUserCanChat(canChat: Boolean) {
if (UserManager.getInstance().userSex == 2) return
val chatView = chatFragment.chatView
if (!canChat) {
// 不能聊天
......@@ -162,6 +161,14 @@ class C2CIMActivity : TUIBaseChatActivity() {
}
}
private fun hideCustomView() {
val customNoticeLayout = TUIChatConfigs.getNoticeLayoutConfig().customNoticeLayout
val tvInfo = customNoticeLayout.findViewById<TextView>(R.id.tv_info)
val rlWxInfo = customNoticeLayout.findViewById<RelativeLayout>(R.id.rl_wx_info)
rlWxInfo.visibility = View.GONE
tvInfo.visibility = View.GONE
}
private fun setCustomTopView(wxCode: String) {
val customNoticeLayout = TUIChatConfigs.getNoticeLayoutConfig().customNoticeLayout
val tvWxNo = customNoticeLayout.findViewById<TextView>(R.id.tv_wx_no)
......
......@@ -6,6 +6,7 @@ import android.content.Intent
import android.content.pm.ActivityInfo
import android.graphics.Color
import android.os.Bundle
import android.text.InputType
import android.text.TextUtils
import android.view.View
import android.widget.EditText
......@@ -54,7 +55,7 @@ import java.io.File
class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileView {
private lateinit var ivAvatar: ImageView
private lateinit var tvNickname: EditText
private lateinit var etNickname: EditText
private lateinit var tvSign: TextView
private lateinit var tvAge: TextView
private lateinit var tvJob: TextView
......@@ -164,7 +165,13 @@ class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileVie
xhdnstzAdapter?.setNewInstance(tagsList.toCollection(ArrayList()))
}
GlideUtils.loadThumbImageView(this@EditProfileActivity, it.headerUrl, ivAvatar)
tvNickname.setText("" + it.nickName)
if (!it.nickName.isNullOrEmpty()) {
etNickname.setText("" + it.nickName)
etNickname.setSelection(it.nickName!!.length)
} else {
etNickname.hint = "请填写您的昵称"
etNickname.setText("")
}
tvSign.text = it.introduce
tvAge.text = it.birthday
tvJob.text = it.career
......@@ -179,8 +186,11 @@ class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileVie
layout_wechat.visibility = View.VISIBLE
layout_wechat.findViewById<TextView>(R.id.label_start).text = "微信账号"
etWechat = layout_wechat.findViewById(R.id.label_et)
if (!TextUtils.isEmpty("")) {
etWechat.setText("")
etWechat.inputType = InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
if (!TextUtils.isEmpty(userProfileData?.infoWechat)) {
etWechat.setText(userProfileData?.infoWechat)
etWechat.setText("" + userProfileData?.infoWechat)
etWechat.setSelection(userProfileData?.infoWechat!!.length)
} else {
etWechat.hint = "请填写您的微信号"
etWechat.setText("")
......@@ -190,8 +200,8 @@ class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileVie
layout_sx.visibility = View.VISIBLE
layout_sx.findViewById<TextView>(R.id.label_start).text = UserProfile.PROFILE_SX.str
tvSx = layout_sx.findViewById(R.id.label_tv)
if (!TextUtils.isEmpty("")) {
tvSx.text = ""
if (!TextUtils.isEmpty(userProfileData?.appearance)) {
tvSx.text = userProfileData?.appearance
} else {
tvSx.text = "请选择您的身形"
}
......@@ -204,7 +214,7 @@ class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileVie
layout_jyjm.findViewById<TextView>(R.id.label_start).text = UserProfile.PROFILE_JYJM.str
tvJyjm = layout_jyjm.findViewById(R.id.label_tv)
if (!TextUtils.isEmpty(userProfileData?.interest)) {
tvJyjm.text = ""
tvJyjm.text = userProfileData?.interest
} else {
tvJyjm.text = "请选择您的交友节目"
}
......@@ -253,11 +263,11 @@ class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileVie
// 昵称
layout_nickname.findViewById<TextView>(R.id.label_start).text = "昵称"
tvNickname = layout_nickname.findViewById(R.id.label_et)
etNickname = layout_nickname.findViewById(R.id.label_et)
if (!TextUtils.isEmpty("")) {
tvNickname.setText("")
etNickname.setText("")
} else {
tvNickname.hint = "请填写您的昵称"
etNickname.hint = "请填写您的昵称"
}
// 个性签名
......@@ -548,9 +558,17 @@ class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileVie
R.id.iv_left_icon -> finish()
R.id.tv_save -> {
// 保存资料
userProfileData?.let { editProfilePresenter.setUserInfo(it) }
userProfileData?.let {
if (etWechat.text.toString().isNotEmpty()) {
it.infoWechat = etWechat.text.toString()
}
if (etNickname.text.toString().isNotEmpty()) {
it.nickName = etNickname.text.toString()
}
editProfilePresenter.setUserInfo(it)
}
}
R.id.layout_xhdnstz -> {
val bundle = Bundle()
bundle.putBoolean(Constant.IS_LIKE_FEMALE_LABEL, true)
......@@ -560,16 +578,13 @@ class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileVie
bundle
)
}
R.id.layout_avatar -> {
showAlbum()
}
R.id.layout_gxqm -> {
// 个性签名
readyGoForResult(WriteSignatureActivity::class.java, Constant.EDIT_PROFILE_CODE)
}
R.id.layout_nl -> {
val defaultValue = if (TextUtils.isEmpty(userProfileData?.age)) {
"2000"
......@@ -578,11 +593,9 @@ class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileVie
}
showPickDialog(UserProfile.PROFILE_NL.str, defaultValue)
}
R.id.layout_zy -> {
showJobPick()
}
R.id.layout_sg -> {
val defaultValue = if (TextUtils.isEmpty(userProfileData?.userHeight)) {
"165CM"
......@@ -591,7 +604,6 @@ class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileVie
}
showPickDialog(UserProfile.PROFILE_SG.str, defaultValue)
}
R.id.layout_tz -> {
val defaultValue = if (TextUtils.isEmpty(userProfileData?.bodyWeight)) {
"50KG"
......@@ -600,19 +612,15 @@ class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileVie
}
showPickDialog(UserProfile.PROFILE_TZ.str, defaultValue)
}
R.id.layout_sx -> {
showPickDialog(UserProfile.PROFILE_SX.str, userProfileData?.appearance)
}
R.id.layout_jyfw -> {
showAddressDialog()
}
R.id.layout_jyjm -> {
showPickDialog(UserProfile.PROFILE_JYJM.str, userProfileData?.findCity)
}
R.id.layout_gxbq -> {
readyGoForResult(UserLabelActivity::class.java, Constant.USER_LABEL_REQUEST_CODE)
}
......@@ -722,6 +730,7 @@ class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileVie
}
avatarUrl = imgPath!!
GlideUtils.loadThumbImageView(mContext, avatarUrl, ivAvatar)
userProfileData?.headerUrl = avatarUrl
}
}
})
......@@ -749,11 +758,9 @@ class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileVie
}
}
}
UCrop.RESULT_ERROR -> {
showToast("裁剪失败,请再试一下")
}
Constant.USER_LABEL_REQUEST_CODE -> {
val sbLabel = data?.getStringExtra(Constant.USER_LABEL_DATA)
userProfileData?.tagsCommon = sbLabel
......@@ -763,7 +770,6 @@ class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileVie
gxbqAdapter?.setNewInstance(tagsList.toCollection(ArrayList()))
}
}
Constant.LIKE_FEMALE_LABEL_REQUEST_CODE -> {
val sbLabel = data?.getStringExtra(Constant.USER_LABEL_DATA)
userProfileData?.findDescribe = sbLabel
......@@ -773,7 +779,6 @@ class EditProfileActivity : BaseActivity(), View.OnClickListener, EditProfileVie
xhdnstzAdapter?.setNewInstance(tagsList.toCollection(ArrayList()))
}
}
Constant.EDIT_PROFILE_CODE -> {
val signature = data?.getStringExtra(Constant.EDIT_PROFILE_SIGNATURE_STR)
userProfileData?.introduce = signature
......
package com.duben.roseplaylet.ui.activitys
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.media.AudioManager
import android.net.Uri
import android.os.Bundle
......@@ -9,14 +11,21 @@ import android.view.KeyEvent
import android.view.View
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentTransaction
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.duben.roseplaylet.R
import com.duben.roseplaylet.common.AppConfig
import com.duben.roseplaylet.common.Constant
import com.duben.roseplaylet.manager.UserHelper
import com.duben.roseplaylet.mvp.model.IM_MSG
import com.duben.roseplaylet.ui.activitys.base.BaseActivity
import com.duben.roseplaylet.ui.fragment.*
import com.duben.roseplaylet.ui.fragment.FirstFragment
import com.duben.roseplaylet.ui.fragment.MessageFragment
import com.duben.roseplaylet.ui.fragment.MyFragment
import com.duben.roseplaylet.ui.fragment.SquareFragment
import com.duben.roseplaylet.ui.widgets.DialogListener
import com.duben.roseplaylet.ui.widgets.PhoneDialog
import com.duben.roseplaylet.utils.RxBus
import com.tencent.qcloud.tuicore.TUIConstants
import kotlinx.android.synthetic.main.activity_main.*
/**
......@@ -63,6 +72,8 @@ class MainActivity : BaseActivity(), View.OnClickListener {
tab_tv_video.isSelected = true
// tab_iv_invite.isSelected = true
// tab_tv_invite.isSelected = true
initUnreadCountReceiver()
}
override fun isApplyKitKatTranslucency(): Boolean {
......@@ -71,6 +82,14 @@ class MainActivity : BaseActivity(), View.OnClickListener {
override fun onDestroy() {
super.onDestroy()
if (unreadCountReceiver != null) {
LocalBroadcastManager.getInstance(this).unregisterReceiver(
unreadCountReceiver!!
)
unreadCountReceiver = null
}
currentFragment = null
audioManager = null
}
......@@ -255,4 +274,36 @@ class MainActivity : BaseActivity(), View.OnClickListener {
phoneDialog!!.show()
}
private var unreadCountReceiver: BroadcastReceiver? = null
private fun initUnreadCountReceiver() {
unreadCountReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
setUnreadView(intent.getLongExtra(TUIConstants.UNREAD_COUNT_EXTRA, 0))
}
}
val unreadCountFilter = IntentFilter()
unreadCountFilter.addAction(TUIConstants.CONVERSATION_UNREAD_COUNT_ACTION)
LocalBroadcastManager.getInstance(this)
.registerReceiver(unreadCountReceiver!!, unreadCountFilter)
RxBus.getDefault().toObservable(IM_MSG::class.java)
.subscribe {
setUnreadView(it.unReadMsgCount)
}
}
private fun setUnreadView(count: Long?) {
if (count == null) return
if (count > 99) {
unread_view.visibility = View.VISIBLE
unread_view.text = "99+"
} else if (count > 0) {
unread_view.visibility = View.VISIBLE
unread_view.text = "" + count
} else {
unread_view.visibility = View.GONE
}
}
}
\ No newline at end of file
......@@ -95,6 +95,13 @@ class ShareActivity : BaseActivity(), View.OnClickListener, InviteView {
when (v?.id) {
R.id.iv_left_icon -> finish()
R.id.tv_bind -> {
if (TextUtils.isEmpty(et_code.text)) {
showToast("请填写邀请码!")
return
}
invitePresenter.updateRuserShareCode(et_code.text.toString())
}
R.id.tv_share_img -> {
shareImgDialog()
}
......@@ -110,6 +117,7 @@ class ShareActivity : BaseActivity(), View.OnClickListener, InviteView {
private fun initListener() {
iv_left_icon.setOnClickListener(this)
tv_bind.setOnClickListener(this)
tv_copy.setOnClickListener(this)
tv_share_img.setOnClickListener(this)
tv_share_url.setOnClickListener(this)
......@@ -135,7 +143,6 @@ class ShareActivity : BaseActivity(), View.OnClickListener, InviteView {
shareDialog.setOnShareOKListener(object : ShareImageDialog.OnShareOKListener {
override fun onShareOk() {}
})
shareDialog.setShareAvatar("https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/ic_my_coin.png")
shareDialog.show()
}
......@@ -198,4 +205,15 @@ class ShareActivity : BaseActivity(), View.OnClickListener, InviteView {
override fun getRuserShareCodeSucFail() {
}
override fun updateRuserShareCodeSuc() {
showToast("绑定邀请码成功!")
et_code.isEnabled = false
}
override fun updateRuserShareCodeFail() {
et_code.isEnabled = true
et_code.setText("")
showToast("绑定邀请码失败!")
}
}
......@@ -152,6 +152,12 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
val bundle = Bundle()
bundle.putString(VipActivity.OTHER_USER_ID, "" + it.uid)
readyGo(VipActivity::class.java, bundle)
return
}
if (UserManager.getInstance().userSex == 2 && UserManager.getInstance().idcardStatus == 2) {
showToast("正在认证审核中")
return
}
var toLikeStatus = 0
......@@ -178,6 +184,9 @@ class UserProfileActivity : BaseActivity(), View.OnClickListener, UserProfileVie
if (UserManager.getInstance().idcardStatus == 1) {
// 直接聊
IMHelper.instance.startChatActivity("" + it.uid)
} else if (UserManager.getInstance().idcardStatus == 2) {
showToast("正在认证审核中")
return
} else {
// 女性 弹出认证弹框
UserHelper.instance.showRealAuthDialog()
......
......@@ -21,6 +21,7 @@ import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import com.duben.roseplaylet.utils.StatusBarUtil;
import com.gyf.barlibrary.ImmersionBar;
import com.duben.roseplaylet.MintsApplication;
import com.duben.roseplaylet.R;
......@@ -52,13 +53,16 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
} else if (
TextUtils.equals(getClass().getSimpleName(), "VideoActivity")
) {
setLightStatusBar();
StatusBarUtil.transparencyBar(this); //设置状态栏全透明
// setLightStatusBar();
} else {
// setDarkStatusBar();
StatusBarUtil.transparencyBar(this); //设置状态栏全透明
StatusBarUtil.StatusBarLightMode(this); //设置白底黑字
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
getWindow().setNavigationBarColor(Color.TRANSPARENT);
getWindow().setNavigationBarColor(Color.BLACK);
}
} catch (Exception e) {
e.printStackTrace();
......
......@@ -32,14 +32,16 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou
override fun convert(holder: BaseViewHolder, item: HallList.ListDTO) {
holder.getView<TextView>(R.id.tv_recommend_name).text = item.nickName
if (item.distance.isEmpty()) {
if (!item.distance.isNullOrEmpty()) {
holder.getView<TextView>(R.id.tv_recommend_location).text = "" + item.distance + "km"
} else {
holder.getView<TextView>(R.id.tv_recommend_location).text = ""
holder.getView<TextView>(R.id.tv_recommend_location).text = "未知"
}
if (UserManager.getInstance().userSex == 2) {
// 用户是男的,看的只有女的
// 用户是女的,看的只有男的
holder.getView<LinearLayout>(R.id.ll_recommend_root)
.setBackgroundResource(R.drawable.shape_bg_black2)
if (item.isVip) {
holder.getView<TextView>(R.id.tv_recommend_vip).visibility = View.VISIBLE
} else {
......@@ -55,19 +57,31 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou
GlideUtils.loadThumbRoundImageView(
holder.itemView.context,
item.headerUrl,
holder.getView(R.id.iv_recommend_header)
holder.getView(R.id.iv_recommend_header),
R.mipmap.ic_default_avatar_rect
)
holder.getView<TextView>(R.id.tv_recommend_age).visibility = View.VISIBLE
holder.getView<TextView>(R.id.tv_recommend_age).text = "" + item.age + "岁"
holder.getView<TextView>(R.id.tv_recommend_label1).text = item.birthday
// if (item.)
if (item.career.isEmpty()) {
if (!item.age.isNullOrEmpty()) {
holder.getView<TextView>(R.id.tv_recommend_age).text = "" + item.age + "岁"
} else {
holder.getView<TextView>(R.id.tv_recommend_age).text = "未知"
}
if (!item.tagsCommon.isNullOrEmpty()) {
val array: Array<String> = gson.fromJson(item.tagsCommon, Array<String>::class.java)
if (array.isNotEmpty()) {
holder.getView<TextView>(R.id.tv_recommend_label1).text = array[0]
} else {
holder.getView<TextView>(R.id.tv_recommend_label1).visibility = View.INVISIBLE
}
} else {
holder.getView<TextView>(R.id.tv_recommend_label1).visibility = View.INVISIBLE
}
if (!item.career.isNullOrEmpty()) {
holder.getView<TextView>(R.id.tv_recommend_label2).text = item.career
} else {
holder.getView<TextView>(R.id.tv_recommend_label2).text = "无"
holder.getView<TextView>(R.id.tv_recommend_label2).visibility = View.INVISIBLE
}
} else {
if (isBlur) {
......@@ -85,7 +99,8 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou
GlideUtils.loadThumbRoundImageView(
holder.itemView.context,
item.headerUrl,
holder.getView(R.id.iv_recommend_header)
holder.getView(R.id.iv_recommend_header),
R.mipmap.ic_default_avatar_rect
)
holder.getView<LinearLayout>(R.id.ll_album).visibility = View.VISIBLE
......
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 androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.duben.library.utils.GlideUtils;
import com.duben.roseplaylet.R;
import com.youth.banner.adapter.BannerAdapter;
import java.util.List;
/**
* 自定义布局,图片+标题
*/
public class SquareImageAdapter extends BannerAdapter<Integer, SquareImageAdapter.ImageHolder> {
private Context context;
public SquareImageAdapter(List<Integer> mDatas) {
super(mDatas);
}
@Override
public ImageHolder onCreateHolder(ViewGroup parent, int viewType) {
context = parent.getContext();
return new ImageHolder(LayoutInflater.from(context).inflate(R.layout.banner_image, parent, false));
}
@Override
public void onBindView(ImageHolder holder, Integer data, int position, int size) {
GlideUtils.INSTANCE.loadImageViewNoAnim(context, data, holder.imageView);
}
public class ImageHolder extends RecyclerView.ViewHolder {
public ImageView imageView;
public ImageHolder(@NonNull View view) {
super(view);
imageView = view.findViewById(R.id.image);
}
}
}
package com.duben.roseplaylet.ui.fragment
import com.tencent.imsdk.v2.*
import com.tencent.qcloud.tuikit.tuiconversation.classicui.page.TUIConversationFragment
class CustomConversationFragment : TUIConversationFragment() {
......@@ -7,6 +8,20 @@ class CustomConversationFragment : TUIConversationFragment() {
override fun setCustomSetting() {
super.setCustomSetting()
// V2TIMManager.getInstance()
// .getUsersInfo(
// listOf("2502118394201300019", "2502113523501101196", "2501415013401700043"),
// object : V2TIMValueCallback<List<V2TIMUserFullInfo>> {
// override fun onSuccess(v2TIMUserFullInfos: List<V2TIMUserFullInfo>) {
//// val result = v2TIMUserFullInfos[0]
// v2TIMUserFullInfos.forEach {
// println("AAAAAAAAAA" + it.faceUrl)
// }
// }
//
// override fun onError(code: Int, desc: String) {
// }
// })
}
}
\ No newline at end of file
......@@ -11,6 +11,7 @@ import com.duben.roseplaylet.common.AppConfig
import com.duben.roseplaylet.common.Constant
import com.duben.roseplaylet.ui.adapter.MsgPageAdapter
import com.duben.roseplaylet.ui.fragment.base.LazyLoadBaseFragment
import com.duben.roseplaylet.utils.LogUtil
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator
import kotlinx.android.synthetic.main.fragment_main_message.*
......
......@@ -132,8 +132,14 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
override fun getBaseMsgSuc(data: UserBean) {
toUid = data.idcode
tv_my_nickname.text = data.nickName
tv_my_label.text = "" + data.age + " " + data.city
if (!data.age.isNullOrEmpty()) {
tv_my_label.text = "" + data.age
}
if (!data.city.isNullOrEmpty()) {
tv_my_label.text = tv_my_label.text.toString() + "" + data.city
}
tv_my_id.text = "ID:" + data.idcode
GlideUtils.loadThumbImageView(requireContext(), data.headerUrl, civ_my_avatar)
if (data.expireTime > 0) {
......@@ -146,8 +152,8 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
"到期时间 ${TimeRender.formatDate(data.expireTime, TimeRender.DEFAULT_FORMAT)}"
}
} else {
rl_my_vip.visibility = View.VISIBLE
iv_my_vip.visibility = View.GONE
rl_my_vip.visibility = View.GONE
iv_my_vip.visibility = View.VISIBLE
}
if (data.sex == 1) {
......
......@@ -19,9 +19,11 @@ import com.duben.roseplaylet.MintsApplication
import com.duben.roseplaylet.R
import com.duben.roseplaylet.common.AppConfig
import com.duben.roseplaylet.common.Constant
import com.duben.roseplaylet.manager.UserManager
import com.duben.roseplaylet.mvp.model.*
import com.duben.roseplaylet.mvp.presenters.SquarePresenter
import com.duben.roseplaylet.mvp.views.SquareView
import com.duben.roseplaylet.ui.activitys.VipActivity
import com.duben.roseplaylet.ui.adapter.*
import com.duben.roseplaylet.ui.fragment.base.LazyLoadBaseFragment
import com.duben.roseplaylet.utils.AppPreferencesManager
......@@ -42,7 +44,7 @@ class SquareFragment : LazyLoadBaseFragment(), SquareView, View.OnClickListener
private val squarePresenter by lazy { SquarePresenter() }
private val bannerList = mutableListOf<BannerBean>()
private val bannerList = mutableListOf<Int>()
private val tabsData = mutableListOf<String>()
private var vpAdapter: SquarePageAdapter? = null
......@@ -50,10 +52,26 @@ class SquareFragment : LazyLoadBaseFragment(), SquareView, View.OnClickListener
override fun initViewsAndEvents() {
initVp()
initBanner()
initLocation()
tv_location.setOnClickListener(this)
}
private fun initBanner() {
bannerList.add(R.mipmap.bg_banner1)
bannerList.add(R.mipmap.bg_banner2)
bannerList.add(R.mipmap.bg_banner3)
banner.addBannerLifecycleObserver(this)
.setAdapter(SquareImageAdapter(bannerList))
.setOnBannerListener { data, position ->
if (position == 0 && !UserManager.getInstance().vipFlag) {
readyGo(VipActivity::class.java)
} else {
}
}
}
override fun onFragmentFirstVisible() {
super.onFragmentFirstVisible()
squarePresenter.attachView(this)
......@@ -63,10 +81,14 @@ class SquareFragment : LazyLoadBaseFragment(), SquareView, View.OnClickListener
super.onFragmentResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_TWO) {
banner?.start()
// squarePresenter.topTabs()
}
}
override fun onFragmentPause() {
super.onFragmentPause()
banner?.stop()
}
override fun onDestroy() {
super.onDestroy()
mLocationClient?.stopLocation()
......@@ -135,25 +157,6 @@ class SquareFragment : LazyLoadBaseFragment(), SquareView, View.OnClickListener
}
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]
if (banner.createType == 4) {
} else {
// TODO
}
}
}
}
private fun initLocation() {
......
......@@ -16,9 +16,11 @@ import com.duben.roseplaylet.mvp.presenters.SquarePresenter
import com.duben.roseplaylet.mvp.views.SquareView
import com.duben.roseplaylet.ui.activitys.UserProfileActivity
import com.duben.roseplaylet.ui.adapter.SquareAdapter
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import kotlinx.android.synthetic.main.fragment_square_list.*
class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListener {
class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListener,
OnRefreshListener {
companion object {
private const val SQUARE_TYPE = "SQUARE_TYPE"
......@@ -57,17 +59,7 @@ class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListene
override fun onFragmentFirstVisible() {
super.onFragmentFirstVisible()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_TWO) {
hotPage = 1
srl_square.resetNoMoreData()
squarePresenter.getHallList(mType, hotPage, hotPageSize)
}
}
fun onRefresh() {
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_TWO) {
hotPage = 1
srl_square.resetNoMoreData()
squarePresenter.getHallList(mType, hotPage, hotPageSize)
srl_square.autoRefresh()
}
}
......@@ -104,7 +96,8 @@ class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListene
}
private fun initListener() {
srl_square.setEnableRefresh(false)
srl_square.setEnableRefresh(true)
srl_square.setOnRefreshListener(this)
srl_square.setOnLoadMoreListener(this)
}
......@@ -140,4 +133,9 @@ class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListene
}
override fun getHallListFail() {}
override fun onRefresh(refreshLayout: RefreshLayout) {
hotPage = 1
squarePresenter.getHallList(mType, hotPage, hotPageSize)
}
}
\ No newline at end of file
......@@ -3,7 +3,6 @@ package com.duben.roseplaylet.ui.widgets
import android.app.Dialog
import android.content.Context
import android.view.*
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import cn.sharesdk.framework.Platform
......@@ -16,8 +15,6 @@ 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.*
import kotlin.concurrent.schedule
......@@ -60,15 +57,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)
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)
view1.findViewById<ImageView>(R.id.item_iv_qrcode).setImageBitmap(QRCode)
view2.findViewById<ImageView>(R.id.item_iv_qrcode).setImageBitmap(QRCode)
llDialogShareWx.setOnClickListener {
shareWechat()
}
......@@ -101,7 +89,8 @@ class ShareDialog(context: Context, private val shareUrl: String) :
private fun shareWechat() {
val wechatSp = ShareParams()
wechatSp.shareType = Platform.SHARE_WEBPAGE
wechatSp.text = Constant.MINTS_APP_NAME
wechatSp.title = Constant.MINTS_APP_NAME + "APP"
wechatSp.comment = "同城看剧高端小圈子"
wechatSp.url = shareUrl
if (ConstantUtil.isInstall(context, "com.tencent.mm")) {
wechat.platformActionListener = object : PlatformActionListener {
......
......@@ -3,7 +3,6 @@ package com.duben.roseplaylet.ui.widgets
import android.app.Dialog
import android.content.Context
import android.graphics.Bitmap
import android.text.TextUtils
import android.view.*
import android.widget.ImageView
import android.widget.LinearLayout
......@@ -17,7 +16,6 @@ import cn.sharesdk.wechat.friends.Wechat
import cn.sharesdk.wechat.moments.WechatMoments
import com.duben.library.utils.ConstantUtil
import com.duben.library.utils.GlideUtils
import com.duben.roseplaylet.BuildConfig
import com.duben.roseplaylet.MintsApplication
import com.duben.roseplaylet.R
import com.duben.roseplaylet.ui.adapter.SharePagerAdapter
......@@ -33,10 +31,13 @@ class ShareImageDialog(
shareCode: String,
) : Dialog(context, R.style.dialog) {
companion object {
const val IMG_BG_URL = "https://mints-web.mints-id.com/web/app/rose/share1.jpg"
}
private val llDialogShareWx: LinearLayout
private val llDialogShareQq: LinearLayout
private val tvDialogShareNext: TextView
private val tvDialogShareTips: TextView
private var mOnShareOKListener: OnShareOKListener? = null
private var mOnShareCompleteListener: OnShareCompleteListener? = null
......@@ -70,7 +71,6 @@ class ShareImageDialog(
llDialogShareWx = findViewById<View>(R.id.llDialogShareWx) as LinearLayout
llDialogShareQq = findViewById<View>(R.id.llDialogShareQq) as LinearLayout
tvDialogShareNext = findViewById<View>(R.id.tvDialogShareNext) as TextView
tvDialogShareTips = findViewById<View>(R.id.tvDialogShareTips) as TextView
viewPager = findViewById(R.id.view_pager)
viewPager.pageMargin = BubbleUtils.dp2px(30)
......@@ -78,23 +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)
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)
GlideUtils.loadHighRoundImageView(
context,
IMG_BG_URL,
view1.findViewById(R.id.item_iv_bg)
)
view1.findViewById<ImageView>(R.id.item_iv_qrcode).setImageBitmap(QRCode)
view1.findViewById<ImageView>(R.id.item_iv_avatar)
.setImageResource(R.mipmap.ic_launcher_main)
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)
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
viewPager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
override fun onPageScrolled(
position: Int,
......@@ -103,15 +102,7 @@ class ShareImageDialog(
) {
}
override fun onPageSelected(position: Int) {
// if (position == 0) {
// cb1.isChecked = true
// cb2.isChecked = false
// } else {
// cb1.isChecked = false
// cb2.isChecked = true
// }
}
override fun onPageSelected(position: Int) {}
override fun onPageScrollStateChanged(state: Int) {}
......@@ -146,35 +137,15 @@ class ShareImageDialog(
fun onShareComplete()
}
fun setShareAvatar(imgSrc: String) {
mViews.forEach {
val avatar = it.findViewById<ImageView>(R.id.item_iv_avatar)
GlideUtils.loadImageViewLoding(
context,
imgSrc,
avatar,
R.mipmap.ic_launcher_main,
R.mipmap.ic_launcher_main
)
}
}
fun setShareWithNoWechatFavoiter(flag: Boolean) {
if (flag) {
llDialogShareWx.visibility = View.GONE
}
}
fun setShareTips(tips: String) {
if (!TextUtils.isEmpty(tips)) {
tvDialogShareTips.visibility = View.VISIBLE
tvDialogShareTips.text = tips
}
}
private fun shareWechat() {
val currentItem = viewPager.currentItem
val child = mViews[currentItem].findViewById<View>(R.id.item_iv_bg)
val child = mViews[currentItem].findViewById<View>(R.id.item_container)
child.isDrawingCacheEnabled = true
child.drawingCacheQuality = View.DRAWING_CACHE_QUALITY_HIGH
child.buildDrawingCache()
......@@ -210,7 +181,7 @@ class ShareImageDialog(
private fun shareWechatFavoite() {
val currentItem = viewPager.currentItem
val child = mViews[currentItem].findViewById<View>(R.id.item_iv_bg)
val child = mViews[currentItem].findViewById<View>(R.id.item_container)
child.isDrawingCacheEnabled = true
child.drawingCacheQuality = View.DRAWING_CACHE_QUALITY_HIGH
child.buildDrawingCache()
......
......@@ -25,8 +25,8 @@ public class QRCodeUtil {
try {
Hashtable<EncodeHintType, Object> hints = new Hashtable<>();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
hints.put(EncodeHintType.MARGIN, 1);
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.Q);
hints.put(EncodeHintType.MARGIN, 0);
BitMatrix bitMatrix = new QRCodeWriter().encode(text,
BarcodeFormat.QR_CODE, size, size, hints);
......@@ -41,11 +41,11 @@ public class QRCodeUtil {
}
}
Bitmap bitmap = Bitmap.createBitmap(size, size,
Bitmap.Config.RGB_565);
Bitmap.Config.ARGB_8888);
bitmap.setPixels(pixels, 0, size, 0, 0, size, size);
// Bitmap zoomBitmap = zoomBitmap(bitmap, size, size);
// bitmap.recycle();
return bitmap;
Bitmap zoomBitmap = zoomBitmap(bitmap, size, size);
bitmap.recycle();
return zoomBitmap;
} catch (WriterException e) {
e.printStackTrace();
return null;
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:bottomLeftRadius="10dp"
android:bottomRightRadius="10dp"
android:topLeftRadius="0dp"
android:topRightRadius="10dp" />
<solid android:color="@color/color_F9F9F9" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:bottomLeftRadius="10dp"
android:bottomRightRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="0dp" />
<solid android:color="@color/color_ebcfad" />
</shape>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 实心 -->
<solid android:color="@color/black" />
<solid android:color="@color/color_252429" />
<corners
android:topLeftRadius="20dp"
android:topRightRadius="20dp" />
......
......@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#aa0c224b" />
<solid android:color="@color/white" />
<!-- 边缘线的宽度和颜色 -->
<stroke
......
......@@ -2,7 +2,8 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
android:background="@color/color_15141A"
android:fitsSystemWindows="true">
<FrameLayout
android:id="@+id/chat_fragment_container"
......
......@@ -28,19 +28,18 @@
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
<RelativeLayout
android:id="@+id/tab_rl_video"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.0"
android:gravity="center"
android:orientation="vertical">
android:layout_weight="1.0">
<ImageView
android:id="@+id/tab_iv_video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:contentDescription="@null"
android:src="@drawable/selector_tab_video" />
......@@ -48,49 +47,51 @@
android:id="@+id/tab_tv_video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tab_iv_video"
android:layout_centerHorizontal="true"
android:text="剧场"
android:textColor="@color/item_text_sel"
android:textSize="16sp" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
<RelativeLayout
android:id="@+id/tab_rl_square"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.0"
android:gravity="center"
android:orientation="vertical">
android:layout_weight="1.0">
<ImageView
android:id="@+id/tab_iv_square"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:contentDescription="@null"
android:src="@drawable/selector_tab_share" />
android:src="@drawable/selector_tab_square" />
<TextView
android:id="@+id/tab_tv_square"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tab_iv_square"
android:layout_centerHorizontal="true"
android:text="广场"
android:textColor="@color/item_text_sel"
android:textSize="16sp" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
<RelativeLayout
android:id="@+id/tab_rl_invite"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.0"
android:gravity="center"
android:orientation="vertical">
android:layout_weight="1.0">
<ImageView
android:id="@+id/tab_iv_invite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:contentDescription="@null"
android:src="@drawable/selector_tab_share" />
......@@ -98,24 +99,26 @@
android:id="@+id/tab_tv_invite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tab_iv_invite"
android:layout_centerHorizontal="true"
android:text="邀请有奖"
android:textColor="@color/item_text_sel"
android:textSize="16sp" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
<RelativeLayout
android:id="@+id/tab_rl_msg"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.0"
android:gravity="center"
android:orientation="vertical">
android:layout_weight="1">
<ImageView
android:id="@+id/tab_iv_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:contentDescription="@null"
android:src="@drawable/selector_tab_msg" />
......@@ -123,24 +126,39 @@
android:id="@+id/tab_tv_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tab_iv_msg"
android:layout_centerHorizontal="true"
android:text="消息"
android:textColor="@color/item_text_sel"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
<com.tencent.qcloud.tuikit.timcommon.component.UnreadCountTextView
android:id="@+id/unread_view"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_alignTop="@id/tab_iv_msg"
android:layout_marginTop="-5dp"
android:layout_toEndOf="@id/tab_iv_msg"
android:gravity="center"
android:minWidth="15dp"
android:minHeight="15dp"
android:textColor="@color/white"
android:textSize="12sp"
android:visibility="gone" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/tab_rl_my"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.0"
android:gravity="center"
android:orientation="vertical">
android:layout_weight="1.0">
<ImageView
android:id="@+id/tab_iv_my"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:contentDescription="@null"
android:src="@drawable/selector_tab_my" />
......@@ -148,10 +166,12 @@
android:id="@+id/tab_tv_my"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tab_iv_my"
android:layout_centerHorizontal="true"
android:text="我的"
android:textColor="@color/item_text_sel"
android:textSize="16sp" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
......
......@@ -21,11 +21,10 @@
<LinearLayout
android:id="@+id/ll_step_progress"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_marginStart="60dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:layout_marginEnd="60dp"
android:gravity="center_vertical"
android:orientation="horizontal">
......@@ -40,11 +39,10 @@
android:textSize="18sp" />
<View
android:layout_width="0dp"
android:layout_width="15dp"
android:layout_height="1dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:layout_weight="1"
android:background="@color/color_818181" />
<TextView
......@@ -58,11 +56,10 @@
android:textSize="18sp" />
<View
android:layout_width="0dp"
android:layout_width="15dp"
android:layout_height="1dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:layout_weight="1"
android:background="@color/color_818181" />
<TextView
......@@ -76,11 +73,10 @@
android:textSize="18sp" />
<View
android:layout_width="0dp"
android:layout_width="15dp"
android:layout_height="1dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:layout_weight="1"
android:background="@color/color_818181" />
<TextView
......
......@@ -2,7 +2,8 @@
<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:layout_height="match_parent"
android:background="@color/color_232122">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY" />
</RelativeLayout>
\ No newline at end of file
......@@ -12,15 +12,15 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="400dp"
android:layout_height="360dp"
android:src="@mipmap/bg_real_auth" />
<TextView
android:id="@+id/tv_to_auth"
android:layout_width="260dp"
android:layout_width="220dp"
android:layout_height="45dp"
android:layout_gravity="center_horizontal|bottom"
android:layout_marginBottom="30dp"
android:layout_marginBottom="20dp"
android:background="@drawable/shape_profile_chat"
android:gravity="center"
android:text="真人认证"
......
......@@ -19,7 +19,8 @@
android:layout_below="@id/iv_avatar"
android:background="@drawable/shape_bg_profile_count"
android:gravity="center_horizontal"
android:orientation="vertical">
android:orientation="vertical"
android:paddingBottom="30dp">
<TextView
android:id="@+id/tv_nickname"
......@@ -84,13 +85,13 @@
android:layout_width="260dp"
android:layout_height="45dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="30dp"
android:background="@drawable/shape_bg_hall_btn2"
android:gravity="center"
android:text="发送我的社交账号给TA"
android:textColor="@color/color_9F6A32"
android:textSize="16sp"
android:textStyle="bold" />
android:textStyle="bold"
android:visibility="gone" />
</LinearLayout>
......
......@@ -7,6 +7,15 @@
android:background="@drawable/shape_share"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:text="分享到"
android:textColor="@color/white"
android:textSize="20sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="110dp"
......@@ -24,14 +33,14 @@
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_share_wx" />
android:src="@mipmap/ic_share_wechat" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginTop="10dp"
android:text="微信"
android:textColor="@color/white"
android:textColor="@color/color_929297"
android:textSize="14sp" />
</LinearLayout>
......@@ -47,14 +56,14 @@
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:src="@mipmap/ic_wx_friends" />
android:src="@mipmap/ic_share_moment" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginTop="10dp"
android:text="朋友圈"
android:textColor="@color/white"
android:textColor="@color/color_929297"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
......@@ -72,7 +81,8 @@
<TextView
android:id="@+id/tvDialogShareNext"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_height="50dp"
android:background="@color/color_2D2D2D"
android:gravity="center"
android:text="取消"
android:textColor="@color/white"
......
......@@ -20,7 +20,7 @@
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_height="160dp"
android:background="@drawable/shape_share"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
......@@ -44,14 +44,14 @@
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/ic_share_wx" />
android:src="@mipmap/ic_share_wechat" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginTop="10dp"
android:text="微信"
android:textColor="@color/white"
android:textColor="@color/color_929297"
android:textSize="14sp" />
</LinearLayout>
......@@ -72,29 +72,20 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginTop="10dp"
android:text="朋友圈"
android:textColor="@color/white"
android:textColor="@color/color_929297"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/tvDialogShareTips"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:gravity="center"
android:text="取消"
android:textSize="12sp"
android:visibility="gone" />
<TextView
android:id="@+id/tvDialogShareNext"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_height="50dp"
android:gravity="center"
android:text="取消"
android:background="@color/color_2D2D2D"
android:textColor="@color/white"
android:textSize="18sp" />
......
......@@ -32,14 +32,16 @@
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:orientation="horizontal">
android:orientation="horizontal"
android:paddingEnd="20dp">
<TextView
android:id="@+id/tv_clear_noread"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="清除未读"
android:textColor="@color/white" />
android:textColor="@color/white"
android:visibility="gone" />
<TextView
android:id="@+id/tv_clear_list"
......
......@@ -34,8 +34,8 @@
<com.duben.roseplaylet.ui.widgets.CircleImageView
android:id="@+id/civ_my_avatar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="70dp"
android:layout_height="70dp"
android:src="@mipmap/ic_my_avat" />
<TextView
......
......@@ -5,12 +5,18 @@
android:layout_height="match_parent">
<com.duben.roseplaylet.ui.widgets.CornerView
android:id="@+id/item_iv_bg"
android:id="@+id/item_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/item_iv_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY" />
<RelativeLayout
android:layout_width="150dp"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="20dp"
......@@ -21,21 +27,22 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:layout_marginBottom="20dp"
android:textColor="@color/color_F6DA8F"
android:textSize="18sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/item_iv_qrcode"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_below="@id/tv_share_code"
android:src="@mipmap/ic_launcher_main" />
android:padding="1dp" />
<ImageView
android:id="@+id/item_iv_avatar"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_below="@id/tv_share_code"
android:layout_alignParentEnd="true"
android:src="@mipmap/ic_launcher_main" />
......@@ -47,11 +54,11 @@
android:layout_alignStart="@id/item_iv_qrcode"
android:layout_alignEnd="@id/item_iv_qrcode"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="扫码下载"
android:textColor="@color/white"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -59,6 +66,7 @@
android:layout_alignStart="@id/item_iv_avatar"
android:layout_alignEnd="@id/item_iv_avatar"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="@string/app_name"
android:textColor="@color/white"
android:textSize="12sp" />
......
......@@ -20,8 +20,8 @@
<ImageView
android:id="@+id/iv_recommend_header"
android:layout_width="100dp"
android:layout_height="130dp"
android:layout_width="120dp"
android:layout_height="120dp"
android:src="@mipmap/ic_my_avat" />
<TextView
......@@ -38,7 +38,6 @@
android:textSize="12sp"
android:visibility="gone" />
</FrameLayout>
<FrameLayout
......@@ -47,7 +46,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="130dp"
android:layout_height="120dp"
android:orientation="vertical">
<RelativeLayout
......@@ -128,7 +127,8 @@
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textColor="@color/color_DB6572"
android:textSize="12sp" />
android:textSize="12sp"
android:visibility="invisible" />
<TextView
android:id="@+id/tv_recommend_label2"
......@@ -141,7 +141,8 @@
android:paddingRight="8dp"
android:singleLine="true"
android:textColor="@color/color_DB6572"
android:textSize="12sp" />
android:textSize="12sp"
android:visibility="invisible" />
</LinearLayout>
......@@ -170,7 +171,7 @@
<LinearLayout
android:id="@+id/ll_album"
android:layout_width="match_parent"
android:layout_height="46dp"
android:layout_height="36dp"
android:layout_marginStart="10dp"
android:layout_marginTop="6dp"
android:orientation="horizontal"
......@@ -178,25 +179,25 @@
<ImageView
android:id="@+id/iv_photo1"
android:layout_width="46dp"
android:layout_height="46dp" />
android:layout_width="36dp"
android:layout_height="36dp" />
<ImageView
android:id="@+id/iv_photo2"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginStart="4dp" />
<FrameLayout
android:id="@+id/fl_photo_more"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginStart="4dp">
<ImageView
android:id="@+id/iv_photo_more"
android:layout_width="46dp"
android:layout_height="46dp" />
android:layout_width="36dp"
android:layout_height="36dp" />
<TextView
android:id="@+id/tv_more"
......@@ -212,9 +213,10 @@
android:id="@+id/tv_status"
android:layout_width="match_parent"
android:layout_height="46dp"
android:gravity="center_vertical|end"
android:gravity="bottom|end"
android:text="近日活跃"
android:textColor="@color/color_E4C46C" />
android:textColor="@color/color_E4C46C"
android:textSize="10sp" />
</LinearLayout>
......
......@@ -7,12 +7,12 @@
android:background="@drawable/shape_toast_bg"
android:gravity="center"
android:minWidth="200dp"
android:paddingBottom="10dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="10dp"
android:textColor="@color/white"
android:textSize="14sp">
android:paddingRight="20dp"
android:paddingBottom="10dp"
android:textColor="@color/black"
android:textSize="16sp">
</TextView>
\ No newline at end of file
......@@ -103,7 +103,9 @@
<color name="color_FFE9CF">#FFE9CF</color>
<color name="color_929297">#929297</color>
<color name="color_1F1F1E">#1F1F1E</color>
<color name="color_323334">#323334</color>
<color name="color_ebcfad">#ebcfad</color>
<color name="color_2D2D2D">#2D2D2D</color>
<color name="color_252429">#252429</color>
......
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