Questions tagged [anko]

Anko is a deprecated JetBrains library for Android application development

Anko is JetBrains library for Android application development (wrapper for Android SDK for Java), written in .

It was deprecated on the 1st of December 2019 and its use is no longer recommended.

258 questions
4
votes
1 answer

Anko theme and style

Is there a way to add theme and style to a Layout with Anko? Thanks
4
votes
1 answer

Why don't I get correct result when I use original parseList function in Kotlin?

I'm learning the sample code about Anko at Kotlin for Android Developers (the book) https://github.com/antoniolg/Kotlin-for-Android-Developers The Method 1 is from sample code and override parseList ,but it's hard to understand. So I try to use the…
HelloCW
  • 843
  • 22
  • 125
  • 310
4
votes
1 answer

Adding / Query / Parse SQLite using Anko

tl;dr: I'm having issues trying to get my code to work, now I can create the database using Anko and insert the columns but when I try to insert the data and when I open the database on sqliteman my columns are empty I also don't know how to…
4
votes
2 answers

How to use anko spinner?

I'm trying to add a spinner inside an alert using anko. My code so far looks like this: alert(getString(R.string.alert)) { positiveButton("Cool") { toast("Yess!!!") } customView { linearLayout { …
Carla Urrea Stabile
  • 869
  • 1
  • 11
  • 35
4
votes
1 answer

How to prevent a dialog (alert) from closing when you touch outside or press back using Anko

I'm ussing kotlin and anko for creating an alert/dialog (code below), but when you tap outside or press back it closes. Here is the code alert("TITLE") { title("Text") positiveButton("Ok") { action() } }.show() Here is how the solution will…
quiquelhappy
  • 396
  • 2
  • 6
  • 16
4
votes
1 answer

Anko Logging with verbose and debug isn't working

I'm trying to use Anko Commons – Logging but for some reason the verbose and debug not showing on the logcat however, when I use Log.d it works as expected. when I'm trying this code…
humazed
  • 74,687
  • 32
  • 99
  • 138
4
votes
1 answer

Setting height and width of an Anko view to match_parent

I would like to set the height and width of an video view to match_parent. My code looks something like the following. It works without the height and width attributes, but doing it as below give me a val cannot be reassigned error. class…
Muz
  • 5,866
  • 3
  • 47
  • 65
4
votes
3 answers

Statusbar is not transparent but white

To test kotlin with anko DSL I decided to start a new proyect in last android studio ide (2.1.3), using kotlin plugin (1.0.3) and latest anko library (0.9) I used the default proyect Navigation Drawer Activity, so I just had to convert the main xml…
yaymalaga
  • 53
  • 1
  • 6
3
votes
2 answers

What do i use now that Anko is deprecated?

How do I fix the deprecation warning in this code? Alternatively, are there any other options for doing this? runOnUiThread { doAsync { // room insert query } } // anko Commons implementation…
Bolt UIX
  • 5,988
  • 6
  • 31
  • 58
3
votes
1 answer

How do I set a topMargin in my Anko layout

I want my Anko layout to have a margin of 100dp on the top, so that the background of the app that gets defined in my theme file gets shown on the top. I tried: verticalLayout { background =…
Christian
  • 25,249
  • 40
  • 134
  • 225
3
votes
2 answers

Button not showing Material Design

I've found out that the reason is that I'm using the Android-Iconics library - I removed the context injection and everything is fine now. I'm using a combination of XML Layouts and Anko DSL to build my app and I've noticed that the button design is…
Naroh
  • 625
  • 4
  • 9
3
votes
1 answer

How to get max _id value of a SQLite table using Anko with Kotlin?

DBRecordTable._ID is a INTEGER + PRIMARY_KEY+ AUTOINCREMENT, I hope to get the max _id value of a table, zero will be return if no data row in the table. I try to write the code select(tableName,DBRecordTable._ID).orderBy(DBRecordTable._ID,…
HelloCW
  • 843
  • 22
  • 125
  • 310
3
votes
1 answer

How can I sort a table based two fields using Anko in Kotlin?

I use Anko to operate SQLite table, I hope to sort a list based the field isFavorite first, then based the createdDate For example, input Source Data, and I get the Sort Result Data But the code return myList.sortedBy{it.isFavorite}.sortedBy{…
HelloCW
  • 843
  • 22
  • 125
  • 310
3
votes
2 answers

How to define a not null field for a table of SQLite when I use Anko in Kotlin?

I hope to define a not null field for a table of SQLite when I use Anko in Kotlin. But DBRecordTable.Category to TEXT NOT NULL is wrong ,how can I fix it? Code implementation "org.jetbrains.anko:anko-sqlite:$anko_version" override fun…
HelloCW
  • 843
  • 22
  • 125
  • 310
3
votes
0 answers

Store Anko Layout in variable without it rendering

How do I store a layout created via ViewManager in a variable and pass it to another function without it rendering whilst being stored in the said variable Example Code 1) The spinner Layout fun ViewManager.spinnerLayout( spinner: Spinner )…
Dev Man
  • 2,114
  • 3
  • 23
  • 38
1 2
3
17 18