1、删除新建的广场ViewHolder,使用老的(注释短剧)

2、优化沉浸式UI间距
This commit is contained in:
老皮 2024-09-13 13:37:58 +08:00
parent 935a5a3ec5
commit 40966e0b33
6 changed files with 24 additions and 65 deletions

View File

@ -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;

View File

@ -54,7 +54,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
private MainActivity nowMainActivity;
List<BaseFragment> 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);
}

View File

@ -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() {
}
}

View File

@ -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"

View File

@ -1,12 +1,12 @@
<?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:tools="http://schemas.android.com/tools"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:paddingTop="36dp"
android:layout_height="match_parent">
<net.lucode.hackware.magicindicator.MagicIndicator
<!-- <net.lucode.hackware.magicindicator.MagicIndicator
android:id="@+id/indicator"
android:layout_width="wrap_content"
android:layout_height="45dp"
@ -17,14 +17,22 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
</net.lucode.hackware.magicindicator.MagicIndicator>
</net.lucode.hackware.magicindicator.MagicIndicator>-->
<ImageView
android:id="@+id/backgroup_iv"
android:layout_width="match_parent"
android:layout_height="240dp"
android:scaleType="fitXY"
android:src="@mipmap/bg"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/community_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/indicator" />
</LinearLayout>
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -4,7 +4,7 @@
android:layout_height="match_parent">
<LinearLayout
android:layout_marginTop="50dp"
android:layout_marginTop="40dp"
android:id="@+id/rootView"
android:layout_width="match_parent"
android:layout_height="match_parent"