Skip to content

Commit

Permalink
RUM-3460: Fix padding and resizing issue for image view mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
ambushwork committed Nov 5, 2024
1 parent b1d6ebb commit 95ab882
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package com.datadog.android.sessionreplay.internal.recorder.resources

import android.graphics.drawable.Drawable
import android.graphics.drawable.GradientDrawable
import android.graphics.drawable.InsetDrawable
import android.graphics.drawable.LayerDrawable
import android.view.View
Expand Down Expand Up @@ -238,7 +237,6 @@ internal class DefaultImageWireframeHelper(
}
}

is GradientDrawable -> DrawableProperties(drawable, view.width, view.height)
else -> DrawableProperties(drawable, width, height)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ internal object ImageViewUtils {
// this will always have size >= 2
@Suppress("UnsafeThirdPartyFunctionCall")
view.getLocationOnScreen(coords)

val leftPadding = view.paddingLeft
val rightPadding = view.paddingRight
val topPadding = view.paddingTop
val bottomPadding = view.paddingBottom
return Rect(
coords[0],
coords[1],
coords[0] + view.width,
coords[1] + view.height
coords[0] + leftPadding,
coords[1] + topPadding,
coords[0] + view.width - rightPadding,
coords[1] + view.height - bottomPadding
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@
<ImageView
android:id="@+id/imageView_remote"
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_height="160dp"
android:padding="32dp"
android:scaleType="fitCenter"
android:contentDescription="@null"
android:layout_marginEnd="8dp"
Expand Down

0 comments on commit 95ab882

Please sign in to comment.