use of com.rideread.rideread.common.util.TitleBuilder in project ride-read-android by Ride-Read.
the class PostMomentActivity method initView.
@Override
public void initView() {
new TitleBuilder(this).setTitleText("发个阅圈").IsBack(true).setRightText("发送").build();
//设置布局管理器
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
mRvPicContainer.setLayoutManager(linearLayoutManager);
//设置适配器
mPostPicAdapter = new PostPicAdapter(this, mSelectedPics);
mRvPicContainer.setAdapter(mPostPicAdapter);
mTvPostLoc.setText(AMapLocationUtils.getLocDetail());
}
use of com.rideread.rideread.common.util.TitleBuilder in project ride-read-android by Ride-Read.
the class ChatSingleActivity method initView.
@Override
public void initView() {
mUser = (UserBaseInfo) getIntent().getSerializableExtra(CHAT_USER);
mUserName = getIntent().getStringExtra(CHAT_USER_NAME);
if (TextUtils.isEmpty(mUserName))
mUserName = "消息";
new TitleBuilder(this).setTitleText(mUserName).IsBack(true).setLeftOnClickListener(v -> finish()).build();
mSwipeRefreshLayout.setEnabled(false);
layoutManager = new LinearLayoutManager(this);
mRecycleView.setLayoutManager(layoutManager);
mMsgAdapter = new ChatMsgAdapter();
mRecycleView.setAdapter(mMsgAdapter);
getConversation(mUser.getUid() + "");
mSwipeRefreshLayout.setOnRefreshListener(() -> {
AVIMMessage message = mMsgAdapter.getFirstMessage();
if (null != mImConversation) {
mImConversation.queryMessages(message.getMessageId(), message.getTimestamp(), 20, new AVIMMessagesQueryCallback() {
@Override
public void done(List<AVIMMessage> list, AVIMException e) {
mSwipeRefreshLayout.setRefreshing(false);
if (filterException(e)) {
if (null != list && list.size() > 0) {
mMsgAdapter.addMessageList(list);
mMsgAdapter.notifyDataSetChanged();
layoutManager.scrollToPositionWithOffset(list.size() - 1, 0);
}
}
}
});
} else {
mSwipeRefreshLayout.setRefreshing(false);
}
});
}
use of com.rideread.rideread.common.util.TitleBuilder in project ride-read-android by Ride-Read.
the class SettingActivity method initView.
@Override
public void initView() {
new TitleBuilder(this).setTitleText(R.string.setting).IsBack(true).setLeftOnClickListener(v -> finish()).build();
mHandler = new WeakHandler();
countCache();
}
use of com.rideread.rideread.common.util.TitleBuilder in project ride-read-android by Ride-Read.
the class UserMomentsActivity method initView.
@Override
public void initView() {
mAMap = mMapViewBg.getMap();
//实例化UiSettings类对象
mUiSettings = mAMap.getUiSettings();
mUiSettings.setZoomControlsEnabled(false);
mAMap.moveCamera(CameraUpdateFactory.zoomTo(1F));
mSelectedUid = getIntent().getIntExtra(SELECTED_UID, UserUtils.getUid());
String username = getIntent().getStringExtra(SELECTED_USERNAME);
if (TextUtils.isEmpty(username)) {
username = "阅圈";
} else {
username = username + "的阅圈";
}
isMyself = mSelectedUid == UserUtils.getUid();
new TitleBuilder(this).setTitleText(isMyself ? getString(R.string.my_circle) : username).IsBack(true).setLeftOnClickListener(v -> finish()).build();
mMoments = new ArrayList<>();
mSwipeRefreshLayout.setOnRefreshListener(() -> {
mPages = 0;
loadUserMoments();
});
mRecycleView.setHasFixedSize(true);
mUserMomentsAdapter = new UserMomentsAdapter(this, mMoments);
// LayoutInflater layoutInflater = getLayoutInflater();
// if (!isMyself) {
// mMomentsHeaderView = layoutInflater.inflate(R.layout.view_user_info, null);
// mUserMomentsAdapter.addHeadView(mMomentsHeaderView);
// }
mRecycleView.setAdapter(mUserMomentsAdapter);
mLayoutManager = new LinearLayoutManager(this);
mRecycleView.setLayoutManager(mLayoutManager);
mRecycleView.setOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
}
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
int lastVisibleItem = mLayoutManager.findLastVisibleItemPosition();
int totalItemCount = mLayoutManager.getItemCount();
// dy>0 表示向下滑动
if (lastVisibleItem >= totalItemCount - 1 && dy > 0) {
if (!isLoadingMore) {
//这里多线程也要手动控制isLoadingMore
loadUserMoments();
}
}
}
});
if (isMyself) {
mViewHeader.setVisibility(View.GONE);
mLlFollowAction.setVisibility(View.GONE);
} else {
mViewHeader.attachTo(mRecycleView);
getUserInfo(mSelectedUid);
}
loadUserMoments();
}
use of com.rideread.rideread.common.util.TitleBuilder in project ride-read-android by Ride-Read.
the class MsgActivity method initView.
@Override
public void initView() {
new TitleBuilder(this).setTitleText("消息").IsBack(true).setLeftOnClickListener(v -> finish()).build();
// final AVIMClient client = AVImClientManager.getInstance().getClient();
mMsgInfoList = new ArrayList<>();
layoutManager = new LinearLayoutManager(this);
mRecycleView.setLayoutManager(layoutManager);
mMsgUserAdapter = new MsgUserAdapter(this, mMsgInfoList);
mRecycleView.setAdapter(mMsgUserAdapter);
mSwipeRefreshLayout.setOnRefreshListener(() -> {
refreshMsgUserList();
});
refreshMsgUserList();
}
Aggregations