Browse Source

- added @OptionsMenu for RemoteRssFragment

pull/526/head
Twig N 5 years ago
parent
commit
521159c928
  1. 15
      app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssFragment.java

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

@ -29,12 +29,15 @@ import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EFragment; import org.androidannotations.annotations.EFragment;
import org.androidannotations.annotations.ItemClick; import org.androidannotations.annotations.ItemClick;
import org.androidannotations.annotations.ItemSelect; import org.androidannotations.annotations.ItemSelect;
import org.androidannotations.annotations.OptionsItem;
import org.androidannotations.annotations.OptionsMenu;
import org.androidannotations.annotations.ViewById; import org.androidannotations.annotations.ViewById;
import org.transdroid.R; 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 java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -45,6 +48,7 @@ import java.util.List;
* @author Twig * @author Twig
*/ */
@EFragment(R.layout.fragment_remoterss) @EFragment(R.layout.fragment_remoterss)
@OptionsMenu(R.menu.fragment_rssfeeds)
public class RemoteRssFragment extends Fragment { public class RemoteRssFragment extends Fragment {
@Bean @Bean
protected Log log; protected Log log;
@ -62,7 +66,6 @@ public class RemoteRssFragment extends Fragment {
@ViewById @ViewById
protected TextView remoterssStatusMessage; protected TextView remoterssStatusMessage;
// protected RemoteRssItemsAdapter adapter;
@AfterViews @AfterViews
protected void init() { protected void init() {
@ -84,9 +87,19 @@ public class RemoteRssFragment extends Fragment {
super.onResume(); super.onResume();
getRssActivity().onFragmentReady(this); getRssActivity().onFragmentReady(this);
this.refreshScreen();
}
@OptionsItem(R.id.action_refresh)
protected void refreshScreen() {
getRssActivity().refreshRemoteFeeds(); getRssActivity().refreshRemoteFeeds();
} }
@OptionsItem(R.id.action_settings)
protected void openSettings() {
MainSettingsActivity_.intent(getActivity()).start();
}
@Override @Override
public void onDestroy() { public void onDestroy() {
super.onDestroy(); super.onDestroy();

Loading…
Cancel
Save