当前位置: 首页>>代码示例>>Java>>正文


Java Views类代码示例

本文整理汇总了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();
    }
}
 
开发者ID:alexvasilkov,项目名称:GestureViews,代码行数:21,代码来源:DemoActivity.java

示例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();
}
 
开发者ID:alexvasilkov,项目名称:GestureViews,代码行数:11,代码来源:BaseActivity.java

示例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);
}
 
开发者ID:alexvasilkov,项目名称:GestureViews,代码行数:14,代码来源:DemoActivity.java

示例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;
        }
    }
}
 
开发者ID:alexvasilkov,项目名称:GestureViews,代码行数:13,代码来源:DecorUtils.java

示例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);
}
 
开发者ID:alexvasilkov,项目名称:GestureViews,代码行数:8,代码来源:ListAdapter.java

示例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);
}
 
开发者ID:alexvasilkov,项目名称:GestureViews,代码行数:8,代码来源:LayoutsPagerAdapter.java

示例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) {
                }
            }
    );
}
 
开发者ID:alexvasilkov,项目名称:AndroidCommons,代码行数:14,代码来源:MainActivity.java

示例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());
    }
}
 
开发者ID:alexvasilkov,项目名称:GestureViews,代码行数:6,代码来源:DecorUtils.java

示例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());
    }
}
 
开发者ID:alexvasilkov,项目名称:GestureViews,代码行数:6,代码来源:DecorUtils.java

示例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;
}
 
开发者ID:alexvasilkov,项目名称:GestureViews,代码行数:5,代码来源:PhotoListAdapter.java

示例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);
}
 
开发者ID:alexvasilkov,项目名称:GestureViews,代码行数:6,代码来源:PhotoPagerAdapter.java

示例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);
}
 
开发者ID:alexvasilkov,项目名称:GestureViews,代码行数:5,代码来源:DefaultEndlessRecyclerAdapter.java

示例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());
}
 
开发者ID:alexvasilkov,项目名称:GestureViews,代码行数:6,代码来源:DefaultEndlessRecyclerAdapter.java

示例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);
}
 
开发者ID:alexvasilkov,项目名称:GestureViews,代码行数:6,代码来源:ListAdapter.java

示例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);
}
 
开发者ID:alexvasilkov,项目名称:GestureViews,代码行数:6,代码来源:RecyclerAdapter.java


注:本文中的com.alexvasilkov.android.commons.ui.Views类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。