Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • Commit451/LabCoat
  • Iktwo/GitLabAndroid
  • jonduran3000/GitLabAndroid
  • steffandroid/GitLabAndroid
  • xiaoyanit/GitLabAndroid
  • scottolcott/GitLabAndroid
  • james.mu/GitLabAndroid
  • pushkarpandey27/GitLabAndroid
  • atomfrede/GitLabAndroid
  • burrito82/GitLabAndroid
  • txlong_onz/GitLabAndroid
  • ricardo.longa/GitLabAndroid
  • rubenroy/GitLabAndroid
  • remy_android/GitLabAndroid
  • mzestars/GitLabAndroid
  • theobisproject/LabCoat
  • tarek360/GitLabAndroid
  • TR4Android/LabCoat
  • lvsmart/LabCoat
  • buddybuild/LabCoat
  • tkuah/LabCoat
  • jay3126/LabCoat
  • rmad17/LabCoat
  • galvatron/LabCoat
  • lijianjian13/LabCoat
  • Cody2333/LabCoat
  • ajtfreitas/LabCoat
  • nestor.lobo/LabCoat
  • Microgamer/LabCoat
  • irvinwang/LabCoat
  • avallete/LabCoat
  • digicazter/LabCoat
  • lovexiaov/LabCoat
  • dineshkarpe/LabCoat
  • bak1an/LabCoat
  • loomis/LabCoat
  • sank20/LabCoat
  • Jawnnyfoo/LabCoat
  • scottyab/LabCoat
  • aleksandar-stefanovic/LabCoat
  • tfontana/LabCoat
  • fuzzmz/LabCoat
  • dipaksavaliya/LabCoat
  • adi.bk/LabCoat
  • andreea.voicu/LabCoat
  • H1ghT0p/LabCoat
  • indritqoku/LabCoat
  • armpogart/LabCoat
  • eyedol/LabCoat
  • khairulnizan/LabCoat
  • vadm.perspectiva/LabCoat
  • yiyoss1986/LabCoat
  • BRoy98/LabCoat
  • satyarth.23/LabCoat
  • victorpe76/LabCoat
  • canhnht/LabCoat
  • jinhu/LabCoat
  • weathery/LabCoat
  • gitlabproject_s/LabCoat
  • tfKamran/LabCoat
  • voxadam/LabCoat
  • nprail/LabCoat
  • terrakok/LabCoat
  • jungletian/LabCoat
  • goldins/LabCoat
  • insanum/LabCoat
  • lzrs/LabCoat
  • shankarg/LabCoat
  • rm3l/LabCoat
  • alamo_dev/LabCoat
  • insomniaqc/LabCoat
  • mrasif/LabCoat
  • Babasile/LabCoat
  • eeyoo/LabCoat
  • ditkin/LabCoat
  • unbubot/LabCoat
  • bschuhm/LabCoat
  • fanticker/LabCoat
  • colorwebdesigner/LabCoat
  • milouse/LabCoat
