Skip to content

Commit

Permalink
[fix] added dynamicly structure and colors
Browse files Browse the repository at this point in the history
  • Loading branch information
mskteknasyon committed Nov 30, 2019
1 parent f0162de commit dc1147b
Show file tree
Hide file tree
Showing 11 changed files with 461 additions and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import retrofit2.http.*

interface HttpService {
@POST("api/v1/tickets")
fun addTicket(@Body ticketItem: Desk360TicketReq): Call<Desk360NewSupportResponse>
fun addTicket(@Body ticketItem: HashMap<String, String>): Call<Desk360NewSupportResponse>

@GET("api/v1/tickets")
fun getTicket(): Call<Desk360TicketListResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package com.teknasyon.desk360.modelv2

class Desk360CustomFields {

var id = 2
var name = "sabir2"
var type = "selectbox"
var options: ArrayList<Desk360Options> = ArrayList()
var place_holder= "sabir2"
var id: Int? = null
var name: String? = null
var type: String? = null
var options: ArrayList<Desk360Options>? = null
var place_holder: String? = null
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ class Desk360DataV2 {

var first_screen: Desk360ScreenFirst = Desk360ScreenFirst()

// var custom_fields: ArrayList<Desk360CustomFields> = ArrayList()
var custom_fields: ArrayList<Desk360CustomFields>? = null

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.teknasyon.desk360.modelv2

class Desk360Options {
var order = 1
var value = "a"
var order: Int? = null
var value: String? = null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.teknasyon.desk360.view.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ArrayAdapter
import android.widget.TextView
import com.teknasyon.desk360.R
import com.teknasyon.desk360.modelv2.Desk360Options

class Desk360CustomSupportTypeAdapter(
context: Context, resourceId: Int,
private val objects: List<Desk360Options>
) : ArrayAdapter<Desk360Options>(context, resourceId, objects) {
override fun getDropDownView(
position: Int, convertView: View?,
parent: ViewGroup
): View {
return getCustomView(position, parent)
}

override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
return getCustomView(position, parent)
}

private fun getCustomView(position: Int, parent: ViewGroup): View {
val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
val row = inflater.inflate(R.layout.desk360_type_dropdown, parent, false)
val label = row.findViewById<View>(R.id.dropdown) as TextView
label.text = objects[position].value
return row
}
}
Loading

0 comments on commit dc1147b

Please sign in to comment.