mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
- Created a drawer with tabs for widgets, folders, shortcuts, wallpapers (wallpapers are currently not implemented) - Tapping outside the drawer dismisses it - Moved the all apps icon to the upper right of the screen - Adding a toast that says "No more space on screen" when dragging a widget to a full screen - Fixed bug where you could stack two equal-sized widgets on top of each other on the homescreen (exposed by the new ability to drag widgets onto the home screen) Change-Id: I03b65ce54a85d24328c94e0c06e249571de449ee
66 lines
2.0 KiB
Java
66 lines
2.0 KiB
Java
/*
|
|
* Copyright (C) 2008 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.launcher2;
|
|
|
|
import android.content.Context;
|
|
import android.util.AttributeSet;
|
|
import android.view.KeyEvent;
|
|
import android.view.MotionEvent;
|
|
import android.view.View;
|
|
import android.widget.FrameLayout;
|
|
|
|
/**
|
|
* A ViewGroup that coordinates dragging across its descendants
|
|
*/
|
|
public class DragLayer extends FrameLayout {
|
|
DragController mDragController;
|
|
|
|
/**
|
|
* Used to create a new DragLayer from XML.
|
|
*
|
|
* @param context The application's context.
|
|
* @param attrs The attributes set containing the Workspace's customization values.
|
|
*/
|
|
public DragLayer(Context context, AttributeSet attrs) {
|
|
super(context, attrs);
|
|
}
|
|
|
|
public void setDragController(DragController controller) {
|
|
mDragController = controller;
|
|
}
|
|
|
|
@Override
|
|
public boolean dispatchKeyEvent(KeyEvent event) {
|
|
return mDragController.dispatchKeyEvent(event) || super.dispatchKeyEvent(event);
|
|
}
|
|
|
|
@Override
|
|
public boolean onInterceptTouchEvent(MotionEvent ev) {
|
|
return mDragController.onInterceptTouchEvent(ev);
|
|
}
|
|
|
|
@Override
|
|
public boolean onTouchEvent(MotionEvent ev) {
|
|
return mDragController.onTouchEvent(ev);
|
|
}
|
|
|
|
@Override
|
|
public boolean dispatchUnhandledMove(View focused, int direction) {
|
|
return mDragController.dispatchUnhandledMove(focused, direction);
|
|
}
|
|
}
|