Skip to content
Snippets Groups Projects
Commit 21e9ac61 authored by John's avatar John
Browse files

Fix visibility of projects

parent 7ab60dac
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -40,8 +40,8 @@ class AddUserActivity : MorphActivity() {
 
companion object {
 
private val KEY_PROJECT_ID = "project_id"
private val KEY_GROUP = "group"
private const val KEY_PROJECT_ID = "project_id"
private const val KEY_GROUP = "group"
 
fun newIntent(context: Context, projectId: Long): Intent {
val intent = Intent(context, AddUserActivity::class.java)
Loading
Loading
Loading
Loading
@@ -6,6 +6,13 @@ import java.util.*
 
@Parcel(Parcel.Serialization.BEAN)
open class Project {
companion object {
const val VISIBILITY_PRIVATE = "private"
const val VISIBILITY_INTERNAL = "internal"
const val VISIBILITY_PUBLIC = "public"
}
@field:Json(name = "id")
var id: Long = 0
@field:Json(name = "description")
Loading
Loading
@@ -14,12 +21,10 @@ open class Project {
var defaultBranch: String? = null
@field:Json(name = "tag_list")
var tagList: List<String>? = null
@field:Json(name = "public")
var isPublic: Boolean = false
@field:Json(name = "archived")
var isArchived: Boolean = false
@field:Json(name = "visibility_level")
var visibilityLevel: Int = 0
@field:Json(name = "visibility")
var visibility: String? = null
@field:Json(name = "ssh_url_to_repo")
var sshUrlToRepo: String? = null
@field:Json(name = "http_url_to_repo")
Loading
Loading
Loading
Loading
@@ -29,11 +29,16 @@ class ProjectViewHolder(view: View) : RecyclerView.ViewHolder(view) {
}
}
 
@BindView(R.id.project_image) lateinit var image: ImageView
@BindView(R.id.project_letter) lateinit var iconLetter: MaterialLetterIcon
@BindView(R.id.project_title) lateinit var textTitle: TextView
@BindView(R.id.project_description) lateinit var textDescription: TextView
@BindView(R.id.project_visibility) lateinit var iconVisibility: ImageView
@BindView(R.id.project_image)
lateinit var image: ImageView
@BindView(R.id.project_letter)
lateinit var iconLetter: MaterialLetterIcon
@BindView(R.id.project_title)
lateinit var textTitle: TextView
@BindView(R.id.project_description)
lateinit var textDescription: TextView
@BindView(R.id.project_visibility)
lateinit var iconVisibility: ImageView
 
init {
ButterKnife.bind(this, view)
Loading
Loading
@@ -66,7 +71,7 @@ class ProjectViewHolder(view: View) : RecyclerView.ViewHolder(view) {
textDescription.text = ""
}
 
if (project.isPublic) {
if (project.visibility == Project.VISIBILITY_PUBLIC) {
iconVisibility.setImageResource(R.drawable.ic_public_24dp)
} else {
iconVisibility.setImageResource(R.drawable.ic_private_24dp)
Loading
Loading
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'com.commit451.updatewrapper'
buildscript {
ext.kotlinVersion = '1.2.20'
ext.kotlinVersion = '1.2.30'
repositories {
jcenter()
maven { url "https://jitpack.io" }
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