Browse Source

- renamed classes and variables because of annoying squiggly green lines

pull/526/head
Twig N 5 years ago
parent
commit
882a647370
  1. 2
      app/src/main/AndroidManifest.xml
  2. 4
      app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java
  3. 24
      app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssFragment.java
  4. 12
      app/src/main/java/org/transdroid/core/gui/rss/RssFeedsActivity.java
  5. 6
      app/src/main/java/org/transdroid/core/gui/rss/RssFeedsFragment.java
  6. 24
      app/src/main/java/org/transdroid/core/gui/rss/RssItemsFragment.java
  7. 2
      app/src/main/java/org/transdroid/core/gui/rss/RssitemsActivity.java
  8. 4
      app/src/main/java/org/transdroid/core/service/RssCheckerJobRunner.java
  9. 6
      app/src/main/res/layout-w900dp/activity_rssfeeds.xml
  10. 4
      app/src/main/res/layout/activity_rssfeeds.xml

2
app/src/main/AndroidManifest.xml

@ -248,7 +248,7 @@
<!-- RSS --> <!-- RSS -->
<activity <activity
android:name="org.transdroid.core.gui.rss.RssfeedsActivity_" android:name="org.transdroid.core.gui.rss.RssFeedsActivity_"
android:label="@string/rss_feeds" android:label="@string/rss_feeds"
android:launchMode="singleTop" android:launchMode="singleTop"
android:theme="@style/TransdroidTheme" /> android:theme="@style/TransdroidTheme" />

4
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.NavigationHelper;
import org.transdroid.core.gui.navigation.RefreshableActivity; import org.transdroid.core.gui.navigation.RefreshableActivity;
import org.transdroid.core.gui.navigation.StatusType; 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.FilePickerHelper;
import org.transdroid.core.gui.search.UrlEntryDialog; import org.transdroid.core.gui.search.UrlEntryDialog;
import org.transdroid.core.gui.settings.MainSettingsActivity_; import org.transdroid.core.gui.settings.MainSettingsActivity_;
@ -809,7 +809,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE
@OptionsItem(R.id.action_rss) @OptionsItem(R.id.action_rss)
protected void openRss() { protected void openRss() {
RssfeedsActivity_.intent(this).start(); RssFeedsActivity_.intent(this).start();
} }
@OptionsItem(R.id.action_settings) @OptionsItem(R.id.action_settings)

24
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.log.Log;
import org.transdroid.core.gui.remoterss.data.RemoteRssChannel; import org.transdroid.core.gui.remoterss.data.RemoteRssChannel;
import org.transdroid.core.gui.remoterss.data.RemoteRssItem; 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 org.transdroid.core.gui.settings.MainSettingsActivity_;
import java.util.ArrayList; import java.util.ArrayList;
@ -57,12 +57,12 @@ public class RemoteRssFragment extends Fragment {
// Views // Views
@ViewById @ViewById
protected View detailsContainer; protected View detailsContainer;
@ViewById @ViewById(R.id.remoterss_filter)
protected Spinner remoterssFilter; protected Spinner remoteRssFilter;
@ViewById @ViewById
protected ListView torrentsList; protected ListView torrentsList;
@ViewById @ViewById(R.id.remoterss_status_message)
protected TextView remoterssStatusMessage; protected TextView remoteRssStatusMessage;
@AfterViews @AfterViews
@ -84,7 +84,7 @@ public class RemoteRssFragment extends Fragment {
@OptionsItem(R.id.action_refresh) @OptionsItem(R.id.action_refresh)
protected void refreshScreen() { protected void refreshScreen() {
RssfeedsActivity rssActivity = (RssfeedsActivity) getActivity(); RssFeedsActivity rssActivity = (RssFeedsActivity) getActivity();
rssActivity.refreshRemoteFeeds(); rssActivity.refreshRemoteFeeds();
} }
@ -107,11 +107,11 @@ public class RemoteRssFragment extends Fragment {
} }
// Show/hide a nice message if there are no items to show // Show/hide a nice message if there are no items to show
if (remoteRssItems.size() > 0) { if (remoteRssItems.size() > 0) {
remoterssStatusMessage.setVisibility(View.GONE); remoteRssStatusMessage.setVisibility(View.GONE);
} }
else { else {
remoterssStatusMessage.setVisibility(View.VISIBLE); remoteRssStatusMessage.setVisibility(View.VISIBLE);
remoterssStatusMessage.setText(R.string.remoterss_no_files); remoteRssStatusMessage.setText(R.string.remoterss_no_files);
} }
} }
@ -124,7 +124,7 @@ public class RemoteRssFragment extends Fragment {
ArrayAdapter<String> adapter = new ArrayAdapter<>(this.getContext(), android.R.layout.simple_spinner_dropdown_item, labels); ArrayAdapter<String> adapter = new ArrayAdapter<>(this.getContext(), android.R.layout.simple_spinner_dropdown_item, labels);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); 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(); RemoteRssItemsAdapter adapter = (RemoteRssItemsAdapter) torrentsList.getAdapter();
RemoteRssItem item = (RemoteRssItem) adapter.getItem(position); RemoteRssItem item = (RemoteRssItem) adapter.getItem(position);
((RssfeedsActivity) getActivity()).downloadRemoteRssItem(item); ((RssFeedsActivity) getActivity()).downloadRemoteRssItem(item);
} }
@ItemSelect(R.id.remoterss_filter) @ItemSelect(R.id.remoterss_filter)
protected void onFeedSelected(boolean selected, int position) { protected void onFeedSelected(boolean selected, int position) {
((RssfeedsActivity) getActivity()).onFeedSelected(position); ((RssFeedsActivity) getActivity()).onFeedSelected(position);
} }
} }

