antonioleiva
05/31/2017, 4:46 PMcancel()
operation returns true, but it's still leaking the activity 😞sitexa
06/05/2017, 1:43 AMblakelee
06/13/2017, 7:13 PMCannot use 'ACT' as reified type parameter. Use a class instead.
code:
class myClass<ACT: Activity>(): AnkoComponent<Fragment> ....
....
floatingActionButton
....
.setOnClickListener {
startActivity<ACT>()
}
classified.dev
07/04/2017, 4:43 AMnickk
07/14/2017, 8:19 AMfragment
function in the DSL.spragg
07/20/2017, 1:55 AMmkojadinovic
07/25/2017, 9:21 AMcardView(){
lparams(height = wrapContent, width = matchParent){
}
}
And it looks like there is no lparams here. But if I do something like
verticalLayout(){
cardView(){
lparams(height = wrapContent, width = matchParent){
}
}
}
it is there. So it looks like I can’t use cardView like root view?david.bilik
07/28/2017, 11:33 AMrelativeLayout {
textView {
text = "Hello world"
}.lparams {
alignParentTop()
}
}
anthaugh
07/28/2017, 1:19 PManthaugh
08/08/2017, 4:32 PMtoolbar
in my app is swipeable away.
I'm using it like this:
coordinatorLayout {
appBarLayout {
toolbar { ... }
relativeLayout { to be filled with content later }
}
}
Is there any way to prevent this behaviour? I tried setCollapsible(false)
to no availanthonyandroid
08/13/2017, 7:35 AMarild
08/20/2017, 7:06 PMUI {...}.view
wrapping, where addView
checks a boolean field to see if it should actually add view seems… inelegantsebastian.janko
08/22/2017, 6:48 PMdamianpetla
09/18/2017, 11:54 AMcancellable
is gone when building alerts?sqia09
09/21/2017, 9:39 AMfun getCount(): Int {
var listDbNodes = mutableListOf<DbNodeModel>()
dbHelper.use {
select(NodeTable.TABLE_NAME).parseList(object: MapRowParser<List<DbNodeModel>> {
override fun parseRow(columns: Map<String, Any?>): List<DbNodeModel> {
val routeID = columns.getValue(NodeTable.ROUTE_ID)
val siteId = columns.getValue(NodeTable.SITE_ID)
val activityId = columns.getValue(NodeTable.ACTIVITY_ID)
val equipmentId = columns.getValue(NodeTable.EQUIPMENT_ID)
val barcode = columns.getValue(NodeTable.BARCODE)
val scannedOn = columns.getValue(NodeTable.SCANNED_ON)
val scannedBy = columns.getValue(NodeTable.SCANNED_BY)
val deviceImei = columns.getValue(NodeTable.DEVICE_IMEI)
val dbNode = DbNodeModel(routeID, siteId, activityId, <----this is where I'm getting cast error
equipmentId, barcode, scannedOn, scannedBy, deviceImei)
listDbNodes.add(dbNode)
return listDbNodes
}
})
}
return listDbNodes.size
}
david.bilik
09/22/2017, 12:58 PMspragg
10/11/2017, 1:28 AMSøren Krogh Neigaard
10/13/2017, 11:15 AMclass ProjectCellView : AnkoComponent<ViewGroup> {
var project: Project? = null
override fun createView(ui: AnkoContext<ViewGroup>): View {
return with(ui) {
verticalLayout {
textView {
text = project?.title
}
}
}
}
}
and my idea was to update its project
in a adapter.onBindViewHolder so that it would show the correct title, but I use it in createView
so that won´t work. What is the correct way to use a AnkoComponent
in a RecyclerView adapter and bind its view's to data in the adapter.onBindViewHolder?stantronic
10/19/2017, 2:06 PMhagabaka
11/07/2017, 1:57 AMdavid.bilik
11/09/2017, 8:21 AMdavid.bilik
11/16/2017, 10:55 AMdamianpetla
11/23/2017, 6:59 AMspragg
11/28/2017, 5:36 AMthemedRelativeLayout()
. Anko convention seems to be to have a themed version of all the views which takes a theme resourceIDspragg
11/29/2017, 11:20 PMdavid.bilik
12/12/2017, 6:19 AM/**
* Get drawable defined by attribute [attr]
*/
fun Context.attrDrawable(attr: Int): Drawable {
val a = theme.obtainStyledAttributes(intArrayOf(attr))
val attributeResourceId = a.getResourceId(0, 0)
a.recycle()
return drawable(attributeResourceId)
}
adeln
12/25/2017, 3:20 PMlouiscad
01/16/2018, 8:08 AMvoghdev
02/06/2018, 12:11 PMbennofs
02/14/2018, 11:30 AMwith(AnkoContext.create(parent.context)) { ...layout... }
but that doesn't allow me to set layout params for example