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


Java MaterialSearchView类代码示例

本文整理汇总了Java中com.miguelcatalan.materialsearchview.MaterialSearchView的典型用法代码示例。如果您正苦于以下问题:Java MaterialSearchView类的具体用法?Java MaterialSearchView怎么用?Java MaterialSearchView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: initSearchView

import com.miguelcatalan.materialsearchview.MaterialSearchView; //导入依赖的package包/类
private void initSearchView()
    {
        //初始化SearchBar
        mSearchView.setVoiceSearch(false);
        mSearchView.setCursorDrawable(R.drawable.custom_cursor);
        mSearchView.setEllipsize(true);
        mSearchView.setSuggestions(getResources().getStringArray(R.array.query_suggestions));
        mSearchView.setOnQueryTextListener(new MaterialSearchView.OnQueryTextListener()
        {

            @Override
            public boolean onQueryTextSubmit(String query)
            {
//                TotalStationSearchActivity.launch(getActivity(), query);
                return false;
            }

            @Override
            public boolean onQueryTextChange(String newText)
            {
                return false;
            }
        });
    }
 
开发者ID:WeDevelopTeam,项目名称:HeroVideo-master,代码行数:25,代码来源:HomePageFragment.java

示例2: onActivityResult

import com.miguelcatalan.materialsearchview.MaterialSearchView; //导入依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
    if (requestCode == MaterialSearchView.REQUEST_VOICE && resultCode == Activity.RESULT_OK)
    {
        ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
        if (matches != null && matches.size() > 0)
        {
            String searchWrd = matches.get(0);
            if (!TextUtils.isEmpty(searchWrd))
            {
                mSearchView.setQuery(searchWrd, false);
            }
        }
        return;
    }
    super.onActivityResult(requestCode, resultCode, data);
}
 
开发者ID:WeDevelopTeam,项目名称:HeroVideo-master,代码行数:19,代码来源:HomePageFragment.java

示例3: initSearchView

import com.miguelcatalan.materialsearchview.MaterialSearchView; //导入依赖的package包/类
private void initSearchView() {

    //初始化SearchBar
    mSearchView.setVoiceSearch(false);
    mSearchView.setCursorDrawable(R.drawable.custom_cursor);
    mSearchView.setEllipsize(true);
    mSearchView.setSuggestions(getResources().getStringArray(R.array.query_suggestions));
    mSearchView.setOnQueryTextListener(new MaterialSearchView.OnQueryTextListener() {

      @Override
      public boolean onQueryTextSubmit(String query) {

        TotalStationSearchActivity.launch(getActivity(), query);
        return false;
      }


      @Override
      public boolean onQueryTextChange(String newText) {

        return false;
      }
    });
  }
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:25,代码来源:HomePageFragment.java

示例4: onActivityResult

import com.miguelcatalan.materialsearchview.MaterialSearchView; //导入依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {

  if (requestCode == MaterialSearchView.REQUEST_VOICE && resultCode == Activity.RESULT_OK) {
    ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
    if (matches != null && matches.size() > 0) {
      String searchWrd = matches.get(0);
      if (!TextUtils.isEmpty(searchWrd)) {
        mSearchView.setQuery(searchWrd, false);
      }
    }

    return;
  }
  super.onActivityResult(requestCode, resultCode, data);
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:17,代码来源:HomePageFragment.java

示例5: initSearchView

