首页UI调整
This commit is contained in:
@@ -12,9 +12,12 @@ import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.util.LongSparseArray;
|
||||
import android.view.GestureDetector;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -22,6 +25,7 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.coorchice.library.utils.LogUtils;
|
||||
import com.mcxiaoke.packer.helper.PackerNg;
|
||||
import com.microquation.linkedme.android.LinkedME;
|
||||
import com.netease.nim.uikit.api.NimUIKit;
|
||||
@@ -55,6 +59,7 @@ import com.yizhuan.erban.base.BaseMvpActivity;
|
||||
import com.yizhuan.erban.common.widget.CircleImageView;
|
||||
import com.yizhuan.erban.common.widget.DragLayout;
|
||||
import com.yizhuan.erban.common.widget.FloatingLiveMiniView;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
import com.yizhuan.erban.community.dynamic.view.DynamicDetailActivity;
|
||||
import com.yizhuan.erban.community.holder.DynamicSysHolder;
|
||||
import com.yizhuan.erban.community.im.WorldDynamicShareViewHolder;
|
||||
@@ -64,6 +69,7 @@ import com.yizhuan.erban.decoration.view.widgets.ShowCarGuideDialog;
|
||||
import com.yizhuan.erban.family.view.activity.FamilyHomeActivity;
|
||||
import com.yizhuan.erban.guide.GuideActivity;
|
||||
import com.yizhuan.erban.home.dialog.RecommendRoomForNewerDialog;
|
||||
import com.yizhuan.erban.home.event.HomeDynamicEvent;
|
||||
import com.yizhuan.erban.home.fragment.CommunityNoticeAct;
|
||||
import com.yizhuan.erban.home.fragment.ContactsListFragment;
|
||||
import com.yizhuan.erban.home.fragment.GameHomeFragment;
|
||||
@@ -163,6 +169,7 @@ import com.yizhuan.xchat_android_core.recall.bean.CheckLostUserInfo;
|
||||
import com.yizhuan.xchat_android_core.recall.event.CheckLostUserEvent;
|
||||
import com.yizhuan.xchat_android_core.redPacket.bean.RedPacketInfoV2;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel;
|
||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
@@ -205,7 +212,7 @@ import static com.yizhuan.xchat_android_core.Constants.SHOW_CAR_GUIDE;
|
||||
*/
|
||||
@CreatePresenter(MainPresenter.class)
|
||||
public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
implements MainTabLayout.OnTabClickListener, IMainView, View.OnClickListener {
|
||||
implements MainTabLayout.OnTabClickListener, IMainView, View.OnClickListener{
|
||||
|
||||
private static final String TAG = "MainActivity";
|
||||
|
||||
@@ -244,6 +251,8 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
*/
|
||||
private LimitEnterRoomHelper limitEnterRoomHelper;
|
||||
|
||||
GestureDetector detector;
|
||||
|
||||
|
||||
public static void start(Context context) {
|
||||
start(context, null);
|
||||
@@ -278,7 +287,6 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
NimMiddleActivity.firstEnter = false;
|
||||
|
||||
if (savedInstanceState != null) {
|
||||
mCurrentMainPosition = savedInstanceState.getInt(Constants.KEY_MAIN_POSITION);
|
||||
}
|
||||
@@ -520,6 +528,7 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
userLivingView.setColor(Color.WHITE);
|
||||
mMainTabLayout.setOnTabClickListener(this);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1243,4 +1252,15 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
EventBus.getDefault().post(new HomeDynamicEvent(true));
|
||||
}else if (ev.getAction() == MotionEvent.ACTION_UP) {
|
||||
EventBus.getDefault().post(new HomeDynamicEvent(false));
|
||||
}
|
||||
return super.dispatchTouchEvent(ev);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
package com.yizhuan.erban.home.adapter;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.netease.nim.uikit.common.ui.recyclerview.adapter.BaseMultiItemQuickAdapter;
|
||||
import com.netease.nim.uikit.common.ui.recyclerview.holder.BaseViewHolder;
|
||||
import com.yizhuan.erban.home.model.HomeMultiItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class HomeMultiItemQuickAdapter extends BaseMultiItemQuickAdapter<HomeMultiItem, BaseViewHolder> {
|
||||
|
||||
|
||||
public HomeMultiItemQuickAdapter(RecyclerView recyclerView, List<HomeMultiItem> data) {
|
||||
super(recyclerView, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getViewType(HomeMultiItem item) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getItemKey(HomeMultiItem item) {
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
package com.yizhuan.erban.home.event;
|
||||
|
||||
public class HomeDynamicEvent {
|
||||
private boolean isRunning;
|
||||
|
||||
public HomeDynamicEvent(boolean isRunning) {
|
||||
this.isRunning = isRunning;
|
||||
}
|
||||
|
||||
public boolean isRunning() {
|
||||
return isRunning;
|
||||
}
|
||||
|
||||
public void setRunning(boolean running) {
|
||||
isRunning = running;
|
||||
}
|
||||
}
|
@@ -197,22 +197,22 @@ public class FamilyFragment extends BaseMvpFragment<IFamilyFragmentView, FamilyF
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
loadData();
|
||||
getMvpPresenter().showCustomerServiceInfo().subscribe(new SingleObserver<FamilyCustomServiceInfo>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mCompositeDisposable.add(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(FamilyCustomServiceInfo familyCustomServiceInfo) {
|
||||
onCustomServiceInfo(familyCustomServiceInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
onCustomServiceFail(e.getMessage());
|
||||
}
|
||||
});
|
||||
// getMvpPresenter().showCustomerServiceInfo().subscribe(new SingleObserver<FamilyCustomServiceInfo>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// mCompositeDisposable.add(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onSuccess(FamilyCustomServiceInfo familyCustomServiceInfo) {
|
||||
// onCustomServiceInfo(familyCustomServiceInfo);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Throwable e) {
|
||||
// onCustomServiceFail(e.getMessage());
|
||||
// }
|
||||
// });
|
||||
|
||||
getMvpPresenter().checkMyFamilyInfo();
|
||||
|
||||
|
@@ -8,10 +8,13 @@ import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.util.Log;
|
||||
import android.view.GestureDetector;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
@@ -22,6 +25,7 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
@@ -34,6 +38,7 @@ import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
|
||||
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.coorchice.library.utils.LogUtils;
|
||||
import com.jude.rollviewpager.Util;
|
||||
import com.jude.rollviewpager.hintview.ColorPointHintView;
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
@@ -115,7 +120,7 @@ import static com.yizhuan.xchat_android_core.certification.CertificationModel.CE
|
||||
*/
|
||||
@CreatePresenter(MainFragmentPresenter.class)
|
||||
public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFragmentPresenter>
|
||||
implements IMainFragmentView, View.OnClickListener, MainMagicIndicatorAdapter.OnItemSelectListener, MainMagicIndicatorAdapter.OnBottomItemSelectListener {
|
||||
implements IMainFragmentView, View.OnClickListener, MainMagicIndicatorAdapter.OnItemSelectListener, MainMagicIndicatorAdapter.OnBottomItemSelectListener{
|
||||
public static final String TAG = "GameHomeFragment";
|
||||
private FragmentGameHomeBinding mBinding;
|
||||
|
||||
@@ -143,6 +148,7 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
private List<Fragment> mFragments;
|
||||
private List<Fragment> mFragmentsBottom;
|
||||
private volatile boolean isUserLogin;
|
||||
private Handler uiHandler;
|
||||
|
||||
|
||||
/**
|
||||
@@ -229,23 +235,16 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
public void initiate() {
|
||||
isUserLogin = AuthModel.get().getCurrentUid() != 0;
|
||||
mBinding.rollView.setVisibility(View.GONE);
|
||||
|
||||
this.uiHandler = new Handler();
|
||||
initLocation();
|
||||
initGuide();
|
||||
initRefreshView();
|
||||
initTitleTab();
|
||||
initRoomConcern();
|
||||
|
||||
}
|
||||
|
||||
private void initRefreshView() {
|
||||
mBinding.appBar.addOnOffsetChangedListener((appBarLayout, i) -> {
|
||||
if (i >= 0) {
|
||||
mBinding.refreshLayout.setEnabled(true); //当滑动到顶部的时候开启
|
||||
} else {
|
||||
mBinding.refreshLayout.setEnabled(false); //否则关闭
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.refreshLayout.setOnRefreshListener(() -> {
|
||||
mBinding.refreshLayout.setRefreshing(false);
|
||||
initRoomTitleTab();
|
||||
@@ -255,6 +254,18 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
});
|
||||
}
|
||||
|
||||
public void scrollToView() {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
int position = mBinding.llIndicator.getTop();
|
||||
mBinding.stickyScrollView.scrollTo(0,position);//ScreenUtil.dip2px(100)
|
||||
// mBinding.rvFollowRoom.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}, 2000);
|
||||
mBinding.rvFollowRoom.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
private void initLocation() {
|
||||
//初始化定位
|
||||
@@ -318,6 +329,7 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
}
|
||||
});
|
||||
ViewPagerHelper.bind(mBinding.magicIndicatorBottom, mBinding.viewPagerBottom);
|
||||
scrollToView();
|
||||
}
|
||||
|
||||
|
||||
@@ -369,19 +381,8 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
}
|
||||
|
||||
private void openCreateRoomTypeDialog() {
|
||||
// new CreateRoomDialog(getActivity(), new CreateRoomDialog.OpenRoomListener() {
|
||||
// @Override
|
||||
// public void onNormalRoom() {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.game_homepage_createroom_ordinary_click, "创建普通房");
|
||||
getRoomInfo(RoomInfo.ROOMTYPE_HOME_PARTY);
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// public void onCpRoom() {
|
||||
// StatisticManager.Instance().onEvent(StatisticsProtocol.Event.game_homepage_createroom_cp_click, "创建陪伴房");
|
||||
// getRoomInfo(RoomInfo.ROOMTYPE_CP);
|
||||
// }
|
||||
// }).openDialog();
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.game_homepage_createroom_ordinary_click, "创建普通房");
|
||||
getRoomInfo(RoomInfo.ROOMTYPE_HOME_PARTY);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@@ -496,7 +497,7 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
@Override
|
||||
public void getFollowRoomsSuccess(List<HomeConcernsInfo> list) {
|
||||
if (list != null && list.size() > 0) {
|
||||
mBinding.rvFollowRoom.setVisibility(View.VISIBLE);
|
||||
// mBinding.rvFollowRoom.setVisibility(View.VISIBLE);
|
||||
mFollowRoomsAdapter.setNewData(list);
|
||||
} else {
|
||||
mBinding.rvFollowRoom.setVisibility(View.GONE);
|
||||
@@ -882,4 +883,5 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@@ -13,16 +13,19 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.coorchice.library.utils.LogUtils;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.base.BaseFragment;
|
||||
import com.yizhuan.erban.home.adapter.HomeDynamicAdapter;
|
||||
import com.yizhuan.erban.home.bean.HomeDynamicInfo;
|
||||
|
||||
import com.yizhuan.erban.home.bean.HomeTabMapInfo;
|
||||
import com.yizhuan.erban.home.event.HomeDynamicEvent;
|
||||
import com.yizhuan.erban.home.event.RefreshHomeDataEvent;
|
||||
import com.yizhuan.erban.home.model.HomeModel;
|
||||
import com.yizhuan.xchat_android_core.user.event.LoadLoginUserInfoEvent;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.LogUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.SizeUtils;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
@@ -92,6 +95,7 @@ public class HomeDynamicFragment extends BaseFragment{
|
||||
}
|
||||
});
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
// recyclerView.setNestedScrollingEnabled(false);
|
||||
dynamicAdapter = new HomeDynamicAdapter(getActivity());
|
||||
recyclerView.setAdapter(dynamicAdapter);
|
||||
}
|
||||
@@ -99,8 +103,6 @@ public class HomeDynamicFragment extends BaseFragment{
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
getHomeDynamic();
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@@ -114,6 +116,7 @@ public class HomeDynamicFragment extends BaseFragment{
|
||||
showNoData(R.drawable.icon_common_failure, "这里什么都没有");
|
||||
}else {
|
||||
hideStatus();
|
||||
dynamicAdapter.setNewData(dynamicList);
|
||||
refreshData();
|
||||
}
|
||||
}
|
||||
@@ -121,7 +124,6 @@ public class HomeDynamicFragment extends BaseFragment{
|
||||
}
|
||||
|
||||
private void refreshData(){
|
||||
dynamicAdapter.setNewData(dynamicList);
|
||||
if (runnable != null){
|
||||
return;
|
||||
}
|
||||
@@ -129,10 +131,8 @@ public class HomeDynamicFragment extends BaseFragment{
|
||||
@Override
|
||||
public void run() {
|
||||
if (getActivity() != null) {
|
||||
// dynamicAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
|
||||
dynamicAdapter.addData(0,dynamicList.get(dynamicList.size()-1));
|
||||
dynamicAdapter.remove(dynamicList.size()-1);
|
||||
dynamicAdapter.notifyDataSetChanged();
|
||||
handler.postDelayed(this, 3000);
|
||||
}
|
||||
}
|
||||
@@ -157,6 +157,16 @@ public class HomeDynamicFragment extends BaseFragment{
|
||||
getHomeDynamic();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onAutoRunningEvent(HomeDynamicEvent event) {
|
||||
if (event.isRunning()){
|
||||
stopTimer();
|
||||
}else {
|
||||
refreshData();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRootLayoutId() {
|
||||
return 0;
|
||||
|
@@ -291,17 +291,6 @@ public class MeFragment extends BaseMvpFragment<IMainFragmentView, MainFragmentP
|
||||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
switch (id) {
|
||||
// case R.id.me_item_my_family:
|
||||
//
|
||||
// StatisticManager.Instance().onEvent(BasicConfig.INSTANCE.getAppContext(),
|
||||
// StatisticsProtocol.Event.MY_FAMILY_CLICK, "我的家族入口", null);
|
||||
//
|
||||
// String familyId = null;
|
||||
// if (null != FamilyModel.Instance().getMyFamily()) {
|
||||
// familyId = FamilyModel.Instance().getMyFamily().getFamilyId();
|
||||
// }
|
||||
// FamilyHomeActivity.start(mContext, familyId);
|
||||
// break;
|
||||
case R.id.iv_user_head:
|
||||
case R.id.rl_user_info:
|
||||
if (mUserInfo != null) {
|
||||
@@ -322,10 +311,6 @@ public class MeFragment extends BaseMvpFragment<IMainFragmentView, MainFragmentP
|
||||
|
||||
case R.id.tv_user_fans:
|
||||
|
||||
// case R.id.fl_me_charm:
|
||||
// CommonWebViewActivity.start(mContext, UriProvider.getUserCharmLevelUrl());
|
||||
// break;
|
||||
|
||||
case R.id.tv_user_fan_text:
|
||||
startActivity(new Intent(mContext, FansListActivity.class));
|
||||
break;
|
||||
|
@@ -0,0 +1,20 @@
|
||||
package com.yizhuan.erban.home.model;
|
||||
|
||||
import com.chad.library.adapter.base.entity.MultiItemEntity;
|
||||
|
||||
public class HomeMultiItem implements MultiItemEntity {
|
||||
public static final int TYPE_CONCERN_ROOM = 1;
|
||||
public static final int TYPE_RECOMMEND_ROOM = 2;
|
||||
public static final int TYPE_BANNER = 3;
|
||||
public static final int TYPE_DYNAMIC = 4;
|
||||
private int itemType;
|
||||
|
||||
public HomeMultiItem(int itemType) {
|
||||
this.itemType = itemType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemType() {
|
||||
return itemType;
|
||||
}
|
||||
}
|
@@ -0,0 +1,396 @@
|
||||
package com.yizhuan.erban.home.widget;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.AlphaAnimation;
|
||||
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
|
||||
import com.yizhuan.erban.R;
|
||||
|
||||
public class StickyScrollView extends NestedScrollView {
|
||||
|
||||
/**
|
||||
* Tag for views that should stick and have constant drawing. e.g. TextViews, ImageViews etc
|
||||
*/
|
||||
public static final String STICKY_TAG = "sticky";
|
||||
|
||||
/**
|
||||
* Flag for views that should stick and have non-constant drawing. e.g. Buttons, ProgressBars etc
|
||||
*/
|
||||
public static final String FLAG_NONCONSTANT = "-nonconstant";
|
||||
|
||||
/**
|
||||
* Flag for views that have aren't fully opaque
|
||||
*/
|
||||
public static final String FLAG_HASTRANSPARANCY = "-hastransparancy";
|
||||
|
||||
/**
|
||||
* Default height of the shadow peeking out below the stuck view.
|
||||
*/
|
||||
private static final int DEFAULT_SHADOW_HEIGHT = 10; // dp;
|
||||
|
||||
private ArrayList<View> stickyViews;
|
||||
private View currentlyStickingView;
|
||||
private float stickyViewTopOffset;
|
||||
private int stickyViewLeftOffset;
|
||||
private boolean redirectTouchesToStickyView;
|
||||
private boolean clippingToPadding;
|
||||
private boolean clipToPaddingHasBeenSet;
|
||||
|
||||
private int mShadowHeight;
|
||||
private Drawable mShadowDrawable;
|
||||
|
||||
private final Runnable invalidateRunnable = new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (currentlyStickingView != null) {
|
||||
int l = getLeftForViewRelativeOnlyChild(currentlyStickingView);
|
||||
int t = getBottomForViewRelativeOnlyChild(currentlyStickingView);
|
||||
int r = getRightForViewRelativeOnlyChild(currentlyStickingView);
|
||||
int b = (int) (getScrollY() + (currentlyStickingView.getHeight() + stickyViewTopOffset));
|
||||
invalidate(l, t, r, b);
|
||||
}
|
||||
postDelayed(this, 16);
|
||||
}
|
||||
};
|
||||
|
||||
public StickyScrollView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public StickyScrollView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, android.R.attr.scrollViewStyle);
|
||||
}
|
||||
|
||||
public StickyScrollView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
setup();
|
||||
|
||||
TypedArray a = context.obtainStyledAttributes(attrs,
|
||||
R.styleable.StickyScrollView, defStyle, 0);
|
||||
|
||||
final float density = context.getResources().getDisplayMetrics().density;
|
||||
int defaultShadowHeightInPix = (int) (DEFAULT_SHADOW_HEIGHT * density + 0.5f);
|
||||
|
||||
mShadowHeight = a.getDimensionPixelSize(
|
||||
R.styleable.StickyScrollView_stuckShadowHeight,
|
||||
defaultShadowHeightInPix);
|
||||
|
||||
int shadowDrawableRes = a.getResourceId(
|
||||
R.styleable.StickyScrollView_stuckShadowDrawable, -1);
|
||||
|
||||
if (shadowDrawableRes != -1) {
|
||||
mShadowDrawable = context.getResources().getDrawable(
|
||||
shadowDrawableRes);
|
||||
}
|
||||
|
||||
a.recycle();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the height of the shadow drawable in pixels.
|
||||
*
|
||||
* @param height
|
||||
*/
|
||||
public void setShadowHeight(int height) {
|
||||
mShadowHeight = height;
|
||||
}
|
||||
|
||||
|
||||
public void setup() {
|
||||
stickyViews = new ArrayList<View>();
|
||||
}
|
||||
|
||||
private int getLeftForViewRelativeOnlyChild(View v) {
|
||||
int left = v.getLeft();
|
||||
while (v.getParent() != getChildAt(0)) {
|
||||
v = (View) v.getParent();
|
||||
left += v.getLeft();
|
||||
}
|
||||
return left;
|
||||
}
|
||||
|
||||
private int getTopForViewRelativeOnlyChild(View v) {
|
||||
int top = v.getTop();
|
||||
while (v.getParent() != getChildAt(0)) {
|
||||
v = (View) v.getParent();
|
||||
top += v.getTop();
|
||||
}
|
||||
return top;
|
||||
}
|
||||
|
||||
private int getRightForViewRelativeOnlyChild(View v) {
|
||||
int right = v.getRight();
|
||||
while (v.getParent() != getChildAt(0)) {
|
||||
v = (View) v.getParent();
|
||||
right += v.getRight();
|
||||
}
|
||||
return right;
|
||||
}
|
||||
|
||||
private int getBottomForViewRelativeOnlyChild(View v) {
|
||||
int bottom = v.getBottom();
|
||||
while (v.getParent() != getChildAt(0)) {
|
||||
v = (View) v.getParent();
|
||||
bottom += v.getBottom();
|
||||
}
|
||||
return bottom;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||
super.onLayout(changed, l, t, r, b);
|
||||
if (!clipToPaddingHasBeenSet) {
|
||||
clippingToPadding = true;
|
||||
}
|
||||
notifyHierarchyChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setClipToPadding(boolean clipToPadding) {
|
||||
super.setClipToPadding(clipToPadding);
|
||||
clippingToPadding = clipToPadding;
|
||||
clipToPaddingHasBeenSet = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addView(View child) {
|
||||
super.addView(child);
|
||||
findStickyViews(child);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addView(View child, int index) {
|
||||
super.addView(child, index);
|
||||
findStickyViews(child);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addView(View child, int index, android.view.ViewGroup.LayoutParams params) {
|
||||
super.addView(child, index, params);
|
||||
findStickyViews(child);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addView(View child, int width, int height) {
|
||||
super.addView(child, width, height);
|
||||
findStickyViews(child);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addView(View child, android.view.ViewGroup.LayoutParams params) {
|
||||
super.addView(child, params);
|
||||
findStickyViews(child);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatchDraw(Canvas canvas) {
|
||||
super.dispatchDraw(canvas);
|
||||
if (currentlyStickingView != null) {
|
||||
canvas.save();
|
||||
canvas.translate(getPaddingLeft() + stickyViewLeftOffset, getScrollY() + stickyViewTopOffset + (clippingToPadding ? getPaddingTop() : 0));
|
||||
|
||||
canvas.clipRect(0, (clippingToPadding ? -stickyViewTopOffset : 0),
|
||||
getWidth() - stickyViewLeftOffset,
|
||||
currentlyStickingView.getHeight() + mShadowHeight + 1);
|
||||
|
||||
if (mShadowDrawable != null) {
|
||||
int left = 0;
|
||||
int right = currentlyStickingView.getWidth();
|
||||
int top = currentlyStickingView.getHeight();
|
||||
int bottom = currentlyStickingView.getHeight() + mShadowHeight;
|
||||
mShadowDrawable.setBounds(left, top, right, bottom);
|
||||
mShadowDrawable.draw(canvas);
|
||||
}
|
||||
|
||||
canvas.clipRect(0, (clippingToPadding ? -stickyViewTopOffset : 0), getWidth(), currentlyStickingView.getHeight());
|
||||
if (getStringTagForView(currentlyStickingView).contains(FLAG_HASTRANSPARANCY)) {
|
||||
showView(currentlyStickingView);
|
||||
currentlyStickingView.draw(canvas);
|
||||
hideView(currentlyStickingView);
|
||||
} else {
|
||||
currentlyStickingView.draw(canvas);
|
||||
}
|
||||
canvas.restore();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
redirectTouchesToStickyView = true;
|
||||
}
|
||||
|
||||
if (redirectTouchesToStickyView) {
|
||||
redirectTouchesToStickyView = currentlyStickingView != null;
|
||||
if (redirectTouchesToStickyView) {
|
||||
redirectTouchesToStickyView =
|
||||
ev.getY() <= (currentlyStickingView.getHeight() + stickyViewTopOffset) &&
|
||||
ev.getX() >= getLeftForViewRelativeOnlyChild(currentlyStickingView) &&
|
||||
ev.getX() <= getRightForViewRelativeOnlyChild(currentlyStickingView);
|
||||
}
|
||||
} else if (currentlyStickingView == null) {
|
||||
redirectTouchesToStickyView = false;
|
||||
}
|
||||
if (redirectTouchesToStickyView) {
|
||||
ev.offsetLocation(0, -1 * ((getScrollY() + stickyViewTopOffset) - getTopForViewRelativeOnlyChild(currentlyStickingView)));
|
||||
}
|
||||
return super.dispatchTouchEvent(ev);
|
||||
}
|
||||
|
||||
private boolean hasNotDoneActionDown = true;
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent ev) {
|
||||
if (redirectTouchesToStickyView) {
|
||||
ev.offsetLocation(0, ((getScrollY() + stickyViewTopOffset) - getTopForViewRelativeOnlyChild(currentlyStickingView)));
|
||||
}
|
||||
|
||||
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
hasNotDoneActionDown = false;
|
||||
}
|
||||
|
||||
if (hasNotDoneActionDown) {
|
||||
MotionEvent down = MotionEvent.obtain(ev);
|
||||
down.setAction(MotionEvent.ACTION_DOWN);
|
||||
super.onTouchEvent(down);
|
||||
hasNotDoneActionDown = false;
|
||||
}
|
||||
|
||||
if (ev.getAction() == MotionEvent.ACTION_UP || ev.getAction() == MotionEvent.ACTION_CANCEL) {
|
||||
hasNotDoneActionDown = true;
|
||||
}
|
||||
|
||||
return super.onTouchEvent(ev);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
|
||||
super.onScrollChanged(l, t, oldl, oldt);
|
||||
doTheStickyThing();
|
||||
}
|
||||
|
||||
private void doTheStickyThing() {
|
||||
View viewThatShouldStick = null;
|
||||
View approachingView = null;
|
||||
for (View v : stickyViews) {
|
||||
int viewTop = getTopForViewRelativeOnlyChild(v) - getScrollY() + (clippingToPadding ? 0 : getPaddingTop());
|
||||
if (viewTop <= 0) {
|
||||
if (viewThatShouldStick == null || viewTop > (getTopForViewRelativeOnlyChild(viewThatShouldStick) - getScrollY() + (clippingToPadding ? 0 : getPaddingTop()))) {
|
||||
viewThatShouldStick = v;
|
||||
}
|
||||
} else {
|
||||
if (approachingView == null || viewTop < (getTopForViewRelativeOnlyChild(approachingView) - getScrollY() + (clippingToPadding ? 0 : getPaddingTop()))) {
|
||||
approachingView = v;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (viewThatShouldStick != null) {
|
||||
stickyViewTopOffset = approachingView == null ? 0 : Math.min(0, getTopForViewRelativeOnlyChild(approachingView) - getScrollY() + (clippingToPadding ? 0 : getPaddingTop()) - viewThatShouldStick.getHeight());
|
||||
if (viewThatShouldStick != currentlyStickingView) {
|
||||
if (currentlyStickingView != null) {
|
||||
stopStickingCurrentlyStickingView();
|
||||
}
|
||||
// only compute the left offset when we start sticking.
|
||||
stickyViewLeftOffset = getLeftForViewRelativeOnlyChild(viewThatShouldStick);
|
||||
startStickingView(viewThatShouldStick);
|
||||
}
|
||||
} else if (currentlyStickingView != null) {
|
||||
stopStickingCurrentlyStickingView();
|
||||
}
|
||||
}
|
||||
|
||||
private void startStickingView(View viewThatShouldStick) {
|
||||
currentlyStickingView = viewThatShouldStick;
|
||||
if (getStringTagForView(currentlyStickingView).contains(FLAG_HASTRANSPARANCY)) {
|
||||
hideView(currentlyStickingView);
|
||||
}
|
||||
if (((String) currentlyStickingView.getTag()).contains(FLAG_NONCONSTANT)) {
|
||||
post(invalidateRunnable);
|
||||
}
|
||||
}
|
||||
|
||||
private void stopStickingCurrentlyStickingView() {
|
||||
if (getStringTagForView(currentlyStickingView).contains(FLAG_HASTRANSPARANCY)) {
|
||||
showView(currentlyStickingView);
|
||||
}
|
||||
currentlyStickingView = null;
|
||||
removeCallbacks(invalidateRunnable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify that the sticky attribute has been added or removed from one or more views in the View hierarchy
|
||||
*/
|
||||
public void notifyStickyAttributeChanged() {
|
||||
notifyHierarchyChanged();
|
||||
}
|
||||
|
||||
private void notifyHierarchyChanged() {
|
||||
if (currentlyStickingView != null) {
|
||||
stopStickingCurrentlyStickingView();
|
||||
}
|
||||
stickyViews.clear();
|
||||
findStickyViews(getChildAt(0));
|
||||
doTheStickyThing();
|
||||
invalidate();
|
||||
}
|
||||
|
||||
private void findStickyViews(View v) {
|
||||
if (v instanceof ViewGroup) {
|
||||
ViewGroup vg = (ViewGroup) v;
|
||||
for (int i = 0; i < vg.getChildCount(); i++) {
|
||||
String tag = getStringTagForView(vg.getChildAt(i));
|
||||
if (tag != null && tag.contains(STICKY_TAG)) {
|
||||
stickyViews.add(vg.getChildAt(i));
|
||||
} else if (vg.getChildAt(i) instanceof ViewGroup) {
|
||||
findStickyViews(vg.getChildAt(i));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
String tag = (String) v.getTag();
|
||||
if (tag != null && tag.contains(STICKY_TAG)) {
|
||||
stickyViews.add(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getStringTagForView(View v) {
|
||||
Object tagObject = v.getTag();
|
||||
return String.valueOf(tagObject);
|
||||
}
|
||||
|
||||
private void hideView(View v) {
|
||||
if (Build.VERSION.SDK_INT >= 11) {
|
||||
v.setAlpha(0);
|
||||
} else {
|
||||
AlphaAnimation anim = new AlphaAnimation(1, 0);
|
||||
anim.setDuration(0);
|
||||
anim.setFillAfter(true);
|
||||
v.startAnimation(anim);
|
||||
}
|
||||
}
|
||||
|
||||
private void showView(View v) {
|
||||
if (Build.VERSION.SDK_INT >= 11) {
|
||||
v.setAlpha(1);
|
||||
} else {
|
||||
AlphaAnimation anim = new AlphaAnimation(0, 1);
|
||||
anim.setDuration(0);
|
||||
anim.setFillAfter(true);
|
||||
v.startAnimation(anim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -3,17 +3,16 @@ package com.yizhuan.erban.ui.user;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.coorchice.library.utils.LogUtils;
|
||||
import com.trello.rxlifecycle2.android.FragmentEvent;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.UIHelper;
|
||||
import com.yizhuan.erban.audio.RecordingVoiceActivity;
|
||||
@@ -29,8 +28,6 @@ import com.yizhuan.xchat_android_core.audio.AudioModel;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.bean.UserInfoItem;
|
||||
import com.yizhuan.xchat_android_core.family.bean.FamilyInfo;
|
||||
import com.yizhuan.xchat_android_core.family.model.FamilyModel;
|
||||
import com.yizhuan.xchat_android_core.market_verify.MarketVerifyModel;
|
||||
import com.yizhuan.xchat_android_core.miniworld.event.MiniWorldStateChangedEvent;
|
||||
import com.yizhuan.xchat_android_core.module_hall.hall.HallModel;
|
||||
import com.yizhuan.xchat_android_core.module_hall.hall.bean.OwnerHallInfo;
|
||||
@@ -47,7 +44,6 @@ import com.yizhuan.xchat_android_core.utils.StringUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.net.BeanObserver;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.LogUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.config.BasicConfig;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
@@ -271,24 +267,6 @@ public class UserInfoFragment extends BaseFragment implements View.OnClickListen
|
||||
initJoinWorlds(userInfo.getJoinWorlds());
|
||||
|
||||
mUserDesAdapter.setUserInfo(userInfo);
|
||||
//设置家族
|
||||
if (FamilyInfo.NO_FAMILY_ID.equals(userInfo.getFamilyId()) || TextUtils.isEmpty(userInfo.getFamilyId())
|
||||
|| MarketVerifyModel.get().isMarketChecking()) {
|
||||
} else {
|
||||
FamilyModel.Instance().loadFamilySimpleInfo(userInfo.getFamilyId())
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||
.subscribe(new BeanObserver<FamilyInfo>() {
|
||||
@Override
|
||||
public void onErrorMsg(String error) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(FamilyInfo familyInfo) {
|
||||
setUserInfoItem(familyInfo, UserInfoItem.TYPE_DES_FAMILY, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setHallData(userInfo);
|
||||
|
||||
}
|
||||
|
@@ -15,204 +15,189 @@
|
||||
type="Boolean" />
|
||||
</data>
|
||||
|
||||
<com.yizhuan.erban.utils.VpSwipeRefreshLayout
|
||||
android:id="@+id/refresh_layout"
|
||||
android:focusableInTouchMode="true"
|
||||
android:focusable="true"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<ImageView
|
||||
android:id="@+id/iv_bg_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_F9F9F9"
|
||||
>
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/bg_home_top"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_search_room"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_home_search"
|
||||
android:drawableStart="@mipmap/ic_home_search"
|
||||
android:drawablePadding="@dimen/dp_7"
|
||||
android:gravity="center_vertical"
|
||||
android:onClick="@{click}"
|
||||
android:paddingStart="@dimen/dp_11"
|
||||
android:paddingEnd="5dp"
|
||||
android:text="@string/search_hint"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_bg_top"
|
||||
android:id="@+id/iv_ranking"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/ic_home_ranking"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginStart="@dimen/dp_13"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:onClick="@{click}"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_to_sign_in"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/dp_11"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click}"
|
||||
android:visibility="gone"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/icon_to_sign_in" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.yizhuan.erban.utils.VpSwipeRefreshLayout
|
||||
android:id="@+id/refresh_layout"
|
||||
android:focusableInTouchMode="true"
|
||||
android:focusable="true"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp">
|
||||
|
||||
<com.yizhuan.erban.home.widget.StickyScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/bg_home_top"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/sticky_scroll_view">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_search_room"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_home_search"
|
||||
android:drawableStart="@mipmap/ic_home_search"
|
||||
android:drawablePadding="@dimen/dp_7"
|
||||
android:gravity="center_vertical"
|
||||
android:onClick="@{click}"
|
||||
android:paddingStart="@dimen/dp_11"
|
||||
android:paddingEnd="5dp"
|
||||
android:text="@string/search_hint"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_ranking"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/ic_home_ranking"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginStart="@dimen/dp_13"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:onClick="@{click}"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_to_sign_in"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/dp_11"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click}"
|
||||
android:visibility="gone"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/icon_to_sign_in" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:id="@+id/layout_coordinator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar"
|
||||
>
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/transparent"
|
||||
android:theme="@style/AppTheme.AppBarOverlay"
|
||||
app:expanded="false"
|
||||
tools:expanded="true"
|
||||
app:elevation="0dp">
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:id="@+id/collapsing_layout"
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_follow_room"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:paddingTop="@dimen/dp_8"
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
android:paddingEnd="@dimen/dp_15"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/ll_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toBottomOf="@id/rv_follow_room"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:paddingStart="14dp"
|
||||
android:paddingEnd="15dp"
|
||||
android:paddingBottom="10dp"
|
||||
>
|
||||
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/magic_indicator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_38"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_room_more"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_weight="1"
|
||||
android:paddingEnd="@dimen/dp_10"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_follow_room"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:paddingBottom="@dimen/dp_8"
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
android:paddingEnd="@dimen/dp_15"
|
||||
|
||||
/>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/ll_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toBottomOf="@id/rv_follow_room"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:paddingStart="14dp"
|
||||
android:paddingEnd="15dp"
|
||||
android:paddingBottom="10dp"
|
||||
>
|
||||
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/magic_indicator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_38"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_room_more"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_weight="1"
|
||||
android:paddingEnd="@dimen/dp_10"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="更多房间"
|
||||
app:layout_constraintTop_toTopOf="@id/magic_indicator"
|
||||
app:layout_constraintStart_toEndOf="@id/magic_indicator"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@id/magic_indicator"
|
||||
android:paddingTop="@dimen/dp_5"
|
||||
android:onClick="@{click}"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_14"
|
||||
android:drawablePadding="@dimen/dp_3"
|
||||
android:drawableRight="@drawable/arrow_right_white"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
android:gravity="center"
|
||||
android:text="更多房间"
|
||||
app:layout_constraintTop_toTopOf="@id/magic_indicator"
|
||||
app:layout_constraintStart_toEndOf="@id/magic_indicator"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@id/magic_indicator"
|
||||
android:paddingTop="@dimen/dp_5"
|
||||
android:onClick="@{click}"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_14"
|
||||
android:drawablePadding="@dimen/dp_3"
|
||||
android:drawableRight="@drawable/arrow_right_white"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
<com.yizhuan.erban.ui.widget.ContentWrapViewPager
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_indicator"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_roll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/color_F9F9F9"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_pager"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
>
|
||||
|
||||
<com.jude.rollviewpager.RollPagerView
|
||||
android:id="@+id/roll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
app:rollviewpager_hint_gravity="left"
|
||||
app:rollviewpager_hint_paddingBottom="8dp"
|
||||
/>
|
||||
</FrameLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
<com.yizhuan.erban.ui.widget.ContentWrapViewPager
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_indicator"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_roll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/color_F9F9F9"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_pager"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
>
|
||||
|
||||
<com.jude.rollviewpager.RollPagerView
|
||||
android:id="@+id/roll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
app:rollviewpager_hint_gravity="left"
|
||||
app:rollviewpager_hint_paddingBottom="8dp"
|
||||
/>
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
|
||||
<!-- </com.google.android.material.appbar.CollapsingToolbarLayout>-->
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/color_F9F9F9"
|
||||
android:tag="sticky"
|
||||
app:layout_constraintTop_toBottomOf="@+id/fl_roll_view"
|
||||
>
|
||||
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/magic_indicator_bottom"
|
||||
@@ -223,39 +208,44 @@
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
<!-- </com.google.android.material.appbar.AppBarLayout>-->
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/view_pager_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
<com.yizhuan.erban.ui.widget.ContentWrapViewPager
|
||||
android:id="@+id/view_pager_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/fl_indicator"
|
||||
/>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
<!-- </androidx.coordinatorlayout.widget.CoordinatorLayout>-->
|
||||
|
||||
<com.yizhuan.erban.common.widget.DragLayout
|
||||
android:id="@+id/activity_image_layout"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:visibility="gone">
|
||||
<com.yizhuan.erban.common.widget.DragLayout
|
||||
android:id="@+id/activity_image_layout"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:visibility="gone">
|
||||
|
||||
<com.jude.rollviewpager.RollPagerView
|
||||
android:id="@+id/activity_img"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:visibility="visible"
|
||||
app:rollviewpager_hint_gravity="center" />
|
||||
</com.yizhuan.erban.common.widget.DragLayout>
|
||||
<com.jude.rollviewpager.RollPagerView
|
||||
android:id="@+id/activity_img"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:visibility="visible"
|
||||
app:rollviewpager_hint_gravity="center" />
|
||||
</com.yizhuan.erban.common.widget.DragLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.yizhuan.erban.home.widget.StickyScrollView>
|
||||
|
||||
</com.yizhuan.erban.utils.VpSwipeRefreshLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.yizhuan.erban.utils.VpSwipeRefreshLayout>
|
||||
|
||||
</layout>
|
@@ -1,5 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<declare-styleable name="StickyScrollView">
|
||||
<attr name="stuckShadowHeight" format="dimension" />
|
||||
<attr name="stuckShadowDrawable" format="reference" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="roundedimageview">
|
||||
<attr name="border_thickness" format="dimension" />
|
||||
<attr name="border_inside_color" format="color" />
|
||||
|
@@ -135,20 +135,7 @@ public class SquareFragment extends BaseFragment implements TopMagicIndicatorAd
|
||||
|
||||
ViewPagerHelper.bind(magicIndicator, viewPager);
|
||||
viewPager.setCurrentItem(TAB_TYPE_RECOMMEND);
|
||||
tvScrollTop.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
try {
|
||||
int curr = viewPager.getCurrentItem();
|
||||
((SquareDynamicFragment)fragmentList.get(curr)).scrollToTop();
|
||||
if (getParentFragment() instanceof FindTabFragment) {
|
||||
((FindTabFragment) getParentFragment()).scrollToTop();
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@@ -76,7 +76,7 @@ public class FamilyModel extends BaseModel implements IFamilyModel {
|
||||
|
||||
private FamilyModel(){
|
||||
EventBus.getDefault().register(this);
|
||||
registerFamilyEvent();
|
||||
// registerFamilyEvent();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,10 +119,10 @@ public class FamilyModel extends BaseModel implements IFamilyModel {
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onLoginEvent(LoginEvent event) {
|
||||
Logger.i("FamilyModel", "用户登录成功后....");
|
||||
syncMyFamilyFromServer().subscribe();
|
||||
// syncMyFamilyFromServer().subscribe();
|
||||
|
||||
if (null == getCustomServiceInfo()){
|
||||
loadFamilyCustomServiceInfo().subscribe();
|
||||
// loadFamilyCustomServiceInfo().subscribe();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ public class FamilyModel extends BaseModel implements IFamilyModel {
|
||||
RxBusHelper.doOnMainThread(FamilyMineEvent.class, mCompositeDisposable, new Consumer<FamilyMineEvent>() {
|
||||
@Override
|
||||
public void accept(FamilyMineEvent familyMineEvent) throws Exception {
|
||||
syncMyFamilyFromServer().subscribe();
|
||||
// syncMyFamilyFromServer().subscribe();
|
||||
//家族币交易 发送家族币更新事件,刷新家族币界面
|
||||
if (familyMineEvent.getType() == FamilyMineEvent.FAMILY_CURRENCY_TRADE
|
||||
|| familyMineEvent.getType() == FamilyMineEvent.FAMILY_CURRENCY_DONATE
|
||||
|
Reference in New Issue
Block a user