// Path: app/src/main/java/com/williammora/openfeed/fragments/PopularSearchResultsFragment.java
// public class PopularSearchResultsFragment extends SearchResultsFragment {
// 
//     public static final String TAG = PopularSearchResultsFragment.class.getSimpleName();
// 
//     @Override
//     protected Query.ResultType getResultType() {
//         return Query.ResultType.popular;
//     }
// 
//     @Subscribe
//     public void onSearchEvent(TwitterEvents.SearchEvent event) {
//         super.onSearchEvent(event);
//     }
// }
// 
// Path: app/src/main/java/com/williammora/openfeed/fragments/SearchResultsFragment.java
// public abstract class SearchResultsFragment extends AbstractFeedFragment {
// 
//     public interface SearchResultsFragmentListener extends FeedFragmentListener {
//         public String getQuery();
//     }
// 
//     private SearchResultsFragmentListener mListener;
// 
//     @Override
//     public void onAttach(Activity activity) {
//         super.onAttach(activity);
//         if (!(activity instanceof SearchResultsFragmentListener)) {
//             throw new ClassCastException("Activity must implement SearchResultsFragmentListener");
//         }
//         mListener = (SearchResultsFragmentListener) activity;
//     }
// 
//     @Override
//     protected void doRequest(Paging paging) {
//         Query query = new Query();
//         query.setQuery(mListener.getQuery());
//         query.setCount(paging.getCount());
//         query.setMaxId(paging.getMaxId());
//         query.setSinceId(paging.getSinceId());
//         query.setResultType(getResultType());
//         TwitterService.getInstance().search(query);
//     }
// 
//     public void onSearchEvent(TwitterEvents.SearchEvent event) {
//         Feed feed = new Feed();
//         feed.setPaging(mPaging);
//         feed.setStatuses(event.getResult().getTweets());
//         updateFeed(feed);
//         onRequestCompleted();
//     }
// 
//     protected abstract Query.ResultType getResultType();
// 
// }


import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import com.williammora.openfeed.R;
import com.williammora.openfeed.fragments.PopularSearchResultsFragment;
import com.williammora.openfeed.fragments.SearchResultsFragment;
package com.williammora.openfeed.activities;



public class SearchResultsActivity extends Activity implements
        SearchResultsFragment.SearchResultsFragmentListener {

    private static final String SAVED_QUERY = "SAVED_QUERY";
    private static final String SAVED_SHOWING_GO_TO_TOP = "SAVED_SHOWING_GO_TO_TOP";

    private Menu mMenu;
    private boolean mShowingGoToTop;
    private String mQuery;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_search_results);
        if (savedInstanceState == null) {
            getFragmentManager().beginTransaction()
// Path: app/src/main/java/com/williammora/openfeed/fragments/PopularSearchResultsFragment.java
// public class PopularSearchResultsFragment extends SearchResultsFragment {
// 
//     public static final String TAG = PopularSearchResultsFragment.class.getSimpleName();
// 
//     @Override
//     protected Query.ResultType getResultType() {
//         return Query.ResultType.popular;
//     }
// 
//     @Subscribe
//     public void onSearchEvent(TwitterEvents.SearchEvent event) {
//         super.onSearchEvent(event);
//     }
// }
// 
// Path: app/src/main/java/com/williammora/openfeed/fragments/SearchResultsFragment.java
// public abstract class SearchResultsFragment extends AbstractFeedFragment {
// 
//     public interface SearchResultsFragmentListener extends FeedFragmentListener {
//         public String getQuery();
//     }
// 
//     private SearchResultsFragmentListener mListener;
// 
//     @Override
//     public void onAttach(Activity activity) {
//         super.onAttach(activity);
//         if (!(activity instanceof SearchResultsFragmentListener)) {
//             throw new ClassCastException("Activity must implement SearchResultsFragmentListener");
//         }
//         mListener = (SearchResultsFragmentListener) activity;
//     }
// 
//     @Override
//     protected void doRequest(Paging paging) {
//         Query query = new Query();
//         query.setQuery(mListener.getQuery());
//         query.setCount(paging.getCount());
//         query.setMaxId(paging.getMaxId());
//         query.setSinceId(paging.getSinceId());
//         query.setResultType(getResultType());
//         TwitterService.getInstance().search(query);
//     }
// 
//     public void onSearchEvent(TwitterEvents.SearchEvent event) {
//         Feed feed = new Feed();
//         feed.setPaging(mPaging);
//         feed.setStatuses(event.getResult().getTweets());
//         updateFeed(feed);
//         onRequestCompleted();
//     }
// 
//     protected abstract Query.ResultType getResultType();
// 
// }


// Path: app/src/main/java/com/williammora/openfeed/activities/SearchResultsActivity.java
import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import com.williammora.openfeed.R;
import com.williammora.openfeed.fragments.PopularSearchResultsFragment;
import com.williammora.openfeed.fragments.SearchResultsFragment;

package com.williammora.openfeed.activities;



public class SearchResultsActivity extends Activity implements
        SearchResultsFragment.SearchResultsFragmentListener {

    private static final String SAVED_QUERY = "SAVED_QUERY";
    private static final String SAVED_SHOWING_GO_TO_TOP = "SAVED_SHOWING_GO_TO_TOP";

    private Menu mMenu;
    private boolean mShowingGoToTop;
    private String mQuery;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_search_results);
        if (savedInstanceState == null) {
            getFragmentManager().beginTransaction()
                    .add(R.id.container, new PopularSearchResultsFragment(), PopularSearchResultsFragment.TAG)