Search in sources :

Example 1 with GpodnetMainFragment

use of de.danoeh.antennapod.fragment.gpodnet.GpodnetMainFragment in project AntennaPod by AntennaPod.

the class AddFeedFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    View root = inflater.inflate(R.layout.addfeed, container, false);
    final EditText etxtFeedurl = (EditText) root.findViewById(R.id.etxtFeedurl);
    Bundle args = getArguments();
    if (args != null && args.getString(ARG_FEED_URL) != null) {
        etxtFeedurl.setText(args.getString(ARG_FEED_URL));
    }
    Button butSearchITunes = (Button) root.findViewById(R.id.butSearchItunes);
    Button butBrowserGpoddernet = (Button) root.findViewById(R.id.butBrowseGpoddernet);
    Button butSearchFyyd = (Button) root.findViewById(R.id.butSearchFyyd);
    Button butOpmlImport = (Button) root.findViewById(R.id.butOpmlImport);
    Button butConfirm = (Button) root.findViewById(R.id.butConfirm);
    final MainActivity activity = (MainActivity) getActivity();
    activity.getSupportActionBar().setTitle(R.string.add_feed_label);
    butSearchITunes.setOnClickListener(v -> activity.loadChildFragment(new ItunesSearchFragment()));
    butBrowserGpoddernet.setOnClickListener(v -> activity.loadChildFragment(new GpodnetMainFragment()));
    butSearchFyyd.setOnClickListener(v -> activity.loadChildFragment(new FyydSearchFragment()));
    butOpmlImport.setOnClickListener(v -> startActivity(new Intent(getActivity(), OpmlImportFromPathActivity.class)));
    butConfirm.setOnClickListener(v -> {
        Intent intent = new Intent(getActivity(), OnlineFeedViewActivity.class);
        intent.putExtra(OnlineFeedViewActivity.ARG_FEEDURL, etxtFeedurl.getText().toString());
        intent.putExtra(OnlineFeedViewActivity.ARG_TITLE, getString(R.string.add_feed_label));
        startActivity(intent);
    });
    return root;
}
Also used : EditText(android.widget.EditText) Button(android.widget.Button) Bundle(android.os.Bundle) Intent(android.content.Intent) MainActivity(de.danoeh.antennapod.activity.MainActivity) View(android.view.View) GpodnetMainFragment(de.danoeh.antennapod.fragment.gpodnet.GpodnetMainFragment)

Aggregations

Intent (android.content.Intent)1 Bundle (android.os.Bundle)1 View (android.view.View)1 Button (android.widget.Button)1 EditText (android.widget.EditText)1 MainActivity (de.danoeh.antennapod.activity.MainActivity)1 GpodnetMainFragment (de.danoeh.antennapod.fragment.gpodnet.GpodnetMainFragment)1