Delete branch after merge (#496)

delete branch API call

Add fork repo info for branch

Check if pr is mergeable, show message if not.

Use checkbox instead of button

make ripple effects work for buttons with enable/disable

introduce viewbinding

Co-authored-by: 6543 <6543@noreply.gitea.io>
Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/496
Reviewed-by: 6543 <6543@noreply.gitea.io>
This commit is contained in:
M M Arif
2020-05-21 22:49:09 +00:00
committed by 6543
parent 1b213783bc
commit d06f5353c6
10 changed files with 338 additions and 83 deletions

View File

@ -123,6 +123,27 @@
</RelativeLayout>
<CheckBox
android:id="@+id/deleteBranch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/deleteBranchAfterMerge"
android:checked="false"
android:textSize="16sp"
android:layout_marginTop="10dp"
android:visibility="gone"
android:textColor="?attr/primaryTextColor"/>
<TextView
android:id="@+id/deleteBranchForkInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/deleteBranchForkInfo"
android:textColor="?attr/hintColor"
android:textSize="12sp"
android:gravity="start"
android:layout_marginTop="0dp" />
<TextView
android:id="@+id/mergeInfo"
android:layout_width="match_parent"
@ -131,7 +152,7 @@
android:textColor="?attr/hintColor"
android:textSize="12sp"
android:gravity="start"
android:layout_marginTop="10dp" />
android:layout_marginTop="15dp" />
<Button
android:id="@+id/mergeButton"
@ -144,6 +165,17 @@
android:background="@drawable/shape_buttons"
android:textColor="@color/btnTextColor" />
<TextView
android:id="@+id/mergeInfoDisabledMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/mergeInfoDisabledMessage"
android:textColor="?attr/hintColor"
android:textSize="12sp"
android:gravity="start"
android:visibility="gone"
android:layout_marginTop="10dp" />
</LinearLayout>
</ScrollView>

View File

@ -14,6 +14,30 @@
android:layout_height="wrap_content"
android:visibility="invisible"/>
<TextView
android:id="@+id/prMergeable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"/>
<TextView
android:id="@+id/prHeadBranch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"/>
<TextView
android:id="@+id/prIsFork"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"/>
<TextView
android:id="@+id/prForkFullName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"/>
<ImageView
android:id="@+id/assigneeAvatar"
android:layout_width="48dp"