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


Java MaterialEditText.setMaxCharacters方法代碼示例

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


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

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

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

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

示例4: onCreate

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

    ((TweetyHuntingApplication)getApplication()).sendScreenTracking(LOG_TAG);

    setContentView(R.layout.activity_tweeting);

    Log.d(LOG_TAG, "onCreate");

    mDensity  = getResources().getDisplayMetrics().density;
    mClient = new OkHttpClient();

    mImageView = (GifImageView) findViewById(R.id.catImageView);
    mLoader = (CustomProgressBarCircularIndeterminate) findViewById(R.id.progressBar);
    mShareButton = (ButtonFloat) findViewById(R.id.shareButton);
    mStateButtonLayout = (ViewGroup) findViewById(R.id.stateButton);
    mShareButtonLoader = (CustomProgressBarCircularIndeterminate) findViewById(R.id.stateButtonLoader);
    mCardView = (CardView) findViewById(R.id.tweet_card);
    mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_container);
    mTweetEditText = (MaterialEditText) findViewById(R.id.tweetEditText);
    mEditTextLayout = (LinearLayout) findViewById(R.id.editTextLayout);

    mTweetEditText.setMaxCharacters(140 - getString(R.string.tweet_sufix).length() -2);

    new LoaderManager(mLoader, mImageView);
    mStateButtonManager = new StateButtonManager(this, mShareButtonLoader,mShareButton);

    mSwipeRefreshLayout.setOnRefreshListener(this);

    updateAdvertisingId();
    getACat();

    mTwitterManager = new TwitterManager(this.getApplicationContext(), this);


    mShareButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {

            // close keyboard
            InputMethodManager imm = (InputMethodManager) getSystemService(
                    Context.INPUT_METHOD_SERVICE);
            imm.hideSoftInputFromWindow(mTweetEditText.getWindowToken(), 0);

            requestTweetCat();
        }
    });
}
 
開發者ID:HugoGresse,項目名稱:TweetyHunting,代碼行數:50,代碼來源:TweetingActivity.java


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