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


Java View.INVISIBLE屬性代碼示例

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


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

示例1: scrollBehindTo

/**
 * 滑動下方視圖到達的位置
 */
public void scrollBehindTo(View content, int x, int y) {
    int vis = View.VISIBLE;
    if (mMode == SlidingMenu.LEFT) {
        if (x >= content.getLeft()) vis = View.INVISIBLE;
        scrollTo((int)((x + getBehindWidth())*mScrollScale), y);
    } else if (mMode == SlidingMenu.RIGHT) {
        if (x <= content.getLeft()) vis = View.INVISIBLE;
        scrollTo((int)(getBehindWidth() - getWidth() +
                (x-getBehindWidth())*mScrollScale), y);
    } else if (mMode == SlidingMenu.LEFT_RIGHT) {
        mContent.setVisibility(x >= content.getLeft() ? View.INVISIBLE : View.VISIBLE);
        mSecondaryContent.setVisibility(x <= content.getLeft() ? View.INVISIBLE : View.VISIBLE);
        vis = x == 0 ? View.INVISIBLE : View.VISIBLE;
        if (x <= content.getLeft()) {
            scrollTo((int)((x + getBehindWidth())*mScrollScale), y);
        } else {
            scrollTo((int)(getBehindWidth() - getWidth() +
                    (x-getBehindWidth())*mScrollScale), y);
        }
    }
    if (vis == View.INVISIBLE)
        Log.v(TAG, "behind INVISIBLE");
    setVisibility(vis);
}
 
開發者ID:Datatellit,項目名稱:xlight_android_native,代碼行數:27,代碼來源:CustomViewBehind.java

示例2: onVisibilityChanged

@Override
protected void onVisibilityChanged(@NonNull View changedView, int visibility) {
    super.onVisibilityChanged(changedView, visibility);

    // avoid doing this check before View is even visible
    if (timeStartElapsed != -1) {
        if ((visibility == View.INVISIBLE || visibility == View.GONE) &&
                previousVisibility == View.VISIBLE) {

            invisibleTimeStart = SystemClock.elapsedRealtime();
        }

        if ((previousVisibility == View.INVISIBLE || previousVisibility == View.GONE) &&
                visibility == View.VISIBLE) {

            timeStartElapsed += SystemClock.elapsedRealtime() - invisibleTimeStart;
        }
    } else {
        timeStartMillis = System.currentTimeMillis();
        timeStartNanos = System.nanoTime();
        timeStartElapsed = SystemClock.elapsedRealtime();
    }

    previousVisibility = visibility;
}
 
開發者ID:PacktPublishing,項目名稱:Building-Android-UIs-with-Custom-Views,代碼行數:25,代碼來源:AnimationExampleView.java

示例3: setTitle

private void setTitle() {
    if (title == null || dname == null) {
        return;
    }
    if (titleStr != null) {
        if (title.getVisibility() == View.INVISIBLE) {
            title.setVisibility(View.VISIBLE);
        }
        title.setText(titleStr);
        if (dname.getVisibility() == View.VISIBLE) {
            dname.setVisibility(View.INVISIBLE);
        }
    } else {
        if (title.getVisibility() == View.VISIBLE) {
            title.setVisibility(View.INVISIBLE);
        }
        if (dname.getVisibility() == View.INVISIBLE) {
            dname.setVisibility(View.VISIBLE);
        }
    }
}
 
開發者ID:KnIfER,項目名稱:wangyi-Lyric-Parser,代碼行數:21,代碼來源:FilePickerDialog.java

示例4: updateMapDownloadButton

void updateMapDownloadButton()
{
    switch (mapView.getCenterTileState())
    {
        case NoData:
        {
            if(btnDownloadMap.getVisibility()==View.INVISIBLE)
            {
                btnDownloadMap.setVisibility(View.VISIBLE);
                btnDownloadMap.getParent().requestLayout();
                updateMapDownloadButtonText();
            }
            break;
        }

        case Loaded:
        {
            if(btnDownloadMap.getVisibility()==View.VISIBLE)
            {
                btnDownloadMap.setVisibility(View.INVISIBLE);
            }
            break;
        }
        case Unknown:
            break;
    }
}
 
