本文整理汇总了Java中com.jess.arms.R类的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
R类属于com.jess.arms包,在下文中一共展示了R类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateTabStyles
import com.jess.arms.R; //导入依赖的package包/类
private void updateTabStyles() {
for (int i = 0; i < mTabCount; i++) {
View tabView = mTabsContainer.getChildAt(i);
tabView.setPadding((int) mTabPadding, 0, (int) mTabPadding, 0);
TextView tv_tab_title = (TextView) tabView.findViewById(R.id.tv_tab_title);
tv_tab_title.setTextColor(i == mCurrentTab ? mTextSelectColor : mTextUnselectColor);
tv_tab_title.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextsize);
// tv_tab_title.setPadding((int) mTabPadding, 0, (int) mTabPadding, 0);
if (mTextAllCaps) {
tv_tab_title.setText(tv_tab_title.getText().toString().toUpperCase());
}
if (mTextBold == TEXT_BOLD_BOTH) {
tv_tab_title.getPaint().setFakeBoldText(true);
} else if (mTextBold == TEXT_BOLD_NONE) {
tv_tab_title.getPaint().setFakeBoldText(false);
}
}
}
示例2: showMsg
import com.jess.arms.R; //导入依赖的package包/类
/**
* 显示未读消息
*
* @param position 显示tab位置
* @param num num小于等于0显示红点,num大于0显示数字
*/
public void showMsg(int position, int num) {
if (position >= mTabCount) {
position = mTabCount - 1;
}
View tabView = mTabsContainer.getChildAt(position);
MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);
if (tipView != null) {
UnreadMsgUtils.show(tipView, num);
if (mInitSetMap.get(position) != null && mInitSetMap.get(position)) {
return;
}
setMsgMargin(position, 2, 2);
mInitSetMap.put(position, true);
}
}
示例3: notifyDataSetChanged
import com.jess.arms.R; //导入依赖的package包/类
/** 更新数据 */
public void notifyDataSetChanged() {
mTabsContainer.removeAllViews();
this.mTabCount = mTabEntitys.size();
View tabView;
for (int i = 0; i < mTabCount; i++) {
if (mIconGravity == Gravity.LEFT) {
tabView = View.inflate(mContext, R.layout.layout_tab_left, null);
} else if (mIconGravity == Gravity.RIGHT) {
tabView = View.inflate(mContext, R.layout.layout_tab_right, null);
} else if (mIconGravity == Gravity.BOTTOM) {
tabView = View.inflate(mContext, R.layout.layout_tab_bottom, null);
} else {
tabView = View.inflate(mContext, R.layout.layout_tab_top, null);
}
tabView.setTag(i);
addTab(i, tabView);
}
updateTabStyles();
}
示例4: SlidingTabLayout
import com.jess.arms.R; //导入依赖的package包/类
public SlidingTabLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
setFillViewport(true);//设置滚动视图是否可以伸缩其内容以填充视口
setWillNotDraw(false);//重写onDraw方法,需要调用这个方法来清除flag
setClipChildren(false);
setClipToPadding(false);
this.mContext = context;
mTabsContainer = new LinearLayout(context);
addView(mTabsContainer);
obtainAttributes(context, attrs);
//get layout_height
String height = attrs.getAttributeValue("http://schemas.android.com/apk/res/android", "layout_height");
if (height.equals(ViewGroup.LayoutParams.MATCH_PARENT + "")) {
} else if (height.equals(ViewGroup.LayoutParams.WRAP_CONTENT + "")) {
} else {
int[] systemAttrs = {android.R.attr.layout_height};
TypedArray a = context.obtainStyledAttributes(attrs, systemAttrs);
mHeight = a.getDimensionPixelSize(0, ViewGroup.LayoutParams.WRAP_CONTENT);
a.recycle();
}
}
示例5: updateTabStyles
import com.jess.arms.R; //导入依赖的package包/类
private void updateTabStyles() {
for (int i = 0; i < mTabCount; i++) {
View v = mTabsContainer.getChildAt(i);
// v.setPadding((int) mTabPadding, v.getPaddingTop(), (int) mTabPadding, v.getPaddingBottom());
TextView tv_tab_title = (TextView) v.findViewById(R.id.tv_tab_title);
if (tv_tab_title != null) {
tv_tab_title.setTextColor(i == mCurrentTab ? mTextSelectColor : mTextUnselectColor);
tv_tab_title.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextsize);
tv_tab_title.setPadding((int) mTabPadding, 0, (int) mTabPadding, 0);
if (mTextAllCaps) {
tv_tab_title.setText(tv_tab_title.getText().toString().toUpperCase());
}
if (mTextBold == TEXT_BOLD_BOTH) {
tv_tab_title.getPaint().setFakeBoldText(true);
} else if (mTextBold == TEXT_BOLD_NONE) {
tv_tab_title.getPaint().setFakeBoldText(false);
}
}
}
}
示例6: showMsg
import com.jess.arms.R; //导入依赖的package包/类
/**
* 显示未读消息
*
* @param position 显示tab位置
* @param num num小于等于0显示红点,num大于0显示数字
*/
public void showMsg(int position, int num) {
if (position >= mTabCount) {
position = mTabCount - 1;
}
View tabView = mTabsContainer.getChildAt(position);
MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);
if (tipView != null) {
UnreadMsgUtils.show(tipView, num);
if (mInitSetMap.get(position) != null && mInitSetMap.get(position)) {
return;
}
setMsgMargin(position, 4, 2);
mInitSetMap.put(position, true);
}
}
示例7: onViewCreated
import com.jess.arms.R; //导入依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mEmptyTxt = (TextView) view.findViewById(R.id.empty_txt);
mRecycleView = (RecyclerView) view.findViewById(R.id.media_recycleview);
mLoadingView = (ProgressBar) view.findViewById(R.id.loading);
GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), GRID_COUNT);
gridLayoutManager.setSmoothScrollbarEnabled(true);
mRecycleView.setLayoutManager(gridLayoutManager);
mRecycleView.addItemDecoration(new SpacesItemDecoration(getResources().getDimensionPixelOffset(R.dimen.boxing_media_margin), GRID_COUNT));
mRecycleView.setAdapter(mMediaAdapter);
mRecycleView.addOnScrollListener(new ScrollListener());
mMediaAdapter.setOnMediaClickListener(new OnMediaClickListener());
mMediaAdapter.setOnCameraClickListener(new OnCameraClickListener());
view.findViewById(R.id.finish_txt).setOnClickListener(this);
}
示例8: showMedia
import com.jess.arms.R; //导入依赖的package包/类
@Override
public void showMedia(@Nullable List<BaseMedia> medias, int totalCount) {
if (medias == null || totalCount <= 0) {
return;
}
mImages.addAll(medias);
mAdapter.notifyDataSetChanged();
checkSelectedMedia(mImages, mSelectedImages);
setupGallery();
if (mToolbar != null && mNeedAllCount) {
mToolbar.setTitle(getString(R.string.boxing_image_preview_title_fmt,
String.valueOf(++mPos), String.valueOf(totalCount)));
mNeedAllCount = false;
}
loadOtherPagesInAlbum(totalCount);
}
示例9: getView
import com.jess.arms.R; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
String data= mDatas.get(position);
Holder holder=null;
View view =convertView;
if(view==null){
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
view=inflater.inflate(R.layout.item_alertbutton, null);
holder=creatHolder(view);
view.setTag(holder);
}
else{
holder=(Holder) view.getTag();
}
holder.UpdateUI(parent.getContext(),data,position);
return view;
}
示例10: onClick
import com.jess.arms.R; //导入依赖的package包/类
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.choose_ok_btn) {
onFinish(mMediaAdapter.getSelectedMedias());
} else if (id == R.id.choose_preview_btn) {
if (!mIsPreview) {
mIsPreview = true;
ArrayList<BaseMedia> medias = (ArrayList<BaseMedia>) mMediaAdapter.getSelectedMedias();
Boxing.get().withIntent(getActivity(), BoxingViewActivity.class, medias)
.start(this, BoxingViewFragment.IMAGE_PREVIEW_REQUEST_CODE, BoxingConfig.ViewMode.PRE_EDIT);
}
}
}
示例11: showLoading
import com.jess.arms.R; //导入依赖的package包/类
public LoadingView showLoading(CharSequence msg, boolean cancleabl) {
mDialog = new Dialog(mContext);// TODO: 2017/8/28 内存泄露时这里也修改为弱引用
mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
rootView = View.inflate(mContext, R.layout.dialogui_loading_horizontal, null);
mLinearLayout = (LinearLayout) rootView.findViewById(R.id.dialogui_ll_bg);
mProgressBar = (ProgressBar) rootView.findViewById(R.id.pb_bg);
mTextView = (TextView) rootView.findViewById(R.id.dialogui_tv_msg);
mTextView.setText(msg);
mLinearLayout.setBackgroundResource(R.drawable.dialogui_shape_wihte_round_corner);
mProgressBar.setIndeterminateDrawable(mContext.getResources().getDrawable(R.drawable.dialogui_shape_progress));
mTextView.setTextColor(mContext.getResources().getColor(R.color.text_black));
mDialog.setContentView(rootView);
if (mDialog != null) {
if (mDialog.isShowing()) {
mDialog.dismiss();
}
mDialog.setCancelable(cancleabl);
mDialog.setOnCancelListener(this);
mDialog.show();
}
return this;
}
示例12: buildByType
import com.jess.arms.R; //导入依赖的package包/类
private void buildByType(BuildBean bean) {
Dialog dialog = new Dialog(bean.mContext);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
bean.dialog = dialog;
View root = View.inflate(bean.mContext, R.layout.dialogui_loading_horizontal, null);
View llBg = (View) root.findViewById(R.id.dialogui_ll_bg);
ProgressBar pbBg = (ProgressBar) root.findViewById(R.id.pb_bg);
TextView tvMsg = (TextView) root.findViewById(R.id.dialogui_tv_msg);
tvMsg.setText(bean.msg);
if (bean.isWhiteBg) {
llBg.setBackgroundResource(R.drawable.dialogui_shape_wihte_round_corner);
pbBg.setIndeterminateDrawable(bean.mContext.getResources().getDrawable(R.drawable.dialogui_shape_progress));
tvMsg.setTextColor(bean.mContext.getResources().getColor(R.color.text_black));
} else {
llBg.setBackgroundResource(R.drawable.dialogui_shape_gray_round_corner);
pbBg.setIndeterminateDrawable(bean.mContext.getResources().getDrawable(R.drawable.dialogui_shape_progress_light));
tvMsg.setTextColor(Color.WHITE);
}
bean.dialog.setContentView(root);
}
示例13: CircleImageView
import com.jess.arms.R; //导入依赖的package包/类
public CircleImageView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
super.setScaleType(SCALE_TYPE);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView, defStyle, 0);
mBorderWidth = a.getDimensionPixelSize(R.styleable.CircleImageView_border_width, DEFAULT_BORDER_WIDTH);
mBorderColor = a.getColor(R.styleable.CircleImageView_border_color, Color.WHITE);
a.recycle();
mReady = true;
if (mSetupPending) {
setup();
mSetupPending = false;
}
}
示例14: onBindViewHolder
import com.jess.arms.R; //导入依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
final AlbumViewHolder albumViewHolder = (AlbumViewHolder) holder;
albumViewHolder.mCoverImg.setImageResource(mDefaultRes);
final int adapterPos = holder.getAdapterPosition();
final AlbumEntity album = mAlums.get(adapterPos);
if (album != null && album.hasImages()) {
albumViewHolder.mNameTxt.setText(album.mBucketName);
ImageMedia media = (ImageMedia) album.mImageList.get(0);
if (media != null) {
BoxingMediaLoader.getInstance().displayThumbnail(albumViewHolder.mCoverImg, media.getPath(), 50, 50);
}
albumViewHolder.mLayout.setTag(adapterPos);
albumViewHolder.mLayout.setOnClickListener(this);
albumViewHolder.mCheckedImg.setVisibility(album.mIsSelected ? View.VISIBLE : View.GONE);
albumViewHolder.mSizeTxt.setText(albumViewHolder.mSizeTxt.
getResources().getString(R.string.boxing_album_images_fmt, album.mCount));
} else {
albumViewHolder.mNameTxt.setText(UNKNOW_ALBUM_NAME);
albumViewHolder.mSizeTxt.setVisibility(View.GONE);
}
}
示例15: onBindViewHolder
import com.jess.arms.R; //导入依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
if (holder instanceof CameraViewHolder) {
CameraViewHolder viewHolder = (CameraViewHolder) holder;
viewHolder.mCameraLayout.setOnClickListener(mOnCameraClickListener);
viewHolder.mCameraImg.setImageResource(BoxingResHelper.getCameraRes());
} else {
int pos = position - mOffset;
final BaseMedia media = mMedias.get(pos);
final ImageViewHolder vh = (ImageViewHolder) holder;
vh.mItemLayout.setImageRes(mDefaultRes);
vh.mItemLayout.setTag(media);
vh.mItemLayout.setOnClickListener(mOnMediaClickListener);
vh.mItemLayout.setTag(R.id.media_item_check, pos);
vh.mItemLayout.setMedia(media);
vh.mItemChecked.setVisibility(mMultiImageMode ? View.VISIBLE : View.GONE);
if (mMultiImageMode && media instanceof ImageMedia) {
vh.mItemLayout.setChecked(((ImageMedia) media).isSelected());
vh.mItemChecked.setTag(R.id.media_layout, vh.mItemLayout);
vh.mItemChecked.setTag(media);
vh.mItemChecked.setOnClickListener(mOnCheckListener);
}
}
}