コード例 #1
0
 public void showSuggestions() {
   if (mAdapter != null
       && mAdapter.getItemCount() > 0
       && mSuggestionsRecyclerView.getVisibility() == GONE) {
     mSuggestionsRecyclerView.setVisibility(VISIBLE);
     mSeparatorView.setVisibility(VISIBLE);
   }
 }
コード例 #2
0
 @Override
 public void onBackPressed() {
   if (mSearchView.isSearching()) {
     mSearchView.closeSearch();
   } else if (mRecyclerView.getVisibility() == View.VISIBLE) {
     mResultAdapter.clear();
     mRecyclerView.setVisibility(View.GONE);
   } else {
     super.onBackPressed();
   }
 }
コード例 #3
0
ファイル: FeedFragment.java プロジェクト: lpjhblpj/football
  public void onEventMainThread(MainActivity.BottomItemRefreshEvent event) {
    if (event.bottomIndex == 2
        && !refreshing
        && mListView != null
        && mListView.getVisibility() == View.VISIBLE) {
      swipeRefreshLayout.setRefreshing(true);

      mListView.post(
          new Runnable() {
            @Override
            public void run() {
              mListView.smoothScrollToPosition(0);
            }
          });
      mListView.postDelayed(
          new Runnable() {
            @Override
            public void run() {
              onRefresh();
            }
          },
          800);
    }
  }
コード例 #4
0
 public void dismissSuggestions() {
   if (mSuggestionsRecyclerView.getVisibility() == VISIBLE) {
     mSuggestionsRecyclerView.setVisibility(GONE);
     mSeparatorView.setVisibility(GONE);
   }
 }