GitNex/app/src/main/res/layout/fragment_commit_details.xml
qwerty287 16f547fed2 Add support for commit statuses (#1212)
Addresses https://codeberg.org/gitnex/GitNex/issues/435 but only supports commits and not PRs.

Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1212
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-10-04 12:22:18 +02:00

260 lines
12 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="match_parent"
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"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/primaryBackgroundColor">
<ImageView
android:id="@+id/close"
android:layout_width="@dimen/dimen26dp"
android:layout_height="@dimen/dimen26dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/close"
android:focusable="true"
android:gravity="center_vertical"
android:src="@drawable/ic_close"/>
<TextView
android:id="@+id/toolbar_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/dimen20dp"
android:ellipsize="none"
android:scrollbars="horizontal"
android:singleLine="true"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen18sp"/>
</com.google.android.material.appbar.MaterialToolbar>
</com.google.android.material.appbar.AppBarLayout>
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progress_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
app:indicatorColor="?attr/progressIndicatorColor"/>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dimen8dp"
android:orientation="vertical">
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="?attr/materialCardViewFilledStyle"
android:layout_marginBottom="@dimen/dimen4dp"
app:cardElevation="@dimen/dimen0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?android:attr/selectableItemBackground"
android:background="?attr/materialCardBackgroundColor"
android:padding="@dimen/dimen12dp"
android:orientation="vertical">
<TextView
android:id="@+id/commitSubject"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dimen8dp"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen18sp"
tools:text="This is a test"/>
<TextView
android:id="@+id/commitBody"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dimen8dp"
android:alpha=".8"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen14sp"
tools:text="This is a test commit message"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen6dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<com.google.android.material.card.MaterialCardView
android:id="@+id/commitAuthorAvatarFrame"
android:layout_width="@dimen/dimen24dp"
android:layout_height="@dimen/dimen24dp"
style="?attr/materialCardViewFilledStyle"
app:cardElevation="@dimen/dimen0dp"
android:layout_marginEnd="@dimen/dimen6dp"
app:cardCornerRadius="@dimen/dimen12dp">
<ImageView
android:id="@+id/commitAuthorAvatar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/generalImgContentText"
tools:srcCompat="@tools:sample/avatars" />
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/commitCommitterAvatarFrame"
android:layout_width="@dimen/dimen24dp"
android:layout_height="@dimen/dimen24dp"
style="?attr/materialCardViewFilledStyle"
app:cardElevation="@dimen/dimen0dp"
android:layout_marginEnd="@dimen/dimen6dp"
app:cardCornerRadius="@dimen/dimen12dp">
<ImageView
android:id="@+id/commitCommitterAvatar"
android:layout_width="@dimen/dimen24dp"
android:layout_height="@dimen/dimen24dp"
android:layout_marginEnd="5dp"
android:contentDescription="@string/generalImgContentText"
tools:srcCompat="@tools:sample/avatars"/>
</com.google.android.material.card.MaterialCardView>
<TextView
android:id="@+id/commitAuthorAndCommitter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dimen10dp"
android:textSize="@dimen/dimen12sp"
android:textColor="?attr/primaryTextColor"
tools:text="opyale authored and opyale committed"/>
</LinearLayout>
<TextView
android:id="@+id/commitSha"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:alpha=".8"
android:drawablePadding="@dimen/dimen10dp"
android:textSize="@dimen/dimen12sp"
android:layout_marginStart="@dimen/dimen10dp"
android:gravity="center_vertical"
android:textColor="?attr/primaryTextColor"
app:drawableLeftCompat="@drawable/ic_commit"
tools:text="357f3qd5s"/>
</LinearLayout>
<LinearLayout
android:id="@+id/statusesLvMain"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?android:attr/selectableItemBackground"
android:background="?attr/materialCardBackgroundColor"
android:orientation="vertical">
<LinearLayout
android:paddingTop="@dimen/dimen8dp"
android:id="@+id/statuses"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/dimen2dp"
android:minHeight="@dimen/dimen48dp"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/commitStatuses"
android:textSize="@dimen/dimen16sp"
android:paddingTop="@dimen/dimen10dp"
android:layout_weight="0.9"
android:gravity="center_vertical"
android:paddingBottom="@dimen/dimen10dp"
android:paddingStart="@dimen/dimen0dp"
android:paddingEnd="@dimen/dimen0dp"
android:textColor="?attr/primaryTextColor"/>
<ImageView
android:id="@+id/statusesExpandCollapse"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.1"
android:layout_gravity="center_vertical|end"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/generalImgContentText"
app:srcCompat="@drawable/ic_chevron_down"/>
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:id="@+id/statusesLv"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/statusesList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/dimen16sp"
android:textColor="?attr/primaryTextColor"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/diff_files"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:listitem="@layout/list_diff_files"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>