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


Java View.setVisibility方法代码示例

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


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

示例1: showHideViewById

import android.view.View; //导入方法依赖的package包/类
/**
 *  根据ID显示隐藏布局
 * @param id
 */
private void showHideViewById(int id) {
    for (int i = 0; i < layoutSparseArray.size(); i++) {
        int key = layoutSparseArray.keyAt(i);
        View valueView = layoutSparseArray.valueAt(i);
        //显示该view
        if(key == id) {
            valueView.setVisibility(View.VISIBLE);
            if(mStatusLayoutManager.onShowHideViewListener != null) mStatusLayoutManager.onShowHideViewListener.onShowView(valueView, key);
        } else {
            if(valueView.getVisibility() != View.GONE) {
                valueView.setVisibility(View.GONE);
                if(mStatusLayoutManager.onShowHideViewListener != null) mStatusLayoutManager.onShowHideViewListener.onHideView(valueView, key);
            }
        }
    }
}
 
开发者ID:rawray,项目名称:RRFramework-Android,代码行数:21,代码来源:RootFrameLayout.java

示例2: showAnimation

import android.view.View; //导入方法依赖的package包/类
private void showAnimation(ViewGroup layout){
	for(int i=0;i<layout.getChildCount();i++){
		final View child = layout.getChildAt(i);
		if(child.getId() == R.id.popmenu_close){
			continue;
		}
		child.setOnClickListener(this);
		child.setVisibility(View.INVISIBLE);
		mHandler.postDelayed(new Runnable() {
			
			@Override
			public void run() {
				child.setVisibility(View.VISIBLE);
				ValueAnimator fadeAnim = ObjectAnimator.ofFloat(child, "translationY", 600, 0);
				fadeAnim.setDuration(300);
				KickBackAnimator kickAnimator = new KickBackAnimator();
				kickAnimator.setDuration(150);
				fadeAnim.setEvaluator(kickAnimator);
				fadeAnim.start();
			}
		}, i * 50);
	}
	
}
 
开发者ID:smartbeng,项目名称:PaoMovie,代码行数:25,代码来源:MoreWindow.java

示例3: onBindDialogView

import android.view.View; //导入方法依赖的package包/类
@Override
protected void onBindDialogView(View view) {
    super.onBindDialogView(view);
    this.datePicker = (DatePicker) view.findViewById(R.id.datePicker);
    //Remover o date_picker_header do datePicker se o mesmo existir
    View viewDayDatePicker = datePicker.findViewById(Resources.getSystem().getIdentifier("date_picker_header", "id", "android"));
    if (viewDayDatePicker != null) {
        viewDayDatePicker.setVisibility(View.GONE);
    }
    Calendar calendar = Calendar.getInstance();
    try {
        //recuperar a preferência no formato yyyyMMdd e converter para um Calendar:
        calendar = OhaHelper.getCalendar(this.getPersistedString(OhaHelper.getStrDate(new Date())));
    } catch (ParseException e) {
        e.printStackTrace();
    }
    datePicker.init(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), null);
}
 
开发者ID:brolam,项目名称:OpenHomeAnalysis,代码行数:19,代码来源:OhaDatePickerDialogPreference.java

示例4: layoutChildItems

import android.view.View; //导入方法依赖的package包/类
private void layoutChildItems() {
    int count = getChildCount();
    double baseAngle = (Math.PI - mItemAngleSection) / 2;
    for (int i = 1; i < count; i++) {
        View child = getChildAt(i);
        int cWidth = child.getMeasuredWidth();
        int cHeight = child.getMeasuredHeight();

        int l = (int) (getMeasuredWidth() / 2 - mRadius * Math.cos(mItemAngleSection / count * i + baseAngle) - cWidth / 2);
        int t = (int) (getMeasuredHeight() - (mRadius * Math.sin(mItemAngleSection / count * i + baseAngle) - mPointOffetScreenY)
                - mMarginBottom);

        child.layout(l, t, l + cWidth, t + cHeight);
        child.setVisibility(View.GONE);
    }
}
 
