diff options
author | Luca Stefani <luca.stefani.ge1@gmail.com> | 2019-02-02 13:09:45 +0100 |
---|---|---|
committer | Luca Stefani <luca.stefani.ge1@gmail.com> | 2019-02-02 13:12:19 +0100 |
commit | 51fcc5b08f3a7aef613c6176e6351604cf7ca5eb (patch) | |
tree | 5ea3bf7260dfa8dbb187617ae254a6fbbef57a84 /quickstep/src/com/android/launcher3/uioverrides/SwipeDownListener.java | |
parent | 26258e1bf1d578d297f3a1adf95034617caccad3 (diff) | |
download | android_packages_apps_Trebuchet-51fcc5b08f3a7aef613c6176e6351604cf7ca5eb.tar.gz android_packages_apps_Trebuchet-51fcc5b08f3a7aef613c6176e6351604cf7ca5eb.tar.bz2 android_packages_apps_Trebuchet-51fcc5b08f3a7aef613c6176e6351604cf7ca5eb.zip |
Revert "Trebuchet: expand statusbar on swipe down"
This reverts commit 038d82514590597c8902a942aa84149572cb4cdb.
Change-Id: Ie4581cf2850a458d1188bda082333f65f092a8df
Diffstat (limited to 'quickstep/src/com/android/launcher3/uioverrides/SwipeDownListener.java')
-rw-r--r-- | quickstep/src/com/android/launcher3/uioverrides/SwipeDownListener.java | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/quickstep/src/com/android/launcher3/uioverrides/SwipeDownListener.java b/quickstep/src/com/android/launcher3/uioverrides/SwipeDownListener.java deleted file mode 100644 index f4dd99caa..000000000 --- a/quickstep/src/com/android/launcher3/uioverrides/SwipeDownListener.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.launcher3.uioverrides; - -import static com.android.launcher3.LauncherState.NORMAL; - -import android.content.Context; -import android.content.SharedPreferences; -import android.util.Log; -import android.view.GestureDetector; -import android.view.MotionEvent; - -import com.android.launcher3.Launcher; -import com.android.launcher3.Utilities; -import com.android.launcher3.util.TouchController; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -public class SwipeDownListener implements TouchController { - private static final String PREF_STATUSBAR_EXPAND = "pref_expand_statusbar"; - - private GestureDetector mGestureDetector; - private Launcher mLauncher; - - public SwipeDownListener(Launcher launcher) { - SharedPreferences prefs = Utilities.getPrefs(launcher.getApplicationContext()); - - mLauncher = launcher; - mGestureDetector = new GestureDetector(launcher, - new GestureDetector.SimpleOnGestureListener() { - @Override - public boolean onFling(MotionEvent e1, MotionEvent e2, float vX, float vy) { - if (prefs.getBoolean(PREF_STATUSBAR_EXPAND, true) && e1.getY() < e2.getY()) { - expandStatusBar(launcher); - } - return true; - } - }); - } - - @Override - public boolean onControllerInterceptTouchEvent(MotionEvent ev) { - if (mLauncher.isInState(NORMAL)) { - mGestureDetector.onTouchEvent(ev); - } - return false; - } - - @Override - public boolean onControllerTouchEvent(MotionEvent ev) { - return false; - } - - private void expandStatusBar(Context context) { - try { - Object service = context.getSystemService("statusbar"); - Class<?> manager = Class.forName("android.app.StatusBarManager"); - Method expand = manager.getMethod("expandNotificationsPanel"); - expand.invoke(service); - } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | - InvocationTargetException e) { - Log.w("Reflection", - "Can't to invoke android.app.StatusBarManager$expandNotificationsPanel"); - } - } -}
\ No newline at end of file |