Merge "Launcher tweaks." into ics-factoryrom
|
Before Width: | Height: | Size: 200 B After Width: | Height: | Size: 196 B |
|
Before Width: | Height: | Size: 184 B After Width: | Height: | Size: 200 B |
|
Before Width: | Height: | Size: 202 B After Width: | Height: | Size: 204 B |
|
Before Width: | Height: | Size: 219 B After Width: | Height: | Size: 177 B |
|
Before Width: | Height: | Size: 170 B After Width: | Height: | Size: 176 B |
|
Before Width: | Height: | Size: 165 B After Width: | Height: | Size: 170 B |
|
Before Width: | Height: | Size: 165 B After Width: | Height: | Size: 169 B |
|
Before Width: | Height: | Size: 196 B After Width: | Height: | Size: 162 B |
|
Before Width: | Height: | Size: 193 B After Width: | Height: | Size: 196 B |
|
Before Width: | Height: | Size: 190 B After Width: | Height: | Size: 193 B |
|
Before Width: | Height: | Size: 199 B After Width: | Height: | Size: 193 B |
|
Before Width: | Height: | Size: 255 B After Width: | Height: | Size: 198 B |
@@ -21,6 +21,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginTop="90dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -43,6 +44,8 @@
|
||||
android:id="@+id/workspace_cling_open_all_apps"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginBottom="130dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:gravity="center"
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<Gallery android:id="@+id/gallery"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:spacing="0dp" />
|
||||
android:spacing="-4dp" />
|
||||
|
||||
<Button android:id="@+id/set"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -62,10 +62,6 @@ public class Cling extends FrameLayout {
|
||||
|
||||
private Paint mErasePaint;
|
||||
|
||||
private View mWorkspaceDesc1;
|
||||
private View mWorkspaceDesc2;
|
||||
private View mAllAppsDesc;
|
||||
|
||||
public Cling(Context context) {
|
||||
this(context, null, 0);
|
||||
}
|
||||
@@ -98,10 +94,6 @@ public class Cling extends FrameLayout {
|
||||
r.getDimensionPixelSize(R.dimen.toolbar_button_horizontal_padding);
|
||||
mButtonBarHeight = r.getDimensionPixelSize(R.dimen.button_bar_height);
|
||||
|
||||
mWorkspaceDesc1 = findViewById(R.id.workspace_cling_move_item);
|
||||
mWorkspaceDesc2 = findViewById(R.id.workspace_cling_open_all_apps);
|
||||
mAllAppsDesc = findViewById(R.id.all_apps_cling_add_item);
|
||||
|
||||
mErasePaint = new Paint();
|
||||
mErasePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.MULTIPLY));
|
||||
mErasePaint.setColor(0xFFFFFF);
|
||||
@@ -140,11 +132,6 @@ public class Cling extends FrameLayout {
|
||||
double diff = Math.sqrt(Math.pow(event.getX() - pos[0], 2) +
|
||||
Math.pow(event.getY() - pos[1], 2));
|
||||
if (diff < mRevealRadius) {
|
||||
if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT)) {
|
||||
// Do nothing
|
||||
} else if (mDrawIdentifier.equals(ALLAPPS_PORTRAIT)) {
|
||||
// Do nothing
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} else if (mDrawIdentifier.equals(FOLDER_PORTRAIT) ||
|
||||
@@ -167,7 +154,7 @@ public class Cling extends FrameLayout {
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
mLauncher.getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
|
||||
// Draw the background
|
||||
// Initialize the draw buffer (to allow punching through)
|
||||
Bitmap b = Bitmap.createBitmap(getMeasuredWidth(), getMeasuredHeight(),
|
||||
Bitmap.Config.ARGB_8888);
|
||||
Canvas c = new Canvas(b);
|
||||
|
||||
@@ -77,10 +77,10 @@ import android.view.Surface;
|
||||
import android.view.View;
|
||||
import android.view.View.OnLongClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewParent;
|
||||
import android.view.WindowManager;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
import android.view.animation.AccelerateDecelerateInterpolator;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.Advanceable;
|
||||
@@ -3130,41 +3130,56 @@ public final class Launcher extends Activity
|
||||
anim.start();
|
||||
}
|
||||
}
|
||||
private void removeCling(int id) {
|
||||
final View cling = findViewById(id);
|
||||
if (cling != null) {
|
||||
final ViewGroup parent = (ViewGroup) cling.getParent();
|
||||
parent.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
parent.removeView(cling);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
public void showFirstRunWorkspaceCling() {
|
||||
if (!isClingsEnabled()) return;
|
||||
|
||||
// Enable the clings only if they have not been dismissed before
|
||||
SharedPreferences prefs =
|
||||
getSharedPreferences(PREFS_KEY, Context.MODE_PRIVATE);
|
||||
if (!prefs.getBoolean(Cling.WORKSPACE_CLING_DISMISSED_KEY, false)) {
|
||||
if (isClingsEnabled() && !prefs.getBoolean(Cling.WORKSPACE_CLING_DISMISSED_KEY, false)) {
|
||||
initCling(R.id.workspace_cling, null, false, 0);
|
||||
} else {
|
||||
removeCling(R.id.workspace_cling);
|
||||
}
|
||||
}
|
||||
public void showFirstRunAllAppsCling(int[] position) {
|
||||
if (!isClingsEnabled()) return;
|
||||
|
||||
// Enable the clings only if they have not been dismissed before
|
||||
SharedPreferences prefs =
|
||||
getSharedPreferences(PREFS_KEY, Context.MODE_PRIVATE);
|
||||
if (!prefs.getBoolean(Cling.ALLAPPS_CLING_DISMISSED_KEY, false)) {
|
||||
if (isClingsEnabled() && !prefs.getBoolean(Cling.ALLAPPS_CLING_DISMISSED_KEY, false)) {
|
||||
initCling(R.id.all_apps_cling, position, true, 0);
|
||||
} else {
|
||||
removeCling(R.id.all_apps_cling);
|
||||
}
|
||||
}
|
||||
public Cling showFirstRunFoldersCling() {
|
||||
if (!isClingsEnabled()) return null;
|
||||
|
||||
// Enable the clings only if they have not been dismissed before
|
||||
SharedPreferences prefs =
|
||||
getSharedPreferences(PREFS_KEY, Context.MODE_PRIVATE);
|
||||
Cling cling = null;
|
||||
if (!prefs.getBoolean(Cling.FOLDER_CLING_DISMISSED_KEY, false)) {
|
||||
if (isClingsEnabled() && !prefs.getBoolean(Cling.FOLDER_CLING_DISMISSED_KEY, false)) {
|
||||
cling = initCling(R.id.folder_cling, null, true, 0);
|
||||
} else {
|
||||
removeCling(R.id.folder_cling);
|
||||
}
|
||||
return cling;
|
||||
}
|
||||
public boolean isFolderClingVisible() {
|
||||
Cling cling = (Cling) findViewById(R.id.folder_cling);
|
||||
return cling.getVisibility() == View.VISIBLE;
|
||||
if (cling != null) {
|
||||
return cling.getVisibility() == View.VISIBLE;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public void dismissWorkspaceCling(View v) {
|
||||
Cling cling = (Cling) findViewById(R.id.workspace_cling);
|
||||
|
||||