Fix indentation in last 8 files

This commit is contained in:
ByteHamster 2024-03-04 23:01:24 +01:00
parent 6c0f9eec62
commit cae848b505
9 changed files with 63 additions and 86 deletions

View File

@ -241,8 +241,9 @@ public class MainActivity extends CastEnabledActivity {
outState.putInt(KEY_GENERATED_VIEW_ID, View.generateViewId());
}
private final BottomSheetBehavior.BottomSheetCallback bottomSheetCallback =
new BottomSheetBehavior.BottomSheetCallback() {
private final BottomSheetBehavior.BottomSheetCallback bottomSheetCallback = new AntennaPodBottomSheetCallback();
private class AntennaPodBottomSheetCallback extends BottomSheetBehavior.BottomSheetCallback {
@Override
public void onStateChanged(@NonNull View view, int state) {
if (state == BottomSheetBehavior.STATE_COLLAPSED) {
@ -266,7 +267,7 @@ public class MainActivity extends CastEnabledActivity {
audioPlayer.fadePlayerToToolbar(slideOffset);
}
};
}
public void setupToolbarToggle(@NonNull MaterialToolbar toolbar, boolean displayUpArrow) {
if (drawerLayout != null) { // Tablet layout does not have a drawer

View File

@ -96,13 +96,13 @@ public class DownloadsPreferencesFragment extends PreferenceFragmentCompat
private void showAutoDeleteEnableDialog() {
new MaterialAlertDialogBuilder(requireContext())
.setMessage(R.string.pref_auto_local_delete_dialog_body)
.setPositiveButton(R.string.yes, (dialog, which) -> {
blockAutoDeleteLocal = false;
((TwoStatePreference) findPreference(PREF_AUTO_DELETE_LOCAL)).setChecked(true);
blockAutoDeleteLocal = true;
})
.setNegativeButton(R.string.cancel_label, null)
.show();
.setMessage(R.string.pref_auto_local_delete_dialog_body)
.setPositiveButton(R.string.yes, (dialog, which) -> {
blockAutoDeleteLocal = false;
((TwoStatePreference) findPreference(PREF_AUTO_DELETE_LOCAL)).setChecked(true);
blockAutoDeleteLocal = true;
})
.setNegativeButton(R.string.cancel_label, null)
.show();
}
}

View File

@ -23,10 +23,10 @@ public class LocalDeleteModal {
}
new MaterialAlertDialogBuilder(context)
.setTitle(R.string.delete_episode_label)
.setMessage(R.string.delete_local_feed_warning_body)
.setPositiveButton(R.string.delete_label, (dialog, which) -> deleteCommand.run())
.setNegativeButton(R.string.cancel_label, null)
.show();
.setTitle(R.string.delete_episode_label)
.setMessage(R.string.delete_local_feed_warning_body)
.setPositiveButton(R.string.delete_label, (dialog, which) -> deleteCommand.run())
.setNegativeButton(R.string.cancel_label, null)
.show();
}
}

View File

@ -125,6 +125,14 @@
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
</module>
<module name="MethodParamPad"/>
<module name="Indentation">
<property name="basicOffset" value="4"/>
<property name="braceAdjustment" value="0"/>
<property name="caseIndent" value="4"/>
<property name="throwsIndent" value="8"/>
<property name="lineWrappingIndentation" value="8"/>
<property name="arrayInitIndent" value="4"/>
</module>
<module name="NoWhitespaceBefore">
<property name="tokens"
value="COMMA, SEMI, POST_INC, POST_DEC, DOT, ELLIPSIS, METHOD_REF"/>

View File

@ -221,8 +221,7 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
if (playerStatus == PlayerStatus.PREPARED && media.getPosition() > 0) {
int newPosition = RewindAfterPauseUtils.calculatePositionWithRewind(
media.getPosition(),
media.getLastPlayedTime());
media.getPosition(), media.getLastPlayedTime());
seekTo(newPosition);
}
mediaPlayer.start();

View File