開發者ID:LewisVo,項目名稱:Overkill,代碼行數:27,代碼來源:DisplayOfflineMap.java

示例5: updateHeaderVisibilities

private void updateHeaderVisibilities() {
    int top;
    if (mHeader != null) {
        top = mHeader.getMeasuredHeight() + (mHeaderOffset != null ? mHeaderOffset : 0) + mStickyHeaderTopOffset;
    } else {
        top = stickyHeaderTop();
    }
    int childCount = mList.getChildCount();
    for (int i = 0; i < childCount; i++) {

        // ensure child is a wrapper view
        View child = mList.getChildAt(i);
        if (!(child instanceof WrapperView)) {
            continue;
        }

        // ensure wrapper view child has a header
        WrapperView wrapperViewChild = (WrapperView) child;
        if (!wrapperViewChild.hasHeader()) {
            continue;
        }

        // update header views visibility
        View childHeader = wrapperViewChild.mHeader;
        if (wrapperViewChild.getTop() < top) {
            if (childHeader.getVisibility() != View.INVISIBLE) {
                childHeader.setVisibility(View.INVISIBLE);
            }
        } else {
            if (childHeader.getVisibility() != View.VISIBLE) {
                childHeader.setVisibility(View.VISIBLE);
            }
        }
    }
}
 
開發者ID:SavorGit,項目名稱:Hotspot-master-devp,代碼行數:35,代碼來源:StickyListHeadersListView.java

示例6: setVisibility

@Override
public void setVisibility(int visibility) {
    int currentVisibility = getVisibility();
    super.setVisibility(visibility);
    if (visibility != currentVisibility) {
        if (visibility == View.VISIBLE) {
            resetAnimation();
        } else if (visibility == View.GONE || visibility == View.INVISIBLE) {
            stopAnimation();
        }
    }
}
 
開發者ID:tortuvshin,項目名稱:health,代碼行數:12,代碼來源:HackProgressBar.java

示例7: showLoading

@Override
public void showLoading() {
    if (!isAdded()) {
        return;
    }

    if (!mPlContainer.isContent()) {
        mPlContainer.showLoading();

        if (mPlContainer.getVisibility() == View.INVISIBLE) {
            mPlContainer.setVisibility(View.VISIBLE);
        }
    }
}
 
開發者ID:coderwjq,項目名稱:ZhaZhaShop,代碼行數:14,代碼來源:FragmentMovieFind.java

示例8: setVisibility

@Override
public void setVisibility(int visibility) 
{
    super.setVisibility(visibility);
    
    if (visibility == View.INVISIBLE || visibility == View.GONE) {
        cancelTask();
    }
}
 
開發者ID:suomenriistakeskus,項目名稱:oma-riista-android,代碼行數:9,代碼來源:WebImageView.java

示例9: openOrClose

private void openOrClose(boolean open, boolean animate) {
    if (mIsAnimating) {
        return;
    }

    if (open && !mClosedState) {
        return;
    }

    if (!open && mClosedState) {
        return;
    }

    if (animate) {
        mMenuButton.performClick();
    } else {
        mClosedState = !open;

        final float centerX = mMenuButton.getX();
        final float centerY = mMenuButton.getY();

        final int buttonsCount = mButtons.size();
        final float angleStep = 360f / buttonsCount;

        final float offset = open ? mDistance : 0f;
        final float scale = open ? 1f : 0f;

        mMenuButton.setImageResource(open ? mIconClose : mIconMenu);
        mMenuButton.setAlpha(open ? DEFAULT_CLOSE_ICON_ALPHA : 1f);

        final int visibility = open ? View.VISIBLE : View.INVISIBLE;
        for (View view: mButtons) {
            view.setVisibility(visibility);
        }

        offsetAndScaleButtons(centerX, centerY, angleStep, offset, scale);
    }
}
 
