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

Merge remote-tracking branch 'origin/develop'

parents cbd7ebc0 f5eb33a1
No related branches found
No related tags found
No related merge requests found
Pipeline #
Showing
with 54 additions and 64 deletions
Loading
Loading
@@ -45,8 +45,8 @@ class MergeRequestHeaderViewHolder(view: View) : RecyclerView.ViewHolder(view) {
textDescription.visibility = View.GONE
} else {
textDescription.visibility = View.VISIBLE
textDescription.setMarkdownText(mergeRequest.description, project)
textDescription.movementMethod = InternalLinkMovementMethod(App.get().getAccount().serverUrl)
textDescription.setMarkdownText(mergeRequest.description!!, project)
textDescription.movementMethod = InternalLinkMovementMethod(App.get().getAccount().serverUrl!!)
}
 
App.get().picasso
Loading
Loading
@@ -56,7 +56,7 @@ class MergeRequestHeaderViewHolder(view: View) : RecyclerView.ViewHolder(view) {
 
var author = ""
if (mergeRequest.author != null) {
author += mergeRequest.author.name + " "
author += mergeRequest.author!!.name + " "
}
author += itemView.resources.getString(R.string.created_merge_request)
if (mergeRequest.createdAt != null) {
Loading
Loading
Loading
Loading
@@ -43,7 +43,7 @@ class MergeRequestViewHolder(view: View) : RecyclerView.ViewHolder(view) {
.into(image)
 
if (item.author != null) {
textAuthor.text = item.author.username
textAuthor.text = item.author!!.username
} else {
textAuthor.text = ""
}
Loading
Loading
Loading
Loading
@@ -46,17 +46,15 @@ class NoteViewHolder(view: View) : RecyclerView.ViewHolder(view) {
textCreationDate.text = DateUtil.getRelativeTimeSpanString(itemView.context, note.createdAt)
}
 
if (note.author != null) {
textTitle.text = note.author.username
val author = note.author
if (author != null) {
textTitle.text = author.username
}
 
var summary = ""
if (note.body != null) {
summary = note.body
}
val summary = note.body ?: ""
 
textSummary.setMarkdownText(summary, project)
textSummary.movementMethod = InternalLinkMovementMethod(App.get().getAccount().serverUrl)
textSummary.movementMethod = InternalLinkMovementMethod(App.get().getAccount().serverUrl!!)
 
App.get().picasso
.load(ImageUtil.getAvatarUrl(note.author, itemView.resources.getDimensionPixelSize(R.dimen.image_size)))
Loading
Loading
Loading
Loading
@@ -9,8 +9,6 @@ import butterknife.BindView
import butterknife.ButterKnife
import com.commit451.gitlab.R
import com.commit451.gitlab.model.api.Pipeline
import com.commit451.gitlab.util.DateUtil
import java.util.*
 
/**
* Pipelines, woot
Loading
Loading
@@ -36,7 +34,7 @@ class PipelineViewHolder(view: View) : RecyclerView.ViewHolder(view) {
}
 
fun bind(pipeline: Pipeline) {
val pipeSha = pipeline.sha.substring(0, 8)
val pipeSha = pipeline.sha!!.substring(0, 8)
val pipelineShaText = String.format(itemView.resources.getString(R.string.pipeline_sha), pipeSha)
textSha.text = pipelineShaText
 
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ import butterknife.BindView
import butterknife.ButterKnife
import com.commit451.gitlab.App
import com.commit451.gitlab.R
import com.commit451.gitlab.model.api.Member
import com.commit451.gitlab.model.api.User
import com.commit451.gitlab.util.ImageUtil
 
/**
Loading
Loading
@@ -44,9 +44,9 @@ class ProjectMemberViewHolder(view: View) : RecyclerView.ViewHolder(view) {
buttonOverflow.setOnClickListener { popupMenu.show() }
}
 
fun bind(member: Member) {
fun bind(member: User) {
textUsername.text = member.username
textAccess.text = Member.getAccessLevel(member.accessLevel)
textAccess.text = User.getAccessLevel(member.accessLevel)
 
App.get().picasso
.load(ImageUtil.getAvatarUrl(member, itemView.resources.getDimensionPixelSize(R.dimen.user_header_image_size)))
Loading
Loading
Loading
Loading
@@ -52,7 +52,7 @@ class ProjectViewHolder(view: View) : RecyclerView.ViewHolder(view) {
image.visibility = View.GONE
 
iconLetter.visibility = View.VISIBLE
iconLetter.letter = project.name.substring(0, 1)
iconLetter.letter = project.name!!.substring(0, 1)
iconLetter.letterColor = Color.WHITE
iconLetter.shapeColor = color
}
Loading
Loading
Loading
Loading
@@ -39,7 +39,7 @@ class TodoViewHolder(view: View) : RecyclerView.ViewHolder(view) {
}
 
fun bind(todo: Todo) {
textProject.text = todo.project.nameWithNamespace
textProject.text = todo.project!!.nameWithNamespace
if (todo.author != null) {
App.get().picasso
.load(ImageUtil.getAvatarUrl(todo.author, itemView.resources.getDimensionPixelSize(R.dimen.image_size)))
Loading
Loading
Loading
Loading
@@ -10,7 +10,7 @@ import butterknife.BindView
import butterknife.ButterKnife
import com.commit451.gitlab.App
import com.commit451.gitlab.R
import com.commit451.gitlab.model.api.UserBasic
import com.commit451.gitlab.model.api.User
import com.commit451.gitlab.util.ImageUtil
 
/**
Loading
Loading
@@ -34,7 +34,7 @@ class UserViewHolder(view: View) : RecyclerView.ViewHolder(view) {
ButterKnife.bind(this, view)
}
 
fun bind(user: UserBasic) {
fun bind(user: User) {
textUsername.text = user.username
App.get().picasso
.load(ImageUtil.getAvatarUrl(user, itemView.resources.getDimensionPixelSize(R.dimen.user_list_image_size)))
Loading
Loading
Loading
Loading
@@ -38,7 +38,7 @@ class AccountViewHolder(view: View) : TypedViewHolder<Account>(view) {
 
override fun bind(position: Int, item: Account) {
textServer.text = item.serverUrl.toString()
textUsername.text = item.user.username
textUsername.text = item.user!!.username
 
Picasso.with(context)
.load(ImageUtil.getAvatarUrl(item.user, itemView.resources.getDimensionPixelSize(R.dimen.user_list_image_size)))
Loading
Loading
Loading
Loading
@@ -31,7 +31,7 @@ class FeedRemoteViewsFactory(private val context: Context, intent: Intent, accou
 
val appWidgetId: Int = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
AppWidgetManager.INVALID_APPWIDGET_ID)
var entries: ArrayList<Entry>? = null
var entries = mutableListOf<Entry>()
val picasso: Picasso
val rssClient: GitLabRss
 
Loading
Loading
@@ -75,7 +75,7 @@ class FeedRemoteViewsFactory(private val context: Context, intent: Intent, accou
// Next, we set a fill-intent which will be used to fill-in the pending intent template
// which is set on the collection view in UserFeedWidgetProvider.
val fillInIntent = Intent()
fillInIntent.putExtra(UserFeedWidgetProvider.EXTRA_LINK, entry.link.href.toString())
fillInIntent.putExtra(UserFeedWidgetProvider.EXTRA_LINK, entry.link.href)
rv.setOnClickFillInIntent(R.id.root, fillInIntent)
 
try {
Loading
Loading
@@ -120,8 +120,10 @@ class FeedRemoteViewsFactory(private val context: Context, intent: Intent, accou
try {
val feed = rssClient.getFeed(feedUrl)
.blockingGet()
if (feed.entries != null) {
entries!!.addAll(feed.entries)
entries.clear()
val nextEntries = feed.entries
if (nextEntries != null) {
entries.addAll(nextEntries)
}
} catch (e: Exception) {
//maybe let the user know somehow?
Loading
Loading
Loading
Loading
@@ -15,7 +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.extension.feedUrl
import com.commit451.gitlab.model.Account
import com.commit451.gitlab.model.api.Project
import timber.log.Timber
Loading
Loading
@@ -106,7 +106,7 @@ class ProjectFeedWidgetConfigureActivity : BaseActivity() {
 
fun saveWidgetConfig(account: Account, project: Project) {
ProjectFeedWidgetPrefs.setAccount(this, appWidgetId, account)
ProjectFeedWidgetPrefs.setFeedUrl(this, appWidgetId, project.getFeedUrl()!!.toString())
ProjectFeedWidgetPrefs.setFeedUrl(this, appWidgetId, project.feedUrl)
 
val resultValue = Intent()
resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId)
Loading
Loading
Loading
Loading
@@ -24,6 +24,7 @@ import android.content.Intent
import android.net.Uri
import android.widget.RemoteViews
import com.commit451.gitlab.R
import com.commit451.gitlab.extension.feedUrl
import com.commit451.gitlab.navigation.DeepLinker
import timber.log.Timber
 
Loading
Loading
@@ -52,35 +53,35 @@ class UserFeedWidgetProvider : AppWidgetProvider() {
// Here we setup the intent which points to the StackViewService which will
// provide the views for this collection.
val account = UserFeedWidgetPrefs.getAccount(context, widgetId)
if (account == null || account.user.feedUrl == null) {
val feedUrl = account?.user?.feedUrl
if (account == null || feedUrl == null) {
//TODO alert the user to this misfortune?
Timber.e("Error getting account or feed url")
return
}
val feedUrl = account.user.feedUrl!!.toString()
Timber.d("Updating widget with url $feedUrl")
val intent = ProjectFeedWidgetService.newIntent(context, widgetId, account, feedUrl)
// When intents are compared, the extras are ignored, so we need to embed the extras
// into the data so that the extras will not be ignored.
intent.data = Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME))
val rv = RemoteViews(context.packageName, R.layout.widget_layout_entry)
rv.setRemoteAdapter(R.id.list_view, intent)
} else {
Timber.d("Updating widget with url $feedUrl")
val intent = ProjectFeedWidgetService.newIntent(context, widgetId, account, feedUrl)
// When intents are compared, the extras are ignored, so we need to embed the extras
// into the data so that the extras will not be ignored.
intent.data = Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME))
val rv = RemoteViews(context.packageName, R.layout.widget_layout_entry)
rv.setRemoteAdapter(R.id.list_view, intent)
 
rv.setEmptyView(R.id.list_view, R.id.empty_view)
rv.setEmptyView(R.id.list_view, R.id.empty_view)
 
// Here we setup the a pending intent template. Individuals items of a collection
// cannot setup their own pending intents, instead, the collection as a whole can
// setup a pending intent template, and the individual items can set a fillInIntent
// to create unique before on an item to item basis.
val actionIntent = Intent(context, UserFeedWidgetProvider::class.java)
actionIntent.action = UserFeedWidgetProvider.ACTION_FOLLOW_LINK
actionIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widgetId)
intent.data = Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME))
val actionPendingIntent = PendingIntent.getBroadcast(context, 0, actionIntent,
PendingIntent.FLAG_UPDATE_CURRENT)
rv.setPendingIntentTemplate(R.id.list_view, actionPendingIntent)
// Here we setup the a pending intent template. Individuals items of a collection
// cannot setup their own pending intents, instead, the collection as a whole can
// setup a pending intent template, and the individual items can set a fillInIntent
// to create unique before on an item to item basis.
val actionIntent = Intent(context, UserFeedWidgetProvider::class.java)
actionIntent.action = UserFeedWidgetProvider.ACTION_FOLLOW_LINK
actionIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widgetId)
intent.data = Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME))
val actionPendingIntent = PendingIntent.getBroadcast(context, 0, actionIntent,
PendingIntent.FLAG_UPDATE_CURRENT)
rv.setPendingIntentTemplate(R.id.list_view, actionPendingIntent)
 
appWidgetManager.updateAppWidget(widgetId, rv)
appWidgetManager.updateAppWidget(widgetId, rv)
}
}
super.onUpdate(context, appWidgetManager, appWidgetIds)
}
Loading
Loading
Loading
Loading
@@ -21,7 +21,6 @@ class ApiTests {
 
@JvmStatic
@BeforeClass
@Throws(Exception::class)
fun setUp() {
//for logging
 
Loading
Loading
@@ -37,7 +36,6 @@ class ApiTests {
}
 
@Test
@Throws(Exception::class)
fun getProjects() {
val projectsResponse = gitLab!!
.getAllProjects()
Loading
Loading
@@ -47,7 +45,6 @@ class ApiTests {
}
 
@Test
@Throws(Exception::class)
fun getGroups() {
val groupResponse = gitLab!!
.getGroups()
Loading
Loading
@@ -57,7 +54,6 @@ class ApiTests {
}
 
@Test
@Throws(Exception::class)
fun getGroupMembers() {
//GitLabService group id
val gitLabGroupId: Long = 9970
Loading
Loading
@@ -69,7 +65,6 @@ class ApiTests {
}
 
@Test
@Throws(Exception::class)
fun getIssues() {
val defaultState = "opened"
val issuesResponse = gitLab!!
Loading
Loading
@@ -80,7 +75,6 @@ class ApiTests {
}
 
@Test
@Throws(Exception::class)
fun getFiles() {
val defaultBranch = "master"
val currentPath = ""
Loading
Loading
@@ -91,7 +85,6 @@ class ApiTests {
}
 
@Test
@Throws(Exception::class)
fun getCommits() {
val defaultBranch = "master"
val commitsResponse = gitLab!!
Loading
Loading
@@ -101,7 +94,6 @@ class ApiTests {
}
 
@Test
@Throws(Exception::class)
fun getMergeRequests() {
val defaultState = "opened"
val mergeRequestResponse = gitLab!!
Loading
Loading
@@ -112,7 +104,6 @@ class ApiTests {
}
 
@Test
@Throws(Exception::class)
fun getCurrentUser() {
val userFullResponse = gitLab!!
.getThisUser()
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha8'
classpath 'com.android.tools.build:gradle:3.0.0-alpha9'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'com.github.ben-manes:gradle-versions-plugin:0.15.0'
classpath 'com.github.Commit451:updatewrapper:1.1.2'
Loading
Loading
#Mon Jul 24 16:08:09 CDT 2017
#Sat Aug 05 16:54:25 CDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-milestone-1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-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