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

Update to latest Reptar

parent 41ff8f77
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -4,7 +4,7 @@ buildscript {
}
 
dependencies {
classpath 'io.fabric.tools:gradle:1.22.2'
classpath 'io.fabric.tools:gradle:1.23.0'
}
}
 
Loading
Loading
@@ -89,14 +89,14 @@ android {
}
 
ext {
supportLibVersion = '25.3.1'
supportLibVersion = '25.4.0'
retrofitVersion = '2.3.0'
okHttpVersion = '3.8.0'
okHttpVersion = '3.8.1'
butterknifeVersion = '8.6.0'
loganSquareVersion = '1.3.7'
parcelerVersion = '1.1.8'
reptarVersion = '2.4.1'
adapterLayout = '1.1.0'
parcelerVersion = '1.1.9'
reptarVersion = '2.5.0'
adapterLayout = '1.1.1'
materialDialogsVersion = '0.9.4.5'
leakCanaryVersion = '1.5'
}
Loading
Loading
@@ -141,7 +141,7 @@ dependencies {
 
compile 'org.greenrobot:eventbus:3.0.0'
 
compile 'io.reactivex.rxjava2:rxjava:2.1.0'
compile 'io.reactivex.rxjava2:rxjava:2.1.1'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
 
compile 'com.trello.rxlifecycle2:rxlifecycle-components:2.1.0'
Loading
Loading
@@ -169,7 +169,7 @@ dependencies {
compile 'com.github.Commit451:Teleprinter:1.0.2'
compile 'com.github.Commit451:BypassPicassoImageGetter:1.1.1'
compile 'com.github.Commit451:Jounce:1.0.2'
compile 'com.github.Commit451:ForegroundViews:2.3.1'
compile 'com.github.Commit451:ForegroundViews:2.4.0'
compile 'com.github.Commit451:MorphTransitions:2.0.0'
compile 'com.github.Commit451.Alakazam:alakazam:1.0.1'
compile 'com.github.Commit451:Lift:1.2.0'
Loading
Loading
@@ -178,7 +178,7 @@ dependencies {
compile 'com.github.Commit451:RetrofitProguardRules:2.2.0.0'
compile 'com.github.Commit451:LoganSquareProGuardRules:1.3.7.0'
compile 'com.github.Commit451:EventBusProGuardRules:3.0.0.0'
compile 'com.github.chrisbanes:PhotoView:2.0.0'
compile 'com.github.chrisbanes:PhotoView:2.1.2'
 
compile 'me.zhanghai.android.materialprogressbar:library:1.4.1'
 
Loading
Loading
Loading
Loading
@@ -26,7 +26,8 @@ import com.commit451.gitlab.rx.CustomSingleObserver
import com.commit451.gitlab.util.BypassFactory
import com.commit451.gitlab.util.BypassImageGetterFactory
import com.commit451.gitlab.util.InternalLinkMovementMethod
import com.commit451.reptar.Result
import com.commit451.reptar.Optional
import com.trello.rxlifecycle2.android.FragmentEvent
import com.vdurmont.emoji.EmojiParser
import io.reactivex.Single
Loading
Loading
@@ -176,24 +177,24 @@ class ProjectFragment : ButterKnifeFragment() {
 
val result = ReadmeResult()
App.get().gitLab.getTree(project!!.id, branchName!!, null)
.flatMap(Function<List<RepositoryTreeObject>, SingleSource<Result<RepositoryTreeObject>>> { repositoryTreeObjects ->
.flatMap(Function<List<RepositoryTreeObject>, SingleSource<Optional<RepositoryTreeObject>>> { repositoryTreeObjects ->
for (treeItem in repositoryTreeObjects) {
if (getReadmeType(treeItem.name) != README_TYPE_UNKNOWN) {
return@Function Single.just(Result(treeItem))
return@Function Single.just(Optional(treeItem))
}
}
Single.just(Result.empty<RepositoryTreeObject>())
Single.just(Optional.empty())
})
.flatMap(Function<Result<RepositoryTreeObject>, SingleSource<Result<RepositoryFile>>> { repositoryTreeObjectResult ->
.flatMap(Function<Optional<RepositoryTreeObject>, SingleSource<Optional<RepositoryFile>>> { repositoryTreeObjectResult ->
if (repositoryTreeObjectResult.isPresent) {
val repositoryFile = App.get().gitLab.getFile(project!!.id, repositoryTreeObjectResult.get().name, branchName!!)
.blockingGet()
result.repositoryFile = repositoryFile
return@Function Single.just(Result(repositoryFile))
return@Function Single.just(Optional(repositoryFile))
}
Single.just(Result.empty<RepositoryFile>())
Single.just(Optional.empty<RepositoryFile>())
})
.flatMap(Function<Result<RepositoryFile>, SingleSource<ReadmeResult>> { repositoryFileResult ->
.flatMap(Function<Optional<RepositoryFile>, SingleSource<ReadmeResult>> { repositoryFileResult ->
if (repositoryFileResult.isPresent) {
result.bytes = repositoryFileResult.get().content.base64Decode()
.blockingGet()
Loading
Loading
@@ -283,7 +284,7 @@ class ProjectFragment : ButterKnifeFragment() {
}
 
class ReadmeResult {
internal var bytes: ByteArray? = null
internal var repositoryFile: RepositoryFile? = null
var bytes: ByteArray? = null
var repositoryFile: RepositoryFile? = null
}
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlinVersion = '1.1.2-5'
ext.kotlinVersion = '1.1.3-2'
repositories {
jcenter()
}
Loading
Loading
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