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


Java AutoCompleteTextView.setOnClickListener方法代码示例

本文整理汇总了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);
        }
    });
}
 
开发者ID:Protino,项目名称:CodeWatch,代码行数:26,代码来源:LeaderboardFragment.java

示例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);
}
 
开发者ID:friendsofagape,项目名称:Autographa-Go,代码行数:41,代码来源:SearchActivity.java


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