Browse Source

- revert some stuff closer to master branch

- adjust some comments
- removed RemoteRssFragment.getRssActivity()
pull/526/head
Twig N 5 years ago
parent
commit
b6dea1cf58
  1. 7
      app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssFragment.java
  2. 12
      app/src/main/java/org/transdroid/core/gui/rss/RssfeedsActivity.java

7
app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssFragment.java

@ -76,10 +76,6 @@ public class RemoteRssFragment extends Fragment {
torrentsList.setFastScrollEnabled(true); torrentsList.setFastScrollEnabled(true);
} }
protected RssfeedsActivity getRssActivity() {
return (RssfeedsActivity) getActivity();
}
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
@ -88,7 +84,8 @@ public class RemoteRssFragment extends Fragment {
@OptionsItem(R.id.action_refresh) @OptionsItem(R.id.action_refresh)
protected void refreshScreen() { protected void refreshScreen() {
getRssActivity().refreshRemoteFeeds(); RssfeedsActivity rssActivity = (RssfeedsActivity) getActivity();
rssActivity.refreshRemoteFeeds();
} }
@OptionsItem(R.id.action_settings) @OptionsItem(R.id.action_settings)

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

@ -87,12 +87,12 @@ public class RssfeedsActivity extends AppCompatActivity {
protected static final int RSS_FEEDS_LOCAL = 0; protected static final int RSS_FEEDS_LOCAL = 0;
protected static final int RSS_FEEDS_REMOTE = 1; protected static final int RSS_FEEDS_REMOTE = 1;
@FragmentById(R.id.remoterss_fragment)
protected RemoteRssFragment fragmentRemoteFeeds;
@FragmentById(R.id.rssitems_fragment)
protected RssitemsFragment fragmentItems;
@FragmentById(R.id.rssfeeds_fragment) @FragmentById(R.id.rssfeeds_fragment)
protected RssfeedsFragment fragmentLocalFeeds; protected RssfeedsFragment fragmentLocalFeeds;
@FragmentById(R.id.rssitems_fragment)
protected RssitemsFragment fragmentItems;
@FragmentById(R.id.remoterss_fragment)
protected RemoteRssFragment fragmentRemoteFeeds;
@ViewById @ViewById
protected Toolbar rssfeedsToolbar; protected Toolbar rssfeedsToolbar;
@ -311,7 +311,7 @@ public class RssfeedsActivity extends AppCompatActivity {
return lastUsed.createServerAdapter(connectivityHelper.getConnectedNetworkName(), this); return lastUsed.createServerAdapter(connectivityHelper.getConnectedNetworkName(), this);
} }
// @Background // @Background
public void refreshRemoteFeeds() { public void refreshRemoteFeeds() {
// Connect to the last used server // Connect to the last used server
IDaemonAdapter currentConnection = this.getCurrentConnection(); IDaemonAdapter currentConnection = this.getCurrentConnection();
@ -350,7 +350,7 @@ public class RssfeedsActivity extends AppCompatActivity {
return; return;
} }
// @UIThread // @UIThread
fragmentRemoteFeeds.updateRemoteItems( fragmentRemoteFeeds.updateRemoteItems(
selectedFilter == 0 ? recentItems : feeds.get(selectedFilter -1).getItems(), selectedFilter == 0 ? recentItems : feeds.get(selectedFilter -1).getItems(),
false /* allow android to restore scroll position */ ); false /* allow android to restore scroll position */ );

Loading…
Cancel
Save