本文整理汇总了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);
}
示例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);
}
}
}
示例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;
}
}
示例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);
}
}
}
}
示例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();
}
}
}
示例7: showLoading
@Override
public void showLoading() {
if (!isAdded()) {
return;
}
if (!mPlContainer.isContent()) {
mPlContainer.showLoading();
if (mPlContainer.getVisibility() == View.INVISIBLE) {
mPlContainer.setVisibility(View.VISIBLE);
}
}
}
示例8: setVisibility
@Override
public void setVisibility(int visibility)
{
super.setVisibility(visibility);
if (visibility == View.INVISIBLE || visibility == View.GONE) {
cancelTask();
}
}
示例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);
}
}
示例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();
}
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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 */
}
示例15: onVisibilityChanged
@Override
protected void onVisibilityChanged(View changedView, int visibility) {
super.onVisibilityChanged(changedView, visibility);
if (visibility == View.INVISIBLE || visibility == View.GONE) {
clearRotateAnimation();
} else {
setRotateAnimation();
}
}