当前位置: 首页>>代码示例>>Java>>正文


Java View.GONE属性代码示例

本文整理汇总了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);
}
 
开发者ID:MobileDev418,项目名称:chat-sdk-android-push-firebase,代码行数:7,代码来源:PickerFragment.java

示例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;
}
 
开发者ID:rexyren,项目名称:PageScrollView,代码行数:16,代码来源:PageScrollView.java

示例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");
}
 
开发者ID:linsir6,项目名称:TripBuyer,代码行数:17,代码来源:SellerTravelDetailsActivity.java

示例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;
    }
 
开发者ID:nidhinvv,项目名称:BubbleAlert,代码行数:20,代码来源:ScreenUtils.java

示例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);
  }
}
 
开发者ID:VerstSiu,项目名称:translucent_layout,代码行数:25,代码来源:TranslucentKit.java

示例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");
    }

}
 
开发者ID:EdisonGu1997,项目名称:GCWeather,代码行数:24,代码来源:ChooseAreaFragment.java

示例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));
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:36,代码来源:VideoEditorActivity.java

示例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);
    }
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:14,代码来源:BlackboardFragmentLayout.java

示例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();
    }
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:11,代码来源:RichAutoCompleteTextView.java

示例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");
    }
}
 
开发者ID:sciage,项目名称:FinalProject,代码行数:7,代码来源:ActivityInteractionFragment.java

示例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();
        }
    }
 
开发者ID:kranthi0987,项目名称:easyfilemanager,代码行数:43,代码来源:FabSpeedDialBehaviour.java

示例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());
  }
}
 
开发者ID:commonsguy,项目名称:cwac-crossport,代码行数:20,代码来源:CoordinatorLayout.java

示例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);
    }
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:11,代码来源:WorkspaceStateTransitionAnimation.java

示例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);
    }
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:31,代码来源:ActionBarImpl.java

示例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;
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:11,代码来源:NoteEditFragment.java


注:本文中的android.view.View.GONE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。