Search in sources :

Example 1 with Keep

use of androidx.annotation.Keep in project Taskbar by farmerbb.

the class Taskbar method openSettings.

/**
 * Opens the settings page for configuring Taskbar, using the specified title and theme.
 * @param context Context used to start the activity
 * @param title Title to display in the top level of the settings hierarchy.
 *              If null, defaults to "Settings".
 * @param theme Theme to apply to the settings activity. If set to -1, the activity will
 *              use the app's default theme if it is a derivative of Theme.AppCompat,
 *              or Theme.AppCompat.Light otherwise.
 */
@Keep
public static void openSettings(@NonNull Context context, @Nullable String title, @StyleRes int theme) {
    Intent intent = new Intent(context, MainActivity.class);
    intent.putExtra("title", title);
    intent.putExtra("theme", theme);
    intent.putExtra("back_arrow", true);
    if (!(context instanceof Activity))
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(intent);
}
Also used : MainActivity(com.farmerbb.taskbar.activity.MainActivity) SecondaryHomeActivity(com.farmerbb.taskbar.activity.SecondaryHomeActivity) Activity(android.app.Activity) Intent(android.content.Intent) Keep(androidx.annotation.Keep)

Aggregations

Activity (android.app.Activity)1 Intent (android.content.Intent)1 Keep (androidx.annotation.Keep)1 MainActivity (com.farmerbb.taskbar.activity.MainActivity)1 SecondaryHomeActivity (com.farmerbb.taskbar.activity.SecondaryHomeActivity)1