當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。