anko Questions

13

Solved

How do you build a lambda expression for the EditText addTextChangeListener in Kotlin? Below gives an error: passwordEditText.addTextChangedListener { charSequence -> try { password = charSeq...
Coopt asked 13/11, 2016 at 1:0

2

Solved

I used to use Channel to send out click event from Anko View class to Activity class, however more and more Channel functions are marked as deprecated. So I wanted to start using Flow apis. I migr...
Barely asked 12/9, 2019 at 3:26

4

Solved

I am trying to use Anko with my Android Kotlin Project. I have added the line to my dependencies / gradle module file as follows: dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') ...
Consumptive asked 23/8, 2017 at 4:5

4

Solved

I'm using Kotlin with Anko and I want to send to another activity a list of Players. class Player(var name: String?) { var score: Int = 0 init { this.score = 0 } } My activity: class MainA...
Joyce asked 23/8, 2017 at 13:5

2

Solved

I'm a little confused about the advantages and disadvantages of using Android KTX vs Anko. Because both libraries are trying to achieve the same end goal, and the line between them it's getting a l...
Moneymaker asked 16/5, 2018 at 1:57

2

Solved

I know Anko provides the functions parseSingle, parseOpt and parseList , I don't understand why the code of Android Developers (the book) need to design extensions parseList again. Could you tell ...
Malagasy asked 2/11, 2017 at 7:45

2

The following code is from "Kotlin for Android Developers", you can access it at https://github.com/antoniolg/Kotlin-for-Android-Developers In order to insert a row data into CityForecastTable.NAM...
Personnel asked 22/7, 2018 at 1:59

1

Solved

For example I have the next alert creation way: alert(message, title) { positiveButton(R.string.alert_dialog_btn_ok) { } }.show() I want to change the color of positive button to green, and ...
Angele asked 18/7, 2018 at 8:4

4

I know I can use an id attribute with Anko to identify a view: class MainActivityUI : AnkoComponent<MainActivity> { override fun createView(ui: AnkoContext<MainActivity>) = with(ui) ...
Ment asked 7/12, 2016 at 14:42

0

I create a customize Preference layout, and display the UI with UIPreference.kt. I can handle the button btnClose simply by import kotlinx.android.synthetic.main.layout_preference.*. Now I hope ...
Well asked 31/5, 2018 at 2:5

2

Solved

The Code B define a Log table, I hope to clear all records except latest 10 records. At present, I list all records order by CreatedDate first, then I do a loop from 11th record to last record, an...
Ilario asked 11/5, 2018 at 8:39

2

Solved

I'm having following error when I'm calling toast("Toast's message text") from Android Fragment: java.lang.NoSuchMethodError: No virtual method getActivity()Landroid/app/Activity; in class Landr...
Subglacial asked 30/1, 2017 at 9:12

1

Solved

I hope to delete a row by _id, I hope to delete multiple rows by where args using Anko too. I have read the article at https://github.com/Kotlin/anko/wiki/Anko-SQLite#updating-values, but I have n...
Orelee asked 16/11, 2017 at 0:42

1

Solved

I have read the docs for Anko SQLite. I know that creating a simple RowParser iscan be done by doing val rowParser = classParser<Person>() The classParser is a function defined in the Anko...
Terpsichorean asked 5/11, 2017 at 6:57

4

Solved

Anko docs tell us how to add custom views to DSL. But if my custom view is a view group, problems arise. class MyFrameLayout(context: Context) : FrameLayout(context) fun ViewManager.myFrameLayout...
Paleobiology asked 26/2, 2016 at 12:32

2

Solved

As with anko you can write callback functions like this: alert { title = "" message = "" yesButton { toast("Yes") } noButton { toast("No") } } How can I create a nested functions like...
Motorway asked 8/9, 2017 at 10:0

1

Solved

Compiler is giving me the error Error:(97, 17) Val cannot be reassigned but the variable is declared as var. Edit: You can see comments in my code. When i assign rcv = recyclerView and chkSt...
Athletics asked 28/6, 2017 at 10:41

2

Solved

What is a good way to do a horizontalLayout in anko / kotlin ? verticalLayout works fine - could set orientation on it but it feels wrong. Not sure what I am missing there.
Lignify asked 30/4, 2015 at 11:31

5

I'm using Anko in my Android project, but I don't know how can it reference the child views I created in the DSL when the referenced view is not at the same level where I reference it. The followi...
Soult asked 11/12, 2015 at 6:58

2

I read that the most benefit of using Anko is its reusability. But i could't find its exact example. Currently in the new Android layout system, the boiler plate is like below: DrawerLayout (with...
Jarvisjary asked 17/10, 2016 at 0:26

1

Solved

With Anko, I can write something like this for showing dialog: alert("Dialog title") { yesButton {} noButton {} }.show() How can I set a title for the button? noButton {title = "title"} Unf...
Refrigerant asked 7/2, 2017 at 5:28

2

I want to create a custom View which is just a wrapper of some Android Views. I looked into creating a custom ViewGroup which manages the layout of it's child views, but I don't need such complexit...
Pleonasm asked 20/10, 2016 at 6:51

1

Solved

I am developing an app in Kotlin (if you don't know about kotlin I am sure you can still help with your Android/Java experience) Details: I have a Spinner in there my app.Though it is not respond...
Livingston asked 10/11, 2016 at 22:10

2

The main question is: is lparams simply gone from Anko, or am I doing something terribly wrong? The following snippet fails to compile: verticalLayout { }.lparams(width = matchParent, height = mat...
Hemelytron asked 18/12, 2015 at 8:43

2

Solved

I realize Anko (and Kotlin) are both pretty cutting edge but I was hoping someone might be able to give me a little guidance on this. This is just a learning project for me, of course. I've got t...
Twinberry asked 1/5, 2015 at 20:36

© 2022 - 2024 — McMap. All rights reserved.