Search in sources :

Example 11 with MainActivity

use of com.frostwire.android.gui.activities.MainActivity in project frostwire by frostwire.

the class DownloadSoundcloudFromUrlTask method onPostExecute.

@Override
protected void onPostExecute(Context ctx, List<SoundcloudSearchResult> results) {
    if (ctx != null && !results.isEmpty()) {
        MainActivity activity = (MainActivity) ctx;
        ConfirmSoundcloudDownloadDialog dlg = createConfirmListDialog(ctx, results);
        dlg.show(activity.getFragmentManager());
    }
}
Also used : ConfirmSoundcloudDownloadDialog(com.frostwire.android.gui.dialogs.ConfirmSoundcloudDownloadDialog) MainActivity(com.frostwire.android.gui.activities.MainActivity)

Example 12 with MainActivity

use of com.frostwire.android.gui.activities.MainActivity in project frostwire by frostwire.

the class MainController method showPreferences.

public void showPreferences() {
    if (!Ref.alive(activityRef)) {
        return;
    }
    MainActivity activity = activityRef.get();
    Intent i = new Intent(activity, SettingsActivity.class);
    activity.startActivity(i);
}
Also used : Intent(android.content.Intent) MainActivity(com.frostwire.android.gui.activities.MainActivity)

Example 13 with MainActivity

use of com.frostwire.android.gui.activities.MainActivity in project frostwire by frostwire.

the class MainController method switchContent.

public void switchContent(Fragment fragment) {
    if (!Ref.alive(activityRef)) {
        return;
    }
    MainActivity activity = activityRef.get();
    activity.switchContent(fragment);
}
Also used : MainActivity(com.frostwire.android.gui.activities.MainActivity)

Example 14 with MainActivity

use of com.frostwire.android.gui.activities.MainActivity in project frostwire by frostwire.

the class MainController method showTransfers.

public void showTransfers(TransferStatus status) {
    if (!Ref.alive(activityRef)) {
        return;
    }
    MainActivity activity = activityRef.get();
    if (!(activity.getCurrentFragment() instanceof TransfersFragment)) {
        activity.runOnUiThread(() -> {
            TransfersFragment fragment = (TransfersFragment) activity.getFragmentByNavMenuId(R.id.menu_main_transfers);
            fragment.selectStatusTab(status);
            switchFragment(R.id.menu_main_transfers);
        });
    }
}
Also used : TransfersFragment(com.frostwire.android.gui.fragments.TransfersFragment) MainActivity(com.frostwire.android.gui.activities.MainActivity)

Example 15 with MainActivity

use of com.frostwire.android.gui.activities.MainActivity in project frostwire by frostwire.

the class MainController method launchMyMusic.

public void launchMyMusic() {
    if (!Ref.alive(activityRef)) {
        return;
    }
    MainActivity activity = activityRef.get();
    Intent i = new Intent(activity, com.andrew.apollo.ui.activities.HomeActivity.class);
    i.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
    activity.startActivity(i);
}
Also used : Intent(android.content.Intent) MainActivity(com.frostwire.android.gui.activities.MainActivity)

Aggregations

MainActivity (com.frostwire.android.gui.activities.MainActivity)16 Intent (android.content.Intent)8 Fragment (android.app.Fragment)2 BuildConfig (com.frostwire.android.BuildConfig)2 R (com.frostwire.android.R)2 Constants (com.frostwire.android.core.Constants)2 TransfersFragment (com.frostwire.android.gui.fragments.TransfersFragment)2 UIUtils (com.frostwire.android.gui.util.UIUtils)2 Offers (com.frostwire.android.offers.Offers)2 Activity (android.app.Activity)1 Context (android.content.Context)1 Configuration (android.content.res.Configuration)1 Uri (android.net.Uri)1 AsyncTask (android.os.AsyncTask)1 Handler (android.os.Handler)1 Looper (android.os.Looper)1 NavigationView (android.support.design.widget.NavigationView)1 LocalBroadcastManager (android.support.v4.content.LocalBroadcastManager)1 DrawerLayout (android.support.v4.widget.DrawerLayout)1 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)1