本文整理汇总了Java中com.blankj.utilcode.util.SizeUtils类的典型用法代码示例。如果您正苦于以下问题:Java SizeUtils类的具体用法?Java SizeUtils怎么用?Java SizeUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SizeUtils类属于com.blankj.utilcode.util包,在下文中一共展示了SizeUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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);
}
示例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);
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
}