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


Java ImageView.setVisibility方法代码示例

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


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

示例1: verifCorreto

import android.widget.ImageView; //导入方法依赖的package包/类
public void verifCorreto(View view) {
    imageView = (ImageView) findViewById(R.id.wink);
    imageView.setImageResource(R.drawable.happy);
    imageView.setVisibility(View.VISIBLE);

    findViewById(R.id.textCorreto).setVisibility(View.VISIBLE);
    findViewById(R.id.enunciado).setVisibility(View.GONE);
    findViewById(R.id.buttonErrado3).setVisibility(View.GONE);
    findViewById(R.id.buttonErrado2).setVisibility(View.GONE);
    findViewById(R.id.buttonErrado1).setVisibility(View.GONE);
    findViewById(R.id.buttonCorreto).setVisibility(View.GONE);
    findViewById(R.id.buttonNext).setVisibility(View.VISIBLE);
    findViewById(R.id.vmsPrati).setVisibility(View.GONE);
    findViewById(R.id.atividade).setVisibility(View.GONE);
    findViewById(R.id.space).setVisibility(View.GONE);

}
 
开发者ID:jvbeltra,项目名称:JavaIsFun,代码行数:18,代码来源:Condicao15.java

示例2: createCrossImage

import android.widget.ImageView; //导入方法依赖的package包/类
private void createCrossImage() {
    crossImageView = new ImageView(getContext());
    // Dismiss the dialog when user click on the 'x'
    crossImageView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            sendCancelToListener();
            WebDialog.this.dismiss();
        }
    });
    Drawable crossDrawable = getContext().getResources().getDrawable(R.drawable.com_facebook_close);
    crossImageView.setImageDrawable(crossDrawable);
    /* 'x' should not be visible while webview is loading
     * make it visible only after webview has fully loaded
     */
    crossImageView.setVisibility(View.INVISIBLE);
}
 
开发者ID:MobileDev418,项目名称:chat-sdk-android-push-firebase,代码行数:18,代码来源:WebDialog.java

示例3: onCreate

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	topContentView = (ViewGroup) LayoutInflater.from(getActivity()).inflate(R.layout.tt_fragment_base, null);

	topBar = (ViewGroup) topContentView.findViewById(R.id.topbar);
	topTitleTxt = (TextView) topContentView.findViewById(R.id.base_fragment_title);
	topLetTitleTxt = (TextView) topContentView.findViewById(R.id.left_txt);
	topRightTitleTxt = (TextView) topContentView.findViewById(R.id.right_txt);
	topLeftBtn = (ImageView) topContentView.findViewById(R.id.left_btn);
	topRightBtn = (ImageView) topContentView.findViewById(R.id.right_btn);
	topContactTitle = (TopTabButton) topContentView.findViewById(R.id.contact_tile);
	topSearchEdt = (SearchEditText) topContentView.findViewById(R.id.chat_title_search);
	topLeftContainerLayout=(RelativeLayout)topContentView.findViewById(R.id.top_left_container);
	searchFrameLayout = (FrameLayout)topContentView.findViewById(R.id.searchbar);
	topContactFrame = (FrameLayout)topContentView.findViewById(R.id.contactTopBar);
			
	topTitleTxt.setVisibility(View.GONE);
	topRightBtn.setVisibility(View.GONE);
	topLeftBtn.setVisibility(View.GONE);
	topLetTitleTxt.setVisibility(View.GONE);
	topRightTitleTxt.setVisibility(View.GONE);
	topContactTitle.setVisibility(View.GONE);
	topSearchEdt.setVisibility(View.GONE);
}
 
开发者ID:ccfish86,项目名称:sctalk,代码行数:27,代码来源:TTBaseFragment.java

示例4: getView

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
  // Inflate our row and find our views!
  View rowItem = mInflater.inflate(R.layout.li_friend, parent, false);
  ImageView img = rowItem.findViewById(R.id.li_friend_img);
  TextView name = rowItem.findViewById(R.id.li_name_tv);
  ImageView vader = rowItem.findViewById(R.id.li_starwars_img);

  // Getting the data for this specific row!
  Friend friend = getItem(position);

  name.setText(friend.getName());
  Picasso.with(mContext).load(friend.getImageUrl()).into(img);
  if (friend.isAStarWarsLover()) {
    vader.setVisibility(View.VISIBLE);
  }

  return rowItem;
}
 
