Skip to content
Snippets Groups Projects
Commit a32b4734 authored by Jawnnypoo's avatar Jawnnypoo
Browse files

Some Uris were hiding from me

parent a547c5d7
No related branches found
No related tags found
No related merge requests found
Pipeline #
Loading
Loading
@@ -104,6 +104,7 @@ ext {
leakCanaryVersion = '1.5'
addendumVersion = '1.3.1'
alakazamVersion = '1.0.1'
moshiVersion = '1.5.0'
}
 
dependencies {
Loading
Loading
@@ -134,7 +135,8 @@ dependencies {
implementation "com.squareup.okhttp3:okhttp:$okHttpVersion"
implementation "com.squareup.okhttp3:logging-interceptor:$okHttpVersion"
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.squareup.moshi:moshi:1.5.0'
implementation "com.squareup.moshi:moshi:$moshiVersion"
implementation "com.squareup.moshi:moshi-adapters:$moshiVersion"
 
implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
implementation "com.jakewharton:butterknife:$butterknifeVersion"
Loading
Loading
Loading
Loading
@@ -5,6 +5,7 @@ import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentPagerAdapter
import com.commit451.gitlab.R
import com.commit451.gitlab.activity.ProjectActivity
import com.commit451.gitlab.extension.getFeedUrl
import com.commit451.gitlab.fragment.*
import com.commit451.gitlab.model.api.Project
import timber.log.Timber
Loading
Loading
@@ -73,7 +74,7 @@ class ProjectSectionsPagerAdapter(context: ProjectActivity, fm: FragmentManager)
 
when (correctPosition) {
PROJECT_POS -> return ProjectFragment.newInstance()
ACTIVITY_POS -> return FeedFragment.newInstance(project.feedUrl)
ACTIVITY_POS -> return FeedFragment.newInstance(project.getFeedUrl())
FILES_POS -> return FilesFragment.newInstance()
COMMITS_POS -> return CommitsFragment.newInstance()
PIPELINES_POS -> return PipelinesFragment.newInstance()
Loading
Loading
Loading
Loading
@@ -2,12 +2,15 @@ package com.commit451.gitlab.api
 
import com.commit451.gitlab.api.converter.DashDateAdapter
import com.squareup.moshi.Moshi
import com.squareup.moshi.Rfc3339DateJsonAdapter
import java.util.*
 
object MoshiProvider {
 
val moshi: Moshi by lazy {
Moshi.Builder()
.add(DashDateAdapter())
.add(Date::class.java, Rfc3339DateJsonAdapter())
.build()
}
}
\ No newline at end of file
package com.commit451.gitlab.extension
import com.commit451.gitlab.model.api.Project
import android.net.Uri
/**
* Created by johncarlson on 7/28/17.
*/
fun Project.getFeedUrl(): Uri? {
if (webUrl == null) {
return null
}
return Uri.parse(webUrl + ".atom")
}
\ No newline at end of file
package com.commit451.gitlab.model.api;
 
import android.net.Uri;
import android.support.annotation.Nullable;
import com.squareup.moshi.Json;
 
import org.parceler.Parcel;
Loading
Loading
@@ -189,14 +186,6 @@ public class Project {
return openIssuesCount;
}
 
@Nullable
public Uri getFeedUrl() {
if (webUrl == null) {
return null;
}
return Uri.parse(webUrl + ".atom");
}
public boolean belongsToGroup() {
//If there is an owner, then there is no group
return getOwner() == null;
Loading
Loading
package com.commit451.gitlab.model.api;
 
import android.net.Uri;
import com.squareup.moshi.Json;
 
import org.parceler.Parcel;
Loading
Loading
@@ -86,12 +84,12 @@ public class ProjectNamespace {
@Parcel
public static class Avatar {
@Json(name = "url")
Uri url;
String url;
 
public Avatar() {
}
 
public Uri getUrl() {
public String getUrl() {
return url;
}
}
Loading
Loading
Loading
Loading
@@ -15,6 +15,7 @@ import com.commit451.addendum.parceler.getParcelerParcelableExtra
import com.commit451.gitlab.R
import com.commit451.gitlab.activity.BaseActivity
import com.commit451.gitlab.data.Prefs
import com.commit451.gitlab.extension.getFeedUrl
import com.commit451.gitlab.model.Account
import com.commit451.gitlab.model.api.Project
import timber.log.Timber
Loading
Loading
@@ -105,7 +106,7 @@ class ProjectFeedWidgetConfigureActivity : BaseActivity() {
 
fun saveWidgetConfig(account: Account, project: Project) {
ProjectFeedWidgetPrefs.setAccount(this, appWidgetId, account)
ProjectFeedWidgetPrefs.setFeedUrl(this, appWidgetId, project.feedUrl!!.toString())
ProjectFeedWidgetPrefs.setFeedUrl(this, appWidgetId, project.getFeedUrl()!!.toString())
 
val resultValue = Intent()
resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId)
Loading
Loading
Loading
Loading
@@ -28,8 +28,8 @@ object TestUtil {
}
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
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