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


Java EditText.setOnClickListener方法代码示例

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


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

示例1: setDatePickerListener

import android.widget.EditText; //导入方法依赖的package包/类
private void setDatePickerListener(final EditText birthday) {
    birthday.setOnClickListener(new View.OnClickListener() {
        @Override public void onClick(View v) {
            showDatePicker((EditText) v);
        }
    });
}
 
开发者ID:datalink747,项目名称:Rx_java2_soussidev,代码行数:8,代码来源:RxVerifyfragment.java

示例2: initView

import android.widget.EditText; //导入方法依赖的package包/类
private void initView(View view)
{
    lv_chatting= (ListView) view.findViewById(R.id.lv_chatting);
    btn_chatting_send= (Button) view.findViewById(R.id.btn_chatting_send);
    et_chatting_text= (EditText) view.findViewById(R.id.et_chatting_text);

    //适配器初始化以及与ListView的绑定
    adapter=new ChattingAdapter(mList);
    lv_chatting.setAdapter(adapter);
    //取消ListView的分割线
    lv_chatting.setDivider(null);
    //机器人欢迎话语
    showButlerResponse("你好,人家是向玮鑫的小管家啦~");

    btn_chatting_send.setOnClickListener(this);
    et_chatting_text.setOnClickListener(this);
}
 
开发者ID:WindFromFarEast,项目名称:SmartButler,代码行数:18,代码来源:ButlerFragment.java

示例3: initEditText

import android.widget.EditText; //导入方法依赖的package包/类
private void initEditText() {
    mEditText = (EditText) findViewById(R.id.input);
    mEditText.setFocusableInTouchMode(true);
    mInputContainer = (LinearLayout) findViewById(R.id.input_container);
    OnClickListener listener = v -> {
        if (mWindow != null) {
            mWindow.requestWindowFocus();
            mEditText.requestFocus();
        }
    };
    mEditText.setOnClickListener(listener);
    mInputContainer.setOnClickListener(listener);
}
 
开发者ID:hyb1996,项目名称:Auto.js,代码行数:14,代码来源:ConsoleView.java

示例4: beautyEditText

import android.widget.EditText; //导入方法依赖的package包/类
protected void beautyEditText(final EditText mEditText, String hintStr, TextWatcher mTextWatcher) {
    mEditText.setHint(hintStr);
    mEditText.setHintTextColor(Color.parseColor("#1e0d0d0d"));
    mEditText.setTextColor(Color.parseColor("#0d0d0d"));
    SDKUtils.setBackground(mEditText, this.crMgmt.getDrawable("uac_input", true));
    mEditText.setTextSize(16.0f);
    if (mTextWatcher != null) {
        mEditText.addTextChangedListener(mTextWatcher);
    }
    mEditText.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            mEditText.setSelection(mEditText.length());
            mEditText.requestFocus();
            mEditText.setFocusable(true);
        }
    });
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:18,代码来源:BasicActivity.java

示例5: initViews

import android.widget.EditText; //导入方法依赖的package包/类
@Override
public void initViews() {
    post_recycler = (RecyclerView) findViewById(R.id.post_recycler);
    text_quit = (TextView) findViewById(R.id.text_quit);
    text_save = (TextView) findViewById(R.id.text_save);
    text_send = (TextView) findViewById(R.id.text_send);
    headView = LayoutInflater.from(this).inflate(R.layout.beegree_post_head_view, null);
    footView = LayoutInflater.from(this).inflate(R.layout.beegree_post_foot_view, null);
    image_cover_button = (ImageView) headView.findViewById(R.id.image_cover_button);
    edit_title = (EditText) headView.findViewById(R.id.edit_title);
    edit_title_place = (EditText) headView.findViewById(R.id.edit_title_place);
    post_header = (RelativeLayout) headView.findViewById(R.id.post_header);
    image_cover = (SimpleDraweeView) headView.findViewById(R.id.image_cover);
    image_set_cover = (ImageView) headView.findViewById(R.id.image_set_cover);
    image_delete_cover = (ImageView) headView.findViewById(R.id.image_delete_cover);
    adapter = new MyAdapter(PostActivity.this, this);
    linearLayoutManager = new LinearLayoutManager(this);
    edit_title.setOnClickListener(this);
    edit_title_place.setOnClickListener(this);
}
 
