1:修改卡顿问题,
2:修改玄镜的动画 3:修改转盘获取数据 4:修改排行榜
This commit is contained in:
@@ -4,6 +4,8 @@ import static com.xscm.moduleutil.utils.permission.PermissionUtils.TAG;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
@@ -27,6 +29,8 @@ import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.utils.SystemUtils;
|
||||
import com.xscm.moduleutil.widget.EqualSpaceItemDecoration;
|
||||
import com.xscm.moduleutil.widget.PaymentUtil;
|
||||
import com.tencent.liteav.base.Log;
|
||||
import com.tencent.mm.opensdk.constants.ConstantsAPI;
|
||||
@@ -81,6 +85,11 @@ public class RechargeActivity extends BaseMvpActivity<RechargePresenter, Activit
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.tvPayment, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
mBinding.tvPayment.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
|
||||
ViewGroup.LayoutParams layoutParams = mBinding.recyclerView.getLayoutParams();
|
||||
layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT; // 使用你定义的getWidth方法
|
||||
layoutParams.height = SystemUtils.getWidth(372); // 示例高度
|
||||
mBinding.recyclerView.setLayoutParams(layoutParams);
|
||||
}
|
||||
|
||||
private void onClick(View view) {
|
||||
@@ -140,7 +149,10 @@ public class RechargeActivity extends BaseMvpActivity<RechargePresenter, Activit
|
||||
mBinding.r4.setVisibility(isVisible ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
});
|
||||
// mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
|
||||
mBinding.recyclerView.setLayoutManager(new GridLayoutManager(this, 3));
|
||||
// int spacing = getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_22); // 根据需要调整间距
|
||||
// mBinding.recyclerView.addItemDecoration(new EqualSpaceItemDecoration(3, spacing));
|
||||
mBinding.recyclerView.setAdapter(rechargeAdapter);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.example.modulevocal.adapter;
|
||||
import android.graphics.Color;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
@@ -14,6 +15,9 @@ import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.ImageLoader;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class UserGiftWallAdapter extends BaseQuickAdapter<CombinedGiftBean, BaseViewHolder> {
|
||||
|
||||
|
||||
@@ -28,7 +32,7 @@ public class UserGiftWallAdapter extends BaseQuickAdapter<CombinedGiftBean, Base
|
||||
ImageLoader.loadImage(mContext, helper.getView(R.id.iv_gift_pic), item.getBase_image());
|
||||
TextView tv_number = helper.getView(R.id.tv_number);
|
||||
if (item.is_liang()) {
|
||||
helper.getView(R.id.cl_iv_down_on).setBackgroundColor(Color.parseColor("#E6E6E6"));
|
||||
// helper.getView(R.id.cl_iv_down_on).setBackgroundColor(Color.parseColor("#E6E6E6"));
|
||||
float[] corners = {0f, 4f, 0f, 4f};
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(tv_number, ColorManager.getInstance().getPrimaryColorInt(), corners);
|
||||
tv_number.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
@@ -37,11 +41,32 @@ public class UserGiftWallAdapter extends BaseQuickAdapter<CombinedGiftBean, Base
|
||||
helper.setVisible(R.id.tv_number, true);
|
||||
// helper.setVisible(R.id.riv_user_head, true);
|
||||
helper.setVisible(R.id.iv_gift_pic_overlay, false);
|
||||
|
||||
// 显示送礼物的用户列表
|
||||
RecyclerView recyclerView = helper.getView(R.id.rv_gift_user_list);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
||||
TopUsersAdapter topUsersAdapter = new TopUsersAdapter(item.getTop_users());
|
||||
recyclerView.setAdapter(topUsersAdapter);
|
||||
// recyclerView.setLayoutManager(new GridLayoutManager(mContext,2,LinearLayoutManager.HORIZONTAL,false));
|
||||
// recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
||||
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false) {
|
||||
@Override
|
||||
public boolean canScrollHorizontally() {
|
||||
return false; // 禁止水平滑动
|
||||
}
|
||||
});
|
||||
|
||||
// TopUsersAdapter topUsersAdapter = new TopUsersAdapter(item.getTop_users());
|
||||
if (item.getTop_users() != null && item.getTop_users().size() > 0) {
|
||||
List<CombinedGiftBean.TopUsers> displayUsers = new ArrayList<>();
|
||||
if (item.getTop_users() != null) {
|
||||
int maxDisplay = Math.min(2, item.getTop_users().size()); // 最多显示2个
|
||||
for (int i = 0; i < maxDisplay; i++) {
|
||||
displayUsers.add(item.getTop_users().get(i));
|
||||
}
|
||||
}
|
||||
TopUsersAdapter topUsersAdapter = new TopUsersAdapter(displayUsers);
|
||||
recyclerView.setAdapter(topUsersAdapter);
|
||||
}
|
||||
|
||||
} else {
|
||||
// 未点亮的礼物只显示图片、名称和金额,不高亮
|
||||
helper.setVisible(R.id.tv_number, false);
|
||||
@@ -49,6 +74,7 @@ public class UserGiftWallAdapter extends BaseQuickAdapter<CombinedGiftBean, Base
|
||||
helper.setVisible(R.id.iv_gift_pic_overlay, true);
|
||||
// 隐藏送礼物的用户列表
|
||||
helper.setVisible(R.id.rv_gift_user_list, false);
|
||||
helper.getView(R.id.iv_gift_pic).setAlpha(0.2f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.example.modulevocal.fragment;
|
||||
import android.os.Bundle;
|
||||
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.activity.UserHomepageActivity;
|
||||
import com.example.modulevocal.adapter.UserGiftWallAdapter;
|
||||
@@ -69,11 +71,13 @@ public class UserGiftWallFragment extends BaseMvpFragment<UserGiftWallPresenter,
|
||||
columns = 4;
|
||||
mUserGiftWallAdapter = new UserGiftWallAdapter();
|
||||
PagerGridLayoutManager layoutManager = new PagerGridLayoutManager(rows, columns, PagerGridLayoutManager.VERTICAL);
|
||||
mBinding.recyclerView.setLayoutManager(layoutManager);
|
||||
|
||||
|
||||
mBinding.recyclerView.setLayoutManager(new GridLayoutManager(getContext(), 4));
|
||||
mBinding.recyclerView.setOnFlingListener(null);
|
||||
// 设置滚动辅助工具
|
||||
PagerGridSnapHelper pageSnapHelper = new PagerGridSnapHelper();
|
||||
pageSnapHelper.attachToRecyclerView(mBinding.recyclerView);
|
||||
// PagerGridSnapHelper pageSnapHelper = new PagerGridSnapHelper();
|
||||
// pageSnapHelper.attachToRecyclerView(mBinding.recyclerView);
|
||||
mBinding.recyclerView.setAdapter(mUserGiftWallAdapter);
|
||||
|
||||
}
|
||||
|
||||
@@ -87,7 +87,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:nestedScrollingEnabled="false" />
|
||||
|
||||
<RelativeLayout
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
android:background="#fff"
|
||||
tools:visibility="visible">
|
||||
|
||||
<!-- <androidx.core.widget.NestedScrollView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:paddingBottom="@dimen/dp_20">-->
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/dp_20">
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
@@ -30,7 +30,7 @@
|
||||
app:spanCount="4"
|
||||
tools:listitem="@layout/me_item_user_gift_wall" />
|
||||
|
||||
<!-- </androidx.core.widget.NestedScrollView>-->
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
@@ -2,19 +2,20 @@
|
||||
<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="@dimen/dp_77"
|
||||
android:layout_height="@dimen/dp_129"
|
||||
android:layout_width="@dimen/dp_78"
|
||||
android:layout_height="@dimen/dp_110"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:background="@mipmap/gift_bj"
|
||||
android:background="#E9E9E9"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_iv_down_on"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:ignore="MissingConstraints">
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:id="@+id/cl_iv_down_on"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- tools:ignore="MissingConstraints">-->
|
||||
|
||||
|
||||
<ImageView
|
||||
@@ -30,24 +31,21 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:alpha="0.5"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_gift_pic_overlay"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="9dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginRight="9dp"
|
||||
app:layout_constraintDimensionRatio="1:1.2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:alpha="0.3"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:alpha="0.5"
|
||||
android:background="#40000000"
|
||||
|
||||
tools:visibility="visible"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
@@ -90,47 +88,20 @@
|
||||
android:textSize="11sp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/iv_gift_pic"
|
||||
app:layout_constraintRight_toRightOf="@+id/iv_gift_pic"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_gift_name" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_gift_name"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
||||
|
||||
<!-- <RelativeLayout-->
|
||||
<!-- android:id="@+id/rl_user_head"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- android:padding="@dimen/dp_2"-->
|
||||
<!-- app:layout_constraintDimensionRatio="1:1"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- android:visibility="gone">-->
|
||||
|
||||
<!-- <com.makeramen.roundedimageview.RoundedImageView-->
|
||||
<!-- android:id="@+id/riv_user_head"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- app:riv_corner_radius="@dimen/dp_13"-->
|
||||
<!-- tools:src="@color/color_FF5872FF" />-->
|
||||
|
||||
<!-- </RelativeLayout>-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tv_gift_name"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_2"-->
|
||||
<!-- android:text="冲浪少年"-->
|
||||
<!-- android:textColor="@color/color_FF545454"-->
|
||||
<!-- android:textSize="@dimen/sp_11"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="@+id/rl_user_head"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="@+id/rl_user_head"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/rl_user_head" />-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_number"
|
||||
android:layout_width="@dimen/dp_22"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_15"
|
||||
android:background="@mipmap/text_bj"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:paddingLeft="3dp"
|
||||
android:paddingRight="3dp"
|
||||
android:textColor="@color/black"
|
||||
@@ -141,45 +112,11 @@
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_gift_user_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="@+id/rl_user_head"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="@+id/rl_user_head"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/tv_gift_name">-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tv_price33"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginTop="2dp"-->
|
||||
<!-- android:text="10000"-->
|
||||
<!-- android:textColor="@color/color_FFFFBC00"-->
|
||||
<!-- android:textSize="11sp"-->
|
||||
<!-- android:drawableStart="@mipmap/jinb"-->
|
||||
<!-- />-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="*"-->
|
||||
<!-- android:textColor="#9C9C9C"-->
|
||||
<!-- android:textSize="@dimen/sp_11"-->
|
||||
<!-- android:visibility="gone" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="1"-->
|
||||
<!-- android:textColor="@color/color_FF7185FF"-->
|
||||
<!-- android:textSize="@dimen/sp_11"-->
|
||||
<!-- android:visibility="gone"/>-->
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user