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