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

Merge branch 'develop'

parents 35eba923 e31b881c
No related branches found
No related tags found
No related merge requests found
Pipeline #
Showing
with 42 additions and 124 deletions
Loading
Loading
@@ -2,8 +2,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.commit451.gitlab.activity.FullscreenImageActivity">
android:layout_height="match_parent">
 
<com.github.chrisbanes.photoview.PhotoView
android:id="@+id/photo_view"
Loading
Loading
Loading
Loading
@@ -21,7 +21,7 @@
android:layout_height="48dp"
android:orientation="horizontal">
 
<com.devspark.robototextview.widget.RobotoTextView
<TextView
android:id="@+id/creator"
android:layout_width="0dp"
android:layout_height="match_parent"
Loading
Loading
Loading
Loading
@@ -37,7 +37,7 @@
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin">
 
<com.devspark.robototextview.widget.RobotoTextView
<TextView
android:id="@+id/commit_author"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Loading
Loading
@@ -45,7 +45,7 @@
android:textSize="14sp"
tools:text="Jawnnypoo" />
 
<com.devspark.robototextview.widget.RobotoTextView
<TextView
android:id="@+id/commit_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Loading
Loading
@@ -54,7 +54,7 @@
</LinearLayout>
</LinearLayout>
 
<com.devspark.robototextview.widget.RobotoTextView
<TextView
android:id="@+id/commit_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Loading
Loading
@@ -62,7 +62,7 @@
android:textSize="16sp"
tools:text="I commited all the code at once cause I am cool. So sorry, the message is so long that..." />
 
<com.devspark.robototextview.widget.RobotoTextView
<TextView
android:id="@+id/commit_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Loading
Loading
Loading
Loading
@@ -43,7 +43,7 @@
android:layout_height="wrap_content"
android:orientation="vertical">
 
<com.devspark.robototextview.widget.RobotoTextView
<TextView
android:id="@+id/profile_user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Loading
Loading
@@ -51,7 +51,7 @@
android:singleLine="true"
android:textColor="@color/white"
android:textSize="14sp"
app:typeface="roboto_medium"
app:fontFamily="@font/roboto_medium"
tools:text="Jawnnypew" />
 
<TextView
Loading
Loading
Loading
Loading
@@ -6,7 +6,7 @@
android:layout_height="wrap_content"
android:orientation="vertical">
 
<com.devspark.robototextview.widget.RobotoTextView
<TextView
android:id="@+id/file_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Loading
Loading
@@ -14,7 +14,7 @@
android:paddingRight="16dp"
android:paddingTop="8dp"
android:textSize="16sp"
app:typeface="roboto_medium"
app:fontFamily="@font/roboto_medium"
tools:text="NewFile.java" />
 
<android.support.v7.widget.CardView
Loading
Loading
Loading
Loading
@@ -30,24 +30,31 @@
android:layout_weight="1"
android:orientation="vertical">
 
<com.devspark.robototextview.widget.RobotoTextView
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textSize="16sp"
app:typeface="roboto_medium"
app:fontFamily="@font/roboto_medium"
tools:text="Project" />
 
<com.devspark.robototextview.widget.RobotoTextView
<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textSize="14sp"
app:typeface="roboto_regular"
tools:text="I like this project because its called a project and it has a really long description that should cut off after a few lines" />
 
<TextView
android:id="@+id/updated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textSize="14sp"
tools:text="2:00 AM 6/14/2017" />
</LinearLayout>
 
</LinearLayout>
\ No newline at end of file
Loading
Loading
@@ -44,7 +44,7 @@
android:layout_weight="1"
android:orientation="vertical">
 
<com.devspark.robototextview.widget.RobotoTextView
<TextView
android:id="@+id/project_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Loading
Loading
@@ -52,10 +52,10 @@
android:ellipsize="end"
android:maxLines="2"
android:textSize="16sp"
app:typeface="roboto_medium"
app:fontFamily="@font/roboto_medium"
tools:text="Project" />
 
<com.devspark.robototextview.widget.RobotoTextView
<TextView
android:id="@+id/project_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Loading
Loading
@@ -63,7 +63,6 @@
android:ellipsize="end"
android:maxLines="2"
android:textSize="14sp"
app:typeface="roboto_regular"
tools:text="I like this project because its called a project and it has a really long description that should cut off after a few lines" />
 
</LinearLayout>
Loading
Loading
Loading
Loading
@@ -16,14 +16,14 @@
android:layout_height="wrap_content"
android:orientation="vertical">
 
<com.devspark.robototextview.widget.RobotoTextView
<TextView
android:id="@+id/text_project"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="4dp"
app:typeface="roboto_condensed_regular"
app:fontFamily="@font/roboto_condensed_regular"
tools:text="Commit451 / LabCoat"/>
 
<LinearLayout
Loading
Loading
Loading
Loading
@@ -72,14 +72,4 @@
<item name="android:foreground">?attr/selectableItemBackground</item>
</style>
 
<style name="FullscreenTheme" parent="AppTheme">
<item name="android:actionBarStyle">@style/FullscreenActionBarStyle</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:windowBackground">@null</item>
</style>
<style name="FullscreenActionBarStyle" parent="Widget.AppCompat.ActionBar">
<item name="android:background">@color/black_overlay</item>
</style>
</resources>
\ No newline at end of file
package com.commit451.gitlab
 
import android.graphics.BitmapFactory
import com.commit451.gitlab.api.GitLab
import com.commit451.gitlab.api.GitLabService
import com.commit451.gitlab.model.api.Project
import com.commit451.gitlab.util.FileUtil
import org.junit.Assert.assertNotNull
import org.junit.BeforeClass
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.annotation.Config
import org.robolectric.shadows.ShadowLog
 
