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


Java View.VISIBLE属性代码示例

本文整理汇总了Java中android.view.View.VISIBLE属性的典型用法代码示例。如果您正苦于以下问题:Java View.VISIBLE属性的具体用法?Java View.VISIBLE怎么用?Java View.VISIBLE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.view.View的用法示例。


在下文中一共展示了View.VISIBLE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: onKeyEvent

public boolean onKeyEvent(int keyCode, KeyEvent event) {
	try {
		int resId = ResHelper.getIdRes(activity, "llSearch");
		if (keyCode == KeyEvent.KEYCODE_BACK
				&& event.getAction() == KeyEvent.ACTION_DOWN
				&& activity.findViewById(resId).getVisibility() == View.VISIBLE) {
			activity.findViewById(resId).setVisibility(View.GONE);
			resId = ResHelper.getIdRes(activity, "llTitle");
			activity.findViewById(resId).setVisibility(View.VISIBLE);
			etSearch.setText("");
			return true;
		}
	} catch (Throwable e) {
		SMSLog.getInstance().w(e);
	}
	return super.onKeyEvent(keyCode, event);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:CountryPage.java

示例3: onNestedPreScroll

@Override
public void onNestedPreScroll(CoordinatorLayout coordinatorLayout, View child,
                              View target, int dx, int dy, int[] consumed) {
    if (dy > 0 && sinceDirectionChange < 0 || dy < 0 && sinceDirectionChange > 0) {
        child.animate().cancel();
        sinceDirectionChange = 0;
    }
    sinceDirectionChange += dy;
    int visibility = child.getVisibility();
    if (sinceDirectionChange > child.getHeight() && visibility == View.VISIBLE) {
        hide(child);
    } else {
        if (sinceDirectionChange < 0 && (visibility == View.GONE || visibility == View
                .INVISIBLE)) {
            show(child);
        }
    }
}
 
开发者ID:zuoni1018,项目名称:CoordinatorLayoutExample-master,代码行数:18,代码来源:FooterBehavior.java

示例4: getSelectedColor

@ColorInt private int getSelectedColor() {
    if (colorChooserCustomFrame != null &&
            colorChooserCustomFrame.getVisibility() == View.VISIBLE) {
        return selectedCustomColor;
    }

    int color = 0;
    if (subIndex() > -1)
        color = mColorsSub[topIndex()][subIndex()];
    else if (topIndex() > -1)
        color = mColorsTop[topIndex()];
    if (color == 0) {
        int fallback = 0;
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
            fallback = DialogUtils.resolveColor(getActivity(), android.R.attr.colorAccent);
        color = DialogUtils.resolveColor(getActivity(), R.attr.colorAccent, fallback);
    }
    return color;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:ColorChooserDialog.java

示例5: onNestedScroll

@Override
public void onNestedScroll(CoordinatorLayout coordinatorLayout, FloatingActionButton 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(new FloatingActionButton.OnVisibilityChangedListener() {
            /**
             * Called when a FloatingActionButton has been hidden
             *
             * @param fab the FloatingActionButton that was hidden.
             */
            @Override
            public void onHidden(FloatingActionButton fab) {
                super.onShown(fab);
                fab.setVisibility(View.INVISIBLE);
            }
        });
    } else if (dyConsumed < 0 && child.getVisibility() != View.VISIBLE) {
        child.show();
    }
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:23,代码来源:ScrollAwareFab.java

示例6: setLv1Item

private void setLv1Item(NewConditionItem item) {
    if (item == null) {
        mPrimaryList.setVisibility(View.GONE);
        setLv2Item(null);
        return;
    }
    if (mPrimaryList.getVisibility() != View.VISIBLE) {
        mPrimaryList.setVisibility(View.VISIBLE);
    }
    mPrimaryAdapter.setList(item.subItems);
    mPrimaryAdapter.notifyDataSetChanged();

    for (int i = 0; i < item.subItems.size(); ++i) {
        NewConditionItem subItem = item.subItems.get(i);
        if (subItem.selected) {
            setLv2Item(subItem);
            if (mSetting) {
                checkSelectedItemVisibility(mPrimaryList, i);
            }
            return;
        }
    }
    setLv2Item(null);
}
 
开发者ID:Tamicer,项目名称:FilterBar,代码行数:24,代码来源:RegionContainer.java

示例7: onPageFinishedLoading

@Override
public void onPageFinishedLoading(String url) {
    LOG.d(TAG, "onPageFinished(" + url + ")");

    clearLoadTimeoutTimer();

    // Broadcast message that page has loaded
    pluginManager.postMessage("onPageFinished", url);

    // Make app visible after 2 sec in case there was a JS error and Cordova JS never initialized correctly
    if (engine.getView().getVisibility() != View.VISIBLE) {
        Thread t = new Thread(new Runnable() {
            public void run() {
                try {
                    Thread.sleep(2000);
                    cordova.getActivity().runOnUiThread(new Runnable() {
                        public void run() {
                            pluginManager.postMessage("spinner", "stop");
                        }
                    });
                } catch (InterruptedException e) {
                }
            }
        });
        t.start();
    }

    // Shutdown if blank loaded
    if (url.equals("about:blank")) {
        pluginManager.postMessage("exit", null);
    }
}
 
开发者ID:rodrigonsh,项目名称:alerta-fraude,代码行数:32,代码来源:CordovaWebViewImpl.java

示例8: showExpirationDateInputsInputs

private void showExpirationDateInputsInputs() {
    if (!mShouldRequestExpirationDate || mExpirationContainer.getVisibility() == View.VISIBLE) {
        return;
    }

    mExpirationContainer.setVisibility(View.VISIBLE);
    mCardUnmaskInput.setEms(3);
    mMonthInput.addTextChangedListener(this);
    mYearInput.addTextChangedListener(this);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:10,代码来源:CardUnmaskPrompt.java

示例9: updateState

protected void updateState() {
    Log.d(LOGTAG, "updateState");
    Log.d(LOGTAG, "mEnabled="+mEnabled+", mHaveSurface="+mHaveSurface);
    boolean willStart = mEnabled && mHaveSurface && mView.getVisibility() == View.VISIBLE;
    if (willStart != mIsStarted) {
        if(willStart) doStart();
        else doStop();
    } else {
        Log.d(LOGTAG, "keeping State unchanged");
    }
    Log.d(LOGTAG, "updateState end");
}
 
开发者ID:linzuzeng,项目名称:Microsphere,代码行数:12,代码来源:CameraGLRendererBase.java

示例10: navigateTo

private void navigateTo(int frame) {
    boolean isSampling = findViewById(R.id.frameSampler).getVisibility() == View.VISIBLE;

    if (frame == R.id.frameLibrary) {
        libraryActivate();
    } else {
        findViewById(R.id.frameLibrary).setVisibility(View.INVISIBLE);
        ((TextView) findViewById(R.id.libraryText)).setTextColor(Color.parseColor("#FFFFFF"));
        ((ImageView) findViewById(R.id.libraryNavbarBtn)).setImageResource(R.drawable.ic_library_music);
    }

    if (frame == R.id.frameSampler) {
        samplerActivate();
    } else {
        findViewById(R.id.frameSampler).setVisibility(View.INVISIBLE);
        ((TextView) findViewById(R.id.samplerText)).setTextColor(Color.parseColor("#FFFFFF"));
        ((ImageView) findViewById(R.id.samplerNavbarBtn)).setImageResource(R.drawable.ic_whatshot);
        if (isSampling)
            dispatch(SAMPLER_STOP);
    }

    if (frame == R.id.frameLoved) {
        lovedActivate();
    } else {
        findViewById(R.id.frameLoved).setVisibility(View.INVISIBLE);
        ((TextView) findViewById(R.id.lovedText)).setTextColor(Color.parseColor("#FFFFFF"));
        ((ImageView) findViewById(R.id.lovedNavbarBtn)).setImageResource(R.drawable.ic_loved);
    }

    if (frame == R.id.frameSharing) {
        sharingActivate();
    } else {
        findViewById(R.id.frameSharing).setVisibility(View.INVISIBLE);
        ((TextView) findViewById(R.id.sharingText)).setTextColor(Color.parseColor("#FFFFFF"));
        ((ImageView) findViewById(R.id.sharingNavbarBtn)).setImageResource(R.drawable.ic_sharing);
    }
}
 
开发者ID:sovteam,项目名称:buddybox,代码行数:37,代码来源:MainActivity.java

示例11: onLayout

@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
    super.onLayout(changed, l, t, r, b);
    ViewTreeObserver observer = getViewTreeObserver();
    if (getVisibility() == View.VISIBLE && changed && observer != null && observer.isAlive()) {
        observer.addOnPreDrawListener(mPredrawListener);
    }
}
 
开发者ID:StylingAndroid,项目名称:PresenterLite,代码行数:8,代码来源:GraphicalLayout.java

示例12: startAlphaAnimation

public static void startAlphaAnimation(View v, long duration, int visibility) {
    AlphaAnimation alphaAnimation = (visibility == View.VISIBLE)
            ? new AlphaAnimation(0f, 1f)
            : new AlphaAnimation(1f, 0f);

    alphaAnimation.setDuration(duration);
    alphaAnimation.setFillAfter(true);
    v.startAnimation(alphaAnimation);
}
 
开发者ID:appteam-nith,项目名称:Nimbus,代码行数:9,代码来源:CoreTeamEventActivity.java

示例13: onNestedScroll

@Override
public void onNestedScroll(CoordinatorLayout coordinatorLayout, FloatingActionButton 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();
        RxBus.getInstance().post(AppConstant.MENU_SHOW_HIDE,false);
    } else if (dyConsumed < 0 && child.getVisibility() != View.VISIBLE) {
        RxBus.getInstance().post(AppConstant.MENU_SHOW_HIDE,true);
        child.show();
    }
}
 
开发者ID:wp521,项目名称:MyFire,代码行数:13,代码来源:ScrollAwareFABBehavior.java

示例14: expandHabitCalendarViewOnClick

@OnClick(R.id.expand_habit_calendar_view)
void expandHabitCalendarViewOnClick() {
    TransitionManager.beginDelayedTransition(habitCalendarContent);
    TransitionManager.beginDelayedTransition(fragHabitRootLinearLayout);
    TransitionManager.beginDelayedTransition(habitCalendarCard);
    if(habitCalendarContent.getVisibility() == View.VISIBLE) {
        habitCalendarContent.setVisibility(View.GONE);
    } else {
        habitCalendarContent.setVisibility(View.VISIBLE);
    }
}
 
开发者ID:AndroidNewbies,项目名称:Sanxing,代码行数:11,代码来源:HabitCalendarFragment.java

示例15: setVisibility

public void setVisibility(int visibility, int delay) {
    super.setVisibility(visibility);
    if (visibility == View.VISIBLE) {
        startLoading(delay);
    } else {
        stopLoading();
    }
}
 
开发者ID:kingwang666,项目名称:BookLoadingView,代码行数:8,代码来源:BookLoadingView.java


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