本文整理汇总了Java中it.neokree.materialnavigationdrawer.util.Utils类的典型用法代码示例。如果您正苦于以下问题:Java Utils类的具体用法?Java Utils怎么用?Java Utils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Utils类属于it.neokree.materialnavigationdrawer.util包,在下文中一共展示了Utils类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: select
import it.neokree.materialnavigationdrawer.util.Utils; //导入依赖的package包/类
public void select() {
isSelected = true;
if(!rippleAnimationSupport())
view.setBackgroundColor(colorSelected);
else
ripple.setRippleBackground(colorSelected);
if(hasSectionColor) {
text.setTextColor(sectionColor);
if(icon != null && !realColor) {
icon.setColorFilter(sectionColor);
Utils.setAlpha(icon, 1f);
}
}
}
示例2: unSelect
import it.neokree.materialnavigationdrawer.util.Utils; //导入依赖的package包/类
public void unSelect() {
isSelected = false;
if(!rippleAnimationSupport()) {
view.setBackgroundColor(colorUnpressed);
}
else {
ripple.setRippleBackground(colorUnpressed);
}
if (hasSectionColor) {
text.setTextColor(textColor);
if (icon != null && !realColor) {
icon.setColorFilter(iconColor);
Utils.setAlpha(icon, 0.54f);
}
}
}
示例3: afterClick
import it.neokree.materialnavigationdrawer.util.Utils; //导入依赖的package包/类
private void afterClick() {
isSelected = true;
if (hasSectionColor) {
text.setTextColor(sectionColor);
if (icon != null && !realColor) {
icon.setColorFilter(sectionColor);
Utils.setAlpha(icon, 1f);
}
}
if (listener != null)
listener.onClick(this);
// se la sezione ha come target l'activity, dopo che questa viene avviata si deseleziona.
if(this.getTarget() == TARGET_ACTIVITY)
this.unSelect();
// si fa arrivare il click anche allo sviluppatore
if (this.getTarget() == TARGET_LISTENER && targetListener != null)
this.targetListener.onClick(this);
}
示例4: doInBackground
import it.neokree.materialnavigationdrawer.util.Utils; //导入依赖的package包/类
@Override
protected BitmapDrawable doInBackground(Integer... params) {
Point photoSize = Utils.getUserPhotoSize(resources);
Bitmap photo = Utils.resizeBitmapFromResource(resources,params[0],photoSize.x,photoSize.y);
circularPhoto = new BitmapDrawable(resources,Utils.getCroppedBitmapDrawable(photo));
return new BitmapDrawable(resources,photo);
}
示例5: useRealColor
import it.neokree.materialnavigationdrawer.util.Utils; //导入依赖的package包/类
public MaterialSection useRealColor() {
realColor = true;
if(icon != null) {
Utils.setAlpha(icon,1f);
}
return this;
}
示例6: recycle
import it.neokree.materialnavigationdrawer.util.Utils; //导入依赖的package包/类
public void recycle() {
Utils.recycleDrawable(photo);
Utils.recycleDrawable(circularPhoto);
Utils.recycleDrawable(background);
}
示例7: MaterialSubheader
import it.neokree.materialnavigationdrawer.util.Utils; //导入依赖的package包/类
public MaterialSubheader(Context ctx) {
float density = ctx.getResources().getDisplayMetrics().density;
// create layout
LinearLayout layout = new LinearLayout(ctx);
layout.setOrientation(LinearLayout.VERTICAL);
// inflate the line
View view = new View(ctx);
view.setBackgroundColor(Color.parseColor("#8f8f8f"));
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,1);
params.setMargins(0,(int) (8 * density), 0 , (int) (8 * density));
layout.addView(view,params);
// inflate the text
text = new TextView(ctx);
Utils.setAlpha(text,0.54f);
text.setTextSize(TypedValue.COMPLEX_UNIT_SP,14);
text.setGravity(Gravity.START);
LinearLayout.LayoutParams paramsText = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
paramsText.setMargins((int) (16 * density),0, (int) (16 * density) , (int) (4 * density));
layout.addView(text,paramsText);
this.view = layout;
// get attributes from current theme
Resources.Theme theme = ctx.getTheme();
TypedValue typedValue = new TypedValue();
theme.resolveAttribute(R.attr.sectionStyle,typedValue,true);
TypedArray values = theme.obtainStyledAttributes(typedValue.resourceId,R.styleable.MaterialSection);
try {
titleColor = values.getColor(R.styleable.MaterialSubheader_subheaderTitleColor,0x000);
}
finally {
values.recycle();
}
// set attributes to the view
text.setTextColor(Color.BLACK);
}
示例8: deviceSupportMultiPane
import it.neokree.materialnavigationdrawer.util.Utils; //导入依赖的package包/类
private boolean deviceSupportMultiPane() {
if(multiPaneSupport && resources.getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE && Utils.isTablet(resources))
return true;
else
return false;
}
示例9: deviceSupportMultiPane
import it.neokree.materialnavigationdrawer.util.Utils; //导入依赖的package包/类
/**
* Checks if the current orientation is {@link Configuration#ORIENTATION_LANDSCAPE} and the
* current device is a tablet. This method suppose that <code>multipaneSupport</code> for
* the current theme is <code>true</code>.
* @return
*/
private boolean deviceSupportMultiPane() {
final Resources resources = getResources();
return resources.getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE &&
Utils.isTablet(resources);
}