android.widget.SearchView.OnQueryTextListener源码实例Demo

类android.widget.SearchView.OnQueryTextListener源码实例Demo

下面列出了android.widget.SearchView.OnQueryTextListener 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

private void initSearchView(SearchView searchView) {
    searchView.setQueryHint(getString(R.string.search_a_place));
    searchView.setIconifiedByDefault(false);
    searchView.setFocusable(true);
    searchView.setIconified(false);
    searchView.requestFocusFromTouch();
    searchView.setOnQueryTextListener(new OnQueryTextListener() {
        @Override
        public boolean onQueryTextSubmit(String query) {
            return false;
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            progressBar.setIndeterminate(true);

            // Cancel any previous place prediction requests
            handler.removeCallbacksAndMessages(null);

            // Start a new place prediction request in 300 ms
            handler.postDelayed(() -> {
                getPlacePredictions(newText);
            }, 300);
            return true;
        }
    });
}
 
private void initSearchView(SearchView searchView) {
    searchView.setQueryHint(getString(R.string.search_a_place));
    searchView.setIconifiedByDefault(false);
    searchView.setFocusable(true);
    searchView.setIconified(false);
    searchView.requestFocusFromTouch();
    searchView.setOnQueryTextListener(new OnQueryTextListener() {
        @Override
        public boolean onQueryTextSubmit(String query) {
            return false;
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            progressBar.setIndeterminate(true);

            // Cancel any previous place prediction requests
            handler.removeCallbacksAndMessages(null);

            // Start a new place prediction request in 300 ms
            handler.postDelayed(() -> {
                getPlacePredictions(newText);
            }, 300);
            return true;
        }
    });
}
 
源代码3 项目: CodenameOne   文件: SearchViewCompatHoneycomb.java
public static Object newOnQueryTextListener(final OnQueryTextListenerCompatBridge listener) {
    return new OnQueryTextListener() {
        @Override
        public boolean onQueryTextSubmit(String query) {
            return listener.onQueryTextSubmit(query);
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            return listener.onQueryTextChange(newText);
        }
    };
}
 
public static Object newOnQueryTextListener(final OnQueryTextListenerCompatBridge listener) {
    return new OnQueryTextListener() {
        @Override
        public boolean onQueryTextSubmit(String query) {
            return listener.onQueryTextSubmit(query);
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            return listener.onQueryTextChange(newText);
        }
    };
}
 
源代码5 项目: V.FlyoutTest   文件: SearchViewCompatHoneycomb.java
public static Object newOnQueryTextListener(final OnQueryTextListenerCompatBridge listener) {
    return new OnQueryTextListener() {
        @Override
        public boolean onQueryTextSubmit(String query) {
            return listener.onQueryTextSubmit(query);
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            return listener.onQueryTextChange(newText);
        }
    };
}
 
源代码6 项目: guideshow   文件: SearchViewCompatHoneycomb.java
public static Object newOnQueryTextListener(final OnQueryTextListenerCompatBridge listener) {
    return new OnQueryTextListener() {
        @Override
        public boolean onQueryTextSubmit(String query) {
            return listener.onQueryTextSubmit(query);
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            return listener.onQueryTextChange(newText);
        }
    };
}
 
源代码7 项目: CodenameOne   文件: SearchViewCompatHoneycomb.java
public static void setOnQueryTextListener(Object searchView, Object listener) {
    ((SearchView) searchView).setOnQueryTextListener((OnQueryTextListener) listener);
}
 
public static void setOnQueryTextListener(Object searchView, Object listener) {
    ((SearchView) searchView).setOnQueryTextListener((OnQueryTextListener) listener);
}
 
源代码9 项目: V.FlyoutTest   文件: SearchViewCompatHoneycomb.java
public static void setOnQueryTextListener(Object searchView, Object listener) {
    ((SearchView) searchView).setOnQueryTextListener((OnQueryTextListener) listener);
}
 
源代码10 项目: guideshow   文件: SearchViewCompatHoneycomb.java
public static void setOnQueryTextListener(Object searchView, Object listener) {
    ((SearchView) searchView).setOnQueryTextListener((OnQueryTextListener) listener);
}
 
源代码评论
动弹
沙发等你来抢
 类所在包
 同包方法