當前位置: 首頁>>代碼示例>>Java>>正文


Java ViewStub.setVisibility方法代碼示例

本文整理匯總了Java中android.view.ViewStub.setVisibility方法的典型用法代碼示例。如果您正苦於以下問題:Java ViewStub.setVisibility方法的具體用法?Java ViewStub.setVisibility怎麽用?Java ViewStub.setVisibility使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.ViewStub的用法示例。


在下文中一共展示了ViewStub.setVisibility方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createGraphObjectView

import android.view.ViewStub; //導入方法依賴的package包/類
protected View createGraphObjectView(T graphObject) {
    View result = inflater.inflate(getGraphObjectRowLayoutId(graphObject), null);

    ViewStub checkboxStub = (ViewStub) result.findViewById(R.id.com_facebook_picker_checkbox_stub);
    if (checkboxStub != null) {
        if (!getShowCheckbox()) {
            checkboxStub.setVisibility(View.GONE);
        } else {
            CheckBox checkBox = (CheckBox) checkboxStub.inflate();
            updateCheckboxState(checkBox, false);
        }
    }

    ViewStub profilePicStub = (ViewStub) result.findViewById(R.id.com_facebook_picker_profile_pic_stub);
    if (!getShowPicture()) {
        profilePicStub.setVisibility(View.GONE);
    } else {
        ImageView imageView = (ImageView) profilePicStub.inflate();
        imageView.setVisibility(View.VISIBLE);
    }

    return result;
}
 
開發者ID:MobileDev418,項目名稱:AndroidBackendlessChat,代碼行數:24,代碼來源:GraphObjectAdapter.java

示例2: showAlternativeView

import android.view.ViewStub; //導入方法依賴的package包/類
void showAlternativeView(int viewType) {
    FrameLayout recyclerFrame = findViewById(R.id.recycler_frame);
    recyclerFrame.setVisibility(View.GONE);
    mShowCancelAll = false;

    switch (viewType) {
        case ZERO_DOWNLOAD_TYPE:
            ViewStub zeroView = findViewById(R.id.zero_downloads);
            zeroView.setVisibility(View.VISIBLE);
            break;
        case FINISHED_DOWNLOAD_TYPE:
            ViewStub finishedView = findViewById(R.id.finished_downloads);
            finishedView.setVisibility(View.VISIBLE);


            break;
        case CANCELLED_DOWNLOAD_TYPE:
            ViewStub cancelledView = findViewById(R.id.cancelled_downloads);
            cancelledView.setVisibility(View.VISIBLE);
            break;

    }
    new Handler().postDelayed(this::finish, 10000);
}
 
開發者ID:fekracomputers,項目名稱:IslamicLibraryAndroid,代碼行數:25,代碼來源:DownloadProgressActivity.java

示例3: onCreateView

import android.view.ViewStub; //導入方法依賴的package包/類
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {

    View view = inflater.inflate(R.layout.fragment_global_user_list, container, false);
    RecyclerView recyclerView = view.findViewById(R.id.recyclerView);
    ViewStub zeroView = view.findViewById(R.id.zero_global_user_notes);

    if ((bookmarkItems.isEmpty() && highlightItems.isEmpty())) {
        recyclerView.setVisibility(View.GONE);
        zeroView.setVisibility(View.VISIBLE);
    } else {
        recyclerView.setAdapter(adapter);
    }
    return view;
}
 
開發者ID:fekracomputers,項目名稱:IslamicLibraryAndroid,代碼行數:17,代碼來源:GlobalUserNotesFragment.java

示例4: onCreateView

import android.view.ViewStub; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_bookmark_list, container, false);

    // Set the adapter
    RecyclerView recyclerView = view.findViewById(R.id.recyclerView);
    ViewStub zeroView = view.findViewById(R.id.zero_bookmarks);

    UserDataDBHelper userDataDBHelper = UserDataDBHelper.getInstance(getContext(), bookId);
    ArrayList<Bookmark> bookmarks = userDataDBHelper.getAllBookmarks(UserDataDBContract.BookmarkEntry.COLUMN_NAME_PAGE_ID);

    if (bookmarks.size() != 0) {
        recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
        recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
        bookmarkRecyclerViewAdapter = new BookmarkRecyclerViewAdapter(bookmarks, mListener, getContext(), userDataDBHelper, getActivity().getPreferences(Context.MODE_PRIVATE));
        bookmarkRecyclerViewAdapter.setHasStableIds(true);
        recyclerView.setAdapter(bookmarkRecyclerViewAdapter);
    } else {
        recyclerView.setVisibility(View.GONE);
        zeroView.setVisibility(View.VISIBLE);
    }

    return view;
}
 
開發者ID:fekracomputers,項目名稱:IslamicLibraryAndroid,代碼行數:26,代碼來源:BookmarkFragment.java

示例5: initViews

