use of android.graphics.Point in project XobotOS by xamarin.
the class View method setBottom.
/**
* Sets the bottom position of this view relative to its parent. This method is meant to be
* called by the layout system and should not generally be called otherwise, because the
* property may be changed at any time by the layout.
*
* @param bottom The bottom of this view, in pixels.
*/
public final void setBottom(int bottom) {
if (bottom != mBottom) {
updateMatrix();
final boolean matrixIsIdentity = mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
if (matrixIsIdentity) {
if (mAttachInfo != null) {
int maxBottom;
if (bottom < mBottom) {
maxBottom = mBottom;
} else {
maxBottom = bottom;
}
invalidate(0, 0, mRight - mLeft, maxBottom - mTop);
}
} else {
// Double-invalidation is necessary to capture view's old and new areas
invalidate(true);
}
int width = mRight - mLeft;
int oldHeight = mBottom - mTop;
mBottom = bottom;
onSizeChanged(width, mBottom - mTop, width, oldHeight);
if (!matrixIsIdentity) {
if ((mPrivateFlags & PIVOT_EXPLICITLY_SET) == 0) {
// A change in dimension means an auto-centered pivot point changes, too
mTransformationInfo.mMatrixDirty = true;
}
// force another invalidation with the new orientation
mPrivateFlags |= DRAWN;
invalidate(true);
}
mBackgroundSizeChanged = true;
invalidateParentIfNeeded();
}
}
use of android.graphics.Point in project XobotOS by xamarin.
the class ViewRootImpl method updateConfiguration.
void updateConfiguration(Configuration config, boolean force) {
if (DEBUG_CONFIGURATION)
Log.v(TAG, "Applying new config to window " + mWindowAttributes.getTitle() + ": " + config);
CompatibilityInfo ci = mCompatibilityInfo.getIfNeeded();
if (ci != null) {
config = new Configuration(config);
ci.applyToConfiguration(config);
}
synchronized (sConfigCallbacks) {
for (int i = sConfigCallbacks.size() - 1; i >= 0; i--) {
sConfigCallbacks.get(i).onConfigurationChanged(config);
}
}
if (mView != null) {
// At this point the resources have been updated to
// have the most recent config, whatever that is. Use
// the on in them which may be newer.
config = mView.getResources().getConfiguration();
if (force || mLastConfiguration.diff(config) != 0) {
mLastConfiguration.setTo(config);
mView.dispatchConfigurationChanged(config);
}
}
}
use of android.graphics.Point in project XobotOS by xamarin.
the class View method setTop.
/**
* Sets the top position of this view relative to its parent. This method is meant to be called
* by the layout system and should not generally be called otherwise, because the property
* may be changed at any time by the layout.
*
* @param top The top of this view, in pixels.
*/
public final void setTop(int top) {
if (top != mTop) {
updateMatrix();
final boolean matrixIsIdentity = mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
if (matrixIsIdentity) {
if (mAttachInfo != null) {
int minTop;
int yLoc;
if (top < mTop) {
minTop = top;
yLoc = top - mTop;
} else {
minTop = mTop;
yLoc = 0;
}
invalidate(0, yLoc, mRight - mLeft, mBottom - minTop);
}
} else {
// Double-invalidation is necessary to capture view's old and new areas
invalidate(true);
}
int width = mRight - mLeft;
int oldHeight = mBottom - mTop;
mTop = top;
onSizeChanged(width, mBottom - mTop, width, oldHeight);
if (!matrixIsIdentity) {
if ((mPrivateFlags & PIVOT_EXPLICITLY_SET) == 0) {
// A change in dimension means an auto-centered pivot point changes, too
mTransformationInfo.mMatrixDirty = true;
}
// force another invalidation with the new orientation
mPrivateFlags |= DRAWN;
invalidate(true);
}
mBackgroundSizeChanged = true;
invalidateParentIfNeeded();
}
}
use of android.graphics.Point in project WordPress-Android by wordpress-mobile.
the class ImageUtils method getMaximumThumbnailWidthForEditor.
/**
* Get the maximum size a thumbnail can be to fit in either portrait or landscape orientations.
*/
public static int getMaximumThumbnailWidthForEditor(Context context) {
int maximumThumbnailWidthForEditor;
Point size = DisplayUtils.getDisplayPixelSize(context);
int screenWidth = size.x;
int screenHeight = size.y;
maximumThumbnailWidthForEditor = (screenWidth > screenHeight) ? screenHeight : screenWidth;
// 48dp of padding on each side so you can still place the cursor next to the image.
int padding = DisplayUtils.dpToPx(context, 48) * 2;
maximumThumbnailWidthForEditor -= padding;
return maximumThumbnailWidthForEditor;
}
use of android.graphics.Point in project TourGuide by worker8.
the class ToolTilMeasureTest method getScreenHeight.
public int getScreenHeight(Activity activity) {
Display display = activity.getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
return size.y;
}
Aggregations