Merge pull request #2135

This commit is contained in:
Patryk Michalik
2021-04-28 11:38:49 +02:00
committed by GitHub
7 changed files with 36 additions and 13 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0-rc01'
classpath 'com.android.tools.build:gradle:7.0.0-alpha14'
classpath PROTOBUF_CLASS_PATH
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.android.gms:oss-licenses-plugin:0.10.4'
+2 -2
View File
@@ -6,7 +6,7 @@ ANDROID_X_VERSION=1+
GRADLE_CLASS_PATH=com.android.tools.build:gradle:4.0.0
PROTOBUF_CLASS_PATH=com.google.protobuf:protobuf-gradle-plugin:0.8.8
PROTOBUF_CLASS_PATH=com.google.protobuf:protobuf-gradle-plugin:0.8.16
PROTOBUF_DEPENDENCY=com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7
BUILD_TOOLS_VERSION=30.0.2
@@ -14,4 +14,4 @@ COMPILE_SDK=android-30
org.gradle.jvmargs=-Xmx2048m
android.debug.obsoleteApi=true
android.debug.obsoleteApi=true
+2 -2
View File
@@ -1,6 +1,6 @@
#Sat Apr 10 11:13:33 CEST 2021
#Wed Apr 28 11:22:03 CEST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
@@ -16,6 +16,7 @@
package app.lawnchair.ui.preferences
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.material.*
import androidx.compose.runtime.Composable
@@ -37,10 +38,11 @@ fun SwitchPreference(
PreferenceTemplate(height = if (description != null) 72.dp else 52.dp, showDivider = showDivider) {
Row(
modifier = Modifier
.clickable { onCheckedChange(!checked) }
.fillMaxHeight()
.fillMaxWidth()
.padding(start = 16.dp, end = 16.dp),
verticalAlignment = Alignment.CenterVertically
verticalAlignment = Alignment.CenterVertically,
) {
Column(modifier = Modifier.weight(1f)) {
Text(
@@ -12,6 +12,8 @@
* 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.
*
* Modifications copyright 2021, Lawnchair
*/
package com.android.launcher3.uioverrides.touchcontrollers;
@@ -21,6 +23,7 @@ import static android.view.MotionEvent.ACTION_UP;
import static android.view.MotionEvent.ACTION_CANCEL;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SWIPE_DOWN_WORKSPACE_NOTISHADE_OPEN;
import android.annotation.SuppressLint;
import android.graphics.PointF;
import android.util.SparseArray;
import android.view.MotionEvent;
@@ -39,6 +42,7 @@ import com.android.launcher3.util.TouchController;
import com.android.quickstep.SystemUiProxy;
import java.io.PrintWriter;
import java.lang.reflect.InvocationTargetException;
/**
* TouchController for handling touch events that get sent to the StatusBar. Once the
@@ -69,6 +73,8 @@ public class StatusBarTouchController implements TouchController {
/* If {@code false}, this controller should not handle the input {@link MotionEvent}.*/
private boolean mCanIntercept;
private boolean mExpanded;
public StatusBarTouchController(Launcher l) {
mLauncher = l;
mSystemUiProxy = SystemUiProxy.INSTANCE.get(mLauncher);
@@ -89,6 +95,20 @@ public class StatusBarTouchController implements TouchController {
if (mSystemUiProxy.isActive()) {
mLastAction = ev.getActionMasked();
mSystemUiProxy.onStatusBarMotionEvent(ev);
} else if (!mExpanded) {
mExpanded = true;
expand();
}
}
@SuppressLint({"WrongConstant", "PrivateApi"})
private void expand() {
try {
Class.forName("android.app.StatusBarManager")
.getMethod("expandNotificationsPanel")
.invoke(mLauncher.getSystemService("statusbar"));
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException | ClassNotFoundException e) {
e.printStackTrace();
}
}
@@ -102,6 +122,7 @@ public class StatusBarTouchController implements TouchController {
if (!mCanIntercept) {
return false;
}
mExpanded = false;
mDownEvents.put(pid, new PointF(ev.getX(), ev.getY()));
} else if (ev.getActionMasked() == MotionEvent.ACTION_POINTER_DOWN) {
// Check!! should only set it only when threshold is not entered.
@@ -168,6 +189,6 @@ public class StatusBarTouchController implements TouchController {
return false;
}
}
return SystemUiProxy.INSTANCE.get(mLauncher).isActive();
return true;
}
}
@@ -12,6 +12,8 @@
* 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.
*
* Modifications copyright 2021, Lawnchair
*/
package com.android.launcher3.folder;
@@ -179,7 +181,10 @@ public class FolderAnimationManager {
Math.round((totalOffsetX + initialSize)),
Math.round((paddingOffsetY + initialSize)));
Rect endRect = new Rect(0, 0, lp.width, lp.height);
float finalRadius = ResourceUtils.pxFromDp(2, mContext.getResources().getDisplayMetrics());
float finalRadius = mContext.getResources().getDimension(R.dimen.bg_round_rect_radius);
if (Utilities.ATLEAST_P) {
finalRadius = Themes.getDimension(mContext, android.R.attr.dialogCornerRadius, finalRadius);
}
// Create the animators.
AnimatorSet a = new AnimatorSet();
@@ -45,8 +45,6 @@ import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.views.OptionsPopupView;
import app.lawnchair.gestures.SwipeDownGesture;
/**
* Helper class to handle touch on empty space in workspace and show options popup on long press
*/
@@ -73,7 +71,6 @@ public class WorkspaceTouchListener extends GestureDetector.SimpleOnGestureListe
private int mLongPressState = STATE_CANCELLED;
private final GestureDetector mGestureDetector;
private final SwipeDownGesture mSwipeDown;
public WorkspaceTouchListener(Launcher launcher, Workspace workspace) {
mLauncher = launcher;
@@ -82,12 +79,10 @@ public class WorkspaceTouchListener extends GestureDetector.SimpleOnGestureListe
// likely to cause movement.
mTouchSlop = 2 * ViewConfiguration.get(launcher).getScaledTouchSlop();
mGestureDetector = new GestureDetector(workspace.getContext(), this);
mSwipeDown = new SwipeDownGesture(workspace.getContext());
}
@Override
public boolean onTouch(View view, MotionEvent ev) {
mSwipeDown.onTouch(view, ev);
mGestureDetector.onTouchEvent(ev);
int action = ev.getActionMasked();