am 7f47685e: Merge "Change custom workspace cling" into jb-dev
* commit '7f47685e662aa4ba17c58d903bc474a35a730444': Change custom workspace cling
This commit is contained in:
@@ -22,8 +22,6 @@
|
|||||||
<dimen name="cling_text_block_offset_x">0dp</dimen>
|
<dimen name="cling_text_block_offset_x">0dp</dimen>
|
||||||
<dimen name="cling_text_block_offset_y">0dp</dimen>
|
<dimen name="cling_text_block_offset_y">0dp</dimen>
|
||||||
<dimen name="reveal_radius">48dp</dimen>
|
<dimen name="reveal_radius">48dp</dimen>
|
||||||
<!-- A list of custom punch through x,y coordinates. x and y alternate. default to empty. -->
|
|
||||||
<array name="punch_through_coords"></array>
|
|
||||||
|
|
||||||
<!-- Workspace -->
|
<!-- Workspace -->
|
||||||
<!-- qsb_bar_height_inset represents qsb_bar_height minus the padding
|
<!-- qsb_bar_height_inset represents qsb_bar_height minus the padding
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ public class Cling extends FrameLayout {
|
|||||||
private int mButtonBarHeight;
|
private int mButtonBarHeight;
|
||||||
private float mRevealRadius;
|
private float mRevealRadius;
|
||||||
private int[] mPositionData;
|
private int[] mPositionData;
|
||||||
private int[] mCustomPositionData;
|
|
||||||
|
|
||||||
private Paint mErasePaint;
|
private Paint mErasePaint;
|
||||||
|
|
||||||
@@ -89,17 +88,6 @@ public class Cling extends FrameLayout {
|
|||||||
|
|
||||||
Resources r = getContext().getResources();
|
Resources r = getContext().getResources();
|
||||||
|
|
||||||
// If we have custom punch through data from resources
|
|
||||||
TypedArray punchThroughCoords = r.obtainTypedArray(R.array.punch_through_coords);
|
|
||||||
|
|
||||||
if (punchThroughCoords != null) {
|
|
||||||
int len = punchThroughCoords.length();
|
|
||||||
mCustomPositionData = new int[len];
|
|
||||||
for (int i = 0; i < len; i++) {
|
|
||||||
mCustomPositionData[i] = punchThroughCoords.getDimensionPixelSize(i, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mPunchThroughGraphic = r.getDrawable(R.drawable.cling);
|
mPunchThroughGraphic = r.getDrawable(R.drawable.cling);
|
||||||
mPunchThroughGraphicCenterRadius =
|
mPunchThroughGraphicCenterRadius =
|
||||||
r.getDimensionPixelSize(R.dimen.clingPunchThroughGraphicCenterRadius);
|
r.getDimensionPixelSize(R.dimen.clingPunchThroughGraphicCenterRadius);
|
||||||
@@ -133,8 +121,6 @@ public class Cling extends FrameLayout {
|
|||||||
final int cornerXOffset = (int) (scale * 15);
|
final int cornerXOffset = (int) (scale * 15);
|
||||||
final int cornerYOffset = (int) (scale * 10);
|
final int cornerYOffset = (int) (scale * 10);
|
||||||
return new int[]{getMeasuredWidth() - cornerXOffset, cornerYOffset};
|
return new int[]{getMeasuredWidth() - cornerXOffset, cornerYOffset};
|
||||||
} else if (mDrawIdentifier.equals(WORKSPACE_CUSTOM)) {
|
|
||||||
return mCustomPositionData;
|
|
||||||
} else if (mDrawIdentifier.equals(ALLAPPS_PORTRAIT) ||
|
} else if (mDrawIdentifier.equals(ALLAPPS_PORTRAIT) ||
|
||||||
mDrawIdentifier.equals(ALLAPPS_LANDSCAPE) ||
|
mDrawIdentifier.equals(ALLAPPS_LANDSCAPE) ||
|
||||||
mDrawIdentifier.equals(ALLAPPS_LARGE)) {
|
mDrawIdentifier.equals(ALLAPPS_LARGE)) {
|
||||||
@@ -148,7 +134,6 @@ public class Cling extends FrameLayout {
|
|||||||
if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) ||
|
if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) ||
|
||||||
mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) ||
|
mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) ||
|
||||||
mDrawIdentifier.equals(WORKSPACE_LARGE) ||
|
mDrawIdentifier.equals(WORKSPACE_LARGE) ||
|
||||||
mDrawIdentifier.equals(WORKSPACE_CUSTOM) ||
|
|
||||||
mDrawIdentifier.equals(ALLAPPS_PORTRAIT) ||
|
mDrawIdentifier.equals(ALLAPPS_PORTRAIT) ||
|
||||||
mDrawIdentifier.equals(ALLAPPS_LANDSCAPE) ||
|
mDrawIdentifier.equals(ALLAPPS_LANDSCAPE) ||
|
||||||
mDrawIdentifier.equals(ALLAPPS_LARGE)) {
|
mDrawIdentifier.equals(ALLAPPS_LARGE)) {
|
||||||
@@ -172,6 +157,9 @@ public class Cling extends FrameLayout {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (mDrawIdentifier.equals(WORKSPACE_CUSTOM)) {
|
||||||
|
// Let all touch events fall through
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
@@ -191,15 +179,15 @@ public class Cling extends FrameLayout {
|
|||||||
if (mBackground == null) {
|
if (mBackground == null) {
|
||||||
if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) ||
|
if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) ||
|
||||||
mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) ||
|
mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) ||
|
||||||
mDrawIdentifier.equals(WORKSPACE_LARGE) ||
|
mDrawIdentifier.equals(WORKSPACE_LARGE)) {
|
||||||
mDrawIdentifier.equals(WORKSPACE_CUSTOM)) {
|
|
||||||
mBackground = getResources().getDrawable(R.drawable.bg_cling1);
|
mBackground = getResources().getDrawable(R.drawable.bg_cling1);
|
||||||
} else if (mDrawIdentifier.equals(ALLAPPS_PORTRAIT) ||
|
} else if (mDrawIdentifier.equals(ALLAPPS_PORTRAIT) ||
|
||||||
mDrawIdentifier.equals(ALLAPPS_LANDSCAPE) ||
|
mDrawIdentifier.equals(ALLAPPS_LANDSCAPE) ||
|
||||||
mDrawIdentifier.equals(ALLAPPS_LARGE)) {
|
mDrawIdentifier.equals(ALLAPPS_LARGE)) {
|
||||||
mBackground = getResources().getDrawable(R.drawable.bg_cling2);
|
mBackground = getResources().getDrawable(R.drawable.bg_cling2);
|
||||||
} else if (mDrawIdentifier.equals(FOLDER_PORTRAIT) ||
|
} else if (mDrawIdentifier.equals(FOLDER_PORTRAIT) ||
|
||||||
mDrawIdentifier.equals(FOLDER_LANDSCAPE)) {
|
mDrawIdentifier.equals(FOLDER_LANDSCAPE) ||
|
||||||
|
mDrawIdentifier.equals(WORKSPACE_CUSTOM)) {
|
||||||
mBackground = getResources().getDrawable(R.drawable.bg_cling3);
|
mBackground = getResources().getDrawable(R.drawable.bg_cling3);
|
||||||
} else if (mDrawIdentifier.equals(FOLDER_LARGE)) {
|
} else if (mDrawIdentifier.equals(FOLDER_LARGE)) {
|
||||||
mBackground = getResources().getDrawable(R.drawable.bg_cling4);
|
mBackground = getResources().getDrawable(R.drawable.bg_cling4);
|
||||||
|
|||||||
Reference in New Issue
Block a user