habitica-android icon indicating copy to clipboard operation
habitica-android copied to clipboard

Images not aligned properly

Open DorianK29 opened this issue 2 years ago • 3 comments

Describe the bug Images are not center with text on android.

To Reproduce Create a new task with any embedded image on android and it will not be aligned. On the web version it works fine for me.

Expected behavior Make them have the same center vertical alignment as text and emojis.

Screenshots image

Smartphone (please complete the following information):

  • Device: Huawei P40
  • OS: Android 12.0
  • App Version: 3.5.2.1
  • Habitica Username: DorainK29
  • Also tried on emulator - Same results

Additional context I tried changing the gravity of the text field in xml to center vertical, but I didn't change the way the image was displayed.

DorianK29 avatar May 18 '22 10:05 DorianK29

Can you also post a screenshot of the behaviour you are expecting? Going by the screenshot you posted, the image and the text are aligned, but are aligned at the bottom/baseline.

phillipthelen avatar May 18 '22 11:05 phillipthelen

I believe it would look a lot better shown as it is in the title rather than the way its written in the description. image

I just hardcoded the image in, to show how it would look like, this is the code snippet.

  <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>

DorianK29 avatar May 18 '22 16:05 DorianK29

alright so center align images with the line of text in title and notes

saraolson avatar May 24 '22 16:05 saraolson