删除搜索页面无用代码
This commit is contained in:
@@ -841,10 +841,6 @@
|
|||||||
android:configChanges="keyboardHidden|orientation"
|
android:configChanges="keyboardHidden|orientation"
|
||||||
android:label="公聊大厅选择提醒的人"
|
android:label="公聊大厅选择提醒的人"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
|
||||||
android:name=".ui.user.decorationsend.DecorationSendActivity"
|
|
||||||
android:screenOrientation="portrait"
|
|
||||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".avroom.activity.RoomRankListActivity"
|
android:name=".avroom.activity.RoomRankListActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
|
@@ -21,15 +21,19 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
import androidx.viewpager.widget.ViewPager;
|
import androidx.viewpager.widget.ViewPager;
|
||||||
|
|
||||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||||
import com.netease.nim.uikit.StatusBarUtil;
|
import com.mango.core.auth.AuthModel;
|
||||||
import com.netease.nimlib.sdk.msg.model.IMMessage;
|
import com.mango.core.bean.RoomHistoryInfo;
|
||||||
|
import com.mango.core.community.im.DynamicImMsg;
|
||||||
|
import com.mango.core.relation.cp.CpBindUnbindEvent;
|
||||||
|
import com.mango.core.room.bean.SearchRoomInfo;
|
||||||
|
import com.mango.core.statistic.StatisticManager;
|
||||||
|
import com.mango.core.statistic.protocol.StatisticsProtocol;
|
||||||
|
import com.mango.core.utils.SharedPreferenceUtils;
|
||||||
import com.mango.moshen.R;
|
import com.mango.moshen.R;
|
||||||
import com.mango.moshen.avroom.activity.AVRoomActivity;
|
import com.mango.moshen.avroom.activity.AVRoomActivity;
|
||||||
import com.mango.moshen.base.BaseMvpActivity;
|
import com.mango.moshen.base.BaseMvpActivity;
|
||||||
import com.mango.moshen.common.ViewPagerAdapter;
|
import com.mango.moshen.common.ViewPagerAdapter;
|
||||||
import com.mango.moshen.common.widget.dialog.DialogManager;
|
import com.mango.moshen.common.widget.dialog.DialogManager;
|
||||||
import com.mango.moshen.decoration.helper.DecorationDialogHelper;
|
|
||||||
import com.mango.moshen.decoration.helper.DecorationSaleType;
|
|
||||||
import com.mango.moshen.friend.action.AbstractSelectFriendAction;
|
import com.mango.moshen.friend.action.AbstractSelectFriendAction;
|
||||||
import com.mango.moshen.friend.view.SelectFriendActivity;
|
import com.mango.moshen.friend.view.SelectFriendActivity;
|
||||||
import com.mango.moshen.home.adapter.ContactsIndicatorAdapter;
|
import com.mango.moshen.home.adapter.ContactsIndicatorAdapter;
|
||||||
@@ -39,35 +43,20 @@ import com.mango.moshen.ui.widget.magicindicator.MagicIndicator;
|
|||||||
import com.mango.moshen.ui.widget.magicindicator.ViewPagerHelper;
|
import com.mango.moshen.ui.widget.magicindicator.ViewPagerHelper;
|
||||||
import com.mango.moshen.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
import com.mango.moshen.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||||
import com.mango.moshen.ui.widget.recyclerview.decoration.VerticalDecoration;
|
import com.mango.moshen.ui.widget.recyclerview.decoration.VerticalDecoration;
|
||||||
import com.mango.core.auth.AuthModel;
|
|
||||||
import com.mango.core.bean.RoomHistoryInfo;
|
|
||||||
import com.mango.core.community.dynamic.DynamicModel;
|
|
||||||
import com.mango.core.community.im.DynamicImMsg;
|
|
||||||
import com.mango.core.community.im.WorldDynamicAttachment;
|
|
||||||
import com.mango.core.decoration.car.bean.CarInfo;
|
|
||||||
import com.mango.core.decoration.headwear.bean.HeadWearInfo;
|
|
||||||
import com.mango.core.manager.IMNetEaseManager;
|
|
||||||
import com.mango.core.relation.cp.CpBindUnbindEvent;
|
|
||||||
import com.mango.core.room.bean.SearchRoomInfo;
|
|
||||||
import com.mango.core.statistic.StatisticManager;
|
|
||||||
import com.mango.core.statistic.protocol.StatisticsProtocol;
|
|
||||||
import com.mango.core.utils.SharedPreferenceUtils;
|
|
||||||
import com.mango.core.utils.net.DontWarnObserver;
|
|
||||||
import com.mango.xchat_android_library.base.factory.CreatePresenter;
|
import com.mango.xchat_android_library.base.factory.CreatePresenter;
|
||||||
import com.mango.xchat_android_library.utils.ImeUtil;
|
import com.mango.xchat_android_library.utils.ImeUtil;
|
||||||
import com.mango.xchat_android_library.utils.JavaUtil;
|
|
||||||
import com.mango.xchat_android_library.utils.SingleToastUtil;
|
import com.mango.xchat_android_library.utils.SingleToastUtil;
|
||||||
import com.mango.xchat_android_library.utils.SizeUtils;
|
import com.mango.xchat_android_library.utils.SizeUtils;
|
||||||
|
import com.netease.nim.uikit.StatusBarUtil;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
import org.greenrobot.eventbus.ThreadMode;
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 搜索界面
|
* 搜索界面
|
||||||
*
|
*
|
||||||
@@ -79,9 +68,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
|
|||||||
@CreatePresenter(SearchPresenter.class)
|
@CreatePresenter(SearchPresenter.class)
|
||||||
public class SearchActivity extends BaseMvpActivity<ISearchView, SearchPresenter> implements ISearchView, View.OnClickListener, ContactsIndicatorAdapter.OnItemSelectListener {
|
public class SearchActivity extends BaseMvpActivity<ISearchView, SearchPresenter> implements ISearchView, View.OnClickListener, ContactsIndicatorAdapter.OnItemSelectListener {
|
||||||
public static final int CODE_REQUEST_TO_SEARCH = 200;
|
public static final int CODE_REQUEST_TO_SEARCH = 200;
|
||||||
private static final String MARK = "isCar";
|
|
||||||
private static final String CAR_INFO = "carInfo";
|
|
||||||
private static final String WEAR_INFO = "wearInfo";
|
|
||||||
private static final String SHOW_HISTORY = "show_history";
|
private static final String SHOW_HISTORY = "show_history";
|
||||||
protected EditText searchEdit;
|
protected EditText searchEdit;
|
||||||
protected int type = AbstractSelectFriendAction.TYPE_NORMAL;
|
protected int type = AbstractSelectFriendAction.TYPE_NORMAL;
|
||||||
@@ -97,9 +83,6 @@ public class SearchActivity extends BaseMvpActivity<ISearchView, SearchPresenter
|
|||||||
private MagicIndicator indicator;
|
private MagicIndicator indicator;
|
||||||
private ViewPager viewPager;
|
private ViewPager viewPager;
|
||||||
private LinearLayout llSearchDetail;
|
private LinearLayout llSearchDetail;
|
||||||
private CarInfo carInfo;
|
|
||||||
private HeadWearInfo wearInfo;
|
|
||||||
private int secondOperator = -1;
|
|
||||||
private boolean mShowHistory = false;
|
private boolean mShowHistory = false;
|
||||||
|
|
||||||
private SearchHistoryAdapter mSearchHistoryAdapter;
|
private SearchHistoryAdapter mSearchHistoryAdapter;
|
||||||
@@ -129,19 +112,6 @@ public class SearchActivity extends BaseMvpActivity<ISearchView, SearchPresenter
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static void start(Context context, CarInfo carInfo) {
|
|
||||||
Intent intent = new Intent(context, SearchActivity.class);
|
|
||||||
intent.putExtra(AbstractSelectFriendAction.KEY_TYPE, AbstractSelectFriendAction.TYPE_CAR);
|
|
||||||
intent.putExtra(CAR_INFO, carInfo);
|
|
||||||
context.startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void start(Context context, HeadWearInfo wearInfo) {
|
|
||||||
Intent intent = new Intent(context, SearchActivity.class);
|
|
||||||
intent.putExtra(AbstractSelectFriendAction.KEY_TYPE, AbstractSelectFriendAction.TYPE_WEAR);
|
|
||||||
intent.putExtra(WEAR_INFO, wearInfo);
|
|
||||||
context.startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void start(Context context) {
|
public static void start(Context context) {
|
||||||
start(context, AbstractSelectFriendAction.TYPE_NORMAL);
|
start(context, AbstractSelectFriendAction.TYPE_NORMAL);
|
||||||
@@ -184,15 +154,8 @@ public class SearchActivity extends BaseMvpActivity<ISearchView, SearchPresenter
|
|||||||
viewPager = findViewById(R.id.viewpager);
|
viewPager = findViewById(R.id.viewpager);
|
||||||
|
|
||||||
type = getIntent().getIntExtra(AbstractSelectFriendAction.KEY_TYPE, AbstractSelectFriendAction.TYPE_NORMAL);
|
type = getIntent().getIntExtra(AbstractSelectFriendAction.KEY_TYPE, AbstractSelectFriendAction.TYPE_NORMAL);
|
||||||
secondOperator = getIntent().getIntExtra(SelectFriendActivity.KEY_SECOND_OPERATOR, -1);
|
|
||||||
switch (type) {
|
|
||||||
case AbstractSelectFriendAction.TYPE_CAR:
|
|
||||||
carInfo = (CarInfo) getIntent().getSerializableExtra(CAR_INFO);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case AbstractSelectFriendAction.TYPE_WEAR:
|
switch (type) {
|
||||||
wearInfo = (HeadWearInfo) getIntent().getSerializableExtra(WEAR_INFO);
|
|
||||||
break;
|
|
||||||
case AbstractSelectFriendAction.TYPE_CP:
|
case AbstractSelectFriendAction.TYPE_CP:
|
||||||
case AbstractSelectFriendAction.TYPE_SEND_DECORATION:
|
case AbstractSelectFriendAction.TYPE_SEND_DECORATION:
|
||||||
indicator.setVisibility(View.GONE);
|
indicator.setVisibility(View.GONE);
|
||||||
@@ -213,16 +176,14 @@ public class SearchActivity extends BaseMvpActivity<ISearchView, SearchPresenter
|
|||||||
searchEdit = findViewById(R.id.search_edit);
|
searchEdit = findViewById(R.id.search_edit);
|
||||||
searchEdit.addTextChangedListener(textWatcher);
|
searchEdit.addTextChangedListener(textWatcher);
|
||||||
searchEdit.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
|
searchEdit.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
|
||||||
searchEdit.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
searchEdit.setOnEditorActionListener((v, actionId, event) -> {
|
||||||
@Override
|
if (actionId == EditorInfo.IME_ACTION_SEARCH ||
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
(event != null && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || (event != null && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
toSearch();
|
||||||
toSearch();
|
return true;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -251,14 +212,13 @@ public class SearchActivity extends BaseMvpActivity<ISearchView, SearchPresenter
|
|||||||
private void initSearchDetail() {
|
private void initSearchDetail() {
|
||||||
|
|
||||||
List<Fragment> mTabs = new ArrayList<>();
|
List<Fragment> mTabs = new ArrayList<>();
|
||||||
//CP
|
|
||||||
if (type == AbstractSelectFriendAction.TYPE_CP || type == AbstractSelectFriendAction.TYPE_SEND_DECORATION) {
|
if (type == AbstractSelectFriendAction.TYPE_CP || type == AbstractSelectFriendAction.TYPE_SEND_DECORATION) {
|
||||||
userFrg = SearchDetailFragment.newInstance(SearchDetailFragment.TYPE_SEARCH_USER, type);
|
userFrg = SearchDetailFragment.newInstance(SearchDetailFragment.TYPE_SEARCH_USER, type);
|
||||||
mTabs.add(userFrg);
|
mTabs.add(userFrg);
|
||||||
viewPager.setAdapter(new ViewPagerAdapter(getSupportFragmentManager(), mTabs, null));
|
viewPager.setAdapter(new ViewPagerAdapter(getSupportFragmentManager(), mTabs, null));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// llSearchDetail.setVisibility(View.GONE);
|
|
||||||
List<String> mTabInfoList = new ArrayList<>();
|
List<String> mTabInfoList = new ArrayList<>();
|
||||||
mTabInfoList.add(getString(R.string.search_room_tab));
|
mTabInfoList.add(getString(R.string.search_room_tab));
|
||||||
mTabInfoList.add(getString(R.string.search_user_tab));
|
mTabInfoList.add(getString(R.string.search_user_tab));
|
||||||
@@ -307,20 +267,17 @@ public class SearchActivity extends BaseMvpActivity<ISearchView, SearchPresenter
|
|||||||
mSearchHistoryAdapter = new SearchHistoryAdapter(mSearchHistoryList);
|
mSearchHistoryAdapter = new SearchHistoryAdapter(mSearchHistoryList);
|
||||||
rvSearchHistory.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
|
rvSearchHistory.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
|
||||||
rvSearchHistory.addItemDecoration(new VerticalDecoration(SizeUtils.dp2px(this, 10), false, true));
|
rvSearchHistory.addItemDecoration(new VerticalDecoration(SizeUtils.dp2px(this, 10), false, true));
|
||||||
mSearchHistoryAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
|
mSearchHistoryAdapter.setOnItemChildClickListener((adapter, view, position) -> {
|
||||||
@Override
|
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_SEARCH_RECENT_SEARCH, "最近搜索记录");
|
||||||
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
|
||||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_SEARCH_RECENT_SEARCH, "最近搜索记录");
|
|
||||||
|
|
||||||
List<String> list = adapter.getData();
|
List<String> list = adapter.getData();
|
||||||
if (position >= 0 && position < list.size()) {
|
if (position >= 0 && position < list.size()) {
|
||||||
String record = list.get(position);
|
String record = list.get(position);
|
||||||
searchEdit.setText(record);
|
searchEdit.setText(record);
|
||||||
|
|
||||||
toSearch();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
toSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
rvSearchHistory.setAdapter(mSearchHistoryAdapter);
|
rvSearchHistory.setAdapter(mSearchHistoryAdapter);
|
||||||
|
|
||||||
@@ -333,9 +290,7 @@ public class SearchActivity extends BaseMvpActivity<ISearchView, SearchPresenter
|
|||||||
clSearchHistoryContainer.setVisibility(View.VISIBLE);
|
clSearchHistoryContainer.setVisibility(View.VISIBLE);
|
||||||
String[] split = strSearchHistory.split(",");
|
String[] split = strSearchHistory.split(",");
|
||||||
|
|
||||||
for (String sub : split) {
|
mSearchHistoryList.addAll(Arrays.asList(split));
|
||||||
mSearchHistoryList.add(sub);
|
|
||||||
}
|
|
||||||
|
|
||||||
mSearchHistoryAdapter.notifyDataSetChanged();
|
mSearchHistoryAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
@@ -498,92 +453,6 @@ public class SearchActivity extends BaseMvpActivity<ISearchView, SearchPresenter
|
|||||||
SharedPreferenceUtils.put(SharedPreferenceUtils.SEARCH_HISTORY + AuthModel.get().getCurrentUid(), "");
|
SharedPreferenceUtils.put(SharedPreferenceUtils.SEARCH_HISTORY + AuthModel.get().getCurrentUid(), "");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showSureDialog(String targetId, String avatar, String nick) {
|
|
||||||
switch (type) {
|
|
||||||
case AbstractSelectFriendAction.TYPE_CAR:
|
|
||||||
if (carInfo == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
long targetUid = JavaUtil.str2long(targetId);
|
|
||||||
DecorationDialogHelper.Options options = new DecorationDialogHelper.Builder()
|
|
||||||
.setTargetUid(targetUid)
|
|
||||||
.setNick(nick)
|
|
||||||
.setType(DecorationSaleType.SEND_CAR)
|
|
||||||
.setDecoration(carInfo)
|
|
||||||
.create();
|
|
||||||
DecorationDialogHelper helper = new DecorationDialogHelper(context, getDialogManager(),
|
|
||||||
options);
|
|
||||||
helper.showBuyOrDonateDialog();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case AbstractSelectFriendAction.TYPE_WEAR:
|
|
||||||
if (wearInfo == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
targetUid = JavaUtil.str2long(targetId);
|
|
||||||
options = new DecorationDialogHelper.Builder()
|
|
||||||
.setTargetUid(targetUid)
|
|
||||||
.setNick(nick)
|
|
||||||
.setType(DecorationSaleType.SEND_HEAD_WEAR)
|
|
||||||
.setDecoration(wearInfo)
|
|
||||||
.create();
|
|
||||||
helper = new DecorationDialogHelper(context, getDialogManager(),
|
|
||||||
options);
|
|
||||||
helper.showBuyOrDonateDialog();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case AbstractSelectFriendAction.TYPE_SHARE:
|
|
||||||
String msg = "";
|
|
||||||
if (SelectFriendActivity.CODE_REQUEST_TO_SHARE_FAMILY == secondOperator) {
|
|
||||||
msg = getResources().getString(R.string.family_invite_friends_slogan);
|
|
||||||
}
|
|
||||||
getDialogManager().showInAppSharingConfirmDialog(avatar, nick, msg, new DialogManager.OkCancelDialogListener() {
|
|
||||||
@Override
|
|
||||||
public void onCancel() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onOk() {
|
|
||||||
Intent intent = new Intent();
|
|
||||||
intent.putExtra(SelectFriendActivity.EXTRA_TARGET_UID, targetId);
|
|
||||||
intent.putExtra(SelectFriendActivity.EXTRA_TARGET_NAME, nick);
|
|
||||||
setResult(Activity.RESULT_OK, intent);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case AbstractSelectFriendAction.TYPE_WORLD_DYNAMIC:
|
|
||||||
DynamicImMsg dynamicImMsg = (DynamicImMsg) getIntent().getSerializableExtra(
|
|
||||||
SelectFriendActivity.EXTRA_DYNAMIC_DATA);
|
|
||||||
if (dynamicImMsg == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
getDialogManager().showOkCancelDialog("确认分享给" + nick + "?", () -> {
|
|
||||||
//发出自定义消息
|
|
||||||
IMMessage message = WorldDynamicAttachment.createShareMsg(dynamicImMsg, targetId);
|
|
||||||
IMNetEaseManager.get().sendMessage(message)
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new DontWarnObserver<Boolean>() {
|
|
||||||
@Override
|
|
||||||
public void accept(Boolean aBoolean, String error) {
|
|
||||||
super.accept(aBoolean, error);
|
|
||||||
if (error != null) {
|
|
||||||
SingleToastUtil.showToast(error);
|
|
||||||
} else {
|
|
||||||
SingleToastUtil.showToast("分享成功");
|
|
||||||
DynamicModel.get().reportShare(dynamicImMsg.getPublishUid(),
|
|
||||||
dynamicImMsg.getWorldId(), dynamicImMsg.getDynamicId())
|
|
||||||
.subscribe();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
setResult(RESULT_OK);
|
|
||||||
finish();
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
@@ -604,7 +473,6 @@ public class SearchActivity extends BaseMvpActivity<ISearchView, SearchPresenter
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showHistory() {
|
private void showHistory() {
|
||||||
// hideStatus();
|
|
||||||
if (mShowHistory) {
|
if (mShowHistory) {
|
||||||
clearSearch();
|
clearSearch();
|
||||||
clSearchHistoryContainer.setVisibility(mSearchHistoryList != null && mSearchHistoryList.size() > 0 ?
|
clSearchHistoryContainer.setVisibility(mSearchHistoryList != null && mSearchHistoryList.size() > 0 ?
|
||||||
|
@@ -1,200 +0,0 @@
|
|||||||
package com.mango.moshen.ui.user.decorationsend;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
|
|
||||||
import com.mango.moshen.R;
|
|
||||||
import com.mango.moshen.base.BaseFragment;
|
|
||||||
import com.mango.core.Constants;
|
|
||||||
import com.mango.core.auth.AuthModel;
|
|
||||||
import com.mango.core.praise.event.PraiseEvent;
|
|
||||||
import com.mango.core.user.AttentionModel;
|
|
||||||
import com.mango.core.user.bean.AttentionInfo;
|
|
||||||
import com.mango.core.user.event.LoginUserInfoUpdateEvent;
|
|
||||||
import com.mango.xchat_android_library.utils.ListUtils;
|
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
|
||||||
import org.greenrobot.eventbus.ThreadMode;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import io.reactivex.SingleObserver;
|
|
||||||
import io.reactivex.disposables.Disposable;
|
|
||||||
import static com.mango.moshen.R.id.swipe_refresh;
|
|
||||||
|
|
||||||
public class DSAttentionFragment extends BaseFragment {
|
|
||||||
public static final String TAG = "AttentionFragment";
|
|
||||||
|
|
||||||
private RecyclerView mRecyclerView;
|
|
||||||
private SwipeRefreshLayout swipeRefreshLayout;
|
|
||||||
private DSAttentionListAdapter mAdapter;
|
|
||||||
private List<AttentionInfo> mAttentionInfoList = new ArrayList<>();
|
|
||||||
private int mPage = Constants.PAGE_START;
|
|
||||||
|
|
||||||
private DecorationSendActivity friendActivity;
|
|
||||||
|
|
||||||
public static DSAttentionFragment newInstance() {
|
|
||||||
return new DSAttentionFragment();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
EventBus.getDefault().register(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
EventBus.getDefault().unregister(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAttach(Activity activity) {
|
|
||||||
super.onAttach(activity);
|
|
||||||
|
|
||||||
if (activity instanceof DecorationSendActivity) {
|
|
||||||
friendActivity = (DecorationSendActivity) activity;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setUserVisibleHint(boolean isVisibleToUser) {
|
|
||||||
super.setUserVisibleHint(isVisibleToUser);
|
|
||||||
//需要踩人等东西,所以进入这个界面需要强制刷新
|
|
||||||
if (isVisibleToUser) {
|
|
||||||
firstLoadData();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFindViews() {
|
|
||||||
mRecyclerView = mView.findViewById(R.id.recycler_view);
|
|
||||||
swipeRefreshLayout = mView.findViewById(swipe_refresh);
|
|
||||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSetListener() {
|
|
||||||
swipeRefreshLayout.setOnRefreshListener(onRefreshListener);
|
|
||||||
mAdapter = new DSAttentionListAdapter(mAttentionInfoList);
|
|
||||||
mAdapter.setRylListener(attentionInfo -> {
|
|
||||||
if (friendActivity != null) {
|
|
||||||
friendActivity.showSureDialog(attentionInfo.getUid(), attentionInfo.getNick());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mAdapter.setOnLoadMoreListener(() -> {
|
|
||||||
mPage++;
|
|
||||||
onRefreshing();
|
|
||||||
}, mRecyclerView);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initiate() {
|
|
||||||
mRecyclerView.setAdapter(mAdapter);
|
|
||||||
showLoading();
|
|
||||||
onRefreshing();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getRootLayoutId() {
|
|
||||||
return R.layout.frg_decoration_send_list;
|
|
||||||
}
|
|
||||||
|
|
||||||
SwipeRefreshLayout.OnRefreshListener onRefreshListener = this::firstLoadData;
|
|
||||||
|
|
||||||
public void firstLoadData() {
|
|
||||||
mPage = Constants.PAGE_START;
|
|
||||||
onRefreshing();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onRefreshing() {
|
|
||||||
AttentionModel.get().getAttentionList(
|
|
||||||
AuthModel.get().getCurrentUid(),
|
|
||||||
mPage,
|
|
||||||
Constants.PAGE_SIZE
|
|
||||||
)
|
|
||||||
.subscribe(new SingleObserver<List<AttentionInfo>>() {
|
|
||||||
@Override
|
|
||||||
public void onSubscribe(Disposable d) {
|
|
||||||
mCompositeDisposable.add(d);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(List<AttentionInfo> attentionInfos) {
|
|
||||||
onGetAttentionList(attentionInfos, mPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Throwable e) {
|
|
||||||
onGetAttentionListFail(e.getMessage(), mPage);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onGetAttentionList(List<AttentionInfo> attentionInfoList, int page) {
|
|
||||||
mPage = page;
|
|
||||||
if (!ListUtils.isListEmpty(attentionInfoList)) {
|
|
||||||
if (mPage == Constants.PAGE_START) {
|
|
||||||
hideStatus();
|
|
||||||
swipeRefreshLayout.setRefreshing(false);
|
|
||||||
mAttentionInfoList.clear();
|
|
||||||
mAdapter.setNewData(attentionInfoList);
|
|
||||||
if (attentionInfoList.size() < Constants.PAGE_SIZE) {
|
|
||||||
mAdapter.setEnableLoadMore(false);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
mAdapter.loadMoreComplete();
|
|
||||||
mAdapter.addData(attentionInfoList);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (mPage == Constants.PAGE_START) {
|
|
||||||
swipeRefreshLayout.setRefreshing(false);
|
|
||||||
showNoData(getString(R.string.no_attention_text));
|
|
||||||
} else {
|
|
||||||
mAdapter.loadMoreEnd(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onGetAttentionListFail(String error, int page) {
|
|
||||||
mPage = page;
|
|
||||||
if (mPage == Constants.PAGE_START) {
|
|
||||||
swipeRefreshLayout.setRefreshing(false);
|
|
||||||
showNetworkErr();
|
|
||||||
} else {
|
|
||||||
mAdapter.loadMoreFail();
|
|
||||||
toast(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------关注动作回调 begin-------------------
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
||||||
public void onPraise(PraiseEvent event) {
|
|
||||||
if (event.isFailed()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
onRefreshing();
|
|
||||||
}
|
|
||||||
// ------------------关注动作回调 end-------------------
|
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
||||||
public void onLoginUserInfoUpdateEvent(LoginUserInfoUpdateEvent event) {
|
|
||||||
onRefreshing();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReloadData() {
|
|
||||||
super.onReloadData();
|
|
||||||
mPage = Constants.PAGE_START;
|
|
||||||
showLoading();
|
|
||||||
onRefreshing();
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,61 +0,0 @@
|
|||||||
package com.mango.moshen.ui.user.decorationsend;
|
|
||||||
|
|
||||||
import com.chad.library.adapter.base.BaseViewHolder;
|
|
||||||
import com.mango.core.level.UserLevelVo;
|
|
||||||
import com.mango.core.noble.NobleInfo;
|
|
||||||
import com.mango.core.user.bean.AttentionInfo;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class DSAttentionListAdapter extends DSBaseListAdapter<AttentionInfo, BaseViewHolder> {
|
|
||||||
|
|
||||||
public DSAttentionListAdapter(List<AttentionInfo> attentionInfoList) {
|
|
||||||
super(attentionInfoList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getNick(AttentionInfo info) {
|
|
||||||
return info.getNick();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getAvatar(AttentionInfo info) {
|
|
||||||
return info.getAvatar();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NobleInfo getNobleInfo(AttentionInfo info) {
|
|
||||||
return info.nobleUsers;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public UserLevelVo getUserLevelVo(AttentionInfo info) {
|
|
||||||
return info.userLevelVo;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGender(AttentionInfo info) {
|
|
||||||
return info.getGender();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getUserDesc(AttentionInfo info) {
|
|
||||||
return info.getUserDesc();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void listeners(AttentionInfo info) {
|
|
||||||
if (rylListener != null)
|
|
||||||
rylListener.sendListener(info);
|
|
||||||
}
|
|
||||||
|
|
||||||
private onClickListener rylListener;
|
|
||||||
|
|
||||||
public interface onClickListener {
|
|
||||||
void sendListener(AttentionInfo attentionInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRylListener(onClickListener onClickListener) {
|
|
||||||
rylListener = onClickListener;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,85 +0,0 @@
|
|||||||
package com.mango.moshen.ui.user.decorationsend;
|
|
||||||
|
|
||||||
import androidx.appcompat.widget.AppCompatImageView;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
|
||||||
import com.chad.library.adapter.base.BaseViewHolder;
|
|
||||||
import com.mango.moshen.R;
|
|
||||||
import com.mango.moshen.ui.utils.ImageLoadUtils;
|
|
||||||
import com.mango.moshen.ui.widget.NobleAvatarView;
|
|
||||||
import com.mango.core.level.UserLevelVo;
|
|
||||||
import com.mango.core.noble.NobleInfo;
|
|
||||||
import com.mango.core.noble.NobleUtil;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 好友,关注,粉丝展示ui一致
|
|
||||||
*/
|
|
||||||
public abstract class DSBaseListAdapter<T, K extends BaseViewHolder> extends BaseQuickAdapter<T, K> {
|
|
||||||
|
|
||||||
DSBaseListAdapter(List<T> list) {
|
|
||||||
super(R.layout.item_send, list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void convert(K helper, T item) {
|
|
||||||
if (item == null) return;
|
|
||||||
|
|
||||||
helper.setText(R.id.tv_userName, getNick(item));
|
|
||||||
helper.setOnClickListener(R.id.tv_send, v -> listeners(item));
|
|
||||||
|
|
||||||
NobleInfo nobleUsers = getNobleInfo(item);
|
|
||||||
|
|
||||||
NobleAvatarView nobleAvatarView = helper.getView(R.id.noble_avatar_view);
|
|
||||||
nobleAvatarView.setSize(50, 65, 15);
|
|
||||||
nobleAvatarView.setData(getAvatar(item), nobleUsers);
|
|
||||||
|
|
||||||
AppCompatImageView ivNobleLevel = helper.getView(R.id.iv_user_badge);
|
|
||||||
ivNobleLevel.setVisibility(View.GONE);
|
|
||||||
if (nobleUsers != null) {
|
|
||||||
String badgeByLevel = NobleUtil.getBadgeByLevel(nobleUsers.getLevel());
|
|
||||||
if (!TextUtils.isEmpty(badgeByLevel)) {
|
|
||||||
ivNobleLevel.setVisibility(View.VISIBLE);
|
|
||||||
NobleUtil.loadResource(badgeByLevel, ivNobleLevel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AppCompatImageView ivUserLevel = helper.getView(R.id.iv_user_level);
|
|
||||||
AppCompatImageView ivOtherLevel = helper.getView(R.id.iv_other_level);
|
|
||||||
ivUserLevel.setVisibility(View.GONE);
|
|
||||||
ivOtherLevel.setVisibility(View.GONE);
|
|
||||||
UserLevelVo userLevelVo = getUserLevelVo(item);
|
|
||||||
if (userLevelVo != null && !TextUtils.isEmpty(userLevelVo.getExperUrl())) {
|
|
||||||
ivUserLevel.setVisibility(View.VISIBLE);
|
|
||||||
ImageLoadUtils.loadImage(mContext, userLevelVo.getExperUrl(), ivUserLevel);
|
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(userLevelVo.getCharmUrl())) {
|
|
||||||
ivOtherLevel.setVisibility(View.VISIBLE);
|
|
||||||
ImageLoadUtils.loadImage(mContext, userLevelVo.getCharmUrl(), ivOtherLevel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AppCompatImageView gender = helper.getView(R.id.iv_gender);
|
|
||||||
if (getGender(item) == 2) {
|
|
||||||
gender.setImageResource(R.drawable.ic_gender_female);
|
|
||||||
} else {
|
|
||||||
gender.setImageResource(R.drawable.ic_gender_male);
|
|
||||||
}
|
|
||||||
|
|
||||||
TextView desc = helper.getView(R.id.tv_desc);
|
|
||||||
desc.setText(getUserDesc(item));
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract String getNick(T info);
|
|
||||||
public abstract String getAvatar(T info);
|
|
||||||
public abstract NobleInfo getNobleInfo(T info);
|
|
||||||
public abstract UserLevelVo getUserLevelVo(T info);
|
|
||||||
public abstract int getGender(T info);
|
|
||||||
public abstract String getUserDesc(T info);
|
|
||||||
public abstract void listeners(T info);
|
|
||||||
|
|
||||||
}
|
|
@@ -1,218 +0,0 @@
|
|||||||
package com.mango.moshen.ui.user.decorationsend;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
|
|
||||||
import com.mango.moshen.R;
|
|
||||||
import com.mango.moshen.base.BaseFragment;
|
|
||||||
import com.mango.moshen.ui.user.UserInfoActivity;
|
|
||||||
import com.mango.core.Constants;
|
|
||||||
import com.mango.core.auth.AuthModel;
|
|
||||||
import com.mango.core.praise.event.PraiseEvent;
|
|
||||||
import com.mango.core.user.AttentionModel;
|
|
||||||
import com.mango.core.user.bean.FansInfo;
|
|
||||||
import com.mango.core.user.bean.FansListInfo;
|
|
||||||
import com.mango.core.user.event.LoginUserInfoUpdateEvent;
|
|
||||||
import com.mango.xchat_android_library.utils.ListUtils;
|
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
|
||||||
import org.greenrobot.eventbus.ThreadMode;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import io.reactivex.SingleObserver;
|
|
||||||
import io.reactivex.disposables.Disposable;
|
|
||||||
|
|
||||||
public class DSFansListFragment extends BaseFragment {
|
|
||||||
private RecyclerView mRecyclerView;
|
|
||||||
private SwipeRefreshLayout mSwipeRefreshLayout;
|
|
||||||
private DSFansViewAdapter mAdapter;
|
|
||||||
private int mCurrentCounter = Constants.PAGE_START;
|
|
||||||
private List<FansInfo> mFansInfoList = new ArrayList<>();
|
|
||||||
private Context mContext;
|
|
||||||
private int mPageType;
|
|
||||||
private DecorationSendActivity friendActivity;
|
|
||||||
|
|
||||||
public static DSFansListFragment newInstanceForSelect() {
|
|
||||||
return new DSFansListFragment();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static DSFansListFragment newInstance(int pageType) {
|
|
||||||
DSFansListFragment fragment = new DSFansListFragment();
|
|
||||||
Bundle bundle = new Bundle();
|
|
||||||
bundle.putInt(Constants.KEY_PAGE_TYPE, pageType);
|
|
||||||
fragment.setArguments(bundle);
|
|
||||||
return fragment;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onInitArguments(Bundle bundle) {
|
|
||||||
super.onInitArguments(bundle);
|
|
||||||
if (bundle != null) {
|
|
||||||
mPageType = bundle.getInt(Constants.KEY_PAGE_TYPE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAttach(Activity activity) {
|
|
||||||
super.onAttach(activity);
|
|
||||||
if (activity instanceof DecorationSendActivity) {
|
|
||||||
friendActivity = (DecorationSendActivity) activity;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
mContext = getContext();
|
|
||||||
EventBus.getDefault().register(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
EventBus.getDefault().unregister(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFindViews() {
|
|
||||||
mRecyclerView = mView.findViewById(R.id.recycler_view);
|
|
||||||
mSwipeRefreshLayout = mView.findViewById(R.id.swipe_refresh);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSetListener() {
|
|
||||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext));
|
|
||||||
mAdapter = new DSFansViewAdapter(mFansInfoList);
|
|
||||||
mAdapter.setOnLoadMoreListener(() -> {
|
|
||||||
mCurrentCounter++;
|
|
||||||
onRefreshing();
|
|
||||||
}, mRecyclerView);
|
|
||||||
mRecyclerView.setAdapter(mAdapter);
|
|
||||||
mSwipeRefreshLayout.setOnRefreshListener(() -> {
|
|
||||||
mCurrentCounter = Constants.PAGE_START;
|
|
||||||
onRefreshing();
|
|
||||||
});
|
|
||||||
mAdapter.setRylListener(new DSFansViewAdapter.OnItemClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onItemClick(FansInfo fansInfo) {
|
|
||||||
UserInfoActivity.Companion.start(mContext, fansInfo.getUid());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void sendListener(FansInfo attentionInfo) {
|
|
||||||
if (friendActivity != null) {
|
|
||||||
friendActivity.showSureDialog(attentionInfo.getUid(), attentionInfo.getNick());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onRefreshing() {
|
|
||||||
AttentionModel.get().getFansList(
|
|
||||||
AuthModel.get().getCurrentUid(),
|
|
||||||
mCurrentCounter,
|
|
||||||
Constants.PAGE_SIZE
|
|
||||||
).subscribe(new SingleObserver<FansListInfo>() {
|
|
||||||
@Override
|
|
||||||
public void onSubscribe(Disposable d) {
|
|
||||||
mCompositeDisposable.add(d);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(FansListInfo fansListInfo) {
|
|
||||||
onGetMyFansList(fansListInfo, mPageType, mCurrentCounter);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Throwable e) {
|
|
||||||
onGetMyFansListFail(e.getMessage(), mPageType, mCurrentCounter);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initiate() {
|
|
||||||
showLoading();
|
|
||||||
onRefreshing();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getRootLayoutId() {
|
|
||||||
return R.layout.frg_decoration_send_list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
||||||
public void onPraise(PraiseEvent event) {
|
|
||||||
getDialogManager().dismissDialog();
|
|
||||||
if (!event.isFailed()) {
|
|
||||||
toast(event.getError());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//该界面关注后,关注按钮消失,所有没有取消操作
|
|
||||||
toast(getString(R.string.fan_success));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onGetMyFansList(FansListInfo fansListInfo, int pageType, int page) {
|
|
||||||
mCurrentCounter = page;
|
|
||||||
if (pageType == mPageType) {
|
|
||||||
mSwipeRefreshLayout.setRefreshing(false);
|
|
||||||
if (fansListInfo == null || ListUtils.isListEmpty(fansListInfo.getFansList())) {
|
|
||||||
//第一页
|
|
||||||
if (mCurrentCounter == Constants.PAGE_START) {
|
|
||||||
showNoData(getString(R.string.no_fan_text));
|
|
||||||
} else {
|
|
||||||
mAdapter.loadMoreEnd(true);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
hideStatus();
|
|
||||||
if (mCurrentCounter == Constants.PAGE_START) {
|
|
||||||
mFansInfoList.clear();
|
|
||||||
List<FansInfo> fansList = fansListInfo.getFansList();
|
|
||||||
mFansInfoList.addAll(fansList);
|
|
||||||
mAdapter.setNewData(mFansInfoList);
|
|
||||||
if (fansList.size() < Constants.PAGE_SIZE) {
|
|
||||||
mAdapter.setEnableLoadMore(false);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mAdapter.loadMoreComplete();
|
|
||||||
mAdapter.addData(fansListInfo.getFansList());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onGetMyFansListFail(String error, int pageType, int page) {
|
|
||||||
mCurrentCounter = page;
|
|
||||||
if (pageType == mPageType) {
|
|
||||||
if (mCurrentCounter == Constants.PAGE_START) {
|
|
||||||
mSwipeRefreshLayout.setRefreshing(false);
|
|
||||||
showNetworkErr();
|
|
||||||
} else {
|
|
||||||
mAdapter.loadMoreFail();
|
|
||||||
toast(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
||||||
public void onLoginUserInfoUpdateEvent(LoginUserInfoUpdateEvent event) {
|
|
||||||
mCurrentCounter = Constants.PAGE_START;
|
|
||||||
onRefreshing();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReloadData() {
|
|
||||||
super.onReloadData();
|
|
||||||
mCurrentCounter = Constants.PAGE_START;
|
|
||||||
showLoading();
|
|
||||||
onRefreshing();
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,63 +0,0 @@
|
|||||||
package com.mango.moshen.ui.user.decorationsend;
|
|
||||||
|
|
||||||
import com.chad.library.adapter.base.BaseViewHolder;
|
|
||||||
import com.mango.core.level.UserLevelVo;
|
|
||||||
import com.mango.core.noble.NobleInfo;
|
|
||||||
import com.mango.core.user.bean.FansInfo;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class DSFansViewAdapter extends DSBaseListAdapter<FansInfo, BaseViewHolder> {
|
|
||||||
|
|
||||||
private OnItemClickListener onItemClickListener;
|
|
||||||
|
|
||||||
public interface OnItemClickListener {
|
|
||||||
void onItemClick(FansInfo fansInfo);
|
|
||||||
void sendListener(FansInfo attentionInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRylListener(OnItemClickListener onClickListener) {
|
|
||||||
onItemClickListener = onClickListener;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DSFansViewAdapter(List<FansInfo> fansInfoList) {
|
|
||||||
super(fansInfoList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getNick(FansInfo info) {
|
|
||||||
return info.getNick();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getAvatar(FansInfo info) {
|
|
||||||
return info.getAvatar();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NobleInfo getNobleInfo(FansInfo info) {
|
|
||||||
return info.getNobleUsers();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public UserLevelVo getUserLevelVo(FansInfo info) {
|
|
||||||
return info.getUserLevelVo();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGender(FansInfo info) {
|
|
||||||
return info.getGender();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getUserDesc(FansInfo info) {
|
|
||||||
return info.getUserDesc();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void listeners(FansInfo info) {
|
|
||||||
if (onItemClickListener != null)
|
|
||||||
onItemClickListener.sendListener(info);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -1,61 +0,0 @@
|
|||||||
package com.mango.moshen.ui.user.decorationsend;
|
|
||||||
|
|
||||||
import com.chad.library.adapter.base.BaseViewHolder;
|
|
||||||
import com.mango.core.level.UserLevelVo;
|
|
||||||
import com.mango.core.noble.NobleInfo;
|
|
||||||
import com.mango.core.user.bean.UserInfo;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class DSFriendListAdapter extends DSBaseListAdapter<UserInfo, BaseViewHolder> {
|
|
||||||
|
|
||||||
private onClickListener rylListener;
|
|
||||||
|
|
||||||
public DSFriendListAdapter(List<UserInfo> userInfoList) {
|
|
||||||
super(userInfoList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getNick(UserInfo info) {
|
|
||||||
return info.getNick();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getAvatar(UserInfo info) {
|
|
||||||
return info.getAvatar();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NobleInfo getNobleInfo(UserInfo info) {
|
|
||||||
return info.getNobleUsers();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public UserLevelVo getUserLevelVo(UserInfo info) {
|
|
||||||
return info.getUserLevelVo();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGender(UserInfo info) {
|
|
||||||
return info.getGender();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getUserDesc(UserInfo info) {
|
|
||||||
return info.getUserDesc();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRylListener(onClickListener onClickListener) {
|
|
||||||
rylListener = onClickListener;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void listeners(UserInfo info) {
|
|
||||||
if (rylListener != null)
|
|
||||||
rylListener.sendListener(info);
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface onClickListener {
|
|
||||||
void sendListener(UserInfo userInfo);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,156 +0,0 @@
|
|||||||
package com.mango.moshen.ui.user.decorationsend;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
|
|
||||||
import com.mango.moshen.R;
|
|
||||||
import com.mango.moshen.base.BaseFragment;
|
|
||||||
import com.mango.core.im.friend.IMFriendModel;
|
|
||||||
import com.mango.core.manager.IMNetEaseManager;
|
|
||||||
import com.mango.core.manager.RelationShipEvent;
|
|
||||||
import com.mango.core.user.UserModel;
|
|
||||||
import com.mango.core.user.bean.UserInfo;
|
|
||||||
import com.mango.core.user.event.LoginUserInfoUpdateEvent;
|
|
||||||
import com.mango.xchat_android_library.utils.ListUtils;
|
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
|
||||||
import org.greenrobot.eventbus.ThreadMode;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import io.reactivex.SingleObserver;
|
|
||||||
import io.reactivex.disposables.Disposable;
|
|
||||||
|
|
||||||
public class DSFriendListFragment extends BaseFragment {
|
|
||||||
|
|
||||||
private DSFriendListAdapter mAdapter = null;
|
|
||||||
private DecorationSendActivity selectFriendActivity;
|
|
||||||
private SwipeRefreshLayout mSwipeRefresh;
|
|
||||||
private RecyclerView mRecyclerView;
|
|
||||||
|
|
||||||
public static DSFriendListFragment newInstances() {
|
|
||||||
return new DSFriendListFragment();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAttach(Activity activity) {
|
|
||||||
super.onAttach(activity);
|
|
||||||
if (activity instanceof DecorationSendActivity) {
|
|
||||||
selectFriendActivity = (DecorationSendActivity) activity;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
EventBus.getDefault().register(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
EventBus.getDefault().unregister(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFindViews() {
|
|
||||||
mSwipeRefresh = mView.findViewById(R.id.swipe_refresh);
|
|
||||||
mRecyclerView = mView.findViewById(R.id.recycler_view);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSetListener() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initiate() {
|
|
||||||
mSwipeRefresh.setOnRefreshListener(() -> {
|
|
||||||
mSwipeRefresh.setRefreshing(true);
|
|
||||||
loadFriends();
|
|
||||||
mSwipeRefresh.setRefreshing(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
mAdapter = new DSFriendListAdapter(null);
|
|
||||||
mAdapter.setEnableLoadMore(true);
|
|
||||||
mAdapter.setRylListener((attentionInfo)->{
|
|
||||||
if (selectFriendActivity != null && attentionInfo != null) {
|
|
||||||
selectFriendActivity.showSureDialog(attentionInfo.getUid(), attentionInfo.getNick());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
|
||||||
mRecyclerView.setAdapter(mAdapter);
|
|
||||||
|
|
||||||
loadFriends();
|
|
||||||
|
|
||||||
Disposable d = IMNetEaseManager.get().getRelationShipEventObservable().subscribe(this::onGetRelationShipEvent);
|
|
||||||
mCompositeDisposable.add(d);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onGetRelationShipEvent(RelationShipEvent event) {
|
|
||||||
if (event.event == RelationShipEvent.EVENT_FRIEND_UPDATE) {
|
|
||||||
onFriendListUpdate(event.accounts);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadFriends() {
|
|
||||||
onFriendListUpdate(IMFriendModel.get().getMyFriendsAccounts());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getRootLayoutId() {
|
|
||||||
return R.layout.frg_decoration_send_list;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onFriendListUpdate(List<String> accounts) {
|
|
||||||
if (ListUtils.isListEmpty(accounts)) {
|
|
||||||
showNoData(getString(R.string.no_frenids_text));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
UserModel.get().loadUserInfoByUids(accounts).subscribe(new SingleObserver<List<UserInfo>>() {
|
|
||||||
@Override
|
|
||||||
public void onSubscribe(Disposable d) {
|
|
||||||
mCompositeDisposable.add(d);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(List<UserInfo> userInfos) {
|
|
||||||
setData(userInfos);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Throwable e) {
|
|
||||||
toast(e.getMessage());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setData(List<UserInfo> userInfo) {
|
|
||||||
if (userInfo != null && !userInfo.isEmpty()) {
|
|
||||||
hideStatus();
|
|
||||||
mAdapter.setNewData(userInfo);
|
|
||||||
mAdapter.notifyDataSetChanged();
|
|
||||||
} else {
|
|
||||||
showNoData(getString(R.string.no_frenids_text));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
||||||
public void onLoginUserInfoUpdateEvent(LoginUserInfoUpdateEvent event) {
|
|
||||||
mRecyclerView.postDelayed(()->onFriendListUpdate(IMFriendModel.get().getMyFriendsAccounts())
|
|
||||||
, 250);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReloadData() {
|
|
||||||
super.onReloadData();
|
|
||||||
showLoading();
|
|
||||||
loadFriends();
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,171 +0,0 @@
|
|||||||
package com.mango.moshen.ui.user.decorationsend;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
import android.view.View;
|
|
||||||
|
|
||||||
import com.mango.moshen.R;
|
|
||||||
import com.mango.moshen.base.BaseBindingActivity;
|
|
||||||
import com.mango.moshen.base.TitleBar;
|
|
||||||
import com.mango.moshen.common.ViewPagerAdapter;
|
|
||||||
import com.mango.moshen.databinding.ActivityDecorationSendBinding;
|
|
||||||
import com.mango.moshen.decoration.helper.DecorationDialogHelper;
|
|
||||||
import com.mango.moshen.decoration.helper.DecorationSaleType;
|
|
||||||
import com.mango.moshen.decoration.view.widgets.CarMagicIndicator;
|
|
||||||
import com.mango.moshen.friend.action.AbstractSelectFriendAction;
|
|
||||||
import com.mango.moshen.ui.search.SearchActivity;
|
|
||||||
import com.mango.moshen.ui.widget.magicindicator.ViewPagerHelper;
|
|
||||||
import com.mango.moshen.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
|
||||||
import com.mango.core.decoration.car.bean.CarInfo;
|
|
||||||
import com.mango.core.decoration.headwear.bean.HeadWearInfo;
|
|
||||||
import com.mango.core.home.bean.TabInfo;
|
|
||||||
import com.mango.xchat_android_library.annatation.ActLayoutRes;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@ActLayoutRes(R.layout.activity_decoration_send)
|
|
||||||
public class DecorationSendActivity extends BaseBindingActivity<ActivityDecorationSendBinding> implements CarMagicIndicator.OnItemSelectListener {
|
|
||||||
|
|
||||||
private static final String CAR_INFO = "carInfo";
|
|
||||||
private static final String WEAR_INFO = "wearInfo";
|
|
||||||
|
|
||||||
private String[] titles = {"好友", "关注", "粉丝"};
|
|
||||||
private CarInfo carInfo;
|
|
||||||
private HeadWearInfo wearInfo;
|
|
||||||
private int type;
|
|
||||||
|
|
||||||
public static void start(Context context, CarInfo carInfo) {
|
|
||||||
Intent intent = new Intent(context, DecorationSendActivity.class);
|
|
||||||
intent.putExtra(AbstractSelectFriendAction.KEY_TYPE, AbstractSelectFriendAction.TYPE_CAR);
|
|
||||||
intent.putExtra(CAR_INFO, carInfo);
|
|
||||||
context.startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void start(Context context, HeadWearInfo wearInfo) {
|
|
||||||
Intent intent = new Intent(context, DecorationSendActivity.class);
|
|
||||||
intent.putExtra(AbstractSelectFriendAction.KEY_TYPE, AbstractSelectFriendAction.TYPE_WEAR);
|
|
||||||
intent.putExtra(WEAR_INFO, wearInfo);
|
|
||||||
context.startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void init() {
|
|
||||||
type = getIntent().getIntExtra(AbstractSelectFriendAction.KEY_TYPE, AbstractSelectFriendAction.TYPE_CAR);
|
|
||||||
|
|
||||||
if (type != AbstractSelectFriendAction.TYPE_CAR && type != AbstractSelectFriendAction.TYPE_WEAR)
|
|
||||||
finish();
|
|
||||||
|
|
||||||
carInfo = (CarInfo) getIntent().getSerializableExtra(CAR_INFO);
|
|
||||||
wearInfo = (HeadWearInfo) getIntent().getSerializableExtra(WEAR_INFO);
|
|
||||||
|
|
||||||
initTitleBar(getString(R.string.title_select_friend));
|
|
||||||
|
|
||||||
mBinding.titleBar.addAction(new TitleBar.Action() {
|
|
||||||
@Override
|
|
||||||
public String getText() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getDrawable() {
|
|
||||||
return R.drawable.ic_send_search;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getTextColor() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getTextDrawableLeft() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void performAction(View view) {
|
|
||||||
switch (type) {
|
|
||||||
case AbstractSelectFriendAction.TYPE_CAR:
|
|
||||||
SearchActivity.start(DecorationSendActivity.this, carInfo);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case AbstractSelectFriendAction.TYPE_WEAR:
|
|
||||||
SearchActivity.start(DecorationSendActivity.this, wearInfo);
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mBinding.viewpager.setOffscreenPageLimit(3);
|
|
||||||
mBinding.viewpager.setAdapter(new ViewPagerAdapter(getSupportFragmentManager(), getFragment(), titles));
|
|
||||||
|
|
||||||
List<TabInfo> tabInfoList = new ArrayList<>(2);
|
|
||||||
tabInfoList.add(new TabInfo(1, getString(R.string.tab_title_friends)));
|
|
||||||
tabInfoList.add(new TabInfo(2, getString(R.string.tab_title_attentions)));
|
|
||||||
tabInfoList.add(new TabInfo(3, getString(R.string.tab_title_fans)));
|
|
||||||
CommonNavigator commonNavigator = new CommonNavigator(this);
|
|
||||||
commonNavigator.setAdjustMode(true);
|
|
||||||
CarMagicIndicator indicator = new CarMagicIndicator(this, tabInfoList, 0);
|
|
||||||
indicator.setOnItemSelectListener(this);
|
|
||||||
commonNavigator.setAdapter(indicator);
|
|
||||||
mBinding.viewIndicator.setNavigator(commonNavigator);
|
|
||||||
ViewPagerHelper.bind(mBinding.viewIndicator, mBinding.viewpager);
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<Fragment> getFragment() {
|
|
||||||
List<Fragment> list = new ArrayList<>();
|
|
||||||
list.add(DSFriendListFragment.newInstances());
|
|
||||||
list.add(DSAttentionFragment.newInstance());
|
|
||||||
list.add(DSFansListFragment.newInstanceForSelect());
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemSelect(int position) {
|
|
||||||
mBinding.viewpager.setCurrentItem(position);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
|
||||||
if (requestCode == SearchActivity.CODE_REQUEST_TO_SEARCH && resultCode == RESULT_OK) {
|
|
||||||
setResult(RESULT_OK, data);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showSureDialog(long targetUid, String nick) {
|
|
||||||
switch (type) {
|
|
||||||
case AbstractSelectFriendAction.TYPE_CAR:
|
|
||||||
if (carInfo != null) {
|
|
||||||
DecorationDialogHelper.Options options = new DecorationDialogHelper.Builder()
|
|
||||||
.setType(DecorationSaleType.SEND_CAR)
|
|
||||||
.setNick(nick)
|
|
||||||
.setDecoration(carInfo)
|
|
||||||
.setTargetUid(targetUid)
|
|
||||||
.create();
|
|
||||||
DecorationDialogHelper helper = new DecorationDialogHelper(context, getDialogManager(), options);
|
|
||||||
helper.showBuyOrDonateDialog();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case AbstractSelectFriendAction.TYPE_WEAR:
|
|
||||||
if (wearInfo != null) {
|
|
||||||
DecorationDialogHelper.Options options = new DecorationDialogHelper.Builder()
|
|
||||||
.setType(DecorationSaleType.SEND_HEAD_WEAR)
|
|
||||||
.setNick(nick)
|
|
||||||
.setDecoration(wearInfo)
|
|
||||||
.setTargetUid(targetUid)
|
|
||||||
.create();
|
|
||||||
DecorationDialogHelper helper = new DecorationDialogHelper(context, getDialogManager(), options);
|
|
||||||
helper.showBuyOrDonateDialog();
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -1,30 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<data>
|
|
||||||
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<com.mango.moshen.base.TitleBar
|
|
||||||
android:id="@+id/title_bar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<com.mango.moshen.ui.widget.magicindicator.MagicIndicator
|
|
||||||
android:id="@+id/view_indicator"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:background="@color/white"/>
|
|
||||||
|
|
||||||
<androidx.viewpager.widget.ViewPager
|
|
||||||
android:id="@+id/viewpager"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@color/color_FAFAFA"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</layout>
|
|
@@ -1,20 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<com.mango.moshen.common.widget.StatusLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@color/color_FAFAFA">
|
|
||||||
|
|
||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
|
||||||
android:id="@+id/swipe_refresh"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/recycler_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:scrollbars="vertical" />
|
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
|
||||||
|
|
||||||
</com.mango.moshen.common.widget.StatusLayout>
|
|
@@ -1,118 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:id="@+id/container"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="65dp"
|
|
||||||
android:background="@drawable/bg_common_touch_while">
|
|
||||||
|
|
||||||
<com.mango.moshen.ui.widget.NobleAvatarView
|
|
||||||
android:id="@+id/noble_avatar_view"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_marginStart="15dp"
|
|
||||||
android:layout_marginEnd="10dp" />
|
|
||||||
|
|
||||||
<com.google.android.flexbox.FlexboxLayout
|
|
||||||
android:id="@+id/ll_name_group"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:layout_toEndOf="@+id/noble_avatar_view"
|
|
||||||
android:layout_toStartOf="@+id/tv_send"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:flexDirection="row"
|
|
||||||
app:flexWrap="nowrap" >
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_userName"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textColor="@color/color_1A1A1A"
|
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:lines="1"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:maxEms="5"
|
|
||||||
android:textSize="15sp"
|
|
||||||
tools:text="小涩瑶"
|
|
||||||
app:layout_flexShrink="1"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_gender"
|
|
||||||
android:layout_width="13dp"
|
|
||||||
android:layout_height="13dp"
|
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
android:src="@drawable/ic_gender_male"
|
|
||||||
app:layout_flexShrink="0"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_user_badge"
|
|
||||||
android:layout_width="17dp"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
tools:src="@mipmap/ic_user_level_king"
|
|
||||||
app:layout_flexShrink="0"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_user_level"
|
|
||||||
android:layout_width="34dp"
|
|
||||||
android:layout_height="14dp"
|
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
tools:src="@mipmap/ic_user_level"
|
|
||||||
app:layout_flexShrink="0"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_other_level"
|
|
||||||
android:layout_width="34dp"
|
|
||||||
android:layout_height="14dp"
|
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
tools:src="@mipmap/ic_user_level"
|
|
||||||
app:layout_flexShrink="0"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</com.google.android.flexbox.FlexboxLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_desc"
|
|
||||||
android:layout_toEndOf="@+id/noble_avatar_view"
|
|
||||||
android:layout_toStartOf="@+id/tv_send"
|
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:textColor="@color/color_999999"
|
|
||||||
android:layout_below="@+id/ll_name_group"
|
|
||||||
android:text="什么也没留下"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_send"
|
|
||||||
android:layout_width="65dp"
|
|
||||||
android:layout_height="29dp"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_marginEnd="15dp"
|
|
||||||
android:background="@drawable/bg_solid_car_send"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/label_send"
|
|
||||||
android:textColor="@color/color_333333"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:visibility="visible" />
|
|
||||||
|
|
||||||
<!--<View-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="1px"-->
|
|
||||||
<!--android:layout_alignParentBottom="true"-->
|
|
||||||
<!--android:layout_marginStart="15dp"-->
|
|
||||||
<!--android:layout_marginEnd="15dp"-->
|
|
||||||
<!--android:background="@color/color_f0f0f0" />-->
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
Reference in New Issue
Block a user