scottiedog45
04/05/2019, 10:11 PMparent
is coming up as undefined. Not sure what I’m doing wrong 😅
package com.example.scottotoole.recyclerviewtutorial
import android.support.v7.widget.RecyclerView
import android.text.Layout
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import kotlinx.android.synthetic.main.activity_main.view.*.
class UsersAdapter(val users: ArrayList<String>) : RecyclerView.Adapter<UsersAdapter.ViewHolder>() {
class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val firstName : TextView = itemView.findViewById(R.id.firstName)
}
override fun onCreateViewHolder(p0: ViewGroup, p1: Int): ViewHolder {
val view : View = LayoutInflater.from(parent.context).inflate(R.layout.userrow, parent, false)
return ViewHolder(view)
}
override fun getItemCount() : Int = users.size
override fun onBindViewHolder(holder: ViewHolder, p1: Int) {
holder.firstName.text = users[p1]
}
}
Frankdroid7
04/06/2019, 12:35 PMSlackbot
04/07/2019, 2:28 PMscottiedog45
04/07/2019, 4:48 PMscottiedog45
04/08/2019, 2:15 PMgumil
04/08/2019, 3:04 PM@Parcelize
in kotlin android extensions?iammini5
04/08/2019, 9:43 PMpablisco
04/09/2019, 3:55 PMes0329
04/09/2019, 5:16 PM./gradlew dependencies
?scottiedog45
04/09/2019, 7:41 PMCarlosBlanco
04/09/2019, 9:28 PMnicka
04/10/2019, 1:43 AMAdam Kirk
04/10/2019, 2:23 AMjw
04/10/2019, 2:25 AMiammini5
04/10/2019, 2:47 AMscottiedog45
04/10/2019, 6:23 PMAlexandra Tsampikakis
04/11/2019, 8:10 AMDuplicate jar entry [com/base/Constants.class]
Does anyone know how to deals with this?
Can I specify in gradle somehow to now include the Constant.kt in base?
Or did I misunderstood how to use modules with multiple apps?
Thankful for any answers 🙏 🙏 🙏
FYI: I know that gradle can be used to handle constants but right now I am just using that file to test if this structure of modules is possiblejurajsolarml
04/11/2019, 8:55 AMjw
04/11/2019, 3:55 PMeygraber
04/11/2019, 6:30 PMSamer Hobeika
04/11/2019, 6:41 PMzokipirlo
04/12/2019, 7:46 AMGeert
04/12/2019, 8:25 AMNelson Almendra
04/12/2019, 10:03 AMzokipirlo
04/12/2019, 11:33 AMpublic class LineChart extends BarLineChartBase<LineData>
and public class BarChart extends BarLineChartBase<BarData>
. How to write an extension function fun BarLineChartBase<what_to_insert_here?>.applyDefaultChartProperties()
on BarLineChartBase
? Or how to write a function which accepts BarLineChartBase
as parameter?Damien O'Reilly
04/13/2019, 10:04 AMRok Koncina
04/15/2019, 9:21 AMAlf_
04/15/2019, 9:56 AMDamien O'Reilly
04/15/2019, 1:11 PMattemptAs
work in the scala world.gsala
04/15/2019, 1:47 PM@Entity
data class DailySummary(
@PrimaryKey val date: LocalDate,
val activeTime: Duration,
val calories: KCal // <- inline class wrapping a Float
)
and it doesn't work even if I provide a @TypeConverter
for it.
The error coming from Gradle is very meaningless so i won't post it here but changing the entity above to use Float
instead of KCal
automatically works.
The Type Converters are these:
@TypeConverter
fun toKCal(value: Float?): KCal? {
return value?.let { KCal(it) }
}
@TypeConverter
fun fromKCal(kcal: KCal?): Float? {
return kcal?.value
}
gsala
04/15/2019, 1:47 PM@Entity
data class DailySummary(
@PrimaryKey val date: LocalDate,
val activeTime: Duration,
val calories: KCal // <- inline class wrapping a Float
)
and it doesn't work even if I provide a @TypeConverter
for it.
The error coming from Gradle is very meaningless so i won't post it here but changing the entity above to use Float
instead of KCal
automatically works.
The Type Converters are these:
@TypeConverter
fun toKCal(value: Float?): KCal? {
return value?.let { KCal(it) }
}
@TypeConverter
fun fromKCal(kcal: KCal?): Float? {
return kcal?.value
}
Sam
04/15/2019, 3:03 PMgsala
04/15/2019, 3:05 PMrkeazor
04/15/2019, 3:07 PMgsala
04/15/2019, 3:09 PMTypeConverter
for it