Compare commits

..

5 Commits

Author SHA1 Message Date
max
d5aa2f0ae3 feat:调整版本号 2024-07-05 17:04:58 +08:00
max
8ae56821c3 feat:私聊、公聊、房间、支持垃圾字检测 2024-07-05 16:59:34 +08:00
max
4a2b2b4c33 feat:调整启动背景-logo 2024-07-05 10:51:53 +08:00
max
f644db76da feat:配置云信-安全通ID 2024-07-05 10:27:04 +08:00
max
f00b2344d5 feat:修改启动页背景 2024-07-05 10:26:41 +08:00
154 changed files with 1227 additions and 2388 deletions

4
.gitmodules vendored
View File

@@ -1,4 +0,0 @@
[submodule "modules/module_google"]
path = modules/module_google
url = https://e.coding.net/chwllive/peko/peko-android-gms.git
branch = molistar

View File

@@ -221,6 +221,7 @@ dependencies {
api "com.jzxiang.pickerview:TimePickerDialog:1.0.1"
api "com.github.zyyoona7:EasyPopup:1.0.2"
api "com.github.donkingliang:LabelsView:1.6.5"
api "com.github.yyued:SVGAPlayer-Android:2.6.1"
api "com.ms-square:expandableTextView:0.1.4"
annotationProcessor 'androidx.annotation:annotation:1.6.0'

View File

@@ -943,12 +943,6 @@
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustNothing" />
<activity
android:windowSoftInputMode="adjustPan"
android:name=".ui.feedback.FeedbackActivity"
android:screenOrientation="portrait" />
<activity android:name=".ui.debug.DebugActivity"
android:screenOrientation="portrait"/>
</application>
</manifest>

View File

@@ -325,9 +325,7 @@ public class App extends BaseApp {
BasicConfig.INSTANCE.setVoiceDir(Constants.VOICE_DIR);
BasicConfig.INSTANCE.setCacheDir(Constants.CACHE_DIR);
BasicConfig.INSTANCE.setImageDir(Constants.IMAGE_CACHE_DIR);
// TODO 临时调整
com.example.lib_utils.log.LogUtil.INSTANCE.setConsolePrinterEnabled(true);
// com.example.lib_utils.log.LogUtil.INSTANCE.setConsolePrinterEnabled(BuildConfig.DEBUG);
com.example.lib_utils.log.LogUtil.INSTANCE.setConsolePrinterEnabled(BuildConfig.DEBUG);
}
/**
@@ -486,6 +484,7 @@ public class App extends BaseApp {
ChannelModel.get();
MarketVerifyModel.get();
GiftModel.get();
GiftModel.get().tryLoadGiftList();
// 模厅
HallDataManager.get().application();
//全局处理

View File

@@ -42,7 +42,6 @@ import com.alibaba.fastjson.JSONObject;
import com.chwl.app.notify.RoomNotifyManager;
import com.chwl.app.ui.webview.baishun.BaiShunGameWebFragment;
import com.chwl.app.ui.webview.baishun.IBaiShunGameListener;
import com.chwl.library.widget.SVGAView;
import com.chwl.core.monsterhunting.bean.MonsterDataBean;
import com.chwl.core.room.game.bean.BaiShunGameConfig;
import com.chwl.core.support.room.AudioRoomContext;
@@ -178,15 +177,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
private static final String TAG = "AVRoomActivity";
private static final int SHOW_RED_DIALOG_MAX = 10;
public static boolean isPKModel = false;
private static SVGAView.SVGACache svgaCache;
public static SVGAView.SVGACache getSvgaCache() {
if (svgaCache == null) {
svgaCache = SVGAView.newCache(20);
}
return svgaCache;
}
/**
* 管理限制进房
*/
@@ -909,10 +899,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
GiftModel.get().cancelCountDownTimer();
EventBus.getDefault().unregister(this);
DemoCache.saveBoolean("FirstCharge", false);
if (svgaCache != null) {
svgaCache.clear();
}
svgaCache = null;
super.onDestroy();
}

View File

