本文整理汇总了Java中com.blankj.utilcode.util.SizeUtils类的典型用法代码示例。如果您正苦于以下问题:Java SizeUtils类的具体用法?Java SizeUtils怎么用?Java SizeUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SizeUtils类属于com.blankj.utilcode.util包,在下文中一共展示了SizeUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: showLineraLayoutGroup
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
/**
* 显示是否线性布局时的分组信息
*
* @param helper
* @param isShow 是否显示
* @param time 时间戳
* @describe
*/
private void showLineraLayoutGroup(boolean isShow, BaseViewHolder helper, long time) {
// 有分组的列,marginTop为8dp,否则,为0dp
LinearLayout ll = helper.getView(R.id.ll_note_list_linear);
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) ll.getLayoutParams();
if (isShow) {
helper.setVisible(R.id.tv_note_list_linear_month, true);
setLinearGroupStyle(helper, time);
params.setMargins(SizeUtils.dp2px(0), SizeUtils.dp2px(8), SizeUtils.dp2px(0), SizeUtils.dp2px(0));
ll.setLayoutParams(params);
} else {
helper.setVisible(R.id.tv_note_list_linear_month, false);
params.setMargins(SizeUtils.dp2px(0), SizeUtils.dp2px(0), SizeUtils.dp2px(0), SizeUtils.dp2px(0));
ll.setLayoutParams(params);
}
}
开发者ID:ifadai,项目名称:SuperNote,代码行数:26,代码来源:RvNoteListAdapter.java
示例2: initAttributes
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
@Override
protected void initAttributes() {
setContentView(R.layout.layout_complex, ViewGroup.LayoutParams.MATCH_PARENT, SizeUtils.dp2px(300));
setFocusAndOutsideEnable(false)
.setBackgroundDimEnable(true)
.setDimValue(0.5f);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:ComplexPopup.java
示例3: initAttributes
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
@Override
protected void initAttributes() {
setContentView(R.layout.layout_gift);
setHeight(SizeUtils.dp2px(200));
setWidth(ViewGroup.LayoutParams.MATCH_PARENT);
setFocusAndOutsideEnable(true);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:GiftPopup.java
示例4: onError
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
@Override
public void onError() {
mTvTip.setText("请重试");
ObjectAnimator animator = ObjectAnimator.ofFloat(mTvTip, "translationX", -SizeUtils.dp2px(8), SizeUtils.dp2px(8), 0);
animator.setDuration(200);
animator.start();
}
开发者ID:ifadai,项目名称:SuperNote,代码行数:8,代码来源:LockActivity.java
示例5: getNoteEditNeedHeight
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
@Override
public int getNoteEditNeedHeight() {
// 屏幕高度减去 状态栏高度、toolbar高度、底部工具栏高度
float height = ScreenUtils.getScreenHeight() - ThemeUtils.getStatusBarHeight()
- SizeUtils.dp2px(56) - SizeUtils.dp2px(48);
return (int) height;
}
开发者ID:ifadai,项目名称:SuperNote,代码行数:8,代码来源:EditNotePresenter.java
示例6: getNoteShareBitmap
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
@Override
public Bitmap getNoteShareBitmap(View view) {
Bitmap bitmap = ImageUtils.view2Bitmap(view);
int x = bitmap.getWidth() - SizeUtils.sp2px(72);
int y = bitmap.getHeight() - SizeUtils.sp2px(16);
int textWaterMarkColor = Utils.getContext().getResources().getColor(R.color.colorBlackAlpha54);
bitmap = ImageUtils.addTextWatermark(bitmap, EditNoteConstans.watermarkText, 24, textWaterMarkColor, x, y);
return bitmap;
}
开发者ID:ifadai,项目名称:SuperNote,代码行数:10,代码来源:EditNotePresenter.java
示例7: hideAddFab
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
@Override
public void hideAddFab() {
ObjectAnimator animator = ObjectAnimator.ofFloat(mFabAdd, "translationY", SizeUtils.dp2px(80));
animator.setDuration(150);
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mFabAdd.setVisibility(View.GONE);
}
});
animator.start();
}
开发者ID:ifadai,项目名称:SuperNote,代码行数:13,代码来源:NoteMainActivity.java
示例8: hideBottomBar
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
@Override
public void hideBottomBar() {
// 下移动画
ObjectAnimator animator = ObjectAnimator.ofFloat(mRlBottomBar, "translationY", SizeUtils.dp2px(56));
animator.setDuration(300);
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mRlBottomBar.setVisibility(View.GONE);
}
});
animator.start();
}
开发者ID:ifadai,项目名称:SuperNote,代码行数:14,代码来源:NoteMainActivity.java
示例9: showBottomBar
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
@Override
public void showBottomBar() {
mRlBottomBar.setVisibility(View.VISIBLE);
// bottombar进行一个上移的动画
ObjectAnimator animator = ObjectAnimator.ofFloat(mRlBottomBar, "translationY", SizeUtils.dp2px(56), 0);
animator.setDuration(300);
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
}
});
animator.start();
}
开发者ID:ifadai,项目名称:SuperNote,代码行数:14,代码来源:NoteMainActivity.java
示例10: showToolbarAndBottomBar
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
private void showToolbarAndBottomBar() {
mIsToolbarAndBottomBarHided = false;
ObjectAnimator animator = ObjectAnimator.ofFloat(mAppBarLayout, "translationY", -SizeUtils.dp2px(56), 0);
animator.setDuration(300);
animator.start();
ObjectAnimator animator1 = ObjectAnimator.ofFloat(mLlBottomBar, "translationY", SizeUtils.dp2px(56), 0);
animator1.setDuration(300);
animator1.start();
}
开发者ID:ifadai,项目名称:SuperNote,代码行数:12,代码来源:ImageInfoActivity.java
示例11: hideToolbarAndBottomBar
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
private void hideToolbarAndBottomBar() {
mIsToolbarAndBottomBarHided = true;
ObjectAnimator animator = ObjectAnimator.ofFloat(mAppBarLayout, "translationY", 0, -SizeUtils.dp2px(56));
animator.setDuration(300);
animator.start();
ObjectAnimator animator1 = ObjectAnimator.ofFloat(mLlBottomBar, "translationY", 0, SizeUtils.dp2px(56));
animator1.setDuration(300);
animator1.start();
}
开发者ID:ifadai,项目名称:SuperNote,代码行数:12,代码来源:ImageInfoActivity.java
示例12: getIcFolderSelectedDrawable
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
public static GradientDrawable getIcFolderSelectedDrawable( int color){
GradientDrawable gradientDrawable=new GradientDrawable();
gradientDrawable.setShape(GradientDrawable.OVAL);
gradientDrawable.setSize(SizeUtils.dp2px(24), SizeUtils.dp2px(24));
gradientDrawable.setBounds(0,0,SizeUtils.dp2px(24), SizeUtils.dp2px(24));
gradientDrawable.setColor(color);
return gradientDrawable;
}
开发者ID:ifadai,项目名称:SuperNote,代码行数:9,代码来源:MyDrawable.java
示例13: measureDimension
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
private void measureDimension(int widthMeasureSpec,int heightMeasureSpec){
// 测量的值
int measureWidth=0;
int measureHeight=0;
// 默认值
int defaultSize=400;
int widthSpecMode= MeasureSpec.getMode(widthMeasureSpec);
int heightSpcMode= MeasureSpec.getMode(heightMeasureSpec);
int widthSpecSize= MeasureSpec.getSize(widthMeasureSpec);
int heightSpecSize= MeasureSpec.getSize(heightMeasureSpec);
switch (widthSpecMode){
case MeasureSpec.EXACTLY:
measureWidth=widthSpecSize;
break;
case MeasureSpec.UNSPECIFIED:
measureWidth=SizeUtils.dp2px(defaultSize);
break;
case MeasureSpec.AT_MOST:
measureWidth= Math.min(widthSpecSize,defaultSize);
break;
}
switch (heightSpcMode){
case MeasureSpec.EXACTLY:
measureHeight=heightSpecSize;
break;
case MeasureSpec.UNSPECIFIED:
measureHeight=SizeUtils.dp2px(defaultSize);
break;
case MeasureSpec.AT_MOST:
// 为了让解锁界面为方形,让高的值和宽一样。
measureHeight=measureWidth;
break;
}
setMeasuredDimension(measureWidth,measureHeight);
}
开发者ID:ifadai,项目名称:SuperNote,代码行数:38,代码来源:LockView.java
示例14: drawCorcle
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
private void drawCorcle(Canvas canvas){
Paint paint=new Paint();
paint.setColor(backgroundColor);
// 绘制圆形
canvas.drawCircle(getMeasuredWidth()/2,getMeasuredHeight()/2, SizeUtils.dp2px(20),paint);
// 绘制对勾
if(isChecked()){
Bitmap bitmap = BitmapFactory.decodeResource(this.getContext().getResources(), R.drawable.ic_check_white_24dp);
canvas.drawBitmap(bitmap,getMeasuredWidth()/2-SizeUtils.dp2px(12),getMeasuredHeight()/2-SizeUtils.dp2px(12),paint);
}
}
开发者ID:ifadai,项目名称:SuperNote,代码行数:14,代码来源:ThemeChoiceRadioButton.java
示例15: showQQPop
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
private void showQQPop(View view) {
mQQPop.showAtAnchorView(view, VerticalGravity.BELOW, HorizontalGravity.LEFT, SizeUtils.dp2px(30), 0);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:EasyPopActivity.java
示例16: setAddFabOut
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
@Override
public void setAddFabOut() {
ObjectAnimator animator = ObjectAnimator.ofFloat(mFabAdd, "translationY", SizeUtils.dp2px(80));
animator.setDuration(150);
animator.start();
}
开发者ID:ifadai,项目名称:SuperNote,代码行数:7,代码来源:NoteMainActivity.java
示例17: setAddFabIn
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
@Override
public void setAddFabIn() {
ObjectAnimator animator = ObjectAnimator.ofFloat(mFabAdd, "translationY", SizeUtils.dp2px(0));
animator.setDuration(150);
animator.start();
}
开发者ID:ifadai,项目名称:SuperNote,代码行数:7,代码来源:NoteMainActivity.java
示例18: hideAddBtn
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
@Override
public void hideAddBtn() {
ObjectAnimator animator= ObjectAnimator.ofFloat(mFabAdd,"translationY", SizeUtils.dp2px(80));
animator.setDuration(150);
animator.start();
}
开发者ID:ifadai,项目名称:SuperNote,代码行数:7,代码来源:FolderActivity.java
示例19: showAddBtn
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
@Override
public void showAddBtn() {
ObjectAnimator animator= ObjectAnimator.ofFloat(mFabAdd,"translationY", SizeUtils.dp2px(0));
animator.setDuration(150);
animator.start();
}
开发者ID:ifadai,项目名称:SuperNote,代码行数:7,代码来源:FolderActivity.java
示例20: setItemData
import com.blankj.utilcode.util.SizeUtils; //导入依赖的package包/类
/**
* 橱窗展示UI
*
* @param holder
* @param position
* @param homeProductBean
* @R.layout.window_item
*/
public static void setItemData(final WindowHolder holder, final int position, final HomeProductBean homeProductBean) {
String quan_price = homeProductBean.getQuan_price();
/**
* @过期了
*/
if (isOutOfDate(homeProductBean)) {
holder.stateQlj.setVisibility(View.GONE);
holder.oldprice.setVisibility(View.GONE);
holder.quanFlag.setVisibility(View.GONE);
ItemUtils.showPrice(holder.oldprice, homeProductBean.getTb_big_price());
}
/**
* @没过期
*/
else {
holder.stateQlj.setVisibility(View.VISIBLE);
holder.stateQlj.setText("券立减 " + quan_price);
if (flags == 0) {
flags = holder.oldprice.getPaint().getFlags();
}
holder.oldprice.getPaint().setFlags(flags | Paint.STRIKE_THRU_TEXT_FLAG);
holder.oldprice.setVisibility(View.VISIBLE);
holder.quanFlag.setVisibility(View.VISIBLE);
ItemUtils.showPrice(holder.oldprice, homeProductBean.getTb_big_price());
ItemUtils.showPrice(holder.newprice, homeProductBean.getPrice());
}
/***
* @商品名称
*/
holder.titleName.setText(homeProductBean.getName());
/***
* @上新标签
*/
if (isToday(homeProductBean.getTb_addtime())) {
holder.stateNew.setVisibility(View.VISIBLE);
} else {
holder.stateNew.setVisibility(View.GONE);
}
/***
* @来源标签
*/
holder.stateFrom.setText(getFrom(homeProductBean.getTb_type(), homeProductBean.getTb_is_tmall()));
/**
* @已售标签
*/
holder.soldnum.setText("已售 " + homeProductBean.getTb_sale() + " 件");
/***
* @设置padding
*/
if (padding == 0) {
padding = (int) (SizeUtils.dp2px(14));
}
if (position % 2 == 0)
holder.itemView.setPadding(padding, padding, padding / 2, 0);
else
holder.itemView.setPadding(padding / 2, padding, padding, 0);
}
开发者ID:While1true,项目名称:JSSample,代码行数:81,代码来源:ItemUtils.java
注:本文中的com.blankj.utilcode.util.SizeUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论