Java Code Examples for android.widget.EditText#setMinWidth()

The following examples show how to use android.widget.EditText#setMinWidth() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FeedSourcesActivity.java    From AnotherRSS with The Unlicense 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.pref_sources);
    ActionBar ab = getSupportActionBar();
    if (ab != null) {
        ab.setDisplayHomeAsUpEnabled(true);
        ab.setTitle(getString(R.string.rss_url));
    }
    _pref = PreferenceManager.getDefaultSharedPreferences(AnotherRSS.getContextOfApplication());
    loadUrls();
    Intent intent = getIntent();
    Uri data = intent.getData();
    if (data != null) {
        int id = _urlEdit.size();
        _active = Arrays.copyOf(_active, _active.length +1);
        _active[id] = true;
        CheckBox checkBox = new CheckBox(this);
        EditText editText = new EditText(this);
        checkBox.setChecked(true);
        editText.setText(data.toString());
        _urlCheck.add(id, checkBox);
        _urlEdit.add(id, editText);

        LinearLayout dummy = new LinearLayout(AnotherRSS.getContextOfApplication());
        dummy.setOrientation(LinearLayout.HORIZONTAL);
        dummy.addView(checkBox, 0);
        dummy.addView(editText, 1);
        editText.setMinWidth(AnotherRSS.Config.DEFAULT_MAX_IMG_WIDTH);
        _linearLayout.addView(dummy, id);
        storeUrls();
        editText.requestFocus();
    }
}
 
Example 2
Source File: TagFlowLayout.java    From support with Apache License 2.0 5 votes vote down vote up
public TagFlowLayout(Context context, AttributeSet attrs) {
    super(context, attrs);
    mInputView = new EditText(context);
    mInputView.setBackgroundColor(Color.TRANSPARENT);
    mInputView.addTextChangedListener(this);
    mInputView.setOnKeyListener(this);
    mInputView.setPadding(0, 0, 0, 0);
    mInputView.setMinWidth(20);
    mInputView.setSingleLine();
    mInputView.setGravity(Gravity.CENTER_VERTICAL);
    setDecorator(new SimpleDecorator(context));
    addView(mInputView);
    setOnClickListener(this);
    previewInEditMode();
}