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...
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')
...
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...
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 ...
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...
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 ...
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) ...
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 ...
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...
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...
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...
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...
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...
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.
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...
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...
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...
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...
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...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.