本文整理汇总了Java中android.support.v7.widget.AppCompatAutoCompleteTextView类的典型用法代码示例。如果您正苦于以下问题:Java AppCompatAutoCompleteTextView类的具体用法?Java AppCompatAutoCompleteTextView怎么用?Java AppCompatAutoCompleteTextView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AppCompatAutoCompleteTextView类属于android.support.v7.widget包,在下文中一共展示了AppCompatAutoCompleteTextView类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import android.support.v7.widget.AppCompatAutoCompleteTextView; //导入依赖的package包/类
public void init() {
locationET = (AppCompatAutoCompleteTextView) findViewById(R.id.place_search_dialog_location_ET);
locationTIL = (TextInputLayout) findViewById(R.id.place_search_dialog_location_TIL);
cancelTV = (AppCompatTextView) findViewById(R.id.place_search_dialog_cancel_TV);
okTV = (AppCompatTextView) findViewById(R.id.place_search_dialog_ok_TV);
headerImageIV = (ImageView) findViewById(R.id.place_search_dialog_header_image_IV);
okTV.setOnClickListener(this);
cancelTV.setOnClickListener(this);
buildDialog();
locationET.setOnItemClickListener(mAutocompleteClickListener);
mAdapter = new PlaceAutocompleteAdapter(context, mGoogleApiClient, BOUNDS_WORLD, null);
locationET.setThreshold(3);
locationET.setAdapter(mAdapter);
}
示例2: isValid
import android.support.v7.widget.AppCompatAutoCompleteTextView; //导入依赖的package包/类
@Override
public boolean isValid(AppCompatAutoCompleteTextView view) {
boolean value;
try {
Address address = autoComplete(mAutocompleteLocation.getText().toString()).get(0);
if (address.getCountryCode().toLowerCase().equals("") && address.getCountryName().equals("")) {
value = false;
} else {
mChosenAddress = address.getCountryName();
value = true;
}
} catch (Exception e) {
value = false;
}
return value;
}
示例3: onCreateView
import android.support.v7.widget.AppCompatAutoCompleteTextView; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
ViewStub viewStub = (ViewStub) findViewById(R.id.toolbar_content);
viewStub.setLayoutResource(R.layout.toolbar_qms_black_list);
viewStub.inflate();
nickField = (AppCompatAutoCompleteTextView) findViewById(R.id.qms_black_list_nick_field);
return view;
}
示例4: ChatThemeCreator
import android.support.v7.widget.AppCompatAutoCompleteTextView; //导入依赖的package包/类
public ChatThemeCreator(QmsChatFragment fragment) {
this.fragment = fragment;
viewStub = (ViewStub) this.fragment.findViewById(R.id.toolbar_content);
viewStub.setLayoutResource(R.layout.toolbar_qms_new_theme);
viewStub.inflate();
nickField = (AppCompatAutoCompleteTextView) this.fragment.findViewById(R.id.qms_theme_nick_field);
titleField = (AppCompatEditText) this.fragment.findViewById(R.id.qms_theme_title_field);
this.userId = this.fragment.currentChat.getUserId();
this.userNick = this.fragment.currentChat.getNick();
this.themeTitle = this.fragment.currentChat.getTitle();
initCreatorViews();
}
示例5: getDefaultViewDefStyleAttr
import android.support.v7.widget.AppCompatAutoCompleteTextView; //导入依赖的package包/类
@SuppressLint({"PrivateResource", "InlinedApi"})
@Override
protected int getDefaultViewDefStyleAttr(View view) {
if (view instanceof AppCompatRadioButton) {
return R.attr.radioButtonStyle;
} else if (view instanceof AppCompatCheckBox) {
return R.attr.checkboxStyle;
} else if (view instanceof AppCompatButton) {
return R.attr.buttonStyle;
} else if (view instanceof AppCompatMultiAutoCompleteTextView) {
return R.attr.autoCompleteTextViewStyle;
} else if (view instanceof AppCompatAutoCompleteTextView) {
return R.attr.autoCompleteTextViewStyle;
} else if (view instanceof AppCompatEditText) {
return R.attr.editTextStyle;
} else if (view instanceof AppCompatCheckedTextView) {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 ?
android.R.attr.checkedTextViewStyle : 0;
} else if (view instanceof AppCompatTextView) {
return android.R.attr.textViewStyle;
} else if (view instanceof AppCompatSpinner) {
return R.attr.spinnerStyle;
} else if (view instanceof AppCompatImageButton) {
return R.attr.imageButtonStyle;
} else if (view instanceof AppCompatRatingBar) {
return R.attr.ratingBarStyle;
} else if (view instanceof AppCompatSeekBar) {
return R.attr.seekBarStyle;
} else {
return super.getDefaultViewDefStyleAttr(view);
}
}
示例6: onCreateView
import android.support.v7.widget.AppCompatAutoCompleteTextView; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.location_view, container, false);
mButtonCancel = (TextView) view.findViewById(R.id.place_search_dialog_cancel_TV);
mButtonOk = (TextView) view.findViewById(R.id.place_search_dialog_ok_TV);
mAutocompleteLocation = (AppCompatAutoCompleteTextView) view.findViewById(R.id.place_search_dialog_location_ET);
mValidator = new Validator(this);
mValidator.setValidationListener(this);
mValidator.put(mAutocompleteLocation, new AutocompleteLocationRule());
initOkButtons();
initAutoCompleteOnItemClick();
initAutoCompleteOnFocusChange();
return view;
}
示例7: onCreateView
import android.support.v7.widget.AppCompatAutoCompleteTextView; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_register_service, container, false);
serviceNameEditText = (EditText) view.findViewById(R.id.service_name);
regTypeEditText = (AppCompatAutoCompleteTextView) view.findViewById(R.id.reg_type);
portEditText = (EditText) view.findViewById(R.id.port);
serviceNameEditText.setOnEditorActionListener(this);
regTypeEditText.setOnEditorActionListener(this);
portEditText.setOnEditorActionListener(this);
adapter = new TxtRecordsAdapter(getContext(), new HashMap<String, String>()){
@Override
public void onItemClick(View view, int position) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
final String key = getKey(position);
String value = getValue(position);
// Inflate and set the layout for the dialog
// Pass null as the parent view because its going in the dialog layout
builder.setMessage("Do you really want to delete " + key + "=" + value + " ?")
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id1) {
mRecords.remove(key);
adapter.swap(mRecords);
adapter.notifyDataSetChanged();
}
})
.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id1) {
}
});
builder.create().show();
}
};
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
recyclerView.setLayoutManager(new LinearLayoutManager(view.getContext(), LinearLayoutManager.VERTICAL, false));
recyclerView.setAdapter(adapter);
List<String> regTypes = BonjourApplication.getRegTypeManager(getContext()).getListRegTypes();
regTypeEditText.setAdapter(new ArrayAdapter<>(getContext(), android.R.layout.select_dialog_item, regTypes));
view.findViewById(R.id.fab).setOnClickListener(this);
return view;
}