Use some empty implementations of listeners

This commit is contained in:
TacoTheDank 2021-09-24 21:10:59 -04:00
parent 92c76f2e12
commit 2b17931628
5 changed files with 9 additions and 107 deletions

View File

@ -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) {

View File

@ -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() {
}
});
}
}

View File

@ -1727,7 +1727,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
}
if (helper == null) {
helper = new ExoPlayerViewHelper(this, mediaUri, null, mExoCreator);
helper.addEventListener(new Playable.EventListener() {
helper.addEventListener(new Playable.DefaultEventListener() {
@Override
public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) {
if (!trackGroups.isEmpty()) {
@ -1749,16 +1749,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
}
}
@Override
public void onMetadata(Metadata metadata) {
}
@Override
public void onCues(List<Cue> cues) {
}
@Override
public void onRenderedFirstFrame() {
mGlide.clear(previewImageView);

View File

@ -2758,7 +2758,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
}
if (helper == null) {
helper = new ExoPlayerViewHelper(this, mediaUri, null, mExoCreator);
helper.addEventListener(new Playable.EventListener() {
helper.addEventListener(new Playable.DefaultEventListener() {
@Override
public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) {
if (!trackGroups.isEmpty()) {
@ -2783,16 +2783,6 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
}
}
@Override
public void onMetadata(Metadata metadata) {
}
@Override
public void onCues(List<Cue> cues) {
}
@Override
public void onRenderedFirstFrame() {
mGlide.clear(previewImageView);
@ -3987,7 +3977,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
}
if (helper == null) {
helper = new ExoPlayerViewHelper(this, mediaUri, null, mExoCreator);
helper.addEventListener(new Playable.EventListener() {
helper.addEventListener(new Playable.DefaultEventListener() {
@Override
public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) {
if (!trackGroups.isEmpty()) {
@ -4012,16 +4002,6 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
}
}
@Override
public void onMetadata(Metadata metadata) {
}
@Override
public void onCues(List<Cue> cues) {
}
@Override
public void onRenderedFirstFrame() {
mGlide.clear(previewImageView);

View File

@ -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() {
}
});
}
}