feat:完成礼物墙优化(用户主页展示所有礼物)
@@ -30,8 +30,8 @@ public class UserGiftActivity extends BaseActivity {
|
||||
MagicIndicator magicIndicator = findViewById(R.id.magic_indicator);
|
||||
List<Fragment> fragmentList = new ArrayList<>(2);
|
||||
//礼物类型 1:普通礼物;2:辛运礼物
|
||||
fragmentList.add(UserInfoGiftFragment.newInstance(1,true));
|
||||
fragmentList.add(UserInfoGiftFragment.newInstance(2,true));
|
||||
fragmentList.add(UserInfoGiftFragment.newInstance(1));
|
||||
fragmentList.add(UserInfoGiftFragment.newInstance(2));
|
||||
UserInfoPagerAdapter pagerAdapter = new UserInfoPagerAdapter(getSupportFragmentManager(), fragmentList);
|
||||
final List<String> tagList = new ArrayList<>(2);
|
||||
tagList.add("普通礼物");
|
||||
|
@@ -9,6 +9,7 @@ import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
@@ -57,6 +58,7 @@ import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
||||
import com.nnbc123.app.ui.widget.ButtonItem;
|
||||
import com.nnbc123.app.ui.widget.ObservableScrollView;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.ViewPagerHelper;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import com.nnbc123.app.ui.widget.rollviewpager.HintView;
|
||||
import com.nnbc123.app.ui.widget.rollviewpager.RollPagerView;
|
||||
@@ -163,6 +165,11 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
}
|
||||
});
|
||||
|
||||
if (userId != AuthModel.get().getCurrentUid()) {
|
||||
ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) mBinding.viewPager.getLayoutParams();
|
||||
layoutParams.bottomMargin = UIUtil.dip2px(context, 60);
|
||||
mBinding.viewPager.setLayoutParams(layoutParams);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -47,13 +47,11 @@ public class UserInfoGiftFragment extends BaseBindingFragment<FragmentUserInfoGi
|
||||
private UserGiftAdapter userGiftAdapter;
|
||||
private Observer mObserver;
|
||||
private Observer mUidObserver;
|
||||
private boolean isDetails = false;
|
||||
|
||||
public static UserInfoGiftFragment newInstance(int giftType, boolean isDetails) {
|
||||
public static UserInfoGiftFragment newInstance(int giftType) {
|
||||
UserInfoGiftFragment userInfoGiftFragment = new UserInfoGiftFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("giftType", giftType);
|
||||
args.putBoolean("isDetails", isDetails);
|
||||
userInfoGiftFragment.setArguments(args);
|
||||
return userInfoGiftFragment;
|
||||
}
|
||||
@@ -89,9 +87,8 @@ public class UserInfoGiftFragment extends BaseBindingFragment<FragmentUserInfoGi
|
||||
|
||||
@Override
|
||||
public void initiate() {
|
||||
isDetails = requireArguments().getBoolean("isDetails", false);
|
||||
mBinding.rvGift.setLayoutManager(new GridLayoutManager(mContext, 4));
|
||||
userGiftAdapter = new UserGiftAdapter(mContext, userInfoItems, isDetails);
|
||||
userGiftAdapter = new UserGiftAdapter(mContext, userInfoItems);
|
||||
userGiftAdapter.bindToRecyclerView(mBinding.rvGift);
|
||||
userGiftAdapter.setSpanSizeLookup(new BaseQuickAdapter.SpanSizeLookup() {
|
||||
@Override
|
||||
@@ -155,10 +152,6 @@ public class UserInfoGiftFragment extends BaseBindingFragment<FragmentUserInfoGi
|
||||
for (int i = 0; i < giftWallInfoList.size(); i++) {
|
||||
userInfoItem = new UserInfoItem<>(UserInfoItem.TYPE_GIFT_ITEM, giftWallInfoList.get(i));
|
||||
userInfoItems.add(userInfoItem);
|
||||
//非礼物详情页主需要12个就够了
|
||||
if (!isDetails && i == 11){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -3,24 +3,24 @@ package com.nnbc123.app.ui.user.adapter;
|
||||
import android.content.Context;
|
||||
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
||||
import com.nnbc123.core.bean.UserInfoItem;
|
||||
import com.nnbc123.core.user.bean.GiftWallInfo;
|
||||
import com.nnbc123.library.utils.ResUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class UserGiftAdapter extends UserTabBaseAdapter {
|
||||
|
||||
private final boolean isDetails;
|
||||
|
||||
public UserGiftAdapter(Context context, List<UserInfoItem> data, boolean isDetails) {
|
||||
public UserGiftAdapter(Context context, List<UserInfoItem> data) {
|
||||
super(context, data);
|
||||
addItemType(UserInfoItem.TYPE_GIFT_ITEM, R.layout.list_item_gift_wall_info);
|
||||
addItemType(UserInfoItem.TYPE_GIFT_EMPTY, R.layout.layout_gift_empty);
|
||||
this.isDetails = isDetails;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -46,17 +46,57 @@ public class UserGiftAdapter extends UserTabBaseAdapter {
|
||||
GiftWallInfo giftWallInfo = (GiftWallInfo) item.getData();
|
||||
|
||||
if (giftWallInfo != null) {
|
||||
|
||||
helper.setText(R.id.gift_name, giftWallInfo.getGiftName())
|
||||
.setGone(R.id.gift_name, isDetails)
|
||||
.setText(R.id.gift_num, "x" + giftWallInfo.getReciveCount())
|
||||
.setBackgroundRes(R.id.gift_num, isDetails ? R.drawable.bg_user_gift_item_details : R.drawable.bg_user_gift_item)
|
||||
.setText(R.id.gift_price, giftWallInfo.getGiftPrice() + "")
|
||||
.setGone(R.id.gift_price, isDetails);
|
||||
.setText(R.id.gift_price, giftWallInfo.getGiftPrice() + "");
|
||||
|
||||
ImageView giftPic = helper.itemView.findViewById(R.id.gift_img);
|
||||
ImageLoadUtils.loadImage(mContext, giftWallInfo.getPicUrl(), giftPic);
|
||||
loadLevelUI(helper, giftWallInfo);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadLevelUI(BaseViewHolder helper, GiftWallInfo item) {
|
||||
ImageView bgView = helper.getView(R.id.iv_bg);
|
||||
TextView nameView = helper.getView(R.id.gift_name);
|
||||
TextView numView = helper.getView(R.id.gift_num);
|
||||
TextView priceView = helper.getView(R.id.gift_price);
|
||||
int bgResId;
|
||||
switch (item.getGiftLevel()) {
|
||||
case 1:
|
||||
bgResId = R.drawable.gift_wall_bg_level_1;
|
||||
break;
|
||||
case 2:
|
||||
bgResId = R.drawable.gift_wall_bg_level_2;
|
||||
break;
|
||||
case 3:
|
||||
bgResId = R.drawable.gift_wall_bg_level_3;
|
||||
break;
|
||||
case 4:
|
||||
bgResId = R.drawable.gift_wall_bg_level_4;
|
||||
break;
|
||||
case 5:
|
||||
bgResId = R.drawable.gift_wall_bg_level_5;
|
||||
break;
|
||||
case 6:
|
||||
bgResId = R.drawable.gift_wall_bg_level_6;
|
||||
break;
|
||||
case 7:
|
||||
bgResId = R.drawable.gift_wall_bg_level_7;
|
||||
break;
|
||||
default:
|
||||
bgResId = R.drawable.gift_wall_bg_level_0;
|
||||
break;
|
||||
}
|
||||
bgView.setImageResource(bgResId);
|
||||
if (bgResId == R.drawable.gift_wall_bg_level_0) {
|
||||
nameView.setTextColor(ResUtil.getColor(R.color.color_696D7A));
|
||||
numView.setTextColor(ResUtil.getColor(R.color.color_7F8494));
|
||||
priceView.setTextColor(ResUtil.getColor(R.color.color_7F8494));
|
||||
} else {
|
||||
nameView.setTextColor(ResUtil.getColor(R.color.color_FFFFFF));
|
||||
numView.setTextColor(ResUtil.getColor(R.color.color_F5F6FA));
|
||||
priceView.setTextColor(ResUtil.getColor(R.color.color_F5F6FA));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.nnbc123.app.ui.user.view
|
||||
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.view.Gravity
|
||||
@@ -13,6 +12,7 @@ import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.viewpager.widget.ViewPager
|
||||
import com.chuhai.utils.ktx.singleClick
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.nnbc123.app.R
|
||||
import com.nnbc123.app.base.BaseViewBindingFragment
|
||||
@@ -21,17 +21,18 @@ import com.nnbc123.app.home.adapter.MainMagicIndicatorAdapter
|
||||
import com.nnbc123.app.skill.activity.SkillHomeActivity
|
||||
import com.nnbc123.app.skill.activity.SkillHomeActivity.Companion.PAGE_TYPE_CUSTOM
|
||||
import com.nnbc123.app.skill.activity.SkillHomeActivity.Companion.PAGE_TYPE_SELF
|
||||
import com.nnbc123.app.ui.user.UserGiftActivity
|
||||
import com.nnbc123.app.ui.user.UserInfoActivity
|
||||
import com.nnbc123.app.ui.user.UserInfoGiftFragment
|
||||
import com.nnbc123.app.ui.user.adapter.SkillCardAdapter
|
||||
import com.nnbc123.app.ui.user.adapter.UserInfoPagerAdapter
|
||||
import com.nnbc123.app.ui.user.decorationsend.UserInfoSkillDecoration
|
||||
import com.nnbc123.app.ui.user.viewmodel.UserInfoViewModel
|
||||
import com.nnbc123.app.ui.webview.CommonWebViewActivity
|
||||
import com.nnbc123.app.ui.widget.magicindicator.MagicIndicator
|
||||
import com.nnbc123.app.ui.widget.magicindicator.ViewPagerHelper
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.UIUtil
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
||||
import com.nnbc123.core.UriProvider
|
||||
import com.nnbc123.core.auth.AuthModel
|
||||
import com.nnbc123.core.user.bean.UserInfoSkillEntity
|
||||
import com.nnbc123.library.annatation.ActLayoutRes
|
||||
@@ -54,14 +55,15 @@ class UserInfoInfoFragment : BaseViewBindingFragment<FragmentUserinfoUserinfoBin
|
||||
val magicIndicator: MagicIndicator = binding.magicIndicatorGift
|
||||
val fragmentList: MutableList<Fragment> = ArrayList(2)
|
||||
//礼物类型 1:普通礼物;2:辛运礼物
|
||||
fragmentList.add(UserInfoGiftFragment.newInstance(1, false))
|
||||
fragmentList.add(UserInfoGiftFragment.newInstance(2, false))
|
||||
fragmentList.add(UserInfoGiftFragment.newInstance(1))
|
||||
fragmentList.add(UserInfoGiftFragment.newInstance(2))
|
||||
val pagerAdapter = UserInfoPagerAdapter(childFragmentManager, fragmentList)
|
||||
val tagList: MutableList<String> = ArrayList(2)
|
||||
tagList.add("普通礼物")
|
||||
tagList.add("幸运礼物")
|
||||
val commonNavigator = CommonNavigator(context)
|
||||
commonNavigator.setTitleWrapContent(true)
|
||||
commonNavigator.setTitleGravity(Gravity.CENTER)
|
||||
commonNavigator.titleMargin = ScreenUtil.dip2px(7.0F)
|
||||
val magicIndicatorAdapter = MainMagicIndicatorAdapter(context, tagList)
|
||||
magicIndicatorAdapter.setOnItemSelectListener { position: Int, view: TextView? ->
|
||||
@@ -115,9 +117,6 @@ class UserInfoInfoFragment : BaseViewBindingFragment<FragmentUserinfoUserinfoBin
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.iv_more_gift -> startActivity(Intent(mContext, UserGiftActivity::class.java))
|
||||
}
|
||||
}
|
||||
|
||||
private fun createSkillEmptyView(): View {
|
||||
@@ -150,11 +149,19 @@ class UserInfoInfoFragment : BaseViewBindingFragment<FragmentUserinfoUserinfoBin
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
binding.viewPagerGift.post {
|
||||
val layoutParams = binding.viewPagerGift.layoutParams
|
||||
val newHeight = binding.layoutRoot.height - binding.viewPagerGift.top
|
||||
layoutParams.height = newHeight
|
||||
binding.viewPagerGift.layoutParams = layoutParams
|
||||
}
|
||||
binding.tvGiftLevel.singleClick {
|
||||
CommonWebViewActivity.start(context, UriProvider.getGiftLevelRuleUrl())
|
||||
}
|
||||
initGiftList()
|
||||
vm.userInfoSkillData.observe(this) {
|
||||
initSkillCardList(it)
|
||||
}
|
||||
binding.ivMoreGift.setOnClickListener(this)
|
||||
}
|
||||
|
||||
}
|
BIN
app/src/main/res/drawable-xxhdpi/gift_wall_bg_level_0.webp
Normal file
After Width: | Height: | Size: 380 B |
BIN
app/src/main/res/drawable-xxhdpi/gift_wall_bg_level_1.webp
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_wall_bg_level_2.webp
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_wall_bg_level_3.webp
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_wall_bg_level_4.webp
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_wall_bg_level_5.webp
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_wall_bg_level_6.webp
Normal file
After Width: | Height: | Size: 53 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_wall_bg_level_7.webp
Normal file
After Width: | Height: | Size: 61 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_wall_ic_diamond.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
18
app/src/main/res/drawable/user_info_ic_help.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="12dp"
|
||||
android:height="12dp"
|
||||
android:viewportWidth="12"
|
||||
android:viewportHeight="12">
|
||||
<path
|
||||
android:pathData="M6,6m-5.5,0a5.5,5.5 0,1 1,11 0a5.5,5.5 0,1 1,-11 0"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#A2A7B8"
|
||||
android:fillType="evenOdd"/>
|
||||
<path
|
||||
android:pathData="M6.11,2.52C5.37,2.52 4.79,2.73 4.36,3.15C3.92,3.57 3.71,4.15 3.71,4.89L4.85,4.89C4.85,4.47 4.93,4.14 5.1,3.91C5.29,3.63 5.6,3.5 6.04,3.5C6.38,3.5 6.65,3.59 6.84,3.78C7.02,3.97 7.12,4.23 7.12,4.56C7.12,4.81 7.03,5.05 6.85,5.27L6.73,5.41C6.08,5.99 5.69,6.41 5.56,6.68C5.42,6.95 5.36,7.28 5.36,7.66L5.36,7.8L6.51,7.8L6.51,7.66C6.51,7.42 6.56,7.21 6.66,7.01C6.75,6.83 6.88,6.66 7.06,6.51C7.54,6.09 7.83,5.82 7.92,5.72C8.16,5.4 8.29,4.99 8.29,4.49C8.29,3.88 8.09,3.4 7.69,3.05C7.29,2.69 6.76,2.52 6.11,2.52ZM5.93,8.29C5.71,8.29 5.53,8.36 5.38,8.5C5.23,8.64 5.16,8.82 5.16,9.04C5.16,9.26 5.23,9.44 5.38,9.58C5.53,9.72 5.71,9.8 5.93,9.8C6.15,9.8 6.33,9.73 6.48,9.59C6.63,9.45 6.71,9.26 6.71,9.04C6.71,8.82 6.63,8.64 6.49,8.5C6.34,8.36 6.15,8.29 5.93,8.29Z"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#A2A7B8"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
</vector>
|
@@ -545,7 +545,6 @@
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="@dimen/dp_60"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
@@ -11,11 +11,10 @@
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_gift"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp" />
|
||||
android:layout_marginTop="11.5dp"
|
||||
android:paddingHorizontal="9.5dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -2,6 +2,7 @@
|
||||
<androidx.core.widget.NestedScrollView 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/layout_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
@@ -17,10 +18,10 @@
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/dp_15"
|
||||
android:paddingTop="@dimen/dp_12"
|
||||
android:paddingRight="@dimen/dp_15"
|
||||
android:paddingBottom="@dimen/dp_12"
|
||||
android:paddingLeft="@dimen/dp_13"
|
||||
android:paddingTop="@dimen/dp_8"
|
||||
android:paddingRight="@dimen/dp_13"
|
||||
android:paddingBottom="@dimen/dp_16"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
@@ -28,19 +29,20 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:text="技能卡"
|
||||
android:textColor="@color/text_normal_282828"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
android:textColor="#2B2D33"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_skill"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginBottom="8dp" />
|
||||
android:layout_marginTop="@dimen/dp_8" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_gift"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
@@ -50,41 +52,61 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_skill"
|
||||
app:layout_constraintVertical_bias="0">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_detail"
|
||||
android:layout_width="wrap_content"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:includeFontPadding="false"
|
||||
android:text="礼物墙"
|
||||
android:textColor="@color/text_normal_282828"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="13dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingEnd="13dp"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_detail"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:text="礼物墙"
|
||||
android:textColor="#2B2D33"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableStart="@drawable/user_info_ic_help"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:includeFontPadding="false"
|
||||
android:paddingVertical="5dp"
|
||||
android:text="礼物等级说明"
|
||||
android:textColor="#A2A7B8"
|
||||
android:textSize="@dimen/sp_11"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_gift_detail"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_gift_detail" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.nnbc123.app.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/magic_indicator_gift"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="25dp"
|
||||
android:layout_height="34dp"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_more_gift"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="-25dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_userinfo_arrow_right" />
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/view_pager_gift"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="350dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/view_pager_gift"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="500dp"
|
||||
android:background="@color/white"
|
||||
app:layout_constraintTop_toBottomOf="@id/layout_gift" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
@@ -1,58 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<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"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="7dp"
|
||||
android:background="@drawable/shape_f3f5fa_corner_8dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="5dp">
|
||||
android:layout_marginHorizontal="2.5dp"
|
||||
android:layout_marginVertical="4dp"
|
||||
tools:layout_width="84dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:src="@drawable/gift_wall_bg_level_0"
|
||||
app:layout_constraintDimensionRatio="84:122"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/line_icon_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.0655" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/gift_img"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="10dp" />
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/line_icon_top"
|
||||
app:layout_constraintWidth_percent="0.654"
|
||||
tools:src="@drawable/default_cover" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="1dp"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="@dimen/dp_8"
|
||||
android:textColor="#6D6B89"
|
||||
android:textSize="12dp"
|
||||
android:textColor="#7F8494"
|
||||
android:textSize="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/gift_img"
|
||||
tools:text="x120" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_horizontal"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_282828"
|
||||
android:paddingHorizontal="3dp"
|
||||
android:textColor="#696D7A"
|
||||
android:textSize="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/gift_num"
|
||||
tools:text="天使" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="3dp"
|
||||
android:drawableStart="@drawable/ic_gift_diamond"
|
||||
android:drawableStart="@drawable/gift_wall_ic_diamond"
|
||||
android:drawablePadding="1dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/text_secondary_878b9c"
|
||||
android:textSize="11dp"
|
||||
android:textColor="#7F8494"
|
||||
android:textSize="9dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/gift_name"
|
||||
tools:text="10" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -630,4 +630,5 @@
|
||||
<color name="color_695CEB">#695CEB</color>
|
||||
<color name="color_FFF265">#FFFFF265</color>
|
||||
<color name="color_5CEFFF">#FF5CEFFF</color>
|
||||
<color name="color_7F8494">#7F8494</color>
|
||||
</resources>
|
||||
|
@@ -528,4 +528,10 @@ public class UriProvider {
|
||||
return WEB_URL.concat("/yinmeng/modules/rule/privilegeCardRule.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 礼物等级
|
||||
*/
|
||||
public static String getGiftLevelRuleUrl() {
|
||||
return WEB_URL.concat("/yinmeng/modules/rule/giftWallRule.html");
|
||||
}
|
||||
}
|
||||
|
@@ -13,6 +13,15 @@ public class GiftWallInfo implements Serializable {
|
||||
private String giftName;
|
||||
private String picUrl;
|
||||
private int giftPrice;
|
||||
private int giftLevel;
|
||||
|
||||
public int getGiftLevel() {
|
||||
return giftLevel;
|
||||
}
|
||||
|
||||
public void setGiftLevel(int giftLevel) {
|
||||
this.giftLevel = giftLevel;
|
||||
}
|
||||
|
||||
public long getUid() {
|
||||
return uid;
|
||||
|
@@ -2,7 +2,9 @@ package com.nnbc123.library.utils;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import androidx.annotation.ColorRes;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
|
||||
public class ResUtil {
|
||||
@@ -15,4 +17,9 @@ public class ResUtil {
|
||||
public static String getString(@StringRes int resId) {
|
||||
return context.getString(resId);
|
||||
}
|
||||
|
||||
public static int getColor(@ColorRes int resId) {
|
||||
return ContextCompat.getColor(context, resId);
|
||||
}
|
||||
|
||||
}
|
||||
|