Source:
<code>public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) { View content = View.inflate(ctx, R.layout.share_episode_dialog, null); AlertDialog.Builder builder = new AlertDialog.Builder(ctx); builder.setTitle(R.string.share_label); builder.setView(content); radioGroup = content.findViewById(R.id.share_dialog_radio_group); radioEpisodeWebsite = content.findViewById(R.id.share_episode_website_radio); radioMediaFile = content.findViewById(R.id.share_media_file_radio); switchStartAt = content.findViewById(R.id.share_start_at_timer_dialog); setupOptions(); builder <START> .setPositiveButton(R.string.share_label, new DialogInterface.OnClickListener() { <END> @Override public void onClick(DialogInterface dialog, int id) { if (radioEpisodeWebsite.isChecked()) { ShareUtils.shareFeedItemLink(ctx, item, switchStartAt.isChecked()); prefs.edit().putBoolean(PREF_SHARE_EPISODE_START_AT, switchStartAt.isChecked()).apply(); prefs.edit().putBoolean(PREF_SHARE_EPISODE_WEBSITE, true).apply(); prefs.edit().putBoolean(PREF_SHARE_EPISODE_MEDIA, false).apply(); } else { ShareUtils.shareFeedItemLink(ctx, item, switchStartAt.isChecked()); prefs.edit().putBoolean(PREF_SHARE_EPISODE_START_AT, switchStartAt.isChecked()).apply(); prefs.edit().putBoolean(PREF_SHARE_EPISODE_WEBSITE, false).apply(); prefs.edit().putBoolean(PREF_SHARE_EPISODE_MEDIA, true).apply(); } } }) .setNegativeButton(R.string.cancel_label, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); } }); return builder.create(); }</code><technical_language>please remove newline builder setPositiveButton move indentation of listener left? I checkstyle happy then, too, horizontal space</technical_language>

Target:
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) { if (getArguments() != null) { ctx = getActivity(); item = (FeedItem) getArguments().getSerializable(ARGUMENT_FEED_ITEM); prefs = getActivity().getSharedPreferences("ShareDialog", Context.MODE_PRIVATE); } View content = View.inflate(ctx, R.layout.share_episode_dialog, null); AlertDialog.Builder builder = new AlertDialog.Builder(ctx); builder.setTitle(R.string.share_label); builder.setView(content); radioGroup = content.findViewById(R.id.share_dialog_radio_group); radioEpisodeWebsite = content.findViewById(R.id.share_episode_website_radio); radioMediaFile = content.findViewById(R.id.share_media_file_radio); checkBoxStartAt = content.findViewById(R.id.share_start_at_timer_dialog); setupOptions(); builder.setPositiveButton(R.string.share_label, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { boolean includePlaybackPosition = checkBoxStartAt.isChecked(); if (radioEpisodeWebsite.isChecked()) { ShareUtils.shareFeedItemLink(ctx, item, includePlaybackPosition); prefs.edit().putString(PREF_SHARE_DIALOG_OPTION, "website").apply(); } else { ShareUtils.shareFeedItemDownloadLink(ctx, item, includePlaybackPosition); prefs.edit().putString(PREF_SHARE_DIALOG_OPTION, "media").apply(); } prefs.edit().putBoolean(PREF_SHARE_EPISODE_START_AT, includePlaybackPosition).apply(); } }).setNegativeButton(R.string.cancel_label, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); } }); return builder.create(); }