當前位置: 首頁>>代碼示例>>Java>>正文


Java EditText.setClickable方法代碼示例

本文整理匯總了Java中android.widget.EditText.setClickable方法的典型用法代碼示例。如果您正苦於以下問題:Java EditText.setClickable方法的具體用法?Java EditText.setClickable怎麽用?Java EditText.setClickable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.EditText的用法示例。


在下文中一共展示了EditText.setClickable方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: generateOneEditText

import android.widget.EditText; //導入方法依賴的package包/類
/**
 * Takes care of styling the editText passed in the param.
 * tag is the index of the editText.
 *
 * @param styleEditText
 * @param tag
 */
private void generateOneEditText(EditText styleEditText, String tag) {
    params.setMargins(mSplitWidth / 2, mSplitWidth / 2, mSplitWidth / 2, mSplitWidth / 2);
    filters[0] = new InputFilter.LengthFilter(1);
    styleEditText.setFilters(filters);
    styleEditText.setLayoutParams(params);
    styleEditText.setGravity(Gravity.CENTER);
    styleEditText.setCursorVisible(mCursorVisible);

    if (!mCursorVisible) {
        styleEditText.setClickable(false);
        styleEditText.setHint(mHint);

        styleEditText.setOnTouchListener(new OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent motionEvent) {
                // When back space is pressed it goes to delete mode and when u click on an edit Text it should get out of the delete mode
                mDelPressed = false;
                return false;
            }
        });
    }
    styleEditText.setBackgroundResource(mPinBackground);
    styleEditText.setPadding(0, 0, 0, 0);
    styleEditText.setTag(tag);
    styleEditText.setInputType(getKeyboardInputType());
    styleEditText.addTextChangedListener(this);
    styleEditText.setOnFocusChangeListener(this);
    styleEditText.setOnKeyListener(this);
}
 
開發者ID:GoodieBag,項目名稱:Pinview,代碼行數:37,代碼來源:Pinview.java

示例2: 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

示例3: 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

示例4: showEditText

import android.widget.EditText; //導入方法依賴的package包/類
/**
 *
 * @param editTexts edits text we want to show
 */
private void showEditText(EditText ... editTexts)
{
    for (EditText anEditText : editTexts)
    {
        anEditText.setEnabled(true);
        anEditText.setClickable(true);

        anEditText.setVisibility(View.VISIBLE);
    }
}
 
開發者ID:kflauri2312lffds,項目名稱:Android_watch_magpie,代碼行數:15,代碼來源:Fragment_display_settings.java

示例5: hideEditText

import android.widget.EditText; //導入方法依賴的package包/類
/**
 *
 * @param editTexts editText we want to display
 */
private void hideEditText(EditText ... editTexts)
{
    for (EditText anEditText : editTexts)
    {
        anEditText.setEnabled(false);
        anEditText.setClickable(false);
        anEditText.setVisibility(View.GONE);
    }
}
 
開發者ID:kflauri2312lffds,項目名稱:Android_watch_magpie,代碼行數:14,代碼來源:Fragment_display_settings.java

示例6: run

import android.widget.EditText; //導入方法依賴的package包/類
@Override
public void run() {
    pageContent = cr.return_url();
    String all_valid_profiles = "";
    String all_contents = "";
    try {
        if(pageContent.isEmpty()) {
            t.setVisibility(View.VISIBLE);
            t.setText("اتصال به اینترنت لازم است.");
        }
        else {
            t.setVisibility(View.INVISIBLE);
            Document doc = Jsoup.parse(pageContent);
            doc.select("blockquote").remove();
            doc.select("p.conl").remove();
            doc.select("div.postfootleft").remove();
            doc.select("div.postsignature.postmsg").remove();
            doc.select("div.pagepost").remove();
            doc.getElementById("feedlinks").remove();
            doc.getElementById("poweredby").remove();
            Elements profiles = doc.select("dt>strong");
            for(Element valid_ones : profiles) {
                String extracted = valid_ones.attr("href");
                all_valid_profiles += (valid_ones.text() + "`");
            }
            valid_profiles = all_valid_profiles.split("`");
            Elements contents = doc.select("p");
            for(Element content : contents) {
                String extracted_content = content.text();
                all_contents += (extracted_content + "`");
            }
            valid_contents = all_contents.split("`");
            LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
            lp.bottomMargin = 10;
            lp.topMargin = 10;
            LinearLayout.LayoutParams lptv=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
            lptv.bottomMargin = 10;
            lptv.topMargin = 80;
            for(int i=0; i<valid_contents.length; i++) {
                TextView tv = new TextView(ViewTopicActivity.this);
                tv.setText(valid_profiles[i]+" :");
                tv.setTextSize(20);
                tv.setTextColor(Color.rgb(255, 255, 255));
                tv.setId(i);
                ll.addView(tv, lptv);
                EditText et = new EditText(ViewTopicActivity.this);
                et.setTextDirection(View.TEXT_DIRECTION_ANY_RTL);
                et.setFocusable(false);
                et.setFocusableInTouchMode(false);
                et.setClickable(false);
                et.setText(valid_contents[i]);
                et.setBackgroundResource(R.drawable.edit_text_shape);
                et.getBackground().setAlpha(100);
                et.setId(1000+i);
                ll.addView(et, lp);
            }
        }
    } catch (Exception e) {
        t.setVisibility(View.VISIBLE);
        t.setText("اشکالی در برنامه یا اتصال به اینترنت وجود دارد. برای تلاش مجدد لطفا بر روی این متن کلیک کنید.");
    }
}
 
開發者ID:m47h4r,項目名稱:arch-users-forum,代碼行數:63,代碼來源:ViewTopicActivity.java


注:本文中的android.widget.EditText.setClickable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。