Skip to content
Snippets Groups Projects
Commit 4cdc3b24 authored by John Carlson's avatar John Carlson
Browse files

Merge branch 'develop'

parents a5b16b56 3187f690
No related branches found
No related tags found
No related merge requests found
Pipeline #
Showing
with 210 additions and 229 deletions
Loading
Loading
@@ -19,9 +19,10 @@ import com.commit451.gitlab.App
import com.commit451.gitlab.R
import com.commit451.gitlab.activity.AttachActivity
import com.commit451.gitlab.adapter.MergeRequestDetailAdapter
import com.commit451.gitlab.adapter.NotesAdapter
import com.commit451.gitlab.api.response.FileUploadResponse
import com.commit451.gitlab.event.MergeRequestChangedEvent
import com.commit451.gitlab.extension.setup
import com.commit451.gitlab.api.response.FileUploadResponse
import com.commit451.gitlab.model.api.MergeRequest
import com.commit451.gitlab.model.api.Note
import com.commit451.gitlab.model.api.Project
Loading
Loading
@@ -63,7 +64,7 @@ class MergeRequestDiscussionFragment : ButterKnifeFragment() {
@BindView(R.id.send_message_view) lateinit var sendMessageView: SendMessageView
@BindView(R.id.progress) lateinit var progress: View
 
lateinit var adapterMergeRequestDetail: MergeRequestDetailAdapter
lateinit var adapterNotes: NotesAdapter
lateinit var layoutManagerNotes: LinearLayoutManager
lateinit var teleprinter: Teleprinter
 
Loading
Loading
@@ -91,17 +92,17 @@ class MergeRequestDiscussionFragment : ButterKnifeFragment() {
}
 
override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater!!.inflate(R.layout.fragment_merge_request_discussion, container, false)
return inflater?.inflate(R.layout.fragment_merge_request_discussion, container, false)
}
 
override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
teleprinter = Teleprinter(activity)
 
adapterMergeRequestDetail = MergeRequestDetailAdapter(activity, mergeRequest, project)
layoutManagerNotes = LinearLayoutManager(activity)
adapterNotes = NotesAdapter(project)
layoutManagerNotes = LinearLayoutManager(activity, LinearLayoutManager.VERTICAL, true)
listNotes.layoutManager = layoutManagerNotes
listNotes.adapter = adapterMergeRequestDetail
listNotes.adapter = adapterNotes
listNotes.addOnScrollListener(onScrollListener)
 
sendMessageView.callback = object : SendMessageView.Callback {
Loading
Loading
@@ -161,13 +162,13 @@ class MergeRequestDiscussionFragment : ButterKnifeFragment() {
swipeRefreshLayout.isRefreshing = false
loading = false
nextPageUrl = LinkHeaderParser.parse(response()).next
adapterMergeRequestDetail.setNotes(notes)
adapterNotes.setNotes(notes)
}
})
}
 
