|
|
@ -185,7 +185,25 @@ public class RssFeedsActivity extends AppCompatActivity { |
|
|
|
PagerAdapter pagerAdapter = new LayoutPagerAdapter(hasRemoteRss, currentConnection.getSettings().getName()); |
|
|
|
PagerAdapter pagerAdapter = new LayoutPagerAdapter(hasRemoteRss, currentConnection.getSettings().getName()); |
|
|
|
viewPager.setAdapter(pagerAdapter); |
|
|
|
viewPager.setAdapter(pagerAdapter); |
|
|
|
tabLayout.setupWithViewPager(viewPager); |
|
|
|
tabLayout.setupWithViewPager(viewPager); |
|
|
|
viewPager.setCurrentItem(0); |
|
|
|
|
|
|
|
|
|
|
|
// if local feeds dont have any entries but remote does, show it instead
|
|
|
|
|
|
|
|
int defaultTab = RSS_FEEDS_LOCAL; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hasRemoteRss && applicationSettings.getRssfeedSettings().size() == 0) { |
|
|
|
|
|
|
|
if (currentConnection instanceof RemoteRssSupplier) { |
|
|
|
|
|
|
|
RemoteRssSupplier remoteConnection = ((RemoteRssSupplier) (currentConnection)); |
|
|
|
|
|
|
|
boolean hasRemoteFeeds = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
hasRemoteFeeds = remoteConnection.getRemoteRssChannels(log).size() > 0; |
|
|
|
|
|
|
|
} catch (DaemonException e) {} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hasRemoteFeeds) { |
|
|
|
|
|
|
|
defaultTab = RSS_FEEDS_REMOTE; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
viewPager.setCurrentItem(defaultTab); |
|
|
|
|
|
|
|
|
|
|
|
if (!hasRemoteRss) { |
|
|
|
if (!hasRemoteRss) { |
|
|
|
tabLayout.setVisibility(View.GONE); |
|
|
|
tabLayout.setVisibility(View.GONE); |
|
|
|