From 2b17931628a4d1612d344e9359fbb630c118efff Mon Sep 17 00:00:00 2001 From: TacoTheDank Date: Fri, 24 Sep 2021 21:10:59 -0400 Subject: Use some empty implementations of listeners --- .../activities/SearchActivity.java | 26 ++++----------------- .../activities/ViewImageOrGifActivity.java | 27 +--------------------- .../adapters/PostDetailRecyclerViewAdapter.java | 12 +--------- .../adapters/PostRecyclerViewAdapter.java | 24 ++----------------- .../ViewRedditGalleryImageOrGifFragment.java | 27 +--------------------- 5 files changed, 9 insertions(+), 107 deletions(-) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java index c7cbf120..eab43461 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java @@ -20,7 +20,9 @@ import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.lifecycle.ViewModelProvider; import androidx.recyclerview.widget.RecyclerView; +import com.ferfalk.simplesearchview.SimpleOnQueryTextListener; import com.ferfalk.simplesearchview.SimpleSearchView; +import com.ferfalk.simplesearchview.SimpleSearchViewListener; import com.google.android.material.appbar.AppBarLayout; import com.r0adkll.slidr.Slidr; @@ -154,26 +156,11 @@ public class SearchActivity extends BaseActivity { simpleSearchView.setHint(getText(R.string.search_only_users_hint)); } - simpleSearchView.setOnSearchViewListener(new SimpleSearchView.SearchViewListener() { - @Override - public void onSearchViewShown() { - - } - + simpleSearchView.setOnSearchViewListener(new SimpleSearchViewListener() { @Override public void onSearchViewClosed() { finish(); } - - @Override - public void onSearchViewShownAnimation() { - - } - - @Override - public void onSearchViewClosedAnimation() { - - } }); mAccountName = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCOUNT_NAME, null); @@ -201,7 +188,7 @@ public class SearchActivity extends BaseActivity { finish(); }); - simpleSearchView.setOnQueryTextListener(new SimpleSearchView.OnQueryTextListener() { + simpleSearchView.setOnQueryTextListener(new SimpleOnQueryTextListener() { @Override public boolean onQueryTextSubmit(@NonNull String query) { search(query); @@ -244,11 +231,6 @@ public class SearchActivity extends BaseActivity { } return false; } - - @Override - public boolean onQueryTextCleared() { - return false; - } }); if (savedInstanceState != null) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java index 9602da8b..e2d10e55 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java @@ -266,12 +266,7 @@ public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWa final SubsamplingScaleImageView view = mImageView.getSSIV(); if (view != null) { - view.setOnImageEventListener(new SubsamplingScaleImageView.OnImageEventListener() { - @Override - public void onReady() { - - } - + view.setOnImageEventListener(new SubsamplingScaleImageView.DefaultOnImageEventListener() { @Override public void onImageLoaded() { view.setMinimumDpi(80); @@ -280,26 +275,6 @@ public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWa view.setQuickScaleEnabled(true); view.resetScaleAndCenter(); } - - @Override - public void onPreviewLoadError(Exception e) { - - } - - @Override - public void onImageLoadError(Exception e) { - - } - - @Override - public void onTileLoadError(Exception e) { - - } - - @Override - public void onPreviewReleased() { - - } }); } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java index e7a673cc..4c3ee7e3 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java @@ -1727,7 +1727,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter cues) { - - } - @Override public void onRenderedFirstFrame() { mGlide.clear(previewImageView); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java index 93a4ef30..6bc1ec30 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java @@ -2758,7 +2758,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter cues) { - - } - @Override public void onRenderedFirstFrame() { mGlide.clear(previewImageView); @@ -3987,7 +3977,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter cues) { - - } - @Override public void onRenderedFirstFrame() { mGlide.clear(previewImageView); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java index cee6d404..05f0ab7a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java @@ -153,12 +153,7 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment { final SubsamplingScaleImageView view = imageView.getSSIV(); if (view != null) { - view.setOnImageEventListener(new SubsamplingScaleImageView.OnImageEventListener() { - @Override - public void onReady() { - - } - + view.setOnImageEventListener(new SubsamplingScaleImageView.DefaultOnImageEventListener() { @Override public void onImageLoaded() { view.setMinimumDpi(80); @@ -167,26 +162,6 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment { view.setQuickScaleEnabled(true); view.resetScaleAndCenter(); } - - @Override - public void onPreviewLoadError(Exception e) { - - } - - @Override - public void onImageLoadError(Exception e) { - - } - - @Override - public void onTileLoadError(Exception e) { - - } - - @Override - public void onPreviewReleased() { - - } }); } } -- cgit v1.2.3