删除装扮商城相关代码
This commit is contained in:
@@ -404,10 +404,6 @@
|
||||
android:name=".decoration.view.MyDecorationActivity"
|
||||
android:label="@string/main_androidmanifest_027"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".decoration.view.DecorationStoreActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".ui.user.activity.UserGiftActivity"
|
||||
android:screenOrientation="portrait"
|
||||
@@ -655,12 +651,6 @@
|
||||
<activity
|
||||
android:name="com.chwl.app.room_chat.activity.RoomMsgActivity"
|
||||
android:theme="@style/room_message_activity" />
|
||||
<activity
|
||||
android:name="com.chwl.app.room_chat.activity.RoomNewbieActivity"
|
||||
android:theme="@style/room_message_activity" />
|
||||
<activity
|
||||
android:name="com.chwl.app.room_chat.activity.RoomNewbieMessageActivity"
|
||||
android:theme="@style/room_message_activity" />
|
||||
<activity
|
||||
android:name="com.chwl.app.room_chat.activity.RoomInviteFansActivity"
|
||||
android:theme="@style/room_message_activity" />
|
||||
@@ -704,42 +694,6 @@
|
||||
<activity
|
||||
android:name=".audio.VoiceMatchActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".miniworld.activity.MiniWorldGuestPageActivity"
|
||||
android:screenOrientation="portrait" /> <!-- 推荐位 -->
|
||||
<activity
|
||||
android:name=".miniworld.activity.TopicMainActivity"
|
||||
android:screenOrientation="portrait" /> <!-- 房间内私聊 -->
|
||||
<activity
|
||||
android:name=".miniworld.activity.MiniWorldEditActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".miniworld.activity.MiniWorldMemberListActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".miniworld.activity.MiniWorldTeamMessageActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".miniworld.activity.MWTeamRoomMessageAct"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/room_message_activity" />
|
||||
<activity
|
||||
android:name=".miniworld.activity.MiniWorldGroupThemeActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".miniworld.activity.MiniWorldActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".miniworld.activity.AllTopicActivity"
|
||||
android:screenOrientation="portrait" /> <!-- 房间内私聊 -->
|
||||
<!-- 萝卜-签到-任务 -->
|
||||
<activity
|
||||
android:name=".miniworld.activity.MiniWorldSearchActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".miniworld.activity.MiniWorldMainActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity android:name=".ui.im.friend.ActFriendList" />
|
||||
<activity
|
||||
android:name=".bank_card.activity.BankCardListActivity"
|
||||
@@ -760,19 +714,10 @@
|
||||
android:name=".home.activity.CommunityNoticeAct"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".community.publish.view.PublishActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustNothing" />
|
||||
<activity
|
||||
android:name=".community.dynamic.view.DynamicDetailActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name=".community.photo.PreviewPhotoActivity"
|
||||
android:name=".photo.PreviewPhotoActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".community.photo.BigPhotoActivity"
|
||||
android:name=".photo.BigPhotoActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.example.matisse.ui.MatisseActivity"
|
||||
@@ -908,12 +853,6 @@
|
||||
<activity
|
||||
android:name=".fansteam.FansTeamListActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".shipantics.PullRadishActivity"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
<activity
|
||||
android:name=".shipantics.RadishRankingActivity"
|
||||
android:theme="@style/room_message_activity" />
|
||||
<activity
|
||||
android:name=".AgentActivity"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
|
||||
|
@@ -1,110 +0,0 @@
|
||||
package com.chwl.app.decoration.view
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.base.BaseViewBindingFragment
|
||||
import com.chwl.app.common.EmptyViewHelper
|
||||
import com.chwl.app.databinding.FragmentDecorationCommonBinding
|
||||
import com.chwl.app.decoration.adapter.DecorationCommonAdapter
|
||||
import com.chwl.app.decoration.viewmodel.DecorationViewModel
|
||||
import com.chwl.app.ui.relation.FansListActivity
|
||||
import com.chwl.app.ui.utils.RVDelegate
|
||||
import com.chwl.core.decoration.bean.DecorationInfo
|
||||
import com.chwl.core.decoration.DecorationInfoEvent
|
||||
import com.chwl.library.annatation.ActLayoutRes
|
||||
import com.chwl.library.utils.ResUtil
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
|
||||
/**
|
||||
* Created by huangmeng1 on 2018/5/7.
|
||||
*/
|
||||
@ActLayoutRes(R.layout.fragment_decoration_common)
|
||||
class DecorationCommonFragment : BaseViewBindingFragment<FragmentDecorationCommonBinding>() {
|
||||
|
||||
companion object {
|
||||
fun newInstance(dressType: Int): DecorationCommonFragment {
|
||||
val args = Bundle()
|
||||
args.putInt("dressType", dressType)
|
||||
val fragment = DecorationCommonFragment()
|
||||
fragment.arguments = args
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
|
||||
private val dressType: Int by lazy { requireArguments().getInt("dressType") }
|
||||
private lateinit var rvDelegate: RVDelegate<DecorationInfo>
|
||||
private lateinit var decorationAdapter: DecorationCommonAdapter
|
||||
private val decorationViewModel: DecorationViewModel by viewModels()
|
||||
|
||||
override fun init() {
|
||||
|
||||
decorationViewModel.loadingLiveData.observe(viewLifecycleOwner) {
|
||||
if (it) dialogManager.showProgressDialog(mContext)
|
||||
else dialogManager.dismissDialog()
|
||||
}
|
||||
decorationAdapter = if (dressType == DecorationStoreActivity.TAB_USER_CARD) {
|
||||
DecorationCommonAdapter(R.layout.item_decoration_user_card)
|
||||
} else {
|
||||
DecorationCommonAdapter()
|
||||
}
|
||||
rvDelegate = RVDelegate.Builder<DecorationInfo>()
|
||||
.setAdapter(decorationAdapter)
|
||||
.setRecyclerView(binding.recyclerView)
|
||||
.setRefreshLayout(binding.swipeRefresh)
|
||||
.setEmptyView(EmptyViewHelper.createEmptyTextView(mContext, ResUtil.getString(R.string.decoration_view_decorationcommonfragment_01)))
|
||||
.setLayoutManager(
|
||||
if (dressType == DecorationStoreActivity.TAB_USER_CARD) {
|
||||
LinearLayoutManager(mContext)
|
||||
} else {
|
||||
GridLayoutManager(mContext, 2, GridLayoutManager.VERTICAL, false)
|
||||
}
|
||||
)
|
||||
.build()
|
||||
binding.swipeRefresh.setOnRefreshListener {
|
||||
decorationViewModel.getDecorationInfoList(dressType)
|
||||
}
|
||||
decorationViewModel.getDecorationInfoList(dressType)
|
||||
decorationViewModel.decorationInfoListLiveData.observe(viewLifecycleOwner) {
|
||||
rvDelegate.loadData(it)
|
||||
}
|
||||
|
||||
decorationAdapter.setOnItemChildClickListener { _, view, position ->
|
||||
val decorationInfo =
|
||||
decorationAdapter.getItem(position) ?: return@setOnItemChildClickListener
|
||||
when (view.id) {
|
||||
R.id.tv_buy -> {
|
||||
dialogManager.showOkCancelDialog(
|
||||
ResUtil.getString(R.string.decoration_view_decorationcommonfragment_02),
|
||||
mContext.resources.getString(
|
||||
R.string.buy_decoration_info_text,
|
||||
decorationInfo.name,
|
||||
decorationInfo.dressDay.toString()
|
||||
),
|
||||
ResUtil.getString(R.string.decoration_view_decorationcommonfragment_03),
|
||||
ResUtil.getString(R.string.decoration_view_decorationcommonfragment_04),
|
||||
true
|
||||
) {
|
||||
decorationViewModel.buyDecoration(
|
||||
decorationInfo.dressType,
|
||||
decorationInfo.id
|
||||
)
|
||||
}
|
||||
}
|
||||
R.id.tv_send -> {
|
||||
EventBus.getDefault().postSticky(DecorationInfoEvent(decorationInfo))
|
||||
FansListActivity.start(mContext, FansListActivity.TYPE_DECORATION)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
EventBus.getDefault().removeStickyEvent(DecorationInfoEvent::class.java)
|
||||
}
|
||||
|
||||
}
|
@@ -1,147 +0,0 @@
|
||||
package com.chwl.app.decoration.view
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.view.View
|
||||
import androidx.activity.viewModels
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentPagerAdapter
|
||||
import com.netease.nim.uikit.StatusBarUtil
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.base.BaseViewBindingActivity
|
||||
import com.chwl.app.base.TitleBar
|
||||
import com.chwl.app.databinding.ActivityDecorationStoreBinding
|
||||
import com.chwl.app.decoration.view.widgets.CarMagicIndicator
|
||||
import com.chwl.app.decoration.view.widgets.MyDecorationMagicIndicator
|
||||
import com.chwl.app.decoration.viewmodel.DecorationViewModel
|
||||
import com.chwl.app.home.helper.BannerHelper
|
||||
import com.chwl.app.ui.pay.ChargeActivity
|
||||
import com.chwl.app.ui.webview.CommonWebViewActivity
|
||||
import com.chwl.app.ui.widget.magicindicator.ViewPagerHelper
|
||||
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
||||
import com.chwl.core.Constants
|
||||
import com.chwl.core.UriProvider
|
||||
import com.chwl.core.home.bean.TabInfo
|
||||
import com.chwl.core.pay.PayModel
|
||||
import com.chwl.core.pay.event.UpdateWalletInfoEvent
|
||||
import com.chwl.library.annatation.ActLayoutRes
|
||||
import com.chwl.library.common.util.DeviceUtil
|
||||
import com.chwl.library.utils.AppMetaDataUtil
|
||||
import com.chwl.library.utils.FormatUtils
|
||||
import com.chwl.library.utils.ResUtil
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
@ActLayoutRes(R.layout.activity_decoration_store)
|
||||
class DecorationStoreActivity : BaseViewBindingActivity<ActivityDecorationStoreBinding>(),
|
||||
CarMagicIndicator.OnItemSelectListener, MyDecorationMagicIndicator.OnItemSelectListener {
|
||||
|
||||
companion object {
|
||||
|
||||
const val TAB_HEAD_WEAR = 0
|
||||
const val TAB_CAR = 1
|
||||
const val TAB_NAMEPLATE = 2
|
||||
const val TAB_USER_CARD = 3
|
||||
const val TAB_CHAT_BUBBLE = 4
|
||||
|
||||
@JvmStatic
|
||||
fun start(context: Context, position: Int) {
|
||||
val intent = Intent(context, DecorationStoreActivity::class.java)
|
||||
intent.putExtra(Constants.KEY_POSITION, position)
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
private var mPosition = 0
|
||||
private val decorationViewModel: DecorationViewModel by viewModels()
|
||||
|
||||
override fun init() {
|
||||
EventBus.getDefault().register(this)
|
||||
initWhiteTitleBar(ResUtil.getString(R.string.decoration_view_decorationstoreactivity_01))
|
||||
mTitleBar?.addAction(object : TitleBar.TextAction(
|
||||
ResUtil.getString(R.string.decoration_view_decorationstoreactivity_02), Color.parseColor("#999999")
|
||||
) {
|
||||
override fun performAction(view: View) {
|
||||
MyDecorationActivity.start(this@DecorationStoreActivity, 0)
|
||||
}
|
||||
})
|
||||
mPosition = intent.getIntExtra(Constants.KEY_POSITION, 0)
|
||||
initViews()
|
||||
decorationViewModel.bannerLiveData.observe(this) {
|
||||
BannerHelper.setBanner(binding.rollView, it)
|
||||
}
|
||||
|
||||
binding.tvCharge.setOnClickListener {
|
||||
// if (AppMetaDataUtil.getChannelID() == Constants.GOOGLE) {
|
||||
ChargeActivity.start(this)
|
||||
// } else {
|
||||
// CommonWebViewActivity.start(
|
||||
// this, UriProvider.getOfficialPay(
|
||||
// 4,
|
||||
// DeviceUtil.getDeviceId(this)
|
||||
// )
|
||||
// )
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
private fun initViews() {
|
||||
onWalletInfoUpdate(null)
|
||||
val viewPager = binding.viewpager
|
||||
val mMagicIndicator = binding.viewIndicator
|
||||
val tabInfoList: MutableList<TabInfo> = ArrayList(5)
|
||||
tabInfoList.add(TabInfo(TAB_HEAD_WEAR, ResUtil.getString(R.string.decoration_view_decorationstoreactivity_03)))
|
||||
tabInfoList.add(TabInfo(TAB_CAR, ResUtil.getString(R.string.decoration_view_decorationstoreactivity_04)))
|
||||
tabInfoList.add(TabInfo(TAB_NAMEPLATE, ResUtil.getString(R.string.decoration_view_decorationstoreactivity_05)))
|
||||
tabInfoList.add(TabInfo(TAB_USER_CARD, ResUtil.getString(R.string.decoration_view_decorationstoreactivity_06)))
|
||||
tabInfoList.add(TabInfo(TAB_CHAT_BUBBLE, ResUtil.getString(R.string.decoration_view_decorationstoreactivity_07)))
|
||||
val commonNavigator = CommonNavigator(this)
|
||||
commonNavigator.isAdjustMode = true
|
||||
val indicator = MyDecorationMagicIndicator(this, tabInfoList)
|
||||
indicator.setOnItemSelectListener(this)
|
||||
commonNavigator.adapter = indicator
|
||||
mMagicIndicator.navigator = commonNavigator
|
||||
ViewPagerHelper.bind(mMagicIndicator, viewPager)
|
||||
viewPager.adapter = object : FragmentPagerAdapter(
|
||||
supportFragmentManager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
|
||||
) {
|
||||
override fun getCount(): Int {
|
||||
return tabInfoList.size
|
||||
}
|
||||
|
||||
override fun getItem(position: Int): Fragment {
|
||||
return DecorationCommonFragment.newInstance(position)
|
||||
}
|
||||
}
|
||||
viewPager.currentItem = mPosition
|
||||
}
|
||||
|
||||
override fun onItemSelect(position: Int) {
|
||||
binding.viewpager.currentItem = position
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onWalletInfoUpdate(event: UpdateWalletInfoEvent?) {
|
||||
binding.tvDiamondNum.text =
|
||||
FormatUtils.formatBigInteger(PayModel.get().currentWalletInfo?.diamondNum ?: 0.0)
|
||||
}
|
||||
|
||||
override fun needSteepStateBar(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun setStatusBar() {
|
||||
super.setStatusBar()
|
||||
StatusBarUtil.transparencyBar(this)
|
||||
StatusBarUtil.StatusBarLightMode(this)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
EventBus.getDefault().unregister(this)
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -15,7 +15,6 @@ import com.chwl.app.avroom.recommendcard.MyRecommendCardActivity;
|
||||
import com.chwl.app.base.BaseActivity;
|
||||
import com.chwl.app.base.DialogManagerInterface;
|
||||
import com.chwl.app.common.widget.dialog.DialogManager;
|
||||
import com.chwl.app.decoration.view.DecorationStoreActivity;
|
||||
import com.chwl.app.decoration.view.MyDecorationActivity;
|
||||
import com.chwl.app.family.view.activity.FamilyHomeActivity;
|
||||
import com.chwl.app.fansteam.FansTeamListActivity;
|
||||
@@ -42,7 +41,6 @@ import com.chwl.app.ui.webview.CommonWebViewActivity;
|
||||
import com.chwl.app.ui.withdraw.BinderAlipayActivity;
|
||||
import com.chwl.app.vip.VipMainActivity;
|
||||
import com.chwl.app.mentoring_relationship.activity.MentoringRelationshipActivity;
|
||||
import com.chwl.core.Constants;
|
||||
import com.chwl.core.DemoCache;
|
||||
import com.chwl.core.UriProvider;
|
||||
import com.chwl.core.auth.AuthModel;
|
||||
@@ -56,9 +54,7 @@ import com.chwl.core.room.model.AvRoomModel;
|
||||
import com.chwl.core.utils.net.BeanObserver;
|
||||
import com.chwl.core.utils.net.RxHelper;
|
||||
import com.chwl.core.withdraw.WithdrawModel;
|
||||
import com.chwl.library.common.util.DeviceUtil;
|
||||
import com.chwl.library.net.rxnet.callback.CallBack;
|
||||
import com.chwl.library.utils.AppMetaDataUtil;
|
||||
import com.chwl.library.utils.JavaUtil;
|
||||
import com.chwl.library.utils.ResUtil;
|
||||
import com.chwl.library.utils.SingleToastUtil;
|
||||
@@ -111,21 +107,18 @@ public class RouterHandler {
|
||||
break;
|
||||
case RouterType.CAR:
|
||||
if (JavaUtil.str2int(routerValue) == 0) {
|
||||
DecorationStoreActivity.start(context, DecorationStoreActivity.TAB_CAR);
|
||||
} else {
|
||||
MyDecorationActivity.start(context, 1);
|
||||
}
|
||||
break;
|
||||
case RouterType.DECORATION:
|
||||
if (JavaUtil.str2int(routerValue) == 0) {
|
||||
DecorationStoreActivity.start(context,0);
|
||||
} else {
|
||||
MyDecorationActivity.start(context, 0);
|
||||
}
|
||||
break;
|
||||
case RouterType.NAMEPLATE:
|
||||
if (JavaUtil.str2int(routerValue) == 0) {
|
||||
DecorationStoreActivity.start(context, DecorationStoreActivity.TAB_NAMEPLATE);
|
||||
} else {
|
||||
MyDecorationActivity.start(context, 2);
|
||||
}
|
||||
@@ -306,7 +299,6 @@ public class RouterHandler {
|
||||
if (intRouterValue < 0 || intRouterValue > 4) {
|
||||
intRouterValue = 0;
|
||||
}
|
||||
DecorationStoreActivity.start(context, intRouterValue);
|
||||
break;
|
||||
case RouterType.MY_DECORATION:
|
||||
if (intRouterValue < 0 || intRouterValue > 4) {
|
||||
|
@@ -1,24 +0,0 @@
|
||||
package com.chwl.app.ui.im.actions;
|
||||
|
||||
import com.netease.nim.uikit.business.session.actions.BaseAction;
|
||||
import com.chwl.app.R;
|
||||
import com.chwl.app.decoration.view.DecorationStoreActivity;
|
||||
import com.chwl.library.utils.JavaUtil;
|
||||
|
||||
/**
|
||||
* Created by huangmeng1 on 2018/5/10.
|
||||
*/
|
||||
|
||||
public class DecorationAction extends BaseAction {
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
public DecorationAction() {
|
||||
super(R.drawable.icon_decoration_action, R.string.decoration_action);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick() {
|
||||
DecorationStoreActivity.start(getActivity(), JavaUtil.str2int(getAccount()));
|
||||
}
|
||||
}
|
@@ -1,84 +0,0 @@
|
||||
package com.chwl.app.ui.user.adapter;
|
||||
|
||||
import static com.chwl.core.decoration.car.bean.CarInfo.STATUS_OFF_SHELF;
|
||||
import static com.chwl.core.decoration.car.bean.CarInfo.STATUS_OUT_OF_DATE;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.chwl.app.R;
|
||||
import com.chwl.app.ui.utils.ImageLoadUtils;
|
||||
import com.chwl.core.bean.CarButtonInfo;
|
||||
import com.chwl.core.bean.UserInfoItem;
|
||||
import com.chwl.core.decoration.car.bean.CarInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class UserInfoCarAdapter extends UserTabBaseAdapter {
|
||||
|
||||
public UserInfoCarAdapter(Context context, List<UserInfoItem> data) {
|
||||
super(context, data);
|
||||
|
||||
addItemType(UserInfoItem.TYPE_CAR_ITEM, R.layout.user_info_my_car_item);
|
||||
addItemType(UserInfoItem.TYPE_CAR_BUTTON, R.layout.layout_car_button);
|
||||
addItemType(UserInfoItem.TYPE_CAR_EMPTY, R.layout.user_info_car_empty);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, UserInfoItem item) {
|
||||
if (item == null)
|
||||
return;
|
||||
|
||||
super.convert(helper, item);
|
||||
|
||||
switch (item.getItemType()) {
|
||||
case UserInfoItem.TYPE_CAR_ITEM:
|
||||
setCarItem(helper, item);
|
||||
break;
|
||||
|
||||
case UserInfoItem.TYPE_CAR_BUTTON:
|
||||
setCarButton(helper, item);
|
||||
break;
|
||||
|
||||
case UserInfoItem.TYPE_CAR_EMPTY:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void setCarItem(BaseViewHolder helper, UserInfoItem item) {
|
||||
|
||||
CarInfo carInfo = (CarInfo) item.getData();
|
||||
|
||||
if (carInfo == null)
|
||||
return;
|
||||
|
||||
int resId = -1;
|
||||
if (carInfo.getStatus() == STATUS_OUT_OF_DATE) {
|
||||
resId = R.drawable.ic_car_expire;
|
||||
} else if (carInfo.getStatus() == STATUS_OFF_SHELF) {
|
||||
resId = R.drawable.ic_car_down;
|
||||
}
|
||||
|
||||
helper.setVisible(R.id.user_info_car_flag,
|
||||
carInfo.getStatus() == STATUS_OUT_OF_DATE || carInfo.getStatus() == STATUS_OFF_SHELF)
|
||||
.addOnClickListener(R.id.user_info_car_pic);
|
||||
if (resId != -1) {
|
||||
helper.setImageResource(R.id.user_info_car_flag, resId);
|
||||
}
|
||||
ImageView carPic = helper.getView(R.id.user_info_car_pic);
|
||||
ImageLoadUtils.loadImage(mContext, carInfo.getPic(), carPic);
|
||||
}
|
||||
|
||||
private void setCarButton(BaseViewHolder helper, UserInfoItem item) {
|
||||
CarButtonInfo carButtonInfo = (CarButtonInfo) item.getData();
|
||||
if (carButtonInfo == null)
|
||||
return;
|
||||
|
||||
helper.setText(R.id.tv_send_car, carButtonInfo.getContext()).addOnClickListener(R.id.tv_send_car);
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,235 +0,0 @@
|
||||
package com.chwl.app.ui.user.fragment;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent;
|
||||
import com.chwl.app.R;
|
||||
import com.chwl.app.base.BaseBindingFragment;
|
||||
import com.chwl.app.databinding.LayoutUserCarStoreBinding;
|
||||
import com.chwl.app.decoration.view.DecorationStoreActivity;
|
||||
import com.chwl.app.decoration.view.MyDecorationActivity;
|
||||
import com.chwl.app.ui.user.adapter.UserInfoCarAdapter;
|
||||
import com.chwl.core.auth.AuthModel;
|
||||
import com.chwl.core.bean.CarButtonInfo;
|
||||
import com.chwl.core.bean.GiftTitleInfo;
|
||||
import com.chwl.core.bean.UserInfoItem;
|
||||
import com.chwl.core.bean.response.ServiceResult;
|
||||
import com.chwl.core.decoration.car.CarModel;
|
||||
import com.chwl.core.decoration.car.bean.CarInfo;
|
||||
import com.chwl.core.user.UserInfoUiMgr;
|
||||
import com.chwl.library.annatation.ActLayoutRes;
|
||||
import com.chwl.library.utils.ListUtils;
|
||||
import com.chwl.library.utils.ResUtil;
|
||||
import com.chwl.library.utils.SizeUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
@ActLayoutRes(R.layout.layout_user_car_store)
|
||||
public class UserInfoCarFragment extends BaseBindingFragment<LayoutUserCarStoreBinding> {
|
||||
|
||||
private long userId;
|
||||
|
||||
private UserInfoCarAdapter mUserInfoCarAdapter;
|
||||
private List<UserInfoItem> mList = new ArrayList<>();
|
||||
private Observer mObserver;
|
||||
|
||||
public static UserInfoCarFragment newInstance() {
|
||||
return new UserInfoCarFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
|
||||
mObserver = new Observer<Long>() {
|
||||
@Override
|
||||
public void onChanged(@Nullable Long o) {
|
||||
if (o != null) {
|
||||
userId = o;
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
UserInfoUiMgr.get().registerUid(this, mObserver);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUserVisibleHint(boolean isVisibleToUser) {
|
||||
super.setUserVisibleHint(isVisibleToUser);
|
||||
|
||||
if (isVisibleToUser) {
|
||||
initData();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onInitArguments(Bundle bundle) {
|
||||
super.onInitArguments(bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetListener() {
|
||||
super.onSetListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiate() {
|
||||
|
||||
mBinding.rvCar.setLayoutManager(new GridLayoutManager(mContext, 2));
|
||||
|
||||
final int px = SizeUtils.dp2px(mContext, 15);
|
||||
int spanCount = ((GridLayoutManager) mBinding.rvCar.getLayoutManager()).getSpanCount();
|
||||
mBinding.rvCar.addItemDecoration(new RecyclerView.ItemDecoration() {
|
||||
@Override
|
||||
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
|
||||
super.getItemOffsets(outRect, view, parent, state);
|
||||
int pos = parent.getChildAdapterPosition(view);
|
||||
|
||||
if (pos == 0) {
|
||||
outRect.set(-px, 0, 0, 0);
|
||||
|
||||
} else {
|
||||
|
||||
int left, right;
|
||||
if ((pos - 1) % spanCount == 0) { //第一列
|
||||
left = 0;
|
||||
right = px / 2;
|
||||
} else {
|
||||
left = px / 2;
|
||||
right = 0;
|
||||
}
|
||||
outRect.set(left, 0, right, px);
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mUserInfoCarAdapter = new UserInfoCarAdapter(mContext, mList);
|
||||
mUserInfoCarAdapter.bindToRecyclerView(mBinding.rvCar);
|
||||
mUserInfoCarAdapter.setSpanSizeLookup(new BaseQuickAdapter.SpanSizeLookup() {
|
||||
@Override
|
||||
public int getSpanSize(GridLayoutManager gridLayoutManager, int position) {
|
||||
|
||||
List<UserInfoItem> list = mUserInfoCarAdapter.getData();
|
||||
if (ListUtils.isListEmpty(list))
|
||||
return 2;
|
||||
|
||||
UserInfoItem userInfoItem = list.get(position);
|
||||
int type = userInfoItem.getItemType();
|
||||
if (type == UserInfoItem.TYPE_TITLE
|
||||
|| type == UserInfoItem.TYPE_CAR_BUTTON
|
||||
|| type == UserInfoItem.TYPE_CAR_EMPTY
|
||||
|| type == UserInfoItem.TYPE_DIV) {
|
||||
return 2;
|
||||
|
||||
} else
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
|
||||
mUserInfoCarAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
|
||||
@Override
|
||||
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
List<UserInfoItem> list = mUserInfoCarAdapter.getData();
|
||||
if (ListUtils.isListEmpty(list))
|
||||
return;
|
||||
|
||||
UserInfoItem userInfoItem = list.get(position);
|
||||
if (userInfoItem.getItemType() == UserInfoItem.TYPE_CAR_ITEM) {
|
||||
|
||||
if (AuthModel.get().getCurrentUid() == userId) {
|
||||
MyDecorationActivity.start(mContext, 1);
|
||||
|
||||
} else {
|
||||
CarInfo carInfo = (CarInfo) userInfoItem.getData();
|
||||
if (carInfo.getStatus() == CarInfo.STATUS_OFF_SHELF) {
|
||||
toast(R.string.car_user_info_off_shelf);
|
||||
} else {
|
||||
DecorationStoreActivity.start(mContext, DecorationStoreActivity.TAB_CAR);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (userInfoItem.getItemType() == UserInfoItem.TYPE_CAR_BUTTON) {
|
||||
DecorationStoreActivity.start(mContext, DecorationStoreActivity.TAB_CAR);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
// 获取车库数据
|
||||
CarModel.get().getUserCarsV2(userId)
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||
.subscribe(new SingleObserver<ServiceResult<List<CarInfo>>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(ServiceResult<List<CarInfo>> listServiceResult) {
|
||||
if (listServiceResult.isSuccess()) {
|
||||
getGarageCarsSuccessView(listServiceResult.getData());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getGarageCarsSuccessView(List<CarInfo> carInfoList) {
|
||||
mList.clear();
|
||||
|
||||
if (ListUtils.isListEmpty(carInfoList)) {
|
||||
initCarTitle(0);
|
||||
|
||||
UserInfoItem emptyItem = new UserInfoItem(UserInfoItem.TYPE_CAR_EMPTY);
|
||||
mList.add(emptyItem);
|
||||
|
||||
} else {
|
||||
initCarTitle(carInfoList.size());
|
||||
|
||||
for (CarInfo carInfo : carInfoList) {
|
||||
UserInfoItem<CarInfo> carItem = new UserInfoItem<>(UserInfoItem.TYPE_CAR_ITEM, carInfo);
|
||||
mList.add(carItem);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CarButtonInfo carButtonInfo = new CarButtonInfo();
|
||||
if (AuthModel.get().getCurrentUid() == userId) {
|
||||
carButtonInfo.setContext(ResUtil.getString(R.string.ui_user_userinfocarfragment_01));
|
||||
} else {
|
||||
carButtonInfo.setContext(ResUtil.getString(R.string.ui_user_userinfocarfragment_02));
|
||||
}
|
||||
UserInfoItem<CarButtonInfo> carButtonItem = new UserInfoItem<>(UserInfoItem.TYPE_CAR_BUTTON, carButtonInfo);
|
||||
mList.add(carButtonItem);
|
||||
mUserInfoCarAdapter.setNewData(mList);
|
||||
mUserInfoCarAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private void initCarTitle(int size) {
|
||||
GiftTitleInfo giftTitleInfo = new GiftTitleInfo();
|
||||
giftTitleInfo.setTitle(ResUtil.getString(R.string.ui_user_userinfocarfragment_03));
|
||||
giftTitleInfo.setNum(String.valueOf(size));
|
||||
UserInfoItem<GiftTitleInfo> userInfoItem = new UserInfoItem<>(UserInfoItem.TYPE_TITLE, giftTitleInfo);
|
||||
mList.add(userInfoItem);
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -22,7 +22,6 @@ import com.chwl.app.UIHelper;
|
||||
import com.chwl.app.application.IReportConstants;
|
||||
import com.chwl.app.application.ReportManager;
|
||||
import com.chwl.app.avroom.activity.AVRoomActivity;
|
||||
import com.chwl.app.decoration.view.DecorationStoreActivity;
|
||||
import com.chwl.app.family.view.activity.FamilyHomeActivity;
|
||||
import com.chwl.app.public_chat_hall.activity.PublicChatHallHomeActivity;
|
||||
import com.chwl.app.ui.im.RouterHandler;
|
||||
@@ -33,8 +32,6 @@ import com.chwl.app.ui.webview.event.ShowNavEvent;
|
||||
import com.chwl.app.ui.webview.event.TaroPayResultEvent;
|
||||
import com.chwl.app.ui.widget.ShareDialog;
|
||||
import com.chwl.core.XConstants;
|
||||
import com.chwl.core.Constants;
|
||||
import com.chwl.core.UriProvider;
|
||||
import com.chwl.core.auth.AuthModel;
|
||||
import com.chwl.core.decoration.bean.DecorationStoreRouterType;
|
||||
import com.chwl.core.file.FileModel;
|
||||
@@ -400,7 +397,6 @@ public class JSInterface {
|
||||
@JavascriptInterface
|
||||
public void openDecorateMallPage(int type) {
|
||||
if (type <= 0) return;
|
||||
DecorationStoreActivity.start(context, type - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,95 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
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">
|
||||
|
||||
<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" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_roll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<com.chwl.app.ui.widget.rollviewpager.RollPagerView
|
||||
android:id="@+id/roll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:visibility="gone"
|
||||
app:rollviewpager_hint_gravity="left"
|
||||
app:rollviewpager_hint_paddingBottom="8dp"
|
||||
tools:visibility="visible" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<com.chwl.app.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/view_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="@dimen/dp_10" />
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/viewpager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:background="@color/white"
|
||||
android:baselineAligned="true"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:drawableStart="@drawable/ic_charge_diamond"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="@string/layout_activity_decoration_store_01"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_diamond_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:includeFontPadding="false"
|
||||
android:text="0"
|
||||
android:textColor="#ffffbc51"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_charge"
|
||||
android:layout_width="98dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:background="@drawable/base_shape_theme_24dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/layout_activity_decoration_store_02"
|
||||
android:textColor="@color/color_1E1E1F"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.chwl.app.common.widget.StatusLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/status_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipe_refresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingStart="14dp"
|
||||
android:paddingEnd="14dp" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</com.chwl.app.common.widget.StatusLayout>
|
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/tv_send_car"
|
||||
android:layout_width="196dp"
|
||||
android:layout_height="39dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/bg_solid_car_send"
|
||||
android:gravity="center"
|
||||
tools:text="@string/layout_layout_car_button_01"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_car"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingStart="15dp"
|
||||
android:paddingEnd="10dp" />
|
||||
</layout>
|
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/icon_common_failure" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_no_car"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
@@ -1,36 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="110dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/bg_car_item">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/user_info_car_pic"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="79dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<View
|
||||
android:id="@+id/car_user_gray_view"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="79dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@color/color_black_000000_30_transparent"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/user_info_car_flag"
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="start"
|
||||
android:layout_marginTop="15dp"
|
||||
tools:src="@drawable/ic_car_expire"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</FrameLayout>
|
Reference in New Issue
Block a user