GitNex-Android-App/app/src/main/res/layout/activity_issue_detail.xml

389 lines
20 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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="match_parent"
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView"
app:elevation="@dimen/dimen0dp">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/primaryBackgroundColor">
2020-01-02 08:51:10 +01:00
<ImageView
android:id="@+id/issuePrState"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/generalImgContentText"
android:paddingStart="@dimen/dimen0dp"
android:paddingEnd="@dimen/dimen8dp"
android:src="@drawable/ic_issue"
android:visibility="gone" />
2020-01-02 08:51:10 +01:00
<TextView
android:id="@+id/toolbar_title"
2020-01-02 08:51:10 +01:00
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
2020-03-04 20:37:28 +01:00
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen20sp" />
2020-01-02 08:51:10 +01:00
</com.google.android.material.appbar.MaterialToolbar>
</com.google.android.material.appbar.AppBarLayout>
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progressBar"
style="@style/Widget.Material3.LinearProgressIndicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen56dp"
android:indeterminate="true"
app:indicatorColor="?attr/progressIndicatorColor" />
Don't use TinyDB as cache (#1034) Do not use TinyDB as a cache or a way to send data between activities. ### How is this working Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so). Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**. Additional changes: * after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account) * repositories and organizations are clickable on user profiles * deleted two unused classes Once finished, hopefully * closes #354 * replaces #897 * fixes #947 * closes #1001 * closes #1015 * marks #876 and #578 as `Wontfix` since they are not necessary at this point * and all the other TinyDB issues Co-authored-by: qwerty287 <ndev@web.de> Co-authored-by: M M Arif <mmarif@noreply.codeberg.org> Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034 Reviewed-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org> Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/addNewComment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/dimen16dp"
android:backgroundTint="?attr/fabColor"
android:contentDescription="@string/commentButtonText"
android:text="@string/commentButtonText"
android:textColor="?attr/materialCardBackgroundColor"
app:iconTint="?attr/materialCardBackgroundColor"
app:icon="@drawable/ic_reply" />
<RelativeLayout
android:id="@+id/relativeMainLayoutFrame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dimen64dp">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/pullToRefresh"
android:layout_width="match_parent"
android:layout_height="wrap_content">
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 https://codeberg.org/gitnex/GitNex/commit/ef9bdbfb902029784a3ca6367ab484a6e76a93d9) * in the next commits (https://codeberg.org/gitnex/GitNex/compare/dd99f435eedf272bc14ac48034b198b38df34dd3...2021a719514594b3b3e0d3cc93100ea25ba5ec87), 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
<androidx.core.widget.NestedScrollView
android:id="@+id/scrollViewComments"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fillViewport="true">
<RelativeLayout
android:id="@+id/relativeLayoutFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="@dimen/dimen8dp"
android:paddingTop="@dimen/dimen2dp"
android:paddingEnd="@dimen/dimen8dp"
android:paddingBottom="@dimen/dimen8dp">
<com.google.android.material.card.MaterialCardView
android:id="@+id/titleCard"
style="?attr/materialCardViewElevatedStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dimen12dp"
app:cardElevation="@dimen/dimen0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/materialCardBackgroundColor"
android:foreground="?android:attr/selectableItemBackground"
android:orientation="vertical"
android:padding="@dimen/dimen12dp">
<TextView
android:id="@+id/issueTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
android:textColor="?attr/primaryTextColor"
android:textIsSelectable="true"
android:textSize="@dimen/dimen16sp" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/mainThreadCard"
style="?attr/materialCardViewElevatedStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/titleCard"
android:layout_marginBottom="@dimen/dimen0dp"
app:cardElevation="@dimen/dimen0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/materialCardBackgroundColor"
android:foreground="?android:attr/selectableItemBackground"
android:orientation="vertical"
android:padding="@dimen/dimen12dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="horizontal">
<com.google.android.material.card.MaterialCardView
style="?attr/materialCardViewElevatedStyle"
android:layout_width="@dimen/dimen24dp"
android:layout_height="@dimen/dimen24dp"
app:cardCornerRadius="@dimen/dimen12dp"
app:cardElevation="@dimen/dimen0dp">
<ImageView
android:id="@+id/assigneeAvatar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0"
android:contentDescription="@string/generalImgContentText"
tools:srcCompat="@tools:sample/avatars"
tools:ignore="TooDeepLayout" />
</com.google.android.material.card.MaterialCardView>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dimen16dp"
android:layout_marginRight="@dimen/dimen16dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="middle"
android:singleLine="true"
android:textIsSelectable="true"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/issueCreatedTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="start"
android:textColor="?attr/hintColor"
android:textSize="12sp"
android:visibility="gone" />
<TextView
android:id="@+id/issueModified"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="start"
android:text="@string/modifiedText"
android:textColor="?attr/hintColor"
android:textSize="12sp"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/dueDateFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end|center_vertical"
android:orientation="horizontal"
android:visibility="gone"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="@dimen/dimen20dp"
android:layout_height="wrap_content"
android:contentDescription="@string/generalImgContentText"
app:srcCompat="@drawable/ic_calendar" />
<TextView
android:id="@+id/issueDueDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dimen8dp"
android:singleLine="true"
android:textIsSelectable="true"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen14sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/milestoneFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end|center_vertical"
android:orientation="horizontal"
android:visibility="gone"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="@dimen/dimen20dp"
android:layout_height="wrap_content"
android:contentDescription="@string/generalImgContentText"
app:srcCompat="@drawable/ic_milestone" />
<TextView
android:id="@+id/issueMilestone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dimen8dp"
android:singleLine="true"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen14sp" />
</LinearLayout>
<HorizontalScrollView
android:id="@+id/assigneesScrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
android:foregroundGravity="right"
android:visibility="gone"
android:scrollbarThumbHorizontal="@android:color/transparent">
<LinearLayout
android:id="@+id/frameAssignees"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="@dimen/dimen10dp"
android:gravity="end"
android:orientation="horizontal">
</LinearLayout>
</HorizontalScrollView>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/issueDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/dimen8dp"
android:autoLink="web"
android:gravity="start"
android:visibility="gone"
android:textColor="?attr/primaryTextColor"
android:textColorLink="@color/lightBlue"
android:textIsSelectable="true"
android:textSize="@dimen/dimen14sp" />
<HorizontalScrollView
android:id="@+id/labelsScrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
android:foregroundGravity="right"
android:visibility="gone"
android:scrollbarThumbHorizontal="@android:color/transparent">
<LinearLayout
android:id="@+id/frameLabels"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen10dp"
android:orientation="horizontal">
</LinearLayout>
</HorizontalScrollView>
<LinearLayout
android:id="@+id/commentReactionBadges"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen10dp"
android:orientation="horizontal"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:id="@+id/attachmentFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/materialCardBackgroundColor"
android:foreground="?android:attr/selectableItemBackground"
android:visibility="gone"
android:orientation="vertical">
<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen4dp" />
<LinearLayout
android:id="@+id/attachmentsView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dimen12dp"
android:orientation="horizontal">
</LinearLayout>
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/mainThreadCard"
android:background="?attr/primaryBackgroundColor">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:paddingBottom="@dimen/dimen72dp" />
</FrameLayout>
</RelativeLayout>
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 https://codeberg.org/gitnex/GitNex/commit/ef9bdbfb902029784a3ca6367ab484a6e76a93d9) * in the next commits (https://codeberg.org/gitnex/GitNex/compare/dd99f435eedf272bc14ac48034b198b38df34dd3...2021a719514594b3b3e0d3cc93100ea25ba5ec87), 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
</androidx.core.widget.NestedScrollView>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>