Enforce SeparatorWrap

This commit is contained in:
ByteHamster 2020-02-02 17:56:57 +01:00
parent b656cb91a2
commit 719af170a7
7 changed files with 48 additions and 29 deletions

View File

@ -116,8 +116,8 @@ public class EspressoTestUtils {
String[] sharedPreferencesFileNames = new File(root, "shared_prefs").list(); String[] sharedPreferencesFileNames = new File(root, "shared_prefs").list();
for (String fileName : sharedPreferencesFileNames) { for (String fileName : sharedPreferencesFileNames) {
System.out.println("Cleared database: " + fileName); System.out.println("Cleared database: " + fileName);
InstrumentationRegistry.getTargetContext(). InstrumentationRegistry.getTargetContext().getSharedPreferences(
getSharedPreferences(fileName.replace(".xml", ""), Context.MODE_PRIVATE).edit().clear().commit(); fileName.replace(".xml", ""), Context.MODE_PRIVATE).edit().clear().commit();
} }
} }

View File

@ -126,11 +126,11 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
if (feedUrl == null) { if (feedUrl == null) {
Log.e(TAG, "feedUrl is null."); Log.e(TAG, "feedUrl is null.");
new AlertDialog.Builder(OnlineFeedViewActivity.this). new AlertDialog.Builder(OnlineFeedViewActivity.this)
setNeutralButton(android.R.string.ok, .setNeutralButton(android.R.string.ok, (dialog, which) -> finish())
(dialog, which) -> finish()). .setTitle(R.string.error_label)
setTitle(R.string.error_label). .setMessage(R.string.null_value_podcast_error)
setMessage(R.string.null_value_podcast_error).create().show(); .show();
} else { } else {
Log.d(TAG, "Activity was started with url " + feedUrl); Log.d(TAG, "Activity was started with url " + feedUrl);
setLoadingLayout(); setLoadingLayout();

View File

@ -74,16 +74,14 @@ public class GpodderPreferencesFragment extends PreferenceFragmentCompat {
dialog.show(); dialog.show();
return true; return true;
}); });
findPreference(PREF_GPODNET_SYNC). findPreference(PREF_GPODNET_SYNC).setOnPreferenceClickListener(preference -> {
setOnPreferenceClickListener(preference -> {
GpodnetSyncService.sendSyncIntent(getActivity().getApplicationContext()); GpodnetSyncService.sendSyncIntent(getActivity().getApplicationContext());
Toast toast = Toast.makeText(getActivity(), R.string.pref_gpodnet_sync_started, Toast toast = Toast.makeText(getActivity(), R.string.pref_gpodnet_sync_started,
Toast.LENGTH_SHORT); Toast.LENGTH_SHORT);
toast.show(); toast.show();
return true; return true;
}); });
findPreference(PREF_GPODNET_FORCE_FULL_SYNC). findPreference(PREF_GPODNET_FORCE_FULL_SYNC).setOnPreferenceClickListener(preference -> {
setOnPreferenceClickListener(preference -> {
GpodnetPreferences.setLastSubscriptionSyncTimestamp(0L); GpodnetPreferences.setLastSubscriptionSyncTimestamp(0L);
GpodnetPreferences.setLastEpisodeActionsSyncTimestamp(0L); GpodnetPreferences.setLastEpisodeActionsSyncTimestamp(0L);
GpodnetPreferences.setLastSyncAttempt(false, 0); GpodnetPreferences.setLastSyncAttempt(false, 0);
@ -94,17 +92,16 @@ public class GpodderPreferencesFragment extends PreferenceFragmentCompat {
toast.show(); toast.show();
return true; return true;
}); });
findPreference(PREF_GPODNET_LOGOUT).setOnPreferenceClickListener( findPreference(PREF_GPODNET_LOGOUT).setOnPreferenceClickListener(preference -> {
preference -> {
GpodnetPreferences.logout(); GpodnetPreferences.logout();
Toast toast = Toast.makeText(activity, R.string.pref_gpodnet_logout_toast, Toast.LENGTH_SHORT); Toast toast = Toast.makeText(activity, R.string.pref_gpodnet_logout_toast, Toast.LENGTH_SHORT);
toast.show(); toast.show();
updateGpodnetPreferenceScreen(); updateGpodnetPreferenceScreen();
return true; return true;
}); });
findPreference(PREF_GPODNET_HOSTNAME).setOnPreferenceClickListener( findPreference(PREF_GPODNET_HOSTNAME).setOnPreferenceClickListener(preference -> {
preference -> { GpodnetSetHostnameDialog.createDialog(activity).setOnDismissListener(
GpodnetSetHostnameDialog.createDialog(activity).setOnDismissListener(dialog -> updateGpodnetPreferenceScreen()); dialog -> updateGpodnetPreferenceScreen());
return true; return true;
}); });
} }

