Browse Source

- now shows the current filter on remote rss feeds in toolbar subtitle

- scroll to top after setting new remote rss items
- format the item timestamp
pull/313/head
twig 9 years ago
parent
commit
c16a0149fa
  1. 11
      app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssActivity.java
  2. 1
      app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssFragment.java
  3. 13
      app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssItemView.java

11
app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssActivity.java

@ -119,11 +119,11 @@ public class RemoteRssActivity extends AppCompatActivity { @@ -119,11 +119,11 @@ public class RemoteRssActivity extends AppCompatActivity {
ServerSetting lastUsed = applicationSettings.getLastUsedServer();
currentConnection = lastUsed.createServerAdapter(connectivityHelper.getConnectedNetworkName(), this);
// Show all items
showRecentItems();
// Fill in the filter list
showChannelFilters();
// Show all items
showRecentItems();
}
@ -172,6 +172,8 @@ public class RemoteRssActivity extends AppCompatActivity { @@ -172,6 +172,8 @@ public class RemoteRssActivity extends AppCompatActivity {
}
fragmentRemoteRss.updateTorrentFiles(recentItems);
RemoteRssChannel channel = (RemoteRssChannel) drawerList.getAdapter().getItem(0);
getSupportActionBar().setSubtitle(channel.getName());
}
protected void showChannelFilters() {
@ -200,6 +202,9 @@ public class RemoteRssActivity extends AppCompatActivity { @@ -200,6 +202,9 @@ public class RemoteRssActivity extends AppCompatActivity {
fragmentRemoteRss.updateTorrentFiles(feeds.get(position -1).getItems());
}
RemoteRssChannel channel = (RemoteRssChannel) drawerList.getAdapter().getItem(position);
getSupportActionBar().setSubtitle(channel.getName());
drawerLayout.closeDrawers();
}

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

@ -110,6 +110,7 @@ public class RemoteRssFragment extends Fragment { @@ -110,6 +110,7 @@ public class RemoteRssFragment extends Fragment {
public void updateTorrentFiles(List<RemoteRssItem> remoteRssFiles) {
torrentFiles = new ArrayList<>(remoteRssFiles);
adapter.updateFiles(torrentFiles);
torrentsList.smoothScrollToPosition(0);
}
@ItemClick(resName = "torrents_list")

13
app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssItemView.java

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
package org.transdroid.core.gui.remoterss;
import android.content.Context;
import android.text.format.DateFormat;
import android.widget.LinearLayout;
import android.widget.TextView;
@ -41,10 +42,14 @@ public class RemoteRssItemView extends LinearLayout { @@ -41,10 +42,14 @@ public class RemoteRssItemView extends LinearLayout {
super(context);
}
public void bind(RemoteRssItem file) {
nameText.setText(file.getName());
dateText.setText(String.valueOf(file.getTimestamp()));
labelText.setText(file.getSourceName());
public void bind(RemoteRssItem item) {
labelText.setText(item.getSourceName());
nameText.setText(item.getName());
dateText.setText(
DateFormat.getDateFormat(getContext()).format(item.getTimestamp()) +
" " +
DateFormat.getTimeFormat(getContext()).format(item.getTimestamp())
);
}
}

Loading…
Cancel
Save