GitNex/app/src/main/res/layout/list_issue_comments.xml
qwerty287 dec9c1e224 Improve md rendering (#1008)
* the first commits close https://codeberg.org/gitnex/GitNex/issues/925
	* instead of using `TextView`s, it now uses `RecyclerView`s as they are supported by `Markwon` too and especially tables look better
    * see https://noties.io/Markwon/docs/v4/recycler/ and https://noties.io/Markwon/docs/v4/recycler-table/
    * I replaced the `TextView`s on issue descriptions, comments, file viewer and the README viewer with a `RecyclerView`
* the second parts close https://codeberg.org/gitnex/GitNex/issues/993
	* images are now displayed if content is rendered using a `RecyclerView`
    * it seems that there is an issue with the `PicassoImagesPlugin` with `TextView`s, with `RecyclerView`s it's working
* the third parts render issue/PR links like #1 as links, that closes https://codeberg.org/gitnex/GitNex/issues/72
	* therefore, I added an URL prefix to the deep links named `gitnex` so that it is possible to open links from any instance by using `gitnex` instead of `http`/`https`
    * Full links are rendered as #index too
    * code is mostly from the sample app (https://github.com/noties/Markwon/blob/master/app-sample/src/main/java/io/noties/markwon/app/samples/GithubUserIssueInlineParsingSample.java#L60-L110)
* I undid https://codeberg.org/gitnex/GitNex/pulls/995 because it wouldn't work if you have code block (starting/ending with ```) with newlines in it, I found another solution (see [the issue on gh](https://github.com/noties/Markwon/issues/168#issuecomment-622943057) and ef9bdbfb90)
* in the next commits (dd99f435ee...2021a71951), I fixed and improved various things
	* commit links are only rendered as short SHA
    * supports relative attachment links (addresses #993)
    * don't render email addresses as user mentions

However, one thing isn't working right now:
* the `LinkifyPlugin` is not working with `RecyclerView`s right now
* I would like to change the way how the links are rendered and to open the activities directly instead of opening the deeplinkactivity

close https://codeberg.org/gitnex/GitNex/issues/925 close https://codeberg.org/gitnex/GitNex/issues/993 close https://codeberg.org/gitnex/GitNex/issues/72

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1008
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2021-12-15 23:39:04 +01:00

86 lines
3.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="match_parent"
android:layout_height="wrap_content"
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical"
android:padding="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/avatar"
android:layout_width="@dimen/list_avatar_size"
android:layout_height="@dimen/list_avatar_size"
android:layout_weight="0"
android:contentDescription="@string/generalImgContentText"
tools:srcCompat="@tools:sample/avatars" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/author"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="middle"
android:singleLine="true"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="@+id/information"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:textColor="?attr/hintColor"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:id="@+id/menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_weight="0"
android:contentDescription="@string/menuContentDesc"
android:background="?android:attr/selectableItemBackgroundBorderless"
app:srcCompat="@drawable/ic_dotted_menu_horizontal" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textColor="?attr/primaryTextColor"
android:textIsSelectable="true"
android:autoLink="web"
android:textColorLink="@color/lightBlue"
android:textSize="14sp" />
<LinearLayout
android:id="@+id/commentReactionBadges"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_marginTop="16dp"
android:orientation="horizontal" />
</LinearLayout>