开发者ID:JozeRi,项目名称:AndroidAcademyTLV-ListsAndAdapters,代码行数:20,代码来源:FriendsBaseAdapter.java

示例5: startEditMode

import android.widget.ImageView; //导入方法依赖的package包/类
private void startEditMode(RecyclerView parent) {
    this.isEditMode = true;
    int childCount = parent.getChildCount();
    for (int i = 0; i < childCount; i++) {
        View view = parent.getChildAt(i);
        if (view != null) {
            ImageView imgEdit = (ImageView) view.findViewById(R.id.edit_tip);
            RelativeLayout layout = (RelativeLayout) view.findViewById(R.id.item_group_id);
            if (layout != null) {
                layout.setBackgroundResource(R.drawable.channel_wall_item_selecter_bg);
            }
            if (imgEdit != null) {
                if (((Integer) imgEdit.getTag()).intValue() == 0) {
                    imgEdit.setBackgroundResource(2130837812);
                } else {
                    imgEdit.setBackgroundResource(2130837811);
                }
                imgEdit.setVisibility(0);
            }
        }
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:23,代码来源:ChannelFragmentAdapter.java

示例6: setNameIconView

import android.widget.ImageView; //导入方法依赖的package包/类
private static void setNameIconView(ChatRoomMessage message, ImageView nameIconView) {
    final String KEY = "type";
    Map<String, Object> ext = message.getRemoteExtension();
    if (ext == null || !ext.containsKey(KEY)) {
        nameIconView.setVisibility(View.GONE);
        return;
    }

    MemberType type = MemberType.typeOfValue((Integer) ext.get(KEY));
    if (type == MemberType.ADMIN) {
        nameIconView.setImageResource(R.drawable.admin_icon);
        nameIconView.setVisibility(View.VISIBLE);
    } else if (type == MemberType.CREATOR) {
        nameIconView.setImageResource(R.drawable.master_icon);
        nameIconView.setVisibility(View.VISIBLE);
    } else {
        nameIconView.setVisibility(View.GONE);
    }
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:20,代码来源:ChatRoomViewHolderHelper.java

示例7: onBindDialogView

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
protected void onBindDialogView(View view) {
    super.onBindDialogView(view);
    final ImageView iconView = (ImageView) view.findViewById(R.id.icon);
    if (mMyIcon != null) {
        iconView.setImageDrawable(mMyIcon);
    } else {
        iconView.setVisibility(View.GONE);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:11,代码来源:SeekBarDialogPreference.java

示例8: setViewImage

import android.widget.ImageView; //导入方法依赖的package包/类
private void setViewImage(ImageView v, Integer value) {
    if (value == 0)
        return;
    if (value == -1)
        v.setVisibility(View.INVISIBLE);
    else {
        v.setImageResource(value);
        v.setVisibility(View.VISIBLE);
    }

}
 
开发者ID:abook23,项目名称:godlibrary,代码行数:12,代码来源:SimpleAdapter.java

示例9: setImageOrSensitive

import android.widget.ImageView; //导入方法依赖的package包/类
private void setImageOrSensitive(String url, ImageView imageView, boolean sensitiveContent) {
    if (!sensitiveContent) {
        Glide
                .with(parentCtx)
                .load(url)
                .crossFade()
                .into(imageView);
    } else {
        imageView.setImageDrawable(new ColorDrawable(Color.GRAY));
    }
    imageView.setVisibility(View.VISIBLE);
}
 
开发者ID:gsora,项目名称:TootApp,代码行数:13,代码来源:StatusesListAdapter.java

示例10: clearImageViews

import android.widget.ImageView; //导入方法依赖的package包/类
void clearImageViews() {
    for (int index = 0; index < imageCount; index++) {
        final ImageView imageView = imageViews[index];
        if (imageView != null) {
            imageView.setVisibility(GONE);
        }
    }
    imageCount = 0;
}
 
开发者ID:ihsanbal,项目名称:Wiv,代码行数:10,代码来源:MediaView.java

示例11: initView

import android.widget.ImageView; //导入方法依赖的package包/类
private void initView() {
    pollId = getIntent().getLongExtra("pollId", 0);
    content = DbManager.getInstance().getPollDetails(pollId);

    ivBack = (ImageView) findViewById(R.id.ivBack);
    ivNext = (ImageView) findViewById(R.id.ivNext);
    tvHeader = (TextView) findViewById(R.id.tvHeader);
    ivNext.setVisibility(View.INVISIBLE);
    tvHeader.setText("Poll Response");

    tvExpiryTime = (TextView) findViewById(R.id.tvExpiryTime);
    tvPollQuestion = (TextView) findViewById(R.id.tvPollQuestion);
    tvOptionOne = (TextView) findViewById(R.id.tvOptionOne);
    tvOptionTwo = (TextView) findViewById(R.id.tvOptionTwo);
    tvOptionThree = (TextView) findViewById(R.id.tvOptionThree);
    tvOptionFour = (TextView) findViewById(R.id.tvOptionFour);
    btnRespond = (Button) findViewById(R.id.btnRespond);
    llOptions= (LinearLayout) findViewById(R.id.llOptions);
    llCheckbox = (LinearLayout) findViewById(R.id.llCheckbox);
    llRadioButton = (LinearLayout) findViewById(R.id.llRadioButton);
    rgOptions = (RadioGroup) findViewById(R.id.rgOptions);
    rdOptionOne = (RadioButton) findViewById(R.id.rdOptionOne);
    rdOptionTwo = (RadioButton) findViewById(R.id.rdOptionTwo);
    rdOptionThree = (RadioButton) findViewById(R.id.rdOptionThree);
    rdOptionFour = (RadioButton) findViewById(R.id.rdOptionFour);
    cbOptionOne = (CheckBox) findViewById(R.id.cbOptionOne);
    cbOptionTwo = (CheckBox) findViewById(R.id.cbOptionTwo);
    cbOptionThree = (CheckBox) findViewById(R.id.cbOptionThree);
    cbOptionFour = (CheckBox) findViewById(R.id.cbOptionFour);
    tvYourResponse = (TextView) findViewById(R.id.tvYourResponse);
    etDescriptive = (EditText) findViewById(R.id.etDescriptive);

    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.hide();
    }
}
 
开发者ID:StringflowServer,项目名称:Beach-Android,代码行数:38,代码来源:PollResponseActivity.java

示例12: updateIndicator

import android.widget.ImageView; //导入方法依赖的package包/类
public void updateIndicator(int count) {
    if(dotViews == null){
        return;
    }
    for(int i = 0 ; i < dotViews.size() ; i++){
        if(i >= count){
            dotViews.get(i).setVisibility(GONE);
            ((View)dotViews.get(i).getParent()).setVisibility(GONE);
        }
        else {
            dotViews.get(i).setVisibility(VISIBLE);
            ((View)dotViews.get(i).getParent()).setVisibility(VISIBLE);
        }
    }
    if(count > dotViews.size()){
        int diff = count - dotViews.size();
        for(int i = 0 ; i < diff ; i++){
            RelativeLayout rl = new RelativeLayout(context);
            LayoutParams params = new LayoutParams(dotHeight,dotHeight);
            RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
            layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
            ImageView imageView = new ImageView(context);
            imageView.setImageBitmap(unselectedBitmap);
            rl.addView(imageView, layoutParams);
            rl.setVisibility(View.GONE);
            imageView.setVisibility(View.GONE);
            this.addView(rl, params);
            dotViews.add(imageView);
        }
    }
}
 
开发者ID:funnyzhaov,项目名称:Tribe,代码行数:32,代码来源:EaseEmojiconIndicatorView.java

示例13: onPostExecute

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
protected final void onPostExecute(@NonNull final ImageView view, @Nullable final Bitmap data,
                                   @NonNull final TabItem... params) {
    view.setImageBitmap(data);
    view.setVisibility(data != null ? View.VISIBLE : View.GONE);
    TabItem tabItem = params[0];
    childViewRecycler.remove(tabItem.getTab());
}
 
开发者ID:NeoTerm,项目名称:NeoTerm,代码行数:9,代码来源:PreviewDataBinder.java

示例14: verif

import android.widget.ImageView; //导入方法依赖的package包/类
public void verif(View view){

        findViewById(R.id.imageButton114).setVisibility(View.VISIBLE);
        findViewById(R.id.button7).setVisibility(View.GONE);

        FlexboxLayout flexboxLayout = (FlexboxLayout) findViewById(R.id.flexTop);
        int count = flexboxLayout.getChildCount();
        int laco=0;
        for(int i =0;i<count;i++){
            View v = flexboxLayout.getChildAt(i);
            laco++;
            if(laco==1){
                if(v==findViewById(R.id.button28)){
                    cont++;
                }
            }else if(laco==2){
                if(v==findViewById(R.id.button19)){
                    cont++;
                }
            }else if(laco==3){
                if(v==findViewById(R.id.button23)){
                    cont++;
                }
            }else if(laco==4){
                if(v==findViewById(R.id.button21)){
                    cont++;
                }
            }else if(laco==5){
                if(v==findViewById(R.id.button25)){
                    cont++;
                }
            }else if(laco==6){
                if(v==findViewById(R.id.button22)){
                    cont++;
                }
            }else if(laco==7){
                if(v==findViewById(R.id.button24)){
                    cont++;
                }
            }




        }
        ImageView imageView = (ImageView) findViewById(R.id.imageView63);
        if(cont>=7){

            findViewById(R.id.textView248).setVisibility(View.VISIBLE);
            findViewById(R.id.textView249).setVisibility(View.GONE);
            imageView.setVisibility(View.VISIBLE);

            findViewById(R.id.flexDown).setVisibility(View.GONE);






        }else{

            findViewById(R.id.textView248).setVisibility(View.GONE);
            imageView.setImageResource(R.drawable.sad);
            imageView.setVisibility(View.VISIBLE);
            findViewById(R.id.textView249).setVisibility(View.VISIBLE);
            findViewById(R.id.flexDown).setVisibility(View.GONE);
        }
    }
 
开发者ID:jvbeltra,项目名称:JavaIsFun,代码行数:69,代码来源:LacoDeRepeticao6.java

示例15: make

import android.widget.ImageView; //导入方法依赖的package包/类
/**
 * Make a themed toast with text, icon, toastBackground and the tint color.
 *
 * @param context The context to use. Usually your {@link android.app.Application}
 *                or {@link android.app.Activity} object.
 * @param text The text to show. Can be formatted text.
 * @param icon The toast icon to show.
 * @param tintColor The toast tint color based on the toastBackground. It will
 *                  automatically check for the contrast to provide best
 *                  visibility.
 * @param backgroundColor The toast toastBackground color.
 * @param duration How long to display the message. Either
 *                 {@link Toast#LENGTH_SHORT} or {@link Toast#LENGTH_LONG}.
 *
 * @return Toast with the supplied parameters. Use {@link Toast#show()}
 *         to display the toast.
 */
public static @NonNull Toast make(@NonNull Context context, @Nullable CharSequence text,
                                  @Nullable Drawable icon, @ColorInt int tintColor,
                                  @ColorInt int backgroundColor, int duration) {
    final Toast toast = new Toast(context);

    final View toastLayout = LayoutInflater.from(context).inflate(
            R.layout.adt_layout_toast, new LinearLayout(context), false);

    final ImageView toastIcon = toastLayout.findViewById(R.id.adt_toast_icon);
    final TextView toastText = toastLayout.findViewById(R.id.adt_toast_text);

    tintColor = DynamicColorUtils.getContrastColor(tintColor, backgroundColor);

    if (icon != null && !disableIcon) {
        if (iconSize != ADT_DEFAULT_ICON_SIZE) {
            toastIcon.getLayoutParams().width = iconSize;
            toastIcon.getLayoutParams().height = iconSize;
            toastIcon.requestLayout();
        }
        toastIcon.setColorFilter(tintColor);
        toastIcon.setImageDrawable(icon);
    } else {
        toastIcon.setVisibility(View.GONE);
    }

    if (textTypeface != null) {
        toastText.setTypeface(textTypeface);
    }
    if (textSize != ADT_DEFAULT_TEXT_SIZE) {
        toastText.setTextSize(TypedValue.COMPLEX_UNIT_SP, textSize);
    }
    toastText.setTextColor(tintColor);
    toastText.setText(text);

    if (toastBackground != null) {
        DynamicDrawableUtils.setBackground(toastLayout,
                DynamicDrawableUtils.colorizeDrawable(toastBackground,
                        backgroundColor, PorterDuff.Mode.MULTIPLY));
    } else {
        DynamicDrawableUtils.setBackground(toastLayout,
                DynamicDrawableUtils.colorizeDrawable(
                        ContextCompat.getDrawable(context, R.drawable.adt_toast_frame),
                        backgroundColor, PorterDuff.Mode.MULTIPLY));
    }

    toast.setDuration(duration);
    toast.setView(toastLayout);

    return toast;
}
 
开发者ID:pranavpandey,项目名称:dynamic-toasts,代码行数:68,代码来源:DynamicToast.java


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