当前位置: 首页>>代码示例>>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;未经允许,请勿转载。