Unverified Commit 5c48e686 authored by Ilya Gulya's avatar Ilya Gulya

Merge branch 'task/extend-markdown-support_milestone-displaying' into...

Merge branch 'task/extend-markdown-support_milestone-displaying' into task/extend-markdown-support_markdown-clicks

# Conflicts:
#	app/src/main/java/ru/terrakok/gitlabclient/presentation/markdown/MarkdownPresenter.kt
#	app/src/main/java/ru/terrakok/gitlabclient/toothpick/provider/MarkDownConverterProvider.kt
#	app/src/main/java/ru/terrakok/gitlabclient/ui/global/markdown/MarkdownTextView.kt
#	markwonx/src/main/java/ru/terrakok/gitlabclient/markwonx/label/LabelVisitor.kt
#	markwonx/src/main/java/ru/terrakok/gitlabclient/markwonx/milestone/MilestoneVisitor.kt
parents 9745bcf2 41e140d0
plugins {
id("com.android.application")
id("io.fabric")
id("org.jetbrains.kotlin.android.extensions")
kotlin("android")
kotlin("kapt")
id("org.jetbrains.kotlin.android.extensions")
}
val buildUid = System.getenv("BUILD_COMMIT_SHA") ?: "local"
......@@ -16,8 +16,8 @@ android {
minSdkVersion(19)
targetSdkVersion(28)
versionName = "1.3.2"
versionCode = 11
versionName = "1.4.2"
versionCode = 14
buildToolsVersion = "28.0.3"
......@@ -49,14 +49,6 @@ android {
buildConfigField("String", "OAUTH_CALLBACK", "\"app://gitlab.client/\"")
multiDexEnabled = true
javaCompileOptions {
annotationProcessorOptions {
arguments = mapOf(
"toothpick_registry_package_name" to "ru.terrakok.gitlabclient"
)
}
}
}
signingConfigs {
......@@ -71,13 +63,13 @@ android {
buildTypes {
create("debugPG") {
isDebuggable = true
initWith(getByName("debug"))
isMinifyEnabled = true
versionNameSuffix = " debugPG"
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
file("config/proguard/proguard-rules.txt")
file("proguard-rules.pro")
)
}
getByName("release") {
......@@ -86,7 +78,7 @@ android {
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
file("config/proguard/proguard-rules.txt")
file("proguard-rules.pro")
)
}
}
......@@ -94,27 +86,27 @@ android {
}
dependencies {
val supportLibraryVersion = "28.0.0"
val moxyVersion = "1.4.6"
val toothpickVersion = "1.0.6"
val moxyVersion = "1.7.0"
val toothpickVersion = "2.1.0"
val retrofitVersion = "2.2.0"
val markwonVersion = extra["markwonVersion"] as String
val glideVersion = "4.8.0"
//Support
implementation("com.android.support:appcompat-v7:$supportLibraryVersion")
implementation("com.android.support:design:$supportLibraryVersion")
implementation("com.android.support:cardview-v7:$supportLibraryVersion")
implementation("com.android.support.constraint:constraint-layout:1.1.3")
implementation("androidx.appcompat:appcompat:1.0.2")
implementation("com.google.android.material:material:1.1.0-alpha06")
implementation("androidx.cardview:cardview:1.0.0")
implementation("androidx.constraintlayout:constraintlayout:1.1.3")
//Kotlin
implementation("org.jetbrains.kotlin:kotlin-stdlib:${extra["kotlinVersion"] as String}")
//Log
implementation("com.jakewharton.timber:timber:4.7.0")
//MVP Moxy
kapt("com.arello-mobile:moxy-compiler:$moxyVersion")
implementation("com.arello-mobile:moxy-app-compat:$moxyVersion")
kapt("tech.schoolhelper:moxy-x-compiler:$moxyVersion")
implementation("tech.schoolhelper:moxy-x:$moxyVersion")
implementation("tech.schoolhelper:moxy-x-androidx:$moxyVersion")
//Cicerone Navigation
implementation("ru.terrakok.cicerone:cicerone:4.0.2")
implementation("ru.terrakok.cicerone:cicerone:5.0.0")
//DI
implementation("com.github.stephanenicolas.toothpick:toothpick-runtime:$toothpickVersion")
kapt("com.github.stephanenicolas.toothpick:toothpick-compiler:$toothpickVersion")
......@@ -126,17 +118,15 @@ dependencies {
implementation("com.squareup.okhttp3:logging-interceptor:3.11.0")
implementation("com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion")
//RxJava
implementation("io.reactivex.rxjava2:rxandroid:2.1.0")
implementation("io.reactivex.rxjava2:rxjava:2.2.3")
implementation("io.reactivex.rxjava2:rxandroid:2.1.1")
implementation("io.reactivex.rxjava2:rxjava:2.2.6")
implementation("com.jakewharton.rxrelay2:rxrelay:2.1.0")
//Adapter simplify
implementation("com.hannesdorfmann:adapterdelegates3:3.1.0")
implementation("com.hannesdorfmann:adapterdelegates4:4.0.0")
//Image load and cache
implementation("com.github.bumptech.glide:glide:$glideVersion")
kapt("com.github.bumptech.glide:compiler:$glideVersion")
implementation("com.github.bumptech.glide:okhttp3-integration:4.6.1") {
exclude(group = "glide-parent")
}
implementation("com.github.bumptech.glide:okhttp3-integration:$glideVersion")
//Markdown to HTML converter
implementation("ru.noties:markwon:$markwonVersion")
implementation("ru.noties:markwon-image-loader:$markwonVersion")
......@@ -149,9 +139,9 @@ dependencies {
//FlexBox Layout
implementation("com.google.android:flexbox:1.0.0")
//Firebase
implementation("com.google.firebase:firebase-core:16.0.5")
implementation("com.google.firebase:firebase-core:16.0.9")
//Crashlytics
implementation("com.crashlytics.sdk.android:crashlytics:2.9.6")
implementation("com.crashlytics.sdk.android:crashlytics:2.10.0")
//Custom GitLab markdown parsing tools
implementation(project(":markwonx"))
......
{
"project_info": {
"project_number": "0",
"firebase_url": "debug",
"project_id": "gitfox-gitlab-client",
"storage_bucket": "debug"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:0:android:0",
"android_client_info": {
"package_name": "com.gitlab.terrakok.gitfox"
}
},
"oauth_client": [
{
"client_id": "debug",
"client_type": 3
}
],
"api_key": [
{
"current_key": "debug"
},
{
"current_key": "debug"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
......@@ -16,6 +16,7 @@
<activity
android:name=".ui.AppActivity"
android:launchMode="singleInstance"
android:theme="@style/AppTheme.Splash"
android:windowSoftInputMode="adjustResize">
<intent-filter>
......
Copyright (c) 2006, Ivan Sagalaev
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of highlight.js nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This diff is collapsed.
!function(e){"use strict";function t(){"complete"===document.readyState?n():e.addEventListener("DOMContentLoaded",n)}function n(){try{var e=document.querySelectorAll("code.hljs");for(var t in e)e.hasOwnProperty(t)&&r(e[t])}catch(n){console.error("LineNumbers error: ",n)}}function r(e){if("object"==typeof e){var t=e.parentNode,n=o(t.textContent);if(n>1){for(var r="",c=0;n>c;c++)r+=c+1+"\n";var l=document.createElement("code");l.className="hljs hljs-line-numbers",l.style["float"]="left",l.textContent=r,t.insertBefore(l,e)}}}function o(e){if(0===e.length)return 0;var t=/\r\n|\r|\n/g,n=e.match(t);return n=n?n.length:0,e[e.length-1].match(t)||(n+=1),n}"undefined"==typeof e.hljs?console.error("highlight.js not detected!"):(e.hljs.initLineNumbersOnLoad=t,e.hljs.lineNumbersBlock=r)}(window);
\ No newline at end of file
/*
Darcula color scheme from the JetBrains family of IDEs
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #2b2b2b;
}
.hljs {
color: #bababa;
}
.hljs-strong,
.hljs-emphasis {
color: #a8a8a2;
}
.hljs-bullet,
.hljs-quote,
.hljs-link,
.hljs-number,
.hljs-regexp,
.hljs-literal {
color: #6896ba;
}
.hljs-code,
.hljs-selector-class {
color: #a6e22e;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-section,
.hljs-attribute,
.hljs-name,
.hljs-variable {
color: #cb7832;
}
.hljs-params {
color: #b9b9b9;
}
.hljs-string {
color: #6a8759;
}
.hljs-subst,
.hljs-type,
.hljs-built_in,
.hljs-builtin-name,
.hljs-symbol,
.hljs-selector-id,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-template-tag,
.hljs-template-variable,
.hljs-addition {
color: #e0c46c;
}
.hljs-comment,
.hljs-deletion,
.hljs-meta {
color: #7f7f7f;
}
/*
Original highlight.js style (c) Ivan Sagalaev <maniac@softwaremaniacs.org>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #F0F0F0;
}
/* Base color: saturation 0; */
.hljs,
.hljs-subst {
color: #444;
}
.hljs-comment {
color: #888888;
}
.hljs-keyword,
.hljs-attribute,
.hljs-selector-tag,
.hljs-meta-keyword,
.hljs-doctag,
.hljs-name {
font-weight: bold;
}
/* User color: hue: 0 */
.hljs-type,
.hljs-string,
.hljs-number,
.hljs-selector-id,
.hljs-selector-class,
.hljs-quote,
.hljs-template-tag,
.hljs-deletion {
color: #880000;
}
.hljs-title,
.hljs-section {
color: #880000;
font-weight: bold;
}
.hljs-regexp,
.hljs-symbol,
.hljs-variable,
.hljs-template-variable,
.hljs-link,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #BC6060;
}
/* Language color: hue: 90; */
.hljs-literal {
color: #78A960;
}
.hljs-built_in,
.hljs-bullet,
.hljs-code,
.hljs-addition {
color: #397300;
}
/* Meta color: hue: 200 */
.hljs-meta {
color: #1f7199;
}
.hljs-meta-string {
color: #4d99bf;
}
/* Misc effects */
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
......@@ -7,14 +7,11 @@ import com.jakewharton.threetenabp.AndroidThreeTen
import io.fabric.sdk.android.Fabric
import ru.noties.markwon.SpannableConfiguration
import ru.noties.markwon.spans.SpannableTheme
import ru.terrakok.gitlabclient.toothpick.DI
import ru.terrakok.gitlabclient.toothpick.module.AppModule
import ru.terrakok.gitlabclient.di.DI
import ru.terrakok.gitlabclient.di.module.AppModule
import timber.log.Timber
import toothpick.Toothpick
import toothpick.configuration.Configuration
import toothpick.registries.FactoryRegistryLocator
import toothpick.registries.MemberInjectorRegistryLocator
import java.util.*
/**
* @author Konstantin Tskhovrebov (aka terrakok) on 26.03.17.
......@@ -23,7 +20,6 @@ class App : Application() {
override fun onCreate() {
super.onCreate()
appCode = UUID.randomUUID().toString()
initLogger()
initFabric()
......@@ -53,9 +49,7 @@ class App : Application() {
if (BuildConfig.DEBUG) {
Toothpick.setConfiguration(Configuration.forDevelopment().preventMultipleRootScopes())
} else {
Toothpick.setConfiguration(Configuration.forProduction().disableReflection())
FactoryRegistryLocator.setRootRegistry(ru.terrakok.gitlabclient.FactoryRegistry())
MemberInjectorRegistryLocator.setRootRegistry(ru.terrakok.gitlabclient.MemberInjectorRegistry())
Toothpick.setConfiguration(Configuration.forProduction())
}
}
......@@ -77,9 +71,4 @@ class App : Application() {
private fun initThreetenABP() {
AndroidThreeTen.init(this)
}
companion object {
lateinit var appCode: String
private set
}
}
\ No newline at end of file
......@@ -6,16 +6,19 @@ import android.net.Uri
import ru.terrakok.cicerone.android.support.SupportAppScreen
import ru.terrakok.gitlabclient.entity.issue.IssueState
import ru.terrakok.gitlabclient.entity.mergerequest.MergeRequestState
import ru.terrakok.gitlabclient.entity.milestone.MilestoneState
import ru.terrakok.gitlabclient.ui.about.AboutFragment
import ru.terrakok.gitlabclient.ui.auth.AuthFlowFragment
import ru.terrakok.gitlabclient.ui.auth.AuthFragment
import ru.terrakok.gitlabclient.ui.drawer.DrawerFlowFragment
import ru.terrakok.gitlabclient.ui.file.ProjectFileFragment
import ru.terrakok.gitlabclient.ui.global.StubFragment
import ru.terrakok.gitlabclient.ui.issue.IssueFlowFragment
import ru.terrakok.gitlabclient.ui.issue.IssueFragment
import ru.terrakok.gitlabclient.ui.issue.IssueInfoFragment
import ru.terrakok.gitlabclient.ui.issue.IssueNotesFragment
import ru.terrakok.gitlabclient.ui.issue.MainIssueFragment
import ru.terrakok.gitlabclient.ui.libraries.LibrariesFragment
import ru.terrakok.gitlabclient.ui.main.MainFlowFragment
import ru.terrakok.gitlabclient.ui.main.MainFragment
import ru.terrakok.gitlabclient.ui.mergerequest.*
import ru.terrakok.gitlabclient.ui.my.activity.MyEventsFragment
import ru.terrakok.gitlabclient.ui.my.issues.MyIssuesContainerFragment
......@@ -25,15 +28,19 @@ import ru.terrakok.gitlabclient.ui.my.mergerequests.MyMergeRequestsFragment
import ru.terrakok.gitlabclient.ui.my.todos.MyTodosContainerFragment
import ru.terrakok.gitlabclient.ui.my.todos.MyTodosFragment
import ru.terrakok.gitlabclient.ui.privacypolicy.PrivacyPolicyFragment
import ru.terrakok.gitlabclient.ui.project.MainProjectFragment
import ru.terrakok.gitlabclient.ui.project.ProjectFlowFragment
import ru.terrakok.gitlabclient.ui.project.ProjectFragment
import ru.terrakok.gitlabclient.ui.project.files.ProjectFilesFragment
import ru.terrakok.gitlabclient.ui.project.info.ProjectEventsFragment
import ru.terrakok.gitlabclient.ui.project.info.ProjectInfoContainerFragment
import ru.terrakok.gitlabclient.ui.project.info.ProjectInfoFragment
import ru.terrakok.gitlabclient.ui.project.issues.ProjectIssuesContainerFragment
import ru.terrakok.gitlabclient.ui.project.issues.ProjectIssuesFragment
import ru.terrakok.gitlabclient.ui.project.labels.ProjectLabelsFragment
import ru.terrakok.gitlabclient.ui.project.mergerequest.ProjectMergeRequestsContainerFragment
import ru.terrakok.gitlabclient.ui.project.mergerequest.ProjectMergeRequestsFragment
import ru.terrakok.gitlabclient.ui.project.milestones.ProjectMilestonesContainerFragment
import ru.terrakok.gitlabclient.ui.project.milestones.ProjectMilestonesFragment
import ru.terrakok.gitlabclient.ui.projects.ProjectsContainerFragment
import ru.terrakok.gitlabclient.ui.projects.ProjectsListFragment
import ru.terrakok.gitlabclient.ui.user.UserFlowFragment
......@@ -43,12 +50,45 @@ import ru.terrakok.gitlabclient.ui.user.info.UserInfoFragment
* @author Konstantin Tskhovrebov (aka terrakok) on 26.03.17.
*/
object Screens {
//flows
object AuthFlow : SupportAppScreen() {
override fun getFragment() = AuthFlowFragment()
}
object DrawerFlow : SupportAppScreen() {
override fun getFragment() = DrawerFlowFragment()
}
object MainFlow : SupportAppScreen() {
override fun getFragment() = MainFlowFragment()
data class ProjectFlow(
val projectId: Long
) : SupportAppScreen() {
override fun getFragment() = ProjectFlowFragment.create(projectId)
}
data class UserFlow(
val userId: Long
) : SupportAppScreen() {
override fun getFragment() = UserFlowFragment.create(userId)
}
data class IssueFlow(
val projectId: Long,
val issueId: Long
) : SupportAppScreen() {
override fun getFragment() = IssueFlowFragment.create(projectId, issueId)
}
data class MergeRequestFlow(
val projectId: Long,
val mrId: Long
) : SupportAppScreen() {
override fun getFragment() = MergeRequestFlowFragment.create(projectId, mrId)
}
//screens
object Main : SupportAppScreen() {
override fun getFragment() = MainFragment()
}
object MyEvents : SupportAppScreen() {
......@@ -105,22 +145,12 @@ object Screens {
override fun getFragment() = LibrariesFragment()
}
object AuthFlow : SupportAppScreen() {
override fun getFragment() = AuthFlowFragment()
}
object Auth : SupportAppScreen() {
override fun getFragment() = AuthFragment()
}
data class ProjectFlow(
val projectId: Long
) : SupportAppScreen() {
override fun getFragment() = ProjectFlowFragment.create(projectId)
}
object ProjectMainFlow : SupportAppScreen() {
override fun getFragment() = ProjectFragment()
object MainProject : SupportAppScreen() {
override fun getFragment() = MainProjectFragment()
}
object ProjectInfoContainer : SupportAppScreen() {
......@@ -155,25 +185,30 @@ object Screens {
override fun getFragment() = ProjectMergeRequestsFragment.create(mrState)
}
data class UserFlow(
val userId: Long
) : SupportAppScreen() {
override fun getFragment() = UserFlowFragment.create(userId)
object ProjectLabels : SupportAppScreen() {
override fun getFragment() = ProjectLabelsFragment()
}
object UserInfo : SupportAppScreen() {
override fun getFragment() = UserInfoFragment()
object ProjectMilestonesContainer : SupportAppScreen() {
override fun getFragment() = ProjectMilestonesContainerFragment()
}
data class MergeRequestFlow(
val projectId: Long,
val mrId: Long
data class ProjectMilestones(
val milestoneState: MilestoneState
) : SupportAppScreen() {
override fun getFragment() = MergeRequestFlowFragment.create(projectId, mrId)
override fun getFragment() = ProjectMilestonesFragment.create(milestoneState)
}
object ProjectFiles : SupportAppScreen() {
override fun getFragment() = ProjectFilesFragment()
}