本文整理汇总了Java中com.alexvasilkov.android.commons.ui.Views类的典型用法代码示例。如果您正苦于以下问题:Java Views类的具体用法?Java Views怎么用?Java Views使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Views类属于com.alexvasilkov.android.commons.ui包,在下文中一共展示了Views类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveScreenState
import com.alexvasilkov.android.commons.ui.Views; //导入依赖的package包/类
/**
* Saves current screen state: whether we are in a full image mode or not, as well as current
* grid position. So that we can restore UI on configuration change.
*/
private void saveScreenState() {
clearScreenState();
savedPhotoCount = gridAdapter.getCount();
savedPagerPosition = listAnimator.isLeaving() || pagerAdapter.getCount() == 0
? NO_POSITION : views.pager.getCurrentItem();
if (views.grid.getChildCount() > 0) {
View child = views.grid.getChildAt(0);
savedGridPosition = views.grid.getChildAdapterPosition(child);
savedGridPositionFromTop = child.getTop()
- Views.getMarginParams(child).topMargin
- views.grid.getPaddingTop();
}
}
示例2: showInfoDialog
import com.alexvasilkov.android.commons.ui.Views; //导入依赖的package包/类
private void showInfoDialog() {
final View layout = Views.inflate(this, R.layout.info_dialog);
final TextView text = layout.findViewById(R.id.info_text);
text.setText(getText(infoTextId));
new AlertDialog.Builder(this)
.setView(layout)
.setPositiveButton(android.R.string.ok, null)
.show();
}
示例3: initDecorMargins
import com.alexvasilkov.android.commons.ui.Views; //导入依赖的package包/类
/**
* Adjusting margins and paddings to fit translucent decor.
*/
private void initDecorMargins() {
if (DecorUtils.isCanHaveTransparentDecor()) {
Views.getParams(views.appBar).height += DecorUtils.getStatusBarHeight(this);
}
DecorUtils.paddingForStatusBar(views.toolbar, true);
DecorUtils.paddingForStatusBar(views.pagerToolbar, true);
DecorUtils.paddingForStatusBar(views.fullImageToolbar, true);
DecorUtils.paddingForNavBar(views.grid);
DecorUtils.marginForNavBar(views.pagerTitle);
}
示例4: paddingForStatusBar
import com.alexvasilkov.android.commons.ui.Views; //导入依赖的package包/类
public static void paddingForStatusBar(View view, boolean isFixedSize) {
if (isCanHaveTransparentDecor()) {
int height = getStatusBarHeight(view.getContext());
view.setPadding(view.getPaddingLeft(), view.getPaddingTop() + height,
view.getPaddingRight(), view.getPaddingBottom());
if (isFixedSize) {
Views.getParams(view).height += height;
}
}
}
示例5: ImagesViewHolder
import com.alexvasilkov.android.commons.ui.Views; //导入依赖的package包/类
ImagesViewHolder(ViewGroup parent) {
super(Views.inflate(parent, R.layout.complex_list_item_images));
row = itemView.findViewById(R.id.complex_item_row);
images[0] = itemView.findViewById(R.id.complex_item_image_1);
images[1] = itemView.findViewById(R.id.complex_item_image_2);
count = itemView.findViewById(R.id.complex_item_count);
}
示例6: ViewHolder
import com.alexvasilkov.android.commons.ui.Views; //导入依赖的package包/类
ViewHolder(ViewGroup container) {
super(Views.inflate(container, R.layout.layout_pager_item));
layout = itemView.findViewById(R.id.frame_item_layout);
image = layout.findViewById(R.id.frame_item_image);
title = layout.findViewById(R.id.frame_item_title);
button = layout.findViewById(R.id.frame_item_button);
}
示例7: onCreate
import com.alexvasilkov.android.commons.ui.Views; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Views.find(this, R.id.test).setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
}
}
);
}
示例8: marginForStatusBar
import com.alexvasilkov.android.commons.ui.Views; //导入依赖的package包/类
public static void marginForStatusBar(View view) {
if (isCanHaveTransparentDecor()) {
Views.getMarginParams(view).topMargin += getStatusBarHeight(view.getContext());
}
}
示例9: marginForNavBar
import com.alexvasilkov.android.commons.ui.Views; //导入依赖的package包/类
public static void marginForNavBar(View view) {
if (isCanHaveTransparentDecor()) {
Views.getMarginParams(view).bottomMargin += getNavBarHeight(view.getContext());
}
}
示例10: ViewHolder
import com.alexvasilkov.android.commons.ui.Views; //导入依赖的package包/类
ViewHolder(ViewGroup parent) {
super(Views.inflate(parent, R.layout.demo_item_photo));
image = (ImageView) itemView;
}
示例11: ViewHolder
import com.alexvasilkov.android.commons.ui.Views; //导入依赖的package包/类
ViewHolder(ViewGroup parent) {
super(Views.inflate(parent, R.layout.demo_item_photo_full));
image = itemView.findViewById(R.id.photo_full_image);
progress = itemView.findViewById(R.id.photo_full_progress);
}
示例12: LoadingViewHolder
import com.alexvasilkov.android.commons.ui.Views; //导入依赖的package包/类
LoadingViewHolder(ViewGroup parent) {
super(Views.inflate(parent, R.layout.demo_item_extra_loading));
loading = itemView.findViewById(R.id.extra_loading_text);
}
示例13: ErrorViewHolder
import com.alexvasilkov.android.commons.ui.Views; //导入依赖的package包/类
ErrorViewHolder(ViewGroup parent, final EndlessRecyclerAdapter<?> adapter) {
super(Views.inflate(parent, R.layout.demo_item_extra_error));
error = itemView.findViewById(R.id.extra_error);
error.setOnClickListener(view -> adapter.reloadNextItemsIfError());
}
示例14: ViewHolder
import com.alexvasilkov.android.commons.ui.Views; //导入依赖的package包/类
ViewHolder(ViewGroup parent) {
itemView = Views.inflate(parent, R.layout.list_image_item);
image = itemView.findViewById(R.id.list_image);
title = itemView.findViewById(R.id.list_image_title);
}
示例15: ViewHolder
import com.alexvasilkov.android.commons.ui.Views; //导入依赖的package包/类
ViewHolder(ViewGroup parent) {
super(Views.inflate(parent, R.layout.list_image_item));
image = itemView.findViewById(R.id.list_image);
title = itemView.findViewById(R.id.list_image_title);
}