本文整理汇总了Java中android.view.View.GONE属性的典型用法代码示例。如果您正苦于以下问题:Java View.GONE属性的具体用法?Java View.GONE怎么用?Java View.GONE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.view.View
的用法示例。
在下文中一共展示了View.GONE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateCheckboxState
@Override
void updateCheckboxState(CheckBox checkBox, boolean graphObjectSelected) {
checkBox.setChecked(graphObjectSelected);
int visible = (graphObjectSelected || selectionStrategy
.shouldShowCheckBoxIfUnselected()) ? View.VISIBLE : View.GONE;
checkBox.setVisibility(visible);
}
示例2: indexOfItemView
public int indexOfItemView(View view) {
if (view != null) {
int virtualIndex = 0;
final int count = getChildCount();
for (int i = 0; i < count; i++) {
final View child = getChildAt(i);
if ((child.getVisibility() == View.GONE) || (child == mPageHeaderView || child == mPageFooterView))
continue;
if (view == child) {
return virtualIndex;
}
virtualIndex++;
}
}
return -1;
}
示例3: down
@OnClick(R.id.down)
public void down() {
if (mFlowLayout2.getVisibility() == View.VISIBLE) {
mFlowLayout2.setVisibility(View.GONE);
KLog.i("---lin---> ok1111");
return;
}
if (mFlowLayout2.getVisibility() == View.GONE) {
mFlowLayout2.setVisibility(View.VISIBLE);
KLog.i("---lin---> ok2222");
}
KLog.i("---lin---> ok");
}
示例4: getMeasuredViewForAlertDialog
public static View getMeasuredViewForAlertDialog(LayoutInflater inflater, int itemId, int btnCount, String content, int width, boolean hasEditText) {
View view = inflater.inflate(itemId, null);
if (btnCount == 1) {
view.findViewById(R.id.btnCancel).setVisibility(View.GONE);
} else if (btnCount == 3) {
view.findViewById(R.id.btnCancel).setVisibility(View.VISIBLE);
view.findViewById(R.id.btnExit).setVisibility(View.VISIBLE);
} else {
view.findViewById(R.id.btnCancel).setVisibility(View.VISIBLE);
}
((TextView) view.findViewById(R.id.txtContent)).setText(content);
int visibility = hasEditText ? View.VISIBLE : View.GONE;
view.findViewById(R.id.edtLibName).setVisibility(visibility);
view.measure(View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY),
View.MeasureSpec.makeMeasureSpec(view.getHeight(), View.MeasureSpec.UNSPECIFIED));
return view;
}
示例5: onMeasurePureViewGroup
/**
* Measure parent view as pure view group.
*/
public void onMeasurePureViewGroup() {
if (!fitSystemEnabled || mLastInsets == null) {
return;
}
if (!exactParentHeightInit) {
exactParentHeightInit = true;
exactParentHeight = readParentHeight(injectParent, 0);
}
final int childCount = injectParent.getChildCount();
for (int i = 0; i < childCount; i++) {
final View child = injectParent.getChildAt(i);
if (child.getVisibility() == View.GONE) {
continue;
}
final ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) child.getLayoutParams();
injectWindowInsets(child, lp);
}
}
示例6: queryCounties
private void queryCounties(){
titleText.setText(selectedCity.getCityName());
if (backButton.getVisibility() == View.GONE){
backButton.setVisibility(View.VISIBLE);
}
countyList = DataSupport
.where("cityid = ?", String.valueOf(selectedCity.getId()))
.find(County.class);
if (countyList.size() > 0){
dataList.clear();
for (County county : countyList){
dataList.add(county.getCountyName());
}
adapter.notifyDataSetChanged();
listView.setSelection(0);
currentLevel = LEVEL_COUNTY;
}else {
int provinceCode = selectedProvince.getProvinceCode();
int cityCode = selectedCity.getCityCode();
String address = "http://www.guolin.tech/api/china/"+provinceCode+"/"+cityCode;
queryFromServer(address, "county");
}
}
示例7: updateVideoEditedInfo
private void updateVideoEditedInfo() {
if (editedSizeTextView == null) {
return;
}
esimatedDuration = (long) Math.ceil((videoTimelineView.getRightProgress() - videoTimelineView.getLeftProgress()) * videoDuration);
int width;
int height;
if (compressVideo.getVisibility() == View.GONE || compressVideo.getVisibility() == View.VISIBLE && !compressVideo.isChecked()) {
width = rotationValue == 90 || rotationValue == 270 ? originalHeight : originalWidth;
height = rotationValue == 90 || rotationValue == 270 ? originalWidth : originalHeight;
estimatedSize = (int) (originalSize * ((float) esimatedDuration / videoDuration));
} else {
width = rotationValue == 90 || rotationValue == 270 ? resultHeight : resultWidth;
height = rotationValue == 90 || rotationValue == 270 ? resultWidth : resultHeight;
estimatedSize = calculateEstimatedSize((float) esimatedDuration / videoDuration);
}
if (videoTimelineView.getLeftProgress() == 0) {
startTime = -1;
} else {
startTime = (long) (videoTimelineView.getLeftProgress() * videoDuration) * 1000;
}
if (videoTimelineView.getRightProgress() == 1) {
endTime = -1;
} else {
endTime = (long) (videoTimelineView.getRightProgress() * videoDuration) * 1000;
}
String videoDimension = String.format("%dx%d", width, height);
int minutes = (int) (esimatedDuration / 1000 / 60);
int seconds = (int) Math.ceil(esimatedDuration / 1000) - minutes * 60;
String videoTimeSize = String.format("%d:%02d, ~%s", minutes, seconds, AndroidUtilities.formatFileSize(estimatedSize));
editedSizeTextView.setText(String.format("%s, %s", videoDimension, videoTimeSize));
}
示例8: updateEditTextBodyVisible
public void updateEditTextBodyVisible(int visibility, CommentConfig commentConfig) {
mCommentConfig = commentConfig;
mCommentLayout.setVisibility(visibility);
measureBNItemHighAndCommentItemOffset(commentConfig);
if(View.VISIBLE==visibility){
mCet.requestFocus();
Utils.showSoftInput( mCet.getContext(), mCet);
}else if(View.GONE==visibility){
Utils.hideSoftInput( mCet.getContext(), mCet);
}
}
示例9: updateDropDownForFilter
private void updateDropDownForFilter(int count) {
if (getWindowVisibility() == View.GONE) return;
final boolean enoughToFilter = enoughToFilter();
if (count > 0 && enoughToFilter) {
if (hasFocus() && hasWindowFocus()) {
showDropDown();
}
} else if (isPopupShowing()) {
dismissDropDown();
}
}
示例10: showEmptyView
private void showEmptyView() {
if (no_post_layout.getVisibility() == View.GONE) {
no_post_layout.setVisibility(View.VISIBLE);
progressBar.setVisibility(View.GONE);
no_post_textview.setText("You need to like or Comment other users posts to see their posts here");
}
}
示例11: if
/**
* Pre-Lollipop we use padding so that the shadow has enough space to be drawn. This method
* offsets our layout position so that we're positioned correctly if we're on one of
* our parent's edges.
*/
/* private void offsetIfNeeded(CoordinatorLayout parent, FabSpeedDial fab) {
final Rect padding = fab.mShadowPadding;
if (padding != null && padding.centerX() > 0 && padding.centerY() > 0) {
final CoordinatorLayout.LayoutParams lp =
(CoordinatorLayout.LayoutParams) fab.getLayoutParams();
int offsetTB = 0, offsetLR = 0;
if (fab.getRight() >= parent.getWidth() - lp.rightMargin) {
// If we're on the left edge, shift it the right
offsetLR = padding.right;
} else if (fab.getLeft() <= lp.leftMargin) {
// If we're on the left edge, shift it the left
offsetLR = -padding.left;
}
if (fab.getBottom() >= parent.getBottom() - lp.bottomMargin) {
// If we're on the bottom edge, shift it down
offsetTB = padding.bottom;
} else if (fab.getTop() <= lp.topMargin) {
// If we're on the top edge, shift it up
offsetTB = -padding.top;
}
fab.offsetTopAndBottom(offsetTB);
fab.offsetLeftAndRight(offsetLR);
}
}*/
@Override
public void onNestedScroll(CoordinatorLayout coordinatorLayout, FabSpeedDial child, View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed) {
super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed);
if(dyConsumed > 0 && child.getVisibility() == View.VISIBLE){
child.hide();
} else if(dyConsumed < 0 && child.getVisibility() == View.GONE){
child.show();
}
}
示例12: getChildRect
/**
* Get the position rect for the given child. If the child has currently requested layout
* or has a visibility of GONE.
*
* @param child child view to check
* @param transform true to include transformation in the output rect, false to
* only account for the base position
* @param out rect to set to the output values
*/
void getChildRect(View child, boolean transform, Rect out) {
if (child.isLayoutRequested() || child.getVisibility() == View.GONE) {
out.setEmpty();
return;
}
if (transform) {
getDescendantRect(child, out);
} else {
out.set(child.getLeft(), child.getTop(), child.getRight(), child.getBottom());
}
}
示例13: updateVisibility
public static void updateVisibility(View view, boolean accessibilityEnabled) {
// We want to avoid the extra layout pass by setting the views to GONE unless
// accessibility is on, in which case not setting them to GONE causes a glitch.
int invisibleState = accessibilityEnabled ? View.GONE : View.INVISIBLE;
if (view.getAlpha() < ALPHA_CUTOFF_THRESHOLD && view.getVisibility() != invisibleState) {
view.setVisibility(invisibleState);
} else if (view.getAlpha() > ALPHA_CUTOFF_THRESHOLD
&& view.getVisibility() != View.VISIBLE) {
view.setVisibility(View.VISIBLE);
}
}
示例14: hide
@Override
public void hide() {
if (mCurrentShowAnim != null) {
mCurrentShowAnim.end();
}
if (mContainerView.getVisibility() == View.GONE) {
return;
}
if (mShowHideAnimationEnabled) {
mContainerView.setAlpha(1);
mContainerView.setTransitioning(true);
AnimatorSet anim = new AnimatorSet();
AnimatorSet.Builder b = anim.play(ObjectAnimator.ofFloat(mContainerView, "alpha", 0));
if (mContentView != null) {
b.with(ObjectAnimator.ofFloat(mContentView, "translationY",
0, -mContainerView.getHeight()));
b.with(ObjectAnimator.ofFloat(mContainerView, "translationY",
-mContainerView.getHeight()));
}
if (mSplitView != null && mSplitView.getVisibility() == View.VISIBLE) {
mSplitView.setAlpha(1);
b.with(ObjectAnimator.ofFloat(mSplitView, "alpha", 0));
}
anim.addListener(mHideListener);
mCurrentShowAnim = anim;
anim.start();
} else {
mHideListener.onAnimationEnd(null);
}
}
示例15: onTouch
@Override
public boolean onTouch(View v, MotionEvent event) {
if (MotionEvent.ACTION_DOWN == event.getAction()) {
if (mLayoutMenu.getVisibility() == View.GONE) {
openMenu();
} else {
closeMenu();
}
}
return true;
}