當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。