import com.miguelcatalan.materialsearchview.MaterialSearchView; //导入依赖的package包/类
private void initSearchView() {
    mSearchView.setVoiceSearch(false);
    mSearchView.setCursorDrawable(R.drawable.custom_cursor);
    mSearchView.setEllipsize(false);
    mSearchView.setSuggestions(getResources().getStringArray(R.array.query_suggestions));
    mSearchView.setOnQueryTextListener(new MaterialSearchView.OnQueryTextListener() {
        @Override
        public boolean onQueryTextSubmit(String query) {
            TotalStationSearchActivity.launch(getActivity(), query);
            return false;
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            return false;
        }
    });
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:19,代码来源:HomePageFragment.java

示例6: initSearchView

import com.miguelcatalan.materialsearchview.MaterialSearchView; //导入依赖的package包/类
private void initSearchView() {

        mSearchView.setVoiceSearch(false);
        mSearchView.setCursorDrawable(R.drawable.shape_cursor);
        mSearchView.setEllipsize(true);
        mSearchView.setOnQueryTextListener(new MaterialSearchView.OnQueryTextListener() {
            @Override
            public boolean onQueryTextSubmit(String query) {
                SnackBarUtil.show(MainActivity.this, String.format(Locale.getDefault(), "哥,别搜%s了", query));
                return false;
            }

            @Override
            public boolean onQueryTextChange(String newText) {
                return false;
            }
        });
    }
 
开发者ID:crazysunj,项目名称:MultiTypeRecyclerViewAdapter,代码行数:19,代码来源:MainActivity.java

示例7: initSearchView

import com.miguelcatalan.materialsearchview.MaterialSearchView; //导入依赖的package包/类
private void initSearchView() {

        mSearchView.setVoiceSearch(false);
        mSearchView.setCursorDrawable(R.drawable.shape_cursor);
        mSearchView.setEllipsize(true);
        mSearchView.setOnQueryTextListener(new MaterialSearchView.OnQueryTextListener() {
            @Override
            public boolean onQueryTextSubmit(String query) {
                SnackBarUtil.show(NormalActivity.this, String.format(Locale.getDefault(), "哥,别搜%s了", query));
                return false;
            }

            @Override
            public boolean onQueryTextChange(String newText) {
                return false;
            }
        });
    }
 
开发者ID:crazysunj,项目名称:MultiTypeRecyclerViewAdapter,代码行数:19,代码来源:NormalActivity.java

示例8: onFinishInflate

import com.miguelcatalan.materialsearchview.MaterialSearchView; //导入依赖的package包/类
@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    View.inflate(getContext(), R.layout.merge_main_view, this);

    toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setNavigationIcon(R.drawable.ic_menu_hamburger);

    drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    navigationView = (NavigationView) findViewById(R.id.nav_view);
    logoutView = (NavigationView) navigationView.findViewById(R.id.logout_view);
    View headerLayout = navigationView.getHeaderView(0);
    profileImageView = (CircleImageView) headerLayout.findViewById(R.id.profileImageView);
    nameTextView = (TextView) headerLayout.findViewById(R.id.nameTextView);
    emailTextView = (TextView) headerLayout.findViewById(R.id.emailTextView);

    searchView = (MaterialSearchView) findViewById(R.id.search_view);
}
 
开发者ID:marcovann,项目名称:Firebase-Chat-Demo,代码行数:19,代码来源:MainView.java

示例9: onFinishInflate

import com.miguelcatalan.materialsearchview.MaterialSearchView; //导入依赖的package包/类
@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    View.inflate(getContext(), R.layout.merge_main_view, this);

    toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setNavigationIcon(R.drawable.ic_menu_hamburger);

    drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    navigationView = (NavigationView) findViewById(R.id.nav_view);
    logoutView = (NavigationView) navigationView.findViewById(R.id.logout_view);
    View headerLayout = navigationView.getHeaderView(0);
    profileImageView = (CircularImageView) headerLayout.findViewById(R.id.profileImageView);
    nameTextView = (TextView) headerLayout.findViewById(R.id.nameTextView);
    emailTextView = (TextView) headerLayout.findViewById(R.id.emailTextView);

    searchView = (MaterialSearchView) findViewById(R.id.search_view);
}
 
开发者ID:saurabhk7,项目名称:TripV1.0,代码行数:19,代码来源:MainView.java

示例10: onActivityResult

import com.miguelcatalan.materialsearchview.MaterialSearchView; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
    //GESTION DE LA RECHERCHE VIA LA VOIX
    if (requestCode == MaterialSearchView.REQUEST_VOICE && resultCode == RESULT_OK) {
        ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
        if (matches != null && matches.size() > 0) {
            String searchWrd = matches.get(0);
            if (!TextUtils.isEmpty(searchWrd)) {
                searchView.setQuery(searchWrd, false);
            }
        }

        return;
    }
    super.onActivityResult(requestCode, resultCode, data);
}
 
