From ed595ec1f44bd17c4c8ca19fee225ef3a128fe1b 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: Tue, 10 Sep 2024 18:29:57 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=96=B0=E7=89=88=20=E5=B9=BF?= =?UTF-8?q?=E5=9C=BA=E7=95=8C=E9=9D=A2=202=E3=80=81=E6=96=B0=E7=89=88=20?= =?UTF-8?q?=E5=A8=B1=E4=B9=90=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/main/activity/MainActivity.java | 57 +++--- .../fragment/MainHomeCommunityFragment.java | 4 + .../main/views/NewMainMessageViewHolder.java | 40 ++++ .../main/res/drawable/create_room_shape.xml | 6 + main/src/main/res/layout/new_gram_room.xml | 176 ++++++++++++++++++ .../main/res/layout/view_new_main_meeage.xml | 7 + main/src/main/res/mipmap-xxxhdpi/jilu.webp | Bin 0 -> 1076 bytes main/src/main/res/mipmap-xxxhdpi/search.webp | Bin 0 -> 1334 bytes 8 files changed, 265 insertions(+), 25 deletions(-) create mode 100644 main/src/main/java/com/yunbao/main/views/NewMainMessageViewHolder.java create mode 100644 main/src/main/res/drawable/create_room_shape.xml create mode 100644 main/src/main/res/layout/new_gram_room.xml create mode 100644 main/src/main/res/layout/view_new_main_meeage.xml create mode 100644 main/src/main/res/mipmap-xxxhdpi/jilu.webp create mode 100644 main/src/main/res/mipmap-xxxhdpi/search.webp 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 9de918e99..76d917dc0 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -137,10 +137,12 @@ import com.yunbao.main.manager.imrongcloud.ConversationIMListManager; import com.yunbao.main.utils.GenerateTestUserSig; import com.yunbao.main.views.FloatBannerView; import com.yunbao.main.views.MainHomeCommunityViewHolder; +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; @@ -178,8 +180,10 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene private List mViewList; private MainHomeLiveViewHolder mHomeLiveViewHolder; private MainHomeViewHolder mainHomeViewHolder; - private MainHomeCommunityViewHolder mMainHomeCommunityViewHolder; - private MainMessageViewHolder mainMessageViewHolder; +// private MainHomeCommunityViewHolder mMainHomeCommunityViewHolder; +// private MainMessageViewHolder mainMessageViewHolder; + private NewMainMessageViewHolder newMainMessageViewHolder; + private MainHomeGameViewHolder mMainHomeGameViewHolder; private MainMeViewHolder mMeViewHolder; private AbsMainViewHolder[] mViewHolders; private View mBottom; @@ -360,27 +364,24 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene case 0: //点击埋点 MobclickAgent.onEvent(mContext, "home_page", "首页"); - if (mMainHomeCommunityViewHolder != null) { - mMainHomeCommunityViewHolder.onPauseVideo(); - } break; case 1: MobclickAgent.onEvent(mContext, "community", "社区"); - if (mMainHomeCommunityViewHolder != null) { + /* if (mMainHomeCommunityViewHolder != null) { mMainHomeCommunityViewHolder.onResumePlay(); - } + }*/ break; case 2: MobclickAgent.onEvent(mContext, "information", "消息"); - if (mMainHomeCommunityViewHolder != null) { + /* if (mMainHomeCommunityViewHolder != null) { mMainHomeCommunityViewHolder.onPauseVideo(); - } + }*/ break; case 3: MobclickAgent.onEvent(mContext, "my", "我的"); - if (mMainHomeCommunityViewHolder != null) { + /* if (mMainHomeCommunityViewHolder != null) { mMainHomeCommunityViewHolder.onPauseVideo(); - } + }*/ break; } OpenAdManager.getInstance().show(OpenAdManager.TYPE_HOME, false); @@ -565,7 +566,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene floatWarOrder.setVisibility(View.GONE); findViewById(R.id.banner_click).setVisibility(View.GONE); isfloatBannernet = false; - if (mainMessageViewHolder != null) mainMessageViewHolder.onResume(); +// if (mainMessageViewHolder != null) mainMessageViewHolder.onResume(); } else { floatBanner.setVisibility(View.GONE); floatRedPacket.setVisibility(View.GONE); @@ -1236,7 +1237,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene if (updataListBean.getIndex() == 0) { EventBus.getDefault().post("Updata"); } else if (updataListBean.getIndex() == 1) { - mMainHomeCommunityViewHolder.loadNewUrl(); +// mMainHomeCommunityViewHolder.loadNewUrl(); } } @@ -1255,7 +1256,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene @Override public void onBackPressed() { if (isTabClose && isWebClose) { - mMainHomeCommunityViewHolder.closeFinger(); +// mMainHomeCommunityViewHolder.closeFinger(); } else { long curTime = System.currentTimeMillis(); if (curTime - mLastClickBackTime > 2000) { @@ -1304,13 +1305,18 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene vh = mainHomeViewHolder; } else if (position == 1) { - mMainHomeCommunityViewHolder = new MainHomeCommunityViewHolder(mContext, parent, this);//社区 - vh = mMainHomeCommunityViewHolder; + /* mMainHomeCommunityViewHolder = new MainHomeCommunityViewHolder(mContext, parent, this);//社区 + vh = mMainHomeCommunityViewHolder;*/ + mMainHomeGameViewHolder = new MainHomeGameViewHolder(this, parent);//游戏 + vh = mMainHomeGameViewHolder; + } else if (position == 2) { - mainMessageViewHolder = new MainMessageViewHolder(this, parent); - vh = mainMessageViewHolder; + /* mainMessageViewHolder = new MainMessageViewHolder(this, parent); + vh = mainMessageViewHolder;*/ + newMainMessageViewHolder = new NewMainMessageViewHolder(this,parent); + vh = newMainMessageViewHolder; } else if (position == 3) { mMeViewHolder = new MainMeViewHolder(mContext, parent); @@ -1359,7 +1365,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene } private void processResult(int resultCode, Intent intent) { - if (mMainHomeCommunityViewHolder.mValueCallback == null) { + /*if (mMainHomeCommunityViewHolder.mValueCallback == null) { return; } if (resultCode == RESULT_OK && intent != null) { @@ -1368,7 +1374,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene } else { mMainHomeCommunityViewHolder.mValueCallback.onReceiveValue(null); } - mMainHomeCommunityViewHolder.mValueCallback = null; + mMainHomeCommunityViewHolder.mValueCallback = null;*/ } @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @@ -1387,9 +1393,9 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene if (dataString != null) { results = new Uri[]{Uri.parse(dataString)}; } - mMainHomeCommunityViewHolder.setValueCallback2(results); +// mMainHomeCommunityViewHolder.setValueCallback2(results); } else { - mMainHomeCommunityViewHolder.setValueCallback2(null); +// mMainHomeCommunityViewHolder.setValueCallback2(null); } } @@ -1571,9 +1577,10 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene public void onInstructorOperationEvent(InstructorOperationEvent event) { //跳转消息列表 if (mViewPager != null) { - mViewPager.setCurrentItem(2); - mTabButtonGroup.setCurPosition(2); - mainMessageViewHolder.setHomeZdyPop(NoviceInstructorManager.get(this).getHomeZdyPop()); + // TODO 跳消息 +// mViewPager.setCurrentItem(2); +// mTabButtonGroup.setCurPosition(2); +// mainMessageViewHolder.setHomeZdyPop(NoviceInstructorManager.get(this).getHomeZdyPop()); } } diff --git a/main/src/main/java/com/yunbao/main/fragment/MainHomeCommunityFragment.java b/main/src/main/java/com/yunbao/main/fragment/MainHomeCommunityFragment.java index cd8d7f804..a56b42658 100644 --- a/main/src/main/java/com/yunbao/main/fragment/MainHomeCommunityFragment.java +++ b/main/src/main/java/com/yunbao/main/fragment/MainHomeCommunityFragment.java @@ -89,6 +89,10 @@ public class MainHomeCommunityFragment extends BaseFragment { super(); this.nowMainActivity=nowMainActivity; } + public MainHomeCommunityFragment(){ + + } + @Override public View createView(LayoutInflater inflater, ViewGroup container) { diff --git a/main/src/main/java/com/yunbao/main/views/NewMainMessageViewHolder.java b/main/src/main/java/com/yunbao/main/views/NewMainMessageViewHolder.java new file mode 100644 index 000000000..1befaf473 --- /dev/null +++ b/main/src/main/java/com/yunbao/main/views/NewMainMessageViewHolder.java @@ -0,0 +1,40 @@ +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/drawable/create_room_shape.xml b/main/src/main/res/drawable/create_room_shape.xml new file mode 100644 index 000000000..71de119f9 --- /dev/null +++ b/main/src/main/res/drawable/create_room_shape.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/main/src/main/res/layout/new_gram_room.xml b/main/src/main/res/layout/new_gram_room.xml new file mode 100644 index 000000000..8b4848512 --- /dev/null +++ b/main/src/main/res/layout/new_gram_room.xml @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/main/src/main/res/layout/view_new_main_meeage.xml b/main/src/main/res/layout/view_new_main_meeage.xml new file mode 100644 index 000000000..aa6672658 --- /dev/null +++ b/main/src/main/res/layout/view_new_main_meeage.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/main/src/main/res/mipmap-xxxhdpi/jilu.webp b/main/src/main/res/mipmap-xxxhdpi/jilu.webp new file mode 100644 index 0000000000000000000000000000000000000000..d3b7ab8ca1d5f52708b3f6abb000355bee9e4971 GIT binary patch literal 1076 zcmWIYbaT^TVPFV%bqWXzu!!JdU|=u+Vt+95baoCn!3g9sFrEOBEI_H;ypp0IcPE92 z$S4K&2Mmlr2nLDC#RU)+RuZV{+ck*V%eq)q;1}dfNi9wWD)|7!Dn&rcfo>83vPIG% zYz+`Q3BtAkvCB&eN`PttK=2?(*InG6iuTNxN6ZXv`}7BDdI zw=ghlJC6`Ugh@eSQ6ktlU~DijrKK@2d|J-Hz#GZHAbf#=fh!s;2PAN~O#vt+19VqD z5T-NaFr+dlFnBWLF(fnS0a-@CNHt_I1IDnA9TNkCzW)JXf%OYk^onFWXyy5nz2{)d z%mz=j>4tCS3tsR!pfdTi#JBSt9usnB-{LfD5%#$ha@&xhPJF^!p>Mzc|J64*P(O3w zt(7TTgHQhB=iuO&#Ihk*np1MQ`Ob&`^LyP}RGc?|6}ni@Hff35L2l+KiA3S+@?hr| z>{*hk>N!aT8C|!$+Xs^L(rsV;=_4C#hUj$q?c58k+w8%>Fb7hx>+^5iY zul@!2-gg%~%FAGL%D1KNMxPUV&1>hfqeAOB!X_7XrpY{3&YhYS6Z++Nv<=g}(q3~v z)!qLm8BY5#?PKknuD}B?=ZYs6h-7f@xXz(e-xqXh(#o`l`3{yU<3x0~I`U70WZ&g|h@_VU{ww#nb= zO*(W}YtP&3N85I%?s>~^{;%Ep<6)g-`!(_R3Zr-Zy1?5O_RgH6Znrp=omc3p5N>%kEm7&~`h9PIamJ?YUb3?6!Om5j zQH5t7MX1JRoviSD{PgIKyAiEL_U~TV$rx+xa&WCRzgc;P>(vS0+sA~au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