View File

@ -43,8 +43,8 @@ public abstract class CastEnabledActivity extends AppCompatActivity
return; return;
} }
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()). PreferenceManager.getDefaultSharedPreferences(getApplicationContext())
registerOnSharedPreferenceChangeListener(this); .registerOnSharedPreferenceChangeListener(this);
castConsumer = new DefaultCastConsumer() { castConsumer = new DefaultCastConsumer() {
@Override @Override

View File

@ -38,6 +38,33 @@
<module name="FallThrough"/> <module name="FallThrough"/>
<module name="UpperEll"/> <module name="UpperEll"/>
<module name="ModifierOrder"/> <module name="ModifierOrder"/>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapDot"/>
<property name="tokens" value="DOT"/>
<property name="option" value="nl"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapComma"/>
<property name="tokens" value="COMMA"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<!-- ELLIPSIS is EOL until https://github.com/google/styleguide/issues/258 -->
<property name="id" value="SeparatorWrapEllipsis"/>
<property name="tokens" value="ELLIPSIS"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<!-- ARRAY_DECLARATOR is EOL until https://github.com/google/styleguide/issues/259 -->
<property name="id" value="SeparatorWrapArrayDeclarator"/>
<property name="tokens" value="ARRAY_DECLARATOR"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapMethodRef"/>
<property name="tokens" value="METHOD_REF"/>
<property name="option" value="nl"/>
</module>
<module name="PackageName"> <module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/> <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern" <message key="name.invalidPattern"

View File

@ -1243,14 +1243,11 @@ public class CastManager extends BaseCastManager implements OnFailedListener {
throw new NoConnectionException(); throw new NoConnectionException();
} }
Log.d(TAG, "remoteMediaPlayer.seek() to position " + position); Log.d(TAG, "remoteMediaPlayer.seek() to position " + position);
remoteMediaPlayer.seek(mApiClient, remoteMediaPlayer.seek(mApiClient, position, RESUME_STATE_UNCHANGED).setResultCallback(result -> {
position, if (!result.getStatus().isSuccess()) {
RESUME_STATE_UNCHANGED). onFailed(R.string.cast_failed_seek, result.getStatus().getStatusCode());
setResultCallback(result -> { }
if (!result.getStatus().isSuccess()) { });
onFailed(R.string.cast_failed_seek, result.getStatus().getStatusCode());
}
});
} }
/** /**

View File

@ -226,9 +226,7 @@ public class ItemEnqueuePositionCalculatorTest {
private static FeedItem setAsDownloading(int id, DownloadStateProvider stubDownloadStateProvider, private static FeedItem setAsDownloading(int id, DownloadStateProvider stubDownloadStateProvider,
boolean isDownloading) { boolean isDownloading) {
FeedItem item = createFeedItem(id); FeedItem item = createFeedItem(id);
FeedMedia media = FeedMedia media = new FeedMedia(item, "http://download.url.net/" + id, 100000 + id, "audio/mp3");
new FeedMedia(item, "http://download.url.net/" + id
, 100000 + id, "audio/mp3");
media.setId(item.getId()); media.setId(item.getId());
item.setMedia(media); item.setMedia(media);
return setAsDownloading(item, stubDownloadStateProvider, isDownloading); return setAsDownloading(item, stubDownloadStateProvider, isDownloading);