本文整理汇总了Java中in.srain.cube.util.LocalDisplay类的典型用法代码示例。如果您正苦于以下问题:Java LocalDisplay类的具体用法?Java LocalDisplay怎么用?Java LocalDisplay使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LocalDisplay类属于in.srain.cube.util包,在下文中一共展示了LocalDisplay类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupList
import in.srain.cube.util.LocalDisplay; //导入依赖的package包/类
protected void setupList() {
mSize = (LocalDisplay.SCREEN_WIDTH_PIXELS - LocalDisplay.dp2px(25 + 5 + 5)) / 3;
int horizontalSpacing = LocalDisplay.dp2px(5);
int verticalSpacing = LocalDisplay.dp2px(10.5f);
mBlockListView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(View v, int position) {
MenuItemInfo itemInfo = mBlockListAdapter.getItem(position);
if (itemInfo != null) {
itemInfo.onClick(v);
}
}
});
mBlockListAdapter.setSpace(horizontalSpacing, verticalSpacing);
mBlockListAdapter.setBlockSize(mSize, mSize);
mBlockListAdapter.setColumnNum(3);
mBlockListView.setAdapter(mBlockListAdapter);
mBlockListAdapter.displayBlocks(mItemInfos);
}
示例2: createView
import in.srain.cube.util.LocalDisplay; //导入依赖的package包/类
@Override
public View createView(LayoutInflater layoutInflater, int position) {
View view = layoutInflater.inflate(R.layout.view_pager_indicator_item, null);
view.setLayoutParams(new AbsListView.LayoutParams(LocalDisplay.dp2px(40), -1));
mNameView = (TextView) view.findViewById(R.id.view_pager_indicator_name);
mTagView = view.findViewById(R.id.view_pager_indicator_tab_current);
return view;
}
示例3: createSimpleLoadingTip
import in.srain.cube.util.LocalDisplay; //导入依赖的package包/类
public static View createSimpleLoadingTip(Context context) {
final View view = LayoutInflater.from(context).inflate(R.layout.cube_ptr_simple_loading, null);
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(-2, -2);
lp.setMargins(0, 0, 0, LocalDisplay.dp2px(4));
lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
lp.addRule(RelativeLayout.CENTER_VERTICAL);
view.setLayoutParams(lp);
view.setVisibility(View.INVISIBLE);
return view;
}
示例4: Cube
import in.srain.cube.util.LocalDisplay; //导入依赖的package包/类
private Cube(Application application) {
mApplication = application;
// local display
LocalDisplay.init(application);
// network status
NetworkStatusManager.init(application);
}