開發者ID:Ramotion,項目名稱:circle-menu-android,代碼行數:38,代碼來源:CircleMenuView.java

示例10: onVisibilityChanged

protected void onVisibilityChanged(View changedView, int visibility) {
    super.onVisibilityChanged(changedView, visibility);
    if(this.mProgressDrawable != null) {
        if(visibility != View.GONE && visibility != View.INVISIBLE) {
            this.mProgressDrawable.start();
        } else {
            this.mProgressDrawable.stop();
        }
    }

}
 
開發者ID:alibaba,項目名稱:atlas,代碼行數:11,代碼來源:DefaultProgress.java

示例11: onStart

@Override
public void onStart() {
    super.onStart();

    Bundle args = getArguments();
    if (args != null) {
        videoCallEnabled = args.getBoolean(CallActivity.EXTRA_VIDEO_CALL, true);
        displayHud = args.getBoolean(CallActivity.EXTRA_DISPLAY_HUD, false);
    }
    int visibility = displayHud ? View.VISIBLE : View.INVISIBLE;
    encoderStatView.setVisibility(visibility);
    toggleDebugButton.setVisibility(visibility);
    hudViewsSetProperties(View.INVISIBLE);
    isRunning = true;
}
 
開發者ID:lgyjg,項目名稱:AndroidRTC,代碼行數:15,代碼來源:HudFragment.java

示例12: onStart

@Override
public void onStart() {
  super.onStart();

  Bundle args = getArguments();
  if (args != null) {
    videoCallEnabled = args.getBoolean(CallActivity.EXTRA_VIDEO_CALL, true);
    displayHud = args.getBoolean(CallActivity.EXTRA_DISPLAY_HUD, false);
  }
  int visibility = displayHud ? View.VISIBLE : View.INVISIBLE;
  encoderStatView.setVisibility(visibility);
  toggleDebugButton.setVisibility(visibility);
  hudViewsSetProperties(View.INVISIBLE);
  isRunning = true;
}
 
開發者ID:Piasy,項目名稱:AppRTC-Android,代碼行數:15,代碼來源:HudFragment.java

示例13: onAnimationEnd

@Override
public void onAnimationEnd(Animator animation)
{
    super.onAnimationEnd(animation);

    final View target = getTarget();
    if (target != null && target.getVisibility() != View.INVISIBLE)
    {
        target.setVisibility(View.INVISIBLE);
    }
}
 
開發者ID:zj565061763,項目名稱:animator,代碼行數:11,代碼來源:OnEndInvisible.java

示例14: setKeypadVisibility

public static void setKeypadVisibility(Context context, EditText inputNote, int visibility) {
    InputMethodManager imm = (InputMethodManager) context
            .getSystemService(Context.INPUT_METHOD_SERVICE);

    switch (visibility) {
        case View.VISIBLE:
            // 開啟鍵盤
            imm.showSoftInput(inputNote, InputMethodManager.SHOW_IMPLICIT);
            break;
        case View.GONE:
        case View.INVISIBLE:
            // 關閉鍵盤
            imm.hideSoftInputFromWindow(inputNote.getWindowToken(), 0);
            break;
    } /* end of switch */
}
 
開發者ID:Welloculus,項目名稱:MobileAppForPatient,代碼行數:16,代碼來源:GuiUtils.java

示例15: onVisibilityChanged

@Override
protected void onVisibilityChanged(View changedView, int visibility) {
	super.onVisibilityChanged(changedView, visibility);
	if (visibility == View.INVISIBLE || visibility == View.GONE) {
		clearRotateAnimation();
	} else {
		setRotateAnimation();
	}
}
 
開發者ID:qizhenghao,項目名稱:HiBangClient,代碼行數:9,代碼來源:FlippingImageView.java


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