import android.view.ViewStub; //導入方法依賴的package包/類
protected void initViews() {
    inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View view = inflater.inflate(R.layout.ultimate_recycler_view_layout, this);
    mRecyclerView = (RecyclerView) view.findViewById(R.id.ultimate_list);
    mSwipeRefreshLayout = (VerticalSwipeRefreshLayout) view.findViewById(R.id.swipe_refresh_layout);
    setScrollbars();
    mSwipeRefreshLayout.setEnabled(false);

    if (mRecyclerView != null) {
        mRecyclerView.setClipToPadding(mClipToPadding);
        if (mPadding != -1.1f) {
            mRecyclerView.setPadding(mPadding, mPadding, mPadding, mPadding);
        } else {
            mRecyclerView.setPadding(mPaddingLeft, mPaddingTop, mPaddingRight, mPaddingBottom);
        }
    }

    defaultFloatingActionButton = (FloatingActionButton) view.findViewById(R.id.defaultFloatingActionButton);
    setDefaultScrollListener();

    /**
     * empty view setup
     */
    mEmpty = (ViewStub) view.findViewById(R.id.emptyview);
    if (mEmptyId != 0) {
        mEmpty.setLayoutResource(mEmptyId);
        mEmptyView = mEmpty.inflate();
        mEmpty.setVisibility(View.GONE);
    }

    /**
     * floating button setup
     */
    mFloatingButtonViewStub = (ViewStub) view.findViewById(R.id.floatingActionViewStub);
    mFloatingButtonViewStub.setLayoutResource(mFloatingButtonId);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:37,代碼來源:UltimateRecyclerView.java

示例6: initViews

import android.view.ViewStub; //導入方法依賴的package包/類
@Override
protected void initViews() {
    //super.initViews();
    LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View view = inflater.inflate(R.layout.custom_recycler_view_layout, this);
    mRecyclerView = (RecyclerView) view.findViewById(R.id.ultimate_list);
    mSwipeRefreshLayout = null;

    if (mRecyclerView != null) {

        mRecyclerView.setClipToPadding(mClipToPadding);
        if (mPadding != -1.1f) {
            mRecyclerView.setPadding(mPadding, mPadding, mPadding, mPadding);
        } else {
            mRecyclerView.setPadding(mPaddingLeft, mPaddingTop, mPaddingRight, mPaddingBottom);
        }
    }

    defaultFloatingActionButton = (FloatingActionButton) view.findViewById(R.id.defaultFloatingActionButton);
    setDefaultScrollListener();

    mEmpty = (ViewStub) view.findViewById(R.id.emptyview);
    mFloatingButtonViewStub = (ViewStub) view.findViewById(R.id.floatingActionViewStub);

    mEmpty.setLayoutResource(mEmptyId);

    mFloatingButtonViewStub.setLayoutResource(mFloatingButtonId);

    if (mEmptyId != 0)
        mEmptyView = mEmpty.inflate();
    mEmpty.setVisibility(View.GONE);

    if (mFloatingButtonId != 0) {
        mFloatingButtonView = mFloatingButtonViewStub.inflate();
        mFloatingButtonView.setVisibility(View.VISIBLE);
    }

}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:39,代碼來源:CustomUltimateRecyclerview.java

示例7: onCreateView

import android.view.ViewStub; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {

    View view = inflater.inflate(R.layout.fragment_highlight_list, container, false);

    RecyclerView recyclerView = view.findViewById(R.id.recyclerView);
    ViewStub zeroView = view.findViewById(R.id.zero_highlights);

    UserDataDBHelper userDataDBHelper = UserDataDBHelper.getInstance(getContext(), bookId);
    ArrayList<Highlight> userDataDBHelperAllHighlights = userDataDBHelper.getAllHighlights();

    if (userDataDBHelperAllHighlights.size() != 0) {
        recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
        highlightRecyclerViewAdapter = new HighlightRecyclerViewAdapter(
                userDataDBHelperAllHighlights,
                mListener,
                getContext().getApplicationContext(),
                getActivity().getPreferences(Context.MODE_PRIVATE));
        highlightRecyclerViewAdapter.setHasStableIds(true);
        recyclerView.setAdapter(highlightRecyclerViewAdapter);
    } else {
        recyclerView.setVisibility(View.GONE);
        zeroView.setVisibility(View.VISIBLE);
    }

    return view;
}
 
開發者ID:fekracomputers,項目名稱:IslamicLibraryAndroid,代碼行數:29,代碼來源:HighlightFragment.java

示例8: showEmpty

import android.view.ViewStub; //導入方法依賴的package包/類
private void showEmpty() {
    ViewStub stub = (ViewStub) findViewById(R.id.empty_layout);
    if (stub != null) {
        stub.setVisibility(0);
    }
    this.recyclerView.setVisibility(8);
    updateMenu();
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:9,代碼來源:DownloadManageActivity.java

示例9: initViews

import android.view.ViewStub; //導入方法依賴的package包/類
@Override
protected void initViews() {
    LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View view = inflater.inflate(R.layout.swipeable_ultimate_recycler_view_layout, this);
    mRecyclerView = (SwipeListView) view.findViewById(R.id.ultimate_list);

    mSwipeRefreshLayout = (VerticalSwipeRefreshLayout) view.findViewById(R.id.swipe_refresh_layout);
    setScrollbars();
    mSwipeRefreshLayout.setEnabled(false);

    if (mRecyclerView != null) {

        mRecyclerView.setClipToPadding(mClipToPadding);
        if (mPadding != -1.1f) {
            mRecyclerView.setPadding(mPadding, mPadding, mPadding, mPadding);
        } else {
            mRecyclerView.setPadding(mPaddingLeft, mPaddingTop, mPaddingRight, mPaddingBottom);
        }
    }

    defaultFloatingActionButton = (FloatingActionButton) view.findViewById(R.id.defaultFloatingActionButton);
    setDefaultScrollListener();

    mEmpty = (ViewStub) view.findViewById(R.id.emptyview);
    mFloatingButtonViewStub = (ViewStub) view.findViewById(R.id.floatingActionViewStub);

    mEmpty.setLayoutResource(mEmptyId);

    mFloatingButtonViewStub.setLayoutResource(mFloatingButtonId);

    if (mEmptyId != 0)
        mEmptyView = mEmpty.inflate();
    mEmpty.setVisibility(View.GONE);

    if (mFloatingButtonId != 0) {
        mFloatingButtonView = mFloatingButtonViewStub.inflate();
        mFloatingButtonView.setVisibility(View.VISIBLE);
    }


}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:42,代碼來源:SwipeableUltimateRecyclerview.java


注:本文中的android.view.ViewStub.setVisibility方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。