From 882a647370efa7e5b30c275c3e5d90f8587b89bf Mon Sep 17 00:00:00 2001 From: Twig N Date: Thu, 23 Jan 2020 21:17:32 +1100 Subject: [PATCH] - renamed classes and variables because of annoying squiggly green lines --- app/src/main/AndroidManifest.xml | 2 +- .../transdroid/core/gui/TorrentsActivity.java | 4 ++-- .../core/gui/remoterss/RemoteRssFragment.java | 24 +++++++++---------- ...edsActivity.java => RssFeedsActivity.java} | 12 +++++----- ...edsFragment.java => RssFeedsFragment.java} | 6 ++--- ...emsFragment.java => RssItemsFragment.java} | 24 +++++++++---------- .../core/gui/rss/RssitemsActivity.java | 2 +- .../core/service/RssCheckerJobRunner.java | 4 ++-- .../res/layout-w900dp/activity_rssfeeds.xml | 6 ++--- app/src/main/res/layout/activity_rssfeeds.xml | 4 ++-- 10 files changed, 44 insertions(+), 44 deletions(-) rename app/src/main/java/org/transdroid/core/gui/rss/{RssfeedsActivity.java => RssFeedsActivity.java} (98%) rename app/src/main/java/org/transdroid/core/gui/rss/{RssfeedsFragment.java => RssFeedsFragment.java} (95%) rename app/src/main/java/org/transdroid/core/gui/rss/{RssitemsFragment.java => RssItemsFragment.java} (93%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d25018f8..70016539 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -248,7 +248,7 @@ diff --git a/app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java b/app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java index 3a2d8f82..147e81ea 100644 --- a/app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java +++ b/app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java @@ -82,7 +82,7 @@ import org.transdroid.core.gui.navigation.NavigationFilter; import org.transdroid.core.gui.navigation.NavigationHelper; import org.transdroid.core.gui.navigation.RefreshableActivity; import org.transdroid.core.gui.navigation.StatusType; -import org.transdroid.core.gui.rss.RssfeedsActivity_; +import org.transdroid.core.gui.rss.RssFeedsActivity_; import org.transdroid.core.gui.search.FilePickerHelper; import org.transdroid.core.gui.search.UrlEntryDialog; import org.transdroid.core.gui.settings.MainSettingsActivity_; @@ -809,7 +809,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE @OptionsItem(R.id.action_rss) protected void openRss() { - RssfeedsActivity_.intent(this).start(); + RssFeedsActivity_.intent(this).start(); } @OptionsItem(R.id.action_settings) diff --git a/app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssFragment.java b/app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssFragment.java index 6c14f567..43cb2e87 100644 --- a/app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssFragment.java +++ b/app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssFragment.java @@ -35,7 +35,7 @@ import org.transdroid.R; import org.transdroid.core.gui.log.Log; import org.transdroid.core.gui.remoterss.data.RemoteRssChannel; import org.transdroid.core.gui.remoterss.data.RemoteRssItem; -import org.transdroid.core.gui.rss.RssfeedsActivity; +import org.transdroid.core.gui.rss.RssFeedsActivity; import org.transdroid.core.gui.settings.MainSettingsActivity_; import java.util.ArrayList; @@ -57,12 +57,12 @@ public class RemoteRssFragment extends Fragment { // Views @ViewById protected View detailsContainer; - @ViewById - protected Spinner remoterssFilter; + @ViewById(R.id.remoterss_filter) + protected Spinner remoteRssFilter; @ViewById protected ListView torrentsList; - @ViewById - protected TextView remoterssStatusMessage; + @ViewById(R.id.remoterss_status_message) + protected TextView remoteRssStatusMessage; @AfterViews @@ -84,7 +84,7 @@ public class RemoteRssFragment extends Fragment { @OptionsItem(R.id.action_refresh) protected void refreshScreen() { - RssfeedsActivity rssActivity = (RssfeedsActivity) getActivity(); + RssFeedsActivity rssActivity = (RssFeedsActivity) getActivity(); rssActivity.refreshRemoteFeeds(); } @@ -107,11 +107,11 @@ public class RemoteRssFragment extends Fragment { } // Show/hide a nice message if there are no items to show if (remoteRssItems.size() > 0) { - remoterssStatusMessage.setVisibility(View.GONE); + remoteRssStatusMessage.setVisibility(View.GONE); } else { - remoterssStatusMessage.setVisibility(View.VISIBLE); - remoterssStatusMessage.setText(R.string.remoterss_no_files); + remoteRssStatusMessage.setVisibility(View.VISIBLE); + remoteRssStatusMessage.setText(R.string.remoterss_no_files); } } @@ -124,7 +124,7 @@ public class RemoteRssFragment extends Fragment { ArrayAdapter adapter = new ArrayAdapter<>(this.getContext(), android.R.layout.simple_spinner_dropdown_item, labels); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); - remoterssFilter.setAdapter(adapter); + remoteRssFilter.setAdapter(adapter); } /** @@ -135,11 +135,11 @@ public class RemoteRssFragment extends Fragment { RemoteRssItemsAdapter adapter = (RemoteRssItemsAdapter) torrentsList.getAdapter(); RemoteRssItem item = (RemoteRssItem) adapter.getItem(position); - ((RssfeedsActivity) getActivity()).downloadRemoteRssItem(item); + ((RssFeedsActivity) getActivity()).downloadRemoteRssItem(item); } @ItemSelect(R.id.remoterss_filter) protected void onFeedSelected(boolean selected, int position) { - ((RssfeedsActivity) getActivity()).onFeedSelected(position); + ((RssFeedsActivity) getActivity()).onFeedSelected(position); } } diff --git a/app/src/main/java/org/transdroid/core/gui/rss/RssfeedsActivity.java b/app/src/main/java/org/transdroid/core/gui/rss/RssFeedsActivity.java similarity index 98% rename from app/src/main/java/org/transdroid/core/gui/rss/RssfeedsActivity.java rename to app/src/main/java/org/transdroid/core/gui/rss/RssFeedsActivity.java index 6c6dda99..5ef17616 100644 --- a/app/src/main/java/org/transdroid/core/gui/rss/RssfeedsActivity.java +++ b/app/src/main/java/org/transdroid/core/gui/rss/RssFeedsActivity.java @@ -76,7 +76,7 @@ import java.util.Date; import java.util.List; @EActivity(R.layout.activity_rssfeeds) -public class RssfeedsActivity extends AppCompatActivity { +public class RssFeedsActivity extends AppCompatActivity { // Settings and local data @Bean @@ -88,14 +88,14 @@ public class RssfeedsActivity extends AppCompatActivity { protected static final int RSS_FEEDS_REMOTE = 1; @FragmentById(R.id.rssfeeds_fragment) - protected RssfeedsFragment fragmentLocalFeeds; + protected RssFeedsFragment fragmentLocalFeeds; @FragmentById(R.id.rssitems_fragment) - protected RssitemsFragment fragmentItems; + protected RssItemsFragment fragmentItems; @FragmentById(R.id.remoterss_fragment) protected RemoteRssFragment fragmentRemoteFeeds; - @ViewById - protected Toolbar rssfeedsToolbar; + @ViewById(R.id.rssfeeds_toolbar) + protected Toolbar rssFeedsToolbar; @ViewById(R.id.rssfeeds_tabs) protected TabLayout tabLayout; @ViewById(R.id.rssfeeds_pager) @@ -178,7 +178,7 @@ public class RssfeedsActivity extends AppCompatActivity { @AfterViews protected void init() { - setSupportActionBar(rssfeedsToolbar); + setSupportActionBar(rssFeedsToolbar); getSupportActionBar().setTitle(NavigationHelper.buildCondensedFontString(getString(R.string.rss_feeds))); getSupportActionBar().setDisplayHomeAsUpEnabled(true); diff --git a/app/src/main/java/org/transdroid/core/gui/rss/RssfeedsFragment.java b/app/src/main/java/org/transdroid/core/gui/rss/RssFeedsFragment.java similarity index 95% rename from app/src/main/java/org/transdroid/core/gui/rss/RssfeedsFragment.java rename to app/src/main/java/org/transdroid/core/gui/rss/RssFeedsFragment.java index 670059e9..894bf4f0 100644 --- a/app/src/main/java/org/transdroid/core/gui/rss/RssfeedsFragment.java +++ b/app/src/main/java/org/transdroid/core/gui/rss/RssFeedsFragment.java @@ -41,7 +41,7 @@ import java.util.List; */ @EFragment(R.layout.fragment_rssfeeds) @OptionsMenu(R.menu.fragment_rssfeeds) -public class RssfeedsFragment extends Fragment { +public class RssFeedsFragment extends Fragment { // Views @ViewById(R.id.rssfeeds_list) @@ -77,8 +77,8 @@ public class RssfeedsFragment extends Fragment { MainSettingsActivity_.intent(getActivity()).start(); } - protected RssfeedsActivity getRssActivity() { - return (RssfeedsActivity) getActivity(); + protected RssFeedsActivity getRssActivity() { + return (RssFeedsActivity) getActivity(); } @Override diff --git a/app/src/main/java/org/transdroid/core/gui/rss/RssitemsFragment.java b/app/src/main/java/org/transdroid/core/gui/rss/RssItemsFragment.java similarity index 93% rename from app/src/main/java/org/transdroid/core/gui/rss/RssitemsFragment.java rename to app/src/main/java/org/transdroid/core/gui/rss/RssItemsFragment.java index 31c5d7f1..e14c42cf 100644 --- a/app/src/main/java/org/transdroid/core/gui/rss/RssitemsFragment.java +++ b/app/src/main/java/org/transdroid/core/gui/rss/RssItemsFragment.java @@ -60,10 +60,10 @@ import java.util.List; * @author Eric Kok */ @EFragment(R.layout.fragment_rssitems) -public class RssitemsFragment extends Fragment { +public class RssItemsFragment extends Fragment { @InstanceState - protected Channel rssfeed = null; + protected Channel rssFeed = null; @InstanceState protected boolean hasError = false; @InstanceState @@ -74,7 +74,7 @@ public class RssitemsFragment extends Fragment { // Views @ViewById(R.id.rssitems_list) - protected ListView rssitemsList; + protected ListView rssItemsList; private MultiChoiceModeListener onItemsSelected = new MultiChoiceModeListener() { SelectionManagerMode selectionManagerMode; @@ -84,7 +84,7 @@ public class RssitemsFragment extends Fragment { // Show contextual action bar to add items in batch mode mode.getMenuInflater().inflate(R.menu.fragment_rssitems_cab, menu); Context themedContext = ((AppCompatActivity) getActivity()).getSupportActionBar().getThemedContext(); - selectionManagerMode = new SelectionManagerMode(themedContext, rssitemsList, R.plurals.rss_itemsselected); + selectionManagerMode = new SelectionManagerMode(themedContext, rssItemsList, R.plurals.rss_itemsselected); selectionManagerMode.onCreateActionMode(mode, menu); return true; } @@ -98,9 +98,9 @@ public class RssitemsFragment extends Fragment { // Get checked torrents List checked = new ArrayList<>(); - for (int i = 0; i < rssitemsList.getCheckedItemPositions().size(); i++) { - if (rssitemsList.getCheckedItemPositions().valueAt(i)) { - checked.add(rssitemsAdapter.getItem(rssitemsList.getCheckedItemPositions().keyAt(i))); + for (int i = 0; i < rssItemsList.getCheckedItemPositions().size(); i++) { + if (rssItemsList.getCheckedItemPositions().valueAt(i)) { + checked.add(rssitemsAdapter.getItem(rssItemsList.getCheckedItemPositions().keyAt(i))); } } @@ -189,9 +189,9 @@ public class RssitemsFragment extends Fragment { protected void init() { // Set up the list adapter, which allows multi-select - rssitemsList.setAdapter(rssitemsAdapter); - rssitemsList.setMultiChoiceModeListener(onItemsSelected); - update(rssfeed, hasError, requiresExternalAuthentication); + rssItemsList.setAdapter(rssitemsAdapter); + rssItemsList.setMultiChoiceModeListener(onItemsSelected); + update(rssFeed, hasError, requiresExternalAuthentication); } @@ -204,7 +204,7 @@ public class RssitemsFragment extends Fragment { public void update(Channel channel, boolean hasError, boolean requiresExternalAuthentication) { this.requiresExternalAuthentication = requiresExternalAuthentication; rssitemsAdapter.update(channel); - rssitemsList.setVisibility(View.GONE); + rssItemsList.setVisibility(View.GONE); emptyText.setVisibility(View.VISIBLE); if (hasError) { emptyText.setText(R.string.rss_error); @@ -218,7 +218,7 @@ public class RssitemsFragment extends Fragment { emptyText.setText(R.string.rss_empty); return; } - rssitemsList.setVisibility(View.VISIBLE); + rssItemsList.setVisibility(View.VISIBLE); emptyText.setVisibility(View.INVISIBLE); } diff --git a/app/src/main/java/org/transdroid/core/gui/rss/RssitemsActivity.java b/app/src/main/java/org/transdroid/core/gui/rss/RssitemsActivity.java index 742687fb..2211a9fa 100644 --- a/app/src/main/java/org/transdroid/core/gui/rss/RssitemsActivity.java +++ b/app/src/main/java/org/transdroid/core/gui/rss/RssitemsActivity.java @@ -46,7 +46,7 @@ public class RssitemsActivity extends AppCompatActivity { protected boolean requiresExternalAuthentication; @FragmentById(R.id.rssitems_fragment) - protected RssitemsFragment fragmentItems; + protected RssItemsFragment fragmentItems; @ViewById protected Toolbar rssfeedsToolbar; diff --git a/app/src/main/java/org/transdroid/core/service/RssCheckerJobRunner.java b/app/src/main/java/org/transdroid/core/service/RssCheckerJobRunner.java index 1ecbea54..910c90da 100644 --- a/app/src/main/java/org/transdroid/core/service/RssCheckerJobRunner.java +++ b/app/src/main/java/org/transdroid/core/service/RssCheckerJobRunner.java @@ -33,7 +33,7 @@ import org.transdroid.core.app.settings.ApplicationSettings; import org.transdroid.core.app.settings.NotificationSettings; import org.transdroid.core.app.settings.RssfeedSetting; import org.transdroid.core.gui.log.Log; -import org.transdroid.core.gui.rss.RssfeedsActivity_; +import org.transdroid.core.gui.rss.RssFeedsActivity_; import org.transdroid.core.rssparser.Item; import org.transdroid.core.rssparser.RssParser; import org.transdroid.daemon.util.Collections2; @@ -121,7 +121,7 @@ public class RssCheckerJobRunner { // Provide a notification, since there are new RSS items PendingIntent pi = PendingIntent - .getActivity(context, 80000, new Intent(context, RssfeedsActivity_.class), PendingIntent.FLAG_UPDATE_CURRENT); + .getActivity(context, 80000, new Intent(context, RssFeedsActivity_.class), PendingIntent.FLAG_UPDATE_CURRENT); String title = context.getResources().getQuantityString(R.plurals.rss_service_new, unread, Integer.toString(unread)); String forString = Collections2.joinString(hasUnread, ", "); final NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NotificationChannels.CHANNEL_RSS_CHECKER) diff --git a/app/src/main/res/layout-w900dp/activity_rssfeeds.xml b/app/src/main/res/layout-w900dp/activity_rssfeeds.xml index f6a95675..997ccd2e 100644 --- a/app/src/main/res/layout-w900dp/activity_rssfeeds.xml +++ b/app/src/main/res/layout-w900dp/activity_rssfeeds.xml @@ -19,7 +19,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".core.gui.rss.RssfeedsActivity_"> + tools:context=".core.gui.rss.RssFeedsActivity_"> + tools:context=".core.gui.rss.RssFeedsActivity_">