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


Java MaterialEditText類代碼示例

本文整理匯總了Java中com.rengwuxian.materialedittext.MaterialEditText的典型用法代碼示例。如果您正苦於以下問題:Java MaterialEditText類的具體用法?Java MaterialEditText怎麽用?Java MaterialEditText使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: onCreate

import com.rengwuxian.materialedittext.MaterialEditText; //導入依賴的package包/類
@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);

    setToolbar(true);
    getSupportActionBar().setTitle(R.string.login);

    final MaterialEditText emailEditText = (MaterialEditText) findViewById(R.id.email_login);
    final MaterialEditText passwordEditText = (MaterialEditText) findViewById(R.id.password_login);

    final Button loginButton = (Button) findViewById(R.id.login);
    loginButton.setOnClickListener((View v) -> {

        final String email = Utils.getEditTextString(emailEditText);
        final String password = Utils.getEditTextString(passwordEditText);
        if (StringUtils.isAValidString(email) && StringUtils.isAValidString(password)
                && StringUtils.isAValidEmail(email) && StringUtils.isAValidPassword(password)) {
            final Message message = new LoginMessageImpl(email, password);
            login(message);
        } else {
            showDialog(R.string.login, R.string.incorrect_login_data);
        }
    });
}
 
開發者ID:SofiaRosetti,項目名稱:S3-16-d-rescue,代碼行數:26,代碼來源:LoginActivity.java

示例2: showSearchDialog

import com.rengwuxian.materialedittext.MaterialEditText; //導入依賴的package包/類
private void showSearchDialog() {
    final MaterialEditText editText = new MaterialEditText(FanjuNewsActivity.this);
    editText.setHint(R.string.input_http);
    editText.setMetTextColor(Color.parseColor("#009688"));
    editText.setPrimaryColor(Color.parseColor("#009688"));
    editText.setMaxCharacters(100);
    editText.setErrorColor(Color.parseColor("#ff0000"));

    AlertDialog.Builder builder = new AlertDialog.Builder(FanjuNewsActivity.this)
            .setTitle(R.string.search_video)
            .setView(editText, 30, 20, 20, 20)
            .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    doSearch(editText.getText().toString());
                }
            });
    builder.create().show();
}
 
開發者ID:henryblue,項目名稱:TeaCup,代碼行數:20,代碼來源:FanjuNewsActivity.java

示例3: showAddDialog

import com.rengwuxian.materialedittext.MaterialEditText; //導入依賴的package包/類
private void showAddDialog() {
    final MaterialEditText editText = new MaterialEditText(FindBookActivity.this);
    editText.setHint(R.string.input_hint);
    editText.setMetTextColor(Color.parseColor("#009688"));
    editText.setPrimaryColor(Color.parseColor("#009688"));
    editText.setMaxCharacters(20);
    editText.setErrorColor(Color.parseColor("#ff0000"));

    AlertDialog.Builder builder = new AlertDialog.Builder(FindBookActivity.this)
            .setTitle(R.string.add_book)
            .setView(editText, 30, 20, 20, 20)
            .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    doSearch(editText.getText().toString());
                }
            });
    builder.create().show();
}
 
開發者ID:henryblue,項目名稱:TeaCup,代碼行數:20,代碼來源:FindBookActivity.java

示例4: showSearchDialog

import com.rengwuxian.materialedittext.MaterialEditText; //導入依賴的package包/類
private void showSearchDialog() {
    final MaterialEditText editText = new MaterialEditText(FanjuVideoActivity.this);
    editText.setHint(R.string.input_http);
    editText.setMetTextColor(Color.parseColor("#009688"));
    editText.setPrimaryColor(Color.parseColor("#009688"));
    editText.setMaxCharacters(100);
    editText.setErrorColor(Color.parseColor("#ff0000"));

    AlertDialog.Builder builder = new AlertDialog.Builder(FanjuVideoActivity.this)
            .setTitle(R.string.search_video)
            .setView(editText, 30, 20, 20, 20)
            .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    doSearch(editText.getText().toString());
                }
            });
    builder.create().show();
}
 
開發者ID:henryblue,項目名稱:TeaCup,代碼行數:20,代碼來源:FanjuVideoActivity.java

示例5: findViews

