Java Code Examples for androidx.appcompat.widget.AppCompatImageView#setVisibility()

The following examples show how to use androidx.appcompat.widget.AppCompatImageView#setVisibility() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SelectCollectionDialog.java    From Mysplash with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void initWidget(View v) {
    setCancelable(true);

    AppCompatImageView cover = v.findViewById(R.id.dialog_select_collection_cover);
    cover.setVisibility(View.GONE);

    progressContainer.setVisibility(View.GONE);
    selectorContainer.setVisibility(View.VISIBLE);

    refreshLayout.setColorSchemeColors(ThemeManager.getContentColor(requireActivity()));
    refreshLayout.setProgressBackgroundColorSchemeColor(ThemeManager.getRootColor(requireActivity()));
    refreshLayout.setRefreshEnabled(false);
    refreshLayout.setLoadEnabled(false);

    recyclerView.setLayoutManager(new LinearLayoutManager(requireActivity(), RecyclerView.VERTICAL, false));
    recyclerView.setAdapter(adapter);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        recyclerView.addOnScrollListener(new ElevationScrollListener());
    }
    recyclerView.addOnScrollListener(new LoadScrollListener());

    updatePhotoAdapter();

    creatorContainer.setVisibility(View.GONE);

    nameTxt.setOnFocusChangeListener((v1, hasFocus) -> nameTxtContainer.setError(null));
}
 
Example 2
Source File: Banner.java    From MaterialBanner with Apache License 2.0 4 votes vote down vote up
private void initViewGroup(Context context) {
    // CONTENT CONTAINER
    LayoutParams layoutParams = new LayoutParams(MATCH_PARENT, WRAP_CONTENT);

    mContentContainer = new RelativeLayout(context);
    mContentContainer.setId(R.id.mb_container_content);
    mContentContainer.setLayoutParams(layoutParams);

    // ICON VIEW
    RelativeLayout.LayoutParams relativeLayoutParams = new RelativeLayout.LayoutParams(
            mIconSize, mIconSize);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        relativeLayoutParams.setMarginStart(mIconMarginStart);
        relativeLayoutParams.addRule(ALIGN_PARENT_START, TRUE);
    } else {
        relativeLayoutParams.leftMargin = mIconMarginStart;
        relativeLayoutParams.addRule(ALIGN_PARENT_LEFT, TRUE);
    }

    mIconView = new AppCompatImageView(context);
    mIconView.setId(R.id.mb_icon);
    mIconView.setLayoutParams(relativeLayoutParams);
    mIconView.setVisibility(GONE);

    // MESSAGE VIEW
    relativeLayoutParams = new RelativeLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        relativeLayoutParams.setMarginStart(mMessageMarginStart);
        relativeLayoutParams.addRule(ALIGN_PARENT_START, TRUE);
    } else {
        relativeLayoutParams.leftMargin = mMessageMarginStart;
        relativeLayoutParams.addRule(ALIGN_PARENT_LEFT, TRUE);
    }

    mMessageView = new MessageView(context);
    mMessageView.setId(R.id.mb_message);
    mMessageView.setLayoutParams(relativeLayoutParams);

    // BUTTONS CONTAINER
    relativeLayoutParams = new RelativeLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        relativeLayoutParams.addRule(ALIGN_PARENT_END, TRUE);
    } else {
        relativeLayoutParams.addRule(ALIGN_PARENT_RIGHT, TRUE);
    }

    mButtonsContainer = new ButtonsContainer(context);
    mButtonsContainer.setId(R.id.mb_container_buttons);
    mButtonsContainer.setLayoutParams(relativeLayoutParams);

    mLeftButton = mButtonsContainer.getLeftButton();
    mRightButton = mButtonsContainer.getRightButton();

    // LINE
    layoutParams = new LayoutParams(MATCH_PARENT, mLineHeight);

    mLine = new View(context);
    mLine.setId(R.id.mb_line);
    mLine.setLayoutParams(layoutParams);

    addView(mContentContainer);
    addView(mLine);

    mContentContainer.addView(mIconView);
    mContentContainer.addView(mMessageView);
    mContentContainer.addView(mButtonsContainer);
}
 
Example 3
Source File: NoteViewHolder.java    From nextcloud-notes with GNU General Public License v3.0 4 votes vote down vote up
protected void bindStatus(AppCompatImageView noteStatus, DBStatus status, int mainColor) {
    noteStatus.setVisibility(DBStatus.VOID.equals(status) ? INVISIBLE : VISIBLE);
    DrawableCompat.setTint(noteStatus.getDrawable(), BrandingUtil.getSecondaryForegroundColorDependingOnTheme(noteStatus.getContext(), mainColor));
}