本文整理汇总了Java中com.hyphenate.util.DensityUtil类的典型用法代码示例。如果您正苦于以下问题:Java DensityUtil类的具体用法?Java DensityUtil怎么用?Java DensityUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DensityUtil类属于com.hyphenate.util包,在下文中一共展示了DensityUtil类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addTab
import com.hyphenate.util.DensityUtil; //导入依赖的package包/类
/**
* add tab
* @param icon
*/
public void addTab(int icon){
View tabView = View.inflate(context, R.layout.ease_scroll_tab_item, null);
ImageView imageView = (ImageView) tabView.findViewById(R.id.iv_icon);
imageView.setImageResource(icon);
int tabWidth = 60;
LinearLayout.LayoutParams imgParams = new LinearLayout.LayoutParams(DensityUtil.dip2px(context, tabWidth), LayoutParams.MATCH_PARENT);
imageView.setLayoutParams(imgParams);
tabContainer.addView(tabView);
tabList.add(imageView);
final int position = tabList.size() -1;
imageView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if(itemClickListener != null){
itemClickListener.onItemClick(position);
}
}
});
}
开发者ID:Vicent9920,项目名称:FanChat,代码行数:25,代码来源:EaseEmojiconScrollTabBar.java
示例2: addTab
import com.hyphenate.util.DensityUtil; //导入依赖的package包/类
/**
* 添加tab
* @param icon
*/
public void addTab(int icon){
View tabView = View.inflate(context, R.layout.ease_scroll_tab_item, null);
ImageView imageView = (ImageView) tabView.findViewById(R.id.iv_icon);
imageView.setImageResource(icon);
LinearLayout.LayoutParams imgParams = new LinearLayout.LayoutParams(DensityUtil.dip2px(context, tabWidth), LayoutParams.MATCH_PARENT);
imageView.setLayoutParams(imgParams);
tabContainer.addView(tabView);
tabList.add(imageView);
final int position = tabList.size() -1;
imageView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if(itemClickListener != null){
itemClickListener.onItemClick(position);
}
}
});
}
开发者ID:Rabbit00,项目名称:MeifuGO,代码行数:24,代码来源:EaseEmojiconScrollTabBar.java
示例3: addTab
import com.hyphenate.util.DensityUtil; //导入依赖的package包/类
/**
* add tab
* @param icon
*/
public void addTab(int icon){
View tabView = View.inflate(context, R.layout.ease_scroll_tab_item, null);
ImageView imageView = (ImageView) tabView.findViewById(R.id.iv_icon);
imageView.setImageResource(icon);
LinearLayout.LayoutParams imgParams = new LinearLayout.LayoutParams(DensityUtil.dip2px(context, tabWidth), LayoutParams.MATCH_PARENT);
imageView.setLayoutParams(imgParams);
tabContainer.addView(tabView);
tabList.add(imageView);
final int position = tabList.size() -1;
imageView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if(itemClickListener != null){
itemClickListener.onItemClick(position);
}
}
});
}
开发者ID:HyphenateInc,项目名称:Hyphenate-EaseUI-Android,代码行数:24,代码来源:EaseEmojiconScrollTabBar.java
示例4: init
import com.hyphenate.util.DensityUtil; //导入依赖的package包/类
private void init(Context context, AttributeSet attrs){
this.context = context;
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.EaseChatExtendMenu);
int numColumns = ta.getInt(R.styleable.EaseChatExtendMenu_numColumns, 4);
ta.recycle();
setNumColumns(numColumns);
setStretchMode(GridView.STRETCH_COLUMN_WIDTH);
setGravity(Gravity.CENTER_VERTICAL);
setVerticalSpacing(DensityUtil.dip2px(context, 8));
}
开发者ID:turoDog,项目名称:KTalk,代码行数:12,代码来源:EaseChatExtendMenu.java
示例5: init
import com.hyphenate.util.DensityUtil; //导入依赖的package包/类
private void init(){
String st = context.getString(R.string.search_new);
sections= new String[]{st,"A","B","C","D","E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z","#"};
paint = new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setColor(Color.parseColor("#8C8C8C"));
paint.setTextAlign(Align.CENTER);
paint.setTextSize(DensityUtil.sp2px(context, 10));
}
开发者ID:turoDog,项目名称:KTalk,代码行数:9,代码来源:EaseSidebar.java
示例6: init
import com.hyphenate.util.DensityUtil; //导入依赖的package包/类
private void init(Context context, AttributeSet attrs){
this.context = context;
dotHeight = DensityUtil.dip2px(context, dotHeight);
selectedBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.ease_dot_emojicon_selected);
unselectedBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.ease_dot_emojicon_unselected);
setGravity(Gravity.CENTER_HORIZONTAL);
}
开发者ID:turoDog,项目名称:KTalk,代码行数:8,代码来源:EaseEmojiconIndicatorView.java
示例7: init
import com.hyphenate.util.DensityUtil; //导入依赖的package包/类
private void init(Context context, AttributeSet attrs){
this.context = context;
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.EaseChatExtendMenu);
int numColumns = ta.getInt(R.styleable.EaseChatExtendMenu_numColumns, 4);
ta.recycle();
setNumColumns(numColumns);
setStretchMode(GridView.STRETCH_COLUMN_WIDTH);
setGravity(Gravity.CENTER_VERTICAL);
setVerticalSpacing(DensityUtil.dip2px(context, 8));
}
开发者ID:tianyuan168326,项目名称:nono-android,代码行数:12,代码来源:EaseChatExtendMenu.java
示例8: initPaint
import com.hyphenate.util.DensityUtil; //导入依赖的package包/类
private void initPaint() {
mPaint = new Paint();
mPaint.setColor(getResources().getColor(R.color.qq_section_text_color));
mPaint.setTextAlign(Paint.Align.CENTER);
mPaint.setTextSize(DensityUtil.sp2px(getContext(), 10));
}
开发者ID:Vicent9920,项目名称:FanChat,代码行数:7,代码来源:SlideBar.java
注:本文中的com.hyphenate.util.DensityUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论