rattleshirt
07/06/2018, 8:25 AMCould not find accessor companyName when using android:text="@{data.invoice.companyName}" (kotlin v1.2.51) with abstract var companyName: String?. In the kotlin bytecode I see a getCompanyName() method but that doesn’t work eitherarekolek
07/06/2018, 8:31 AMdata.getInvoice() that is chosen over data.invoice and doesn't have the companyName. That was the problem here https://stackoverflow.com/questions/32683129/android-databinding-error-could-not-find-accessorrattleshirt
07/06/2018, 9:14 AMgildor
07/06/2018, 9:15 AMrattleshirt
07/06/2018, 9:16 AMgildor
07/06/2018, 9:16 AMgetCompanyName()gildor
07/06/2018, 9:17 AMgildor
07/06/2018, 9:17 AMrattleshirt
07/06/2018, 9:18 AMabstract class InvoiceType {
abstract var companyName: String?
}
interface AfterpayInvoice<T : InvoiceType> {
var invoice: T
}rattleshirt
07/06/2018, 9:19 AMdata class Invoice(@PrimaryKey
var orderNumber: String,
override var companyName: String?
) : InvoiceType()rattleshirt
07/06/2018, 9:20 AMclass InvoiceWithDetails : AfterpayInvoice<Invoice> {
@Embedded
override lateinit var invoice: Invoice
}rattleshirt
07/06/2018, 9:24 AMrattleshirt
07/06/2018, 9:27 AMgildor
07/06/2018, 9:36 AMrattleshirt
07/06/2018, 9:37 AMrattleshirt
07/06/2018, 9:38 AMinterface AfterpayInvoice<T : InvoiceType> {
var invoice: T
fun getterForInvoice() : InvoiceType
}rattleshirt
07/06/2018, 9:38 AMgildor
07/06/2018, 9:59 AMdatagildor
07/06/2018, 10:00 AMclass InvoiceSomeData : SomeData<InvoiceType>rattleshirt
07/06/2018, 10:15 AMgildor
07/06/2018, 10:49 AM