use of me.zhanghai.android.douya.ui.OnHorizontalScrollListener in project Douya by DreaminginCodeZH.
the class BroadcastLayout method init.
private void init() {
setOrientation(VERTICAL);
ViewUtils.inflateInto(R.layout.broadcast_layout, this);
ButterKnife.bind(this);
ViewCompat.setBackground(mImageListDescriptionLayout, DrawableUtils.makeScrimDrawable());
mImageList.setHasFixedSize(true);
mImageList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
mImageList.addItemDecoration(new DividerItemDecoration(DividerItemDecoration.HORIZONTAL, R.drawable.transparent_divider_vertical_2dp, getContext()));
mImageListAdapter = new HorizontalImageAdapter();
mImageList.setAdapter(mImageListAdapter);
mImageList.addOnScrollListener(new OnHorizontalScrollListener() {
private boolean mShowingDescription = true;
@Override
public void onScrolledLeft() {
if (!mShowingDescription) {
mShowingDescription = true;
ViewUtils.fadeIn(mImageListDescriptionLayout);
}
}
@Override
public void onScrolledRight() {
if (mShowingDescription) {
mShowingDescription = false;
ViewUtils.fadeOut(mImageListDescriptionLayout);
}
}
});
ViewUtils.setTextViewLinkClickable(mTextText);
ViewUtils.setTextViewLinkClickable(mRebroadcastedTextText);
TooltipUtils.setup(mLikeButton);
TooltipUtils.setup(mCommentButton);
// Handled by the OnLongClickListener set in bind().
// TooltipUtils.setup(mRebroadcastButton);
}
use of me.zhanghai.android.douya.ui.OnHorizontalScrollListener in project Douya by DreaminginCodeZH.
the class SendBroadcastAttachmentLayout method init.
private void init() {
ViewUtils.inflateInto(R.layout.send_broadcast_attachment_layout, this);
ButterKnife.bind(this);
ViewCompat.setBackground(mImageListDescriptionLayout, DrawableUtils.makeScrimDrawable());
mImageList.setHasFixedSize(true);
mImageList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
mImageList.addItemDecoration(new DividerItemDecoration(DividerItemDecoration.HORIZONTAL, R.drawable.transparent_divider_vertical_2dp, getContext()));
mImageListAdapter = new HorizontalUploadImageAdapter();
mImageList.setAdapter(mImageListAdapter);
mImageList.addOnScrollListener(new OnHorizontalScrollListener() {
private boolean mShowingDescription = true;
@Override
public void onScrolledLeft() {
if (!mShowingDescription) {
mShowingDescription = true;
ViewUtils.fadeIn(mImageListDescriptionLayout);
}
}
@Override
public void onScrolledRight() {
if (mShowingDescription) {
mShowingDescription = false;
ViewUtils.fadeOut(mImageListDescriptionLayout);
}
}
});
}
Aggregations