Browse Source

- use actual server name rather than "Server" in remote rss tab

pull/526/head
Twig N 5 years ago
parent
commit
3fc82d4cc5
  1. 12
      app/src/main/java/org/transdroid/core/gui/rss/RssfeedsActivity.java

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

@ -114,11 +114,13 @@ public class RssfeedsActivity extends AppCompatActivity {
class PagerAdapter extends FragmentPagerAdapter { class PagerAdapter extends FragmentPagerAdapter {
boolean hasRemoteRss = false; boolean hasRemoteRss = false;
String serverName = "";
public PagerAdapter(FragmentManager fm, boolean hasRemoteRss) { public PagerAdapter(FragmentManager fm, boolean hasRemoteRss, String name) {
super(fm); super(fm);
this.hasRemoteRss = hasRemoteRss; this.hasRemoteRss = hasRemoteRss;
this.serverName = (name.length() > 0 ? name : getString(R.string.navigation_rss_tabs_remote));
} }
@Override @Override
@ -151,7 +153,7 @@ public class RssfeedsActivity extends AppCompatActivity {
case RSS_FEEDS_LOCAL: case RSS_FEEDS_LOCAL:
return getString(R.string.navigation_rss_tabs_local); return getString(R.string.navigation_rss_tabs_local);
case RSS_FEEDS_REMOTE: case RSS_FEEDS_REMOTE:
return getString(R.string.navigation_rss_tabs_remote); return this.serverName;
} }
return super.getPageTitle(position); return super.getPageTitle(position);
@ -173,8 +175,10 @@ public class RssfeedsActivity extends AppCompatActivity {
getSupportActionBar().setTitle(NavigationHelper.buildCondensedFontString(getString(R.string.rss_feeds))); getSupportActionBar().setTitle(NavigationHelper.buildCondensedFontString(getString(R.string.rss_feeds)));
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
boolean hasRemoteRss = Daemon.supportsRemoteRssManagement(this.getCurrentConnection().getType()); IDaemonAdapter currentConnection = this.getCurrentConnection();
PagerAdapter pagerAdapter = new PagerAdapter(getSupportFragmentManager(), hasRemoteRss); boolean hasRemoteRss = Daemon.supportsRemoteRssManagement(currentConnection.getType());
PagerAdapter pagerAdapter = new PagerAdapter(getSupportFragmentManager(), hasRemoteRss, currentConnection.getSettings().getName());
viewPager.setAdapter(pagerAdapter); viewPager.setAdapter(pagerAdapter);
tabLayout.setupWithViewPager(viewPager); tabLayout.setupWithViewPager(viewPager);
viewPager.setCurrentItem(0); viewPager.setCurrentItem(0);

Loading…
Cancel
Save