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 1219ffaa1..0dedba2ba 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -182,7 +182,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene private List mViewList; private MainHomeLiveViewHolder mHomeLiveViewHolder; private MainHomeViewHolder mainHomeViewHolder; -// private MainHomeCommunityViewHolder mMainHomeCommunityViewHolder; + private MainHomeCommunityViewHolder mMainHomeCommunityViewHolder; // private MainMessageViewHolder mainMessageViewHolder; private NewMainMessageViewHolder newMainMessageViewHolder; private MainHomeGameViewHolder mMainHomeGameViewHolder; @@ -1240,7 +1240,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(); } } @@ -1259,7 +1259,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) { @@ -1318,8 +1318,10 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene /* mainMessageViewHolder = new MainMessageViewHolder(this, parent); vh = mainMessageViewHolder;*/ - newMainMessageViewHolder = new NewMainMessageViewHolder(this,parent); - vh = newMainMessageViewHolder; + /* newMainMessageViewHolder = new NewMainMessageViewHolder(this,parent); + vh = newMainMessageViewHolder;*/ + mMainHomeCommunityViewHolder = new MainHomeCommunityViewHolder(mContext, parent, this);//社区 + vh = mMainHomeCommunityViewHolder; } else if (position == 3) { mMeViewHolder = new MainMeViewHolder(mContext, parent); @@ -1368,7 +1370,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) { @@ -1377,7 +1379,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) @@ -1396,9 +1398,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); } } 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 b2876efeb..066f89afc 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java @@ -78,7 +78,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl viewPager = (ViewPager2) findViewById(R.id.community_viewpager); fragments = new ArrayList<>(); fragments.add(new MainHomeCommunityFragment(nowMainActivity)); - fragments.add(new MainHomeCommunityVideoFragment()); + //fragments.add(new MainHomeCommunityVideoFragment()); viewPager.setAdapter(new FragmentStateAdapter(((AppCompatActivity) mContext)) { @NonNull @Override diff --git a/main/src/main/res/layout/view_main_community.xml b/main/src/main/res/layout/view_main_community.xml index f56d4dc3c..26b26ec29 100644 --- a/main/src/main/res/layout/view_main_community.xml +++ b/main/src/main/res/layout/view_main_community.xml @@ -10,6 +10,7 @@ android:id="@+id/indicator" android:layout_width="wrap_content" android:layout_height="45dp" + android:visibility="gone" android:overScrollMode="never" android:layout_gravity="center" app:layout_constraintEnd_toEndOf="parent"