开发者ID:Ethan-9606,项目名称:BottomMenu,代码行数:17,代码来源:BottomMenu.java

示例5: visible

import android.view.View; //导入方法依赖的package包/类
protected void visible(final View... views) {
    if (views != null && views.length > 0) {
        for (View view : views) {
            if (view != null) {
                view.setVisibility(View.VISIBLE);
            }
        }
    }

}
 
开发者ID:zwmlibs,项目名称:BookReader-master,代码行数:11,代码来源:BaseActivity.java

示例6: noMoreLoading

import android.view.View; //导入方法依赖的package包/类
public void noMoreLoading() {
    isLoadingData = false;
    final View footView = mFootViews.get(0);
    isnomore = true;
    if (footView instanceof LoadingMoreFooter) {
        ((LoadingMoreFooter) footView).setState(LoadingMoreFooter.STATE_NOMORE);
    } else {
        footView.setVisibility(View.GONE);
    }
    // 额外添加的footView
    if (isOther) {
        footView.setVisibility(View.VISIBLE);
    }
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:15,代码来源:XRecyclerView.java

示例7: fadeIn

import android.view.View; //导入方法依赖的package包/类
static void fadeIn(View view, int duration) {
    Animation anim = new AlphaAnimation(0.0f, 1.0f);
    anim.setInterpolator(new AccelerateDecelerateInterpolator());
    anim.setDuration(duration);

    view.setAnimation(anim);
    view.setVisibility(View.VISIBLE);
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:9,代码来源:SearchAnimator.java

示例8: addStatusBarColor

import android.view.View; //导入方法依赖的package包/类
private static void addStatusBarColor(final Activity activity, final int color, final int alpha, boolean isDecor) {
    ViewGroup parent = isDecor ?
            (ViewGroup) activity.getWindow().getDecorView() :
            (ViewGroup) activity.findViewById(android.R.id.content);
    View fakeStatusBarView = parent.findViewWithTag(TAG_COLOR);
    if (fakeStatusBarView != null) {
        if (fakeStatusBarView.getVisibility() == View.GONE) {
            fakeStatusBarView.setVisibility(View.VISIBLE);
        }
        fakeStatusBarView.setBackgroundColor(getStatusBarColor(color, alpha));
    } else {
        parent.addView(createColorStatusBarView(parent.getContext(), color, alpha));
    }
}
 
开发者ID:Wilshion,项目名称:HeadlineNews,代码行数:15,代码来源:BarUtils.java

示例9: initViews

import android.view.View; //导入方法依赖的package包/类
private void initViews() {
    mFingerprintImageView = (View) findViewById(R.id.fingerprint_image);

    if (isFingerPrintLockEnabled) {
        mFingerprintImageView.setVisibility(View.VISIBLE);
    }
    else {
        mFingerprintImageView.setVisibility(View.GONE);
    }
    mPatternLockView = (PatternLockView) findViewById(R.id.pattern_lock_view);
}
 
开发者ID:gsttarun,项目名称:AppLockLibrary,代码行数:12,代码来源:LockActivity.java

示例10: scaleShow

import android.view.View; //导入方法依赖的package包/类
public static void scaleShow(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    view.setVisibility(View.VISIBLE);
    ViewCompat.animate(view)
            .scaleX(1.0f)
            .scaleY(1.0f)
            .alpha(1.0f)
            .setDuration(800)
            .setListener(viewPropertyAnimatorListener)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .start();
}
 
开发者ID:Pingsh,项目名称:Mix,代码行数:12,代码来源:AnimatorUtil.java

示例11: changeBindViewVisibility

import android.view.View; //导入方法依赖的package包/类
/**
 * 更改绑定布局的显示状态
 *
 * @param visible 显示的状态
 */
private void changeBindViewVisibility(int visible) {
    final View[] views = mBindViews;
    if (views == null || views.length == 0)
        return;

    for (View view : views) {
        view.setVisibility(visible);
    }
}
 
开发者ID:FZZFVII,项目名称:pipe,代码行数:15,代码来源:EmptyView.java

示例12: setCategories

import android.view.View; //导入方法依赖的package包/类
public void setCategories(SparseArray<SpeciesCategory> categories, SparseIntArray categoryData) {
    LinearLayout categoriesView = (LinearLayout) findViewById(R.id.categories);
    categoriesView.removeAllViews();
    for (int i = 0; i < SpeciesInformation.getSpeciesCategories().size() && i < DISPLAY_CATEGORIES; i++) {
        CatchCategoryItem item = new CatchCategoryItem(mContext);
        SpeciesCategory speciesCategory = categories.get(categories.keyAt(i));
        item.setContents(categoryData.get(speciesCategory.mId), speciesCategory.mName);
        item.setLayoutParams(new CatchCategoryItem.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, 1f));
        if (i < DISPLAY_CATEGORIES - 1) {
            View separator = item.findViewById(R.id.divider);
            separator.setVisibility(View.VISIBLE);
        }
        categoriesView.addView(item);
    }
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-android,代码行数:16,代码来源:GameCalendar.java

示例13: calcAndRefreshStickTopView

import android.view.View; //导入方法依赖的package包/类
protected void calcAndRefreshStickTopView() {
	Collections.sort(listStickTop, new Comparator<ForumForum>() {
		@Override
		public int compare(ForumForum lhs, ForumForum rhs) {
			return new Long(lhs.fid - rhs.fid).intValue();
		}
	});
	//Reuse the view created last time.
	for (int i = 0; i < listStickTop.size(); i++) {
		View viewchild = layoutSticktop.getChildAt(i);
		View view = createSticktopItem(listStickTop.get(i), viewchild, layoutSticktop);
		view.setVisibility(VISIBLE);
		if(viewchild == null) {
			layoutSticktop.addView(view);
		}
	}
	int childcount = layoutSticktop.getChildCount();
	if(childcount > listStickTop.size()) {
		for(int i = listStickTop.size(); i < childcount; i++) {
			layoutSticktop.getChildAt(i).setVisibility(GONE);
		}
	}

	if (layoutSticktop.getChildCount() == 0) {
		layoutSticktop.setVisibility(View.GONE);
	} else {
		layoutSticktop.setVisibility(VISIBLE);
	}
}
 
开发者ID:MobClub,项目名称:BBSSDK-for-Android,代码行数:30,代码来源:Theme0ForumForumView.java

示例14: setupStatusBarView

import android.view.View; //导入方法依赖的package包/类
private void setupStatusBarView(Context context, ViewGroup decorViewGroup) {
    mStatusBarTintView = new View(context);
    FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, mConfig.getStatusBarHeight());
    params.gravity = Gravity.TOP;
    if (mNavBarAvailable && !mConfig.isNavigationAtBottom()) {
        params.rightMargin = mConfig.getNavigationBarWidth();
    }
    mStatusBarTintView.setLayoutParams(params);
    mStatusBarTintView.setBackgroundColor(DEFAULT_TINT_COLOR);
    mStatusBarTintView.setVisibility(View.GONE);
    decorViewGroup.addView(mStatusBarTintView);
}
 
开发者ID:devzwy,项目名称:KUtils,代码行数:13,代码来源:SystemBarTintManager.java

示例15: updateField

import android.view.View; //导入方法依赖的package包/类
private void updateField(TextView v, CharSequence text, View label) {
    boolean hasText = !TextUtils.isEmpty(text);

    v.setText(text);
    v.setVisibility(hasText ? View.VISIBLE : View.GONE);
    label.setVisibility(hasText ? View.VISIBLE : View.GONE);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:8,代码来源:ICalendarPublishView.java


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