@ -1195,7 +1195,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
this.autoSkippedFeedMediaId = feedMedia.getItem().getIdentifyingValue();
mediaPlayer.skip();
}
}
}
/**
* Updates the Media Session for the corresponding status.
@ -1624,11 +1624,10 @@ public class PlaybackService extends MediaBrowserServiceCompat {
if (getPlayable() instanceof FeedMedia) {
if (((FeedMedia) getPlayable()).getItem().getFeed().getId() == event.getFeedId()) {
if (event.getSkipEnding() != 0) {
FeedPreferences feedPreferences
= ((FeedMedia) getPlayable()).getItem().getFeed().getPreferences();
feedPreferences.setFeedSkipIntro(event.getSkipIntro());
feedPreferences.setFeedSkipEnding(event.getSkipEnding());
FeedPreferences feedPreferences
= ((FeedMedia) getPlayable()).getItem().getFeed().getPreferences();
feedPreferences.setFeedSkipIntro(event.getSkipIntro());
feedPreferences.setFeedSkipEnding(event.getSkipEnding());
}
}
}

View File

@ -108,9 +108,9 @@ public class Atom extends Namespace {
* feed-object has no link yet b) type of link is
* LINK_TYPE_HTML or LINK_TYPE_XHTML
*/
if (state.getFeed() != null &&
((type == null && state.getFeed().getLink() == null) ||
(LINK_TYPE_HTML.equals(type) || LINK_TYPE_XHTML.equals(type)))) {
if (state.getFeed() != null
&& ((type == null && state.getFeed().getLink() == null)
|| (LINK_TYPE_HTML.equals(type) || LINK_TYPE_XHTML.equals(type)))) {
state.getFeed().setLink(href);
} else if (LINK_TYPE_ATOM.equals(type) || LINK_TYPE_RSS.equals(type)) {
// treat as podlove alternate feed
@ -188,17 +188,17 @@ public class Atom extends Namespace {
} else if (ENTRY.equals(second) && state.getCurrentItem() != null) {
state.getCurrentItem().setTitle(textElement.getProcessedContent());
}
} else if (SUBTITLE.equals(top) && FEED.equals(second) && textElement != null &&
state.getFeed() != null) {
} else if (SUBTITLE.equals(top) && FEED.equals(second) && textElement != null
&& state.getFeed() != null) {
state.getFeed().setDescription(textElement.getProcessedContent());
} else if (CONTENT.equals(top) && ENTRY.equals(second) && textElement != null &&
state.getCurrentItem() != null) {
} else if (CONTENT.equals(top) && ENTRY.equals(second) && textElement != null
&& state.getCurrentItem() != null) {
state.getCurrentItem().setDescriptionIfLonger(textElement.getProcessedContent());
} else if (SUMMARY.equals(top) && ENTRY.equals(second) && textElement != null
&& state.getCurrentItem() != null) {
state.getCurrentItem().setDescriptionIfLonger(textElement.getProcessedContent());
} else if (UPDATED.equals(top) && ENTRY.equals(second) && state.getCurrentItem() != null &&
state.getCurrentItem().getPubDate() == null) {
} else if (UPDATED.equals(top) && ENTRY.equals(second) && state.getCurrentItem() != null
&& state.getCurrentItem().getPubDate() == null) {
state.getCurrentItem().setPubDate(DateUtils.parseOrNullIfFuture(content));
} else if (PUBLISHED.equals(top) && ENTRY.equals(second) && state.getCurrentItem() != null) {
state.getCurrentItem().setPubDate(DateUtils.parseOrNullIfFuture(content));
@ -206,8 +206,8 @@ public class Atom extends Namespace {
state.getFeed().setImageUrl(content);
} else if (IMAGE_ICON.equals(top) && state.getFeed() != null) {
state.getFeed().setImageUrl(content);
} else if (AUTHOR_NAME.equals(top) && AUTHOR.equals(second) &&
state.getFeed() != null && state.getCurrentItem() == null) {
} else if (AUTHOR_NAME.equals(top) && AUTHOR.equals(second)
&& state.getFeed() != null && state.getCurrentItem() == null) {
String currentName = state.getFeed().getAuthor();
if (currentName == null) {
state.getFeed().setAuthor(content);

View File

@ -22,8 +22,8 @@ public class DublinCore extends Namespace {
@Override
public void handleElementEnd(String localName, HandlerState state) {
if (state.getCurrentItem() != null && state.getContentBuf() != null &&
state.getTagstack() != null && state.getTagstack().size() >= 2) {
if (state.getCurrentItem() != null && state.getContentBuf() != null
&& state.getTagstack() != null && state.getTagstack().size() >= 2) {
FeedItem currentItem = state.getCurrentItem();
String top = state.getTagstack().peek().getName();
String second = state.getSecondTag().getName();

View File

@ -372,7 +372,9 @@ public class UserPreferences {
prefs.edit().putBoolean(UserPreferences.PREF_FOLLOW_QUEUE, value).apply();
}
public static boolean shouldSkipKeepEpisode() { return prefs.getBoolean(PREF_SKIP_KEEPS_EPISODE, true); }
public static boolean shouldSkipKeepEpisode() {
return prefs.getBoolean(PREF_SKIP_KEEPS_EPISODE, true);
}
public static boolean shouldFavoriteKeepEpisode() {
return prefs.getBoolean(PREF_FAVORITE_KEEPS_EPISODE, true);
@ -589,33 +591,23 @@ public class UserPreferences {
}
public static void setFastForwardSecs(int secs) {
prefs.edit()
.putInt(PREF_FAST_FORWARD_SECS, secs)
.apply();
prefs.edit().putInt(PREF_FAST_FORWARD_SECS, secs).apply();
}
public static void setRewindSecs(int secs) {
prefs.edit()
.putInt(PREF_REWIND_SECS, secs)
.apply();
prefs.edit().putInt(PREF_REWIND_SECS, secs).apply();
}
public static void setPlaybackSpeed(float speed) {
prefs.edit()
.putString(PREF_PLAYBACK_SPEED, String.valueOf(speed))
.apply();
prefs.edit().putString(PREF_PLAYBACK_SPEED, String.valueOf(speed)).apply();
}
public static void setVideoPlaybackSpeed(float speed) {
prefs.edit()
.putString(PREF_VIDEO_PLAYBACK_SPEED, String.valueOf(speed))
.apply();
prefs.edit().putString(PREF_VIDEO_PLAYBACK_SPEED, String.valueOf(speed)).apply();
}
public static void setSkipSilence(boolean skipSilence) {
prefs.edit()
.putBoolean(PREF_PLAYBACK_SKIP_SILENCE, skipSilence)
.apply();
prefs.edit().putBoolean(PREF_PLAYBACK_SKIP_SILENCE, skipSilence).apply();
}
public static void setPlaybackSpeedArray(List<Float> speeds) {
@ -626,15 +618,11 @@ public class UserPreferences {
for (float speed : speeds) {
jsonArray.put(speedFormat.format(speed));
}
prefs.edit()
.putString(PREF_PLAYBACK_SPEED_ARRAY, jsonArray.toString())
.apply();
prefs.edit().putString(PREF_PLAYBACK_SPEED_ARRAY, jsonArray.toString()).apply();
}
public static void setAutodownloadSelectedNetworks(String[] value) {
prefs.edit()
.putString(PREF_AUTODL_SELECTED_NETWORKS, TextUtils.join(",", value))
.apply();
prefs.edit().putString(PREF_AUTODL_SELECTED_NETWORKS, TextUtils.join(",", value)).apply();
}
public static boolean gpodnetNotificationsEnabled() {
@ -652,29 +640,21 @@ public class UserPreferences {
}
public static void setGpodnetNotificationsEnabled() {
prefs.edit()
.putBoolean(PREF_GPODNET_NOTIFICATIONS, true)
.apply();
prefs.edit().putBoolean(PREF_GPODNET_NOTIFICATIONS, true).apply();
}
public static void setHiddenDrawerItems(List<String> items) {
String str = TextUtils.join(",", items);
prefs.edit()
.putString(PREF_HIDDEN_DRAWER_ITEMS, str)
.apply();
prefs.edit().putString(PREF_HIDDEN_DRAWER_ITEMS, str).apply();
}
public static void setFullNotificationButtons(List<Integer> items) {
String str = TextUtils.join(",", items);
prefs.edit()
.putString(PREF_FULL_NOTIFICATION_BUTTONS, str)
.apply();
prefs.edit().putString(PREF_FULL_NOTIFICATION_BUTTONS, str).apply();
}
public static void setQueueLocked(boolean locked) {
prefs.edit()
.putBoolean(PREF_QUEUE_LOCKED, locked)
.apply();
prefs.edit().putBoolean(PREF_QUEUE_LOCKED, locked).apply();
}
private static List<Float> readPlaybackSpeedArray(String valueFromPrefs) {
@ -700,9 +680,7 @@ public class UserPreferences {
}
public static void setEpisodeCleanupValue(int episodeCleanupValue) {
prefs.edit()
.putString(PREF_EPISODE_CLEANUP, Integer.toString(episodeCleanupValue))
.apply();
prefs.edit().putString(PREF_EPISODE_CLEANUP, Integer.toString(episodeCleanupValue)).apply();
}
/**
@ -748,9 +726,7 @@ public class UserPreferences {
public static void setDataFolder(String dir) {
Log.d(TAG, "setDataFolder(dir: " + dir + ")");
prefs.edit()
.putString(PREF_DATA_FOLDER, dir)
.apply();
prefs.edit().putString(PREF_DATA_FOLDER, dir).apply();
}
/**
@ -808,9 +784,7 @@ public class UserPreferences {
* @see #setQueueKeepSortedOrder(SortOrder)
*/
public static void setQueueKeepSorted(boolean keepSorted) {
prefs.edit()
.putBoolean(PREF_QUEUE_KEEP_SORTED, keepSorted)
.apply();
prefs.edit().putBoolean(PREF_QUEUE_KEEP_SORTED, keepSorted).apply();
}
/**
@ -833,9 +807,7 @@ public class UserPreferences {
if (sortOrder == null) {
return;
}
prefs.edit()
.putString(PREF_QUEUE_KEEP_SORTED_ORDER, sortOrder.name())
.apply();
prefs.edit().putString(PREF_QUEUE_KEEP_SORTED_ORDER, sortOrder.name()).apply();
}
public static FeedPreferences.NewEpisodesAction getNewEpisodesAction() {
@ -874,9 +846,7 @@ public class UserPreferences {
}
public static void setSubscriptionsFilter(SubscriptionsFilter value) {
prefs.edit()
.putString(PREF_FILTER_FEED, value.serialize())
.apply();
prefs.edit().putString(PREF_FILTER_FEED, value.serialize()).apply();
}
public static boolean shouldShowSubscriptionTitle() {