From 40966e0b33dd96af731720c47eae8da64c63f0bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E7=9A=AE?= <14840170+lao-pi123@user.noreply.gitee.com> Date: Fri, 13 Sep 2024 13:37:58 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=88=A0=E9=99=A4=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E7=9A=84=E5=B9=BF=E5=9C=BAViewHolder=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E8=80=81=E7=9A=84=EF=BC=88=E6=B3=A8=E9=87=8A=E7=9F=AD?= =?UTF-8?q?=E5=89=A7=EF=BC=89=202=E3=80=81=E4=BC=98=E5=8C=96=E6=B2=89?= =?UTF-8?q?=E6=B5=B8=E5=BC=8FUI=E9=97=B4=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/main/activity/MainActivity.java | 9 ----- .../views/MainHomeCommunityViewHolder.java | 10 ++--- .../main/views/NewMainMessageViewHolder.java | 40 ------------------- main/src/main/res/layout/new_gram_room.xml | 2 +- .../main/res/layout/view_main_community.xml | 26 +++++++----- .../main/res/layout/view_main_encourage.xml | 2 +- 6 files changed, 24 insertions(+), 65 deletions(-) delete mode 100644 main/src/main/java/com/yunbao/main/views/NewMainMessageViewHolder.java diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index 0dedba2ba..34db8cdc8 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -62,7 +62,6 @@ import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.server.DownloadService; import com.yunbao.common.utils.AppManager; import com.yunbao.common.utils.Bus; -import com.yunbao.common.utils.L; import com.yunbao.common.utils.LogUtil; import com.yunbao.common.utils.MobclickAgent; import com.yunbao.common.CommonAppConfig; @@ -143,8 +142,6 @@ import com.yunbao.main.views.MainHomeGameViewHolder; import com.yunbao.main.views.MainHomeLiveViewHolder; import com.yunbao.main.views.MainHomeViewHolder; import com.yunbao.main.views.MainMeViewHolder; -import com.yunbao.main.views.MainMessageViewHolder; -import com.yunbao.main.views.NewMainMessageViewHolder; import com.yunbao.video.utils.VideoStorge; import org.greenrobot.eventbus.EventBus; @@ -184,7 +181,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene private MainHomeViewHolder mainHomeViewHolder; private MainHomeCommunityViewHolder mMainHomeCommunityViewHolder; // private MainMessageViewHolder mainMessageViewHolder; - private NewMainMessageViewHolder newMainMessageViewHolder; private MainHomeGameViewHolder mMainHomeGameViewHolder; private MainMeViewHolder mMeViewHolder; private AbsMainViewHolder[] mViewHolders; @@ -1315,11 +1311,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene } else if (position == 2) { - /* mainMessageViewHolder = new MainMessageViewHolder(this, parent); - vh = mainMessageViewHolder;*/ - - /* newMainMessageViewHolder = new NewMainMessageViewHolder(this,parent); - vh = newMainMessageViewHolder;*/ mMainHomeCommunityViewHolder = new MainHomeCommunityViewHolder(mContext, parent, this);//社区 vh = mMainHomeCommunityViewHolder; diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java index 066f89afc..24baacc79 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java @@ -54,7 +54,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl private MainActivity nowMainActivity; List fragments; ViewPager2 viewPager; - private MagicIndicator mIndicator; +// private MagicIndicator mIndicator; public MainHomeCommunityViewHolder(Context context, ViewGroup parentView, MainActivity mainActivity) { super(context, parentView); @@ -74,7 +74,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl @Override public void init() { - mIndicator = (MagicIndicator) findViewById(R.id.indicator); +// mIndicator = (MagicIndicator) findViewById(R.id.indicator); viewPager = (ViewPager2) findViewById(R.id.community_viewpager); fragments = new ArrayList<>(); fragments.add(new MainHomeCommunityFragment(nowMainActivity)); @@ -154,9 +154,9 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl return linePagerIndicator; } }); - mIndicator.setNavigator(commonNavigator); - bind(mIndicator, viewPager); - mIndicator.onPageSelected(0); +// mIndicator.setNavigator(commonNavigator); +// bind(mIndicator, viewPager); +// mIndicator.onPageSelected(0); viewPager.setCurrentItem(0); } diff --git a/main/src/main/java/com/yunbao/main/views/NewMainMessageViewHolder.java b/main/src/main/java/com/yunbao/main/views/NewMainMessageViewHolder.java deleted file mode 100644 index 1befaf473..000000000 --- a/main/src/main/java/com/yunbao/main/views/NewMainMessageViewHolder.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.yunbao.main.views; - -import android.content.Context; -import android.view.ViewGroup; - -import androidx.constraintlayout.widget.ConstraintLayout; -import androidx.fragment.app.FragmentTransaction; - -import com.yunbao.common.views.AbsMainViewHolder; -import com.yunbao.main.R; -import com.yunbao.main.activity.MainActivity; -import com.yunbao.main.fragment.MainHomeCommunityFragment; - -public class NewMainMessageViewHolder extends AbsMainViewHolder { - private MainActivity mContext; - private MainHomeCommunityFragment mMainHomeCommunityFragment; - - - public NewMainMessageViewHolder(MainActivity context, ViewGroup parentView) { - super(context, parentView); - this.mContext = context; - FragmentTransaction fragmentTransaction = mContext.getSupportFragmentManager().beginTransaction(); - if (mMainHomeCommunityFragment == null){ - mMainHomeCommunityFragment = new MainHomeCommunityFragment(mContext); - } - fragmentTransaction.add(R.id.fragment_container,mMainHomeCommunityFragment); - fragmentTransaction.commit(); - } - - @Override - protected int getLayoutId() { - return R.layout.view_new_main_meeage; - } - - @Override - public void init() { - - } - -} diff --git a/main/src/main/res/layout/new_gram_room.xml b/main/src/main/res/layout/new_gram_room.xml index 38e02b410..dddf518e6 100644 --- a/main/src/main/res/layout/new_gram_room.xml +++ b/main/src/main/res/layout/new_gram_room.xml @@ -20,7 +20,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="17dp" - android:layout_marginTop="52dp" + android:layout_marginTop="48dp" android:text="@string/interactive_game_room_list_new" android:textColor="#000" android:textSize="19sp" diff --git a/main/src/main/res/layout/view_main_community.xml b/main/src/main/res/layout/view_main_community.xml index 26b26ec29..5b9a9b33c 100644 --- a/main/src/main/res/layout/view_main_community.xml +++ b/main/src/main/res/layout/view_main_community.xml @@ -1,12 +1,12 @@ - - - + --> + + + - \ No newline at end of file + /> + + \ No newline at end of file diff --git a/main/src/main/res/layout/view_main_encourage.xml b/main/src/main/res/layout/view_main_encourage.xml index 70431ca2b..d09c5d0bb 100644 --- a/main/src/main/res/layout/view_main_encourage.xml +++ b/main/src/main/res/layout/view_main_encourage.xml @@ -4,7 +4,7 @@ android:layout_height="match_parent">