Skip to content

Commit

Permalink
Refactor the custom profile layout of the balloon
Browse files Browse the repository at this point in the history
  • Loading branch information
skydoves committed Jan 30, 2021
1 parent de65afa commit 146edc5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ProfileBalloonFactory : Balloon.Factory() {
isRtlSupport(BalloonUtils.isRtlLayout())
setCornerRadius(4f)
setElevation(6)
setBackgroundColorResource(R.color.white)
setBackgroundColorResource(R.color.background800)
setBalloonAnimation(BalloonAnimation.CIRCULAR)
setDismissWhenTouchOutside(true)
setDismissWhenShowAgain(true)
Expand Down
36 changes: 31 additions & 5 deletions app/src/main/res/layout/layout_custom_profile.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="240dp"
Expand All @@ -16,27 +16,50 @@
android:layout_marginTop="10dp"
android:scaleType="centerCrop"
android:src="@drawable/lovebird"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:shapeAppearanceOverlay="@style/CircleImageStyle" />

<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:src="@drawable/ic_cards"
app:layout_constraintBottom_toBottomOf="@+id/name"
app:layout_constraintEnd_toStartOf="@id/name"
app:layout_constraintTop_toTopOf="@id/name" />

<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginTop="8dp"
android:gravity="center"
android:text="skydoves"
android:textColor="@color/background900"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/icon"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/circleImageView"
tools:ignore="HardcodedText" />

<TextView
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="Love coffee, music, magic tricks and writing poems."
android:textColor="@color/background800"
android:textColor="@color/white"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/name"
tools:ignore="HardcodedText" />

<Button
Expand All @@ -48,6 +71,9 @@
android:text="Edit"
android:textAllCaps="false"
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/content"
tools:ignore="HardcodedText" />

</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit 146edc5

Please sign in to comment.