Search in sources :

Example 1 with MoreOptionsActivity

use of com.battlelancer.seriesguide.ui.preferences.MoreOptionsActivity in project SeriesGuide by UweTrottmann.

the class BaseTopActivity method onNavItemClick.

private void onNavItemClick(int itemId) {
    Intent launchIntent = null;
    if (itemId == R.id.navigation_item_shows) {
        if (this instanceof ShowsActivity) {
            onSelectedCurrentNavItem();
            return;
        }
        launchIntent = new Intent(this, ShowsActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
    } else if (itemId == R.id.navigation_item_lists) {
        if (this instanceof ListsActivity) {
            onSelectedCurrentNavItem();
            return;
        }
        launchIntent = new Intent(this, ListsActivity.class).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
    } else if (itemId == R.id.navigation_item_movies) {
        if (this instanceof MoviesActivity) {
            onSelectedCurrentNavItem();
            return;
        }
        launchIntent = new Intent(this, MoviesActivity.class).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
    } else if (itemId == R.id.navigation_item_stats) {
        if (this instanceof StatsActivity) {
            onSelectedCurrentNavItem();
            return;
        }
        launchIntent = new Intent(this, StatsActivity.class).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
    } else if (itemId == R.id.navigation_item_more) {
        if (this instanceof MoreOptionsActivity) {
            onSelectedCurrentNavItem();
            return;
        }
        launchIntent = new Intent(this, MoreOptionsActivity.class).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
    }
    if (launchIntent != null) {
        startActivity(launchIntent);
        overridePendingTransition(R.anim.activity_fade_enter_sg, R.anim.activity_fade_exit_sg);
    }
}
Also used : StatsActivity(com.battlelancer.seriesguide.ui.stats.StatsActivity) Intent(android.content.Intent) MoreOptionsActivity(com.battlelancer.seriesguide.ui.preferences.MoreOptionsActivity)

Aggregations

Intent (android.content.Intent)1 MoreOptionsActivity (com.battlelancer.seriesguide.ui.preferences.MoreOptionsActivity)1 StatsActivity (com.battlelancer.seriesguide.ui.stats.StatsActivity)1