import com.rengwuxian.materialedittext.MaterialEditText; //導入依賴的package包/類
private void findViews(){
    toolbar = (Toolbar) findViewById(R.id.toolbar_new_word);
    toolbar.setTitle("新詞條");
    toolbar.setTitleTextColor(Color.WHITE);
    toolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
    setSupportActionBar(toolbar);
    actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setHomeAsUpIndicator(R.drawable.ic_arrow_back_white);

    et_new_word = (MaterialEditText) findViewById(R.id.et_new_word);
    spinner = (ButtonFlat) findViewById(R.id.spinner_new_word_lang);
        setupSpinner();
    checkBox = (CheckBox) findViewById(R.id.cb_anonymous);
    tv_time = (TextView) findViewById(R.id.tv_time);
        tv_time.setVisibility(View.GONE);
    tv_hint = (TextView) findViewById(R.id.tv_record_hint);
    ib_delete = (ImageButton) findViewById(R.id.ib_delete);
        ib_delete.setVisibility(View.GONE);
    bt_main = (ButtonFloatSmall) findViewById(R.id.bt_record);
    bt_main.setDrawableIcon(getResources().getDrawable(R.drawable.iconfont_microphone));
    bt_main.setRippleSpeed(20f);

}
 
開發者ID:JianxunRao,項目名稱:FangYanShuo,代碼行數:25,代碼來源:NewWordActivity.java

示例6: onActivityCreated

import com.rengwuxian.materialedittext.MaterialEditText; //導入依賴的package包/類
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    initProgressDialog();

    mUsernameField = (MaterialEditText) getView().findViewById(R.id.username_field);
    mPasswordField = (MaterialEditText) getView().findViewById(R.id.password_field);

    Button loginBtn = (Button) getView().findViewById(R.id.btn_login);
    loginBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            String username = mUsernameField.getText().toString();
            String password = mPasswordField.getText().toString();

            if (isInputsValid(username, password)) {
                showProgressDialog();
                login(username, password);
            }

        }
    });
}
 
開發者ID:scarletsky,項目名稱:Bangumi-Android,代碼行數:25,代碼來源:LoginFragment.java

示例7: onActivityCreated

import com.rengwuxian.materialedittext.MaterialEditText; //導入依賴的package包/類
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    mProgressBar = (ProgressBar) getView()
            .findViewById(R.id.subject_grade_progress_bar_wrapper)
            .findViewById(R.id.progress_bar);
    mSubjectGradeWrapper = (LinearLayout) getView().findViewById(R.id.subject_grade_wrapper);
    mSubjectStatus = (TextView) getView().findViewById(R.id.subject_status);
    mSubjectRating = (TextView) getView().findViewById(R.id.subject_rating);
    mSubjectComment = (TextView) getView().findViewById(R.id.subject_comment);
    mSubjectStatusField = (RadioGroup) getView().findViewById(R.id.subject_status_field);
    mSubjectRatingField = (Slider) getView().findViewById(R.id.subject_rating_field);
    mSubjectCommentField = (MaterialEditText) getView().findViewById(R.id.subject_comment_field);

    mSubjectStatusField.setOnCheckedChangeListener(this);
}
 
開發者ID:scarletsky,項目名稱:Bangumi-Android,代碼行數:18,代碼來源:SubjectGradeFragment.java

示例8: InitMain

import com.rengwuxian.materialedittext.MaterialEditText; //導入依賴的package包/類
void InitMain()
{
    SignInButton = (FlatButton) findViewById(R.id.SignIn);
    UserNameEditText = (MaterialEditText) findViewById(R.id.UserName);
    PasswordEditText = (MaterialEditText) findViewById(R.id.Password);

    SignInButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            new Thread(LoginRunnable).start();
            InputMethodManager imm = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
            imm.hideSoftInputFromWindow(UserNameEditText.getWindowToken(), 0);
            imm.hideSoftInputFromWindow(PasswordEditText.getWindowToken(), 0);
            SignInButton.setEnabled(false);
            UserNameEditText.setEnabled(false);
            PasswordEditText.setEnabled(false);
        }
    });

    restorePrefs();
}
 
開發者ID:hearsilent,項目名稱:XiaomiOrder,代碼行數:22,代碼來源:MainActivity.java

示例9: getEditionValue

import com.rengwuxian.materialedittext.MaterialEditText; //導入依賴的package包/類
@Override
public Object getEditionValue()
{
    if (editionView instanceof MaterialEditText)
    {
        String value = ((MaterialEditText) editionView).getText().toString();
        if (TextUtils.isEmpty(value))
        {
            return null;
        }
        else if ("-".equals(value))
        {
            return null;
        }
        else
        {
            return Double.parseDouble(value);
        }

    }
    return null;
}
 
開發者ID:Alfresco,項目名稱:activiti-android-app,代碼行數:23,代碼來源:AmountField.java

示例10: setupEditionView

