1 /* Copyright 2016 Braden Farmer
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 package com.farmerbb.taskbar.util;
18 public class LauncherHelper {
20 private boolean onPrimaryHomeScreen = false;
21 private boolean onSecondaryHomeScreen = false;
23 private static LauncherHelper theInstance;
25 private LauncherHelper() {}
27 public static LauncherHelper getInstance() {
28 if(theInstance == null) theInstance = new LauncherHelper();
33 public boolean isOnHomeScreen() {
34 return isOnHomeScreen(true, true);
37 public boolean isOnHomeScreen(boolean checkPrimary, boolean checkSecondary) {
38 if(checkPrimary && checkSecondary)
39 return onPrimaryHomeScreen || onSecondaryHomeScreen;
41 if(!checkPrimary && checkSecondary)
42 return onSecondaryHomeScreen;
45 return onPrimaryHomeScreen;
50 public void setOnPrimaryHomeScreen(boolean value) {
51 onPrimaryHomeScreen = value;
54 public void setOnSecondaryHomeScreen(boolean value) {
55 onSecondaryHomeScreen = value;