Merge branch 'develop_home' into develop_new
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();
|
||||
}
|
||||
|
||||
private void openRoom() {
|
||||
@@ -368,19 +380,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
|
||||
@@ -495,7 +496,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);
|
||||
@@ -881,4 +882,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,11 +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);
|
||||
}
|
||||
}
|
||||
@@ -158,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -82,13 +82,13 @@ public class LoginCodeActivity extends BaseLoginAct {
|
||||
onFindViews();
|
||||
initData();
|
||||
onSetListener();
|
||||
// getSmsCode();
|
||||
getSmsCode();
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private void initData() {
|
||||
mPhone = getIntent().getStringExtra("phone");
|
||||
tvDesc.setText(getString(R.string.str_send_code_success)+mPhone);
|
||||
|
||||
codeEt.setFocusable(true);
|
||||
codeEt.setFocusableInTouchMode(true);
|
||||
codeEt.requestFocus();
|
||||
@@ -157,55 +157,34 @@ public class LoginCodeActivity extends BaseLoginAct {
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
private void getSmsCode() {
|
||||
String deviceId = DeviceUuidFactory.getDeviceId(this);
|
||||
if (isSuperAdmin) {
|
||||
CodeModel.get()
|
||||
.sendCode(mPhone, CodeType.SUPER_ADMIN)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||
.subscribe(new SingleObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
startCountDownTimer();
|
||||
toast(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
toast(e.getMessage());
|
||||
Logger.e(TAG, "获取短信失败!");
|
||||
}
|
||||
});
|
||||
}else {
|
||||
AuthModel.get()
|
||||
.sendLoginCode(mPhone, deviceId)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||
.subscribe(new SingleObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
startCountDownTimer();
|
||||
toast(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
toast(e.getMessage());
|
||||
// finish();
|
||||
Logger.e(TAG, "获取短信失败!");
|
||||
}
|
||||
});
|
||||
if (mPhone.length() != 11){
|
||||
return;
|
||||
}
|
||||
String deviceId = DeviceUuidFactory.getDeviceId(this);
|
||||
AuthModel.get()
|
||||
.sendLoginCode(mPhone, deviceId)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||
.subscribe(new SingleObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
tvDesc.setText(getString(R.string.str_send_code_success)+mPhone);
|
||||
startCountDownTimer();
|
||||
toast(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
toast(e.getMessage());
|
||||
// finish();
|
||||
Logger.e(TAG, "获取短信失败!");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void login(){
|
||||
|
@@ -87,7 +87,7 @@ public class LoginPhoneActivity extends BaseActivity implements View.OnClickList
|
||||
}
|
||||
|
||||
private void checkInput() {
|
||||
if (!TextUtils.isEmpty(accountEt.getText().toString()) && accountEt.getText().toString().length() == 11) {
|
||||
if (!TextUtils.isEmpty(accountEt.getText().toString()) && accountEt.getText().toString().length() >= 7) {
|
||||
btnNext.setEnabled(true);
|
||||
} else {
|
||||
btnNext.setEnabled(false);
|
||||
|
@@ -53,13 +53,11 @@ import me.shihao.library.XRadioGroup;
|
||||
* @Date 2018/11/23
|
||||
*/
|
||||
public class AddUserInfoFragment extends BaseFragment
|
||||
implements View.OnClickListener, DatePickerDialog.OnDateSetListener,
|
||||
TimePickerDialog.OnTimeSetListener, ErbanTakePhotoActivity.TakePhotoCallBack {
|
||||
implements View.OnClickListener,
|
||||
TimePickerDialog.OnTimeSetListener {
|
||||
|
||||
private static final String TAG = "AddUserInfoFragment";
|
||||
private CircleImageView civAvatar;
|
||||
private TextInputEditText tvNick;
|
||||
private TextInputEditText tvGender;
|
||||
private Button okBtn;
|
||||
// private ImageView ivRandomAvatar;
|
||||
private ImageView tvRandomNick;
|
||||
@@ -85,9 +83,7 @@ public class AddUserInfoFragment extends BaseFragment
|
||||
@Override
|
||||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
civAvatar = view.findViewById(R.id.civ_avatar);
|
||||
tvNick = view.findViewById(R.id.tv_nick);
|
||||
tvGender = view.findViewById(R.id.tv_gender);
|
||||
okBtn = view.findViewById(R.id.ok_btn);
|
||||
tvRandomNick = view.findViewById(R.id.tv_random_nick);
|
||||
rgGender = view.findViewById(R.id.rg_gender);
|
||||
@@ -99,8 +95,6 @@ public class AddUserInfoFragment extends BaseFragment
|
||||
@Override
|
||||
public void initiate() {
|
||||
gender = -1;
|
||||
civAvatar.setOnClickListener(this);
|
||||
tvGender.setOnClickListener(this);
|
||||
okBtn.setOnClickListener(this);
|
||||
tvRandomNick.setOnClickListener(this);
|
||||
init();
|
||||
@@ -120,9 +114,6 @@ public class AddUserInfoFragment extends BaseFragment
|
||||
tvNick.setText(nick);
|
||||
}
|
||||
}
|
||||
if (!TextUtils.isEmpty(avatarUrlWX)) {
|
||||
ImageLoadUtils.loadAvatar(getContext(), avatarUrlWX, civAvatar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,23 +138,7 @@ public class AddUserInfoFragment extends BaseFragment
|
||||
toast("必须要选性别哦");
|
||||
return;
|
||||
}
|
||||
if (photoFile != null) {
|
||||
getDialogManager().showProgressDialog(getContext(), "正在上传请稍后...");
|
||||
FileModel.get()
|
||||
.uploadFile(photoFile.getAbsolutePath())
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe((url, throwable) -> {
|
||||
if (throwable != null) {
|
||||
onUploadFail();
|
||||
} else {
|
||||
onUpload(url);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
//用户如果自己拍照作为头像就上传,如果为空就代表没拍照,直接拿微信头像上传
|
||||
// avatarUrl = avatarUrlWX;
|
||||
if (avatarUrlWX != null) {
|
||||
avatarUrl = avatarUrlWX;
|
||||
}
|
||||
@@ -172,26 +147,7 @@ public class AddUserInfoFragment extends BaseFragment
|
||||
}
|
||||
commit();
|
||||
break;
|
||||
case R.id.civ_avatar:
|
||||
ButtonItem upItem = new ButtonItem("拍照上传", new ButtonItem.OnClickListener() {
|
||||
@Override
|
||||
public void onClick() {
|
||||
ErbanTakePhotoActivity.startToTakePhoto(getContext(), AddUserInfoFragment.this);
|
||||
}
|
||||
});
|
||||
|
||||
ButtonItem localItem = new ButtonItem("本地相册", new ButtonItem.OnClickListener() {
|
||||
@Override
|
||||
public void onClick() {
|
||||
ErbanTakePhotoActivity.startToSelectPhoto(getContext(), AddUserInfoFragment.this);
|
||||
|
||||
}
|
||||
});
|
||||
List<ButtonItem> buttonItemList = new ArrayList<>();
|
||||
buttonItemList.add(upItem);
|
||||
buttonItemList.add(localItem);
|
||||
getDialogManager().showCommonPopupDialog(buttonItemList, "取消", false);
|
||||
break;
|
||||
|
||||
case R.id.tv_random_nick:
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_INFORMATION_RANDOM_NAME,
|
||||
@@ -216,7 +172,6 @@ public class AddUserInfoFragment extends BaseFragment
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -281,22 +236,7 @@ public class AddUserInfoFragment extends BaseFragment
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDateSet(DatePickerDialog datePickerDialog, int year, int month, int day) {
|
||||
String monthstr;
|
||||
if ((month + 1) < 10) {
|
||||
monthstr = "0" + (month + 1);
|
||||
} else {
|
||||
monthstr = String.valueOf(month + 1);
|
||||
}
|
||||
String daystr;
|
||||
if (day < 10) {
|
||||
daystr = "0" + day;
|
||||
} else {
|
||||
daystr = String.valueOf(day);
|
||||
}
|
||||
// tvBirthday.setText(String.valueOf(year) + "-" + monthstr + "-" + daystr);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onTimeSet(RadialPickerLayout view, int hourOfDay, int minute) {
|
||||
@@ -304,37 +244,4 @@ public class AddUserInfoFragment extends BaseFragment
|
||||
}
|
||||
|
||||
|
||||
public void onUpload(String url) {
|
||||
Log.d(TAG, "onUpload: 这是添加用户更改上传");
|
||||
avatarUrl = url;
|
||||
getDialogManager().dismissDialog();
|
||||
ImageLoadUtils.loadAvatar(getContext(), url, civAvatar);
|
||||
commit();
|
||||
}
|
||||
|
||||
public void onUploadFail() {
|
||||
toast("上传失败");
|
||||
getDialogManager().dismissDialog();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void takeSuccess(TResult result) {
|
||||
photoFile = new File(result.getImage().getCompressPath());
|
||||
if (getContext() != null) {
|
||||
ImageLoadUtils.loadImage(getContext(), photoFile, civAvatar, R.drawable.tutu_default_avatar_purple);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void takeFail(TResult result, String msg) {
|
||||
toast(msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void takeCancel() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -87,8 +87,6 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
private int TAB_SIZE = 1;
|
||||
private int TAB_DYNAMIC = 0;
|
||||
|
||||
|
||||
|
||||
public interface IdentityState {
|
||||
int NON = 0; // 无法识别
|
||||
int OWN = 1; // 自己
|
||||
|
@@ -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);
|
||||
|
||||
}
|
||||
|
@@ -79,7 +79,6 @@ public class UserInfoDynamicAdapter extends BaseQuickAdapter<WorldDynamicBean, B
|
||||
public UserInfoDynamicAdapter(Context context) {
|
||||
super(R.layout.item_userinfo_dynamic);
|
||||
this.context = context;
|
||||
this.worldId = worldId;
|
||||
iconWidth = UIUtil.dip2px(context, 32);
|
||||
iconHeight = UIUtil.dip2px(context, 15);
|
||||
imageTmHasText = UIUtil.dip2px(context, 15f);
|
||||
@@ -93,8 +92,6 @@ public class UserInfoDynamicAdapter extends BaseQuickAdapter<WorldDynamicBean, B
|
||||
protected void convert(BaseViewHolder helper, WorldDynamicBean item) {
|
||||
//这个值,有没有文本UI部分,改变图片部分的margin
|
||||
boolean noTextUi = TextUtils.isEmpty(item.getContent());
|
||||
|
||||
helper.setText(R.id.tv_nick, item.getNick());
|
||||
RecyclerView rvImage = helper.getView(R.id.rv_image);
|
||||
List<DynamicMedia> dynamicMediaList = item.getDynamicResList();
|
||||
if (item.getType() == WorldDynamicBean.TYPE_IMAGE
|
||||
@@ -104,24 +101,6 @@ public class UserInfoDynamicAdapter extends BaseQuickAdapter<WorldDynamicBean, B
|
||||
} else {
|
||||
rvImage.setVisibility(View.GONE);
|
||||
}
|
||||
//头饰 贵族头饰
|
||||
ImageView ivHeadWear = helper.getView(R.id.iv_head_wear);
|
||||
GlideApp.with(ivHeadWear.getContext()).clear(ivHeadWear);
|
||||
String headwearPic = item.getHeadwearPic();
|
||||
String micDecorate = item.getMicDecorate();
|
||||
if (!TextUtils.isEmpty(headwearPic)) {
|
||||
NobleUtil.loadHeadWear(headwearPic, ivHeadWear);
|
||||
} else if (!TextUtils.isEmpty(micDecorate)){
|
||||
NobleUtil.loadResource(micDecorate, ivHeadWear);
|
||||
} else {
|
||||
ivHeadWear.setImageDrawable(null);
|
||||
}
|
||||
|
||||
//头像
|
||||
ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_avatar), item.getAvatar());
|
||||
|
||||
DynamicNickDetailWidget widget = helper.getView(R.id.widget_nick_detail);
|
||||
widget.setData(item);
|
||||
|
||||
//时间
|
||||
helper.setText(R.id.tv_time, TimeUiUtils.getDynamicUi(item.getPublishTime()));
|
||||
@@ -203,10 +182,6 @@ public class UserInfoDynamicAdapter extends BaseQuickAdapter<WorldDynamicBean, B
|
||||
helper.addOnClickListener(R.id.iv_more)
|
||||
.addOnClickListener(R.id.ll_share);
|
||||
|
||||
View.OnClickListener userInfoActClick = v -> UIHelper.showUserInfoAct(context, item.getUid());
|
||||
helper.getView(R.id.iv_avatar).setOnClickListener(userInfoActClick);
|
||||
helper.getView(R.id.widget_nick_detail).setOnClickListener(userInfoActClick);
|
||||
|
||||
}
|
||||
|
||||
private void setLikeCount(BaseViewHolder helper, int likeCount, boolean isLike, boolean isAnim) {
|
||||
|
@@ -252,7 +252,6 @@
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textColor="@color/color_333333"
|
||||
android:drawableEnd="@drawable/arrow_right_2"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
@@ -8,88 +8,32 @@
|
||||
android:background="@drawable/bg_login"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/civ_avatar"
|
||||
android:layout_width="87dp"
|
||||
android:layout_height="87dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="80dp"
|
||||
android:src="@drawable/tutu_default_avatar_purple"
|
||||
app:cborder_color="@color/transparent"
|
||||
app:cborder_width="0dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_nick"
|
||||
android:layout_width="match_parent"
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="@dimen/login_btn_padding"
|
||||
android:layout_marginEnd="@dimen/login_btn_padding"
|
||||
android:paddingStart="@dimen/dp_10"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:paddingEnd="0dp"
|
||||
android:background="@drawable/shape_trans_radius_10"
|
||||
android:textSize="@dimen/dp_18"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/civ_avatar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:gravity="center"
|
||||
>
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_100"
|
||||
android:text="@string/add_info"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/tv_nick"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingTop="@dimen/dp_15"
|
||||
android:paddingBottom="@dimen/dp_15"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_14"
|
||||
android:lines="1"
|
||||
android:background="@null"
|
||||
android:maxLength="8"
|
||||
android:singleLine="true"
|
||||
android:text="@string/text_default_nick"
|
||||
tools:ignore="SpUsage" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tv_random_nick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:visibility="visible"
|
||||
android:visibility="gone"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:src="@mipmap/ic_random_nick"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/tv_gender"
|
||||
android:layout_width="match_parent"
|
||||
<TextView
|
||||
android:id="@+id/tv_detail"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="26dp"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginEnd="26dp"
|
||||
android:gravity="start|center_vertical"
|
||||
android:paddingBottom="15dp"
|
||||
android:textColor="@color/color_1A1A1A"
|
||||
android:textColorHint="@color/color_C7C7C7"
|
||||
android:textSize="@dimen/dp_14"
|
||||
android:theme="@style/common_edittext_style"
|
||||
android:lines="1"
|
||||
android:visibility="gone"
|
||||
android:singleLine="true"
|
||||
android:hint="请选择性别(选择后不可更改)"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:drawableEnd="@drawable/arrow_right"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:textSize="@dimen/dp_13"
|
||||
android:textColor="#BBB1FF"
|
||||
android:layout_marginTop="@dimen/dp_13"
|
||||
android:text="@string/gender_cannot_modify"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ll_nick"
|
||||
tools:ignore="SpUsage" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title"
|
||||
/>
|
||||
|
||||
<me.shihao.library.XRadioGroup
|
||||
android:id="@+id/rg_gender"
|
||||
@@ -101,7 +45,7 @@
|
||||
android:layout_marginEnd="@dimen/login_btn_padding"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ll_nick"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_detail"
|
||||
tools:ignore="SpUsage"
|
||||
>
|
||||
|
||||
@@ -139,72 +83,94 @@
|
||||
</me.shihao.library.XRadioGroup>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_nick_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="昵称"
|
||||
android:textSize="@dimen/dp_15"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_nick"
|
||||
android:layout_marginStart="75dp"
|
||||
/>
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/tv_nick"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:paddingEnd="@dimen/dp_9"
|
||||
android:paddingStart="@dimen/dp_9"
|
||||
android:paddingTop="@dimen/dp_15"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_14"
|
||||
android:lines="1"
|
||||
android:maxLength="8"
|
||||
android:singleLine="true"
|
||||
android:background="@null"
|
||||
android:text="@string/text_default_nick"
|
||||
app:layout_constraintTop_toBottomOf="@id/rg_gender"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_nick_title"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_random_nick"
|
||||
android:layout_marginTop="80dp"
|
||||
tools:ignore="SpUsage" />
|
||||
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tv_random_nick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:visibility="visible"
|
||||
android:visibility="gone"
|
||||
android:src="@mipmap/ic_random_nick"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_nick"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginEnd="75dp"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#30F4F4F4"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_nick_title"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:layout_marginStart="75dp"
|
||||
android:layout_marginEnd="75dp"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/ok_btn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="@dimen/common_item_view_height"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:layout_marginStart="@dimen/login_btn_padding"
|
||||
android:layout_marginEnd="@dimen/login_btn_padding"
|
||||
android:background="@drawable/shape_trans_radius_20"
|
||||
android:background="@drawable/shape_white_radius_22"
|
||||
android:text="@string/done"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/appColor"
|
||||
android:textSize="@dimen/sp_15"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rg_gender"
|
||||
app:layout_constraintTop_toBottomOf="@+id/view"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:ignore="SpUsage" />
|
||||
|
||||
<!--<TextView-->
|
||||
<!--android:id="@+id/tv_gender_men"-->
|
||||
<!--android:layout_width="125dp"-->
|
||||
<!--android:layout_height="43dp"-->
|
||||
<!--android:layout_marginTop="@dimen/dp_20"-->
|
||||
<!--android:layout_marginEnd="@dimen/dp_15"-->
|
||||
<!--android:background="@drawable/selector_gender_select_men"-->
|
||||
<!--android:drawableStart="@drawable/selector_gender_select_men_padding_drawable"-->
|
||||
<!--android:drawablePadding="@dimen/dp_3"-->
|
||||
<!--android:gravity="center"-->
|
||||
<!--android:paddingStart="@dimen/dp_40"-->
|
||||
<!--android:paddingEnd="@dimen/dp_40"-->
|
||||
<!--android:text="@string/text_gender_men"-->
|
||||
<!--android:textColor="@color/gender_select_text_color"-->
|
||||
<!--android:textSize="@dimen/dp_14"-->
|
||||
<!--app:layout_constraintStart_toStartOf="@+id/tv_birthday"-->
|
||||
<!--app:layout_constraintTop_toBottomOf="@+id/tv_birthday"-->
|
||||
<!--tools:ignore="SpUsage" />-->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/add_user_info_desc"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:textColor="#BBB1FF"
|
||||
android:layout_marginBottom="15dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:textSize="@dimen/dp_11"
|
||||
/>
|
||||
|
||||
<!--<TextView-->
|
||||
<!--android:id="@+id/tv_gender_women"-->
|
||||
<!--android:layout_width="125dp"-->
|
||||
<!--android:layout_height="43dp"-->
|
||||
<!--android:layout_marginStart="@dimen/dp_15"-->
|
||||
<!--android:layout_marginTop="@dimen/dp_20"-->
|
||||
<!--android:background="@drawable/selector_gender_select_women"-->
|
||||
<!--android:drawableStart="@drawable/selector_gender_select_women_padding_drawable"-->
|
||||
<!--android:drawablePadding="@dimen/dp_3"-->
|
||||
<!--android:gravity="center"-->
|
||||
<!--android:paddingStart="@dimen/dp_40"-->
|
||||
<!--android:paddingEnd="@dimen/dp_40"-->
|
||||
<!--android:text="@string/text_gender_women"-->
|
||||
<!--android:textColor="@color/gender_select_text_color"-->
|
||||
<!--android:textSize="@dimen/dp_14"-->
|
||||
<!--app:layout_constraintEnd_toEndOf="@+id/tv_birthday"-->
|
||||
<!--app:layout_constraintTop_toBottomOf="@+id/tv_birthday"-->
|
||||
<!--tools:ignore="SpUsage" />-->
|
||||
|
||||
<!--<TextView-->
|
||||
<!--android:id="@+id/tv_tips"-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:layout_marginTop="@dimen/dp_13"-->
|
||||
<!--android:text="性别选择后不可更改"-->
|
||||
<!--android:textColor="@color/color_999999"-->
|
||||
<!--android:textSize="@dimen/dp_12"-->
|
||||
<!--android:visibility="gone"-->
|
||||
<!--app:layout_constraintEnd_toEndOf="@+id/tv_gender_women"-->
|
||||
<!--app:layout_constraintStart_toStartOf="@+id/tv_gender_men"-->
|
||||
<!--app:layout_constraintTop_toBottomOf="@+id/tv_gender_men"-->
|
||||
<!--tools:ignore="SpUsage" />-->
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -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" />
|
||||
|
@@ -883,5 +883,8 @@
|
||||
|
||||
<string name="search_room_tab">房间</string>
|
||||
<string name="search_user_tab">用户</string>
|
||||
<string name="add_info">完善资料</string>
|
||||
<string name="gender_cannot_modify">性别后期无法进行修改</string>
|
||||
<string name="add_user_info_desc">本软件只提供给18岁或以上用户使用</string>
|
||||
|
||||
</resources>
|
||||
|
@@ -509,8 +509,8 @@
|
||||
|
||||
|
||||
<style name="common_edittext_style" parent="Theme.AppCompat.Light">
|
||||
<item name="colorControlNormal">@color/color_b3b3b3</item>
|
||||
<item name="colorControlActivated">@color/color_333333</item>
|
||||
<item name="colorControlNormal">#30F4F4F4</item>
|
||||
<item name="colorControlActivated">#30F4F4F4</item>
|
||||
</style>
|
||||
|
||||
<style name="common_login_edit_style" parent="Theme.AppCompat.Light">
|
||||
|
@@ -270,32 +270,7 @@ public class PublishActivity extends BaseMvpActivity<IPublishView, PublishPresen
|
||||
public void onViewClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.tv_publish:
|
||||
// long worldId = getMvpPresenter().getWorldId();
|
||||
// if (worldId > 0) { // 发布到小世界
|
||||
//
|
||||
// if (getMvpPresenter().isInWorld()) {
|
||||
// publish();
|
||||
// } else {
|
||||
// getDialogManager().showOkCancelDialog("提示", "加入小世界就可以发布啦~", "加入并发布",
|
||||
// "我再想想", new DialogManager.OkCancelDialogListener() {
|
||||
// @Override
|
||||
// public void onOk() {
|
||||
// StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_SQUARE_JOIN_WORLD,
|
||||
// "发布动态点击发布时弹窗-加入并发布");
|
||||
// publish(); // 发布接口有自动加入小世界功能
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onCancel() {
|
||||
// StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_SQUARE_JOIN_WORLD,
|
||||
// "发布动态点击发布时弹窗-我再想想");
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// } else {// 发布到动态广场
|
||||
publish();
|
||||
// }
|
||||
publish();
|
||||
break;
|
||||
|
||||
case R.id.iv_close:
|
||||
@@ -316,6 +291,7 @@ public class PublishActivity extends BaseMvpActivity<IPublishView, PublishPresen
|
||||
}
|
||||
|
||||
private void publish() {
|
||||
tvPublish.setEnabled(false);
|
||||
getDialogManager().showProgressDialog(context);
|
||||
getMvpPresenter().publishDy(
|
||||
ObjectTypeHelper.customToStringList(uploadList),
|
||||
@@ -387,6 +363,7 @@ public class PublishActivity extends BaseMvpActivity<IPublishView, PublishPresen
|
||||
|
||||
hideIME(etContent);
|
||||
getDialogManager().dismissDialog();
|
||||
tvPublish.setEnabled(true);
|
||||
getDialogManager().showCustomViewDialog(R.layout.dialog_dy_publish_success);
|
||||
getDialogManager().getDialog().setCanceledOnTouchOutside(true);
|
||||
getDialogManager().getDialog().setOnDismissListener(dialog -> finish());
|
||||
|
@@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@@ -4,57 +4,21 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_user_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="59dp"
|
||||
android:layout_marginTop="@dimen/dp_13"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_avatar"
|
||||
android:layout_width="@dimen/dp_45"
|
||||
android:layout_height="@dimen/dp_45"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_head_wear"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_head_wear"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_head_wear"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_head_wear" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_head_wear"
|
||||
android:layout_width="59dp"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<com.yizhuan.erban.community.widget.DynamicNickDetailWidget
|
||||
android:id="@+id/widget_nick_detail"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_head_wear"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_7"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="@dimen/dp_12"
|
||||
app:layout_constraintBottom_toBottomOf="@id/widget_nick_detail"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:text="刚刚" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:textColor="@color/color_999999"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:textSize="@dimen/dp_11"
|
||||
tools:text="刚刚" />
|
||||
|
||||
<com.yizhuan.erban.community.widget.ExpandableTextView
|
||||
android:id="@+id/etv_content"
|
||||
@@ -69,7 +33,7 @@
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
app:expandToggleOnTextClick="false"
|
||||
app:expandToggleType="TextView"
|
||||
app:layout_constraintTop_toBottomOf="@id/cl_user_info"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_time"
|
||||
app:maxCollapsedLines="6">
|
||||
|
||||
<com.netease.nim.uikit.business.session.widget.NimEmojiTextView
|
||||
@@ -109,7 +73,7 @@
|
||||
android:id="@+id/rv_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
/>
|
||||
</FrameLayout>
|
||||
|
||||
|
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#ffffff" />
|
||||
<corners android:radius="22dp" />
|
||||
</shape>
|
@@ -10,7 +10,7 @@
|
||||
android:id="@+id/iv_logo_quick_pass"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="108dp"
|
||||
android:src="@drawable/ic_quick_pass_logo"
|
||||
android:src="@drawable/splash_logo"
|
||||
android:layout_marginTop="60dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@@ -217,7 +217,7 @@ public class AuthModel extends BaseModel implements IAuthModel {
|
||||
@Override
|
||||
public Single<String> autoLogin() {
|
||||
if (currentAccountInfo == null || TextUtils.isEmpty(currentAccountInfo.getAccess_token())) {
|
||||
return Single.error(new Throwable("没有账号信息"));
|
||||
return Single.error(new Throwable(""));//没有账号信息
|
||||
}
|
||||
return requestTicket().flatMap(new Function<TicketResult, SingleSource<? extends String>>() {
|
||||
@Override
|
||||
|
@@ -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