import com.rengwuxian.materialedittext.MaterialEditText; //導入依賴的package包/類
@Override
public View setupEditionView(Object value)
{
    MaterialEditText edit = (MaterialEditText) super.setupEditionView(value);
    edit.addTextChangedListener(new DecimalTextWatcher(edit, 10, 2));
    edit.setFloatingLabelText(getLabelText(getCurrencyLabel()));

    if ((((AmountFieldRepresentation) data).isEnableFractions()))
    {
        edit.setInputType(EditorInfo.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL
                | EditorInfo.TYPE_NUMBER_FLAG_SIGNED);

    }
    else
    {
        edit.setInputType(EditorInfo.TYPE_CLASS_NUMBER | EditorInfo.TYPE_NUMBER_FLAG_SIGNED);
    }
    return edit;
}
 
開發者ID:Alfresco,項目名稱:activiti-android-app,代碼行數:20,代碼來源:AmountField.java

示例11: getEditionValue

import com.rengwuxian.materialedittext.MaterialEditText; //導入依賴的package包/類
@Override
public Object getEditionValue()
{
    if (editionView instanceof MaterialEditText)
    {
        String value = ((MaterialEditText) editionView).getText().toString();
        if (TextUtils.isEmpty(value))
        {
            return null;
        }
        else if ("-".equals(value))
        {
            return null;
        }
        else
        {
            return Double.parseDouble(value);
        }
    }
    return null;
}
 
開發者ID:Alfresco,項目名稱:activiti-android-app,代碼行數:22,代碼來源:NumberField.java

示例12: initValidationEt

import com.rengwuxian.materialedittext.MaterialEditText; //導入依賴的package包/類
private void initValidationEt() {
	final MaterialEditText validationEt = (MaterialEditText) findViewById(R.id.validationEt);
   validationEt.addValidator(new RegexpValidator("Only Integer Valid!", "\\d+"));
	final Button validateBt = (Button) findViewById(R.id.validateBt);
	validateBt.setOnClickListener(new View.OnClickListener() {
     @Override
     public void onClick(View v) {
       // validate
       validationEt.validate();
     }
   });
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:13,代碼來源:MainActivity.java

示例13: isFileNameOk

import com.rengwuxian.materialedittext.MaterialEditText; //導入依賴的package包/類
public static String isFileNameOk(Context context, MaterialEditText fileName, String suffix, String parentPath, boolean needCheckExist) {
    if (fileName.getText() == null) {
        fileName.setError(context.getString(R.string.empty_name_tip));
        return null;
    }

    String name = fileName.getText().toString().trim();
    if (TextUtils.isEmpty(name)) {
        fileName.setError(context.getString(R.string.empty_name_tip));
        return null;
    } else if (FileUtils.hasIllegalChar(name)) {
        fileName.setError(context.getString(R.string.file_name_illegal));
        return null;
    } else if (FileUtils.fileNameOnlyOne(name)) {
        fileName.setError(context.getString(R.string.file_name_unqualified));
        return null;
    }

    if (needCheckExist){
        File file = new File(parentPath, name + suffix);
        if (file.exists()) {
            fileName.setError(context.getString(R.string.same_name));
            return null;
        }
    }

    return name + suffix;
}
 
開發者ID:WeiMei-Tian,項目名稱:editor-sql,代碼行數:29,代碼來源:Utils.java

示例14: startFilterActivity

import com.rengwuxian.materialedittext.MaterialEditText; //導入依賴的package包/類
private void startFilterActivity(String selectColum, MaterialEditText filter_value) {
    Intent intent = new Intent(SqlTabDatasActivity.this, SqlTabDatasActivity.class);
    intent.putExtra(SqlTabDatasActivity.TABLE_KEY, mTableName);
    intent.putExtra(SqlTabDatasActivity.DB_NAME, getIntent().getStringExtra(DB_NAME));
    intent.putExtra(SqlTabDatasActivity.DATA_SOURCE, SqlConstant.TABLE_DATAS_FILTER);
    intent.putExtra(SqlTabDatasActivity.FILTER_COLUM, selectColum);
    intent.putExtra(SqlTabDatasActivity.FILTER_KEY, filter_value.getText().toString());
    startActivity(intent);
}
 
開發者ID:WeiMei-Tian,項目名稱:editor-sql,代碼行數:10,代碼來源:SqlTabDatasActivity.java

示例15: hasSameTable

import com.rengwuxian.materialedittext.MaterialEditText; //導入依賴的package包/類
private boolean hasSameTable(MaterialEditText fileName) {
    boolean hasSame = false;
    String tableName, fileNameStr;
    for (int i = 0; i < mTableNames.size(); i++) {
        tableName = mTableNames.get(i).toLowerCase();
        fileNameStr = fileName.getText().toString().trim().toLowerCase();
        if (tableName.equals(fileNameStr)) {
            hasSame = true;
            fileName.setError(this.getResources().getString(R.string.same_name));
        }
    }
    return hasSame;
}
 
開發者ID:WeiMei-Tian,項目名稱:editor-sql,代碼行數:14,代碼來源:DbTablesActivity.java


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