Java Code Examples for android.view.View.INVISIBLE

The following are Jave code examples for showing how to use INVISIBLE of the android.view.View class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: xlight_android_native   File: CustomViewBehind.java   Source Code and License Vote up 7 votes
/**
 * 滑动下方视图到达的位置
 */
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);
}
 
Example 2
Project: Building-Android-UIs-with-Custom-Views   File: AnimationExampleView.java   Source Code and License Vote up 7 votes
@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;
}
 
Example 3
Project: wangyi-Lyric-Parser   File: FilePickerDialog.java   Source Code and License Vote up 7 votes
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);
        }
    }
}
 
Example 4
Project: Overkill   File: DisplayOfflineMap.java   Source Code and License Vote up 6 votes
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;
    }
}
 
Example 5
Project: Hotspot-master-devp   File: StickyListHeadersListView.java   Source Code and License Vote up 6 votes
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);
            }
        }
    }
}
 
Example 6
Project: health   File: HackProgressBar.java   Source Code and License Vote up 6 votes
@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();
        }
    }
}
 
Example 7
Project: ZhaZhaShop   File: FragmentMovieFind.java   Source Code and License Vote up 6 votes
@Override
public void showLoading() {
    if (!isAdded()) {
        return;
    }

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

        if (mPlContainer.getVisibility() == View.INVISIBLE) {
            mPlContainer.setVisibility(View.VISIBLE);
        }
    }
}
 
Example 8
Project: oma-riista-android   File: WebImageView.java   Source Code and License Vote up 6 votes
@Override
public void setVisibility(int visibility) 
{
    super.setVisibility(visibility);
    
    if (visibility == View.INVISIBLE || visibility == View.GONE) {
        cancelTask();
    }
}
 
Example 9
Project: circle-menu-android   File: CircleMenuView.java   Source Code and License Vote up 6 votes
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);
    }
}
 
Example 10
Project: atlas   File: DefaultProgress.java   Source Code and License Vote up 6 votes
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();
        }
    }

}
 
Example 11
Project: AndroidRTC   File: HudFragment.java   Source Code and License Vote up 6 votes
@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;
}
 
Example 12
Project: AppRTC-Android   File: HudFragment.java   Source Code and License Vote up 6 votes
@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;
}
 
Example 13
Project: animator   File: OnEndInvisible.java   Source Code and License Vote up 6 votes
@Override
public void onAnimationEnd(Animator animation)
{
    super.onAnimationEnd(animation);

    final View target = getTarget();
    if (target != null && target.getVisibility() != View.INVISIBLE)
    {
        target.setVisibility(View.INVISIBLE);
    }
}
 
Example 14
Project: MobileAppForPatient   File: GuiUtils.java   Source Code and License Vote up 6 votes
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 */
}
 
Example 15
Project: HiBangClient   File: FlippingImageView.java   Source Code and License Vote up 6 votes
@Override
protected void onVisibilityChanged(View changedView, int visibility) {
	super.onVisibilityChanged(changedView, visibility);
	if (visibility == View.INVISIBLE || visibility == View.GONE) {
		clearRotateAnimation();
	} else {
		setRotateAnimation();
	}
}
 
Example 16
Project: android-radiobutton-extended   File: SecondAdapter.java   Source Code and License Vote up 6 votes
protected void setDefaults(SecondViewHolder holder, int position) {
    SecondModel item = mItems.get(position);
    {
        holder.setRadioItem(item.getId());
        holder.getLabel().setText(generateLabel(position, holder.getUuid()));
    }
    int visibility = getCheckedId() == item.getId() ? View.VISIBLE : View.INVISIBLE;
    {
        holder.getIcon().setVisibility(visibility);
    }
}
 
Example 17
Project: Pocket-Plays-for-Twitch   File: VideoMediaRouteControllerDialog.java   Source Code and License Vote up 5 votes
private void adjustControlsVisibility(boolean showPlayPause) {
    int visible = showPlayPause ? View.VISIBLE : View.INVISIBLE;
    mPausePlay.setVisibility(visible);
    setLoadingVisibility(!showPlayPause);
}
 
Example 18
Project: Witch-Android   File: LoginViewModel.java   Source Code and License Vote up 5 votes
@BindToView(id = R.id.login_fragment_progress_view, view = View.class, set = "visibility")
Integer progressVisible() {
    return isLoggingIn ? View.VISIBLE : View.INVISIBLE;
}
 
Example 19
Project: Huochexing12306   File: EditPage.java   Source Code and License Vote up 5 votes
public void onClick(View v) {
	if (v.equals(llTitle.getBtnBack())) {
		Platform plat = null;
		for (int i = 0; i < views.length; i++) {
			if (views[i].getVisibility() == View.INVISIBLE) {
				plat = platformList[i];
				break;
			}
		}

		// 取消分享的统计
		if (plat != null) {
			ShareSDK.logDemoEvent(5, plat);
		}
		finish();
		return;
	}

	// 取消分享的统计
	if (v.equals(llTitle.getBtnRight())) {
		String text = etContent.getText().toString();
		reqData.put("text", text);
		if(!shareImage){
			if (reqData.get("imagePath") == null) {
				reqData.put("viewToShare", null);
				reqData.put("imageUrl", null);
			} else if (reqData.get("imageUrl") == null) {
				reqData.put("imagePath", null);
				reqData.put("viewToShare", null);
			} else {
				reqData.put("imageUrl", null);
				reqData.put("imagePath", null);
			}
		}

		HashMap<Platform, HashMap<String, Object>> editRes
				= new HashMap<Platform, HashMap<String,Object>>();
		boolean selected = false;
		for (int i = 0; i < views.length; i++) {
			if (views[i].getVisibility() != View.VISIBLE) {
				editRes.put(platformList[i], reqData);
				selected = true;
			}
		}

		if (selected) {
			HashMap<String, Object> res = new HashMap<String, Object>();
			res.put("editRes", editRes);
			setResult(res);
			finish();
		} else {
			int resId = getStringRes(activity, "select_one_plat_at_least");
			if (resId > 0) {
				Toast.makeText(getContext(), resId, Toast.LENGTH_SHORT).show();
			}
		}
		return;
	}

	if (v instanceof FrameLayout) {
		((FrameLayout) v).getChildAt(1).performClick();
		return;
	}

	if (v.getVisibility() == View.INVISIBLE) {
		v.setVisibility(View.VISIBLE);
	} else {
		v.setVisibility(View.INVISIBLE);
	}
}
 
Example 20
Project: CustomAndroidOneSheeld   File: AbstractDefaultGoogleStyleViewLayout.java   Source Code and License Vote up 5 votes
private void showHeaderText() {
	if (null != mHeaderText && View.INVISIBLE == mHeaderText.getVisibility()) {
		mHeaderText.setVisibility(View.VISIBLE);
	}
}