@Override public void setBackgroundColor(int color) { if (mBackgroundHelper != null) { mBackgroundHelper.setBackgroundColor(color); } else { super.setBackgroundColor(color); } }
private void createEditText(Context context) { EDT_diary_text = new EditText(context); EDT_diary_text.setTextColor(Color.BLACK); EDT_diary_text.setBackgroundColor(Color.TRANSPARENT); EDT_diary_text.setGravity(Gravity.TOP | Gravity.LEFT); //2dp paddding int padding = ScreenHelper.dpToPixel(context.getResources(), 2); EDT_diary_text.setPadding(padding, padding, padding, padding); } public void insertText(String text){
private void disableEditText(EditText editText) { editText.setFocusable(false); editText.setEnabled(false); editText.setCursorVisible(false); editText.setKeyListener(null); editText.setBackgroundColor(Color.TRANSPARENT); }
editText.setBackgroundColor(Color.TRANSPARENT);
public void setSearchBarColor(int color) { // Set background color of search bar. mSearchEditText.setBackgroundColor(color); }
EditText editText = new EditText(this); editText.setText("My Text"); editText.setWidth(180); editText.setBackgroundColor(Color.WHITE);
EditText editText = new EditText(this); editText.setBackgroundColor(R.color.BLUE); editText.setTextColor(R.color.BLACK); row.addView(editText);
final EditText et = new EditText(getApplicationContext()); TextWatcher tw = new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { if (s.length() > 0) { et.setBackgroundColor(Color.WHITE); } else { et.setBackgroundColor(Color.GRAY); } } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub } @Override public void afterTextChanged(Editable s) { // TODO Auto-generated method stub } }; et.addTextChangedListener(tw); setContentView(et);
EditText editText = new EditText(this); editText.setText("My Text"); editText.setWidth(180); editText.setBackgroundColor(Color.WHITE);
public class Atiras { private boolean isTrue; public void atirasfigyelo(final EditText valtozo, Cursor sql, String SQLoszlop, final boolean ell) { valtozo.setText("" + sql.getInt(sql.getColumnIndex(SQLoszlop))); isTrue= false; valtozo.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { isTrue= true; } @Override public void afterTextChanged(Editable s) { valtozo.setBackgroundColor(Color.RED); } }); } }
@Override public void onInitView(GVRViewSceneObject gvrViewSceneObject, View view) { final EditText editor = (EditText) view.findViewById(R.id.editor); editor.requestFocus(); editor.setDrawingCacheEnabled(false); editor.setBackgroundColor(Color.BLACK); updateButton = (TextView) view.findViewById(R.id.update); updateButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { android.util.Log.d("Editor", "update was clicked"); // get text String script = editor.getText().toString(); // execute script mScriptHandler.processLine(script); } }); }
private void validateExampleAndHighlight(String template, String example) { if (Utils.isNotEmpty(template) && template.length() > 4 && Utils.isNotEmpty(example)) { final Resources resources = SmsTemplateActivity.this.getResources(); final String[] matches = SmsTransactionProcessor.findTemplateMatches(template, example); if (matches == null) { exampleTxt.setBackgroundColor(resources.getColor(R.color.negative_amount)); } else { exampleTxt.setBackgroundColor(resources.getColor(R.color.cleared_transaction_color)); } } } }
// highlight any unfilled boxes final EditText text = (EditText) activity.findViewById(id); String data = text.getText().toString(); if (data.length() == 0) // { final Drawable oldBackground = activity.findViewById(id).getBackground(); text.setBackgroundColor(Color.YELLOW); text.addTextChangedListener(new TextWatcher() // { @Override public void afterTextChanged(Editable s) // { text.setBackgroundDrawable(oldBackground); } @Override public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } }); }
@Override public boolean finishedSearch(FileSystemSuperRoot newRoot, String searchQuery) { boolean matched = super.finishedSearch(newRoot, searchQuery); if (matched) { searchBox.setBackgroundDrawable(origSearchBackground); } else { searchBox.setBackgroundColor(Color.parseColor("#FFDDDD")); } return matched; }
private void ResetColors(){ ((EditText)findViewById(R.id.editNote)).setBackgroundColor(Color.TRANSPARENT); ((EditText)findViewById(R.id.editNote)).setTextColor(Color.BLACK); }
/** * Set Background color of View. * * @param color The background color of view. */ @Override public void setBackgroundColor(int color) { if (color != DEFAULT_TRANSPARENT_COLOR) { super.setBackgroundColor(color); } else { setBackgroundDrawable(mDefaultBackground); } mManager.setBackgroundColor(color); onRefreshStyles(); }
@Override public View createCellEditor(GridPanel gridPanel, GridCellRange cellRange, Rect bounds) { EditText editText = (EditText) super.createCellEditor(gridPanel, cellRange, bounds); if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { editText.setBackground(null); } if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { editText.setBackgroundTintMode(PorterDuff.Mode.CLEAR); } editText.setBackgroundColor(ContextCompat.getColor(flexGrid.getContext(), R.color.colorTransparent)); return editText; } }
private void disableEditText(EditText editText) { editText.setFocusable(false); editText.setEnabled(false); editText.setCursorVisible(false); editText.setKeyListener(null); editText.setBackgroundColor(Color.TRANSPARENT); }
public void updateSkin() { editText.setBackgroundResource(R.drawable.blank); editText.setBackgroundColor(softKeyboard.skinInfoManager.skinData.backcolor_preEdit); editText.setTextColor(softKeyboard.skinInfoManager.skinData.textcolor_preEdit); editText.getBackground().setAlpha(Global.getCurrentAlpha()); editText.setShadowLayer(Global.shadowRadius, 0, 0, softKeyboard.skinInfoManager.skinData.shadow); }
private void ResetColors(){ ((EditText)findViewById(R.id.bodyView)).setBackgroundColor(Color.TRANSPARENT); ((EditText)findViewById(R.id.bodyView)).setTextColor(Color.BLACK); Colors currentColor = Colors.valueOf(color); switch (currentColor) { case BLUE: (findViewById(R.id.scrollView)).setBackgroundColor(0xFFA6CAFD); this.realColor = R.id.blue; break; case WHITE: (findViewById(R.id.scrollView)).setBackgroundColor(0xFFFFFFFF); this.realColor = R.id.white; break; case YELLOW: (findViewById(R.id.scrollView)).setBackgroundColor(0xFFFFFFCC); this.realColor = R.id.yellow; break; case PINK: (findViewById(R.id.scrollView)).setBackgroundColor(0xFFFFCCCC); this.realColor = R.id.pink; break; case GREEN: (findViewById(R.id.scrollView)).setBackgroundColor(0xFFCCFFCC); this.realColor = R.id.green; break; default: (findViewById(R.id.scrollView)).setBackgroundColor(Color.TRANSPARENT); } invalidateOptionsMenu(); }