@@ -15,12 +15,8 @@ import androidx.annotation.Nullable;
import androidx.lifecycle.Observer;
import androidx.recyclerview.widget.RecyclerView;
import com.chwl.app.avroom.activity.AVRoomActivity;
import com.chwl.app.utils.AvatarHelper;
import com.chwl.library.widget.SVGAView;
import com.chwl.core.utils.extension.StringExtensionKt;
import com.coorchice.library.SuperTextView;
import com.example.lib_utils.StringUtils2;
import com.netease.nim.uikit.common.util.string.StringUtil;
import com.opensource.svgaplayer.SVGAImageView;
import com.chwl.app.R;
@@ -149,7 +145,7 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
SVGAImageView ivHalo;
@Nullable
SVGAView ivHeadWear;
ImageView ivHeadWear;
@Nullable
ImageView ivCharmLevelTag;
@@ -175,9 +171,6 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
ivUpImage.setOnClickListener(this);
ivLockImage.setOnClickListener(this);
ivAvatar.setOnClickListener(this);
if (ivHeadWear != null) {
ivHeadWear.bindCache(AVRoomActivity.getSvgaCache());
}
}
public void clear() {
@@ -283,7 +276,6 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
private void clearHeadWear() {
if (ivHeadWear == null) return;
ivHeadWear.clearAnimation();
ivHeadWear.stopAnimation();
ivHeadWear.setImageDrawable(null);
ivHeadWear.setTag(R.id.mic_item_head_wear, null);
ivHeadWear.setVisibility(View.GONE);
@@ -307,13 +299,10 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
private void updateNobleView(MicMemberInfo chatRoomMember) {
if (ivHeadWear == null) return;
String headWear = chatRoomMember.getHeadWearUrl();
int headWearType = chatRoomMember.getHeadWearType();
if (TextUtils.isEmpty(headWear)) {
headWear = NobleUtil.getHeadResource(HeadWearInfo.EFFECT, chatRoomMember) != null ?
NobleUtil.getHeadResource(HeadWearInfo.EFFECT, chatRoomMember) :
NobleUtil.getHeadResource(HeadWearInfo.PIC, chatRoomMember);
String type = NobleUtil.getHeadResource(HeadWearInfo.TYPE, chatRoomMember);
headWearType = StringUtils2.INSTANCE.toInt(type);
}
String nobleHeadWear = (String) NobleUtil.getResource(NobleResourceType.KEY_HEAD_WEAR, chatRoomMember);
if (!TextUtils.isEmpty(headWear)) {
@@ -321,7 +310,7 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
//只有头饰发生改变才更新,防止闪烁
if (!headWear.equals(ivHeadWear.getTag(R.id.mic_item_head_wear))) {
ivHeadWear.setTag(R.id.mic_item_head_wear, headWear);
AvatarHelper.loadAvatarFrame(ivHeadWear, headWear, headWearType);
NobleUtil.loadMicHeadWear(headWear, ivHeadWear, R.id.mic_item_head_wear, headWear);
}
} else if (!TextUtils.isEmpty(nobleHeadWear)) {
// 头饰

View File

@@ -2,6 +2,7 @@ package com.chwl.app.avroom.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -12,6 +13,8 @@ import androidx.recyclerview.widget.RecyclerView;
import com.chwl.app.R;
import com.chwl.core.bean.RoomQueueInfo;
import com.chwl.core.manager.AvRoomDataManager;
import com.chwl.library.utils.ResUtil;
/**
* @author xiaoyu

View File

@@ -2,7 +2,6 @@ package com.chwl.app.avroom.headline
import android.content.Context
import android.util.AttributeSet
import android.view.Gravity
import android.view.LayoutInflater
import androidx.core.view.isVisible
import androidx.databinding.DataBindingUtil
@@ -10,15 +9,12 @@ import com.chwl.app.R
import com.chwl.app.databinding.RoomHeadlineWidgetBinding
import com.chwl.app.public_chat.core.ChatRoomClient
import com.chwl.app.public_chat.core.ChatRoomClientManager
import com.chwl.app.ui.utils.loadAvatar
import com.chwl.core.im.custom.bean.CustomAttachment
import com.chwl.core.im.custom.bean.HeadlineChangedAttachment
import com.chwl.core.public_chat_hall.bean.HeadlineBean
import com.chwl.core.public_chat_hall.model.PublicChatModel
import com.chwl.core.support.room.FrameLayoutRoomWidget
import com.chwl.core.support.room.RoomView
import com.example.lib_utils.AppUtils
import com.example.lib_utils.UiUtils
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage
import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum
@@ -48,12 +44,6 @@ class RoomHeadlineWidget : FrameLayoutRoomWidget {
defStyleRes: Int
) : super(context, attrs, defStyleAttr, defStyleRes)
init {
if (UiUtils.isRtl(AppUtils.getApp())) {
binding.tvHeadlineContent.gravity = Gravity.RIGHT
}
}
override fun onStart(roomView: RoomView) {
super.onStart(roomView)
if (!isInEditMode) {
@@ -99,11 +89,13 @@ class RoomHeadlineWidget : FrameLayoutRoomWidget {
}
private fun updateHeadline(data: HeadlineBean?) {
binding.tvHeadlineContent.text = data?.content ?: ""
binding.ivAvatar.loadAvatar(data?.avatar)
binding.tvName.text = "${data?.nick ?: ""} :"
binding.tvMoney.text = data?.payMoneyNum?.toString() ?: "0"
this.isVisible = data?.isValid() == true && !data.content.isNullOrEmpty()
val content = data?.content
if (data?.isValid() == true && !content.isNullOrEmpty()) {
binding.tvHeadlineContent.text = content
this.isVisible = true
} else {
this.isVisible = false
}
}
override fun onStop() {

View File

@@ -6,6 +6,7 @@ import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
@@ -13,7 +14,7 @@ import android.widget.RelativeLayout;
import androidx.annotation.NonNull;
import com.chwl.library.utils.PathHelper;
import com.chwl.core.helper.PathHelper;
import com.chwl.library.download.DownloadException;
import com.chwl.library.download.DownloadManager;
import com.chwl.library.download.DownloadRequest;

View File

@@ -17,6 +17,7 @@ import com.chwl.app.databinding.PhotoDialogBinding
import com.chwl.app.ui.widget.dialog.CommonTipDialog
import com.chwl.library.common.base.BaseDialogFragment
import com.chwl.library.common.photo.PhotoProvider
import com.chwl.library.common.photo.PhotoProviderNew
import com.chwl.library.common.util.PhotoCompressCallback
import com.chwl.library.common.util.PhotoCompressUtil
import com.chwl.library.common.util.PhotosCompressCallback
@@ -83,7 +84,7 @@ class PhotoDialog : BaseDialogFragment<PhotoDialogBinding>(), EasyPermissions.Pe
if (Build.VERSION.SDK_INT >= 33) Manifest.permission.READ_MEDIA_IMAGES else Manifest.permission.READ_EXTERNAL_STORAGE
)
} else {
PhotoProvider.photoProvider(this, resultCode = REQUEST_CODE_OPEN_PHOTO_PROVIDER)
PhotoProviderNew.photoProvider(this, resultCode = REQUEST_CODE_OPEN_PHOTO_PROVIDER)
}
}
@@ -117,7 +118,7 @@ class PhotoDialog : BaseDialogFragment<PhotoDialogBinding>(), EasyPermissions.Pe
if (Build.VERSION.SDK_INT >= 33) Manifest.permission.READ_MEDIA_IMAGES else Manifest.permission.READ_EXTERNAL_STORAGE
)
} else {
PhotoProvider.photoCamera(this, REQUEST_CODE_OPEN_CAMERA_PROVIDER)
PhotoProviderNew.photoCamera(this, REQUEST_CODE_OPEN_CAMERA_PROVIDER)
}
}

View File

@@ -0,0 +1,72 @@
package com.chwl.app.decoration.adapter;
import android.view.View;
import com.chwl.app.R;
import com.chwl.app.bindadapter.BaseAdapter;
import com.chwl.app.bindadapter.BindingViewHolder;
import com.chwl.app.databinding.ItemHeadWearBinding;
import com.chwl.core.decoration.headwear.bean.HeadWearInfo;
import com.chwl.core.noble.NobleUtil;
import com.chwl.library.utils.ListUtils;
/**
* Created by huangmeng1 on 2018/5/10.
*/
public class HeadWearShopAdapter extends BaseAdapter<HeadWearInfo> {
private int selectPosition;
public int getSelectPosition() {
return selectPosition;
}
public void setSelectPosition(int selectPosition) {
notifyItemChanged(this.selectPosition);
this.selectPosition = selectPosition;
notifyItemChanged(this.selectPosition);
}
public HeadWearShopAdapter(int layoutResId, int brid) {
super(layoutResId, brid);
}
@Override
protected void convert(BindingViewHolder helper, HeadWearInfo item) {
super.convert(helper, item);
ItemHeadWearBinding binding = (ItemHeadWearBinding) helper.getBinding();
binding.llRoot.setSelected(selectPosition == helper.getAdapterPosition());
NobleUtil.loadHeadWears(item.getPic(), binding.ivHeadWear);
binding.setSelectPosition(selectPosition == helper.getAdapterPosition());
if (item.getLabelType() == HeadWearInfo.LABEL_TYPE_NORMAL) {
binding.ivTag.setVisibility(View.GONE);
} else if (HeadWearInfo.LABEL_TYPE_NEW == item.getLabelType()) {
binding.ivTag.setVisibility(View.VISIBLE);
binding.ivTag.setImageResource(R.drawable.ic_mark_new);
} else if (HeadWearInfo.LABEL_TYPE_DISCOUNT == item.getLabelType()) {
binding.ivTag.setVisibility(View.VISIBLE);
binding.ivTag.setImageResource(R.drawable.ic_mark_discount);
} else if (HeadWearInfo.LABEL_TYPE_LIMIT == item.getLabelType()) {
binding.ivTag.setVisibility(View.VISIBLE);
binding.ivTag.setImageResource(R.drawable.ic_mark_limit);
} else if (HeadWearInfo.LABEL_TYPE_EXCLUSIVE == item.getLabelType()) {
binding.ivTag.setVisibility(View.VISIBLE);
binding.ivTag.setImageResource(R.drawable.ic_mark_exclusive);
}
binding.tvHeadName.setText(item.getName() + "");
}
public void setCarInfoHasBeenBought(HeadWearInfo carInfo) {
if (carInfo.getHeadwearId() <= 0 || ListUtils.isListEmpty(mData)) return;
int index = mData.indexOf(carInfo);
if (index == -1) return;
mData.get(index).setStatus(HeadWearInfo.STATUS_IN_USED);
notifyItemChanged(index);
}
}

View File

@@ -6,11 +6,9 @@ import com.chwl.app.R;
import com.chwl.app.bindadapter.BaseAdapter;
import com.chwl.app.bindadapter.BindingViewHolder;
import com.chwl.app.databinding.ItemMyHeadWearBinding;
import com.chwl.app.utils.AvatarHelper;
import com.chwl.core.decoration.headwear.bean.HeadWearInfo;
import com.chwl.core.noble.NobleUtil;
import com.chwl.library.utils.ResUtil;
import com.chwl.library.widget.SVGAView;
/**
* Created by huangmeng1 on 2018/5/11.
@@ -22,14 +20,11 @@ public class MyHeadWearAdapter extends BaseAdapter<HeadWearInfo> {
super(layoutResId, brid);
}
private SVGAView.SVGACache svgaCache = SVGAView.newCache(10);
@Override
protected void convert(BindingViewHolder helper, HeadWearInfo item) {
super.convert(helper, item);
ItemMyHeadWearBinding binding = (ItemMyHeadWearBinding) helper.getBinding();
binding.ivCarCover.bindCache(svgaCache);
AvatarHelper.loadAvatarFrame(binding.ivCarCover, item.getFirstUrl(), item.getType());
NobleUtil.loadHeadWears(item.getPic(), binding.ivCarCover);
helper.addOnClickListener(R.id.tv_used);
if (item.getLabelType() == HeadWearInfo.LABEL_TYPE_NORMAL) {

View File

@@ -39,8 +39,8 @@ public class HomeIndicatorAdapter extends CommonNavigatorAdapter {
@Override
public IPagerTitleView getTitleView(Context context, final int i) {
ScaleTransitionPagerTitleView scaleTransitionPagerTitleView = new ScaleTransitionPagerTitleView(context, true);
scaleTransitionPagerTitleView.setNormalColor(ContextCompat.getColor(context, R.color.color_990C1D18));
scaleTransitionPagerTitleView.setSelectedColor(ContextCompat.getColor(context, R.color.color_0C1D18));
scaleTransitionPagerTitleView.setNormalColor(ContextCompat.getColor(context, R.color.white_transparent_60));
scaleTransitionPagerTitleView.setSelectedColor(ContextCompat.getColor(context, R.color.color_FFFFFF));
scaleTransitionPagerTitleView.setMinScale(minScale);
scaleTransitionPagerTitleView.setTextSize(textSize);
int padding = UIUtil.dip2px(context, 13);
@@ -59,10 +59,10 @@ public class HomeIndicatorAdapter extends CommonNavigatorAdapter {
public IPagerIndicator getIndicator(Context context) {
LinePagerIndicator indicator = new LinePagerIndicator(context);
indicator.setMode(LinePagerIndicator.MODE_EXACTLY);
indicator.setLineHeight(context.getResources().getDimensionPixelOffset(R.dimen.dp_4));
indicator.setRoundRadius(context.getResources().getDimensionPixelOffset(R.dimen.dp_2));
indicator.setLineWidth(context.getResources().getDimensionPixelOffset(R.dimen.dp_13));
indicator.setColors(context.getResources().getColor(R.color.color_002512));
indicator.setLineHeight(UIUtil.dip2px(mContext, 2.5));
indicator.setRoundRadius(UIUtil.dip2px(mContext, 1.5));
indicator.setLineWidth(UIUtil.dip2px(mContext, 10));
indicator.setColors(context.getResources().getColor(R.color.color_10ECD6));
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
// lp.bottomMargin = mBottomMargin;
indicator.setLayoutParams(lp);

View File

@@ -15,12 +15,7 @@ import androidx.databinding.DataBindingUtil;
import com.bumptech.glide.request.RequestOptions;
import com.chwl.app.ui.login.LoginPasswordActivity;
import com.chwl.core.auth.AuthModel;
import com.chwl.core.bean.response.result.TicketResult;
import com.chwl.core.gift.GiftModel;
import com.chwl.library.language.LanguageHelper;
import com.chwl.library.utils.SingleToastUtil;
import com.example.lib_utils.log.LogUtil;
import com.netease.nim.uikit.StatusBarUtil;
import com.netease.nim.uikit.support.glide.GlideApp;
import com.chwl.app.MainActivity;
@@ -37,10 +32,6 @@ import com.chwl.core.utils.OaidUtil;
import com.chwl.core.utils.SharedPreferenceUtils;
import com.chwl.library.common.util.DeviceUtil;
import io.reactivex.SingleObserver;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
/**
* @author xiaoyu
* @date 2017/12/30
@@ -52,15 +43,8 @@ public class SplashActivity extends AppCompatActivity implements View.OnClickLis
private ActivitySplashBinding mBinding;
private SplashComponent mLocalSplashVo;
private CompositeDisposable disposable = new CompositeDisposable();
// ticket状态 -1:加载失败、0:加载中、1:加载成功
private int ticketState = 0;
private volatile boolean needJump = false;
private Runnable jumpRunnable;
public static void start(Context context) {
Intent starter = new Intent(context, SplashActivity.class);
context.startActivity(starter);
@@ -88,10 +72,9 @@ public class SplashActivity extends AppCompatActivity implements View.OnClickLis
// 从堆栈恢复不再重复解析之前的intent
setIntent(new Intent());
}
initiate();
StatusBarUtil.transparencyBar(this);
StatusBarUtil.StatusBarLightMode(this);
initTicket();
initiate();
}
@Override
@@ -162,12 +145,8 @@ public class SplashActivity extends AppCompatActivity implements View.OnClickLis
}
public void jumpActivity(Intent intent) {
jumpRunnable = () -> jumpActivityImpl(intent);
next();
}
public void jumpActivityImpl(Intent intent) {
if (!AuthModel.get().isLogin()) {
AccountInfo currentAccountInfo = DemoCache.readCurrentAccountInfo();
if (currentAccountInfo == null || TextUtils.isEmpty(currentAccountInfo.getAccess_token())) {
NimMiddleActivity.openCommunity = false;
LoginPasswordActivity.start(this);
finish();
@@ -211,53 +190,4 @@ public class SplashActivity extends AppCompatActivity implements View.OnClickLis
}
private void initTicket() {
ticketState = 0;
if (!AuthModel.get().isLogin()) {
ticketState = -1;
next();
return;
}
AuthModel.get().refreshTicket().subscribe(new SingleObserver<TicketResult>() {
@Override
public void onSubscribe(Disposable d) {
disposable.add(d);
}
@Override
public void onSuccess(TicketResult ticketResult) {
LogUtil.d("SplashActivity", "initTicket onSuccess", false);
onTicketSuccess();
ticketState = 1;
next();
}
@Override
public void onError(Throwable throwable) {
LogUtil.d("SplashActivity", "initTicket throwable:" + throwable.getMessage(), false);
SingleToastUtil.showToast(throwable.getMessage());
AuthModel.get().reset();
ticketState = -1;
next();
}
});
}
private void onTicketSuccess() {
GiftModel.get().tryLoadGiftList();
}
private void next() {
if (ticketState != 0 && jumpRunnable != null) {
jumpRunnable.run();
}
}
@Override
protected void onDestroy() {
super.onDestroy();
if (disposable != null && !disposable.isDisposed()) {
disposable.dispose();
}
}
}

View File

@@ -3,7 +3,7 @@ package com.chwl.app.support
import androidx.lifecycle.viewModelScope
import com.chwl.app.BuildConfig
import com.chwl.app.base.BaseViewModel
import com.chwl.library.utils.PathHelper
import com.chwl.core.helper.PathHelper
import com.chwl.core.home.model.HomeModel
import com.chwl.library.common.util.SPUtils
import com.chwl.library.download.DownloadException

View File

@@ -1,50 +0,0 @@
package com.chwl.app.ui.debug
import com.chwl.app.base.BaseViewBindingActivity
import com.chwl.app.databinding.DebugActivityBinding
import com.netease.nim.uikit.StatusBarUtil
class DebugActivity : BaseViewBindingActivity<DebugActivityBinding>() {
override fun init() {
initWhiteTitleBar("调试")
initSVGAList()
}
private fun initSVGAList() {
val adapter = DebugAdapter()
binding.recyclerView.adapter = adapter
// binding.recyclerView.setItemViewCacheSize(-1)
val svgaList = listOf(
"https://image.pekolive.com/花和玫瑰.svga",
"https://image.pekolive.com/firecrown.svga",
"https://image.pekolive.com/ningtangchengbaoqietu.svga",
"https://image.pekolive.com/xunmengfengche.svga",
"https://image.pekolive.com/tonghuaqiyuan1334.svga",
"https://image.pekolive.com/mengquyinhe.svga",
"https://image.pekolive.com/duqinghuashu.svga",
"https://image.pekolive.com/juzhijingling.svga",
"https://image.pekolive.com/3121_aixintouwei.svga",
"https://image.pekolive.com/4051_langmanyewan.svga"
)
val list = ArrayList<String>()
list.addAll(svgaList)
list.addAll(svgaList)
adapter.setNewData(list)
binding.btnRefreshAll.setOnClickListener {
adapter.notifyDataSetChanged()
}
binding.btnRefresh.setOnClickListener {
adapter.notifyItemChanged(5, true)
}
}
override fun needSteepStateBar(): Boolean {
return true
}
override fun setStatusBar() {
super.setStatusBar()
StatusBarUtil.transparencyBar(this)
StatusBarUtil.StatusBarLightMode(this)
}
}

View File

@@ -1,47 +0,0 @@
package com.chwl.app.ui.debug
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.chwl.app.R
import com.chwl.library.widget.SVGAView
import com.example.lib_utils.log.ILog
class DebugAdapter : BaseQuickAdapter<String, BaseViewHolder>(R.layout.debug_item_svga), ILog {
private val svgaCache = SVGAView.newCache(10)
override fun convertPayloads(
helper: BaseViewHolder,
item: String?,
payloads: MutableList<Any>
) {
super.convertPayloads(helper, item, payloads)
logD("convertPayloads holder:${helper.absoluteAdapterPosition} #${helper.hashCode()} SVGAView")
val svgaView = helper.getView<SVGAView>(R.id.svga_view)
svgaView.loadUrl(item)
}
override fun convert(helper: BaseViewHolder, item: String?) {
logD("convert holder:${helper.absoluteAdapterPosition} #${helper.hashCode()} SVGAView")
helper.setText(R.id.tv_name, helper.absoluteAdapterPosition.toString())
val item = getItem(helper.bindingAdapterPosition)
val svgaView = helper.getView<SVGAView>(R.id.svga_view)
svgaView.bindCache(svgaCache)
svgaView.setLogTag(helper.absoluteAdapterPosition.toString())
svgaView.loadUrl(item)
}
override fun onViewAttachedToWindow(holder: BaseViewHolder) {
super.onViewAttachedToWindow(holder)
logD("onViewAttachedToWindow holder:${holder.absoluteAdapterPosition} #${holder.hashCode()} SVGAView")
// val item = getItem(holder.bindingAdapterPosition)
// val svgaView = holder.getView<SVGAView>(R.id.svga_view)
// svgaView.bindCache(SVGAView.newCache(10))
// svgaView.setLogTag(holder.absoluteAdapterPosition.toString())
// svgaView.loadUrl(item)
}
override fun onViewDetachedFromWindow(holder: BaseViewHolder) {
super.onViewDetachedFromWindow(holder)
logD("onViewDetachedFromWindow holder:${holder.absoluteAdapterPosition} #${holder.hashCode()} SVGAView")
}
}

View File

@@ -1,61 +0,0 @@
package com.chwl.app.ui.feedback
import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.view.WindowManager
import com.chwl.app.R
import com.chwl.app.base.BaseBindingDialog
import com.chwl.app.databinding.FeedbackCustomerServiceDialogBinding
import com.chwl.app.ui.widget.recyclerview.decoration.SpacingDecoration
import com.chwl.library.annatation.ActLayoutRes
import com.chwl.library.utils.SingleToastUtil
@ActLayoutRes(R.layout.feedback_customer_service_dialog)
class CustomerServiceDialog(context: Context, val map: Map<String, String?>) :
BaseBindingDialog<FeedbackCustomerServiceDialogBinding>(context, R.style.dialog) {
private val adapter = CustomerServiceItemAdapter()
override fun onStart() {
width = WindowManager.LayoutParams.MATCH_PARENT
super.onStart()
}
override fun init() {
binding.layoutRoot.setOnClickListener {
dismiss()
}
binding.tvNext.setOnClickListener {
dismiss()
}
binding.recyclerView.addItemDecoration(
SpacingDecoration(
0,
context.resources.getDimensionPixelOffset(R.dimen.dp_10),
false
)
)
binding.recyclerView.adapter = adapter
val list = map.map {
it
}
adapter.setNewData(list)
adapter.setOnItemChildClickListener { adapter, view, position ->
val text = this.adapter.getItem(position)?.value
if (text != null) {
copyText(text)
}
}
}
private fun copyText(text: String) {
try {
val cm =
context?.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
cm.setPrimaryClip(ClipData.newPlainText("text", text))
SingleToastUtil.showToast(R.string.have_copy)
} catch (e: Exception) {
SingleToastUtil.showToast(e.toString())
}
}
}

View File

@@ -1,34 +0,0 @@
package com.chwl.app.ui.feedback
import android.annotation.SuppressLint
import android.view.Gravity
import android.view.ViewGroup
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.chwl.app.R
import com.example.lib_utils.AppUtils
import com.example.lib_utils.UiUtils
class CustomerServiceItemAdapter :
BaseQuickAdapter<Map.Entry<String, String?>, BaseViewHolder>(R.layout.feedback_customer_service_item) {
private var isRTL = UiUtils.isRtl(AppUtils.getApp())
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
return super.onCreateViewHolder(parent, viewType).apply {
this.addOnClickListener(R.id.layout_copy)
val textView = getView<TextView>(R.id.tv_content)
if (isRTL) {
textView.gravity = Gravity.RIGHT
}
}
}
@SuppressLint("SetTextI18n")
override fun convert(helper: BaseViewHolder, item: Map.Entry<String, String?>) {
val textView = helper.getView<TextView>(R.id.tv_content)
textView.text = "${item.key}: ${item.value ?: ""}"
}
}

View File

@@ -1,353 +0,0 @@
package com.chwl.app.ui.feedback
import android.Manifest
import android.annotation.SuppressLint
import android.content.Intent
import android.os.Build
import android.widget.ImageView.ScaleType
import androidx.activity.viewModels
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import com.chwl.app.R
import com.chwl.app.base.BaseViewBindingActivity
import com.chwl.app.databinding.FeedbackActivityBinding
import com.chwl.app.ui.utils.load
import com.chwl.app.ui.widget.dialog.CommonTipDialog
import com.chwl.core.file.FileModel
import com.chwl.core.home.bean.FeedbackTypeBean
import com.chwl.library.common.photo.PhotoProvider
import com.chwl.library.common.photo.PhotoProvider.photoProvider
import com.chwl.library.common.util.PhotoCompressUtil
import com.chwl.library.common.util.PhotosCompressCallback
import com.chwl.library.easypermisssion.EasyPermissions
import com.chwl.library.easyphoto.utils.settings.SettingsUtils
import com.chwl.library.utils.ResUtil
import com.chwl.library.utils.SingleToastUtil
import com.example.lib_utils.SolveEditTextScrollClash
import com.example.lib_utils.ktx.getColorById
import com.example.lib_utils.ktx.setOnInputChangedListener
import com.example.lib_utils.ktx.singleClick
import com.example.lib_utils.spannable.SpannableTextBuilder
import com.google.android.flexbox.FlexDirection
import com.google.android.flexbox.FlexWrap
import com.google.android.flexbox.FlexboxLayoutManager
import com.google.android.flexbox.JustifyContent
import com.hjq.toast.ToastUtils
import com.netease.nim.uikit.StatusBarUtil
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.launch
class FeedbackActivity : BaseViewBindingActivity<FeedbackActivityBinding>(),
EasyPermissions.PermissionCallbacks {
private val PERMISSION_CODE_STORAGE = 12
private val REQUEST_CODE_OPEN_PHOTO_PROVIDER = 111 // 从相册中选择
private val viewModel: FeedbackViewModel by viewModels()
private val adapter = FeedbackTypeAdapter()
private var compressJob: Job? = null
private var wantShowCustomerService = false
private var imagePath: String? = null
private var imageUrl: String? = null
override fun init() {
initWhiteTitleBar(ResUtil.getString(R.string.feedback_title))
initView()
initEvent()
initObserve()
refreshSubmitState()
}
private fun initView() {
val flexBoxLayoutManager = FlexboxLayoutManager(context)
flexBoxLayoutManager.flexDirection = FlexDirection.ROW
flexBoxLayoutManager.flexWrap = FlexWrap.WRAP
flexBoxLayoutManager.justifyContent = JustifyContent.FLEX_START
binding.recyclerViewType.layoutManager = flexBoxLayoutManager
binding.recyclerViewType.adapter = adapter
binding.etContent.setOnTouchListener(SolveEditTextScrollClash(binding.etContent))
}
private fun initEvent() {
adapter.setOnItemClickListener { adapter, view, position ->
this.adapter.selectItem(this.adapter.getItem(position))
refreshSubmitState()
}
binding.tvSubmit.singleClick {
dialogManager.showProgressDialog(this)
submit()
}
binding.ivImage.singleClick {
checkStoragePermission()
}
binding.ivCustomerService.singleClick {
showCustomerServiceDialog()
}
binding.etContent.setOnInputChangedListener {
updateContentInputTips(this)
refreshSubmitState()
true
}
binding.etContact.setOnInputChangedListener {
refreshSubmitState()
true
}
}
private fun initObserve() {
viewModel.loadingLiveData.observe(this) {
if (it) dialogManager.showProgressDialog(this)
else dialogManager.dismissDialog()
}
viewModel.configLiveData.observe(this) {
if (it?.isSuccess == true) {
loadTypeList(it.data?.typeEnumList)
if (wantShowCustomerService) {
showCustomerServiceDialog(it.data?.customContactMap)
}
} else if (it?.message != null) {
toast(it.message ?: "")
}
wantShowCustomerService = false
}
lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.RESUMED) {
viewModel.submitStateFlow.collectLatest {
dialogManager.dismissDialog()
if (it.isSuccess) {
toast(R.string.home_model_homemodel_01)
finish()
} else if (it.message != null) {
toast(it.message)
}
}
}
}
}
private fun updateContentInputTips(length: Int) {
if (length > 0) {
SpannableTextBuilder(binding.tvContentCount)
.appendText(
text = length.toString(),
textColor = getColorById(R.color.color_3FDDAC)
)
.appendText(text = "/300")
.apply()
} else {
binding.tvContentCount.text = "${length}/300"
}
}
private fun showCustomerServiceDialog() {
val config = viewModel.configLiveData.value?.data
if (config == null) {
wantShowCustomerService = true
viewModel.getConfig()
return
}
showCustomerServiceDialog(config.customContactMap)
}
private fun showCustomerServiceDialog(info: Map<String, String>?) {
if (info.isNullOrEmpty()) {
return
}
CustomerServiceDialog(this, info).show()
}
private fun loadTypeList(type: List<FeedbackTypeBean>?) {
adapter.setNewData(type)
}
private fun onAddImage(path: String?) {
if (path.isNullOrEmpty()) {
imagePath = null
imageUrl = null
binding.ivImage.scaleType = ScaleType.CENTER_INSIDE
binding.ivImage.setImageResource(R.drawable.feedback_ic_add)
} else {
imagePath = path
imageUrl = null
binding.ivImage.load(path)
binding.ivImage.scaleType = ScaleType.CENTER_CROP
}
refreshSubmitState()
}
private fun refreshSubmitState() {
binding.tvSubmit.isEnabled = canSubmit()
}
private fun canSubmit(): Boolean {
if (binding.etContent.text.isNullOrEmpty()) {
return false
}
if (binding.etContact.text.isNullOrEmpty()) {
return false
}
if (adapter.getSelectItem() == null) {
return false
}
return true
}
private fun submit() {
val content = binding.etContent.text.trim().toString()
val contact = binding.etContact.text.trim().toString()
val type = adapter.getSelectItem()?.type ?: ""
val imagePath = imagePath
if (imagePath != null && imageUrl == null) {
uploadImage(imagePath, {
imageUrl = it
submit()
}, {
if (it != null) {
toast(ResUtil.getString(R.string.ui_user_userinfomodifyactivity_08) + ":${it.message}")
}
dialogManager.dismissDialog()
})
} else {
viewModel.submitFeedback(
type = type,
content = content,
image = imageUrl ?: "",
contact = contact
)
}
}
@SuppressLint("CheckResult")
private fun uploadImage(path: String, success: (String) -> Unit, failed: (Throwable?) -> Unit) {
FileModel.get()
.uploadFile(path)
.compose(bindToLifecycle())
.subscribe { url: String?, throwable: Throwable? ->
if (url != null) {
success.invoke(url)
} else {
failed.invoke(throwable)
}
}
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (resultCode == RESULT_OK) {
if (requestCode == REQUEST_CODE_OPEN_PHOTO_PROVIDER) {
if (data == null) {
return
}
PhotoProvider.getResultPathListAsync(data) { list ->
if (list.isNullOrEmpty()) {
SingleToastUtil.showToastShort(com.netease.nim.uikit.R.string.picker_image_error)
return@getResultPathListAsync
}
val paths = list.map { it.path }.toMutableList()
compressPhotos(paths)
}
}
}
}
override fun onRequestPermissionsResult(
requestCode: Int,
permissions: Array<String?>,
grantResults: IntArray
) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this)
}
private fun checkStoragePermission() {
if (!EasyPermissions.hasPermissions(
this,
if (Build.VERSION.SDK_INT >= 33) Manifest.permission.READ_MEDIA_IMAGES else Manifest.permission.READ_EXTERNAL_STORAGE
)
) {
EasyPermissions.requestPermissions(
this,
getString(R.string.permission_storage_rationale),
PERMISSION_CODE_STORAGE,
if (Build.VERSION.SDK_INT >= 33) Manifest.permission.READ_MEDIA_IMAGES else Manifest.permission.READ_EXTERNAL_STORAGE
)
} else {
photoProvider(
this,
1,
true,
REQUEST_CODE_OPEN_PHOTO_PROVIDER,
true,
true
)
}
}
private fun compressPhotos(paths: MutableList<String>) {
compressJob?.cancel(null)
compressJob = PhotoCompressUtil.compress(
this, paths,
PhotoCompressUtil.getCompressCachePath(),
object : PhotosCompressCallback {
override fun onSuccess(compressedImgList: ArrayList<String>) {
val firstItem = compressedImgList.firstOrNull() ?: return
onAddImage(firstItem)
}
override fun onFail(e: Throwable) {
ToastUtils.show(getString(R.string.picker_image_error))
}
}
)
}
override fun needSteepStateBar(): Boolean {
return true
}
override fun setStatusBar() {
super.setStatusBar()
StatusBarUtil.transparencyBar(this)
StatusBarUtil.StatusBarLightMode(this)
}
override fun onPermissionsGranted(requestCode: Int, perms: MutableList<String>) {
if (requestCode == PERMISSION_CODE_STORAGE) {
checkStoragePermission()
}
}
override fun onPermissionsDenied(requestCode: Int, perms: MutableList<String>) {
if (requestCode == PERMISSION_CODE_STORAGE) {
val requestTip = getString(R.string.permission_storage_denied)
val mPrivacyDialog = CommonTipDialog(context)
mPrivacyDialog.setTipMsg(requestTip)
mPrivacyDialog.setOkText(getString(R.string.room_perform_go_update))
mPrivacyDialog.setOnActionListener(object : CommonTipDialog.OnActionListener {
override fun onOk() {
//同意跳到应用详情页面
SettingsUtils.startMyApplicationDetailsForResult(
this@FeedbackActivity,
packageName
)
}
override fun onCancel() {
super.onCancel()
//取消跳到应用详情页面
ToastUtils.show(getString(R.string.permission_storage_refused))
}
})
mPrivacyDialog.show()
}
}
override fun onResume() {
super.onResume()
if (viewModel.configLiveData.value?.data == null) {
viewModel.getConfig()
}
}
}

View File

@@ -1,42 +0,0 @@
package com.chwl.app.ui.feedback
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.chwl.app.R
import com.chwl.core.home.bean.FeedbackTypeBean
class FeedbackTypeAdapter : BaseQuickAdapter<FeedbackTypeBean, BaseViewHolder>(R.layout.feedback_item_type) {
private var selectItem: FeedbackTypeBean? = null
override fun convertPayloads(
helper: BaseViewHolder,
item: FeedbackTypeBean?,
payloads: MutableList<Any>
) {
super.convertPayloads(helper, item, payloads)
convertState(helper, item)
}
override fun convert(helper: BaseViewHolder, item: FeedbackTypeBean?) {
helper.setText(R.id.tv_name, item?.desc ?: "")
convertState(helper, item)
}
private fun convertState(helper: BaseViewHolder, item: FeedbackTypeBean?) {
if (selectItem == item) {
helper.setBackgroundRes(R.id.tv_name, R.drawable.shape_85f6d3_15dp)
} else {
helper.setBackgroundRes(R.id.tv_name, R.drawable.shape_f3f5fa_15dp)
}
}
fun selectItem(item: FeedbackTypeBean?) {
this.selectItem = item
notifyItemRangeChanged(0, itemCount, true)
}
fun getSelectItem(): FeedbackTypeBean? {
return selectItem
}
}

View File

@@ -1,36 +0,0 @@
package com.chwl.app.ui.feedback
import androidx.lifecycle.MutableLiveData
import com.chwl.app.base.BaseViewModel
import com.chwl.core.bean.response.BeanResult
import com.chwl.core.home.bean.FeedbackConfigBean
import com.chwl.core.home.model.HomeModel
import kotlinx.coroutines.flow.MutableSharedFlow
class FeedbackViewModel : BaseViewModel() {
val configLiveData = MutableLiveData<BeanResult<FeedbackConfigBean>?>()
val submitStateFlow = MutableSharedFlow<BeanResult<Any?>>()
fun getConfig() {
safeLaunch(
needLoading = true,
onError = {
configLiveData.postValue(BeanResult.failed(it))
}) {
val value = HomeModel.getFeedbackConfig()
configLiveData.postValue(BeanResult.success(value))
}
}
fun submitFeedback(type: String, content: String, image: String, contact: String) {
safeLaunch(
needLoading = true,
onError = {
submitStateFlow.emit(BeanResult.failed(it))
}) {
val value = HomeModel.commitFeedback(contact, content, image, type)
submitStateFlow.emit(BeanResult.success(value))
}
}
}

View File

@@ -2,12 +2,10 @@ package com.chwl.app.ui.im;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import com.chwl.app.decoration.view.DecorationStoreActivity;
import com.chwl.app.earn.activity.EarnRecordActivity;
import com.chwl.app.pay.activity.GiveGoldActivity;
import com.chwl.app.ui.feedback.FeedbackActivity;
import com.chwl.core.module_hall.hall.bean.H5FamilyInfo;
import com.chwl.core.module_hall.hall.bean.UserClanInfo;
import com.trello.rxlifecycle3.components.support.RxAppCompatActivity;
@@ -34,11 +32,13 @@ import com.chwl.app.team.view.NimTeamMessageActivity;
import com.chwl.app.ui.login.BindPhoneActivity;
import com.chwl.app.ui.login.ShowBindPhoneActivity;
import com.chwl.app.ui.pay.ChargeActivity;
import com.chwl.app.ui.setting.FeedbackActivity;
import com.chwl.app.ui.setting.ModifyPwdActivity;
import com.chwl.app.ui.user.activity.UserInfoActivity;
import com.chwl.app.ui.webview.CommonWebViewActivity;
import com.chwl.app.vip.VipMainActivity;
import com.chwl.core.DemoCache;
import com.chwl.core.UriProvider;
import com.chwl.core.auth.AuthModel;
import com.chwl.core.community.event.SquareTaskEvent;
import com.chwl.core.im.custom.bean.RouterType;
@@ -209,7 +209,7 @@ public class RouterHandler {
break;
case RouterType.FEED_BACK:
context.startActivity(new Intent(context, FeedbackActivity.class));
FeedbackActivity.start(context);
break;
case RouterType.SET_PASSWORD:
ModifyPwdActivity.start(context, ModifyPwdActivity.LOGIN_PWD);

View File

@@ -27,7 +27,6 @@ import androidx.core.content.ContextCompat;
import com.chwl.app.BuildConfig;
import com.chwl.app.common.widget.OriginalDrawStatusClickSpan;
import com.chwl.app.ui.feedback.FeedbackActivity;
import com.chwl.app.ui.setting.LabActivity;
import com.chwl.app.ui.webview.CommonWebViewActivity;
import com.chwl.core.UriProvider;
@@ -276,9 +275,7 @@ public class LoginPasswordActivity extends BaseActivity {
});
setProtocol();
findViewById(R.id.layout_google).setOnClickListener(v -> googleLogin());
findViewById(R.id.tv_feedback).setOnClickListener(v -> {
startActivity(new Intent(this, FeedbackActivity.class));
});
if (BuildConfig.DEBUG) {
findViewById(R.id.iv_logo).setOnClickListener(v -> {
startActivity(new Intent(this, LabActivity.class));

View File

@@ -64,7 +64,7 @@ public class LogoutHelper {
String text = ResUtil.getString(R.string.login_helper_logouthelper_09) + simpleDateFormat.format(new Date(exception.getCancelDate()));
int end = text.length();
text += ResUtil.getString(R.string.login_helper_logouthelper_010);
text += ResUtil.getString(R.string.login_helper_logouthelper_010);
SpannableString spannableString = new SpannableString(text);
spannableString.setSpan(new ForegroundColorSpan(ContextCompat.getColor(activity, R.color.appColor)),
0, end, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);

View File

@@ -0,0 +1,100 @@
package com.chwl.app.ui.setting;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import com.netease.nim.uikit.StatusBarUtil;
import com.trello.rxlifecycle3.android.ActivityEvent;
import com.chwl.app.R;
import com.chwl.app.base.BaseActivity;
import com.chwl.core.auth.AuthModel;
import com.chwl.core.home.model.HomeModel;
import com.chwl.library.utils.ResUtil;
import io.reactivex.SingleObserver;
import io.reactivex.disposables.Disposable;
public class FeedbackActivity extends BaseActivity {
private EditText edtContent;
private EditText edtContact;
private Button btnCommit;
public static void start(Context context) {
Intent intent = new Intent(context, FeedbackActivity.class);
context.startActivity(intent);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_feedback);
initWhiteTitleBar(ResUtil.getString(R.string.ui_setting_feedbackactivity_01));
initView();
initData();
SetListener();
}
private void SetListener() {
btnCommit.setOnClickListener(v ->
HomeModel.INSTANCE.commitFeedback(AuthModel.get().getCurrentUid(),
edtContent.getText().toString(),
edtContact.getText().toString()
)
.compose(bindUntilEvent(ActivityEvent.DESTROY))
.subscribe(new SingleObserver<String>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onSuccess(String s) {
onCommitFeedback();
}
@Override
public void onError(Throwable e) {
onCommitFeedbackFail(e.getMessage());
}
})
);
}
private void initData() {
}
private void initView() {
edtContent = findViewById(R.id.edt_content);
edtContact = findViewById(R.id.edt_contact);
btnCommit = findViewById(R.id.btn_commit);
}
public void onCommitFeedback(){
getDialogManager().showProgressDialog(FeedbackActivity.this, ResUtil.getString(R.string.ui_setting_feedbackactivity_02));
toast(ResUtil.getString(R.string.ui_setting_feedbackactivity_03));
finish();
}
public void onCommitFeedbackFail(String error){
// toast(error);
}
@Override
protected boolean needSteepStateBar() {
return true;
}
@Override
protected void setStatusBar() {
super.setStatusBar();
StatusBarUtil.transparencyBar(this);
StatusBarUtil.StatusBarLightMode(this);
}
}

View File

@@ -13,7 +13,6 @@ import com.chwl.app.base.BaseViewBindingActivity
import com.chwl.app.common.widget.dialog.DialogManager.OkCancelDialogListener
import com.chwl.app.databinding.ActivitySettingBinding
import com.chwl.app.notify.RoomNotifyManager
import com.chwl.app.ui.debug.DebugActivity
import com.chwl.app.ui.im.avtivity.BlackListManageActivity
import com.chwl.app.ui.language.LanguageActivity
import com.chwl.app.ui.login.BindPhoneActivity
@@ -84,12 +83,11 @@ class SettingActivity : BaseViewBindingActivity<ActivitySettingBinding>(), View.
binding.tvLanugage.setOnClickListener(this)
binding.rlyPayPwd.setOnClickListener(this)
// TODO 临时调整
// if (BuildConfig.DEBUG) {
if (BuildConfig.DEBUG) {
binding.titleBar.setOnTitleClickListener {
debug()
}
// }
}
}
@SuppressLint("CheckResult")
@@ -223,8 +221,7 @@ class SettingActivity : BaseViewBindingActivity<ActivitySettingBinding>(), View.
}
private fun debug() {
// startActivity(Intent(this, DebugActivity::class.java))
CommonWebViewActivity.start(this,"http://beta.api.molistar.xyz/molistar/modules/order/index.html")
// CommonWebViewActivity.start(this,"https://api.molistar.xyz/molistar/activity/2024-invitationFission/index.html")
// PublicChatRoomMessageActivity.start(this)
// MyDecorationActivity.start(this,0)
}

View File

@@ -25,9 +25,8 @@ import com.chwl.app.ui.user.adapter.UserInfoTopAlbumAdapter;
import com.chwl.app.ui.user.fragment.UserInfoDataFragment;
import com.chwl.app.ui.user.fragment.UserInfoDynamicFragment;
import com.chwl.app.utils.AppBarStateChangeListener;
import com.chwl.app.utils.AvatarHelper;
import com.chwl.library.widget.SVGAView;
import com.chwl.core.decoration.headwear.bean.HeadWearInfo;
import com.chwl.core.noble.NobleUtil;
import com.example.lib_utils.UiUtils;
import com.google.android.material.appbar.AppBarLayout;
import com.netease.nim.uikit.StatusBarUtil;
@@ -255,7 +254,6 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
mBinding.tbUserInfo.setTitle("");
ivOfficialMask = mBinding.inOfficialMask.findViewById(R.id.iv_official_mask);
tvOfficialMask = mBinding.inOfficialMask.findViewById(R.id.tv_official_mask);
mBinding.ivHeadWear.bindCache(SVGAView.newCache(1));
}
@Subscribe(threadMode = ThreadMode.MAIN)
@@ -271,7 +269,8 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
ImageLoadUtilsV2.loadImage(mBinding.ivUserHead, userInfo.getAvatar());
HeadWearInfo headWearInfo = userInfo.getUserHeadwear();
if (headWearInfo != null && headWearInfo.getFirstUrl() != null) {
AvatarHelper.loadAvatarFrame(mBinding.ivHeadWear, headWearInfo.getFirstUrl(), headWearInfo.getType());
NobleUtil.loadHeadWear(headWearInfo.getFirstUrl(), mBinding.ivHeadWear);
mBinding.ivHeadWear.setVisibility(View.VISIBLE);
mBinding.ivUserHead.setPadding(0, 0, 0, 0);
mBinding.ivUserHead.setStrokeWidth(0);
} else {

View File

@@ -40,7 +40,7 @@ import com.chwl.core.user.bean.UserInfo
import com.chwl.core.user.bean.UserPhoto
import com.chwl.core.utils.CoreLogger
import com.chwl.library.common.file.FileHelper
import com.chwl.library.common.photo.PhotoProvider
import com.chwl.library.common.photo.PhotoProviderNew
import com.chwl.library.common.util.PhotoCompressCallback
import com.chwl.library.common.util.PhotoCompressUtil
import com.chwl.library.easypermisssion.EasyPermissions
@@ -371,7 +371,7 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
)
} else {
mUri = Uri.parse("file://${FileHelper.getRootCacheDir()?.path}/${getNowTime()}.jpg")
PhotoProvider.photoProvider(
PhotoProviderNew.photoProvider(
this,
resultCode = REQUEST_CODE_OPEN_PHOTO_PROVIDER
)
@@ -429,7 +429,7 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
}
}
REQUEST_CODE_OPEN_PHOTO_PROVIDER -> data?.let {
val photos = PhotoProvider.getResultPhotoList(it)
val photos = PhotoProviderNew.getResultPhotoList(it)
if (!photos.isNullOrEmpty()) {
val photo = photos[0]
crop(photo.uri, photo.size, mUri)

View File

@@ -32,7 +32,7 @@ import com.chwl.core.user.bean.UserPhoto
import com.chwl.core.utils.CoreLogger
import com.chwl.core.utils.net.BeanObserver
import com.chwl.library.common.file.FileHelper
import com.chwl.library.common.photo.PhotoProvider
import com.chwl.library.common.photo.PhotoProviderNew
import com.chwl.library.common.util.PhotoCompressCallback
import com.chwl.library.common.util.PhotoCompressUtil
import com.chwl.library.easypermisssion.EasyPermissions
@@ -232,7 +232,7 @@ class UserModifyPhotosActivity : TakePhotoActivity(), PhotoItemClickListener,
)
} else {
mUri = Uri.parse("file://${FileHelper.getRootCacheDir()?.path}/${getNowTime()}.jpg")
PhotoProvider.photoProvider(
PhotoProviderNew.photoProvider(
this,
resultCode = REQUEST_CODE_OPEN_PHOTO_PROVIDER
)
@@ -252,7 +252,7 @@ class UserModifyPhotosActivity : TakePhotoActivity(), PhotoItemClickListener,
} else if (resultCode == RESULT_OK) {
when (requestCode) {
REQUEST_CODE_OPEN_PHOTO_PROVIDER -> data?.let {
val photos = PhotoProvider.getResultPhotoList(data) ?: return
val photos = PhotoProviderNew.getResultPhotoList(data) ?: return
if (photos.isNotEmpty()) {
val photo = photos[0]
crop(photo.uri, photo.size, mUri)

View File

@@ -57,8 +57,8 @@ public class ContactsIndicatorAdapter extends CommonNavigatorAdapter {
if (!showIndicator) return null;
DrawableIndicator indicator = new DrawableIndicator(context);
indicator.setMode(DrawableIndicator.MODE_EXACTLY);
indicator.setDrawableWidth(context.getResources().getDimensionPixelOffset(R.dimen.dp_24));
indicator.setDrawableHeight(context.getResources().getDimensionPixelOffset(R.dimen.dp_7));
indicator.setDrawableWidth(UIUtil.dip2px(context, 24));
indicator.setDrawableHeight(UIUtil.dip2px(context, 8));
indicator.setIndicatorDrawable(context.getResources().getDrawable(R.drawable.base_ic_indicator));
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.END;

View File

@@ -63,8 +63,8 @@ public class HomeRecommendIndicatorAdapter extends CommonNavigatorAdapter {
if (!showIndicator) return null;
DrawableIndicator indicator = new DrawableIndicator(context);
indicator.setMode(DrawableIndicator.MODE_EXACTLY);
indicator.setDrawableWidth(context.getResources().getDimensionPixelOffset(R.dimen.dp_24));
indicator.setDrawableHeight(context.getResources().getDimensionPixelOffset(R.dimen.dp_7));
indicator.setDrawableWidth(UIUtil.dip2px(context, 24));
indicator.setDrawableHeight(UIUtil.dip2px(context, 8));
indicator.setIndicatorDrawable(context.getResources().getDrawable(R.drawable.base_ic_indicator));
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.END;

View File

@@ -1,221 +0,0 @@
package com.chwl.app.ui.wallet.payment
import android.app.Activity
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.LifecycleOwner
import com.chwl.app.R
import com.chwl.app.common.widget.dialog.DialogManager
import com.chwl.core.pay.PayModel
import com.chwl.core.pay.bean.PayRecordId
import com.chwl.library.utils.SingleToastUtil
import com.example.lib_utils.log.ILog
import com.example.module_base.support.billing.IBillingResult
import com.example.module_base.support.billing.IBillingService
import com.example.module_base.support.billing.IProductDetails
import com.example.module_base.support.billing.IPurchase
import com.example.module_base.support.google.IGoogleService
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.disposables.Disposable
class GPaymentClient(val activity: Activity) : IPaymentClient, IBillingService.Listener,
IBillingService.ProductDetailsResponseListener, LifecycleEventObserver, ILog {
private var compositeDisposable: CompositeDisposable? = null
private var _billingService: IBillingService? = null
private val dialogManager = DialogManager(activity)
private var paymentIntent: PaymentIntent? = null
private var productItem: IProductDetails? = null
private var orderId: String? = null
init {
dialogManager.setCanceledOnClickOutside(false)
dialogManager.setCanceledOnClickBackKey(false)
(activity as? LifecycleOwner)?.lifecycle?.addObserver(this)
}
private fun getBillingService(): IBillingService? {
if (_billingService == null) {
_billingService = IGoogleService.newBillingService(activity, this)
}
return _billingService
}
override fun launchPayment(intent: PaymentIntent) {
logD("launchPayment() intent:${intent.productId}")
if (paymentIntent != null) {
SingleToastUtil.showToast(R.string.avroom_activity_roomblacklistactivity_015)
return
}
dialogManager.showProgressDialog(activity)
this.paymentIntent = intent
tryLaunch()
}
private fun tryLaunch() {
val productId = paymentIntent?.productId
val productItem = productItem
logD("tryLaunch() productId:$productId productItem:$productItem")
if (productId == null) {
return
}
if (getBillingService()?.isServiceConnected() != true) {
logD("tryLaunch() isServiceConnected = false")
return
}
if (productItem == null) {
getBillingService()?.querySkuDetailsAsync(listOf(productId), this)
} else {
placeOrder(productItem)
}
}
private fun placeOrder(productItem: IProductDetails) {
logD("placeOrder() productItem:${productItem.getProductId()}")
addDisposable(PayModel.get().placeOrder(productItem.getProductId())
.subscribe(
{ recordId: PayRecordId ->
if (paymentIntent?.productId == productItem.getProductId()) {
orderId = recordId.recordId
getBillingService()?.initiatePurchaseFlow(
productItem,
recordId.recordId
)
} else {
logE("placeOrder() 意图发生改变")
}
}
) { throwable: Throwable ->
callFailed(IPaymentClient.CODE_PLACE_ORDER_FAILED, throwable)
})
}
override fun onBillingClientSetupFinished() {
logD("onBillingClientSetupFinished()")
tryLaunch()
}
override fun onPurchasesUpdated(purchases: List<IPurchase>) {
logD("onPurchasesUpdated() purchases:${purchases.size}")
purchases.forEach {
logD("onPurchasesUpdated() item.state:${it.getPurchaseState()}")
logD("onPurchasesUpdated() item.orderId:${it.getOrderId()}")
logD("onPurchasesUpdated() item.token:${it.getPurchaseToken()}")
logD("onPurchasesUpdated() item.data:${it.getData()}")
val identifiers = it.getAccountIdentifiers()
if (it.isPurchasedState() && identifiers != null) {
addDisposable(
PayModel.get().verifyOrder(
identifiers.getObfuscatedAccountId(),
it.getProducts().firstOrNull(),
it.getPackageName(),
it.getPurchaseToken()
).subscribe({
getBillingService()?.consumeAsync(it)
}, {
callFailed(IPaymentClient.CODE_VERIFY_ORDER_FAILED, it)
})
)
}
}
}
override fun onConsumeFinished(token: String?, result: Int) {
logD("onConsumeFinished() token:${token} result:$result")
val orderId = orderId
if (orderId != null) {
callSuccess(orderId)
}
}
override fun onFailedHandle(result: Int) {
logD("onFailedHandle() result:${result}")
callFailed(IPaymentClient.CODE_OTHER)
}
override fun onProductDetailsResponse(
billingResult: IBillingResult,
productDetails: List<IProductDetails>
) {
logD("onProductDetailsResponse() billingResult:${billingResult.getResponseCode()} productDetails:${productDetails.size}")
if (billingResult.isResponseOk()) {
val item = productDetails.firstOrNull {
it.getProductId() == paymentIntent?.productId
}
productItem = item
if (item != null) {
tryLaunch()
} else {
callFailed(IPaymentClient.CODE_NOT_FOUND)
}
} else {
callFailed(IPaymentClient.CODE_NOT_FOUND)
}
}
private fun callSuccess(orderRecordId: String) {
logD("callSuccess() orderRecordId:${orderRecordId} productId:${paymentIntent?.productId}")
paymentIntent?.let {
it.listener.onResponse(PaymentResult.PaymentSuccess(it.productId, orderRecordId))
}
paymentIntent = null
dialogManager.dismissDialog()
}
private fun callFailed(code: Int, throwable: Throwable? = null) {
throwable?.printStackTrace()
logD("callFailed() code:${code} throwable:${throwable?.message}")
throwable?.let {
SingleToastUtil.showToast(
it.message
)
}
paymentIntent?.let {
it.listener.onResponse(PaymentResult.PaymentFailed(it.productId, code, throwable))
}
paymentIntent = null
dialogManager.dismissDialog()
}
private fun getCompositeDisposable(): CompositeDisposable {
var disposable = compositeDisposable
if (disposable == null) {
disposable = CompositeDisposable()
compositeDisposable = disposable
}
return disposable
}
private fun addDisposable(disposable: Disposable) {
getCompositeDisposable().add(disposable)
}
override fun onCleared() {
logD("onCleared()")
paymentIntent = null
compositeDisposable?.dispose()
compositeDisposable = null
dialogManager.dismissDialog()
}
override fun onStateChanged(source: LifecycleOwner, event: Lifecycle.Event) {
logD("onStateChanged() event:$event")
when (event) {
Lifecycle.Event.ON_RESUME -> {
if (_billingService?.isServiceConnected() == true) {
_billingService?.onQueryPurchases()
}
}
Lifecycle.Event.ON_DESTROY -> {
(activity as? LifecycleOwner)?.lifecycle?.removeObserver(this)
onCleared()
}
else -> {
}
}
}
}

View File

@@ -1,33 +0,0 @@
package com.chwl.app.ui.wallet.payment
import com.example.lib_utils.ICleared
interface IPaymentClient : ICleared {
companion object {
// 支付成功
const val CODE_SUCCESS = 200
// 未知异常原因
const val CODE_OTHER = 0
// 服务不可用
const val CODE_UNAVAILABLE = 1
// 查询订单信息失败
const val CODE_NOT_FOUND = 2
// 预下单失败
const val CODE_PLACE_ORDER_FAILED = 3
// 验证订单失败
const val CODE_VERIFY_ORDER_FAILED = 4
}
fun launchPayment(intent: PaymentIntent)
override fun onCleared()
interface Listener {
fun onResponse(result: PaymentResult)
}
}

View File

@@ -1,4 +0,0 @@
package com.chwl.app.ui.wallet.payment
class PaymentIntent(val productId: String, val listener: IPaymentClient.Listener) {
}

View File

@@ -1,12 +0,0 @@
package com.chwl.app.ui.wallet.payment
sealed class PaymentResult {
data class PaymentSuccess(val productId: String, val orderId: String) : PaymentResult()
data class PaymentFailed(
val productId: String,
val code: Int,
val exception: Throwable? = null
) : PaymentResult()
}

View File

@@ -91,8 +91,6 @@ public class CommonWebViewActivity extends BaseActivity {
private static final String POSITION = "position";
private int mPosition;
private JSInterface jsInterface;
public static void start(Context context, String url) {
Intent intent = new Intent(context, CommonWebViewActivity.class);
intent.putExtra("url", url);
@@ -196,7 +194,7 @@ public class CommonWebViewActivity extends BaseActivity {
webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE);
}
webView.getSettings().setTextZoom(100);
jsInterface = new JSInterface(webView, this);
JSInterface jsInterface = new JSInterface(webView, this);
jsInterface.setPosition(mPosition);
webView.addJavascriptInterface(jsInterface, "androidJsObj");
webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
@@ -443,9 +441,6 @@ public class CommonWebViewActivity extends BaseActivity {
@Override
protected void onDestroy() {
if (jsInterface != null) {
jsInterface.onCleared();
}
EventBus.getDefault().unregister(this);
if (webViewCallBack != null) {

View File

@@ -1,6 +1,8 @@
package com.chwl.app.ui.webview;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Build;
import android.text.TextUtils;
@@ -14,6 +16,7 @@ import androidx.appcompat.app.AlertDialog;
import com.orhanobut.logger.Logger;
import com.chwl.app.R;
import com.chwl.app.base.BaseBindingFragment;
import com.chwl.app.common.widget.dialog.BaseAlertDialogBuilder;
import com.chwl.app.databinding.FragmentCommonWebViewBinding;
import com.chwl.library.annatation.ActLayoutRes;
import com.chwl.library.utils.ResUtil;
@@ -23,7 +26,6 @@ public class CommonWebViewFragment extends BaseBindingFragment<FragmentCommonWeb
private WebView webView;
protected String url;
private JSInterface jsInterface;
@Override
public void initiate() {
@@ -35,7 +37,7 @@ public class CommonWebViewFragment extends BaseBindingFragment<FragmentCommonWeb
webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE);
}
webView.getSettings().setTextZoom(100);
jsInterface = new JSInterface(webView, getActivity());
JSInterface jsInterface = new JSInterface(webView, getActivity());
webView.addJavascriptInterface(jsInterface, "androidJsObj");
webView.setWebViewClient(new WebViewClient() {
@@ -111,12 +113,4 @@ public class CommonWebViewFragment extends BaseBindingFragment<FragmentCommonWeb
ShowWebView(url);
}
}
@Override
public void onDestroy() {
super.onDestroy();
if (jsInterface != null) {
jsInterface.onCleared();
}
}
}

View File

@@ -14,21 +14,13 @@ import android.util.Log;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import androidx.annotation.NonNull;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.chwl.app.earn.activity.EarnRecordActivity;
import com.chwl.app.ui.invite.InviteImageHelper;
import com.chwl.app.ui.invite.ShareInviteDialog;
import com.chwl.app.ui.invite.ShareInviteInfo;
import com.chwl.app.ui.wallet.payment.GPaymentClient;
import com.chwl.app.ui.wallet.payment.IPaymentClient;
import com.chwl.app.ui.wallet.payment.PaymentIntent;
import com.chwl.app.ui.wallet.payment.PaymentResult;
import com.chwl.library.language.LanguageHelper;
import com.chwl.library.utils.json.JsonUtils;
import com.example.lib_utils.ICleared;
import com.google.gson.Gson;
import com.netease.nim.uikit.common.util.log.LogUtil;
import com.orhanobut.logger.Logger;
@@ -74,7 +66,7 @@ import java.util.HashMap;
* <p> html js 与webview 交互接口</p>
* Created by ${user} on 2017/11/6.
*/
public class JSInterface implements ICleared {
public class JSInterface {
private static final String TAG = JSInterface.class.getSimpleName();
private WebView mWebView;
private CommonWebViewActivity mActivity;
@@ -83,7 +75,6 @@ public class JSInterface implements ICleared {
private MediaRecorder recorder;
private File myRecAudioFile;
private ExtAudioRecorder extAudioRecorder;
private GPaymentClient paymentClient;
public JSInterface(WebView webView, CommonWebViewActivity activity) {
mWebView = webView;
@@ -96,68 +87,6 @@ public class JSInterface implements ICleared {
this.context = context;
}
private void loadUrl(String url) {
com.example.lib_utils.log.LogUtil.d("JSInterface", "loadUrl url:" + url, false);
if (Looper.myLooper() == Looper.getMainLooper()) {
if (mWebView != null) {
mWebView.loadUrl(url);
}
} else {
if (mActivity != null) {
mActivity.runOnUiThread(() -> {
if (mWebView != null) {
mWebView.loadUrl(url);
}
});
}
}
}
private void callJsWithJson(String name, Object params) {
if (name == null) {
return;
}
if (params != null) {
String jsonStr = JsonUtils.toJson(params);
loadUrl("javascript:" + name + "(" + jsonStr + ")");
} else {
loadUrl("javascript:" + name + "()");
}
}
/**
* 拉起本地支付
*/
@JavascriptInterface
public void openPayment(String productId) {
com.example.lib_utils.log.LogUtil.d("JSInterface", "openPayment productId:" + productId, false);
if (mActivity == null || TextUtils.isEmpty(productId)) {
return;
}
mActivity.runOnUiThread(() -> {
if (paymentClient == null) {
paymentClient = new GPaymentClient(mActivity);
}
PaymentIntent paymentIntent = new PaymentIntent(productId, new IPaymentClient.Listener() {
@Override
public void onResponse(@NonNull PaymentResult result) {
HashMap<String, Object> map = new HashMap<>();
if (result instanceof PaymentResult.PaymentSuccess) {
map.put("orderId", ((PaymentResult.PaymentSuccess) result).getOrderId());
map.put("productId", ((PaymentResult.PaymentSuccess) result).getProductId());
map.put("code", 200);
} else if (result instanceof PaymentResult.PaymentFailed) {
map.put("code", ((PaymentResult.PaymentFailed) result).getCode());
map.put("productId", ((PaymentResult.PaymentFailed) result).getProductId());
}
callJsWithJson("openPaymentCallback", map);
}
});
paymentClient.launchPayment(paymentIntent);
});
}
/**
* 调转个人主页
*
@@ -193,7 +122,7 @@ public class JSInterface implements ICleared {
map.put(IReportConstants.MODULE, IReportConstants.MOLISTAR_PAY);
ReportManager.get().reportEvent(IReportConstants.PAYPAGE_SHOW, map);
// if (AppMetaDataUtil.getChannelID().equals(Constants.GOOGLE)) {
ChargeActivity.start(context);
ChargeActivity.start(context);
// } else {
// CommonWebViewActivity.start(
// context, UriProvider.getOfficialPay(
@@ -246,7 +175,7 @@ public class JSInterface implements ICleared {
if (activity == null) {
return;
}
ShareInviteInfo info = new Gson().fromJson(json, ShareInviteInfo.class);
ShareInviteInfo info = new Gson().fromJson(json,ShareInviteInfo.class);
if (info.getType() != null) {
if (info.getType() == 1) {
activity.runOnUiThread(() -> {
@@ -627,12 +556,4 @@ public class JSInterface implements ICleared {
PraiseModel.get().praise(Long.parseLong(uid), true).subscribe();
NimP2PMessageActivity.start(context, uid);
}
@Override
public void onCleared() {
ICleared.super.onCleared();
if (paymentClient != null) {
paymentClient.onCleared();
}
}
}

View File

@@ -27,8 +27,6 @@ import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.chwl.app.utils.AvatarHelper;
import com.chwl.library.widget.SVGAView;
import com.google.android.flexbox.FlexboxLayout;
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder;
@@ -121,7 +119,7 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
private UserInfo userInfo;
private ImageView closeImage;
private FrameLayout avatarLayout;
private SVGAView ivAvatarHeadWear;
private ImageView ivAvatarHeadWear;
private ImageView avatar;
/**
* 头像高斯模糊背景
@@ -248,7 +246,6 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
inNamePlate = findViewById(R.id.in_nameplate);
ivAvatarHeadWear = findViewById(R.id.iv_avatar_head_wear);
ivAvatarHeadWear.bindCache(AVRoomActivity.getSvgaCache());
ivBadge = findViewById(R.id.iv_badge);
ivBadge.setVisibility(View.GONE);
ivOfficialView = findViewById(R.id.iv_user_official);
@@ -681,12 +678,9 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
HeadWearInfo userHeadwear = userInfo.getUserHeadwear();
boolean havaHead = false;
// 设置普通人
if (userHeadwear != null) {
String avatarFrame = userHeadwear.getFirstUrl();
if (!TextUtils.isEmpty(avatarFrame)) {
havaHead = true;
AvatarHelper.loadAvatarFrame(ivAvatarHeadWear, avatarFrame, userHeadwear.getType());
}
if (userHeadwear != null && !TextUtils.isEmpty(userHeadwear.getPic())) {
havaHead = true;
NobleUtil.loadHeadWear(userHeadwear.getEffect() != null ? userHeadwear.getEffect() : userHeadwear.getPic(), ivAvatarHeadWear);
}
if (nobleInfo == null || TextUtils.isEmpty(nobleInfo.getCardBg())) {

View File

@@ -1,42 +0,0 @@
package com.chwl.app.utils
import androidx.core.view.isVisible
import com.chwl.app.R
import com.chwl.library.widget.SVGAView
import com.chwl.core.decoration.headwear.bean.HeadWearInfo
import com.chwl.core.noble.NobleUtil
object AvatarHelper {
/**
* 加载头饰
*/
@JvmStatic
fun loadAvatarFrame(view: SVGAView, headWearInfo: HeadWearInfo?) {
loadAvatarFrame(view, headWearInfo?.firstUrl, headWearInfo?.type ?: 0)
}
/**
* 加载头饰
* @param type 头饰类型 0:图片、1:SVGA
*/
@JvmStatic
fun loadAvatarFrame(view: SVGAView, url: String?, type: Int) {
view.setTag(R.id.head_wear, url)
if (url.isNullOrEmpty()) {
view.clearAnimation()
view.stopAnimation()
view.setImageDrawable(null)
return
}
if (type == 1) {
view.clearAnimation()
view.loadUrl(url)
view.isVisible = true
} else {
view.stopAnimation()
NobleUtil.loadHeadWear(url, view, R.id.head_wear, url)
view.isVisible = true
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 890 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 941 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="15dp" />
<solid android:color="#85F6D3" />
</shape>

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="15dp" />
<solid android:color="#F3F5FA" />
</shape>

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="7dp" />
<solid android:color="#F3F5FA" />
</shape>

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp" />
<solid android:color="#F3F5FA" />
</shape>

View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_normal_1c1b22"
android:orientation="vertical"
tools:context="com.chwl.app.ui.setting.FeedbackActivity">
<com.chwl.app.base.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/line_353548" />
<TextView
android:layout_width="match_parent"
android:layout_height="44dp"
android:drawableStart="@drawable/feedback_point"
android:drawablePadding="4dp"
android:gravity="center_vertical"
android:paddingStart="15dp"
android:text="@string/layout_activity_feedback_01"
android:textColor="@color/text_title_color"
android:textSize="15sp" />
<EditText
android:id="@+id/edt_content"
android:layout_width="match_parent"
android:layout_height="161dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:background="@drawable/bg_secondary_radius_15"
android:gravity="start"
android:hint="@string/layout_activity_feedback_02"
android:padding="10dp"
android:textColor="@color/text_normal_c6c6e9"
android:textColorHint="@color/text_hint_555574"
android:textSize="14sp" />
<EditText
android:id="@+id/edt_contact"
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_marginStart="15dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="15dp"
android:background="@drawable/bg_secondary_radius_15"
android:hint="@string/layout_activity_feedback_03"
android:padding="10dp"
android:textColor="@color/text_normal_c6c6e9"
android:textColorHint="@color/text_hint_555574"
android:textSize="14sp" />
<Button
android:id="@+id/btn_commit"
style="?android:attr/borderlessButtonStyle"
android:layout_width="310dp"
android:layout_height="45dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="45dp"
android:background="@drawable/base_selector_theme_30dp"
android:text="@string/layout_activity_feedback_04"
android:textColor="@color/base_selector_color_theme_btn"
android:textSize="15sp" />
</LinearLayout>

View File

@@ -14,19 +14,6 @@
android:src="@drawable/bg_theme_top"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_feedback"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_marginTop="@dimen/dp_30"
android:layout_marginEnd="@dimen/dp_15"
android:gravity="center"
android:text="@string/feedback_title"
android:textColor="#000000"
android:textSize="@dimen/dp_14"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_logo"
app:layout_constraintEnd_toEndOf="parent"

View File

@@ -80,9 +80,8 @@
app:strokeColor="@color/white"
app:strokeWidth="@dimen/dp_1" />
<com.chwl.library.widget.SVGAView
<ImageView
android:id="@+id/iv_head_wear"
android:scaleType="centerCrop"
android:layout_width="@dimen/dp_97"
android:layout_height="@dimen/dp_97"
app:layout_constraintBottom_toBottomOf="@id/iv_user_head"

View File

@@ -1,45 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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">
<com.chwl.app.base.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical"
android:overScrollMode="never"
android:scrollbars="none"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toTopOf="@id/layout_bottom"
app:layout_constraintTop_toBottomOf="@id/title_bar" />
<LinearLayout
android:id="@+id/layout_bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent">
<Button
android:id="@+id/btn_refresh_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="REFRESH-ALL" />
<Button
android:id="@+id/btn_refresh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="REFRESH" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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="@dimen/dp_80"
android:layout_marginVertical="@dimen/dp_2">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_15"
android:textSize="@dimen/dp_18"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.chwl.library.widget.SVGAView
android:id="@+id/svga_view"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/dp_15"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintStart_toEndOf="@id/tv_name"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -66,7 +66,7 @@
android:layout_height="55dp"
android:layout_gravity="center" />
<com.chwl.library.widget.SVGAView
<ImageView
android:id="@+id/iv_avatar_head_wear"
android:layout_width="73dp"
android:layout_height="73dp"

View File

@@ -1,221 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_FFFFFF">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#EBECF3"
android:paddingTop="@dimen/dp_30"
app:layout_constraintTop_toTopOf="parent">
<com.chwl.app.base.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_customer_service"
android:layout_width="@dimen/dp_30"
android:layout_height="@dimen/dp_30"
android:layout_marginEnd="@dimen/dp_9"
android:scaleType="centerInside"
android:src="@drawable/feedback_ic_customer_service"
app:layout_constraintBottom_toBottomOf="@id/title_bar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/title_bar" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/layout_title_bar">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tv_type_title_prefix"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_29"
android:text="*"
android:textColor="#EB5C2C"
android:textSize="@dimen/dp_16"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_type_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/feedback_type_title"
android:textColor="#000000"
android:textSize="@dimen/dp_16"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/tv_type_title_prefix"
app:layout_constraintStart_toEndOf="@id/tv_type_title_prefix"
app:layout_constraintTop_toTopOf="@id/tv_type_title_prefix" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_2"
android:layout_marginTop="@dimen/dp_9"
android:overScrollMode="never"
android:scrollbars="none"
app:layout_constraintTop_toBottomOf="@id/tv_type_title"
tools:itemCount="2"
tools:listitem="@layout/feedback_item_type" />
<TextView
android:id="@+id/tv_content_title_prefix"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_23"
android:text="*"
android:textColor="#EB5C2C"
android:textSize="@dimen/dp_16"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@id/tv_type_title_prefix"
app:layout_constraintTop_toBottomOf="@id/recycler_view_type" />
<TextView
android:id="@+id/tv_content_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/feedback_content_title"
android:textColor="#000000"
android:textSize="@dimen/dp_16"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/tv_content_title_prefix"
app:layout_constraintStart_toEndOf="@id/tv_content_title_prefix"
app:layout_constraintTop_toTopOf="@id/tv_content_title_prefix" />
<EditText
android:id="@+id/et_content"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_149"
android:layout_marginHorizontal="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_16"
android:background="@drawable/shape_f3f5fa_7dp"
android:hint="@string/feedback_content_hint"
android:maxLength="300"
android:paddingHorizontal="@dimen/dp_9"
android:paddingTop="@dimen/dp_9"
android:paddingBottom="@dimen/dp_35"
android:textColor="#22252C"
android:textColorHint="#ACB0B7"
android:textSize="@dimen/dp_14"
app:layout_constraintTop_toBottomOf="@id/tv_content_title" />
<TextView
android:id="@+id/tv_content_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_13"
android:layout_marginBottom="@dimen/dp_14"
android:text="0/300"
android:textColor="#A7ACB3"
android:textSize="@dimen/dp_14"
app:layout_constraintBottom_toBottomOf="@id/et_content"
app:layout_constraintEnd_toEndOf="@id/et_content" />
<TextView
android:id="@+id/tv_image_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_23"
android:text="@string/feedback_image_title"
android:textColor="#000000"
android:textSize="@dimen/dp_16"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@id/tv_type_title_prefix"
app:layout_constraintTop_toBottomOf="@id/et_content" />
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/iv_image"
android:layout_width="@dimen/dp_76"
android:layout_height="@dimen/dp_76"
android:layout_marginStart="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_16"
android:background="#F3F5FA"
android:scaleType="centerInside"
android:src="@drawable/feedback_ic_add"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_image_title"
app:shapeAppearance="@style/shape_corner_8dp" />
<TextView
android:id="@+id/tv_contact_title_prefix"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30"
android:text="*"
android:textColor="#EB5C2C"
android:textSize="@dimen/dp_16"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@id/tv_type_title_prefix"
app:layout_constraintTop_toBottomOf="@id/iv_image" />
<TextView
android:id="@+id/tv_contact_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/feedback_contact_title"
android:textColor="#000000"
android:textSize="@dimen/dp_16"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/tv_contact_title_prefix"
app:layout_constraintStart_toEndOf="@id/tv_contact_title_prefix"
app:layout_constraintTop_toTopOf="@id/tv_contact_title_prefix" />
<EditText
android:id="@+id/et_contact"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_43"
android:layout_marginHorizontal="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_16"
android:background="@drawable/shape_f3f5fa_8dp"
android:gravity="center_vertical"
android:hint="@string/feedback_contact_hint"
android:maxLength="100"
android:maxLines="1"
android:paddingHorizontal="@dimen/dp_9"
android:singleLine="true"
android:textColor="#22252C"
android:textColorHint="#ACB0B7"
android:textSize="@dimen/dp_14"
app:layout_constraintTop_toBottomOf="@id/tv_contact_title" />
<TextView
android:id="@+id/tv_submit"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_49"
android:layout_marginHorizontal="@dimen/dp_36"
android:layout_marginTop="@dimen/dp_58"
android:layout_marginBottom="@dimen/dp_30"
android:background="@drawable/base_selector_theme_26dp"
android:enabled="false"
android:gravity="center"
android:text="@string/layout_activity_modify_pwd_07"
android:textColor="@color/base_selector_color_theme_btn"
android:textSize="@dimen/dp_17"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/et_contact" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools">
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/layout_root"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_43"
android:background="@drawable/base_shape_ffffff_15o5dp"
android:clickable="true">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_22"
android:layout_marginTop="@dimen/dp_30"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintHeight_max="@dimen/dp_350"
app:layout_constraintTop_toTopOf="parent"
tools:itemCount="3"
tools:listitem="@layout/feedback_customer_service_item" />
<TextView
android:id="@+id/tv_next"
android:layout_width="@dimen/dp_120"
android:layout_height="@dimen/dp_38"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_15"
android:background="@drawable/base_shape_theme_19dp"
android:gravity="center"
android:text="@string/login_fragment_adduserinfofragment_04"
android:textColor="@color/base_selector_color_theme_btn"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/recycler_view" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
</layout>

View File

@@ -1,43 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="3"
android:textColor="#333333"
android:textSize="@dimen/dp_16"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/layout_copy"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_default="wrap"
tools:text="meNameNameNaNmeNameNameNaNmeNameNameNaNameNameNameNameNaNameNameNameNameNaameNameNameNameNaNameNameNameNameNameNameNameNaNameNameNameNameNaNameNameNameNameNaameNameNameNameNaNameNameNameNameNa11" />
<FrameLayout
android:id="@+id/layout_copy"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tv_content"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_copy"
android:layout_width="@dimen/dp_13"
android:layout_height="@dimen/dp_13"
android:layout_gravity="center"
android:scaleType="fitCenter"
android:src="@drawable/feedback_ic_copy" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_31"
android:layout_marginHorizontal="@dimen/dp_12"
android:layout_marginVertical="@dimen/dp_7"
android:background="@drawable/shape_85f6d3_15dp"
android:gravity="center"
android:paddingHorizontal="@dimen/dp_10"
android:textColor="#22252C"
android:textSize="@dimen/dp_14"
tools:text="NAME" />

View File

@@ -10,7 +10,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/bg_theme_top_home"
android:src="@drawable/bg_theme_top"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout

View File

@@ -49,7 +49,7 @@
android:visibility="invisible"
tools:visibility="visible" />
<com.chwl.library.widget.SVGAView
<ImageView
android:id="@+id/iv_head_wear"
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@@ -56,7 +56,7 @@
android:visibility="invisible"
tools:visibility="gone" />
<com.chwl.library.widget.SVGAView
<ImageView
android:id="@+id/iv_head_wear"
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<variable
name="headWearInfo"
type="com.chwl.core.decoration.headwear.bean.HeadWearInfo" />
<variable
name="select_position"
type="Boolean" />
</data>
<LinearLayout
android:id="@+id/ll_root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/bg_item_select">
<RelativeLayout
android:id="@+id/rl_head_wear"
android:padding="5dp"
android:layout_width="match_parent"
android:layout_height="106dp"
android:layout_gravity="center_horizontal">
<ImageView
android:id="@+id/iv_head_wear"
android:layout_width="88dp"
android:layout_height="88dp"
android:layout_marginTop="6dp"
android:layout_marginStart="11dp"
android:layout_marginEnd="11dp"
android:layout_centerInParent="true" />
<ImageView
android:id="@+id/iv_tag"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentTop="true"
tools:src="@drawable/ic_mark_limit"/>
</RelativeLayout>
<TextView
android:id="@+id/tv_head_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
android:layout_marginBottom="14dp"
android:textColor="@{select_position?@color/appColor:@color/color_666666}"
android:textSize="14sp" />
</LinearLayout>
</layout>

View File

@@ -97,7 +97,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.chwl.library.widget.SVGAView
<ImageView
android:id="@+id/iv_head_wear"
android:layout_width="0dp"
android:layout_height="0dp"

View File

@@ -97,7 +97,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.chwl.library.widget.SVGAView
<ImageView
android:id="@+id/iv_head_wear"
android:layout_width="0dp"
android:layout_height="0dp"

View File

@@ -73,7 +73,7 @@
tools:visibility="visible" />
<com.chwl.library.widget.SVGAView
<ImageView
android:id="@+id/iv_head_wear"
android:layout_width="0dp"
android:layout_height="0dp"
@@ -92,10 +92,6 @@
android:gravity="center"
android:includeFontPadding="false"
android:text="@string/layout_item_micro_game_01"
app:autoSizeMaxTextSize="10dp"
app:autoSizeMinTextSize="5dp"
app:autoSizeStepGranularity="1px"
app:autoSizeTextType="uniform"
android:textColor="@color/white"
android:textSize="10dp"
android:visibility="gone"

View File

@@ -22,7 +22,7 @@
android:layout_height="60dp"
android:layout_gravity="center" />
<com.chwl.library.widget.SVGAView
<ImageView
android:id="@+id/iv_head_wear"
android:layout_width="52.8dp"
android:layout_height="52.8dp"

View File

@@ -23,7 +23,7 @@
android:background="@drawable/bg_secondary_radius_15"
android:gravity="center">
<com.chwl.library.widget.SVGAView
<ImageView
android:id="@+id/iv_car_cover"
android:layout_width="63dp"
android:layout_height="63dp"

View File

@@ -48,7 +48,7 @@
android:visibility="invisible"
tools:visibility="gone" />
<com.chwl.library.widget.SVGAView
<ImageView
android:id="@+id/iv_head_wear"
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@@ -52,7 +52,7 @@
android:visibility="invisible"
tools:visibility="gone" />
<com.chwl.library.widget.SVGAView
<ImageView
android:id="@+id/iv_head_wear"
tools:visibility="gone"
android:layout_width="match_parent"

View File

@@ -1,94 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<layout>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tv_headline_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/room_bg_headline">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/iv_avatar"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_marginStart="@dimen/dp_7_5"
android:layout_marginTop="@dimen/dp_7_5"
android:scaleType="centerCrop"
android:src="@drawable/default_avatar"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:shapeAppearance="@style/shape_circle" />
<ImageView
android:layout_width="@dimen/dp_23"
android:layout_height="@dimen/dp_23"
android:src="@drawable/room_bg_headline_avatar_frame"
app:layout_constraintBottom_toBottomOf="@id/iv_avatar"
app:layout_constraintEnd_toEndOf="@id/iv_avatar"
app:layout_constraintStart_toStartOf="@id/iv_avatar"
app:layout_constraintTop_toTopOf="@id/iv_avatar" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_4"
android:ellipsize="end"
android:maxWidth="@dimen/dp_150"
android:maxLines="1"
android:textColor="#F5EA8E"
android:textSize="@dimen/dp_12"
app:layout_constraintBottom_toBottomOf="@id/iv_avatar"
app:layout_constraintStart_toEndOf="@id/iv_avatar"
app:layout_constraintTop_toTopOf="@id/iv_avatar"
tools:text="Name" />
<com.chwl.app.view.AutoMirroredImageView
android:id="@+id/iv_money_bg"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_15"
android:src="@drawable/room_bg_headline_money"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_6"
android:maxLines="1"
android:text="0"
android:textColor="@color/white"
android:textSize="@dimen/dp_8"
app:layout_constraintBottom_toBottomOf="@id/iv_money_bg"
app:layout_constraintEnd_toEndOf="@id/iv_money_bg"
app:layout_constraintTop_toTopOf="@id/iv_money_bg" />
<ImageView
android:layout_width="@dimen/dp_10"
android:layout_height="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_2"
android:scaleType="fitCenter"
android:src="@drawable/icon_diamond"
app:layout_constraintBottom_toBottomOf="@id/iv_money_bg"
app:layout_constraintEnd_toStartOf="@id/tv_money"
app:layout_constraintTop_toTopOf="@id/iv_money_bg" />
<TextView
android:id="@+id/tv_headline_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_1"
android:layout_marginEnd="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_7"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_12"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/tv_name"
app:layout_constraintTop_toBottomOf="@id/iv_avatar"
tools:text="Content" />
</androidx.constraintlayout.widget.ConstraintLayout>
android:layout_marginTop="@dimen/dp_8"
android:background="@drawable/room_bg_headline"
android:paddingHorizontal="@dimen/dp_10"
android:paddingTop="@dimen/dp_9"
android:paddingBottom="@dimen/dp_9"
android:textColor="#FFF6E1"
android:textSize="@dimen/dp_13"
tools:text="Content" />
</layout>

View File

@@ -150,7 +150,7 @@
android:layout_height="@dimen/dp_48"
android:layout_marginHorizontal="@dimen/dp_36"
android:layout_marginBottom="@dimen/dp_30"
android:background="@drawable/base_shape_theme_24dp"
android:background="@drawable/base_shape_theme2_24dp"
android:gravity="center"
android:text="@string/room_type_use"
android:textColor="@color/white"

View File

@@ -5314,13 +5314,4 @@
<string name="room_type_revelry">كرنفال صاخب</string>
<string name="room_type_using">قيد الاستخدام</string>
<string name="room_type_use">الاستخدام</string>
<string name="feedback_title">التعليق</string>
<string name="feedback_type_title">اختر نوع المشكلة</string>
<string name="feedback_content_title">صف المشكلة</string>
<string name="feedback_image_title">تحميل لقطة شاشة</string>
<string name="feedback_contact_title">وسيلة تواصل</string>
<string name="feedback_content_hint">من فضلك ادخل</string>
<string name="feedback_contact_hint"> رقم الهاتف او البريد الالكتروني</string>
</resources>

View File

@@ -5254,12 +5254,4 @@
<string name="room_type_revelry">狂歡</string>
<string name="room_type_using">使用中</string>
<string name="room_type_use">使用</string>
<string name="feedback_title">反饋</string>
<string name="feedback_type_title">選擇問題類型</string>
<string name="feedback_content_title">問題描述</string>
<string name="feedback_image_title">上傳截圖</string>
<string name="feedback_contact_title">聯係方式</string>
<string name="feedback_content_hint">請輸入…</string>
<string name="feedback_contact_hint">手機號或郵箱</string>
</resources>

View File

@@ -742,8 +742,4 @@
<color name="color_7F191919">#7F191919</color>
<color name="color_CC191919">#CC191919</color>
<color name="color_FEFFBF">#FEFFBF</color>
<color name="color_0C1D18">#0C1D18</color>
<color name="color_990C1D18">#990C1D18</color>
<color name="color_002512">#002512</color>
<color name="color_3FDDAC">#3FDDAC</color>
</resources>

View File

@@ -13,8 +13,6 @@
<item type="id" name="mic_item_head_wear" />
<item type="id" name="head_wear" />
<item type="id" name="guide_view" />
<item name="animator" type="id" />

View File

@@ -5294,16 +5294,6 @@ You cannot join again within 24 hours after leaving</string>
<string name="room_type_revelry">Carnival</string>
<string name="room_type_using">Using</string>
<string name="room_type_use">Use</string>
<string name="feedback_title">Feedback</string>
<string name="feedback_type_title">Choose the problem type</string>
<string name="feedback_content_title">Describe the problem</string>
<string name="feedback_image_title">Upload screenshot</string>
<string name="feedback_contact_title">Contact information</string>
<string name="feedback_content_hint">Please enter...</string>
<string name="feedback_contact_hint">Mobile phone number or email</string>
</resources>

Some files were not shown because too many files have changed in this diff Show More