Search in sources :

Example 1 with MainActivity

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

the class MainController method startWizardActivity.

public void startWizardActivity() {
    if (!Ref.alive(activityRef)) {
        return;
    }
    MainActivity activity = activityRef.get();
    ConfigurationManager.instance().resetToDefaults();
    Intent i = new Intent(activity, WizardActivity.class);
    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
    activity.startActivity(i);
}
Also used : Intent(android.content.Intent) MainActivity(com.frostwire.android.gui.activities.MainActivity)

Example 2 with MainActivity

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

the class MainController method setTitle.

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

Example 3 with MainActivity

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

the class MainController method switchFragment.

public void switchFragment(int itemId) {
    if (!Ref.alive(activityRef)) {
        return;
    }
    MainActivity activity = activityRef.get();
    Fragment fragment = activity.getFragmentByNavMenuId(itemId);
    if (fragment != null) {
        activity.switchContent(fragment);
    }
}
Also used : MainActivity(com.frostwire.android.gui.activities.MainActivity) Fragment(android.app.Fragment) TransfersFragment(com.frostwire.android.gui.fragments.TransfersFragment)

Example 4 with MainActivity

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

the class MainController method syncNavigationMenu.

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

Example 5 with MainActivity

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

the class MainController method showShutdownDialog.

public void showShutdownDialog() {
    if (!Ref.alive(activityRef)) {
        return;
    }
    MainActivity activity = activityRef.get();
    activity.showShutdownDialog();
}
Also used : 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