Hotfix touchpoint scale factor (#61)
This commit is contained in:
@@ -6,7 +6,7 @@ plugins {
|
||||
id 'kotlin-parcelize'
|
||||
}
|
||||
|
||||
def VERSION_NAME = "1.0.11"
|
||||
def VERSION_NAME = "1.0.12"
|
||||
|
||||
android {
|
||||
namespace 'com.navi.alfred'
|
||||
|
||||
@@ -62,9 +62,7 @@ data class AlfredConfig(
|
||||
internal var memoryUsageBeforeEventStart: Float? = null,
|
||||
internal var storageUsageBeforeEventStart: Float? = null,
|
||||
internal var batteryPercentageBeforeEventStart: Float? = null,
|
||||
internal var cruiseAttributes: CruiseAttributes = CruiseAttributes(),
|
||||
internal var xScaleFactor: Float? = null,
|
||||
internal var yScaleFactor: Float? = null
|
||||
internal var cruiseAttributes: CruiseAttributes = CruiseAttributes()
|
||||
) {
|
||||
constructor(appName: String, appVersionCode: String, appVersionName: String, flavor: String, apiKey: String) : this(
|
||||
appVersionCode = appVersionCode,
|
||||
|
||||
@@ -103,10 +103,6 @@ internal fun insertScreenShotPathInDb(
|
||||
}
|
||||
}
|
||||
bitmap?.compress(Bitmap.CompressFormat.JPEG, videoQuality, fos)
|
||||
if (AlfredManager.config.xScaleFactor == null || AlfredManager.config.yScaleFactor == null) {
|
||||
AlfredManager.config.xScaleFactor = bitmap?.width?.toFloat()?.div(Resources.getSystem().displayMetrics.widthPixels)
|
||||
AlfredManager.config.yScaleFactor = bitmap?.height?.toFloat()?.div(Resources.getSystem().displayMetrics.heightPixels)
|
||||
}
|
||||
fos.flush()
|
||||
fos.close()
|
||||
if (bottomSheetFlow == false) {
|
||||
|
||||
@@ -32,14 +32,14 @@ internal fun getTouchEvent(
|
||||
(difference(currentTouchEvent?.rawX, previousTouchEvent?.rawX) &&
|
||||
difference(currentTouchEvent?.rawY, previousTouchEvent?.rawY))
|
||||
) {
|
||||
properties[AlfredConstants.START_X] = min(previousTouchEvent?.pointerPositionX ?: 0f, screenWidth.toFloat()).times(AlfredManager.config.xScaleFactor ?: 0.5f).toString()
|
||||
properties[AlfredConstants.START_Y] = min(previousTouchEvent?.pointerPositionY ?: 0f, screenHeight.toFloat()).times(AlfredManager.config.yScaleFactor ?: 0.5f).toString()
|
||||
properties[AlfredConstants.START_X] = min(previousTouchEvent?.pointerPositionX ?: 0f, screenWidth.toFloat()).times(0.5f).toString()
|
||||
properties[AlfredConstants.START_Y] = min(previousTouchEvent?.pointerPositionY ?: 0f, screenHeight.toFloat()).times(0.5f).toString()
|
||||
AlfredConstants.TOUCH_EVENT
|
||||
} else {
|
||||
properties[AlfredConstants.START_X] = min(previousTouchEvent?.pointerPositionX ?: 0f, screenWidth.toFloat()).times(AlfredManager.config.xScaleFactor ?: 0.5f).toString()
|
||||
properties[AlfredConstants.START_Y] = min(previousTouchEvent?.pointerPositionY ?: 0f, screenHeight.toFloat()).times(AlfredManager.config.yScaleFactor ?: 0.5f).toString()
|
||||
properties[AlfredConstants.END_X] = min(currentTouchEvent?.getX(pointerIndex) ?: 0f, screenWidth.toFloat()).times(AlfredManager.config.xScaleFactor ?: 0.5f).toString()
|
||||
properties[AlfredConstants.END_Y] = min(currentTouchEvent?.getY(pointerIndex) ?: 0f, screenHeight.toFloat()).times(AlfredManager.config.yScaleFactor ?: 0.5f).toString()
|
||||
properties[AlfredConstants.START_X] = min(previousTouchEvent?.pointerPositionX ?: 0f, screenWidth.toFloat()).times(0.5f).toString()
|
||||
properties[AlfredConstants.START_Y] = min(previousTouchEvent?.pointerPositionY ?: 0f, screenHeight.toFloat()).times(0.5f).toString()
|
||||
properties[AlfredConstants.END_X] = min(currentTouchEvent?.getX(pointerIndex) ?: 0f, screenWidth.toFloat()).times(0.5f).toString()
|
||||
properties[AlfredConstants.END_Y] = min(currentTouchEvent?.getY(pointerIndex) ?: 0f, screenHeight.toFloat()).times(0.5f).toString()
|
||||
AlfredConstants.SCROLL_EVENT
|
||||
}
|
||||
return Pair(eventName, properties)
|
||||
|
||||
Reference in New Issue
Block a user