Skip to content

Instantly share code, notes, and snippets.

@MahmoudMabrok
Last active May 12, 2021 12:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MahmoudMabrok/a97201cd49b206a37b12a25b3c1abd88 to your computer and use it in GitHub Desktop.
Save MahmoudMabrok/a97201cd49b206a37b12a25b3c1abd88 to your computer and use it in GitHub Desktop.
story reply
private fun makeViewFullWidth(view: View) {
val point = Point()
// point will be populated with screen width and height
activity?.windowManager?.defaultDisplay?.getSize(point)
val param = view.layoutParams
param.width = point.x
param.height = point.y
view.layoutParams = param
}
<FrameLayout
android:id="@+id/imContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/_5sdp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
</FrameLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment