首页动态tab UI修改
This commit is contained in:
@@ -456,13 +456,9 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
override fun makeFocusDrawable(): Drawable? {
|
||||
val dotFocus = GradientDrawable()
|
||||
dotFocus.setColor(Color.WHITE)
|
||||
dotFocus.cornerRadius = Util.dip2px(
|
||||
context, 2f
|
||||
).toFloat()
|
||||
dotFocus.cornerRadius = Util.dip2px(context, 2f).toFloat()
|
||||
dotFocus.setSize(
|
||||
Util.dip2px(context, 9f), Util.dip2px(
|
||||
context, 4f
|
||||
)
|
||||
Util.dip2px(context, 9f), Util.dip2px(context, 4f)
|
||||
)
|
||||
return if (show) dotFocus else null
|
||||
}
|
||||
@@ -470,13 +466,9 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
override fun makeNormalDrawable(): Drawable? {
|
||||
val dotNormal = GradientDrawable()
|
||||
dotNormal.setColor(mContext.resources.getColor(R.color.color_66FFFFFF))
|
||||
dotNormal.cornerRadius = Util.dip2px(
|
||||
context, 2f
|
||||
).toFloat()
|
||||
dotNormal.cornerRadius = Util.dip2px(context, 2f).toFloat()
|
||||
dotNormal.setSize(
|
||||
Util.dip2px(context, 4f), Util.dip2px(
|
||||
context, 4f
|
||||
)
|
||||
Util.dip2px(context, 4f), Util.dip2px(context, 4f)
|
||||
)
|
||||
return if (show) dotNormal else null
|
||||
}
|
||||
@@ -538,7 +530,8 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
}
|
||||
rootView.setOnClickListener {
|
||||
WishListPanelDialog.newInstance().show(mContext)
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_WISHLIST_POP_CLICK,"礼物心愿气泡点击")
|
||||
StatisticManager.Instance()
|
||||
.onEvent(StatisticsProtocol.EVENT_WISHLIST_POP_CLICK, "礼物心愿气泡点击")
|
||||
}
|
||||
return rootView
|
||||
}
|
||||
|
@@ -127,9 +127,8 @@ class PartyFragment : BaseFragment(), MainMagicIndicatorAdapter.OnItemSelectList
|
||||
mFragments.add(fragment)
|
||||
}
|
||||
val commonNavigator = CommonNavigator(context)
|
||||
commonNavigator.setTitleWrapContent(false)
|
||||
commonNavigator.titleMargin = ScreenUtil.dip2px(2.0F)
|
||||
commonNavigator.setTitleGravity(Gravity.CENTER_VERTICAL)
|
||||
commonNavigator.setTitleWrapContent(true)
|
||||
commonNavigator.titleMargin = ScreenUtil.dip2px(6.0F)
|
||||
val magicIndicatorAdapter = MainMagicIndicatorAdapter(context, mTabInfoList)
|
||||
magicIndicatorAdapter.textSize = 16
|
||||
magicIndicatorAdapter.minScale = 0.85f
|
||||
|
@@ -30,6 +30,7 @@ import java.io.File
|
||||
import java.net.MalformedURLException
|
||||
import java.net.URL
|
||||
|
||||
@JvmOverloads
|
||||
fun ImageView.load(
|
||||
url: String?,
|
||||
@Dimension(unit = DP) round: Float = 0f,
|
||||
|
10
app/src/main/res/drawable/shape_232323_bottom_40dp.xml
Normal file
10
app/src/main/res/drawable/shape_232323_bottom_40dp.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#99232323" />
|
||||
|
||||
<corners
|
||||
android:bottomLeftRadius="40dp"
|
||||
android:bottomRightRadius="40dp" />
|
||||
</shape>
|
13
app/src/main/res/drawable/shape_dynamic_bottom.xml
Normal file
13
app/src/main/res/drawable/shape_dynamic_bottom.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:endColor="@color/transparent"
|
||||
android:startColor="#66000000"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<corners
|
||||
android:bottomLeftRadius="12dp"
|
||||
android:bottomRightRadius="12dp" />
|
||||
</shape>
|
12
app/src/main/res/drawable/shape_dynamic_topic.xml
Normal file
12
app/src/main/res/drawable/shape_dynamic_topic.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#339882FF"
|
||||
android:startColor="@color/transparent"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
|
||||
<corners android:radius="12dp" />
|
||||
</shape>
|
@@ -8,46 +8,71 @@
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/coordinator_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="54dp"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="54dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_roll_view"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:id="@+id/coordinator_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.nnbc123.app.ui.widget.rollviewpager.RollPagerView
|
||||
android:id="@+id/roll_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="345:80"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:rollviewpager_hint_gravity="left"
|
||||
app:rollviewpager_hint_paddingBottom="8dp"
|
||||
tools:visibility="gone" />
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/app_bar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/transparent"
|
||||
app:elevation="0dp"
|
||||
app:layout_behavior="com.nnbc123.app.ui.widget.AppBarLayoutBehavior">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:contentScrim="@color/transparent"
|
||||
app:layout_scrollFlags="scroll|enterAlwaysCollapsed">
|
||||
|
||||
<com.nnbc123.app.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/magic_indicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="31dp"
|
||||
android:layout_marginStart="7dp" />
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_roll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15">
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
<com.nnbc123.app.ui.widget.rollviewpager.RollPagerView
|
||||
android:id="@+id/roll_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="345:80"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:rollviewpager_hint_gravity="left"
|
||||
app:rollviewpager_hint_paddingBottom="8dp"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
|
||||
<com.nnbc123.app.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/magic_indicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="31dp"
|
||||
android:layout_marginStart="13dp" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
27
app/src/main/res/layout/item_square_topic_banner.xml
Normal file
27
app/src/main/res/layout/item_square_topic_banner.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/shape_dynamic_topic" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_topic"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
tools:text="#话题话题" />
|
||||
|
||||
</FrameLayout>
|
||||
|
@@ -5,31 +5,21 @@ import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.UIHelper;
|
||||
import com.nnbc123.app.avroom.activity.AVRoomActivity;
|
||||
import com.nnbc123.app.base.BaseMvpFragment;
|
||||
import com.nnbc123.app.base.BaseFragment;
|
||||
import com.nnbc123.app.common.EmptyViewHelper;
|
||||
import com.nnbc123.app.common.widget.dialog.DialogManager;
|
||||
import com.nnbc123.app.community.helper.ShareDynamicHelper;
|
||||
import com.nnbc123.app.community.square.adapter.SquareDynamicAdapter;
|
||||
import com.nnbc123.app.miniworld.activity.AllTopicActivity;
|
||||
import com.nnbc123.app.miniworld.activity.TopicMainActivity;
|
||||
import com.nnbc123.app.miniworld.adapter.RecommendTopicListAdapter;
|
||||
import com.nnbc123.app.miniworld.listener.DoubleClickCheckListener;
|
||||
import com.nnbc123.app.miniworld.presenter.MiniWorldCategoryPresenter;
|
||||
import com.nnbc123.app.miniworld.view.IMiniWorldCategoryView;
|
||||
import com.nnbc123.app.community.square.adapter.NewSquareDynamicAdapter;
|
||||
import com.nnbc123.app.ui.widget.ButtonItem;
|
||||
import com.nnbc123.xchat_android_constants.XChatConstants;
|
||||
import com.nnbc123.core.auth.AuthModel;
|
||||
import com.nnbc123.core.community.CommunityConstant;
|
||||
import com.nnbc123.core.community.bean.WorldDynamicBean;
|
||||
@@ -37,14 +27,12 @@ import com.nnbc123.core.community.bean.WorldDynamicListResult;
|
||||
import com.nnbc123.core.community.dynamic.DynamicModel;
|
||||
import com.nnbc123.core.community.event.DynamicPublishEvent;
|
||||
import com.nnbc123.core.community.square.SquareModel;
|
||||
import com.nnbc123.core.miniworld.bean.MiniWorldInfo;
|
||||
import com.nnbc123.core.statistic.StatisticManager;
|
||||
import com.nnbc123.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.nnbc123.core.user.UserModel;
|
||||
import com.nnbc123.core.user.event.LoadLoginUserInfoEvent;
|
||||
import com.nnbc123.core.utils.net.DontWarnObserver;
|
||||
import com.nnbc123.library.base.factory.CreatePresenter;
|
||||
import com.nnbc123.library.utils.SizeUtils;
|
||||
import com.nnbc123.xchat_android_constants.XChatConstants;
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -62,8 +50,7 @@ import io.reactivex.Single;
|
||||
/**
|
||||
* create by lvzebiao @2020/1/7
|
||||
*/
|
||||
@CreatePresenter(MiniWorldCategoryPresenter.class)
|
||||
public class SquareDynamicFragment extends BaseMvpFragment<IMiniWorldCategoryView, MiniWorldCategoryPresenter> implements IMiniWorldCategoryView {
|
||||
public class SquareDynamicFragment extends BaseFragment {
|
||||
|
||||
public static final String EXTRA_SQUARE_TYPE = "square_type";
|
||||
|
||||
@@ -72,31 +59,15 @@ public class SquareDynamicFragment extends BaseMvpFragment<IMiniWorldCategoryVie
|
||||
RecyclerView recyclerView;
|
||||
@BindView(R.id.refresh_layout)
|
||||
SwipeRefreshLayout refreshLayout;
|
||||
TextView tvTitleTopic;
|
||||
RecyclerView rvTopic;
|
||||
/**
|
||||
* 刷新的时候,传null
|
||||
*/
|
||||
/**
|
||||
* 话题类型ID
|
||||
* 全部 0
|
||||
* 推荐 1
|
||||
*/
|
||||
private static final String TOPIC_CATEGORY_ID = "1";
|
||||
|
||||
private String nextDynamicId;
|
||||
|
||||
private int page = 1;
|
||||
|
||||
private SquareDynamicAdapter adapter;
|
||||
|
||||
|
||||
private View headerView;
|
||||
private NewSquareDynamicAdapter adapter;
|
||||
|
||||
private int squareType;
|
||||
|
||||
private RecommendTopicListAdapter mRecommendTopicAdapter;
|
||||
|
||||
public static SquareDynamicFragment newInstance(int type) {
|
||||
SquareDynamicFragment fragment = new SquareDynamicFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
@@ -114,28 +85,14 @@ public class SquareDynamicFragment extends BaseMvpFragment<IMiniWorldCategoryVie
|
||||
return mView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFindViews() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetListener() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiate() {
|
||||
Bundle bundle = getArguments();
|
||||
if (bundle != null) {
|
||||
squareType = bundle.getInt(EXTRA_SQUARE_TYPE, SquareFragment.TAB_TYPE_RECOMMEND);
|
||||
}
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
adapter = new SquareDynamicAdapter(getActivity());
|
||||
|
||||
if (squareType == SquareFragment.TAB_TYPE_RECOMMEND) {
|
||||
initHeader();
|
||||
}
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(mContext,2,GridLayoutManager.VERTICAL,false));
|
||||
adapter = new NewSquareDynamicAdapter();
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.addItemDecoration(new RecyclerView.ItemDecoration() {
|
||||
|
||||
@@ -182,15 +139,9 @@ public class SquareDynamicFragment extends BaseMvpFragment<IMiniWorldCategoryVie
|
||||
refreshLayout = mView.findViewById(R.id.refresh_layout);
|
||||
refreshLayout.setOnRefreshListener(() -> {
|
||||
loadData(true);
|
||||
if (squareType == SquareFragment.TAB_TYPE_RECOMMEND) {
|
||||
getMvpPresenter().getMiniWorldList(TOPIC_CATEGORY_ID, 1);
|
||||
}
|
||||
});
|
||||
|
||||
loadData(true);
|
||||
if (squareType == SquareFragment.TAB_TYPE_RECOMMEND) {
|
||||
getMvpPresenter().getMiniWorldList(TOPIC_CATEGORY_ID, 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadData(boolean isRefresh) {
|
||||
@@ -295,44 +246,6 @@ public class SquareDynamicFragment extends BaseMvpFragment<IMiniWorldCategoryVie
|
||||
});
|
||||
}
|
||||
|
||||
private void initHeader() {
|
||||
headerView = LayoutInflater.from(mContext).inflate(R.layout.layout_recommend_topic_header, null);
|
||||
tvTitleTopic = headerView.findViewById(R.id.tv_title_topic);
|
||||
tvTitleTopic.setOnClickListener(v -> {
|
||||
AllTopicActivity.start(getActivity(), 0);
|
||||
});
|
||||
|
||||
rvTopic = headerView.findViewById(R.id.recycler_view);
|
||||
initRecyclerView(headerView);
|
||||
adapter.addHeaderView(headerView);
|
||||
|
||||
}
|
||||
|
||||
private void initRecyclerView(View headerView) {
|
||||
RecyclerView recyclerView = headerView.findViewById(R.id.rv_topic);
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
|
||||
layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
|
||||
recyclerView.setLayoutManager(layoutManager);
|
||||
List<MiniWorldInfo> list = new ArrayList<>();
|
||||
for (int i = 0; i < 100; i++) {
|
||||
list.add(new MiniWorldInfo());
|
||||
}
|
||||
mRecommendTopicAdapter = new RecommendTopicListAdapter(list);
|
||||
mRecommendTopicAdapter.setEnableLoadMore(false);
|
||||
mRecommendTopicAdapter.setOnItemClickListener(new DoubleClickCheckListener() {
|
||||
@Override
|
||||
protected void onItemClickSingle(BaseQuickAdapter adapter, View view, int position) {
|
||||
MiniWorldInfo miniWorldInfo = mRecommendTopicAdapter.getItem(position);
|
||||
if (miniWorldInfo == null) {
|
||||
return;
|
||||
}
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_SQUARE_DONGTAI_TJ_HJ_CLICK,
|
||||
"广场动态页_推荐_点击话题");
|
||||
TopicMainActivity.start(mContext, String.valueOf(miniWorldInfo.getId()));
|
||||
}
|
||||
});
|
||||
recyclerView.setAdapter(mRecommendTopicAdapter);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onDynamicPublishEvent(DynamicPublishEvent event) {
|
||||
@@ -360,18 +273,4 @@ public class SquareDynamicFragment extends BaseMvpFragment<IMiniWorldCategoryVie
|
||||
unbinder.unbind();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showRetry() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetMiniWorldList(List<MiniWorldInfo> miniWorldInfos, boolean isRefresh, boolean isNextData) {
|
||||
mRecommendTopicAdapter.replaceData(miniWorldInfos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showNoMoreData() {
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,34 +1,56 @@
|
||||
package com.nnbc123.app.community.square;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.netease.nim.uikit.common.ui.draggablebubbles.BubbleView;
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.avroom.adapter.RoomContributeListAdapter;
|
||||
import com.nnbc123.app.base.BaseFragment;
|
||||
import com.nnbc123.app.common.widget.DragLayout;
|
||||
import com.nnbc123.app.community.dynamic.view.DynamicDetailActivity;
|
||||
import com.nnbc123.app.community.publish.view.PublishActivity;
|
||||
import com.nnbc123.app.home.adapter.TopMagicIndicatorAdapter;
|
||||
import com.nnbc123.app.home.activity.CommunityNoticeAct;
|
||||
import com.nnbc123.app.home.adapter.MainMagicIndicatorAdapter;
|
||||
import com.nnbc123.app.miniworld.activity.TopicMainActivity;
|
||||
import com.nnbc123.app.ui.utils.ImageLoadKt;
|
||||
import com.nnbc123.app.ui.widget.OnPageSelectedListener;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.MagicIndicator;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.ViewPagerHelper;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import com.nnbc123.app.ui.widget.rollviewpager.RollPagerView;
|
||||
import com.nnbc123.app.ui.widget.rollviewpager.Util;
|
||||
import com.nnbc123.app.ui.widget.rollviewpager.adapter.StaticPagerAdapter;
|
||||
import com.nnbc123.app.ui.widget.rollviewpager.hintview.ColorPointHintView;
|
||||
import com.nnbc123.core.auth.AuthModel;
|
||||
import com.nnbc123.core.community.dynamic.DynamicModel;
|
||||
import com.nnbc123.core.community.event.UnReadCountEvent;
|
||||
import com.nnbc123.core.home.model.HomeModel;
|
||||
import com.nnbc123.core.miniworld.bean.MiniWorldInfo;
|
||||
import com.nnbc123.core.miniworld.model.MiniWorldModel;
|
||||
import com.nnbc123.core.statistic.StatisticManager;
|
||||
import com.nnbc123.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.nnbc123.core.user.event.LoadLoginUserInfoEvent;
|
||||
import com.nnbc123.core.utils.net.RxHelper;
|
||||
import com.nnbc123.library.base.PresenterEvent;
|
||||
import com.nnbc123.library.utils.ListUtils;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -42,14 +64,11 @@ import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.functions.BiConsumer;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
/**
|
||||
* create by lvzebiao @2020/1/7
|
||||
*/
|
||||
|
||||
public class SquareFragment extends BaseFragment implements TopMagicIndicatorAdapter.OnItemSelectListener, View.OnClickListener{
|
||||
public class SquareFragment extends BaseFragment implements MainMagicIndicatorAdapter.OnItemSelectListener, View.OnClickListener {
|
||||
public static final String TAG = "SquareFragment";
|
||||
/**
|
||||
* 关注
|
||||
@@ -75,6 +94,8 @@ public class SquareFragment extends BaseFragment implements TopMagicIndicatorAd
|
||||
FrameLayout flContactList;
|
||||
@BindView(R.id.msg_number)
|
||||
TextView tvCommunityUnread;
|
||||
@BindView(R.id.roll_view)
|
||||
RollPagerView rollView;
|
||||
|
||||
|
||||
public static SquareFragment newInstance() {
|
||||
@@ -94,7 +115,7 @@ public class SquareFragment extends BaseFragment implements TopMagicIndicatorAd
|
||||
tagList.add(getResources().getString(R.string.dys_tab_attent));
|
||||
} else if (integer == TAB_TYPE_RECOMMEND) {
|
||||
tagList.add(getResources().getString(R.string.dys_tab_recommend));
|
||||
} else if (integer == TAB_TYPE_NEW){
|
||||
} else if (integer == TAB_TYPE_NEW) {
|
||||
tagList.add(getResources().getString(R.string.dys_tab_new));
|
||||
}
|
||||
fragmentList.add(SquareDynamicFragment.newInstance(integer));
|
||||
@@ -108,13 +129,13 @@ public class SquareFragment extends BaseFragment implements TopMagicIndicatorAd
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
String tag = "";
|
||||
if(position == 0){
|
||||
if (position == 0) {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_SQUARE_DONGTAI_FOLLOW_CLICK,
|
||||
"广场动态页_关注");
|
||||
tag = getResources().getString(R.string.dys_tab_attent);
|
||||
}else if (position == 1){
|
||||
} else if (position == 1) {
|
||||
tag = getResources().getString(R.string.dys_tab_recommend);
|
||||
} else if (position == 2){
|
||||
} else if (position == 2) {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_SQUARE_DONGTAI_NEW_CLICK,
|
||||
"广场动态页_最新");
|
||||
tag = getResources().getString(R.string.dys_tab_new);
|
||||
@@ -123,24 +144,68 @@ public class SquareFragment extends BaseFragment implements TopMagicIndicatorAd
|
||||
});
|
||||
|
||||
CommonNavigator commonNavigator = new CommonNavigator(getContext());
|
||||
TopMagicIndicatorAdapter magicIndicatorAdapter = new TopMagicIndicatorAdapter(getContext(), tagList);
|
||||
commonNavigator.setTitleMargin(ScreenUtil.dip2px(6.0F));
|
||||
MainMagicIndicatorAdapter magicIndicatorAdapter = new MainMagicIndicatorAdapter(getContext(), tagList);
|
||||
magicIndicatorAdapter.setOnItemSelectListener(this);
|
||||
magicIndicatorAdapter.setTextSize(16);
|
||||
magicIndicatorAdapter.setMinScale(0.85f);
|
||||
magicIndicatorAdapter.setResId(R.drawable.ic_home_indicator_center);
|
||||
commonNavigator.setTitleWrapContent(true);
|
||||
commonNavigator.setAdapter(magicIndicatorAdapter);
|
||||
|
||||
magicIndicator.setNavigator(commonNavigator);
|
||||
|
||||
//init indicator
|
||||
|
||||
ViewPagerHelper.bind(magicIndicator, viewPager);
|
||||
viewPager.setCurrentItem(TAB_TYPE_RECOMMEND);
|
||||
|
||||
|
||||
initTopic();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemSelect(int position) {
|
||||
viewPager.setCurrentItem(position);
|
||||
@SuppressLint({"CheckResult", "SetTextI18n"})
|
||||
private void initTopic() {
|
||||
rollView.setHintView(new ColorPointHintView(mContext, Color.WHITE, mContext.getResources().getColor(R.color.color_66FFFFFF)) {
|
||||
@Override
|
||||
public Drawable makeFocusDrawable() {
|
||||
GradientDrawable dotFocus = new GradientDrawable();
|
||||
dotFocus.setColor(Color.WHITE);
|
||||
dotFocus.setCornerRadius(Util.dip2px(getContext(), 2));
|
||||
dotFocus.setSize(Util.dip2px(getContext(), 9), Util.dip2px(getContext(), 4));
|
||||
return dotFocus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Drawable makeNormalDrawable() {
|
||||
GradientDrawable dotNormal = new GradientDrawable();
|
||||
dotNormal.setColor(mContext.getResources().getColor(R.color.color_66FFFFFF));
|
||||
dotNormal.setCornerRadius(Util.dip2px(getContext(), 2));
|
||||
dotNormal.setSize(Util.dip2px(getContext(), 4), Util.dip2px(getContext(), 4));
|
||||
return dotNormal;
|
||||
}
|
||||
});
|
||||
|
||||
MiniWorldModel.getInstance().getCategoryMiniWorldList("0", 1, 500)
|
||||
.compose(RxHelper.handleSchAndExce())
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe((miniWorldInfos, throwable) -> {
|
||||
if (miniWorldInfos != null) {
|
||||
rollView.setAdapter(new StaticPagerAdapter() {
|
||||
@Override
|
||||
public View getView(ViewGroup container, int position) {
|
||||
MiniWorldInfo worldInfo = miniWorldInfos.get(position);
|
||||
View flRoot = LayoutInflater.from(container.getContext()).inflate(R.layout.item_square_topic_banner, container, false);
|
||||
ImageView imgBanner = flRoot.findViewById(R.id.iv_cover);
|
||||
ImageLoadKt.load(imgBanner, worldInfo.getIcon(), 12);
|
||||
TextView tvTopic = flRoot.findViewById(R.id.tv_topic);
|
||||
tvTopic.setText("#" + worldInfo.getName());
|
||||
flRoot.setOnClickListener(v -> TopicMainActivity.start(mContext, String.valueOf(worldInfo.getId())));
|
||||
return flRoot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return miniWorldInfos.size();
|
||||
}
|
||||
});
|
||||
rollView.setPlayDelay(5000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -196,7 +261,7 @@ public class SquareFragment extends BaseFragment implements TopMagicIndicatorAd
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
public void setNumber(int number) {
|
||||
if(tvCommunityUnread instanceof BubbleView){
|
||||
if (tvCommunityUnread instanceof BubbleView) {
|
||||
((BubbleView) tvCommunityUnread).setNumText(number);
|
||||
return;
|
||||
}
|
||||
@@ -217,15 +282,16 @@ public class SquareFragment extends BaseFragment implements TopMagicIndicatorAd
|
||||
private void getUnReadCount() {
|
||||
HomeModel.INSTANCE.getUnreadCount(AuthModel.get().getCurrentUid())
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(new BiConsumer<Integer, Throwable>() {
|
||||
@Override
|
||||
public void accept(Integer integer, Throwable throwable) throws Exception {
|
||||
if (integer != null) {
|
||||
EventBus.getDefault().post(new UnReadCountEvent(integer));
|
||||
}
|
||||
.subscribe((integer, throwable) -> {
|
||||
if (integer != null) {
|
||||
EventBus.getDefault().post(new UnReadCountEvent(integer));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemSelect(int position, TextView view) {
|
||||
viewPager.setCurrentItem(position);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,104 @@
|
||||
package com.nnbc123.app.community.square.adapter
|
||||
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil
|
||||
import com.nnbc123.app.R
|
||||
import com.nnbc123.app.community.dynamic.view.DynamicDetailActivity
|
||||
import com.nnbc123.app.ui.utils.load
|
||||
import com.nnbc123.app.ui.utils.loadAvatar
|
||||
import com.nnbc123.core.community.bean.WorldDynamicBean
|
||||
import com.nnbc123.core.community.dynamic.DynamicModel
|
||||
import com.nnbc123.core.utils.net.DontWarnObserver
|
||||
import com.nnbc123.core.utils.net.RxHelper
|
||||
import com.nnbc123.core.utils.subAndReplaceDot
|
||||
import com.nnbc123.library.utils.SingleToastUtil
|
||||
|
||||
|
||||
class NewSquareDynamicAdapter :
|
||||
BaseQuickAdapter<WorldDynamicBean, BaseViewHolder>(R.layout.item_square_dynamic_new) {
|
||||
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: WorldDynamicBean) {
|
||||
|
||||
helper.getView<ImageView>(R.id.iv_avatar).loadAvatar(item.avatar)
|
||||
helper.setText(R.id.tv_nickname, item.nick.subAndReplaceDot(10))
|
||||
helper.setText(R.id.tv_content, item.content)
|
||||
helper.getView<ImageView>(R.id.iv_cover)
|
||||
.load(item.dynamicResList?.getOrNull(0)?.resUrl, 12f)
|
||||
helper.setGone(R.id.tv_live, item.inRoomUid != null)
|
||||
helper.addOnClickListener(R.id.iv_in_room)
|
||||
//点赞
|
||||
setLikeCount(helper, item.likeCount, item.isLike)
|
||||
val llLike: LinearLayout = helper.getView(R.id.ll_like)
|
||||
llLike.isEnabled = true
|
||||
llLike.setOnClickListener {
|
||||
llLike.isEnabled = false
|
||||
val status = if (item.isLike) 0 else 1
|
||||
DynamicModel.get()
|
||||
.like(item.worldId, item.dynamicId, item.uid, status, 4)
|
||||
.compose(RxHelper.bindContext(mContext))
|
||||
.subscribe(object : DontWarnObserver<String>() {
|
||||
override fun accept(s: String?, error: String?) {
|
||||
super.accept(s, error)
|
||||
llLike.isEnabled = true
|
||||
if (error != null) {
|
||||
SingleToastUtil.showToast(error)
|
||||
} else {
|
||||
LogUtil.print("调用点赞接口完成...")
|
||||
if (status == 1) {
|
||||
item.likeCount = item.likeCount + 1
|
||||
} else {
|
||||
item.likeCount = item.likeCount - 1
|
||||
}
|
||||
item.isLike = status == 1
|
||||
setLikeCount(helper, item.likeCount, item.isLike)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
helper.itemView.setOnClickListener {
|
||||
DynamicDetailActivity.start(
|
||||
mContext,
|
||||
item.dynamicId,
|
||||
item.worldId,
|
||||
helper.bindingAdapterPosition,
|
||||
false,
|
||||
6
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private fun setLikeCount(
|
||||
helper: BaseViewHolder,
|
||||
likeCount: Int,
|
||||
isLike: Boolean
|
||||
) {
|
||||
val tvLike = helper.getView<TextView>(R.id.tv_like)
|
||||
val likeCountStr: String = when {
|
||||
likeCount < 0 -> {
|
||||
"0"
|
||||
}
|
||||
likeCount >= 1000 -> {
|
||||
"999+"
|
||||
}
|
||||
else -> {
|
||||
likeCount.toString()
|
||||
}
|
||||
}
|
||||
tvLike.text = likeCountStr
|
||||
val ivLikeAnim = helper.getView<ImageView>(R.id.iv_like_pic)
|
||||
if (isLike) {
|
||||
ivLikeAnim.setImageResource(R.drawable.icon_square_dynamic_like_checked_new)
|
||||
} else {
|
||||
ivLikeAnim.setImageResource(R.drawable.icon_square_dynamic_like_normal_new)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -24,7 +24,6 @@ import com.nnbc123.app.community.widget.ExpandableTextView;
|
||||
import com.nnbc123.app.community.widget.GridImageWidget;
|
||||
import com.nnbc123.app.community.widget.TopicLabelWidget;
|
||||
import com.nnbc123.app.miniworld.activity.TopicMainActivity;
|
||||
import com.nnbc123.app.miniworld.presenter.MiniWorldCategoryPresenter;
|
||||
import com.nnbc123.app.ui.utils.ImageLoadUtilsV2;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.nnbc123.app.utils.TimeUiUtils;
|
||||
@@ -35,7 +34,6 @@ import com.nnbc123.core.statistic.StatisticManager;
|
||||
import com.nnbc123.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.nnbc123.core.utils.net.DontWarnObserver;
|
||||
import com.nnbc123.core.utils.net.RxHelper;
|
||||
import com.nnbc123.library.base.factory.CreatePresenter;
|
||||
import com.nnbc123.library.utils.SingleToastUtil;
|
||||
|
||||
import java.util.List;
|
||||
@@ -43,7 +41,6 @@ import java.util.List;
|
||||
/**
|
||||
* create by lvzebiao @2019/11/13
|
||||
*/
|
||||
@CreatePresenter(MiniWorldCategoryPresenter.class)
|
||||
public class SquareDynamicAdapter extends BaseQuickAdapter<WorldDynamicBean, BaseViewHolder> {
|
||||
|
||||
private SparseBooleanArray mCollapsedStatus = new SparseBooleanArray();
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 605 B |
Binary file not shown.
After Width: | Height: | Size: 598 B |
@@ -5,79 +5,110 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bg_normal_1c1b22"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
android:paddingTop="54dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:id="@+id/coordinator_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="20dp">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.nnbc123.app.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/magic_indicator"
|
||||
android:layout_width="wrap_content"
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/app_bar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:layout_height="20dp"
|
||||
tools:layout_width="match_parent" />
|
||||
android:background="@color/transparent"
|
||||
app:elevation="0dp"
|
||||
app:layout_behavior="com.nnbc123.app.ui.widget.AppBarLayoutBehavior">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_contact_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
app:layout_constraintBottom_toBottomOf="@id/magic_indicator"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="21dp"
|
||||
android:layout_height="21dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_community_notice_rink" />
|
||||
|
||||
<com.netease.nim.uikit.common.ui.draggablebubbles.BubbleView
|
||||
android:id="@+id/msg_number"
|
||||
android:layout_width="wrap_content"
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:visibility="invisible"
|
||||
tools:text="123"
|
||||
tools:visibility="visible" />
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
app:contentScrim="@color/transparent"
|
||||
app:layout_scrollFlags="scroll|enterAlwaysCollapsed">
|
||||
|
||||
</FrameLayout>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.nnbc123.app.ui.widget.rollviewpager.RollPagerView
|
||||
android:id="@+id/roll_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintDimensionRatio="345:74"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.nnbc123.app.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/magic_indicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="31dp"
|
||||
android:layout_marginStart="13dp"
|
||||
tools:layout_height="20dp" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_contact_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="21dp"
|
||||
android:layout_height="21dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_community_notice_rink" />
|
||||
|
||||
<com.netease.nim.uikit.common.ui.draggablebubbles.BubbleView
|
||||
android:id="@+id/msg_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:visibility="visible"
|
||||
tools:text="123"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@color/transparent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/magic_indicator" />
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
<com.nnbc123.app.common.widget.DragLayout
|
||||
android:id="@+id/iv_square_publish"
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
<com.nnbc123.app.common.widget.DragLayout
|
||||
android:id="@+id/iv_square_publish"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginBottom="90dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginBottom="90dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
android:src="@drawable/ic_square_publish" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_square_publish" />
|
||||
</com.nnbc123.app.common.widget.DragLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.nnbc123.app.common.widget.DragLayout>
|
||||
|
||||
</FrameLayout>
|
@@ -210,6 +210,7 @@
|
||||
android:textColor="@color/color_666666"
|
||||
android:textSize="@dimen/sp_12"
|
||||
tools:text="0123" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
122
app/src/module_community/res/layout/item_square_dynamic_new.xml
Normal file
122
app/src/module_community/res/layout/item_square_dynamic_new.xml
Normal file
@@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:orientation="vertical"
|
||||
tools:layout_width="165dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/default_cover"
|
||||
app:layout_constraintDimensionRatio="165:220"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_bg_bottom"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/shape_dynamic_bottom"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_cover"
|
||||
app:layout_constraintDimensionRatio="165:60"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_cover"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_cover" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginEnd="17dp"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:text="动态文案文案动态文..."
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_cover"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_cover"
|
||||
app:layout_constraintTop_toTopOf="@id/view_bg_bottom" />
|
||||
|
||||
<com.nnbc123.app.common.widget.CircleImageView
|
||||
android:id="@+id/iv_avatar"
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="26dp"
|
||||
android:src="@drawable/default_cover"
|
||||
app:cborder_color="@color/white"
|
||||
app:cborder_width="1px"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_cover"
|
||||
app:layout_constraintStart_toStartOf="@id/tv_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_live"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="10dp"
|
||||
android:text="直播中"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:layout_marginEnd="1dp"
|
||||
android:layout_marginStart="1dp"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_avatar"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_avatar"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_avatar"
|
||||
android:background="@drawable/shape_232323_bottom_40dp"
|
||||
android:textColor="#73fff6"
|
||||
android:textSize="6sp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_nickname"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_avatar"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_avatar"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_avatar"
|
||||
tools:text="小半" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_like"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_avatar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_avatar">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_like_pic"
|
||||
android:layout_width="@dimen/dp_12"
|
||||
android:layout_height="@dimen/dp_12"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="@drawable/icon_square_dynamic_like_normal_new" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_like"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_11"
|
||||
tools:text="123" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Reference in New Issue
Block a user