开发者ID:SoxZz5,项目名称:FitFood,代码行数:18,代码来源:MainActivity.java

示例11: initSearchView

import com.miguelcatalan.materialsearchview.MaterialSearchView; //导入依赖的package包/类
private void initSearchView() {
  searchView.setVoiceSearch(false);
  searchView.setCursorDrawable(R.drawable.search_view_cursor);
  searchView.setOnQueryTextListener(new MaterialSearchView.OnQueryTextListener() {
    @Override public boolean onQueryTextSubmit(final String query) {
      Timber.d("pressed search icon");
      searchTweets(query);
      return false;
    }

    @Override public boolean onQueryTextChange(String newText) {
      searchTweetsWithDelay(newText);
      return false;
    }
  });
}
 
开发者ID:pwittchen,项目名称:SearchTwitter,代码行数:17,代码来源:MainActivity.java

示例12: bindSearchView

import com.miguelcatalan.materialsearchview.MaterialSearchView; //导入依赖的package包/类
@BindingAdapter("model")
public static void bindSearchView(final MaterialSearchView searchView, final SuggestionViewModel viewModel) {
    final SuggestionAdapter adapter = new SuggestionAdapter(viewModel);
    searchView.setAdapter(adapter);

    searchView.addOnAttachStateChangeListener(new SubscribeActionOnAttachedStateChangeListener<>(
            viewModel.didUpdateSuggestion(),
            new Action1<Void>() {
                @Override
                public void call(Void aVoid) {
                    adapter.notifyDataSetChanged();
                    searchView.showSuggestions();
                }
            }
    ));
}
 
开发者ID:ffgiraldez,项目名称:rx-mvvm-android,代码行数:17,代码来源:SuggestionViewModelBinding.java

示例13: onPostCreate

import com.miguelcatalan.materialsearchview.MaterialSearchView; //导入依赖的package包/类
@Override
public void onPostCreate(Bundle savedInstanceState) {
    super.onPostCreate(savedInstanceState);
    toolbar.inflateMenu(R.menu.search);
    searchView.setMenuItem(toolbar.getMenu().findItem(R.id.action_search));
    searchView.setOnQueryTextListener(new MaterialSearchView.OnQueryTextListener() {
        @Override
        public boolean onQueryTextSubmit(String query) {
            searchViewModel.setQuery(query);
            searchView.closeSearch();
            return true;
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            suggestionViewModel.setQuery(newText);
            return false;
        }
    });
}
 
开发者ID:ffgiraldez,项目名称:rx-mvvm-android,代码行数:21,代码来源:SearchActivity.java

示例14: onActivityResult

import com.miguelcatalan.materialsearchview.MaterialSearchView; //导入依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == MaterialSearchView.REQUEST_VOICE && resultCode == RESULT_OK){
        ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
        if (matches != null && matches.size() > 0){
            String searchWord = matches.get(0);
            if (!TextUtils.isEmpty(searchWord)){
                mSearchView.setQuery(searchWord, false);
            }
        }
        return;
    }
    super.onActivityResult(requestCode, resultCode, data);
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:15,代码来源:HomePageFragment.java

示例15: initView

import com.miguelcatalan.materialsearchview.MaterialSearchView; //导入依赖的package包/类
private void initView() {

        mToolbar = (Toolbar) findViewById(R.id.toolbar);
        mRecyclerView = (RecyclerView) findViewById(R.id.recyclerview);
        mSearchView = (MaterialSearchView) findViewById(R.id.search);
        mTitle = (TextView) findViewById(R.id.title);
        mAppBar = (AppBarLayout) findViewById(R.id.appbar);
    }
 
开发者ID:crazysunj,项目名称:MultiTypeRecyclerViewAdapter,代码行数:9,代码来源:MainActivity.java


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