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


Java EditText.setVisibility方法代码示例

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


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

示例1: setUpState

import android.widget.EditText; //导入方法依赖的package包/类
private void setUpState() {

        EditText enterScoreText = (EditText) findViewById(R.id.enterScoreText);
        TextView instructionText = (TextView) findViewById(R.id.instructionText);

        switch(gameState) {
            case deal:
                enterScoreText.setVisibility(View.INVISIBLE);
                instructionText.setVisibility(View.VISIBLE);
                String instruction = getResources().getString(R.string.deal, dealCount);
                if (!goingDown && dealCount == 1) {
                    instruction += " (Blind)";
                }
                instructionText.setText(instruction);
                break;
            case bid:
                enterScoreText.setVisibility(View.VISIBLE);
                instructionText.setVisibility(View.INVISIBLE);
                enterScoreText.setHint(R.string.bid);
                break;
            case score:
                enterScoreText.setHint(R.string.num_won);
                break;
        }
    }
 
开发者ID:agware,项目名称:UpAndDown,代码行数:26,代码来源:GameActivity.java

示例2: displayOptions

import android.widget.EditText; //导入方法依赖的package包/类
@Override
public void displayOptions(String[] options) {
    if (nonNull(mOptionsViewGroup)) {
        for (int i = 0; i < mOptionsViewGroup.getChildCount(); i++) {
            EditText editText = (EditText) mOptionsViewGroup.getChildAt(i);
            editText.setVisibility(View.VISIBLE);
            editText.setText(options[i]);
        }

        for (int u = mOptionsViewGroup.getChildCount() - 2; u >= 0; u--) {
            if (u == 1) {
                break;
            }

            if (TextUtils.isEmpty(options[u])) {
                mOptionsViewGroup.getChildAt(u + 1).setVisibility(View.GONE);
            } else {
                break;
            }
        }
    }
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:23,代码来源:CreatePollFragment.java

示例3: init

import android.widget.EditText; //导入方法依赖的package包/类
/**
 * 初始化操作
 */
private void init() {
	ptrID1 = INVALID_POINTER_ID;
	ptrID2 = INVALID_POINTER_ID;
	mptrID1 = INVALID_POINTER_ID;
	mptrID2 = INVALID_POINTER_ID;

	list = new ArrayList<>();
	listTvParams = new ArrayList<>();
	listDistance = new ArrayList<>();

	editText = new EditText(context);
	editText.setLayoutParams(
			new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
	editText.setVisibility(GONE);
	addView(editText);
}
 
开发者ID:smartbeng,项目名称:PaoMovie,代码行数:20,代码来源:MyRelativeLayout.java

示例4: builder

import android.widget.EditText; //导入方法依赖的package包/类
public CustomAlertDialog builder() {
    view = LayoutInflater.from(context).inflate(R.layout.view_alertdialog, null);

    lLayout_bg = (LinearLayout) view.findViewById(R.id.layout_bg);
    txt_title = (TextView) view.findViewById(R.id.txt_title);
    txt_title.setVisibility(View.GONE);
    txt_msg = (TextView) view.findViewById(R.id.txt_msg);
    txt_msg.setVisibility(View.GONE);
    et_input = (EditText) view.findViewById(R.id.et_input);
    et_input.setVisibility(View.GONE);
    btn_neg = (Button) view.findViewById(R.id.btn_neg);
    btn_neg.setVisibility(View.GONE);
    btn_pos = (Button) view.findViewById(R.id.btn_pos);
    btn_pos.setVisibility(View.GONE);
    btn_mid = (Button) view.findViewById(R.id.btn_mid);
    btn_mid.setVisibility(View.GONE);
    line1 = (ImageView) view.findViewById(R.id.line1);
    line1.setVisibility(View.GONE);
    line2 = (ImageView) view.findViewById(R.id.line2);
    line2.setVisibility(View.GONE);

    dialog = new Dialog(context, R.style.AlertDialogStyle);
    dialog.setContentView(view);

    lLayout_bg.setLayoutParams(new FrameLayout.LayoutParams((int) (
            display.getWidth() * 0.85), LayoutParams.WRAP_CONTENT));

    return this;
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:30,代码来源:CustomAlertDialog.java

示例5: builder

import android.widget.EditText; //导入方法依赖的package包/类
public CustomAlertPPtDialog builder() {
    view = LayoutInflater.from(context).inflate(R.layout.view_alertdialog, null);

    lLayout_bg = (LinearLayout) view.findViewById(R.id.layout_bg);
    txt_title = (TextView) view.findViewById(R.id.txt_title);
    txt_title.setVisibility(View.GONE);
    txt_msg = (TextView) view.findViewById(R.id.txt_msg);
    txt_msg.setVisibility(View.GONE);
    et_input = (EditText) view.findViewById(R.id.et_input);
    et_input.setVisibility(View.GONE);
    btn_neg = (Button) view.findViewById(R.id.btn_neg);
    btn_neg.setVisibility(View.GONE);
    btn_pos = (Button) view.findViewById(R.id.btn_pos);
    btn_pos.setVisibility(View.GONE);
    btn_mid = (Button) view.findViewById(R.id.btn_mid);
    btn_mid.setVisibility(View.GONE);
    line1 = (ImageView) view.findViewById(R.id.line1);
    line1.setVisibility(View.GONE);
    line2 = (ImageView) view.findViewById(R.id.line2);
    line2.setVisibility(View.GONE);

    dialog = new Dialog(context, R.style.AlertDialogStyle);
    dialog.setContentView(view);

    lLayout_bg.setLayoutParams(new FrameLayout.LayoutParams((int) (
            display.getWidth() * 0.85), LayoutParams.WRAP_CONTENT));

    return this;
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:30,代码来源:CustomAlertPPtDialog.java

示例6: initialize

import android.widget.EditText; //导入方法依赖的package包/类
/**
    * Initialize data and GUI elements.
    */
   private void initialize() {
	dbAdapter = new DatabaseAdapter(this);
	dbAdapter.open();
	
   	customCD = (RadioButton)findViewById(R.id.custom_closing_day);
   	regularCD = (RadioButton)findViewById(R.id.regular_closing_day);
   	newClosingDay = (EditText)findViewById(R.id.new_closing_day);
   	
   	customClosingDay = dbAdapter.getCustomClosingDay(accountId, periodKey);
   	if (customClosingDay>0) {
   		// select custom closing day and fill edit text
   		newClosingDay.setText(Integer.toString(customClosingDay));
   		customCD.setChecked(true);
   	} else {
   		// select regular closing day and disable edit text
   		regularCD.setChecked(true);
   		newClosingDay.setVisibility(EditText.GONE);
   	}
   	
	setLabels();
	setListeners();
	
	this.setTitle(R.string.closing_day_title);
	
	if (customClosingDay>0) {
		EditText newCD = (EditText)findViewById(R.id.new_closing_day);
		newCD.setText(Integer.toString(customClosingDay));
		// set custom closing day selected
		regularCD.setChecked(false);
		customCD.setChecked(true);
	} else {
		// set regular closing day selected
		customCD.setChecked(false);
		regularCD.setChecked(true);			
	}
}
 
开发者ID:tiberiusteng,项目名称:financisto1-holo,代码行数:40,代码来源:CCardStatementClosingDayActivity.java

示例7: prepare

import android.widget.EditText; //导入方法依赖的package包/类
@Override
protected void prepare(ViewGroup layout) {
    super.prepare(layout);
    EditText prompt = (EditText) layout.findViewById(R.id.js_modal_dialog_prompt);
    prompt.setVisibility(View.VISIBLE);

    if (mDefaultPromptText.length() > 0) {
        prompt.setText(mDefaultPromptText);
        prompt.selectAll();
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:12,代码来源:JavascriptAppModalDialog.java

示例8: setEdit

import android.widget.EditText; //导入方法依赖的package包/类
private void setEdit(View v, String s, int hint_res, TextWatcher w) {
  EditText t = (EditText)v.findViewById(R.id.setting_edit);
  t.setVisibility(View.VISIBLE);
  t.addTextChangedListener(w);
  t.setText(s);
  t.setSelection(s.length());
  t.setHint(hint_res);
}
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:9,代码来源:AlarmOptions.java

示例9: initViews

import android.widget.EditText; //导入方法依赖的package包/类
private void initViews() {
	etPwd = (EditText)findViewById(R.id.pwd);
	etInfo = (EditText)findViewById(R.id.info);
	tvTip = (TextView)findViewById(R.id.tip);
	tvErrorMsg = (TextView)findViewById(R.id.errorMsg);
	btnOperate = (Button)findViewById(R.id.ok);
	btnOperate.setOnClickListener(this);
	
	//取得从上一个Activity传递过来的数据
	bundle = this.getIntent().getExtras();
	actBar.setTitle(bundle.getString(BAR_TITLE));
	etInfo.setText(bundle.getString(INFO));
	if (bundle.getBoolean(INFO_READONLY)){
		etInfo.setKeyListener(null);
	}else{
		etInfo.setSelection(etInfo.getText().length());
	}
	strRegex = bundle.getString(REGEX);
	tvTip.setText(bundle.getString(TIP));
	btnOperate.setText(bundle.getString(OPERATE_TEXT));
	
	//设置隐藏项
	String strOperate = bundle.getString(OPERATE);
	if (strOperate.equals(OPERATE_BIND_EMAIL) || strOperate.equals(OPERATE_BIND_PHONE)){
		etPwd.setVisibility(View.VISIBLE);
	}else{
		etPwd.setVisibility(View.GONE);
	}
}
 
开发者ID:SShineTeam,项目名称:Huochexing12306,代码行数:30,代码来源:EditTextAty.java

示例10: initMyView

import android.widget.EditText; //导入方法依赖的package包/类
private void initMyView(){
	sobot_leavemsg_nikename = (EditText) findViewById(getResId("sobot_leavemsg_nikename"));
	sobot_leavemsg_phone = (EditText) findViewById(getResId("sobot_leavemsg_phone"));
	sobot_et_email = (EditText) findViewById(getResId("sobot_et_email"));
	sobot_frist_line = findViewById(getResId("sobot_frist_line"));
	sobot_second_line = findViewById(getResId("sobot_second_line"));
	sobot_et_content = (EditText) findViewById(getResId("sobot_et_content"));
	sobot_tv_post_msg1 = (TextView) findViewById(getResId("sobot_tv_post_msg1"));
	sobot_enclosure_hint = (TextView) findViewById(getResId("sobot_enclosure_hint"));
	sobot_post_msg_layout =(RelativeLayout) findViewById(getResId("sobot_post_msg_layout"));
	sobot_img_clear_nikename = (ImageView) findViewById(getResId("sobot_img_clear_nikename"));
	sobot_img_clear_email = (ImageView) findViewById(getResId("sobot_img_clear_email"));
	sobot_img_clear_phone = (ImageView) findViewById(getResId("sobot_img_clear_phone"));
	sobot_enclosure_container = (LinearLayout) findViewById(getResId("sobot_enclosure_container"));

	sobot_leavemsg_nikename.setText(SharedPreferencesUtil.getStringData(this,"sobot_user_nikename",""));
	sobot_leavemsg_phone.setText(SharedPreferencesUtil.getStringData(this,"sobot_user_phone",""));

	if ("1".equals(ticketStartWay)){
		sobot_et_email.setVisibility(View.VISIBLE);

		if (telShowFlag){
			sobot_leavemsg_phone.setVisibility(View.VISIBLE);
		} else {
			sobot_leavemsg_phone.setVisibility(View.GONE);
		}
	} else {
		sobot_leavemsg_phone.setVisibility(View.VISIBLE);

		if (emailShowFlag){
			sobot_et_email.setVisibility(View.VISIBLE);
		} else {
			sobot_et_email.setVisibility(View.GONE);
		}
	}

	if (isShowNikeNameTv){
		sobot_leavemsg_nikename.setVisibility(View.VISIBLE);
	} else {
		sobot_leavemsg_nikename.setVisibility(View.GONE);
	}

	if (emailShowFlag && telShowFlag && isShowNikeNameTv){
		sobot_frist_line.setVisibility(View.VISIBLE);
		sobot_second_line.setVisibility(View.VISIBLE);
	} else if (emailShowFlag && telShowFlag){
		sobot_frist_line.setVisibility(View.VISIBLE);
		sobot_second_line.setVisibility(View.GONE);
	} else if (telShowFlag && isShowNikeNameTv){
		sobot_frist_line.setVisibility(View.GONE);
		sobot_second_line.setVisibility(View.VISIBLE);
	} else if (emailShowFlag && isShowNikeNameTv){
		sobot_frist_line.setVisibility(View.VISIBLE);
		sobot_second_line.setVisibility(View.GONE);
	} else {
		sobot_frist_line.setVisibility(View.GONE);
		sobot_second_line.setVisibility(View.GONE);
	}

	if(enclosureShowFlag){
		sobot_enclosure_container.setVisibility(View.VISIBLE);
		initPicListView();
	}else{
		sobot_enclosure_container.setVisibility(View.GONE);
	}
}
 
开发者ID:fengdongfei,项目名称:CXJPadProject,代码行数:67,代码来源:SobotPostMsgActivity.java

示例11: UserDictionaryAddWordContents

import android.widget.EditText; //导入方法依赖的package包/类
UserDictionaryAddWordContents(final View view, final Bundle args) {
    mWordEditText = (EditText)view.findViewById(R.id.user_dictionary_add_word_text);
    mShortcutEditText = (EditText)view.findViewById(R.id.user_dictionary_add_shortcut);
    if (!UserDictionarySettings.IS_SHORTCUT_API_SUPPORTED) {
        mShortcutEditText.setVisibility(View.GONE);
        view.findViewById(R.id.user_dictionary_add_shortcut_label).setVisibility(View.GONE);
    }
    final String word = args.getString(EXTRA_WORD);
    if (null != word) {
        mWordEditText.setText(word);
        // Use getText in case the edit text modified the text we set. This happens when
        // it's too long to be edited.
        mWordEditText.setSelection(mWordEditText.getText().length());
    }
    final String shortcut;
    if (UserDictionarySettings.IS_SHORTCUT_API_SUPPORTED) {
        shortcut = args.getString(EXTRA_SHORTCUT);
        if (null != shortcut && null != mShortcutEditText) {
            mShortcutEditText.setText(shortcut);
        }
        mOldShortcut = args.getString(EXTRA_SHORTCUT);
    } else {
        shortcut = null;
        mOldShortcut = null;
    }
    mMode = args.getInt(EXTRA_MODE); // default return value for #getInt() is 0 = MODE_EDIT
    mOldWord = args.getString(EXTRA_WORD);
    updateLocale(args.getString(EXTRA_LOCALE));
}
 
开发者ID:sergeychilingaryan,项目名称:AOSP-Kayboard-7.1.2,代码行数:30,代码来源:UserDictionaryAddWordContents.java

示例12: closeSearch

import android.widget.EditText; //导入方法依赖的package包/类
public void closeSearch() {
	//Log.v(APP_TAG, "Quit search");
	//hideKeyboard();
	EditText text = (EditText)findViewById(R.id.textField);
	text.setText("");
	findViewById(R.id.searchBar).setVisibility(View.GONE);
	findViewById(R.id.webSearchButton).setVisibility(View.GONE);
	text.setVisibility(View.GONE);
	findViewById(R.id.tabs).setVisibility(View.VISIBLE);
	if (!dock.isEmpty()) {
		dock.unhide();
	}
	searchIsOpened=false;
}
 
开发者ID:HenriDellal,项目名称:emerald,代码行数:15,代码来源:Apps.java

示例13: init

import android.widget.EditText; //导入方法依赖的package包/类
private void init(Context context) {

        setClipToPadding(false);

        FrameLayout.LayoutParams linearLayoutParams = new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        linearLayoutParams.gravity = Gravity.CENTER;

        FrameLayout.LayoutParams editTextLayoutParams = new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        editTextLayoutParams.gravity = Gravity.CENTER;

        animatedPlaceholder = new LinearLayout(context);
        animatedPlaceholder.setVisibility(INVISIBLE);
        animatedPlaceholder.setOrientation(LinearLayout.HORIZONTAL);
        animatedPlaceholder.setClipToPadding(false);
        animatedPlaceholder.setPadding(0, 20, 0, 0);

        actualEditText = new EditText(context);
        actualEditText.setBackground(null);
        actualEditText.setGravity(Gravity.CENTER);
        actualEditText.setIncludeFontPadding(false);
        actualEditText.setVisibility(INVISIBLE);
        actualEditText.setPadding(0, 20, 0, 0);

        if (!TextUtils.isEmpty(text)) actualEditText.setText(text);
        if (!TextUtils.isEmpty(hint)) actualEditText.setHint(hint);
        if (textColor != -1) actualEditText.setTextColor(textColor);
        if (hintColor != -1) actualEditText.setHintTextColor(hintColor);
        if (textSize != -1) actualEditText.setTextSize(textSize);

        addView(animatedPlaceholder, linearLayoutParams);
        addView(actualEditText, editTextLayoutParams);

        if (autoStart) startAnimation();
    }
 
开发者ID:mcassiano,项目名称:cute-currency-view,代码行数:37,代码来源:CuteCurrencyView.java

示例14: showEditText

import android.widget.EditText; //导入方法依赖的package包/类
private void showEditText(EditText ... editTexts)
{
    for (EditText anEditText : editTexts)
    {
        anEditText.setEnabled(true);
        anEditText.setClickable(true);

        anEditText.setVisibility(View.VISIBLE);
    }
}
 
开发者ID:kflauri2312lffds,项目名称:Android_watch_magpie,代码行数:11,代码来源:FragmentSettings.java

示例15: hideEditText

import android.widget.EditText; //导入方法依赖的package包/类
private void hideEditText(EditText ... editTexts)
{
    for (EditText anEditText : editTexts)
    {
        anEditText.setEnabled(false);
        anEditText.setClickable(false);
        anEditText.setVisibility(View.GONE);
    }
}
 
开发者ID:kflauri2312lffds,项目名称:Android_watch_magpie,代码行数:10,代码来源:FragmentSettings.java


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