12
app/src/main/java/org/transdroid/core/gui/rss/RssfeedsActivity.java → app/src/main/java/org/transdroid/core/gui/rss/RssFeedsActivity.java

@ -76,7 +76,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
@EActivity(R.layout.activity_rssfeeds) @EActivity(R.layout.activity_rssfeeds)
public class RssfeedsActivity extends AppCompatActivity { public class RssFeedsActivity extends AppCompatActivity {
// Settings and local data // Settings and local data
@Bean @Bean
@ -88,14 +88,14 @@ public class RssfeedsActivity extends AppCompatActivity {
protected static final int RSS_FEEDS_REMOTE = 1; protected static final int RSS_FEEDS_REMOTE = 1;
@FragmentById(R.id.rssfeeds_fragment) @FragmentById(R.id.rssfeeds_fragment)
protected RssfeedsFragment fragmentLocalFeeds; protected RssFeedsFragment fragmentLocalFeeds;
@FragmentById(R.id.rssitems_fragment) @FragmentById(R.id.rssitems_fragment)
protected RssitemsFragment fragmentItems; protected RssItemsFragment fragmentItems;
@FragmentById(R.id.remoterss_fragment) @FragmentById(R.id.remoterss_fragment)
protected RemoteRssFragment fragmentRemoteFeeds; protected RemoteRssFragment fragmentRemoteFeeds;
@ViewById @ViewById(R.id.rssfeeds_toolbar)
protected Toolbar rssfeedsToolbar; protected Toolbar rssFeedsToolbar;
@ViewById(R.id.rssfeeds_tabs) @ViewById(R.id.rssfeeds_tabs)
protected TabLayout tabLayout; protected TabLayout tabLayout;
@ViewById(R.id.rssfeeds_pager) @ViewById(R.id.rssfeeds_pager)
@ -178,7 +178,7 @@ public class RssfeedsActivity extends AppCompatActivity {
@AfterViews @AfterViews
protected void init() { protected void init() {
setSupportActionBar(rssfeedsToolbar); setSupportActionBar(rssFeedsToolbar);
getSupportActionBar().setTitle(NavigationHelper.buildCondensedFontString(getString(R.string.rss_feeds))); getSupportActionBar().setTitle(NavigationHelper.buildCondensedFontString(getString(R.string.rss_feeds)));
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);

6
app/src/main/java/org/transdroid/core/gui/rss/RssfeedsFragment.java → app/src/main/java/org/transdroid/core/gui/rss/RssFeedsFragment.java

@ -41,7 +41,7 @@ import java.util.List;
*/ */
@EFragment(R.layout.fragment_rssfeeds) @EFragment(R.layout.fragment_rssfeeds)
@OptionsMenu(R.menu.fragment_rssfeeds) @OptionsMenu(R.menu.fragment_rssfeeds)
public class RssfeedsFragment extends Fragment { public class RssFeedsFragment extends Fragment {
// Views // Views
@ViewById(R.id.rssfeeds_list) @ViewById(R.id.rssfeeds_list)
@ -77,8 +77,8 @@ public class RssfeedsFragment extends Fragment {
MainSettingsActivity_.intent(getActivity()).start(); MainSettingsActivity_.intent(getActivity()).start();
} }
protected RssfeedsActivity getRssActivity() { protected RssFeedsActivity getRssActivity() {
return (RssfeedsActivity) getActivity(); return (RssFeedsActivity) getActivity();
} }
@Override @Override

24
app/src/main/java/org/transdroid/core/gui/rss/RssitemsFragment.java → app/src/main/java/org/transdroid/core/gui/rss/RssItemsFragment.java

@ -60,10 +60,10 @@ import java.util.List;
* @author Eric Kok * @author Eric Kok
*/ */
@EFragment(R.layout.fragment_rssitems) @EFragment(R.layout.fragment_rssitems)
public class RssitemsFragment extends Fragment { public class RssItemsFragment extends Fragment {
@InstanceState @InstanceState
protected Channel rssfeed = null; protected Channel rssFeed = null;
@InstanceState @InstanceState
protected boolean hasError = false; protected boolean hasError = false;
@InstanceState @InstanceState
@ -74,7 +74,7 @@ public class RssitemsFragment extends Fragment {
// Views // Views
@ViewById(R.id.rssitems_list) @ViewById(R.id.rssitems_list)
protected ListView rssitemsList; protected ListView rssItemsList;
private MultiChoiceModeListener onItemsSelected = new MultiChoiceModeListener() { private MultiChoiceModeListener onItemsSelected = new MultiChoiceModeListener() {
SelectionManagerMode selectionManagerMode; SelectionManagerMode selectionManagerMode;
@ -84,7 +84,7 @@ public class RssitemsFragment extends Fragment {
// Show contextual action bar to add items in batch mode // Show contextual action bar to add items in batch mode
mode.getMenuInflater().inflate(R.menu.fragment_rssitems_cab, menu); mode.getMenuInflater().inflate(R.menu.fragment_rssitems_cab, menu);
Context themedContext = ((AppCompatActivity) getActivity()).getSupportActionBar().getThemedContext(); 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); selectionManagerMode.onCreateActionMode(mode, menu);
return true; return true;
} }
@ -98,9 +98,9 @@ public class RssitemsFragment extends Fragment {
// Get checked torrents // Get checked torrents
List<Item> checked = new ArrayList<>(); List<Item> checked = new ArrayList<>();
for (int i = 0; i < rssitemsList.getCheckedItemPositions().size(); i++) { for (int i = 0; i < rssItemsList.getCheckedItemPositions().size(); i++) {
if (rssitemsList.getCheckedItemPositions().valueAt(i)) { if (rssItemsList.getCheckedItemPositions().valueAt(i)) {
checked.add(rssitemsAdapter.getItem(rssitemsList.getCheckedItemPositions().keyAt(i))); checked.add(rssitemsAdapter.getItem(rssItemsList.getCheckedItemPositions().keyAt(i)));
} }
} }
@ -189,9 +189,9 @@ public class RssitemsFragment extends Fragment {
protected void init() { protected void init() {
// Set up the list adapter, which allows multi-select // Set up the list adapter, which allows multi-select
rssitemsList.setAdapter(rssitemsAdapter); rssItemsList.setAdapter(rssitemsAdapter);
rssitemsList.setMultiChoiceModeListener(onItemsSelected); rssItemsList.setMultiChoiceModeListener(onItemsSelected);
update(rssfeed, hasError, requiresExternalAuthentication); update(rssFeed, hasError, requiresExternalAuthentication);
} }
@ -204,7 +204,7 @@ public class RssitemsFragment extends Fragment {
public void update(Channel channel, boolean hasError, boolean requiresExternalAuthentication) { public void update(Channel channel, boolean hasError, boolean requiresExternalAuthentication) {
this.requiresExternalAuthentication = requiresExternalAuthentication; this.requiresExternalAuthentication = requiresExternalAuthentication;
rssitemsAdapter.update(channel); rssitemsAdapter.update(channel);
rssitemsList.setVisibility(View.GONE); rssItemsList.setVisibility(View.GONE);
emptyText.setVisibility(View.VISIBLE); emptyText.setVisibility(View.VISIBLE);
if (hasError) { if (hasError) {
emptyText.setText(R.string.rss_error); emptyText.setText(R.string.rss_error);
@ -218,7 +218,7 @@ public class RssitemsFragment extends Fragment {
emptyText.setText(R.string.rss_empty); emptyText.setText(R.string.rss_empty);
return; return;
} }
rssitemsList.setVisibility(View.VISIBLE); rssItemsList.setVisibility(View.VISIBLE);
emptyText.setVisibility(View.INVISIBLE); emptyText.setVisibility(View.INVISIBLE);
} }

2
app/src/main/java/org/transdroid/core/gui/rss/RssitemsActivity.java

@ -46,7 +46,7 @@ public class RssitemsActivity extends AppCompatActivity {
protected boolean requiresExternalAuthentication; protected boolean requiresExternalAuthentication;
@FragmentById(R.id.rssitems_fragment) @FragmentById(R.id.rssitems_fragment)
protected RssitemsFragment fragmentItems; protected RssItemsFragment fragmentItems;
@ViewById @ViewById
protected Toolbar rssfeedsToolbar; protected Toolbar rssfeedsToolbar;

4
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.NotificationSettings;
import org.transdroid.core.app.settings.RssfeedSetting; import org.transdroid.core.app.settings.RssfeedSetting;
import org.transdroid.core.gui.log.Log; 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.Item;
import org.transdroid.core.rssparser.RssParser; import org.transdroid.core.rssparser.RssParser;
import org.transdroid.daemon.util.Collections2; import org.transdroid.daemon.util.Collections2;
@ -121,7 +121,7 @@ public class RssCheckerJobRunner {
// Provide a notification, since there are new RSS items // Provide a notification, since there are new RSS items
PendingIntent pi = PendingIntent 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 title = context.getResources().getQuantityString(R.plurals.rss_service_new, unread, Integer.toString(unread));
String forString = Collections2.joinString(hasUnread, ", "); String forString = Collections2.joinString(hasUnread, ", ");
final NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NotificationChannels.CHANNEL_RSS_CHECKER) final NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NotificationChannels.CHANNEL_RSS_CHECKER)

6
app/src/main/res/layout-w900dp/activity_rssfeeds.xml

@ -19,7 +19,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".core.gui.rss.RssfeedsActivity_"> tools:context=".core.gui.rss.RssFeedsActivity_">
<android.support.v7.widget.Toolbar <android.support.v7.widget.Toolbar
android:id="@+id/rssfeeds_toolbar" android:id="@+id/rssfeeds_toolbar"
@ -51,7 +51,7 @@
android:orientation="horizontal"> android:orientation="horizontal">
<fragment <fragment
android:id="@+id/rssfeeds_fragment" android:id="@+id/rssfeeds_fragment"
class="org.transdroid.core.gui.rss.RssfeedsFragment_" class="org.transdroid.core.gui.rss.RssFeedsFragment_"
android:layout_width="0dip" android:layout_width="0dip"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="2" android:layout_weight="2"
@ -59,7 +59,7 @@
<fragment <fragment
android:id="@+id/rssitems_fragment" android:id="@+id/rssitems_fragment"
class="org.transdroid.core.gui.rss.RssitemsFragment_" class="org.transdroid.core.gui.rss.RssItemsFragment_"
android:layout_width="0dip" android:layout_width="0dip"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="3" android:layout_weight="3"

4
app/src/main/res/layout/activity_rssfeeds.xml

@ -19,7 +19,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".core.gui.rss.RssfeedsActivity_"> tools:context=".core.gui.rss.RssFeedsActivity_">
<android.support.v7.widget.Toolbar <android.support.v7.widget.Toolbar
android:id="@+id/rssfeeds_toolbar" android:id="@+id/rssfeeds_toolbar"
@ -52,7 +52,7 @@
android:orientation="horizontal"> android:orientation="horizontal">
<fragment <fragment
android:id="@+id/rssfeeds_fragment" android:id="@+id/rssfeeds_fragment"
class="org.transdroid.core.gui.rss.RssfeedsFragment_" class="org.transdroid.core.gui.rss.RssFeedsFragment_"
android:layout_width="0dip" android:layout_width="0dip"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="2" android:layout_weight="2"

Loading…
Cancel
Save