fun loadMoreNotes() {
adapterMergeRequestDetail.setLoading(true)
adapterNotes.setLoading(true)
App.get().gitLab.getMergeRequestNotes(nextPageUrl!!.toString())
.setup(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
.subscribe(object : CustomResponseSingleObserver<List<Note>>() {
Loading
Loading
@@ -175,23 +176,23 @@ class MergeRequestDiscussionFragment : ButterKnifeFragment() {
override fun error(e: Throwable) {
loading = false
Timber.e(e)
adapterMergeRequestDetail.setLoading(false)
adapterNotes.setLoading(false)
Snackbar.make(root, getString(R.string.connection_error), Snackbar.LENGTH_SHORT)
.show()
}
 
override fun responseNonNullSuccess(notes: List<Note>) {
adapterMergeRequestDetail.setLoading(false)
adapterNotes.setLoading(false)
loading = false
nextPageUrl = LinkHeaderParser.parse(response()).next
adapterMergeRequestDetail.addNotes(notes)
adapterNotes.addNotes(notes)
}
})
}
 
fun postNote(message: String) {
 
if (message.isNullOrBlank()) {
if (message.isBlank()) {
return
}
 
Loading
Loading
@@ -202,7 +203,7 @@ class MergeRequestDiscussionFragment : ButterKnifeFragment() {
teleprinter.hideKeyboard()
sendMessageView.clearText()
 
App.get().gitLab.addMergeRequestNote(project.id, mergeRequest.id, message)
App.get().gitLab.addMergeRequestNote(project.id, mergeRequest.iid, message)
.setup(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
.subscribe(object : CustomSingleObserver<Note>() {
 
Loading
Loading
@@ -215,12 +216,13 @@ class MergeRequestDiscussionFragment : ButterKnifeFragment() {
 
override fun success(note: Note) {
progress.visibility = View.GONE
adapterMergeRequestDetail.addNote(note)
adapterNotes.addNote(note)
listNotes.smoothScrollToPosition(MergeRequestDetailAdapter.headerCount)
}
})
}
 
@Suppress("unused")
@Subscribe
fun onMergeRequestChangedEvent(event: MergeRequestChangedEvent) {
if (mergeRequest.id == event.mergeRequest.id) {
Loading
Loading
Loading
Loading
@@ -132,10 +132,6 @@ object Navigator {
activity.startActivity(IssueActivity.newIntent(activity, project, issue))
}
 
fun navigateToIssue(activity: Activity, namespace: String, projectName: String, issueIid: String) {
activity.startActivity(IssueActivity.newIntent(activity, namespace, projectName, issueIid))
}
fun navigateToMergeRequest(activity: Activity, project: Project, mergeRequest: MergeRequest) {
val intent = MergeRequestActivity.newIntent(activity, project, mergeRequest)
activity.startActivity(intent)
Loading
Loading
Loading
Loading
@@ -77,7 +77,7 @@ class CustomTrustManager : X509TrustManager {
 
var keyManagers: Array<KeyManager>? = null
if (privateKeyAlias != null) {
keyManagers = arrayOf<KeyManager>(CustomKeyManager(privateKeyAlias))
keyManagers = arrayOf(CustomKeyManager(privateKeyAlias))
}
 
try {
Loading
Loading
package com.commit451.gitlab.viewHolder
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import butterknife.BindView
import butterknife.ButterKnife
import com.commit451.adapterflowlayout.AdapterFlowLayout
import com.commit451.gitlab.R
import com.commit451.gitlab.adapter.IssueLabelsAdapter
/**
* Shows the labels for an issue
*/
class IssueLabelsViewHolder(view: View) : RecyclerView.ViewHolder(view) {
companion object {
fun inflate(parent: ViewGroup): IssueLabelsViewHolder {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.header_issue_labels, parent, false)
return IssueLabelsViewHolder(view)
}
}
@BindView(R.id.adapter_layout) lateinit var flowLayout: AdapterFlowLayout
var adapterIssueLabels: IssueLabelsAdapter
private val mListener = object : IssueLabelsAdapter.Listener {
override fun onLabelClicked(label: String, viewHolder: IssueLabelViewHolder) {
//TODO anything?
}
}
init {
ButterKnife.bind(this, view)
adapterIssueLabels = IssueLabelsAdapter(mListener)
flowLayout.adapter = adapterIssueLabels
}
fun bind(labels: Collection<String>) {
adapterIssueLabels.setLabels(labels)
}
}
\ No newline at end of file
Loading
Loading
@@ -2,90 +2,50 @@
<android.support.design.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:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent">
 
<LinearLayout
android:id="@+id/app_bar_container"
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="?attr/actionBarSize"
android:orientation="vertical">
android:layout_height="wrap_content">
 
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
android:layout_height="?attr/actionBarSize"/>
 
<TextView
android:id="@+id/toolbar_title"
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="8dp"
tools:text="Issue title" />
<TextView
android:id="@+id/toolbar_subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="subtitle" />
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabMode="fixed"/>
 
</LinearLayout>
</android.support.v7.widget.Toolbar>
<TextView
android:id="@+id/issue_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:drawablePadding="8dp"
android:layout_marginRight="56dp"
tools:text="This is an issue"/>
</android.support.design.widget.AppBarLayout>
 
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
 
<com.commit451.gitlab.view.LabCoatSwipeRefreshLayout
android:id="@+id/swipe_layout"
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="match_parent"/>
 
<android.support.v7.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<include layout="@layout/progress_fullscreen"/>
 
</com.commit451.gitlab.view.LabCoatSwipeRefreshLayout>
</LinearLayout>
<com.commit451.gitlab.view.SendMessageView
android:id="@+id/send_message_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"/>
</FrameLayout>
 
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_edit_issue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
app:srcCompat="@drawable/ic_edit_24dp"
app:fabSize="mini"
app:layout_anchor="@id/appbar"
app:layout_anchorGravity="bottom|right|end"/>
<include layout="@layout/progress_fullscreen"/>
app:layout_anchorGravity="bottom|right|end"
app:srcCompat="@drawable/ic_edit_24dp"/>
 
</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file
Loading
Loading
@@ -38,7 +38,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/url_hint"
android:inputType="textUri"/>
android:importantForAutofill="no"
android:inputType="textUri" />
 
</android.support.design.widget.TextInputLayout>
 
Loading
Loading
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
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:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="8dp"
android:orientation="vertical">
<TextView
android:id="@+id/text_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="Description"
android:textAppearance="?android:attr/textAppearanceMedium" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="8dp">
<ImageView
android:id="@+id/author_image"
android:layout_width="@dimen/image_size"
android:layout_height="@dimen/image_size"
android:contentDescription="@null"/>
<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/padding_normal"
android:layout_marginRight="@dimen/padding_normal"
android:layout_gravity="center_vertical"
tools:text="Jawnnypoo created issue 8 hours ago"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="@+id/milestone_root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_milestone_24dp"
android:contentDescription="@null"/>
<TextView
android:id="@+id/milestone_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/padding_normal"
android:layout_marginRight="@dimen/padding_normal"
android:layout_gravity="center_vertical"
tools:text="2.0.0"/>
</LinearLayout>
<com.commit451.adapterflowlayout.AdapterFlowLayout
android:id="@+id/list_labels"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
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:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="8dp"
android:orientation="vertical">
<TextView
android:id="@+id/text_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="Description"
android:textAppearance="?android:attr/textAppearanceMedium" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="8dp">
<ImageView
android:id="@+id/author_image"
android:layout_width="@dimen/image_size"
android:layout_height="@dimen/image_size"
android:contentDescription="@null"/>
<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/padding_normal"
android:layout_marginRight="@dimen/padding_normal"
android:layout_gravity="center_vertical"
tools:text="Jawnnypoo created issue 8 hours ago"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_height="match_parent">
 
<com.commit451.gitlab.view.LabCoatSwipeRefreshLayout
android:id="@+id/swipe_layout"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
android:layout_height="match_parent"
android:orientation="vertical">
 
<android.support.v7.widget.RecyclerView
android:id="@+id/list"
<com.commit451.gitlab.view.LabCoatSwipeRefreshLayout
android:id="@+id/swipe_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="0dp"
android:layout_weight="1">
 
</com.commit451.gitlab.view.LabCoatSwipeRefreshLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
 
<com.commit451.gitlab.view.SendMessageView
android:id="@+id/send_message_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"/>
</com.commit451.gitlab.view.LabCoatSwipeRefreshLayout>
<com.commit451.gitlab.view.SendMessageView
android:id="@+id/send_message_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"/>
</LinearLayout>
 
<include layout="@layout/progress_fullscreen" />
 
</LinearLayout>
\ No newline at end of file
</FrameLayout>
\ No newline at end of file
<?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:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
tools:text="Description"
android:textAppearance="?android:attr/textAppearanceMedium" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_margin="16dp">
<ImageView
android:id="@+id/author_image"
android:layout_width="@dimen/image_size"
android:layout_height="@dimen/image_size"
android:contentDescription="@null"/>
<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/padding_normal"
android:layout_marginRight="@dimen/padding_normal"
android:layout_gravity="center_vertical"
tools:text="Jawnnypoo created issue 8 hours ago"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="@+id/milestone_root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_milestone_24dp"
android:contentDescription="@null"/>
<TextView
android:id="@+id/milestone_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/padding_normal"
android:layout_marginRight="@dimen/padding_normal"
android:layout_gravity="center_vertical"
tools:text="2.0.0"/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<com.commit451.adapterflowlayout.AdapterFlowLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/adapter_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"/>
\ No newline at end of file
Loading
Loading
@@ -190,6 +190,12 @@
<string name="root">ROOT</string>
 
<!-- Issues -->
<string name="issue_tab_discussion">Discussion</string>
<string name="issue_tab_details">Details</string>
<string-array name="issue_tabs">
<item>@string/issue_tab_details</item>
<item>@string/issue_tab_discussion</item>
</string-array>
<string name="new_note_hint">Add comment</string>
<string name="add_issue">Add new issue</string>
<string name="add_issue_dialog_title">New issue</string>
Loading
Loading
@@ -303,7 +309,9 @@
<!-- Merge Requests -->
<string name="title_merge_discussion">discussion</string>
<string name="title_merge_commits">Commits</string>
<string name="title_merge_details">Details</string>
<string-array name="merge_request_tabs">
<item>@string/title_merge_details</item>
<item>@string/title_merge_discussion</item>
<item>@string/title_merge_commits</item>
</string-array>
Loading
Loading
Loading
Loading
@@ -2,14 +2,14 @@
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'com.commit451.updatewrapper'
buildscript {
ext.kotlinVersion = '1.1.4-2'
ext.kotlinVersion = '1.1.4-3'
repositories {
jcenter()
maven { url "https://jitpack.io" }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta2'
classpath 'com.android.tools.build:gradle:3.0.0-beta4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'com.github.ben-manes:gradle-versions-plugin:0.15.0'
classpath 'com.github.Commit451:updatewrapper:1.1.2'
Loading
Loading
Loading
Loading
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment