本文整理汇总了Java中com.zhy.autolayout.utils.AutoUtils类的典型用法代码示例。如果您正苦于以下问题:Java AutoUtils类的具体用法?Java AutoUtils怎么用?Java AutoUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AutoUtils类属于com.zhy.autolayout.utils包,在下文中一共展示了AutoUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUpTabTextSize
import com.zhy.autolayout.utils.AutoUtils; //导入依赖的package包/类
private void setUpTabTextSize(Tab tab)
{
if (mTextSize == NO_VALID || tab.getCustomView() != null) return;
ViewGroup tabGroup = (ViewGroup) getChildAt(0);
ViewGroup tabContainer = (ViewGroup) tabGroup.getChildAt(tab.getPosition());
TextView textView = (TextView) tabContainer.getChildAt(1);
if (AutoUtils.autoed(textView))
{
return;
}
int autoTextSize = 0 ;
if (mTextSizeBaseWidth)
{
autoTextSize = AutoUtils.getPercentWidthSize(mTextSize);
} else
{
autoTextSize = AutoUtils.getPercentHeightSize(mTextSize);
}
textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, autoTextSize);
}
示例2: setUpTabTextSize
import com.zhy.autolayout.utils.AutoUtils; //导入依赖的package包/类
private void setUpTabTextSize(Tab tab) {
if (mTextSize == NO_VALID || tab.getCustomView() != null) return;
ViewGroup tabGroup = (ViewGroup) getChildAt(0);
ViewGroup tabContainer = (ViewGroup) tabGroup.getChildAt(tab.getPosition());
TextView textView = (TextView) tabContainer.getChildAt(1);
if (AutoUtils.autoed(textView)) {
return;
}
int autoTextSize = 0;
if (mTextSizeBaseWidth) {
autoTextSize = AutoUtils.getPercentWidthSize(mTextSize);
} else {
autoTextSize = AutoUtils.getPercentHeightSize(mTextSize);
}
textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, autoTextSize);
}
示例3: getView
import com.zhy.autolayout.utils.AutoUtils; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
ViewHolder holder = null;
if (convertView == null)
{
holder = new ViewHolder();
convertView = LayoutInflater.from(mContext).inflate(R.layout.list_item, parent, false);
convertView.setTag(holder);
//对于listview,注意添加这一行,即可在item上使用高度
AutoUtils.autoSize(convertView);
} else
{
holder = (ViewHolder) convertView.getTag();
}
return convertView;
}
示例4: getView
import com.zhy.autolayout.utils.AutoUtils; //导入依赖的package包/类
@Override
public View getView(FlowLayout parent, int position, Summary.DataBean.TagBean tagBean) {
TextView tv = new TextView(parent.getContext());
int paddingTopAndBottom = 10;
int paddingLeftAndRight = 25;
tv.setPadding(paddingLeftAndRight, paddingTopAndBottom, paddingLeftAndRight, paddingTopAndBottom);
tv.setText(tagBean.getTag_name());
tv.setTextSize(12);
tv.setTextColor(ArmsUtils.getColor(parent.getContext(), R.color.text_title));
tv.setBackgroundResource(R.drawable.shape_tv_tag_video_detail);
AutoUtils.auto(tv);
return tv;
}
示例5: ViewHolder
import com.zhy.autolayout.utils.AutoUtils; //导入依赖的package包/类
public ViewHolder(Context context, ViewGroup parent, int layoutId, int position) {
// TODO Auto-generated constructor stub
this.mPosition = position;
this.mContext = context;
this.mViews = new SparseArray<View>();
this.mConvertView = LayoutInflater.from(context).inflate(layoutId, parent, false);
mConvertView.setTag(this);
//对于listview,注意添加这一行,即可在item上使用高度
AutoUtils.autoSize(mConvertView);
}
示例6: setUpTitleTextSize
import com.zhy.autolayout.utils.AutoUtils; //导入依赖的package包/类
private void setUpTitleTextSize(String name, int val) {
try {
//反射 Toolbar 的 TextView
Field f = getClass().getSuperclass().getDeclaredField(name);
f.setAccessible(true);
TextView textView = (TextView) f.get(this);
if (textView != null) {
int autoTextSize = AutoUtils.getPercentHeightSize(val);
textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, autoTextSize);
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例7: onCreateViewHolder
import com.zhy.autolayout.utils.AutoUtils; //导入依赖的package包/类
@Override
public com.zhy.base.adapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
{
com.zhy.base.adapter.ViewHolder viewHolder = super.onCreateViewHolder(parent, viewType);
AutoUtils.autoSize(viewHolder.getConvertView());
return viewHolder;
}
示例8: ViewHolder
import com.zhy.autolayout.utils.AutoUtils; //导入依赖的package包/类
public ViewHolder(View itemView)
{
super(itemView);
Random random = new Random();
itemView.setBackgroundColor(Color.argb(200, random.nextInt(255), random.nextInt(255), random.nextInt(255)));
//recyclerview,注意添加这一行
AutoUtils.autoSize(itemView, AutoAttr.BASE_HEIGHT);
// Log.e("", itemView.getLayoutParams().width + " , " + itemView.getLayoutParams().height);
}
示例9: MetroLayout
import com.zhy.autolayout.utils.AutoUtils; //导入依赖的package包/类
public MetroLayout(Context context, AttributeSet attrs)
{
super(context, attrs);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.MetroLayout);
mDivider = a.getDimensionPixelOffset(R.styleable.MetroLayout_metro_divider, 0);
mDivider = AutoUtils.getPercentWidthSizeBigger(mDivider);
a.recycle();
}
示例10: BaseAdapterHelper
import com.zhy.autolayout.utils.AutoUtils; //导入依赖的package包/类
protected BaseAdapterHelper(Context context, ViewGroup parent, int layoutId, int position) {
this.context = context;
this.position = position;
this.layoutId = layoutId;
this.views = new SparseArray<View>();
convertView = LayoutInflater.from(context) //
.inflate(layoutId, parent, false);
convertView.setTag(this);
//对于listview,注意添加这一行,即可在item上使用高度
AutoUtils.autoSize(convertView);
}
示例11: BaseViewHolder
import com.zhy.autolayout.utils.AutoUtils; //导入依赖的package包/类
public BaseViewHolder(View view) {
super(view);
this.views = new SparseArray<View>();
this.childClickViewIds = new LinkedHashSet<>();
this.itemChildLongClickViewIds = new LinkedHashSet<>();
convertView = view;
AutoUtils.auto(convertView);
}
示例12: BaseHolder
import com.zhy.autolayout.utils.AutoUtils; //导入依赖的package包/类
public BaseHolder(View itemView) {
super(itemView);
itemView.setOnClickListener(this);//点击事件
AutoUtils.autoSize(itemView);//适配
KnifeUtil.bindTarget(this, itemView);//绑定
}
示例13: BaseHolder
import com.zhy.autolayout.utils.AutoUtils; //导入依赖的package包/类
public BaseHolder(View itemView) {
super(itemView);
itemView.setOnClickListener(this);//点击事件
AutoUtils.autoSize(itemView);//适配
ThirdViewUtil.bindTarget(this, itemView);//绑定
}
示例14: BaseHolder
import com.zhy.autolayout.utils.AutoUtils; //导入依赖的package包/类
public BaseHolder(View itemView) {
super(itemView);
itemView.setOnClickListener(this);//点击事件
if (ThirdViewUtil.USE_AUTOLAYOUT == 1) AutoUtils.autoSize(itemView);//适配
ThirdViewUtil.bindTarget(this, itemView);//绑定
}
示例15: getAutoWidth
import com.zhy.autolayout.utils.AutoUtils; //导入依赖的package包/类
public static int getAutoWidth(boolean autoLayoutEnabled, int width) {
return autoLayoutEnabled ? AutoUtils.getPercentWidthSize(width) : width;
}