80 results
Show changes
Commits on Source (3)
Loading
Loading
@@ -96,7 +96,7 @@ ext {
retrofitVersion = '2.3.0'
okHttpVersion = '3.9.1'
butterknifeVersion = '8.8.1'
parcelerVersion = '1.1.9'
parcelerVersion = '1.1.10'
reptarVersion = '2.5.1'
adapterLayout = '1.1.2'
materialDialogsVersion = '0.9.6.0'
Loading
Loading
@@ -143,7 +143,7 @@ dependencies {
 
implementation 'org.greenrobot:eventbus:3.1.1'
 
implementation 'io.reactivex.rxjava2:rxjava:2.1.7'
implementation 'io.reactivex.rxjava2:rxjava:2.1.8'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
 
implementation "com.uber.autodispose:autodispose-kotlin:$autodisposeVersion"
Loading
Loading
@@ -169,7 +169,7 @@ dependencies {
implementation 'com.github.Commit451:Gimbal:2.0.2'
implementation 'com.github.Commit451:Teleprinter:2.0.0'
implementation 'com.github.Commit451:Jounce:1.0.2'
implementation 'com.github.Commit451:ForegroundViews:2.4.0'
implementation 'com.github.Commit451:ForegroundViews:2.4.4'
implementation 'com.github.Commit451:MorphTransitions:2.0.0'
implementation "com.github.Commit451:Alakazam:2.0.0"
implementation 'com.github.Commit451:Lift:2.0.1'
Loading
Loading
@@ -195,7 +195,7 @@ dependencies {
 
implementation 'com.github.alorma:diff-textview:1.3.0'
 
implementation 'com.wdullaer:materialdatetimepicker:3.4.0'
implementation 'com.wdullaer:materialdatetimepicker:3.5.0'
 
implementation 'com.github.novoda:simple-chrome-custom-tabs:0.1.5'
 
Loading
Loading
Loading
Loading
@@ -48,6 +48,14 @@ class BranchAdapter(private val ref: Ref?, private val listener: BranchAdapter.L
notifyDataSetChanged()
}
 
fun addEntries(entries: Collection<Branch>) {
if (!entries.isEmpty()) {
val start = values.size
this.values.addAll(entries)
notifyItemRangeChanged(start, this.values.size)
}
}
private fun getEntry(position: Int): Branch {
return values[position]
}
Loading
Loading
Loading
Loading
@@ -277,7 +277,10 @@ interface GitLabService {
/* --- REPOSITORY --- */
 
@GET(API_VERSION + "/projects/{id}/repository/branches?order_by=last_activity_at")
fun getBranches(@Path("id") projectId: Long): Single<List<Branch>>
fun getBranches(@Path("id") projectId: Long): Single<Response<List<Branch>>>
@GET
fun getBranches(@Url url: String): Single<Response<List<Branch>>>
 
@GET(API_VERSION + "/projects/{id}/repository/contributors")
fun getContributors(@Path("id") projectId: String): Single<List<Contributor>>
Loading
Loading
Loading
Loading
@@ -2,6 +2,7 @@ package com.commit451.gitlab.fragment
 
import android.app.Activity
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
Loading
Loading
@@ -20,7 +21,9 @@ import com.commit451.gitlab.adapter.BranchAdapter
import com.commit451.gitlab.extension.with
import com.commit451.gitlab.model.Ref
import com.commit451.gitlab.model.api.Branch
import com.commit451.gitlab.rx.CustomSingleObserver
import com.commit451.gitlab.rx.CustomResponseSingleObserver
import com.commit451.gitlab.util.LinkHeaderParser
import com.commit451.gitlab.util.OnScrollLoadMoreListener
import timber.log.Timber
 
/**
Loading
Loading
@@ -30,8 +33,8 @@ class PickBranchFragment : ButterKnifeFragment() {
 
companion object {
 
private val EXTRA_PROJECT_ID = "project_id"
private val EXTRA_REF = "ref"
private const val EXTRA_PROJECT_ID = "project_id"
private const val EXTRA_REF = "ref"
 
fun newInstance(projectId: Long, ref: Ref?): PickBranchFragment {
val fragment = PickBranchFragment()
Loading
Loading
@@ -43,14 +46,20 @@ class PickBranchFragment : ButterKnifeFragment() {
}
}
 
@BindView(R.id.list) lateinit var listProjects: RecyclerView
@BindView(R.id.message_text) lateinit var textMessage: TextView
@BindView(R.id.progress) lateinit var progress: View
@BindView(R.id.list)
lateinit var listProjects: RecyclerView
@BindView(R.id.message_text)
lateinit var textMessage: TextView
@BindView(R.id.progress)
lateinit var progress: View
 
lateinit var adapterBranches: BranchAdapter
 
var projectId: Long = 0
 
var nextPageUrl: Uri? = null
var loading: Boolean = false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
projectId = arguments?.getLong(EXTRA_PROJECT_ID)!!
Loading
Loading
@@ -73,22 +82,26 @@ class PickBranchFragment : ButterKnifeFragment() {
activity?.finish()
}
})
listProjects.layoutManager = LinearLayoutManager(activity)
val layoutManager = LinearLayoutManager(activity)
listProjects.layoutManager = layoutManager
listProjects.adapter = adapterBranches
listProjects.addOnScrollListener(OnScrollLoadMoreListener(layoutManager, {
!loading && nextPageUrl != null
}, {
loadMore()
}))
 
loadData()
}
 
override fun loadData() {
if (view == null) {
return
}
loading = true
progress.visibility = View.VISIBLE
textMessage.visibility = View.GONE
 
App.get().gitLab.getBranches(projectId)
.with(this)
.subscribe(object : CustomSingleObserver<List<Branch>>() {
.subscribe(object : CustomResponseSingleObserver<List<Branch>>() {
 
override fun error(e: Throwable) {
Timber.e(e)
Loading
Loading
@@ -96,10 +109,31 @@ class PickBranchFragment : ButterKnifeFragment() {
textMessage.visibility = View.VISIBLE
}
 
override fun success(branches: List<Branch>) {
override fun responseNonNullSuccess(branches: List<Branch>) {
loading = false
nextPageUrl = LinkHeaderParser.parse(response()).next
progress.visibility = View.GONE
adapterBranches.setEntries(branches)
}
})
}
fun loadMore() {
loading = true
App.get().gitLab.getBranches(nextPageUrl.toString())
.with(this)
.subscribe(object : CustomResponseSingleObserver<List<Branch>>() {
override fun error(e: Throwable) {
Timber.e(e)
loading = false
}
override fun responseNonNullSuccess(branches: List<Branch>) {
loading = false
nextPageUrl = LinkHeaderParser.parse(response()).next
adapterBranches.addEntries(branches)
}
})
}
}
Loading
Loading
@@ -11,10 +11,10 @@ import timber.log.Timber
*/
object LinkHeaderParser {
 
private val PREV_PAGE_SUFFIX = "rel=\"prev\""
private val NEXT_PAGE_SUFFIX = "rel=\"next\""
private val FIRST_PAGE_SUFFIX = "rel=\"first\""
private val LAST_PAGE_SUFFIX = "rel=\"last\""
private const val PREV_PAGE_SUFFIX = "rel=\"prev\""
private const val NEXT_PAGE_SUFFIX = "rel=\"next\""
private const val FIRST_PAGE_SUFFIX = "rel=\"first\""
private const val LAST_PAGE_SUFFIX = "rel=\"last\""
 
fun parse(response: Response<*>): PaginationData {
var prev: Uri? = null
Loading
Loading
package com.commit451.gitlab.util
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
class OnScrollLoadMoreListener(private val layoutManager: LinearLayoutManager, private val shouldLoadMore: () -> Boolean, private val loadMore: () -> Unit) : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView?, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
val visibleItemCount = layoutManager.childCount
val totalItemCount = layoutManager.itemCount
val firstVisibleItem = layoutManager.findFirstVisibleItemPosition()
if (firstVisibleItem + visibleItemCount >= totalItemCount && shouldLoadMore.invoke()) {
loadMore.invoke()
}
}
}
\ No newline at end of file
Loading
Loading
@@ -108,7 +108,7 @@
<string name="realm_message">A username and password are being requested by the server.\nThe server says: \"%1$s\"</string>
<string name="already_logged_in">This account is already logged in</string>
<string name="access_token_info_title">Personal Access Token</string>
<string name="access_token_info_message">In order to log in to GitLab, you need to create a personal access token for the app to use. This is more secure than inputting your username and password, since those values could be tracked or used maliciously. You can create a personal access token under your profile preferences. Please select "api" as the scope of this token. You can leave "expires at" blank to never have the token expire.</string>
<string name="access_token_info_message">In order to log in to GitLab, you need to create a personal access token for the app to use. This is more secure than inputting your username and password, since those values could be tracked or used maliciously. You can create a personal access token under your settings > Access Tokens. Please select "api" as the scope of this token. You can leave "expires at" blank to never have the token expire.</string>
<string name="create_personal_access_token">Create Personal Access Token</string>
<string name="details">Details</string>
 
Loading
Loading
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'com.commit451.updatewrapper'
buildscript {
ext.kotlinVersion = '1.2.10'
ext.kotlinVersion = '1.2.20'
repositories {
jcenter()
maven { url "https://jitpack.io" }
Loading
Loading