本文整理匯總了Java中android.widget.AutoCompleteTextView.setOnClickListener方法的典型用法代碼示例。如果您正苦於以下問題:Java AutoCompleteTextView.setOnClickListener方法的具體用法?Java AutoCompleteTextView.setOnClickListener怎麽用?Java AutoCompleteTextView.setOnClickListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.AutoCompleteTextView
的用法示例。
在下文中一共展示了AutoCompleteTextView.setOnClickListener方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createLeaderDialog
import android.widget.AutoCompleteTextView; //導入方法依賴的package包/類
private void createLeaderDialog() {
autoCompleteTextView =
(AutoCompleteTextView) dialogView.findViewById(R.id.language_autocomplete);
autoCompleteTextView.setAdapter(new ArrayAdapter<>(
getActivity(), android.R.layout.simple_dropdown_item_1line, validLanguages));
validator = new LanguageValidator(getActivity(), autoCompleteTextView, validLanguages);
autoCompleteTextView.setValidator(validator);
autoCompleteTextView.setOnFocusChangeListener(new FocusListener());
autoCompleteTextView.setThreshold(1);
autoCompleteTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
autoCompleteTextView.showDropDown();
}
});
filteredCheckbox = (CheckBox) dialogView.findViewById(R.id.filter_rb);
filteredCheckbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
autoCompleteTextView.setVisibility(isChecked ? View.VISIBLE : View.GONE);
}
});
}
示例2: onCreate
import android.widget.AutoCompleteTextView; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
getTheme().applyStyle(SharedPrefs.getFontSize().getResId(), true);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search);
UtilFunctions.applyReadingMode();
languageCode = SharedPrefs.getString(Constants.PrefKeys.LAST_OPEN_LANGUAGE_CODE, "ENG");
versionCode = SharedPrefs.getString(Constants.PrefKeys.LAST_OPEN_VERSION_CODE, Constants.VersionCodes.ULB);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white);
toolbar.setContentInsetStartWithNavigation(0);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mAutoCompleteTextView = (AutoCompleteTextView) findViewById(R.id.auto_complete_search);
mProgressBar = (ProgressBar) findViewById(R.id.progress_bar);
noResultsFound = (LinearLayout) findViewById(R.id.no_results_found);
mIvClose = (ImageView) findViewById(R.id.iv_close);
mRecyclerView = (RecyclerView) findViewById(R.id.list_results);
sectionGroupView = (RadioGroup) findViewById(R.id.section_group);
numOfResults = (TextView) findViewById(R.id.numResults);
sectionGroupView.setOnCheckedChangeListener(this);
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mAdapter = new SearchAdapter(this, mShowSearchResultModels);
mRecyclerView.setAdapter(mAdapter);
mIvClose.setOnClickListener(this);
mAutoCompleteTextView.setOnClickListener(this);
mAutoCompleteTextView.setOnEditorActionListener(this);
}