开发者ID:gitxuyulin,项目名称:EditorImageAndText,代码行数:21,代码来源:PostActivity.java

示例6: onCreate

import android.widget.EditText; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_upload);

    mStorageRef = FirebaseStorage.getInstance().getReference();

    t1 = (EditText) findViewById(R.id.editText2);
    buttonUpload = (Button)findViewById(R.id.button3);

    if (c == 0){
        fc();
    }

    t1.setOnClickListener(this);
    buttonUpload.setOnClickListener(this);
}
 
开发者ID:nSpider,项目名称:Paathshala,代码行数:18,代码来源:upload.java

示例7: onCreate

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

    setContentView(R.layout.title_editor);

    // Get the uri of the note whose title we want to edit
    mUri = getIntent().getData();

    // Get a cursor to access the note
    mCursor = managedQuery(mUri, PROJECTION, null, null, null);

    // Set up click handlers for the text field and button
    mText = (EditText) this.findViewById(R.id.title);
    mText.setOnClickListener(this);
    
    Button b = (Button) findViewById(R.id.ok);
    b.setOnClickListener(this);
}
 
开发者ID:firebase,项目名称:firebase-testlab-instr-lib,代码行数:20,代码来源:TitleEditor.java

示例8: onCreate

import android.widget.EditText; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_add_edit_habit);

    habitNameText = (EditText) findViewById(R.id.edit_habit_name);

    habitDateText = (EditText) findViewById(R.id.edit_date);
    habitDateText.setOnClickListener(this);

    habitDaysText = (EditText) findViewById(R.id.edit_days);
    habitDaysText.setOnClickListener(this);

    addHabitButton = (Button) findViewById(R.id.add_habit_button);
    addHabitButton.setOnClickListener(this);

    cancelAddButton = (Button) findViewById(R.id.cancel_add_button);
    cancelAddButton.setOnClickListener(this);
}
 
开发者ID:TongTongX,项目名称:HabitTracker,代码行数:20,代码来源:AddEditHabitActivity.java

示例9: initView

