noties / Markwon

Android markdown library (no WebView)
https://noties.io/Markwon/
Apache License 2.0
2.68k stars 298 forks source link

[Question] How to change image gravity? #404

Closed DorianK29 closed 1 year ago

DorianK29 commented 2 years ago

Both the title and description image are not aligned the same way emojis are, with gravity center_vectical. image

Is it possible to make them aligned the same way the tittle picture is in this picture? image

  1. Please specify expected/actual behavior Markdown images have gravity set to center_vertical, and would look like emojis in picture above (not the same in size, just alignment), or like in the second picture.

  2. Please specify conditions/steps to reproduce (layout, code, markdown used, etc.) To create the 2nd picture I just hardcoded an image and set the gravity to center_vertical. I tried setting the gravity in the TextView to center_vertical but the way the image was aligned didn't change.

    <LinearLayout
        android:layout_width="match_parent"
        android:orientation="horizontal"
        android:layout_height="wrap_content">
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:src="@drawable/pic_buff1"/>
        <com.habitrpg.android.habitica.ui.views.EllipsisTextView
            android:id="@+id/checkedTextView"
            style="@style/Subheader3"
            android:textColor="?attr/textColorPrimary"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:lineSpacingExtra="2sp"
            android:layout_gravity="center_vertical"
            android:textSize="15sp"
            android:letterSpacing="0.025"
            tools:text="Habit Title" />
    </LinearLayout>
noties commented 1 year ago

Hello @DorianK29 ,

unfortunately it is not possible to specify gravity for individual images via markdown