/**
* Tests account login and basic retrieval stuff
*/
@RunWith(RobolectricTestRunner::class)
@Config(constants = BuildConfig::class, sdk = intArrayOf(23))
class ApiTests {
 
companion object {
Loading
Loading
@@ -33,9 +24,6 @@ class ApiTests {
@Throws(Exception::class)
fun setUp() {
//for logging
ShadowLog.stream = System.out
GitLab.init()
 
gitLab = TestUtil.login()
 
Loading
Loading
@@ -83,7 +71,7 @@ class ApiTests {
@Test
@Throws(Exception::class)
fun getIssues() {
val defaultState = RuntimeEnvironment.application.resources.getString(R.string.issue_state_value_default)
val defaultState = "opened"
val issuesResponse = gitLab!!
.getIssues(fakeProject!!.id, defaultState)
.blockingGet()
Loading
Loading
@@ -107,7 +95,7 @@ class ApiTests {
fun getCommits() {
val defaultBranch = "master"
val commitsResponse = gitLab!!
.getCommits(fakeProject!!.id, defaultBranch, 0)
.getCommits(fakeProject!!.id, defaultBranch, 1)
.blockingGet()
assertNotNull(commitsResponse)
}
Loading
Loading
@@ -115,7 +103,7 @@ class ApiTests {
@Test
@Throws(Exception::class)
fun getMergeRequests() {
val defaultState = RuntimeEnvironment.application.resources.getString(R.string.merge_request_state_value_default)
val defaultState = "opened"
val mergeRequestResponse = gitLab!!
.getMergeRequests(fakeProject!!.id, defaultState)
.blockingGet()
Loading
Loading
@@ -132,15 +120,4 @@ class ApiTests {
TestUtil.assertRetrofitResponseSuccess(userFullResponse)
assertNotNull(userFullResponse.body())
}
// @Test
@Throws(Exception::class)
fun uploadFile() {
val bitmap = BitmapFactory.decodeResource(RuntimeEnvironment.application.resources, R.drawable.ic_fork)
val part = FileUtil.toPart(bitmap, "fork.png")
val uploadResponseResponse = gitLab!!.uploadFile(fakeProject!!.id, part)
.blockingGet()
assertNotNull(uploadResponseResponse)
}
}
\ No newline at end of file
package com.commit451.gitlab
import com.bluelinelabs.logansquare.typeconverters.StringBasedTypeConverter
/**
* The worst type converter you will ever see. Only used in testing if Robolectric decides to break
* and not know what a [android.net.Uri] or other class is
*/
class NullTypeConverter : StringBasedTypeConverter<Any>() {
override fun convertToString(`object`: Any): String? {
return null
}
override fun getFromString(string: String): Any? {
return null
}
}
package com.commit451.gitlab
import org.robolectric.TestLifecycleApplication
import java.lang.reflect.Method
/**
* Test version of our Application class, used by Robolectric
*/
class TestApp : App(), TestLifecycleApplication {
override fun beforeTest(method: Method) {
}
override fun prepareTest(test: Any) {
}
override fun afterTest(method: Method) {
}
override fun setupCrashReporting() {
//Intentionally left blank
}
override fun setupLeakCanary() {
//Intentionally left blank
}
override fun setupMultidex() {
//Intentionally left blank
}
}
package com.commit451.gitlab
 
import android.net.Uri
import com.commit451.gitlab.api.GitLabFactory
import com.commit451.gitlab.api.GitLabService
import com.commit451.gitlab.api.OkHttpClientFactory
Loading
Loading
@@ -21,16 +20,16 @@ object TestUtil {
fun login(): GitLabService {
//log in
val account = Account()
account.serverUrl = Uri.parse("https://gitlab.com/")
account.serverUrl = "https://gitlab.com/"
 
val gitlabClientBuilder = OkHttpClientFactory.create(account)
if (BuildConfig.DEBUG) {
gitlabClientBuilder.addInterceptor(HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY))
}
val gitLab = GitLabFactory.create(account, gitlabClientBuilder.build(), true)
val gitLab = GitLabFactory.create(account, gitlabClientBuilder.build())
val request = SessionRequest()
.setLogin("TestAllTheThings")
.setPassword("testing123")
request.login = "TestAllTheThings"
request.password = "testing123"
val loginResponse = gitLab
.login(request)
.blockingGet()
Loading
Loading
art/screenshot-1.png

37.9 KiB | W: 259px | H: 463px

art/screenshot-1.png

39.4 KiB | W: 259px | H: 444px

art/screenshot-1.png
art/screenshot-1.png
art/screenshot-1.png
art/screenshot-1.png
  • 2-up
  • Swipe
  • Onion skin
Loading
Loading
@@ -2,17 +2,17 @@
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'com.commit451.updatewrapper'
buildscript {
ext.kotlinVersion = '1.1.2-3'
ext.kotlinVersion = '1.1.3-2'
repositories {
jcenter()
maven { url "https://jitpack.io" }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.android.tools.build:gradle:3.0.0-alpha8'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
//check with ./gradlew dependencyUpdates
classpath 'com.github.ben-manes:gradle-versions-plugin:0.14.0'
classpath 'com.github.Commit451:updatewrapper:1.1.1'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.15.0'
classpath 'com.github.Commit451:updatewrapper:1.1.2'
}
}
 
Loading
Loading
@@ -20,7 +20,7 @@ allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }
google()
}
}
 
Loading
Loading
No preview for this file type
#Tue Feb 21 19:28:36 CST 2017
#Mon Jul 24 16:08:09 CDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-milestone-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