import android.widget.EditText; //导入方法依赖的package包/类
private void initView() {
    mChatTxt = (TextView) findViewById(R.id.app_watch_chattxt);
    mChatTxt.setOnClickListener(this);
    mHostTxt = (TextView) findViewById(R.id.app_watch_hosttxt);
    mHostTxt.setOnClickListener(this);
    mMessagesendlayout = (LinearLayout) findViewById(R.id.app_watch_msg_send_layout);
    mZhubolayout = (RelativeLayout) findViewById(R.id.app_watch_zhubo_layout);
    mChatzhubomsg = (RelativeLayout) findViewById(R.id.app_watch_chat_zhubo_msg);
    mDanmakuView = (IDanmakuView) findViewById(R.id.app_watch_danmakuview);
    mMessagesView = (RecyclerView) findViewById(R.id.app_watch_msg_receive_layout);
    mMessagesView.setLayoutManager(new LinearLayoutManager(this));
    mMessagesView.setAdapter(mAdapter);
    mEditMsg = (EditText) findViewById(R.id.app_watch_editimg);
    mEditMsg.setOnFocusChangeListener(new View.OnFocusChangeListener() {
        @Override
        public void onFocusChange(View v, boolean hasFocus) {
            if (hasFocus) {
                showPopFormBottom();
            }
        }
    });
    mEditMsg.setOnClickListener(this);
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:24,代码来源:WatchLiveActivity.java

示例10: initView

import android.widget.EditText; //导入方法依赖的package包/类
private void initView() {
    mCourierCom = (EditText) findViewById(R.id.courier_com);
    mCourierCom.setOnClickListener(this);
    mCourierNo = (EditText) findViewById(R.id.courier_no);
    mCourierNo.setOnClickListener(this);
    mGetCourier = (Button) findViewById(R.id.get_courier);
    mGetCourier.setOnClickListener(this);
    mCourierList = (ListView) findViewById(R.id.courier_list);
}
 
开发者ID:Hultron,项目名称:LifeHelper,代码行数:10,代码来源:CourierActivity.java

示例11: initEditText

import android.widget.EditText; //导入方法依赖的package包/类
private void initEditText() {
    mEditText = (EditText) findViewById(R.id.input);
    mEditText.setFocusableInTouchMode(true);
    mInputContainer = (LinearLayout) findViewById(R.id.input_container);
    OnClickListener listener = new OnClickListener() {
        @Override
        public void onClick(View v) {
            if (mWindow != null) {
                mWindow.requestWindowFocus();
                mEditText.requestFocus();
            }
        }
    };
    mEditText.setOnClickListener(listener);
    mInputContainer.setOnClickListener(listener);
}
 
开发者ID:feifadaima,项目名称:https-github.com-hyb1996-NoRootScriptDroid,代码行数:17,代码来源:ConsoleView.java

示例12: onCreate

import android.widget.EditText; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.frm_manutencao_cliente);

    mOperacao = getIntent().getExtras().getString("Operacao");

    if (mOperacao.matches("I"))
        setTitle(getString(R.string.i_001));

    if (mOperacao.matches("A")) {
        setTitle(getString(R.string.a_002));
    }

    edtNome = (EditText) findViewById(R.id.edtNome);
    edtFone_1 = (EditText) findViewById(R.id.edtFone_1);
    edtFone_2 = (EditText) findViewById(R.id.edtFone_2);
    edtEmail = (EditText) findViewById(R.id.edtEmail);
    edtEndereco = (EditText) findViewById(R.id.edtEndereco);
    edtObservacoes = (EditText) findViewById(R.id.edtObservacoes);

    edtFone_1.addTextChangedListener(Mask.insert("(##) ####-####", edtFone_1));
    edtFone_2.addTextChangedListener(Mask.insert("(##) ####-####", edtFone_2));

    edtDtCadastro = (EditText) findViewById(R.id.edtDtCadastro);
    edtDtCadastro.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            int iAno = Calendar.getInstance().get(Calendar.YEAR);
            int iMes = Calendar.getInstance().get(Calendar.MONTH);
            int iDia = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);

            if (edtDtCadastro.getText().toString().trim().length() != 0) {
                iDia = Integer.valueOf(edtDtCadastro.getText().toString().split("\\/")[0]);
                iMes = Integer.valueOf(edtDtCadastro.getText().toString().split("\\/")[1]) - 1;
                iAno = Integer.valueOf(edtDtCadastro.getText().toString().split("\\/")[2]);
            }

            DatePickerDialog datePickerDialog = new DatePickerDialog(frmManutencaoClientes.this, new DatePickerDialog.OnDateSetListener() {
                public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
                    Calendar newDate = Calendar.getInstance();
                    newDate.set(year, monthOfYear, dayOfMonth);
                    edtDtCadastro.setText(Funcoes.dateFormat.format(newDate.getTime()));
                }
            }, iAno, iMes, iDia);

            datePickerDialog.show();
        }
    });

    leitura();
}
 
开发者ID:marcelohanel,项目名称:Cash,代码行数:54,代码来源:frmManutencaoClientes.java

示例13: onCreate

import android.widget.EditText; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);
    loginButton = (Button) findViewById(R.id.login_button);
    usernameText = (EditText) findViewById(R.id.username_text);
    usernameInputLayout = (TextInputLayout) findViewById(R.id.username_input_layout);
    pwInputLayout = (TextInputLayout) findViewById(R.id.pw_input_layout);
    setToolbar(R.id.login_toolbar, true);
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

    loginButton.setOnClickListener(this);
    usernameText.setOnClickListener(this);

    if (!TextUtils.isEmpty(username)) {
        usernameText.setText(username);
    }
}
 
