mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2025-10-29 19:59:22 +00:00
Fix some deprecations and warnings (#7947)
This commit is contained in:
parent
b4a6762bd6
commit
3a94f1f430
@ -78,13 +78,13 @@ import de.danoeh.antennapod.ui.screen.subscriptions.SubscriptionFragment;
|
||||
import de.danoeh.antennapod.ui.view.BottomSheetBackPressedCallback;
|
||||
import de.danoeh.antennapod.ui.view.LockableBottomSheetBehavior;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* The activity that is shown when the user launches the app.
|
||||
@ -104,10 +104,10 @@ public class MainActivity extends CastEnabledActivity {
|
||||
private @Nullable ActionBarDrawerToggle drawerToggle;
|
||||
private BottomNavigation bottomNavigation;
|
||||
private View navDrawer;
|
||||
private LockableBottomSheetBehavior sheetBehavior;
|
||||
private LockableBottomSheetBehavior<FragmentContainerView> sheetBehavior;
|
||||
private BottomSheetBackPressedCallback bottomSheetBackPressedCallback;
|
||||
private OnBackPressedCallback openDefaultPageBackPressedCallback;
|
||||
private RecyclerView.RecycledViewPool recycledViewPool = new RecyclerView.RecycledViewPool();
|
||||
private final RecyclerView.RecycledViewPool recycledViewPool = new RecyclerView.RecycledViewPool();
|
||||
private int lastTheme = 0;
|
||||
private Insets systemBarInsets = Insets.NONE;
|
||||
|
||||
@ -189,10 +189,10 @@ public class MainActivity extends CastEnabledActivity {
|
||||
transaction.replace(R.id.audioplayerFragment, audioPlayerFragment, AudioPlayerFragment.TAG);
|
||||
transaction.commit();
|
||||
|
||||
View bottomSheet = findViewById(R.id.audioplayerFragment);
|
||||
sheetBehavior = (LockableBottomSheetBehavior) BottomSheetBehavior.from(bottomSheet);
|
||||
FragmentContainerView bottomSheet = findViewById(R.id.audioplayerFragment);
|
||||
sheetBehavior = (LockableBottomSheetBehavior<FragmentContainerView>) BottomSheetBehavior.from(bottomSheet);
|
||||
sheetBehavior.setHideable(false);
|
||||
sheetBehavior.setBottomSheetCallback(bottomSheetCallback);
|
||||
sheetBehavior.addBottomSheetCallback(bottomSheetCallback);
|
||||
bottomSheetBackPressedCallback = new BottomSheetBackPressedCallback(false, sheetBehavior, bottomSheet);
|
||||
|
||||
FeedUpdateManager.getInstance().restartUpdateAlarm(this, false);
|
||||
@ -357,7 +357,7 @@ public class MainActivity extends CastEnabledActivity {
|
||||
return drawerLayout != null && navDrawer != null && drawerLayout.isDrawerOpen(navDrawer);
|
||||
}
|
||||
|
||||
public LockableBottomSheetBehavior getBottomSheet() {
|
||||
public LockableBottomSheetBehavior<FragmentContainerView> getBottomSheet() {
|
||||
return sheetBehavior;
|
||||
}
|
||||
|
||||
@ -482,7 +482,7 @@ public class MainActivity extends CastEnabledActivity {
|
||||
}
|
||||
|
||||
public void loadChildFragment(Fragment fragment, TransitionEffect transition, String navigationTag) {
|
||||
Validate.notNull(fragment);
|
||||
Objects.requireNonNull(fragment);
|
||||
if (navigationTag != null && bottomNavigation != null) {
|
||||
bottomNavigation.updateSelectedItem(navigationTag);
|
||||
}
|
||||
@ -558,7 +558,7 @@ public class MainActivity extends CastEnabledActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRestoreInstanceState(Bundle savedInstanceState) {
|
||||
protected void onRestoreInstanceState(@NonNull Bundle savedInstanceState) {
|
||||
super.onRestoreInstanceState(savedInstanceState);
|
||||
|
||||
if (getBottomSheet().getState() == BottomSheetBehavior.STATE_EXPANDED) {
|
||||
|
||||
@ -74,13 +74,13 @@ import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
/**
|
||||
@ -126,7 +126,7 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
Bundle args = getArguments();
|
||||
Validate.notNull(args);
|
||||
Objects.requireNonNull(args);
|
||||
feedID = args.getLong(ARGUMENT_FEED_ID);
|
||||
}
|
||||
|
||||
|
||||
@ -154,7 +154,7 @@ public class FeedUpdateWorker extends Worker {
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ListenableFuture getForegroundInfoAsync() {
|
||||
public ListenableFuture<ForegroundInfo> getForegroundInfoAsync() {
|
||||
return Futures.immediateFuture(new ForegroundInfo(R.id.notification_updating_feeds, createNotification(null)));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user