Sitelet https://github.com/KeepSafe/TapTargetView/pull/187/files
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,23 +437,18 @@ public void run() {

targetBounds.set(target.bounds());

getLocationOnScreen(offset);
getLocationInWindow(offset);
targetBounds.offset(-offset[0], -offset[1]);

if (boundingParent != null) {
final WindowManager windowManager
= (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
final DisplayMetrics displayMetrics = new DisplayMetrics();
windowManager.getDefaultDisplay().getMetrics(displayMetrics);

final Rect rect = new Rect();
boundingParent.getWindowVisibleDisplayFrame(rect);
int[] viewLocation = new int[2];
boundingParent.getLocationInWindow(viewLocation);

// We bound the boundaries to be within the screen's coordinates to
// handle the case where the layout bounds do not match
// (like when FLAG_LAYOUT_NO_LIMITS is specified)
topBoundary = Math.max(0, rect.top);
bottomBoundary = Math.min(rect.bottom, displayMetrics.heightPixels);
topBoundary = Math.max(0, viewLocation[1]);
bottomBoundary = viewLocation[1] + boundingParent.getHeight();
}

drawTintedTarget();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void onReady(final Runnable runnable) {
public void run() {
// Cache bounds
final int[] location = new int[2];
view.getLocationOnScreen(location);
view.getLocationInWindow(location);
bounds = new Rect(location[0], location[1],
location[0] + view.getWidth(), location[1] + view.getHeight());

Expand Down