开发者ID:SailFlorve,项目名称:RunHDU,代码行数:19,代码来源:LoginActivity.java

示例14: init

import android.widget.EditText; //导入方法依赖的package包/类
private void init(final Context context, AttributeSet attrs) {
    this.context = context;
    LayoutInflater.from(context).inflate(R.layout.chat_primary_menu, this);
    editText = (EditText) findViewById(R.id.et_sendmessage);
    buttonSetModeKeyboard = findViewById(R.id.btn_set_mode_keyboard);
    edittext_layout = (RelativeLayout) findViewById(R.id.edittext_layout);
    buttonSetModeVoice = findViewById(R.id.btn_set_mode_voice);
    buttonSend = findViewById(R.id.btn_send);
    buttonPressToSpeak = findViewById(R.id.btn_press_to_speak);
    faceNormal = (ImageView) findViewById(R.id.iv_face_normal);
    faceChecked = (ImageView) findViewById(R.id.iv_face_checked);
    faceLayout = (RelativeLayout) findViewById(R.id.rl_face);
    buttonMore = (Button) findViewById(R.id.btn_more);

    buttonSend.setOnClickListener(this);
    buttonSetModeKeyboard.setOnClickListener(this);
    buttonSetModeVoice.setOnClickListener(this);
    buttonMore.setOnClickListener(this);
    faceLayout.setOnClickListener(this);
    editText.setOnClickListener(this);
    editText.requestFocus();

    // 监听文字框
    editText.addTextChangedListener(new EdittextWatcher(){
        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
            if (!TextUtils.isEmpty(s)) {
                buttonMore.setVisibility(View.GONE);
                buttonSend.setVisibility(View.VISIBLE);
            } else {
                buttonMore.setVisibility(View.VISIBLE);
                buttonSend.setVisibility(View.GONE);
            }
        }
    });

    buttonPressToSpeak.setOnTouchListener(new View.OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if(listener != null){
                return listener.onPressToSpeakBtnTouch(v, event);
            }
            return false;
        }
    });
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:48,代码来源:ChatPrimaryMenuLayout.java

示例15: init

import android.widget.EditText; //导入方法依赖的package包/类
/**
	 * 初始化控件
	 * 
	 * @param context
	 *            上下文对象
	 */
	private void init(Context context) {
		this.mContext = context;
		mSearchView = View.inflate(context, R.layout.search_view_layout, this);
		msearchEditLayout = (RelativeLayout) mSearchView.findViewById(R.id.search_container);
		mSliderView = (SliderView) mSearchView.findViewById(R.id.citys_bladeview);
		mContentListView = (ListView) mSearchView.findViewById(R.id.content_list);
//		mSearchEt = (EditText) mSearchView.findViewById(R.id.search_edit);
		mLoadingLayout = (LinearLayout) mSearchView.findViewById(R.id.content_list_empty);
		
		mCityContentLayout = (RelativeLayout) mSearchView.findViewById(R.id.city_content_container);
		mSearchEdit = (EditText) mSearchView.findViewById(R.id.search_edit);
		mSearchResultsLv = (ListView) findViewById(R.id.search_list);
		mSearchResultLayout = (FrameLayout) mSearchView.findViewById(R.id.search_content_container);
		mClearBtn = (ImageButton) mSearchView.findViewById(R.id.ib_clear_text);
		mSearchEmptyTv = (TextView) findViewById(R.id.search_empty);
		setClearListener(mClearBtn);
		setResultListrener();
		android.view.ViewGroup.LayoutParams layoutParams = new LayoutParams(
				LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
		mSearchView.setLayoutParams(layoutParams);
		
		mSearchEdit.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				if(mHistoryResults!=null&&!TextUtils.isEmpty(mSearchEdit.getText())) {
					mHistoryResults.clear();
				}
			}
		});
		
		// 默认显示城市列表界面
		hideSearchResultLayout();
		
		// 模糊查询监听处理
		handleSearchEditText(mSearchEdit);
	}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:44,代码来源:SearchView.java


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