本文整理汇总了Java中android.support.v7.widget.AppCompatCheckBox.setOnClickListener方法的典型用法代码示例。如果您正苦于以下问题:Java AppCompatCheckBox.setOnClickListener方法的具体用法?Java AppCompatCheckBox.setOnClickListener怎么用?Java AppCompatCheckBox.setOnClickListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.AppCompatCheckBox
的用法示例。
在下文中一共展示了AppCompatCheckBox.setOnClickListener方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onViewCreatedOk
import android.support.v7.widget.AppCompatCheckBox; //导入方法依赖的package包/类
@Override
public void onViewCreatedOk(View view, @Nullable Bundle savedInstanceState) {
mCbCheck = (AppCompatCheckBox) view.findViewById(R.id.cb_page_check);
mViewPager = (ViewPager) view.findViewById(R.id.view_pager_page);
mRlRootView = (RelativeLayout) view.findViewById(R.id.rl_page_root_view);
mScreenSize = DeviceUtils.getScreenSize(getContext());
mMediaBeanList = new ArrayList<>();
if (savedInstanceState != null) {
List<MediaBean> mediaList = savedInstanceState.getParcelableArrayList(EXTRA_MEDIA_LIST);
mItemClickPosition = savedInstanceState.getInt(EXTRA_ITEM_CLICK_POSITION);
if (mediaList != null) {
mMediaBeanList.addAll(mediaList);
}
}
mMediaPreviewAdapter = new MediaPreviewAdapter(mMediaBeanList,
mScreenSize.widthPixels, mScreenSize.heightPixels, mConfiguration
, ThemeUtils.resolveColor(getActivity(), R.attr.gallery_page_bg, R.color.gallery_default_page_bg),
ContextCompat.getDrawable(getActivity(), ThemeUtils.resolveDrawableRes(getActivity(), R.attr.gallery_default_image, R.drawable.gallery_default_image)));
mViewPager.setAdapter(mMediaPreviewAdapter);
mCbCheck.setOnClickListener(this);
mViewPager.setCurrentItem(mItemClickPosition);
mViewPager.addOnPageChangeListener(this);
}
示例2: onViewCreatedOk
import android.support.v7.widget.AppCompatCheckBox; //导入方法依赖的package包/类
@Override
public void onViewCreatedOk(View view, @Nullable Bundle savedInstanceState) {
mCbCheck = (AppCompatCheckBox) view.findViewById(R.id.cb_check);
mViewPager = (ViewPager) view.findViewById(R.id.view_pager);
mRlRootView = (RelativeLayout) view.findViewById(R.id.rl_root_view);
mScreenSize = DeviceUtils.getScreenSize(getContext());
mMediaBeanList = new ArrayList<>();
if (mMediaActivity.getCheckedList() != null) {
mMediaBeanList.addAll(mMediaActivity.getCheckedList());
}
MediaPreviewAdapter mMediaPreviewAdapter = new MediaPreviewAdapter(mMediaBeanList,
mScreenSize.widthPixels, mScreenSize.heightPixels, mConfiguration,
ThemeUtils.resolveColor(getActivity(), R.attr.gallery_page_bg, R.color.gallery_default_page_bg),
ContextCompat.getDrawable(getActivity(), ThemeUtils.resolveDrawableRes(getActivity(), R.attr.gallery_default_image, R.drawable.gallery_default_image)));
mViewPager.setAdapter(mMediaPreviewAdapter);
mCbCheck.setOnClickListener(this);
if (savedInstanceState != null) {
mPagerPosition = savedInstanceState.getInt(EXTRA_PAGE_INDEX);
}
}
示例3: ImageHolder
import android.support.v7.widget.AppCompatCheckBox; //导入方法依赖的package包/类
ImageHolder(View itemView, int itemSize, boolean hasCamera, @Album.ChoiceMode int choiceMode, ColorStateList selector,
OnItemClickListener itemClickListener, OnItemCheckedListener itemCheckedListener) {
super(itemView);
itemView.getLayoutParams().height = itemSize;
this.itemSize = itemSize;
this.hasCamera = hasCamera;
this.mChoiceMode = choiceMode;
this.mItemClickListener = itemClickListener;
this.mItemCheckedListener = itemCheckedListener;
mIvImage = (ImageView) itemView.findViewById(R.id.iv_album_content_image);
mCheckBox = (AppCompatCheckBox) itemView.findViewById(R.id.cb_album_check);
mLayoutLayer = (FrameLayout) itemView.findViewById(R.id.layout_layer);
itemView.setOnClickListener(this);
mCheckBox.setOnClickListener(this);
mLayoutLayer.setOnClickListener(this);
if (mChoiceMode == Album.MODE_MULTIPLE) {
mCheckBox.setVisibility(View.VISIBLE);
mCheckBox.setSupportButtonTintList(selector);
} else {
mCheckBox.setVisibility(View.GONE);
}
}
示例4: VideoHolder
import android.support.v7.widget.AppCompatCheckBox; //导入方法依赖的package包/类
VideoHolder(View itemView, int itemSize, boolean hasCamera, @Album.ChoiceMode int choiceMode, ColorStateList selector,
OnItemClickListener itemClickListener, OnItemCheckedListener itemCheckedListener) {
super(itemView);
itemView.getLayoutParams().height = itemSize;
this.itemSize = itemSize;
this.hasCamera = hasCamera;
this.mChoiceMode = choiceMode;
this.mItemClickListener = itemClickListener;
this.mItemCheckedListener = itemCheckedListener;
mIvImage = (ImageView) itemView.findViewById(R.id.iv_album_content_image);
mCheckBox = (AppCompatCheckBox) itemView.findViewById(R.id.cb_album_check);
mTvDuration = (TextView) itemView.findViewById(R.id.tv_duration);
mLayoutLayer = (FrameLayout) itemView.findViewById(R.id.layout_layer);
itemView.setOnClickListener(this);
mCheckBox.setOnClickListener(this);
mLayoutLayer.setOnClickListener(this);
if (mChoiceMode == Album.MODE_MULTIPLE) {
mCheckBox.setVisibility(View.VISIBLE);
mCheckBox.setSupportButtonTintList(selector);
} else {
mCheckBox.setVisibility(View.GONE);
}
}
示例5: showFullscreenTempView
import android.support.v7.widget.AppCompatCheckBox; //导入方法依赖的package包/类
/***
* 显示隐藏全屏按钮
*
* @param visibility 状态
*/
public void showFullscreenTempView(int visibility) {
AppCompatCheckBox compatCheckBox = (AppCompatCheckBox) playerView.findViewById(R.id.sexo_video_fullscreen);
compatCheckBox.setVisibility(visibility);
compatCheckBox.setButtonDrawable(playerView.getControllerView().getIcFullscreenSelector());
compatCheckBox.setOnClickListener(onClickListener);
}