当前位置: 首页>>代码示例>>Java>>正文


Java AutoCompleteTextView.setTextColor方法代码示例

本文整理汇总了Java中android.widget.AutoCompleteTextView.setTextColor方法的典型用法代码示例。如果您正苦于以下问题:Java AutoCompleteTextView.setTextColor方法的具体用法?Java AutoCompleteTextView.setTextColor怎么用?Java AutoCompleteTextView.setTextColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.AutoCompleteTextView的用法示例。


在下文中一共展示了AutoCompleteTextView.setTextColor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createAutoCompleteTextView

import android.widget.AutoCompleteTextView; //导入方法依赖的package包/类
private AutoCompleteTextView createAutoCompleteTextView(Context context) {
    final LayoutParams lparamsTextView = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
    lparamsTextView.setMargins(0, 0, 10, 0);
    lparamsTextView.gravity = Gravity.CENTER;
    final AutoCompleteTextView autoCompleteTextView = new AutoCompleteTextView(context);
    autoCompleteTextView.setBackgroundColor(Color.parseColor("#00FFFFFF"));
    autoCompleteTextView.setLayoutParams(lparamsTextView);
    autoCompleteTextView.setHint(" ");
    autoCompleteTextView.setPadding(10,0,10,10);
    autoCompleteTextView.setSingleLine(true);
    autoCompleteTextView.setTextColor(textColor);
    autoCompleteTextView.setHintTextColor(hintColor);
    autoCompleteTextView.setCursorVisible(true);

    return autoCompleteTextView;
}
 
开发者ID:OfficialAmal,项目名称:ChipLayout,代码行数:17,代码来源:ChipLayout.java

示例2: setTextColor

import android.widget.AutoCompleteTextView; //导入方法依赖的package包/类
public void setTextColor(int textColor){
    this.textColor = textColor;
    for (int i = 0; i < this.getChildCount(); i++){
        AutoCompleteTextView autoCompleteTextView = (AutoCompleteTextView) ((ViewGroup)this.getChildAt(i)).getChildAt(labelPosition);
        autoCompleteTextView.setTextColor(textColor);
        ((ChipTextWatcher)focusedTextWatcher).setTextColor(textColor);

    }
}
 
开发者ID:OfficialAmal,项目名称:ChipLayout,代码行数:10,代码来源:ChipLayout.java

示例3: highlightChipAt

import android.widget.AutoCompleteTextView; //导入方法依赖的package包/类
public void highlightChipAt(int pos, int bgColor, int textColor){
    View v = this.getChildAt(pos);
    v.setBackgroundColor(bgColor);
    AutoCompleteTextView autoCompleteTextView = (AutoCompleteTextView) ((ViewGroup)v).getChildAt(labelPosition);
    autoCompleteTextView.setTextColor(textColor);

}
 
开发者ID:OfficialAmal,项目名称:ChipLayout,代码行数:8,代码来源:ChipLayout.java

示例4: onPrepareOptionsMenu

import android.widget.AutoCompleteTextView; //导入方法依赖的package包/类
@Override
public void onPrepareOptionsMenu(Menu _Menu) {
    // TODO: try to remove this, it seems very very hacky
    // found at: http://stackoverflow.com/questions/10445760/how-to-change-the-default-icon-on-the-searchview-to-be-use-in-the-action-bar-on
    if (_Menu == null) {
        return;
    }
    MenuItem searchMenuItem = _Menu.findItem(R.id.menu_product_list_dialog_search);
    SearchView searchView = (SearchView) searchMenuItem.getActionView();
    searchMenuItem.setIcon(R.drawable.ic_search_white_36dp);


    int searchTextViewId = android.support.v7.appcompat.R.id.search_src_text;
    AutoCompleteTextView searchTextView = (AutoCompleteTextView) searchView.findViewById(searchTextViewId);
    searchTextView.setHintTextColor(getResources().getColor(R.color.white));
    searchTextView.setTextColor(getResources().getColor(android.R.color.white));
    searchTextView.setTextSize(16.0f);


    SpannableStringBuilder ssb = new SpannableStringBuilder("   "); // for the icon
    //ssb.append(hintText);
    Drawable searchIcon = getResources().getDrawable(R.drawable.ic_search_white_36dp);
    int textSize = (int) (searchTextView.getTextSize() * 1.25);
    searchIcon.setBounds(0, 0, textSize, textSize);
    ssb.setSpan(new ImageSpan(searchIcon), 1, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    searchTextView.setHint(ssb);
    super.onPrepareOptionsMenu(_Menu);
}
 
开发者ID:InstaList,项目名称:instalist-android,代码行数:29,代码来源:ProductListDialogFragment.java

示例5: onCreate

import android.widget.AutoCompleteTextView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {


    super.onCreate(savedInstanceState);

    setTitle("Add Record");

    setContentView(R.layout.activity_add);

    subjectEditText = (EditText) findViewById(R.id.editText2);
    descEditText = (EditText) findViewById(R.id.editText3);

    spinner = (ProgressBar) findViewById(R.id.progressBar2);
    new AddActivity.AltcoinRetrieve().execute();

 //   Double a = (Double)findViewById(R.id.editText3);

    ArrayAdapter<String> adapter = new ArrayAdapter<String> (this,android.R.layout.select_dialog_item,list);
    //Getting the instance of AutoCompleteTextView
    AutoCompleteTextView actv= (AutoCompleteTextView)findViewById(R.id.coinlist);
    actv.setThreshold(1);//will start working from first character
    actv.setAdapter(adapter);//setting the adapter data into the AutoCompleteTextView
    actv.setTextColor(Color.RED);


    button = (Button) findViewById(R.id.button);
  //  final String name = subjectEditText.getText().toString();
    //final String desc = descEditText.getText().toString();
    button.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            try {
                SQLiteDatabase db;
                db = openOrCreateDatabase("PORTFOLIO", Context.MODE_PRIVATE, null);
                db.execSQL("CREATE TABLE IF NOT EXISTS coinpryc(id INTEGER PRIMARY KEY AUTOINCREMENT,name VARCHAR(20),amount DOUBLE,price DOUBLE);");
                Double a = Double.parseDouble(subjectEditText.getText().toString());
                //Double a = subjectEditText;
                System.out.println("a " + a);
                Double b = Double.parseDouble(descEditText.getText().toString());
                System.out.println("b " + b);
                // Cursor c=db.rawQuery("SELECT * FROM bitdata", null);
                db.execSQL("INSERT INTO coinpryc (name,amount,price) VALUES('" + a + "','" + b + "');");
                Intent activity = new Intent(AddActivity.this, FifthActivity.class);
                AddActivity.this.startActivity(activity);
            }
            catch (SQLiteException e)
            {
                Log.e("SQL Error",e.getMessage(),e);
            }
        }
    });



}
 
开发者ID:someaditya,项目名称:CoinPryc,代码行数:56,代码来源:AddActivity.java


注:本文中的android.widget.AutoCompleteTextView.setTextColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。