From ffdd474c73208d3815283dad4e06030e6422b81c Mon Sep 17 00:00:00 2001 From: tateisu Date: Thu, 2 Feb 2023 03:07:26 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=84=E3=82=8D=E3=81=84=E3=82=8D=E8=AA=BF?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/jetbrains/anko/AlertBuilder.kt | 119 - .../org/jetbrains/anko/AlertDialogBuilder.kt | 304 --- .../org/jetbrains/anko/AndroidAlertBuilder.kt | 117 - .../java/org/jetbrains/anko/AndroidDialogs.kt | 184 -- .../org/jetbrains/anko/AndroidSelectors.kt | 49 - .../src/main/java/org/jetbrains/anko/Async.kt | 418 +-- .../java/org/jetbrains/anko/ContextUtils.kt | 3 - .../jetbrains/anko/CustomLayoutProperties.kt | 4 +- .../jetbrains/anko/CustomViewProperties.kt | 3 - .../java/org/jetbrains/anko/CustomViews.kt | 31 +- .../main/java/org/jetbrains/anko/Dialogs.kt | 98 - .../java/org/jetbrains/anko/Dimensions.kt | 45 +- .../main/java/org/jetbrains/anko/Helpers.kt | 3 - .../org/jetbrains/anko/InputConstraints.kt | 4 +- .../main/java/org/jetbrains/anko/Intents.kt | 52 +- .../main/java/org/jetbrains/anko/Layouts.kt | 3 +- .../main/java/org/jetbrains/anko/Logging.kt | 4 +- .../anko/RelativeLayoutLayoutParamsHelpers.kt | 77 +- .../main/java/org/jetbrains/anko/Selectors.kt | 52 - .../org/jetbrains/anko/SharedPreferences.kt | 40 - .../src/main/java/org/jetbrains/anko/Theme.kt | 20 +- .../main/java/org/jetbrains/anko/Toasts.kt | 27 +- anko/src/main/java/org/jetbrains/anko/Ui.kt | 6 +- .../java/org/jetbrains/anko/ViewGroups.kt | 895 ++++++ .../src/main/java/org/jetbrains/anko/Views.kt | 2427 ++--------------- .../main/java/org/jetbrains/anko/Views2.kt | 1028 +++++++ .../anko/appcompat/v7/SupportAlertBuilder.kt | 304 +-- .../java/org/jetbrains/anko/buildSpanned.kt | 186 +- .../jetbrains/anko/collections/Collections.kt | 17 - .../anko/collections/SparseArrays.kt | 64 - .../java/org/jetbrains/anko/custom/Custom.kt | 3 +- .../org/jetbrains/anko/custom/Deprecated.kt | 94 - .../org/jetbrains/anko/menuItemsSequences.kt | 51 - .../jetbrains/anko/viewChildrenSequences.kt | 53 +- app/build.gradle | 10 +- app/proguard-rules.pro | 6 +- base/build.gradle | 5 +- .../java/jp/juggler/WebPushCryptTest.kt | 3 + .../main/java/jp/juggler/crypt/CryptUtils.kt | 1 + 39 files changed, 2796 insertions(+), 4014 deletions(-) delete mode 100644 anko/src/main/java/org/jetbrains/anko/AlertBuilder.kt delete mode 100644 anko/src/main/java/org/jetbrains/anko/AlertDialogBuilder.kt delete mode 100644 anko/src/main/java/org/jetbrains/anko/AndroidAlertBuilder.kt delete mode 100644 anko/src/main/java/org/jetbrains/anko/AndroidDialogs.kt delete mode 100644 anko/src/main/java/org/jetbrains/anko/AndroidSelectors.kt delete mode 100644 anko/src/main/java/org/jetbrains/anko/Dialogs.kt delete mode 100644 anko/src/main/java/org/jetbrains/anko/Selectors.kt delete mode 100644 anko/src/main/java/org/jetbrains/anko/SharedPreferences.kt create mode 100644 anko/src/main/java/org/jetbrains/anko/ViewGroups.kt create mode 100644 anko/src/main/java/org/jetbrains/anko/Views2.kt delete mode 100644 anko/src/main/java/org/jetbrains/anko/collections/SparseArrays.kt delete mode 100644 anko/src/main/java/org/jetbrains/anko/custom/Deprecated.kt delete mode 100644 anko/src/main/java/org/jetbrains/anko/menuItemsSequences.kt rename base/src/{test => androidTest}/java/jp/juggler/WebPushCryptTest.kt (99%) diff --git a/anko/src/main/java/org/jetbrains/anko/AlertBuilder.kt b/anko/src/main/java/org/jetbrains/anko/AlertBuilder.kt deleted file mode 100644 index c703d49c..00000000 --- a/anko/src/main/java/org/jetbrains/anko/AlertBuilder.kt +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@file:Suppress("NOTHING_TO_INLINE", "unused") - -package org.jetbrains.anko - -import android.annotation.SuppressLint -import android.content.Context -import android.content.DialogInterface -import android.graphics.drawable.Drawable -import android.view.KeyEvent -import android.view.View -import android.view.ViewManager -import androidx.annotation.DrawableRes -import androidx.annotation.StringRes -import org.jetbrains.anko.internals.AnkoInternals.NO_GETTER -import kotlin.DeprecationLevel.ERROR - -@SuppressLint("SupportAnnotationUsage") -interface AlertBuilder { - val ctx: Context - - var title: CharSequence - @Deprecated(NO_GETTER, level = ERROR) get - - var titleResource: Int - @Deprecated(NO_GETTER, level = ERROR) get - - var message: CharSequence - @Deprecated(NO_GETTER, level = ERROR) get - - var messageResource: Int - @Deprecated(NO_GETTER, level = ERROR) get - - var icon: Drawable - @Deprecated(NO_GETTER, level = ERROR) get - - @setparam:DrawableRes - var iconResource: Int - @Deprecated(NO_GETTER, level = ERROR) get - - var customTitle: View - @Deprecated(NO_GETTER, level = ERROR) get - - var customView: View - @Deprecated(NO_GETTER, level = ERROR) get - - var isCancelable: Boolean - @Deprecated(NO_GETTER, level = ERROR) get - - fun onCancelled(handler: (dialog: DialogInterface) -> Unit) - - fun onKeyPressed(handler: (dialog: DialogInterface, keyCode: Int, e: KeyEvent) -> Boolean) - - fun positiveButton(buttonText: String, onClicked: (dialog: DialogInterface) -> Unit) - fun positiveButton( - @StringRes buttonTextResource: Int, - onClicked: (dialog: DialogInterface) -> Unit, - ) - - fun negativeButton(buttonText: String, onClicked: (dialog: DialogInterface) -> Unit) - fun negativeButton( - @StringRes buttonTextResource: Int, - onClicked: (dialog: DialogInterface) -> Unit, - ) - - fun neutralPressed(buttonText: String, onClicked: (dialog: DialogInterface) -> Unit) - fun neutralPressed( - @StringRes buttonTextResource: Int, - onClicked: (dialog: DialogInterface) -> Unit, - ) - - fun items( - items: List, - onItemSelected: (dialog: DialogInterface, index: Int) -> Unit, - ) - - fun items( - items: List, - onItemSelected: (dialog: DialogInterface, item: T, index: Int) -> Unit, - ) - - fun build(): D - fun show(): D -} - -fun AlertBuilder<*>.customTitle(dsl: ViewManager.() -> Unit) { - customTitle = ctx.UI(dsl).view -} - -fun AlertBuilder<*>.customView(dsl: ViewManager.() -> Unit) { - customView = ctx.UI(dsl).view -} - -inline fun AlertBuilder<*>.okButton(noinline handler: (dialog: DialogInterface) -> Unit) = - positiveButton(android.R.string.ok, handler) - -inline fun AlertBuilder<*>.cancelButton(noinline handler: (dialog: DialogInterface) -> Unit) = - negativeButton(android.R.string.cancel, handler) - -inline fun AlertBuilder<*>.yesButton(noinline handler: (dialog: DialogInterface) -> Unit) = - positiveButton(android.R.string.yes, handler) - -inline fun AlertBuilder<*>.noButton(noinline handler: (dialog: DialogInterface) -> Unit) = - negativeButton(android.R.string.no, handler) diff --git a/anko/src/main/java/org/jetbrains/anko/AlertDialogBuilder.kt b/anko/src/main/java/org/jetbrains/anko/AlertDialogBuilder.kt deleted file mode 100644 index 0ccfee21..00000000 --- a/anko/src/main/java/org/jetbrains/anko/AlertDialogBuilder.kt +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Copyright 2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@file:Suppress("unused") - -package org.jetbrains.anko - -//import android.app.AlertDialog -//import android.content.Context -//import android.content.DialogInterface -//import android.database.Cursor -//import android.graphics.drawable.Drawable -//import android.view.KeyEvent -//import android.view.View -//import android.view.ViewManager -//import android.widget.ListAdapter -// -//@Deprecated("Use AlertBuilder class instead.") -//class AlertDialogBuilder(val ctx: Context) { -// private var builder: AlertDialog.Builder? = AlertDialog.Builder(ctx) -// -// /** -// * Returns the [AlertDialog] instance if created. -// * Returns null until the [show] function is called. -// */ -// var dialog: AlertDialog? = null -// private set -// -// constructor(ankoContext: AnkoContext<*>) : this(ankoContext.ctx) -// -// fun dismiss() { -// dialog?.dismiss() -// } -// -// private fun checkBuilder() { -// if (builder == null) { -// throw IllegalStateException("show() was already called for this AlertDialogBuilder") -// } -// } -// -// /** -// * Create the [AlertDialog] and display it on screen. -// * -// */ -// fun show(): AlertDialogBuilder { -// checkBuilder() -// dialog = builder!!.create() -// builder = null -// dialog!!.show() -// return this -// } -// -// /** -// * Set the [title] displayed in the dialog. -// */ -// fun title(title: CharSequence) { -// checkBuilder() -// builder!!.setTitle(title) -// } -// -// /** -// * Set the title using the given [title] resource id. -// */ -// fun title(title: Int) { -// checkBuilder() -// builder!!.setTitle(title) -// } -// -// /** -// * Set the [message] to display. -// */ -// fun message(message: CharSequence) { -// checkBuilder() -// builder!!.setMessage(message) -// } -// -// /** -// * Set the message to display using the given [message] resource id. -// */ -// fun message(message: Int) { -// checkBuilder() -// builder!!.setMessage(message) -// } -// -// /** -// * Set the resource id of the [Drawable] to be used in the title. -// */ -// fun icon(icon: Int) { -// checkBuilder() -// builder!!.setIcon(icon) -// } -// -// /** -// * Set the [icon] Drawable to be used in the title. -// */ -// fun icon(icon: Drawable) { -// checkBuilder() -// builder!!.setIcon(icon) -// } -// -// /** -// * Set the title using the custom [view]. -// */ -// fun customTitle(view: View) { -// checkBuilder() -// builder!!.setCustomTitle(view) -// } -// -// /** -// * Set the title using the custom DSL view. -// */ -// fun customTitle(dsl: ViewManager.() -> Unit) { -// checkBuilder() -// val view = ctx.UI(dsl).view -// builder!!.setCustomTitle(view) -// } -// -// /** -// * Set a custom [view] to be the contents of the Dialog. -// */ -// fun customView(view: View) { -// checkBuilder() -// builder!!.setView(view) -// } -// -// /** -// * Set a custom DSL view to be the contents of the Dialog. -// */ -// fun customView(dsl: ViewManager.() -> Unit) { -// checkBuilder() -// val view = ctx.UI(dsl).view -// builder!!.setView(view) -// } -// -// /** -// * Set if the dialog is cancellable. -// * -// * @param cancellable if true, the created dialog will be cancellable. -// */ -// fun cancellable(cancellable: Boolean = true) { -// checkBuilder() -// builder!!.setCancelable(cancellable) -// } -// -// /** -// * Sets the [callback] that will be called if the dialog is canceled. -// */ -// fun onCancel(callback: () -> Unit) { -// checkBuilder() -// builder!!.setOnCancelListener { callback() } -// } -// -// /** -// * Sets the [callback] that will be called if a key is dispatched to the dialog. -// */ -// fun onKey(callback: (keyCode: Int, e: KeyEvent) -> Boolean) { -// checkBuilder() -// builder!!.setOnKeyListener({ dialog, keyCode, event -> callback(keyCode, event) }) -// } -// -// /** -// * Set a listener to be invoked when the neutral button of the dialog is pressed. -// * -// * @param neutralText the text resource to display in the neutral button. -// * @param callback the callback that will be called if the neutral button is pressed. -// */ -// fun neutralButton( -// neutralText: Int = android.R.string.ok, -// callback: DialogInterface.() -> Unit = { dismiss() }, -// ) { -// neutralButton(ctx.getString(neutralText), callback) -// } -// -// /** -// * Set a listener to be invoked when the neutral button of the dialog is pressed. -// * -// * @param neutralText the text to display in the neutral button. -// * @param callback the callback that will be called if the neutral button is pressed. -// */ -// fun neutralButton( -// neutralText: CharSequence, -// callback: DialogInterface.() -> Unit = { dismiss() }, -// ) { -// checkBuilder() -// builder!!.setNeutralButton(neutralText, { dialog, which -> dialog.callback() }) -// } -// -// /** -// * Set a listener to be invoked when the positive button of the dialog is pressed. -// * -// * @param positiveText the text to display in the positive button. -// * @param callback the callback that will be called if the positive button is pressed. -// */ -// fun positiveButton(positiveText: Int, callback: DialogInterface.() -> Unit) { -// positiveButton(ctx.getString(positiveText), callback) -// } -// -// /** -// * Set a listener to be invoked when the positive button of the dialog is pressed. -// * -// * @param callback the callback that will be called if the positive button is pressed. -// */ -// fun okButton(callback: DialogInterface.() -> Unit) { -// positiveButton(ctx.getString(android.R.string.ok), callback) -// } -// -// /** -// * Set a listener to be invoked when the positive button of the dialog is pressed. -// * -// * @param callback the callback that will be called if the positive button is pressed. -// */ -// fun yesButton(callback: DialogInterface.() -> Unit) { -// positiveButton(ctx.getString(android.R.string.yes), callback) -// } -// -// /** -// * Set a listener to be invoked when the positive button of the dialog is pressed. -// * -// * @param positiveText the text to display in the positive button. -// * @param callback the callback that will be called if the positive button is pressed. -// */ -// fun positiveButton(positiveText: CharSequence, callback: DialogInterface.() -> Unit) { -// checkBuilder() -// builder!!.setPositiveButton(positiveText, { dialog, which -> dialog.callback() }) -// } -// -// /** -// * Set a listener to be invoked when the negative button of the dialog is pressed. -// * -// * @param negativeText the text to display in the negative button. -// * @param callback the callback that will be called if the negative button is pressed. -// */ -// fun negativeButton(negativeText: Int, callback: DialogInterface.() -> Unit = { dismiss() }) { -// negativeButton(ctx.getString(negativeText), callback) -// } -// -// /** -// * Set a listener to be invoked when the negative button of the dialog is pressed. -// * -// * @param callback the callback that will be called if the negative button is pressed. -// */ -// fun cancelButton(callback: DialogInterface.() -> Unit = { dismiss() }) { -// negativeButton(ctx.getString(android.R.string.cancel), callback) -// } -// -// /** -// * Set a listener to be invoked when the negative button of the dialog is pressed. -// * -// * @param callback the callback that will be called if the negative button is pressed. -// */ -// fun noButton(callback: DialogInterface.() -> Unit = { dismiss() }) { -// negativeButton(ctx.getString(android.R.string.no), callback) -// } -// -// /** -// * Set a listener to be invoked when the negative button of the dialog is pressed. -// * -// * @param negativeText the text to display in the negative button. -// * @param callback the callback that will be called if the negative button is pressed. -// */ -// fun negativeButton( -// negativeText: CharSequence, -// callback: DialogInterface.() -> Unit = { dismiss() }, -// ) { -// checkBuilder() -// builder!!.setNegativeButton(negativeText, { dialog, which -> dialog.callback() }) -// } -// -// fun items(itemsId: Int, callback: (which: Int) -> Unit) { -// items(ctx.resources!!.getTextArray(itemsId), callback) -// } -// -// fun items(items: List, callback: (which: Int) -> Unit) { -// items(items.toTypedArray(), callback) -// } -// -// fun items(items: Array, callback: (which: Int) -> Unit) { -// checkBuilder() -// builder!!.setItems(items, { dialog, which -> callback(which) }) -// } -// -// fun adapter(adapter: ListAdapter, callback: (which: Int) -> Unit) { -// checkBuilder() -// builder!!.setAdapter(adapter, { dialog, which -> callback(which) }) -// } -// -// fun adapter(cursor: Cursor, labelColumn: String, callback: (which: Int) -> Unit) { -// checkBuilder() -// builder!!.setCursor(cursor, { dialog, which -> callback(which) }, labelColumn) -// } -//} diff --git a/anko/src/main/java/org/jetbrains/anko/AndroidAlertBuilder.kt b/anko/src/main/java/org/jetbrains/anko/AndroidAlertBuilder.kt deleted file mode 100644 index cc7b991e..00000000 --- a/anko/src/main/java/org/jetbrains/anko/AndroidAlertBuilder.kt +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.anko - -import android.app.AlertDialog -import android.content.Context -import android.content.DialogInterface -import android.graphics.drawable.Drawable -import android.view.KeyEvent -import android.view.View -import org.jetbrains.anko.internals.AnkoInternals -import org.jetbrains.anko.internals.AnkoInternals.NO_GETTER -import kotlin.DeprecationLevel.ERROR - -val Android: AlertBuilderFactory = ::AndroidAlertBuilder - -internal class AndroidAlertBuilder(override val ctx: Context) : AlertBuilder { - private val builder = AlertDialog.Builder(ctx) - - override var title: CharSequence - @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() - set(value) { builder.setTitle(value) } - - override var titleResource: Int - @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() - set(value) { builder.setTitle(value) } - - override var message: CharSequence - @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() - set(value) { builder.setMessage(value) } - - override var messageResource: Int - @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() - set(value) { builder.setMessage(value) } - - override var icon: Drawable - @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() - set(value) { builder.setIcon(value) } - - override var iconResource: Int - @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() - set(value) { builder.setIcon(value) } - - override var customTitle: View - @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() - set(value) { builder.setCustomTitle(value) } - - override var customView: View - @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() - set(value) { builder.setView(value) } - - override var isCancelable: Boolean - @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() - set(value) { builder.setCancelable(value) } - - override fun onCancelled(handler: (DialogInterface) -> Unit) { - builder.setOnCancelListener(handler) - } - - override fun onKeyPressed(handler: (dialog: DialogInterface, keyCode: Int, e: KeyEvent) -> Boolean) { - builder.setOnKeyListener(handler) - } - - override fun positiveButton(buttonText: String, onClicked: (dialog: DialogInterface) -> Unit) { - builder.setPositiveButton(buttonText) { dialog, _ -> onClicked(dialog) } - } - - override fun positiveButton(buttonTextResource: Int, onClicked: (dialog: DialogInterface) -> Unit) { - builder.setPositiveButton(buttonTextResource) { dialog, _ -> onClicked(dialog) } - } - - override fun negativeButton(buttonText: String, onClicked: (dialog: DialogInterface) -> Unit) { - builder.setNegativeButton(buttonText) { dialog, _ -> onClicked(dialog) } - } - - override fun negativeButton(buttonTextResource: Int, onClicked: (dialog: DialogInterface) -> Unit) { - builder.setNegativeButton(buttonTextResource) { dialog, _ -> onClicked(dialog) } - } - - override fun neutralPressed(buttonText: String, onClicked: (dialog: DialogInterface) -> Unit) { - builder.setNeutralButton(buttonText) { dialog, _ -> onClicked(dialog) } - } - - override fun neutralPressed(buttonTextResource: Int, onClicked: (dialog: DialogInterface) -> Unit) { - builder.setNeutralButton(buttonTextResource) { dialog, _ -> onClicked(dialog) } - } - - override fun items(items: List, onItemSelected: (dialog: DialogInterface, index: Int) -> Unit) { - builder.setItems(Array(items.size) { i -> items[i].toString() }) { dialog, which -> - onItemSelected(dialog, which) - } - } - - override fun items(items: List, onItemSelected: (dialog: DialogInterface, item: T, index: Int) -> Unit) { - builder.setItems(Array(items.size) { i -> items[i].toString() }) { dialog, which -> - onItemSelected(dialog, items[which], which) - } - } - - override fun build(): AlertDialog = builder.create() - - override fun show(): AlertDialog = builder.show() -} \ No newline at end of file diff --git a/anko/src/main/java/org/jetbrains/anko/AndroidDialogs.kt b/anko/src/main/java/org/jetbrains/anko/AndroidDialogs.kt deleted file mode 100644 index 15928d98..00000000 --- a/anko/src/main/java/org/jetbrains/anko/AndroidDialogs.kt +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright 2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@file:Suppress("NOTHING_TO_INLINE", "unused") - -package org.jetbrains.anko - -import android.app.AlertDialog -import android.content.Context -import android.content.DialogInterface -import androidx.fragment.app.Fragment - -inline fun AnkoContext<*>.alert( - message: CharSequence, - title: CharSequence? = null, - noinline init: (AlertBuilder.() -> Unit)? = null, -) = ctx.alert(message, title, init) - -inline fun Fragment.alert( - message: CharSequence, - title: CharSequence? = null, - noinline init: (AlertBuilder.() -> Unit)? = null, -) = requireActivity().alert(message, title, init) - -fun Context.alert( - message: CharSequence, - title: CharSequence? = null, - init: (AlertBuilder.() -> Unit)? = null, -): AlertBuilder { - return AndroidAlertBuilder(this).apply { - if (title != null) { - this.title = title - } - this.message = message - if (init != null) init() - } -} - -inline fun AnkoContext<*>.alert( - message: Int, - title: Int? = null, - noinline init: (AlertBuilder.() -> Unit)? = null, -) = ctx.alert(message, title, init) - -inline fun Fragment.alert( - message: Int, - title: Int? = null, - noinline init: (AlertBuilder.() -> Unit)? = null, -) = requireActivity().alert(message, title, init) - -fun Context.alert( - messageResource: Int, - titleResource: Int? = null, - init: (AlertBuilder.() -> Unit)? = null, -): AlertBuilder { - return AndroidAlertBuilder(this).apply { - if (titleResource != null) { - this.titleResource = titleResource - } - this.messageResource = messageResource - if (init != null) init() - } -} - -inline fun AnkoContext<*>.alert(noinline init: AlertBuilder.() -> Unit) = - ctx.alert(init) - -inline fun Fragment.alert(noinline init: AlertBuilder.() -> Unit) = - requireActivity().alert(init) - -fun Context.alert(init: AlertBuilder.() -> Unit): AlertBuilder = - AndroidAlertBuilder(this).apply { init() } - -//@Deprecated(message = "Android progress dialogs are deprecated") -//inline fun AnkoContext<*>.progressDialog( -// message: Int? = null, -// title: Int? = null, -// noinline init: (ProgressDialog.() -> Unit)? = null, -//) = ctx.progressDialog(message, title, init) -// -//@Deprecated(message = "Android progress dialogs are deprecated") -//inline fun Fragment.progressDialog( -// message: Int? = null, -// title: Int? = null, -// noinline init: (ProgressDialog.() -> Unit)? = null, -//) = requireActivity().progressDialog(message, title, init) -// -//@Deprecated(message = "Android progress dialogs are deprecated") -//fun Context.progressDialog( -// message: Int? = null, -// title: Int? = null, -// init: (ProgressDialog.() -> Unit)? = null, -//) = progressDialog(false, message?.let { getString(it) }, title?.let { getString(it) }, init) -// -//@Deprecated(message = "Android progress dialogs are deprecated") -//inline fun AnkoContext<*>.indeterminateProgressDialog( -// message: Int? = null, -// title: Int? = null, -// noinline init: (ProgressDialog.() -> Unit)? = null, -//) = ctx.indeterminateProgressDialog(message, title, init) -// -//@Deprecated(message = "Android progress dialogs are deprecated") -//inline fun Fragment.indeterminateProgressDialog( -// message: Int? = null, -// title: Int? = null, -// noinline init: (ProgressDialog.() -> Unit)? = null, -//) = requireActivity().indeterminateProgressDialog(message, title, init) -// -//@Deprecated(message = "Android progress dialogs are deprecated") -//fun Context.indeterminateProgressDialog( -// message: Int? = null, -// title: Int? = null, -// init: (ProgressDialog.() -> Unit)? = null, -//) = progressDialog(true, message?.let { getString(it) }, title?.let { getString(it) }, init) -// -//@Deprecated(message = "Android progress dialogs are deprecated") -//inline fun AnkoContext<*>.progressDialog( -// message: CharSequence? = null, -// title: CharSequence? = null, -// noinline init: (ProgressDialog.() -> Unit)? = null, -//) = ctx.progressDialog(message, title, init) -// -//@Deprecated(message = "Android progress dialogs are deprecated") -//inline fun Fragment.progressDialog( -// message: CharSequence? = null, -// title: CharSequence? = null, -// noinline init: (ProgressDialog.() -> Unit)? = null, -//) = requireActivity().progressDialog(message, title, init) -// -//@Deprecated(message = "Android progress dialogs are deprecated") -//fun Context.progressDialog( -// message: CharSequence? = null, -// title: CharSequence? = null, -// init: (ProgressDialog.() -> Unit)? = null, -//) = progressDialog(false, message, title, init) -// -//@Deprecated(message = "Android progress dialogs are deprecated") -//inline fun AnkoContext<*>.indeterminateProgressDialog( -// message: CharSequence? = null, -// title: CharSequence? = null, -// noinline init: (ProgressDialog.() -> Unit)? = null, -//) = ctx.indeterminateProgressDialog(message, title, init) -// -//@Deprecated(message = "Android progress dialogs are deprecated") -//inline fun Fragment.indeterminateProgressDialog( -// message: CharSequence? = null, -// title: CharSequence? = null, -// noinline init: (ProgressDialog.() -> Unit)? = null, -//) = requireActivity().indeterminateProgressDialog(message, title, init) -// -//@Deprecated(message = "Android progress dialogs are deprecated") -//fun Context.indeterminateProgressDialog( -// message: CharSequence? = null, -// title: CharSequence? = null, -// init: (ProgressDialog.() -> Unit)? = null, -//) = progressDialog(true, message, title, init) -// -//@Deprecated(message = "Android progress dialogs are deprecated") -//private fun Context.progressDialog( -// indeterminate: Boolean, -// message: CharSequence? = null, -// title: CharSequence? = null, -// init: (ProgressDialog.() -> Unit)? = null, -//) = ProgressDialog(this).apply { -// isIndeterminate = indeterminate -// if (!indeterminate) setProgressStyle(ProgressDialog.STYLE_HORIZONTAL) -// if (message != null) setMessage(message) -// if (title != null) setTitle(title) -// if (init != null) init() -// show() -//} diff --git a/anko/src/main/java/org/jetbrains/anko/AndroidSelectors.kt b/anko/src/main/java/org/jetbrains/anko/AndroidSelectors.kt deleted file mode 100644 index 8279c0f6..00000000 --- a/anko/src/main/java/org/jetbrains/anko/AndroidSelectors.kt +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@file:Suppress("NOTHING_TO_INLINE", "unused") - -package org.jetbrains.anko - -import android.content.Context -import android.content.DialogInterface -import androidx.fragment.app.Fragment - -inline fun AnkoContext<*>.selector( - title: CharSequence? = null, - items: List, - noinline onClick: (DialogInterface, Int) -> Unit, -) = ctx.selector(title, items, onClick) - -inline fun Fragment.selector( - title: CharSequence? = null, - items: List, - noinline onClick: (DialogInterface, Int) -> Unit, -) = requireActivity().selector(title, items, onClick) - -fun Context.selector( - title: CharSequence? = null, - items: List, - onClick: (DialogInterface, Int) -> Unit, -) { - with(AndroidAlertBuilder(this)) { - if (title != null) { - this.title = title - } - items(items, onClick) - show() - } -} diff --git a/anko/src/main/java/org/jetbrains/anko/Async.kt b/anko/src/main/java/org/jetbrains/anko/Async.kt index 66ddee9d..2ab1d5a8 100644 --- a/anko/src/main/java/org/jetbrains/anko/Async.kt +++ b/anko/src/main/java/org/jetbrains/anko/Async.kt @@ -1,209 +1,209 @@ -/* - * Copyright 2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@file:Suppress("unused") - -package org.jetbrains.anko - -import android.app.Activity -import android.content.Context -import android.os.Handler -import android.os.Looper -import androidx.fragment.app.Fragment -import java.lang.ref.WeakReference -import java.util.concurrent.ExecutorService -import java.util.concurrent.Executors -import java.util.concurrent.Future - -/** - * Execute [f] on the application UI thread. - */ -fun Context.runOnUiThread(f: Context.() -> Unit) { - if (Looper.getMainLooper() === Looper.myLooper()) f() else ContextHelper.handler.post { f() } -} - -/** - * Execute [f] on the application UI thread. - */ -inline fun Fragment.runOnUiThread(crossinline f: () -> Unit) { - requireContext().runOnUiThread { f() } -} - -class AnkoAsyncContext(val weakRef: WeakReference) - -/** - * Execute [f] on the application UI thread. - * If the [doAsync] receiver still exists (was not collected by GC), - * [f] gets it as a parameter ([f] gets null if the receiver does not exist anymore). - */ -fun AnkoAsyncContext.onComplete(f: (T?) -> Unit) { - val ref = weakRef.get() - if (Looper.getMainLooper() === Looper.myLooper()) { - f(ref) - } else { - ContextHelper.handler.post { f(ref) } - } -} - -/** - * Execute [f] on the application UI thread. - * [doAsync] receiver will be passed to [f]. - * If the receiver does not exist anymore (it was collected by GC), [f] will not be executed. - */ -fun AnkoAsyncContext.uiThread(f: (T) -> Unit): Boolean { - val ref = weakRef.get() ?: return false - if (Looper.getMainLooper() === Looper.myLooper()) { - f(ref) - } else { - ContextHelper.handler.post { f(ref) } - } - return true -} - -/** - * Execute [f] on the application UI thread if the underlying [Activity] still exists and is not finished. - * The receiver [Activity] will be passed to [f]. - * If it is not exist anymore or if it was finished, [f] will not be called. - */ -fun AnkoAsyncContext.activityUiThread(f: (T) -> Unit): Boolean { - val activity = weakRef.get() ?: return false - if (activity.isFinishing) return false - activity.runOnUiThread { f(activity) } - return true -} - -fun AnkoAsyncContext.activityUiThreadWithContext(f: Context.(T) -> Unit): Boolean { - val activity = weakRef.get() ?: return false - if (activity.isFinishing) return false - activity.runOnUiThread { activity.f(activity) } - return true -} - -@JvmName("activityContextUiThread") -fun AnkoAsyncContext>.activityUiThread(f: (T) -> Unit): Boolean { - val activity = weakRef.get()?.owner ?: return false - if (activity.isFinishing) return false - activity.runOnUiThread { f(activity) } - return true -} - -@JvmName("activityContextUiThreadWithContext") -fun AnkoAsyncContext>.activityUiThreadWithContext(f: Context.(T) -> Unit): Boolean { - val activity = weakRef.get()?.owner ?: return false - if (activity.isFinishing) return false - activity.runOnUiThread { activity.f(activity) } - return true -} - -@Deprecated(message = "Use support library fragments instead. Framework fragments were deprecated in API 28.") -fun AnkoAsyncContext.fragmentUiThread(f: (T) -> Unit): Boolean { - val fragment = weakRef.get() ?: return false - if (fragment.isDetached) return false - val activity = fragment.activity ?: return false - activity.runOnUiThread { f(fragment) } - return true -} - -@Deprecated(message = "Use support library fragments instead. Framework fragments were deprecated in API 28.") -fun AnkoAsyncContext.fragmentUiThreadWithContext(f: Context.(T) -> Unit): Boolean { - val fragment = weakRef.get() ?: return false - if (fragment.isDetached) return false - val activity = fragment.activity ?: return false - activity.runOnUiThread { activity.f(fragment) } - return true -} - -private val crashLogger = { throwable: Throwable -> throwable.printStackTrace() } - -/** - * Execute [task] asynchronously. - * - * @param exceptionHandler optional exception handler. - * If defined, any exceptions thrown inside [task] will be passed to it. If not, exceptions will be ignored. - * @param task the code to execute asynchronously. - */ -fun T.doAsync( - exceptionHandler: ((Throwable) -> Unit)? = crashLogger, - task: AnkoAsyncContext.() -> Unit, -): Future { - val context = AnkoAsyncContext(WeakReference(this)) - return BackgroundExecutor.submit { - return@submit try { - context.task() - } catch (thr: Throwable) { - val result = exceptionHandler?.invoke(thr) - result ?: Unit - } - } -} - -fun T.doAsync( - exceptionHandler: ((Throwable) -> Unit)? = crashLogger, - executorService: ExecutorService, - task: AnkoAsyncContext.() -> Unit, -): Future { - val context = AnkoAsyncContext(WeakReference(this)) - return executorService.submit { - try { - context.task() - } catch (thr: Throwable) { - exceptionHandler?.invoke(thr) - } - } -} - -fun T.doAsyncResult( - exceptionHandler: ((Throwable) -> Unit)? = crashLogger, - task: AnkoAsyncContext.() -> R, -): Future { - val context = AnkoAsyncContext(WeakReference(this)) - return BackgroundExecutor.submit { - try { - context.task() - } catch (thr: Throwable) { - exceptionHandler?.invoke(thr) - throw thr - } - } -} - -fun T.doAsyncResult( - exceptionHandler: ((Throwable) -> Unit)? = crashLogger, - executorService: ExecutorService, - task: AnkoAsyncContext.() -> R, -): Future { - val context = AnkoAsyncContext(WeakReference(this)) - return executorService.submit { - try { - context.task() - } catch (thr: Throwable) { - exceptionHandler?.invoke(thr) - throw thr - } - } -} - -internal object BackgroundExecutor { - @Suppress("MemberVisibilityCanBePrivate") - var executor: ExecutorService = - Executors.newScheduledThreadPool(2 * Runtime.getRuntime().availableProcessors()) - - fun submit(task: () -> T): Future = executor.submit(task) -} - -private object ContextHelper { - val handler = Handler(Looper.getMainLooper()) -} +///* +// * Copyright 2016 JetBrains s.r.o. +// * +// * Licensed under the Apache License, Version 2.0 (the "License"); +// * you may not use this file except in compliance with the License. +// * You may obtain a copy of the License at +// * +// * http://www.apache.org/licenses/LICENSE-2.0 +// * +// * Unless required by applicable law or agreed to in writing, software +// * distributed under the License is distributed on an "AS IS" BASIS, +// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// * See the License for the specific language governing permissions and +// * limitations under the License. +// */ +// +//@file:Suppress("unused") +// +//package org.jetbrains.anko +// +//import android.app.Activity +//import android.content.Context +//import android.os.Handler +//import android.os.Looper +//import androidx.fragment.app.Fragment +//import java.lang.ref.WeakReference +//import java.util.concurrent.ExecutorService +//import java.util.concurrent.Executors +//import java.util.concurrent.Future +// +///** +// * Execute [f] on the application UI thread. +// */ +//fun Context.runOnUiThread(f: Context.() -> Unit) { +// if (Looper.getMainLooper() === Looper.myLooper()) f() else ContextHelper.handler.post { f() } +//} +// +///** +// * Execute [f] on the application UI thread. +// */ +//inline fun Fragment.runOnUiThread(crossinline f: () -> Unit) { +// requireContext().runOnUiThread { f() } +//} +// +//class AnkoAsyncContext(val weakRef: WeakReference) +// +///** +// * Execute [f] on the application UI thread. +// * If the [doAsync] receiver still exists (was not collected by GC), +// * [f] gets it as a parameter ([f] gets null if the receiver does not exist anymore). +// */ +//fun AnkoAsyncContext.onComplete(f: (T?) -> Unit) { +// val ref = weakRef.get() +// if (Looper.getMainLooper() === Looper.myLooper()) { +// f(ref) +// } else { +// ContextHelper.handler.post { f(ref) } +// } +//} +// +///** +// * Execute [f] on the application UI thread. +// * [doAsync] receiver will be passed to [f]. +// * If the receiver does not exist anymore (it was collected by GC), [f] will not be executed. +// */ +//fun AnkoAsyncContext.uiThread(f: (T) -> Unit): Boolean { +// val ref = weakRef.get() ?: return false +// if (Looper.getMainLooper() === Looper.myLooper()) { +// f(ref) +// } else { +// ContextHelper.handler.post { f(ref) } +// } +// return true +//} +// +///** +// * Execute [f] on the application UI thread if the underlying [Activity] still exists and is not finished. +// * The receiver [Activity] will be passed to [f]. +// * If it is not exist anymore or if it was finished, [f] will not be called. +// */ +//fun AnkoAsyncContext.activityUiThread(f: (T) -> Unit): Boolean { +// val activity = weakRef.get() ?: return false +// if (activity.isFinishing) return false +// activity.runOnUiThread { f(activity) } +// return true +//} +// +//fun AnkoAsyncContext.activityUiThreadWithContext(f: Context.(T) -> Unit): Boolean { +// val activity = weakRef.get() ?: return false +// if (activity.isFinishing) return false +// activity.runOnUiThread { activity.f(activity) } +// return true +//} +// +//@JvmName("activityContextUiThread") +//fun AnkoAsyncContext>.activityUiThread(f: (T) -> Unit): Boolean { +// val activity = weakRef.get()?.owner ?: return false +// if (activity.isFinishing) return false +// activity.runOnUiThread { f(activity) } +// return true +//} +// +//@JvmName("activityContextUiThreadWithContext") +//fun AnkoAsyncContext>.activityUiThreadWithContext(f: Context.(T) -> Unit): Boolean { +// val activity = weakRef.get()?.owner ?: return false +// if (activity.isFinishing) return false +// activity.runOnUiThread { activity.f(activity) } +// return true +//} +// +//@Deprecated(message = "Use support library fragments instead. Framework fragments were deprecated in API 28.") +//fun AnkoAsyncContext.fragmentUiThread(f: (T) -> Unit): Boolean { +// val fragment = weakRef.get() ?: return false +// if (fragment.isDetached) return false +// val activity = fragment.activity ?: return false +// activity.runOnUiThread { f(fragment) } +// return true +//} +// +//@Deprecated(message = "Use support library fragments instead. Framework fragments were deprecated in API 28.") +//fun AnkoAsyncContext.fragmentUiThreadWithContext(f: Context.(T) -> Unit): Boolean { +// val fragment = weakRef.get() ?: return false +// if (fragment.isDetached) return false +// val activity = fragment.activity ?: return false +// activity.runOnUiThread { activity.f(fragment) } +// return true +//} +// +//private val crashLogger = { throwable: Throwable -> throwable.printStackTrace() } +// +///** +// * Execute [task] asynchronously. +// * +// * @param exceptionHandler optional exception handler. +// * If defined, any exceptions thrown inside [task] will be passed to it. If not, exceptions will be ignored. +// * @param task the code to execute asynchronously. +// */ +//fun T.doAsync( +// exceptionHandler: ((Throwable) -> Unit)? = crashLogger, +// task: AnkoAsyncContext.() -> Unit, +//): Future { +// val context = AnkoAsyncContext(WeakReference(this)) +// return BackgroundExecutor.submit { +// return@submit try { +// context.task() +// } catch (thr: Throwable) { +// val result = exceptionHandler?.invoke(thr) +// result ?: Unit +// } +// } +//} +// +//fun T.doAsync( +// exceptionHandler: ((Throwable) -> Unit)? = crashLogger, +// executorService: ExecutorService, +// task: AnkoAsyncContext.() -> Unit, +//): Future { +// val context = AnkoAsyncContext(WeakReference(this)) +// return executorService.submit { +// try { +// context.task() +// } catch (thr: Throwable) { +// exceptionHandler?.invoke(thr) +// } +// } +//} +// +//fun T.doAsyncResult( +// exceptionHandler: ((Throwable) -> Unit)? = crashLogger, +// task: AnkoAsyncContext.() -> R, +//): Future { +// val context = AnkoAsyncContext(WeakReference(this)) +// return BackgroundExecutor.submit { +// try { +// context.task() +// } catch (thr: Throwable) { +// exceptionHandler?.invoke(thr) +// throw thr +// } +// } +//} +// +//fun T.doAsyncResult( +// exceptionHandler: ((Throwable) -> Unit)? = crashLogger, +// executorService: ExecutorService, +// task: AnkoAsyncContext.() -> R, +//): Future { +// val context = AnkoAsyncContext(WeakReference(this)) +// return executorService.submit { +// try { +// context.task() +// } catch (thr: Throwable) { +// exceptionHandler?.invoke(thr) +// throw thr +// } +// } +//} +// +//internal object BackgroundExecutor { +// @Suppress("MemberVisibilityCanBePrivate") +// var executor: ExecutorService = +// Executors.newScheduledThreadPool(2 * Runtime.getRuntime().availableProcessors()) +// +// fun submit(task: () -> T): Future = executor.submit(task) +//} +// +//private object ContextHelper { +// val handler = Handler(Looper.getMainLooper()) +//} diff --git a/anko/src/main/java/org/jetbrains/anko/ContextUtils.kt b/anko/src/main/java/org/jetbrains/anko/ContextUtils.kt index 51221899..99526dd6 100644 --- a/anko/src/main/java/org/jetbrains/anko/ContextUtils.kt +++ b/anko/src/main/java/org/jetbrains/anko/ContextUtils.kt @@ -13,9 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -@file:Suppress("unused", "NOTHING_TO_INLINE") - package org.jetbrains.anko import android.app.Activity diff --git a/anko/src/main/java/org/jetbrains/anko/CustomLayoutProperties.kt b/anko/src/main/java/org/jetbrains/anko/CustomLayoutProperties.kt index cd49603f..17f16d73 100644 --- a/anko/src/main/java/org/jetbrains/anko/CustomLayoutProperties.kt +++ b/anko/src/main/java/org/jetbrains/anko/CustomLayoutProperties.kt @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -@file:Suppress("NOTHING_TO_INLINE", "unused", "TopLevelPropertyNaming") - +@file:Suppress("TopLevelPropertyNaming") package org.jetbrains.anko import android.view.ViewGroup diff --git a/anko/src/main/java/org/jetbrains/anko/CustomViewProperties.kt b/anko/src/main/java/org/jetbrains/anko/CustomViewProperties.kt index 87ba9a5f..48abff48 100644 --- a/anko/src/main/java/org/jetbrains/anko/CustomViewProperties.kt +++ b/anko/src/main/java/org/jetbrains/anko/CustomViewProperties.kt @@ -13,9 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -@file:Suppress("unused") - package org.jetbrains.anko import android.graphics.drawable.Drawable diff --git a/anko/src/main/java/org/jetbrains/anko/CustomViews.kt b/anko/src/main/java/org/jetbrains/anko/CustomViews.kt index 05822b13..96535a91 100644 --- a/anko/src/main/java/org/jetbrains/anko/CustomViews.kt +++ b/anko/src/main/java/org/jetbrains/anko/CustomViews.kt @@ -13,8 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -@file:Suppress("NOTHING_TO_INLINE", "unused", "MatchingDeclarationName", "ClassNaming") +@file:Suppress("MatchingDeclarationName", "ClassNaming") package org.jetbrains.anko @@ -43,7 +42,7 @@ internal object `$$Anko$Factories$CustomViews` { } } -inline fun ViewManager.verticalLayout(theme: Int = 0): LinearLayout = verticalLayout(theme) {} +fun ViewManager.verticalLayout(theme: Int = 0): LinearLayout = verticalLayout(theme) {} inline fun ViewManager.verticalLayout( theme: Int = 0, init: (@AnkoViewDslMarker _LinearLayout).() -> Unit, @@ -51,7 +50,7 @@ inline fun ViewManager.verticalLayout( return ankoView(`$$Anko$Factories$CustomViews`.VERTICAL_LAYOUT_FACTORY, theme, init) } -inline fun Context.verticalLayout(theme: Int = 0): LinearLayout = verticalLayout(theme) {} +fun Context.verticalLayout(theme: Int = 0): LinearLayout = verticalLayout(theme) {} inline fun Context.verticalLayout( theme: Int = 0, init: (@AnkoViewDslMarker _LinearLayout).() -> Unit, @@ -59,7 +58,7 @@ inline fun Context.verticalLayout( return ankoView(`$$Anko$Factories$CustomViews`.VERTICAL_LAYOUT_FACTORY, theme, init) } -inline fun Activity.verticalLayout(theme: Int = 0): LinearLayout = verticalLayout(theme) {} +fun Activity.verticalLayout(theme: Int = 0): LinearLayout = verticalLayout(theme) {} inline fun Activity.verticalLayout( theme: Int = 0, init: (@AnkoViewDslMarker _LinearLayout).() -> Unit, @@ -67,7 +66,7 @@ inline fun Activity.verticalLayout( return ankoView(`$$Anko$Factories$CustomViews`.VERTICAL_LAYOUT_FACTORY, theme, init) } -inline fun ViewManager.editText(constraints: InputConstraints, theme: Int = 0): EditText = +fun ViewManager.editText(constraints: InputConstraints, theme: Int = 0): EditText = editText(constraints, theme) {} inline fun ViewManager.editText( @@ -80,7 +79,7 @@ inline fun ViewManager.editText( return v } -inline fun Context.editText(constraints: InputConstraints, theme: Int = 0): EditText = +fun Context.editText(constraints: InputConstraints, theme: Int = 0): EditText = editText(constraints, theme) {} inline fun Context.editText( @@ -93,7 +92,7 @@ inline fun Context.editText( return v } -inline fun Activity.editText(constraints: InputConstraints, theme: Int = 0): EditText = +fun Activity.editText(constraints: InputConstraints, theme: Int = 0): EditText = editText(constraints, theme) {} inline fun Activity.editText( @@ -106,7 +105,7 @@ inline fun Activity.editText( return v } -inline fun ViewManager.horizontalProgressBar(theme: Int = 0): ProgressBar = +fun ViewManager.horizontalProgressBar(theme: Int = 0): ProgressBar = horizontalProgressBar(theme) {} inline fun ViewManager.horizontalProgressBar( @@ -116,7 +115,7 @@ inline fun ViewManager.horizontalProgressBar( return ankoView(`$$Anko$Factories$CustomViews`.HORIZONTAL_PROGRESS_BAR_FACTORY, theme, init) } -inline fun Context.horizontalProgressBar(theme: Int = 0): ProgressBar = +fun Context.horizontalProgressBar(theme: Int = 0): ProgressBar = horizontalProgressBar(theme) {} inline fun Context.horizontalProgressBar( @@ -126,7 +125,7 @@ inline fun Context.horizontalProgressBar( return ankoView(`$$Anko$Factories$CustomViews`.HORIZONTAL_PROGRESS_BAR_FACTORY, theme, init) } -inline fun Activity.horizontalProgressBar(theme: Int = 0): ProgressBar = +fun Activity.horizontalProgressBar(theme: Int = 0): ProgressBar = horizontalProgressBar(theme) {} inline fun Activity.horizontalProgressBar( @@ -136,7 +135,7 @@ inline fun Activity.horizontalProgressBar( return ankoView(`$$Anko$Factories$CustomViews`.HORIZONTAL_PROGRESS_BAR_FACTORY, theme, init) } -inline fun ViewManager.include(layoutId: Int): T = include(layoutId, {}) +fun ViewManager.include(layoutId: Int): T = include(layoutId, {}) inline fun ViewManager.include( layoutId: Int, init: (@AnkoViewDslMarker T).() -> Unit, @@ -145,20 +144,20 @@ inline fun ViewManager.include( return ankoView({ ctx -> ctx.layoutInflater.inflate(layoutId, null) as T }, 0) { init() } } -inline fun ViewGroup.include(layoutId: Int): T = include(layoutId, {}) +fun ViewGroup.include(layoutId: Int): T = include(layoutId, {}) inline fun ViewGroup.include(layoutId: Int, init: (@AnkoViewDslMarker T).() -> Unit): T { @Suppress("UNCHECKED_CAST") return ankoView({ ctx -> ctx.layoutInflater.inflate(layoutId, this, false) as T }, 0) { init() } } -inline fun Context.include(layoutId: Int): T = include(layoutId, {}) +fun Context.include(layoutId: Int): T = include(layoutId, {}) inline fun Context.include(layoutId: Int, init: (@AnkoViewDslMarker T).() -> Unit): T { @Suppress("UNCHECKED_CAST") return ankoView({ ctx -> ctx.layoutInflater.inflate(layoutId, null) as T }, 0) { init() } } -inline fun Activity.include(layoutId: Int): T = include(layoutId, {}) +fun Activity.include(layoutId: Int): T = include(layoutId, {}) inline fun Activity.include(layoutId: Int, init: (@AnkoViewDslMarker T).() -> Unit): T { @Suppress("UNCHECKED_CAST") return ankoView({ ctx -> ctx.layoutInflater.inflate(layoutId, null) as T }, 0) { init() } -} \ No newline at end of file +} diff --git a/anko/src/main/java/org/jetbrains/anko/Dialogs.kt b/anko/src/main/java/org/jetbrains/anko/Dialogs.kt deleted file mode 100644 index 97f614e9..00000000 --- a/anko/src/main/java/org/jetbrains/anko/Dialogs.kt +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@file:Suppress("NOTHING_TO_INLINE", "unused") - -package org.jetbrains.anko - -import android.content.Context -import android.content.DialogInterface -import androidx.fragment.app.Fragment - -typealias AlertBuilderFactory = (Context) -> AlertBuilder - -inline fun AnkoContext<*>.alert( - noinline factory: AlertBuilderFactory, - message: String, - title: String? = null, - noinline init: (AlertBuilder.() -> Unit)? = null, -) = ctx.alert(factory, message, title, init) - -inline fun Fragment.alert( - noinline factory: AlertBuilderFactory, - message: String, - title: String? = null, - noinline init: (AlertBuilder.() -> Unit)? = null, -) = requireActivity().alert(factory, message, title, init) - -fun Context.alert( - factory: AlertBuilderFactory, - message: String, - title: String? = null, - init: (AlertBuilder.() -> Unit)? = null, -): AlertBuilder { - return factory(this).apply { - if (title != null) { - this.title = title - } - this.message = message - if (init != null) init() - } -} - -inline fun AnkoContext<*>.alert( - noinline factory: AlertBuilderFactory, - message: Int, - title: Int? = null, - noinline init: (AlertBuilder.() -> Unit)? = null, -) = ctx.alert(factory, message, title, init) - -inline fun Fragment.alert( - noinline factory: AlertBuilderFactory, - message: Int, - title: Int? = null, - noinline init: (AlertBuilder.() -> Unit)? = null, -) = requireActivity().alert(factory, message, title, init) - -fun Context.alert( - factory: AlertBuilderFactory, - messageResource: Int, - titleResource: Int? = null, - init: (AlertBuilder.() -> Unit)? = null, -): AlertBuilder { - return factory(this).apply { - if (titleResource != null) { - this.titleResource = titleResource - } - this.messageResource = messageResource - if (init != null) init() - } -} - -inline fun AnkoContext<*>.alert( - noinline factory: AlertBuilderFactory, - noinline init: AlertBuilder.() -> Unit, -) = ctx.alert(factory, init) - -inline fun Fragment.alert( - noinline factory: AlertBuilderFactory, - noinline init: AlertBuilder.() -> Unit, -) = requireActivity().alert(factory, init) - -fun Context.alert( - factory: AlertBuilderFactory, - init: AlertBuilder.() -> Unit, -): AlertBuilder = factory(this).apply { init() } diff --git a/anko/src/main/java/org/jetbrains/anko/Dimensions.kt b/anko/src/main/java/org/jetbrains/anko/Dimensions.kt index dafb6323..9f348b11 100644 --- a/anko/src/main/java/org/jetbrains/anko/Dimensions.kt +++ b/anko/src/main/java/org/jetbrains/anko/Dimensions.kt @@ -13,9 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -@file:Suppress("NOTHING_TO_INLINE", "unused") - package org.jetbrains.anko import android.content.Context @@ -50,28 +47,28 @@ fun Context.px2sp(px: Int): Float = px.toFloat() / resources.displayMetrics.scal fun Context.dimen(@DimenRes resource: Int): Int = resources.getDimensionPixelSize(resource) //the same for nested DSL components -inline fun AnkoContext<*>.dip(value: Int): Int = ctx.dip(value) -inline fun AnkoContext<*>.dip(value: Float): Int = ctx.dip(value) -inline fun AnkoContext<*>.sp(value: Int): Int = ctx.sp(value) -inline fun AnkoContext<*>.sp(value: Float): Int = ctx.sp(value) -inline fun AnkoContext<*>.px2dip(px: Int): Float = ctx.px2dip(px) -inline fun AnkoContext<*>.px2sp(px: Int): Float = ctx.px2sp(px) -inline fun AnkoContext<*>.dimen(@DimenRes resource: Int): Int = ctx.dimen(resource) +fun AnkoContext<*>.dip(value: Int): Int = ctx.dip(value) +fun AnkoContext<*>.dip(value: Float): Int = ctx.dip(value) +fun AnkoContext<*>.sp(value: Int): Int = ctx.sp(value) +fun AnkoContext<*>.sp(value: Float): Int = ctx.sp(value) +fun AnkoContext<*>.px2dip(px: Int): Float = ctx.px2dip(px) +fun AnkoContext<*>.px2sp(px: Int): Float = ctx.px2sp(px) +fun AnkoContext<*>.dimen(@DimenRes resource: Int): Int = ctx.dimen(resource) //the same for the views -inline fun View.dip(value: Int): Int = context.dip(value) -inline fun View.dip(value: Float): Int = context.dip(value) -inline fun View.sp(value: Int): Int = context.sp(value) -inline fun View.sp(value: Float): Int = context.sp(value) -inline fun View.px2dip(px: Int): Float = context.px2dip(px) -inline fun View.px2sp(px: Int): Float = context.px2sp(px) -inline fun View.dimen(@DimenRes resource: Int): Int = context.dimen(resource) +fun View.dip(value: Int): Int = context.dip(value) +fun View.dip(value: Float): Int = context.dip(value) +fun View.sp(value: Int): Int = context.sp(value) +fun View.sp(value: Float): Int = context.sp(value) +fun View.px2dip(px: Int): Float = context.px2dip(px) +fun View.px2sp(px: Int): Float = context.px2sp(px) +fun View.dimen(@DimenRes resource: Int): Int = context.dimen(resource) //the same for Fragments -inline fun Fragment.dip(value: Int): Int = requireContext().dip(value) -inline fun Fragment.dip(value: Float): Int = requireContext().dip(value) -inline fun Fragment.sp(value: Int): Int = requireContext().sp(value) -inline fun Fragment.sp(value: Float): Int = requireContext().sp(value) -inline fun Fragment.px2dip(px: Int): Float = requireContext().px2dip(px) -inline fun Fragment.px2sp(px: Int): Float = requireContext().px2sp(px) -inline fun Fragment.dimen(@DimenRes resource: Int): Int = requireContext().dimen(resource) +fun Fragment.dip(value: Int): Int = requireContext().dip(value) +fun Fragment.dip(value: Float): Int = requireContext().dip(value) +fun Fragment.sp(value: Int): Int = requireContext().sp(value) +fun Fragment.sp(value: Float): Int = requireContext().sp(value) +fun Fragment.px2dip(px: Int): Float = requireContext().px2dip(px) +fun Fragment.px2sp(px: Int): Float = requireContext().px2sp(px) +fun Fragment.dimen(@DimenRes resource: Int): Int = requireContext().dimen(resource) diff --git a/anko/src/main/java/org/jetbrains/anko/Helpers.kt b/anko/src/main/java/org/jetbrains/anko/Helpers.kt index 3a34e180..9da082e8 100644 --- a/anko/src/main/java/org/jetbrains/anko/Helpers.kt +++ b/anko/src/main/java/org/jetbrains/anko/Helpers.kt @@ -13,9 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -@file:Suppress("unused") - package org.jetbrains.anko import android.app.Activity diff --git a/anko/src/main/java/org/jetbrains/anko/InputConstraints.kt b/anko/src/main/java/org/jetbrains/anko/InputConstraints.kt index 7159b98b..095e4a95 100644 --- a/anko/src/main/java/org/jetbrains/anko/InputConstraints.kt +++ b/anko/src/main/java/org/jetbrains/anko/InputConstraints.kt @@ -13,12 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -@file:Suppress("unused") package org.jetbrains.anko import android.text.InputType enum class InputConstraints(val value: Int) { PASSWORD(InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_PASSWORD) -} \ No newline at end of file +} diff --git a/anko/src/main/java/org/jetbrains/anko/Intents.kt b/anko/src/main/java/org/jetbrains/anko/Intents.kt index eb5d56e5..5b2bb4d1 100644 --- a/anko/src/main/java/org/jetbrains/anko/Intents.kt +++ b/anko/src/main/java/org/jetbrains/anko/Intents.kt @@ -13,9 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -@file:Suppress("NOTHING_TO_INLINE", "unused") - package org.jetbrains.anko import android.annotation.SuppressLint @@ -50,11 +47,10 @@ inline fun Activity.startActivityForResult( inline fun Fragment.startActivityForResult( requestCode: Int, vararg params: Pair, -) = - startActivityForResult( - AnkoInternals.createIntent(requireActivity(), T::class.java, params), - requestCode - ) +) = startActivityForResult( + AnkoInternals.createIntent(requireActivity(), T::class.java, params), + requestCode +) inline fun Context.startService(vararg params: Pair) = AnkoInternals.internalStartService(this, T::class.java, params) @@ -88,14 +84,14 @@ inline fun Fragment.intentFor(vararg params: Pair.browse(url: String, newTask: Boolean = false) = ctx.browse(url, newTask) +fun AnkoContext<*>.browse(url: String, newTask: Boolean = false) = ctx.browse(url, newTask) -inline fun Fragment.browse(url: String, newTask: Boolean = false) = +fun Fragment.browse(url: String, newTask: Boolean = false) = requireActivity().browse(url, newTask) fun Context.browse(url: String, newTask: Boolean = false) { @@ -178,10 +174,10 @@ fun Context.browse(url: String, newTask: Boolean = false) { // ActivityNotFoundException } -inline fun AnkoContext<*>.share(text: String, subject: String = "", title: String? = null) = +fun AnkoContext<*>.share(text: String, subject: String = "", title: String? = null) = ctx.share(text, subject, title) -inline fun Fragment.share(text: String, subject: String = "", title: String? = null) = +fun Fragment.share(text: String, subject: String = "", title: String? = null) = requireActivity().share(text, subject, title) fun Context.share(text: String, subject: String = "", title: String? = null) { @@ -193,10 +189,10 @@ fun Context.share(text: String, subject: String = "", title: String? = null) { // ActivityNotFoundException } -inline fun AnkoContext<*>.email(email: String, subject: String = "", text: String = "") = +fun AnkoContext<*>.email(email: String, subject: String = "", text: String = "") = ctx.email(email, subject, text) -inline fun Fragment.email(email: String, subject: String = "", text: String = "") = +fun Fragment.email(email: String, subject: String = "", text: String = "") = requireActivity().email(email, subject, text) @SuppressLint("QueryPermissionsNeeded") @@ -215,9 +211,9 @@ fun Context.email(email: String, subject: String = "", text: String = ""): Boole return false } -inline fun AnkoContext<*>.makeCall(number: String) = ctx.makeCall(number) +fun AnkoContext<*>.makeCall(number: String) = ctx.makeCall(number) -inline fun Fragment.makeCall(number: String) = requireActivity().makeCall(number) +fun Fragment.makeCall(number: String) = requireActivity().makeCall(number) fun Context.makeCall(number: String) { val intent = Intent(Intent.ACTION_CALL, Uri.parse("tel:$number")) @@ -225,10 +221,10 @@ fun Context.makeCall(number: String) { // ActivityNotFoundException } -inline fun AnkoContext<*>.sendSMS(number: String, text: String = "") = +fun AnkoContext<*>.sendSMS(number: String, text: String = "") = ctx.sendSMS(number, text) -inline fun Fragment.sendSMS(number: String, text: String = "") = +fun Fragment.sendSMS(number: String, text: String = "") = requireActivity().sendSMS(number, text) fun Context.sendSMS(number: String, text: String = "") { diff --git a/anko/src/main/java/org/jetbrains/anko/Layouts.kt b/anko/src/main/java/org/jetbrains/anko/Layouts.kt index 389936a5..5a040fba 100644 --- a/anko/src/main/java/org/jetbrains/anko/Layouts.kt +++ b/anko/src/main/java/org/jetbrains/anko/Layouts.kt @@ -10,6 +10,7 @@ import android.util.AttributeSet import android.view.View import android.view.ViewGroup import android.widget.* +import androidx.appcompat.widget.Toolbar @Suppress("ClassNaming") open class _AppWidgetHostView(ctx: Context) : AppWidgetHostView(ctx) { @@ -198,7 +199,7 @@ open class _AppWidgetHostView(ctx: Context) : AppWidgetHostView(ctx) { //} @Suppress("ClassNaming") -open class _ActionMenuView(ctx: Context) : ActionMenuView(ctx) { +open class _ActionMenuView(ctx: Context) : androidx.appcompat.widget.ActionMenuView(ctx) { inline fun T.lparams( c: Context?, diff --git a/anko/src/main/java/org/jetbrains/anko/Logging.kt b/anko/src/main/java/org/jetbrains/anko/Logging.kt index a7602a49..0fddf28a 100644 --- a/anko/src/main/java/org/jetbrains/anko/Logging.kt +++ b/anko/src/main/java/org/jetbrains/anko/Logging.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -@file:Suppress("unused", "NOTHING_TO_INLINE", "MatchingDeclarationName", "NAME_SHADOWING") +@file:Suppress("MatchingDeclarationName", "NAME_SHADOWING") @file:JvmName("Logging") package org.jetbrains.anko @@ -275,4 +275,4 @@ private fun getTag(clazz: Class<*>): String { } else { tag.substring(0, 23) } -} \ No newline at end of file +} diff --git a/anko/src/main/java/org/jetbrains/anko/RelativeLayoutLayoutParamsHelpers.kt b/anko/src/main/java/org/jetbrains/anko/RelativeLayoutLayoutParamsHelpers.kt index b11c2518..4f7b32e0 100644 --- a/anko/src/main/java/org/jetbrains/anko/RelativeLayoutLayoutParamsHelpers.kt +++ b/anko/src/main/java/org/jetbrains/anko/RelativeLayoutLayoutParamsHelpers.kt @@ -13,9 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -@file:Suppress("NOTHING_TO_INLINE", "unused") - package org.jetbrains.anko import android.view.View @@ -63,7 +60,7 @@ fun LayoutParams.below(view: View) { /** * Place the current View to the left of [view]. */ -inline fun LayoutParams.leftOf(view: View) { +fun LayoutParams.leftOf(view: View) { val id = view.id if (id == View.NO_ID) throw AnkoException("Id is not set for $view") addRule(LEFT_OF, id) @@ -72,7 +69,7 @@ inline fun LayoutParams.leftOf(view: View) { /** * Place the current View to the start of [view]. */ -inline fun LayoutParams.startOf(view: View) { +fun LayoutParams.startOf(view: View) { val id = view.id if (id == View.NO_ID) throw AnkoException("Id is not set for $view") addRule(START_OF, id) @@ -81,7 +78,7 @@ inline fun LayoutParams.startOf(view: View) { /** * Place the current View to the right of [view]. */ -inline fun LayoutParams.rightOf(view: View) { +fun LayoutParams.rightOf(view: View) { val id = view.id if (id == View.NO_ID) throw AnkoException("Id is not set for $view") addRule(RIGHT_OF, id) @@ -90,7 +87,7 @@ inline fun LayoutParams.rightOf(view: View) { /** * Place the current View to the end of [view]. */ -inline fun LayoutParams.endOf(view: View) { +fun LayoutParams.endOf(view: View) { val id = view.id if (id == View.NO_ID) throw AnkoException("Id is not set for $view") addRule(END_OF, id) @@ -99,7 +96,7 @@ inline fun LayoutParams.endOf(view: View) { /** * Set the current View left attribute the same as for [view]. */ -inline fun LayoutParams.sameLeft(view: View) { +fun LayoutParams.sameLeft(view: View) { val id = view.id if (id == View.NO_ID) throw AnkoException("Id is not set for $view") addRule(ALIGN_LEFT, id) @@ -108,7 +105,7 @@ inline fun LayoutParams.sameLeft(view: View) { /** * Set the current View start attribute the same as for [view]. */ -inline fun LayoutParams.sameStart(view: View) { +fun LayoutParams.sameStart(view: View) { val id = view.id if (id == View.NO_ID) throw AnkoException("Id is not set for $view") addRule(ALIGN_START, id) @@ -117,7 +114,7 @@ inline fun LayoutParams.sameStart(view: View) { /** * Set the current View top attribute the same as for [view]. */ -inline fun LayoutParams.sameTop(view: View) { +fun LayoutParams.sameTop(view: View) { val id = view.id if (id == View.NO_ID) throw AnkoException("Id is not set for $view") addRule(ALIGN_TOP, id) @@ -126,7 +123,7 @@ inline fun LayoutParams.sameTop(view: View) { /** * Set the current View right attribute the same as for [view]. */ -inline fun LayoutParams.sameRight(view: View) { +fun LayoutParams.sameRight(view: View) { val id = view.id if (id == View.NO_ID) throw AnkoException("Id is not set for $view") addRule(ALIGN_RIGHT, id) @@ -135,7 +132,7 @@ inline fun LayoutParams.sameRight(view: View) { /** * Set the current View end attribute the same as for [view]. */ -inline fun LayoutParams.sameEnd(view: View) { +fun LayoutParams.sameEnd(view: View) { val id = view.id if (id == View.NO_ID) throw AnkoException("Id is not set for $view") addRule(ALIGN_END, id) @@ -144,7 +141,7 @@ inline fun LayoutParams.sameEnd(view: View) { /** * Set the current View bottom attribute the same as for [view]. */ -inline fun LayoutParams.sameBottom(view: View) { +fun LayoutParams.sameBottom(view: View) { val id = view.id if (id == View.NO_ID) throw AnkoException("Id is not set for $view") addRule(ALIGN_BOTTOM, id) @@ -154,133 +151,133 @@ inline fun LayoutParams.sameBottom(view: View) { * Place the current View above the View with a given [id]. * It is an alias for [above]. */ -inline fun LayoutParams.topOf(@IdRes id: Int) = addRule(ABOVE, id) +fun LayoutParams.topOf(@IdRes id: Int) = addRule(ABOVE, id) /** * Place the current View above the View with a given [id]. */ -inline fun LayoutParams.above(@IdRes id: Int) = addRule(ABOVE, id) +fun LayoutParams.above(@IdRes id: Int) = addRule(ABOVE, id) /** * Place the current View below the View with a given [id]. */ -inline fun LayoutParams.below(@IdRes id: Int) = addRule(BELOW, id) +fun LayoutParams.below(@IdRes id: Int) = addRule(BELOW, id) /** * Place the current View below the View with a given [id]. * It is an alias for [below]. */ -inline fun LayoutParams.bottomOf(@IdRes id: Int) = addRule(BELOW, id) +fun LayoutParams.bottomOf(@IdRes id: Int) = addRule(BELOW, id) /** * Place the current View to the left of the View with a given [id]. */ -inline fun LayoutParams.leftOf(@IdRes id: Int) = addRule(LEFT_OF, id) +fun LayoutParams.leftOf(@IdRes id: Int) = addRule(LEFT_OF, id) /** * Place the current View to the start of the View with a given [id]. */ -inline fun LayoutParams.startOf(@IdRes id: Int): Unit = addRule(START_OF, id) +fun LayoutParams.startOf(@IdRes id: Int): Unit = addRule(START_OF, id) /** * Place the current View to the left of the View with a given [id]. */ -inline fun LayoutParams.rightOf(@IdRes id: Int) = addRule(RIGHT_OF, id) +fun LayoutParams.rightOf(@IdRes id: Int) = addRule(RIGHT_OF, id) /** * Place the current View to the end of the View with a given [id]. */ -inline fun LayoutParams.endOf(@IdRes id: Int): Unit = addRule(END_OF, id) +fun LayoutParams.endOf(@IdRes id: Int): Unit = addRule(END_OF, id) /** * Set the current View left attribute the same as for View with a given [id]. */ -inline fun LayoutParams.sameLeft(@IdRes id: Int) = addRule(ALIGN_LEFT, id) +fun LayoutParams.sameLeft(@IdRes id: Int) = addRule(ALIGN_LEFT, id) /** * Set the current View start attribute the same as for View with a given [id]. */ -inline fun LayoutParams.sameStart(@IdRes id: Int): Unit = addRule(ALIGN_START, id) +fun LayoutParams.sameStart(@IdRes id: Int): Unit = addRule(ALIGN_START, id) /** * Set the current View top attribute the same as for View with a given [id]. */ -inline fun LayoutParams.sameTop(@IdRes id: Int) = addRule(ALIGN_TOP, id) +fun LayoutParams.sameTop(@IdRes id: Int) = addRule(ALIGN_TOP, id) /** * Set the current View right attribute the same as for View with a given [id]. */ -inline fun LayoutParams.sameRight(@IdRes id: Int) = addRule(ALIGN_RIGHT, id) +fun LayoutParams.sameRight(@IdRes id: Int) = addRule(ALIGN_RIGHT, id) /** * Set the current View end attribute the same as for View with a given [id]. */ -inline fun LayoutParams.sameEnd(@IdRes id: Int): Unit = addRule(ALIGN_END, id) +fun LayoutParams.sameEnd(@IdRes id: Int): Unit = addRule(ALIGN_END, id) /** * Set the current View bottom attribute the same as for View with a given [id]. */ -inline fun LayoutParams.sameBottom(@IdRes id: Int) = addRule(ALIGN_BOTTOM, id) +fun LayoutParams.sameBottom(@IdRes id: Int) = addRule(ALIGN_BOTTOM, id) /** * Align the current View's start edge with another child's start edge. */ -inline fun LayoutParams.alignStart(@IdRes id: Int): Unit = addRule(ALIGN_START, id) +fun LayoutParams.alignStart(@IdRes id: Int): Unit = addRule(ALIGN_START, id) /** * Align the current View's end edge with another child's end edge. */ -inline fun LayoutParams.alignEnd(@IdRes id: Int): Unit = addRule(ALIGN_END, id) +fun LayoutParams.alignEnd(@IdRes id: Int): Unit = addRule(ALIGN_END, id) /** * Align the current View's top edge with its parent's top edge. */ -inline fun LayoutParams.alignParentTop() = addRule(ALIGN_PARENT_TOP) +fun LayoutParams.alignParentTop() = addRule(ALIGN_PARENT_TOP) /** * Align the current View's right edge with its parent's right edge. */ -inline fun LayoutParams.alignParentRight() = addRule(ALIGN_PARENT_RIGHT) +fun LayoutParams.alignParentRight() = addRule(ALIGN_PARENT_RIGHT) /** * Align the current View's bottom edge with its parent's bottom edge. */ -inline fun LayoutParams.alignParentBottom() = addRule(ALIGN_PARENT_BOTTOM) +fun LayoutParams.alignParentBottom() = addRule(ALIGN_PARENT_BOTTOM) /** * Align the current View's left edge with its parent's left edge. */ -inline fun LayoutParams.alignParentLeft() = addRule(ALIGN_PARENT_LEFT) +fun LayoutParams.alignParentLeft() = addRule(ALIGN_PARENT_LEFT) /** * Center the child horizontally in its parent. */ -inline fun LayoutParams.centerHorizontally() = addRule(CENTER_HORIZONTAL) +fun LayoutParams.centerHorizontally() = addRule(CENTER_HORIZONTAL) /** * Center the child vertically in its parent. */ -inline fun LayoutParams.centerVertically() = addRule(CENTER_VERTICAL) +fun LayoutParams.centerVertically() = addRule(CENTER_VERTICAL) /** * Center the child horizontally and vertically in its parent. */ -inline fun LayoutParams.centerInParent() = addRule(CENTER_IN_PARENT) +fun LayoutParams.centerInParent() = addRule(CENTER_IN_PARENT) /** * Align the current View's start edge with its parent's start edge. */ -inline fun LayoutParams.alignParentStart(): Unit = addRule(ALIGN_PARENT_START) +fun LayoutParams.alignParentStart(): Unit = addRule(ALIGN_PARENT_START) /** * Align the current View's end edge with its parent's end edge. */ -inline fun LayoutParams.alignParentEnd(): Unit = addRule(ALIGN_PARENT_END) +fun LayoutParams.alignParentEnd(): Unit = addRule(ALIGN_PARENT_END) /** * Positions the baseline of this view on the baseline of the given anchor [view]. */ -inline fun LayoutParams.baselineOf(view: View) { +fun LayoutParams.baselineOf(view: View) { val id = view.id if (id == View.NO_ID) throw AnkoException("Id is not set for $view") addRule(ALIGN_BASELINE, id) @@ -289,4 +286,4 @@ inline fun LayoutParams.baselineOf(view: View) { /** * Positions the baseline of this view on the baseline of the anchor View with a given [id]. */ -inline fun LayoutParams.baselineOf(@IdRes id: Int) = addRule(ALIGN_BASELINE, id) +fun LayoutParams.baselineOf(@IdRes id: Int) = addRule(ALIGN_BASELINE, id) diff --git a/anko/src/main/java/org/jetbrains/anko/Selectors.kt b/anko/src/main/java/org/jetbrains/anko/Selectors.kt deleted file mode 100644 index 0b69a680..00000000 --- a/anko/src/main/java/org/jetbrains/anko/Selectors.kt +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@file:Suppress("NOTHING_TO_INLINE", "unused") - -package org.jetbrains.anko - -import android.content.Context -import android.content.DialogInterface -import androidx.fragment.app.Fragment - -inline fun AnkoContext<*>.selector( - noinline factory: AlertBuilderFactory, - title: CharSequence? = null, - items: List, - noinline onClick: (DialogInterface, CharSequence, Int) -> Unit, -) = ctx.selector(factory, title, items, onClick) - -inline fun Fragment.selector( - noinline factory: AlertBuilderFactory, - title: CharSequence? = null, - items: List, - noinline onClick: (DialogInterface, CharSequence, Int) -> Unit, -) = requireActivity().selector(factory, title, items, onClick) - -fun Context.selector( - factory: AlertBuilderFactory, - title: CharSequence? = null, - items: List, - onClick: (DialogInterface, CharSequence, Int) -> Unit, -) { - with(factory(this)) { - if (title != null) { - this.title = title - } - items(items, onClick) - show() - } -} diff --git a/anko/src/main/java/org/jetbrains/anko/SharedPreferences.kt b/anko/src/main/java/org/jetbrains/anko/SharedPreferences.kt deleted file mode 100644 index dc2f28f1..00000000 --- a/anko/src/main/java/org/jetbrains/anko/SharedPreferences.kt +++ /dev/null @@ -1,40 +0,0 @@ - -/* - * Copyright 2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.anko - -import android.content.SharedPreferences - -/** - * Opens the [SharedPreferences.Editor], applies the [modifer] to it and then applies the changes asynchronously - */ -@Deprecated(message = "Use the Android KTX version", replaceWith = ReplaceWith("edit(modifier)", "androidx.core.content.edit")) -inline fun SharedPreferences.apply(modifier: SharedPreferences.Editor.() -> Unit) { - val editor = this.edit() - editor.modifier() - editor.apply() -} - -/** - * Opens the [SharedPreferences.Editor], applies the [modifer] to it and then applies the changes synchronously - */ -@Deprecated(message = "Use the Android KTX version", replaceWith = ReplaceWith("edit(true, modifier)", "androidx.core.content.edit")) -inline fun SharedPreferences.commit(modifier: SharedPreferences.Editor.() -> Unit) { - val editor = this.edit() - editor.modifier() - editor.commit() -} diff --git a/anko/src/main/java/org/jetbrains/anko/Theme.kt b/anko/src/main/java/org/jetbrains/anko/Theme.kt index d26398a8..096c2e5e 100644 --- a/anko/src/main/java/org/jetbrains/anko/Theme.kt +++ b/anko/src/main/java/org/jetbrains/anko/Theme.kt @@ -1,5 +1,3 @@ -@file:Suppress("NOTHING_TO_INLINE", "unused") - package org.jetbrains.anko import android.content.Context @@ -40,24 +38,24 @@ fun Context.dimenAttr(@AttrRes attribute: Int): Int = fun Context.colorAttr(@AttrRes attribute: Int): Int = theme.color(attribute) @Dimension(unit = Dimension.PX) -inline fun AnkoContext<*>.dimenAttr(@AttrRes attribute: Int): Int = ctx.dimenAttr(attribute) +fun AnkoContext<*>.dimenAttr(@AttrRes attribute: Int): Int = ctx.dimenAttr(attribute) @ColorInt -inline fun AnkoContext<*>.colorAttr(@AttrRes attribute: Int): Int = ctx.colorAttr(attribute) +fun AnkoContext<*>.colorAttr(@AttrRes attribute: Int): Int = ctx.colorAttr(attribute) -inline fun AnkoContext<*>.attr(@AttrRes attribute: Int): TypedValue = ctx.attr(attribute) +fun AnkoContext<*>.attr(@AttrRes attribute: Int): TypedValue = ctx.attr(attribute) @Dimension(unit = Dimension.PX) -inline fun View.dimenAttr(@AttrRes attribute: Int): Int = context.dimenAttr(attribute) +fun View.dimenAttr(@AttrRes attribute: Int): Int = context.dimenAttr(attribute) @ColorInt -inline fun View.colorAttr(@AttrRes attribute: Int): Int = context.colorAttr(attribute) +fun View.colorAttr(@AttrRes attribute: Int): Int = context.colorAttr(attribute) -inline fun View.attr(@AttrRes attribute: Int): TypedValue = context.attr(attribute) +fun View.attr(@AttrRes attribute: Int): TypedValue = context.attr(attribute) @Dimension(unit = Dimension.PX) -inline fun Fragment.dimenAttr(@AttrRes attribute: Int): Int = requireContext().dimenAttr(attribute) +fun Fragment.dimenAttr(@AttrRes attribute: Int): Int = requireContext().dimenAttr(attribute) @ColorInt -inline fun Fragment.colorAttr(@AttrRes attribute: Int): Int = requireContext().colorAttr(attribute) -inline fun Fragment.attr(@AttrRes attribute: Int): TypedValue = requireContext().attr(attribute) +fun Fragment.colorAttr(@AttrRes attribute: Int): Int = requireContext().colorAttr(attribute) +fun Fragment.attr(@AttrRes attribute: Int): TypedValue = requireContext().attr(attribute) diff --git a/anko/src/main/java/org/jetbrains/anko/Toasts.kt b/anko/src/main/java/org/jetbrains/anko/Toasts.kt index ff54e675..e353f060 100644 --- a/anko/src/main/java/org/jetbrains/anko/Toasts.kt +++ b/anko/src/main/java/org/jetbrains/anko/Toasts.kt @@ -13,9 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -@file:Suppress("NOTHING_TO_INLINE", "unused") - package org.jetbrains.anko import android.content.Context @@ -27,21 +24,21 @@ import androidx.fragment.app.Fragment * * @param message the message text resource. */ -inline fun AnkoContext<*>.toast(message: Int) = ctx.toast(message) +fun AnkoContext<*>.toast(message: Int) = ctx.toast(message) /** * Display the simple Toast message with the [Toast.LENGTH_SHORT] duration. * * @param message the message text resource. */ -inline fun Fragment.toast(message: Int) = requireContext().toast(message) +fun Fragment.toast(message: Int) = requireContext().toast(message) /** * Display the simple Toast message with the [Toast.LENGTH_SHORT] duration. * * @param message the message text resource. */ -inline fun Context.toast(message: Int): Toast = Toast +fun Context.toast(message: Int): Toast = Toast .makeText(this, message, Toast.LENGTH_SHORT) .apply { show() @@ -52,21 +49,21 @@ inline fun Context.toast(message: Int): Toast = Toast * * @param message the message text. */ -inline fun AnkoContext<*>.toast(message: CharSequence) = ctx.toast(message) +fun AnkoContext<*>.toast(message: CharSequence) = ctx.toast(message) /** * Display the simple Toast message with the [Toast.LENGTH_SHORT] duration. * * @param message the message text. */ -inline fun Fragment.toast(message: CharSequence) = requireContext().toast(message) +fun Fragment.toast(message: CharSequence) = requireContext().toast(message) /** * Display the simple Toast message with the [Toast.LENGTH_SHORT] duration. * * @param message the message text. */ -inline fun Context.toast(message: CharSequence): Toast = Toast +fun Context.toast(message: CharSequence): Toast = Toast .makeText(this, message, Toast.LENGTH_SHORT) .apply { show() @@ -77,21 +74,21 @@ inline fun Context.toast(message: CharSequence): Toast = Toast * * @param message the message text resource. */ -inline fun AnkoContext<*>.longToast(message: Int) = ctx.longToast(message) +fun AnkoContext<*>.longToast(message: Int) = ctx.longToast(message) /** * Display the simple Toast message with the [Toast.LENGTH_LONG] duration. * * @param message the message text resource. */ -inline fun Fragment.longToast(message: Int) = requireContext().longToast(message) +fun Fragment.longToast(message: Int) = requireContext().longToast(message) /** * Display the simple Toast message with the [Toast.LENGTH_LONG] duration. * * @param message the message text resource. */ -inline fun Context.longToast(message: Int): Toast = Toast +fun Context.longToast(message: Int): Toast = Toast .makeText(this, message, Toast.LENGTH_LONG) .apply { show() @@ -102,21 +99,21 @@ inline fun Context.longToast(message: Int): Toast = Toast * * @param message the message text. */ -inline fun AnkoContext<*>.longToast(message: CharSequence) = ctx.longToast(message) +fun AnkoContext<*>.longToast(message: CharSequence) = ctx.longToast(message) /** * Display the simple Toast message with the [Toast.LENGTH_LONG] duration. * * @param message the message text. */ -inline fun Fragment.longToast(message: CharSequence) = requireContext().longToast(message) +fun Fragment.longToast(message: CharSequence) = requireContext().longToast(message) /** * Display the simple Toast message with the [Toast.LENGTH_LONG] duration. * * @param message the message text. */ -inline fun Context.longToast(message: CharSequence): Toast = Toast +fun Context.longToast(message: CharSequence): Toast = Toast .makeText(this, message, Toast.LENGTH_LONG) .apply { show() diff --git a/anko/src/main/java/org/jetbrains/anko/Ui.kt b/anko/src/main/java/org/jetbrains/anko/Ui.kt index cedab673..28542b20 100644 --- a/anko/src/main/java/org/jetbrains/anko/Ui.kt +++ b/anko/src/main/java/org/jetbrains/anko/Ui.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -@file:Suppress("unused", "NOTHING_TO_INLINE", "MatchingDeclarationName") +@file:Suppress("MatchingDeclarationName") package org.jetbrains.anko @@ -30,7 +30,7 @@ annotation class AnkoViewDslMarker * * @return the receiver. */ -inline fun T.applyRecursively(noinline f: (View) -> Unit): T { +fun T.applyRecursively(f: (View) -> Unit): T { AnkoInternals.applyRecursively(this, f) return this -} \ No newline at end of file +} diff --git a/anko/src/main/java/org/jetbrains/anko/ViewGroups.kt b/anko/src/main/java/org/jetbrains/anko/ViewGroups.kt new file mode 100644 index 00000000..f64b10ca --- /dev/null +++ b/anko/src/main/java/org/jetbrains/anko/ViewGroups.kt @@ -0,0 +1,895 @@ +@file:Suppress("TooManyFunctions", "ClassNaming") +@file:JvmName("Sdk28ViewGroupsKt") + +package org.jetbrains.anko + +import android.app.* +import android.content.Context +import android.view.ViewManager +import android.widget.* +import androidx.appcompat.widget.* +import androidx.appcompat.widget.ActionMenuView +import androidx.appcompat.widget.Toolbar +import org.jetbrains.anko.custom.* + +@PublishedApi +internal object `$$Anko$Factories$Sdk28ViewGroup` { + val APP_WIDGET_HOST_VIEW = { ctx: Context -> _AppWidgetHostView(ctx) } + + //val ABSOLUTE_LAYOUT = { ctx: Context -> _AbsoluteLayout(ctx) } + val ACTION_MENU_VIEW = { ctx: Context -> _ActionMenuView(ctx) } + val FRAME_LAYOUT = { ctx: Context -> _FrameLayout(ctx) } + + //val GALLERY = { ctx: Context -> _Gallery(ctx) } + val GRID_LAYOUT = { ctx: Context -> _GridLayout(ctx) } + val GRID_VIEW = { ctx: Context -> _GridView(ctx) } + val HORIZONTAL_SCROLL_VIEW = { ctx: Context -> _HorizontalScrollView(ctx) } + val IMAGE_SWITCHER = { ctx: Context -> _ImageSwitcher(ctx) } + val LINEAR_LAYOUT = { ctx: Context -> _LinearLayout(ctx) } + val RADIO_GROUP = { ctx: Context -> _RadioGroup(ctx) } + val RELATIVE_LAYOUT = { ctx: Context -> _RelativeLayout(ctx) } + val SCROLL_VIEW = { ctx: Context -> _ScrollView(ctx) } + val TABLE_LAYOUT = { ctx: Context -> _TableLayout(ctx) } + val TABLE_ROW = { ctx: Context -> _TableRow(ctx) } + val TEXT_SWITCHER = { ctx: Context -> _TextSwitcher(ctx) } + val TOOLBAR = { ctx: Context -> _Toolbar(ctx) } + val VIEW_ANIMATOR = { ctx: Context -> _ViewAnimator(ctx) } + val VIEW_SWITCHER = { ctx: Context -> _ViewSwitcher(ctx) } +} + +fun ViewManager.appWidgetHostView(): android.appwidget.AppWidgetHostView = + appWidgetHostView {} + +inline fun ViewManager.appWidgetHostView(init: (@AnkoViewDslMarker _AppWidgetHostView).() -> Unit): android.appwidget.AppWidgetHostView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.APP_WIDGET_HOST_VIEW, theme = 0) { init() } +} + +fun ViewManager.themedAppWidgetHostView(theme: Int = 0): android.appwidget.AppWidgetHostView = + themedAppWidgetHostView(theme) {} + +inline fun ViewManager.themedAppWidgetHostView( + theme: Int = 0, + init: (@AnkoViewDslMarker _AppWidgetHostView).() -> Unit, +): android.appwidget.AppWidgetHostView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.APP_WIDGET_HOST_VIEW, theme) { init() } +} + +fun Context.appWidgetHostView(): android.appwidget.AppWidgetHostView = appWidgetHostView {} +inline fun Context.appWidgetHostView(init: (@AnkoViewDslMarker _AppWidgetHostView).() -> Unit): android.appwidget.AppWidgetHostView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.APP_WIDGET_HOST_VIEW, theme = 0) { init() } +} + +fun Context.themedAppWidgetHostView(theme: Int = 0): android.appwidget.AppWidgetHostView = + themedAppWidgetHostView(theme) {} + +inline fun Context.themedAppWidgetHostView( + theme: Int = 0, + init: (@AnkoViewDslMarker _AppWidgetHostView).() -> Unit, +): android.appwidget.AppWidgetHostView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.APP_WIDGET_HOST_VIEW, theme) { init() } +} + +fun Activity.appWidgetHostView(): android.appwidget.AppWidgetHostView = + appWidgetHostView {} + +inline fun Activity.appWidgetHostView(init: (@AnkoViewDslMarker _AppWidgetHostView).() -> Unit): android.appwidget.AppWidgetHostView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.APP_WIDGET_HOST_VIEW, theme = 0) { init() } +} + +fun Activity.themedAppWidgetHostView(theme: Int = 0): android.appwidget.AppWidgetHostView = + themedAppWidgetHostView(theme) {} + +inline fun Activity.themedAppWidgetHostView( + theme: Int = 0, + init: (@AnkoViewDslMarker _AppWidgetHostView).() -> Unit, +): android.appwidget.AppWidgetHostView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.APP_WIDGET_HOST_VIEW, theme) { init() } +} + +//inline fun ViewManager.absoluteLayout(): android.widget.AbsoluteLayout = absoluteLayout() {} +//inline fun ViewManager.absoluteLayout(init: (@AnkoViewDslMarker _AbsoluteLayout).() -> Unit): android.widget.AbsoluteLayout { +// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ABSOLUTE_LAYOUT, theme = 0) { init() } +//} +// +//inline fun ViewManager.themedAbsoluteLayout(theme: Int = 0): android.widget.AbsoluteLayout = +// themedAbsoluteLayout(theme) {} +// +//inline fun ViewManager.themedAbsoluteLayout( +// theme: Int = 0, +// init: (@AnkoViewDslMarker _AbsoluteLayout).() -> Unit, +//): android.widget.AbsoluteLayout { +// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ABSOLUTE_LAYOUT, theme) { init() } +//} +// +//inline fun Context.absoluteLayout(): android.widget.AbsoluteLayout = absoluteLayout() {} +//inline fun Context.absoluteLayout(init: (@AnkoViewDslMarker _AbsoluteLayout).() -> Unit): android.widget.AbsoluteLayout { +// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ABSOLUTE_LAYOUT, theme = 0) { init() } +//} +// +//inline fun Context.themedAbsoluteLayout(theme: Int = 0): android.widget.AbsoluteLayout = +// themedAbsoluteLayout(theme) {} +// +//inline fun Context.themedAbsoluteLayout( +// theme: Int = 0, +// init: (@AnkoViewDslMarker _AbsoluteLayout).() -> Unit, +//): android.widget.AbsoluteLayout { +// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ABSOLUTE_LAYOUT, theme) { init() } +//} +// +//inline fun Activity.absoluteLayout(): android.widget.AbsoluteLayout = absoluteLayout() {} +//inline fun Activity.absoluteLayout(init: (@AnkoViewDslMarker _AbsoluteLayout).() -> Unit): android.widget.AbsoluteLayout { +// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ABSOLUTE_LAYOUT, theme = 0) { init() } +//} +// +//inline fun Activity.themedAbsoluteLayout(theme: Int = 0): android.widget.AbsoluteLayout = +// themedAbsoluteLayout(theme) {} +// +//inline fun Activity.themedAbsoluteLayout( +// theme: Int = 0, +// init: (@AnkoViewDslMarker _AbsoluteLayout).() -> Unit, +//): android.widget.AbsoluteLayout { +// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ABSOLUTE_LAYOUT, theme) { init() } +//} + +fun ViewManager.actionMenuView(): ActionMenuView = actionMenuView {} +inline fun ViewManager.actionMenuView(init: (@AnkoViewDslMarker _ActionMenuView).() -> Unit): ActionMenuView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ACTION_MENU_VIEW, theme = 0) { init() } +} + +fun ViewManager.themedActionMenuView(theme: Int = 0): ActionMenuView = + themedActionMenuView(theme) {} + +inline fun ViewManager.themedActionMenuView( + theme: Int = 0, + init: (@AnkoViewDslMarker _ActionMenuView).() -> Unit, +): ActionMenuView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ACTION_MENU_VIEW, theme) { init() } +} + +fun Context.actionMenuView(): ActionMenuView = actionMenuView {} +inline fun Context.actionMenuView(init: (@AnkoViewDslMarker _ActionMenuView).() -> Unit): ActionMenuView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ACTION_MENU_VIEW, theme = 0) { init() } +} + +fun Context.themedActionMenuView(theme: Int = 0): ActionMenuView = + themedActionMenuView(theme) {} + +inline fun Context.themedActionMenuView( + theme: Int = 0, + init: (@AnkoViewDslMarker _ActionMenuView).() -> Unit, +): ActionMenuView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ACTION_MENU_VIEW, theme) { init() } +} + +fun Activity.actionMenuView(): ActionMenuView = actionMenuView {} +inline fun Activity.actionMenuView(init: (@AnkoViewDslMarker _ActionMenuView).() -> Unit): ActionMenuView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ACTION_MENU_VIEW, theme = 0) { init() } +} + +fun Activity.themedActionMenuView(theme: Int = 0): ActionMenuView = + themedActionMenuView(theme) {} + +inline fun Activity.themedActionMenuView( + theme: Int = 0, + init: (@AnkoViewDslMarker _ActionMenuView).() -> Unit, +): ActionMenuView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ACTION_MENU_VIEW, theme) { init() } +} + +fun ViewManager.frameLayout(): FrameLayout = frameLayout {} +inline fun ViewManager.frameLayout(init: (@AnkoViewDslMarker _FrameLayout).() -> Unit): FrameLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.FRAME_LAYOUT, theme = 0) { init() } +} + +fun ViewManager.themedFrameLayout(theme: Int = 0): FrameLayout = + themedFrameLayout(theme) {} + +inline fun ViewManager.themedFrameLayout( + theme: Int = 0, + init: (@AnkoViewDslMarker _FrameLayout).() -> Unit, +): FrameLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.FRAME_LAYOUT, theme) { init() } +} + +fun Context.frameLayout(): FrameLayout = frameLayout {} +inline fun Context.frameLayout(init: (@AnkoViewDslMarker _FrameLayout).() -> Unit): FrameLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.FRAME_LAYOUT, theme = 0) { init() } +} + +fun Context.themedFrameLayout(theme: Int = 0): FrameLayout = + themedFrameLayout(theme) {} + +inline fun Context.themedFrameLayout( + theme: Int = 0, + init: (@AnkoViewDslMarker _FrameLayout).() -> Unit, +): FrameLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.FRAME_LAYOUT, theme) { init() } +} + +fun Activity.frameLayout(): FrameLayout = frameLayout {} +inline fun Activity.frameLayout(init: (@AnkoViewDslMarker _FrameLayout).() -> Unit): FrameLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.FRAME_LAYOUT, theme = 0) { init() } +} + +fun Activity.themedFrameLayout(theme: Int = 0): FrameLayout = + themedFrameLayout(theme) {} + +inline fun Activity.themedFrameLayout( + theme: Int = 0, + init: (@AnkoViewDslMarker _FrameLayout).() -> Unit, +): FrameLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.FRAME_LAYOUT, theme) { init() } +} + +//inline fun ViewManager.gallery(): android.widget.Gallery = gallery() {} +//inline fun ViewManager.gallery(init: (@AnkoViewDslMarker _Gallery).() -> Unit): android.widget.Gallery { +// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GALLERY, theme = 0) { init() } +//} +// +//inline fun ViewManager.themedGallery(theme: Int = 0): android.widget.Gallery = +// themedGallery(theme) {} +// +//inline fun ViewManager.themedGallery( +// theme: Int = 0, +// init: (@AnkoViewDslMarker _Gallery).() -> Unit, +//): android.widget.Gallery { +// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GALLERY, theme) { init() } +//} + +//inline fun Context.gallery(): android.widget.Gallery = gallery() {} +//inline fun Context.gallery(init: (@AnkoViewDslMarker _Gallery).() -> Unit): android.widget.Gallery { +// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GALLERY, theme = 0) { init() } +//} +// +//inline fun Context.themedGallery(theme: Int = 0): android.widget.Gallery = themedGallery(theme) {} +//inline fun Context.themedGallery( +// theme: Int = 0, +// init: (@AnkoViewDslMarker _Gallery).() -> Unit, +//): android.widget.Gallery { +// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GALLERY, theme) { init() } +//} + +//inline fun Activity.gallery(): android.widget.Gallery = gallery() {} +//inline fun Activity.gallery(init: (@AnkoViewDslMarker _Gallery).() -> Unit): android.widget.Gallery { +// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GALLERY, theme = 0) { init() } +//} +// +//inline fun Activity.themedGallery(theme: Int = 0): android.widget.Gallery = themedGallery(theme) {} +//inline fun Activity.themedGallery( +// theme: Int = 0, +// init: (@AnkoViewDslMarker _Gallery).() -> Unit, +//): android.widget.Gallery { +// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GALLERY, theme) { init() } +//} + +fun ViewManager.gridLayout(): GridLayout = gridLayout {} +inline fun ViewManager.gridLayout(init: (@AnkoViewDslMarker _GridLayout).() -> Unit): GridLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_LAYOUT, theme = 0) { init() } +} + +fun ViewManager.themedGridLayout(theme: Int = 0): GridLayout = + themedGridLayout(theme) {} + +inline fun ViewManager.themedGridLayout( + theme: Int = 0, + init: (@AnkoViewDslMarker _GridLayout).() -> Unit, +): GridLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_LAYOUT, theme) { init() } +} + +fun Context.gridLayout(): GridLayout = gridLayout {} +inline fun Context.gridLayout(init: (@AnkoViewDslMarker _GridLayout).() -> Unit): GridLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_LAYOUT, theme = 0) { init() } +} + +fun Context.themedGridLayout(theme: Int = 0): GridLayout = + themedGridLayout(theme) {} + +inline fun Context.themedGridLayout( + theme: Int = 0, + init: (@AnkoViewDslMarker _GridLayout).() -> Unit, +): GridLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_LAYOUT, theme) { init() } +} + +fun Activity.gridLayout(): GridLayout = gridLayout {} +inline fun Activity.gridLayout(init: (@AnkoViewDslMarker _GridLayout).() -> Unit): GridLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_LAYOUT, theme = 0) { init() } +} + +fun Activity.themedGridLayout(theme: Int = 0): GridLayout = + themedGridLayout(theme) {} + +inline fun Activity.themedGridLayout( + theme: Int = 0, + init: (@AnkoViewDslMarker _GridLayout).() -> Unit, +): GridLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_LAYOUT, theme) { init() } +} + +fun ViewManager.gridView(): GridView = gridView {} +inline fun ViewManager.gridView(init: (@AnkoViewDslMarker _GridView).() -> Unit): GridView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_VIEW, theme = 0) { init() } +} + +fun ViewManager.themedGridView(theme: Int = 0): GridView = + themedGridView(theme) {} + +inline fun ViewManager.themedGridView( + theme: Int = 0, + init: (@AnkoViewDslMarker _GridView).() -> Unit, +): GridView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_VIEW, theme) { init() } +} + +fun Context.gridView(): GridView = gridView {} +inline fun Context.gridView(init: (@AnkoViewDslMarker _GridView).() -> Unit): GridView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_VIEW, theme = 0) { init() } +} + +fun Context.themedGridView(theme: Int = 0): GridView = + themedGridView(theme) {} + +inline fun Context.themedGridView( + theme: Int = 0, + init: (@AnkoViewDslMarker _GridView).() -> Unit, +): GridView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_VIEW, theme) { init() } +} + +fun Activity.gridView(): GridView = gridView {} +inline fun Activity.gridView(init: (@AnkoViewDslMarker _GridView).() -> Unit): GridView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_VIEW, theme = 0) { init() } +} + +fun Activity.themedGridView(theme: Int = 0): GridView = + themedGridView(theme) {} + +inline fun Activity.themedGridView( + theme: Int = 0, + init: (@AnkoViewDslMarker _GridView).() -> Unit, +): GridView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_VIEW, theme) { init() } +} + +fun ViewManager.horizontalScrollView(): HorizontalScrollView = + horizontalScrollView {} + +inline fun ViewManager.horizontalScrollView(init: (@AnkoViewDslMarker _HorizontalScrollView).() -> Unit): HorizontalScrollView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.HORIZONTAL_SCROLL_VIEW, theme = 0) { init() } +} + +fun ViewManager.themedHorizontalScrollView(theme: Int = 0): HorizontalScrollView = + themedHorizontalScrollView(theme) {} + +inline fun ViewManager.themedHorizontalScrollView( + theme: Int = 0, + init: (@AnkoViewDslMarker _HorizontalScrollView).() -> Unit, +): HorizontalScrollView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.HORIZONTAL_SCROLL_VIEW, theme) { init() } +} + +fun Context.horizontalScrollView(): HorizontalScrollView = + horizontalScrollView {} + +inline fun Context.horizontalScrollView(init: (@AnkoViewDslMarker _HorizontalScrollView).() -> Unit): HorizontalScrollView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.HORIZONTAL_SCROLL_VIEW, theme = 0) { init() } +} + +fun Context.themedHorizontalScrollView(theme: Int = 0): HorizontalScrollView = + themedHorizontalScrollView(theme) {} + +inline fun Context.themedHorizontalScrollView( + theme: Int = 0, + init: (@AnkoViewDslMarker _HorizontalScrollView).() -> Unit, +): HorizontalScrollView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.HORIZONTAL_SCROLL_VIEW, theme) { init() } +} + +fun Activity.horizontalScrollView(): HorizontalScrollView = + horizontalScrollView {} + +inline fun Activity.horizontalScrollView(init: (@AnkoViewDslMarker _HorizontalScrollView).() -> Unit): HorizontalScrollView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.HORIZONTAL_SCROLL_VIEW, theme = 0) { init() } +} + +fun Activity.themedHorizontalScrollView(theme: Int = 0): HorizontalScrollView = + themedHorizontalScrollView(theme) {} + +inline fun Activity.themedHorizontalScrollView( + theme: Int = 0, + init: (@AnkoViewDslMarker _HorizontalScrollView).() -> Unit, +): HorizontalScrollView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.HORIZONTAL_SCROLL_VIEW, theme) { init() } +} + +fun ViewManager.imageSwitcher(): ImageSwitcher = imageSwitcher {} +inline fun ViewManager.imageSwitcher(init: (@AnkoViewDslMarker _ImageSwitcher).() -> Unit): ImageSwitcher { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.IMAGE_SWITCHER, theme = 0) { init() } +} + +fun ViewManager.themedImageSwitcher(theme: Int = 0): ImageSwitcher = + themedImageSwitcher(theme) {} + +inline fun ViewManager.themedImageSwitcher( + theme: Int = 0, + init: (@AnkoViewDslMarker _ImageSwitcher).() -> Unit, +): ImageSwitcher { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.IMAGE_SWITCHER, theme) { init() } +} + +fun Context.imageSwitcher(): ImageSwitcher = imageSwitcher {} +inline fun Context.imageSwitcher(init: (@AnkoViewDslMarker _ImageSwitcher).() -> Unit): ImageSwitcher { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.IMAGE_SWITCHER, theme = 0) { init() } +} + +fun Context.themedImageSwitcher(theme: Int = 0): ImageSwitcher = + themedImageSwitcher(theme) {} + +inline fun Context.themedImageSwitcher( + theme: Int = 0, + init: (@AnkoViewDslMarker _ImageSwitcher).() -> Unit, +): ImageSwitcher { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.IMAGE_SWITCHER, theme) { init() } +} + +fun Activity.imageSwitcher(): ImageSwitcher = imageSwitcher {} +inline fun Activity.imageSwitcher(init: (@AnkoViewDslMarker _ImageSwitcher).() -> Unit): ImageSwitcher { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.IMAGE_SWITCHER, theme = 0) { init() } +} + +fun Activity.themedImageSwitcher(theme: Int = 0): ImageSwitcher = + themedImageSwitcher(theme) {} + +inline fun Activity.themedImageSwitcher( + theme: Int = 0, + init: (@AnkoViewDslMarker _ImageSwitcher).() -> Unit, +): ImageSwitcher { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.IMAGE_SWITCHER, theme) { init() } +} + +fun ViewManager.linearLayout(): LinearLayout = linearLayout {} +inline fun ViewManager.linearLayout(init: (@AnkoViewDslMarker _LinearLayout).() -> Unit): LinearLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.LINEAR_LAYOUT, theme = 0) { init() } +} + +fun ViewManager.themedLinearLayout(theme: Int = 0): LinearLayout = + themedLinearLayout(theme) {} + +inline fun ViewManager.themedLinearLayout( + theme: Int = 0, + init: (@AnkoViewDslMarker _LinearLayout).() -> Unit, +): LinearLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.LINEAR_LAYOUT, theme) { init() } +} + +fun Context.linearLayout(): LinearLayout = linearLayout {} +inline fun Context.linearLayout(init: (@AnkoViewDslMarker _LinearLayout).() -> Unit): LinearLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.LINEAR_LAYOUT, theme = 0) { init() } +} + +fun Context.themedLinearLayout(theme: Int = 0): LinearLayout = + themedLinearLayout(theme) {} + +inline fun Context.themedLinearLayout( + theme: Int = 0, + init: (@AnkoViewDslMarker _LinearLayout).() -> Unit, +): LinearLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.LINEAR_LAYOUT, theme) { init() } +} + +fun Activity.linearLayout(): LinearLayout = linearLayout {} +inline fun Activity.linearLayout(init: (@AnkoViewDslMarker _LinearLayout).() -> Unit): LinearLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.LINEAR_LAYOUT, theme = 0) { init() } +} + +fun Activity.themedLinearLayout(theme: Int = 0): LinearLayout = + themedLinearLayout(theme) {} + +inline fun Activity.themedLinearLayout( + theme: Int = 0, + init: (@AnkoViewDslMarker _LinearLayout).() -> Unit, +): LinearLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.LINEAR_LAYOUT, theme) { init() } +} + +fun ViewManager.radioGroup(): RadioGroup = radioGroup {} +inline fun ViewManager.radioGroup(init: (@AnkoViewDslMarker _RadioGroup).() -> Unit): RadioGroup { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RADIO_GROUP, theme = 0) { init() } +} + +fun ViewManager.themedRadioGroup(theme: Int = 0): RadioGroup = + themedRadioGroup(theme) {} + +inline fun ViewManager.themedRadioGroup( + theme: Int = 0, + init: (@AnkoViewDslMarker _RadioGroup).() -> Unit, +): RadioGroup { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RADIO_GROUP, theme) { init() } +} + +fun Context.radioGroup(): RadioGroup = radioGroup {} +inline fun Context.radioGroup(init: (@AnkoViewDslMarker _RadioGroup).() -> Unit): RadioGroup { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RADIO_GROUP, theme = 0) { init() } +} + +fun Context.themedRadioGroup(theme: Int = 0): RadioGroup = + themedRadioGroup(theme) {} + +inline fun Context.themedRadioGroup( + theme: Int = 0, + init: (@AnkoViewDslMarker _RadioGroup).() -> Unit, +): RadioGroup { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RADIO_GROUP, theme) { init() } +} + +fun Activity.radioGroup(): RadioGroup = radioGroup {} +inline fun Activity.radioGroup(init: (@AnkoViewDslMarker _RadioGroup).() -> Unit): RadioGroup { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RADIO_GROUP, theme = 0) { init() } +} + +fun Activity.themedRadioGroup(theme: Int = 0): RadioGroup = + themedRadioGroup(theme) {} + +inline fun Activity.themedRadioGroup( + theme: Int = 0, + init: (@AnkoViewDslMarker _RadioGroup).() -> Unit, +): RadioGroup { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RADIO_GROUP, theme) { init() } +} + +fun ViewManager.relativeLayout(): RelativeLayout = relativeLayout {} +inline fun ViewManager.relativeLayout(init: (@AnkoViewDslMarker _RelativeLayout).() -> Unit): RelativeLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RELATIVE_LAYOUT, theme = 0) { init() } +} + +fun ViewManager.themedRelativeLayout(theme: Int = 0): RelativeLayout = + themedRelativeLayout(theme) {} + +inline fun ViewManager.themedRelativeLayout( + theme: Int = 0, + init: (@AnkoViewDslMarker _RelativeLayout).() -> Unit, +): RelativeLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RELATIVE_LAYOUT, theme) { init() } +} + +fun Context.relativeLayout(): RelativeLayout = relativeLayout {} +inline fun Context.relativeLayout(init: (@AnkoViewDslMarker _RelativeLayout).() -> Unit): RelativeLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RELATIVE_LAYOUT, theme = 0) { init() } +} + +fun Context.themedRelativeLayout(theme: Int = 0): RelativeLayout = + themedRelativeLayout(theme) {} + +inline fun Context.themedRelativeLayout( + theme: Int = 0, + init: (@AnkoViewDslMarker _RelativeLayout).() -> Unit, +): RelativeLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RELATIVE_LAYOUT, theme) { init() } +} + +fun Activity.relativeLayout(): RelativeLayout = relativeLayout {} +inline fun Activity.relativeLayout(init: (@AnkoViewDslMarker _RelativeLayout).() -> Unit): RelativeLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RELATIVE_LAYOUT, theme = 0) { init() } +} + +fun Activity.themedRelativeLayout(theme: Int = 0): RelativeLayout = + themedRelativeLayout(theme) {} + +inline fun Activity.themedRelativeLayout( + theme: Int = 0, + init: (@AnkoViewDslMarker _RelativeLayout).() -> Unit, +): RelativeLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RELATIVE_LAYOUT, theme) { init() } +} + +fun ViewManager.scrollView(): ScrollView = scrollView {} +inline fun ViewManager.scrollView(init: (@AnkoViewDslMarker _ScrollView).() -> Unit): ScrollView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.SCROLL_VIEW, theme = 0) { init() } +} + +fun ViewManager.themedScrollView(theme: Int = 0): ScrollView = + themedScrollView(theme) {} + +inline fun ViewManager.themedScrollView( + theme: Int = 0, + init: (@AnkoViewDslMarker _ScrollView).() -> Unit, +): ScrollView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.SCROLL_VIEW, theme) { init() } +} + +fun Context.scrollView(): ScrollView = scrollView {} +inline fun Context.scrollView(init: (@AnkoViewDslMarker _ScrollView).() -> Unit): ScrollView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.SCROLL_VIEW, theme = 0) { init() } +} + +fun Context.themedScrollView(theme: Int = 0): ScrollView = + themedScrollView(theme) {} + +inline fun Context.themedScrollView( + theme: Int = 0, + init: (@AnkoViewDslMarker _ScrollView).() -> Unit, +): ScrollView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.SCROLL_VIEW, theme) { init() } +} + +fun Activity.scrollView(): ScrollView = scrollView {} +inline fun Activity.scrollView(init: (@AnkoViewDslMarker _ScrollView).() -> Unit): ScrollView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.SCROLL_VIEW, theme = 0) { init() } +} + +fun Activity.themedScrollView(theme: Int = 0): ScrollView = + themedScrollView(theme) {} + +inline fun Activity.themedScrollView( + theme: Int = 0, + init: (@AnkoViewDslMarker _ScrollView).() -> Unit, +): ScrollView { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.SCROLL_VIEW, theme) { init() } +} + +fun ViewManager.tableLayout(): TableLayout = tableLayout {} +inline fun ViewManager.tableLayout(init: (@AnkoViewDslMarker _TableLayout).() -> Unit): TableLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_LAYOUT, theme = 0) { init() } +} + +fun ViewManager.themedTableLayout(theme: Int = 0): TableLayout = + themedTableLayout(theme) {} + +inline fun ViewManager.themedTableLayout( + theme: Int = 0, + init: (@AnkoViewDslMarker _TableLayout).() -> Unit, +): TableLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_LAYOUT, theme) { init() } +} + +fun Context.tableLayout(): TableLayout = tableLayout {} +inline fun Context.tableLayout(init: (@AnkoViewDslMarker _TableLayout).() -> Unit): TableLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_LAYOUT, theme = 0) { init() } +} + +fun Context.themedTableLayout(theme: Int = 0): TableLayout = + themedTableLayout(theme) {} + +inline fun Context.themedTableLayout( + theme: Int = 0, + init: (@AnkoViewDslMarker _TableLayout).() -> Unit, +): TableLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_LAYOUT, theme) { init() } +} + +fun Activity.tableLayout(): TableLayout = tableLayout {} +inline fun Activity.tableLayout(init: (@AnkoViewDslMarker _TableLayout).() -> Unit): TableLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_LAYOUT, theme = 0) { init() } +} + +fun Activity.themedTableLayout(theme: Int = 0): TableLayout = + themedTableLayout(theme) {} + +inline fun Activity.themedTableLayout( + theme: Int = 0, + init: (@AnkoViewDslMarker _TableLayout).() -> Unit, +): TableLayout { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_LAYOUT, theme) { init() } +} + +fun ViewManager.tableRow(): TableRow = tableRow {} +inline fun ViewManager.tableRow(init: (@AnkoViewDslMarker _TableRow).() -> Unit): TableRow { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_ROW, theme = 0) { init() } +} + +fun ViewManager.themedTableRow(theme: Int = 0): TableRow = + themedTableRow(theme) {} + +inline fun ViewManager.themedTableRow( + theme: Int = 0, + init: (@AnkoViewDslMarker _TableRow).() -> Unit, +): TableRow { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_ROW, theme) { init() } +} + +fun Context.tableRow(): TableRow = tableRow {} +inline fun Context.tableRow(init: (@AnkoViewDslMarker _TableRow).() -> Unit): TableRow { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_ROW, theme = 0) { init() } +} + +fun Context.themedTableRow(theme: Int = 0): TableRow = + themedTableRow(theme) {} + +inline fun Context.themedTableRow( + theme: Int = 0, + init: (@AnkoViewDslMarker _TableRow).() -> Unit, +): TableRow { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_ROW, theme) { init() } +} + +fun Activity.tableRow(): TableRow = tableRow {} +inline fun Activity.tableRow(init: (@AnkoViewDslMarker _TableRow).() -> Unit): TableRow { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_ROW, theme = 0) { init() } +} + +fun Activity.themedTableRow(theme: Int = 0): TableRow = + themedTableRow(theme) {} + +inline fun Activity.themedTableRow( + theme: Int = 0, + init: (@AnkoViewDslMarker _TableRow).() -> Unit, +): TableRow { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_ROW, theme) { init() } +} + +fun ViewManager.textSwitcher(): TextSwitcher = textSwitcher {} +inline fun ViewManager.textSwitcher(init: (@AnkoViewDslMarker _TextSwitcher).() -> Unit): TextSwitcher { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TEXT_SWITCHER, theme = 0) { init() } +} + +fun ViewManager.themedTextSwitcher(theme: Int = 0): TextSwitcher = + themedTextSwitcher(theme) {} + +inline fun ViewManager.themedTextSwitcher( + theme: Int = 0, + init: (@AnkoViewDslMarker _TextSwitcher).() -> Unit, +): TextSwitcher { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TEXT_SWITCHER, theme) { init() } +} + +fun Context.textSwitcher(): TextSwitcher = textSwitcher {} +inline fun Context.textSwitcher(init: (@AnkoViewDslMarker _TextSwitcher).() -> Unit): TextSwitcher { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TEXT_SWITCHER, theme = 0) { init() } +} + +fun Context.themedTextSwitcher(theme: Int = 0): TextSwitcher = + themedTextSwitcher(theme) {} + +inline fun Context.themedTextSwitcher( + theme: Int = 0, + init: (@AnkoViewDslMarker _TextSwitcher).() -> Unit, +): TextSwitcher { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TEXT_SWITCHER, theme) { init() } +} + +fun Activity.textSwitcher(): TextSwitcher = textSwitcher {} +inline fun Activity.textSwitcher(init: (@AnkoViewDslMarker _TextSwitcher).() -> Unit): TextSwitcher { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TEXT_SWITCHER, theme = 0) { init() } +} + +fun Activity.themedTextSwitcher(theme: Int = 0): TextSwitcher = + themedTextSwitcher(theme) {} + +inline fun Activity.themedTextSwitcher( + theme: Int = 0, + init: (@AnkoViewDslMarker _TextSwitcher).() -> Unit, +): TextSwitcher { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TEXT_SWITCHER, theme) { init() } +} + +fun ViewManager.toolbar(): Toolbar = toolbar {} +inline fun ViewManager.toolbar(init: (@AnkoViewDslMarker _Toolbar).() -> Unit): Toolbar { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TOOLBAR, theme = 0) { init() } +} + +fun ViewManager.themedToolbar(theme: Int = 0): Toolbar = + themedToolbar(theme) {} + +inline fun ViewManager.themedToolbar( + theme: Int = 0, + init: (@AnkoViewDslMarker _Toolbar).() -> Unit, +): Toolbar { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TOOLBAR, theme) { init() } +} + +fun Context.toolbar(): Toolbar = toolbar {} +inline fun Context.toolbar(init: (@AnkoViewDslMarker _Toolbar).() -> Unit): Toolbar { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TOOLBAR, theme = 0) { init() } +} + +fun Context.themedToolbar(theme: Int = 0): Toolbar = themedToolbar(theme) {} +inline fun Context.themedToolbar( + theme: Int = 0, + init: (@AnkoViewDslMarker _Toolbar).() -> Unit, +): Toolbar { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TOOLBAR, theme) { init() } +} + +fun Activity.toolbar(): Toolbar = toolbar {} +inline fun Activity.toolbar(init: (@AnkoViewDslMarker _Toolbar).() -> Unit): Toolbar { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TOOLBAR, theme = 0) { init() } +} + +fun Activity.themedToolbar(theme: Int = 0): Toolbar = themedToolbar(theme) {} +inline fun Activity.themedToolbar( + theme: Int = 0, + init: (@AnkoViewDslMarker _Toolbar).() -> Unit, +): Toolbar { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TOOLBAR, theme) { init() } +} + +fun ViewManager.viewAnimator(): ViewAnimator = viewAnimator {} +inline fun ViewManager.viewAnimator(init: (@AnkoViewDslMarker _ViewAnimator).() -> Unit): ViewAnimator { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_ANIMATOR, theme = 0) { init() } +} + +fun ViewManager.themedViewAnimator(theme: Int = 0): ViewAnimator = + themedViewAnimator(theme) {} + +inline fun ViewManager.themedViewAnimator( + theme: Int = 0, + init: (@AnkoViewDslMarker _ViewAnimator).() -> Unit, +): ViewAnimator { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_ANIMATOR, theme) { init() } +} + +fun Context.viewAnimator(): ViewAnimator = viewAnimator {} +inline fun Context.viewAnimator(init: (@AnkoViewDslMarker _ViewAnimator).() -> Unit): ViewAnimator { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_ANIMATOR, theme = 0) { init() } +} + +fun Context.themedViewAnimator(theme: Int = 0): ViewAnimator = + themedViewAnimator(theme) {} + +inline fun Context.themedViewAnimator( + theme: Int = 0, + init: (@AnkoViewDslMarker _ViewAnimator).() -> Unit, +): ViewAnimator { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_ANIMATOR, theme) { init() } +} + +fun Activity.viewAnimator(): ViewAnimator = viewAnimator {} +inline fun Activity.viewAnimator(init: (@AnkoViewDslMarker _ViewAnimator).() -> Unit): ViewAnimator { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_ANIMATOR, theme = 0) { init() } +} + +fun Activity.themedViewAnimator(theme: Int = 0): ViewAnimator = + themedViewAnimator(theme) {} + +inline fun Activity.themedViewAnimator( + theme: Int = 0, + init: (@AnkoViewDslMarker _ViewAnimator).() -> Unit, +): ViewAnimator { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_ANIMATOR, theme) { init() } +} + +fun ViewManager.viewSwitcher(): ViewSwitcher = viewSwitcher {} +inline fun ViewManager.viewSwitcher(init: (@AnkoViewDslMarker _ViewSwitcher).() -> Unit): ViewSwitcher { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_SWITCHER, theme = 0) { init() } +} + +fun ViewManager.themedViewSwitcher(theme: Int = 0): ViewSwitcher = + themedViewSwitcher(theme) {} + +inline fun ViewManager.themedViewSwitcher( + theme: Int = 0, + init: (@AnkoViewDslMarker _ViewSwitcher).() -> Unit, +): ViewSwitcher { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_SWITCHER, theme) { init() } +} + +fun Context.viewSwitcher(): ViewSwitcher = viewSwitcher {} +inline fun Context.viewSwitcher(init: (@AnkoViewDslMarker _ViewSwitcher).() -> Unit): ViewSwitcher { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_SWITCHER, theme = 0) { init() } +} + +fun Context.themedViewSwitcher(theme: Int = 0): ViewSwitcher = + themedViewSwitcher(theme) {} + +inline fun Context.themedViewSwitcher( + theme: Int = 0, + init: (@AnkoViewDslMarker _ViewSwitcher).() -> Unit, +): ViewSwitcher { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_SWITCHER, theme) { init() } +} + +fun Activity.viewSwitcher(): ViewSwitcher = viewSwitcher {} +inline fun Activity.viewSwitcher(init: (@AnkoViewDslMarker _ViewSwitcher).() -> Unit): ViewSwitcher { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_SWITCHER, theme = 0) { init() } +} + +fun Activity.themedViewSwitcher(theme: Int = 0): ViewSwitcher = + themedViewSwitcher(theme) {} + +inline fun Activity.themedViewSwitcher( + theme: Int = 0, + init: (@AnkoViewDslMarker _ViewSwitcher).() -> Unit, +): ViewSwitcher { + return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_SWITCHER, theme) { init() } +} diff --git a/anko/src/main/java/org/jetbrains/anko/Views.kt b/anko/src/main/java/org/jetbrains/anko/Views.kt index 7666ec30..7d4241ba 100644 --- a/anko/src/main/java/org/jetbrains/anko/Views.kt +++ b/anko/src/main/java/org/jetbrains/anko/Views.kt @@ -3,356 +3,363 @@ package org.jetbrains.anko -import android.app.Activity +import android.app.* import android.content.Context -import android.view.ViewManager import android.widget.* import org.jetbrains.anko.custom.* +import androidx.appcompat.widget.* +import android.gesture.GestureOverlayView +import android.inputmethodservice.ExtractEditText +import android.media.tv.TvView +import android.opengl.GLSurfaceView +import android.view.* +import android.webkit.WebView +import androidx.appcompat.widget.SearchView @PublishedApi internal object `$$Anko$Factories$Sdk28View` { - val MEDIA_ROUTE_BUTTON = { ctx: Context -> android.app.MediaRouteButton(ctx) } - val GESTURE_OVERLAY_VIEW = { ctx: Context -> android.gesture.GestureOverlayView(ctx) } - val EXTRACT_EDIT_TEXT = { ctx: Context -> android.inputmethodservice.ExtractEditText(ctx) } - val TV_VIEW = { ctx: Context -> android.media.tv.TvView(ctx) } - val G_L_SURFACE_VIEW = { ctx: Context -> android.opengl.GLSurfaceView(ctx) } - val SURFACE_VIEW = { ctx: Context -> android.view.SurfaceView(ctx) } - val TEXTURE_VIEW = { ctx: Context -> android.view.TextureView(ctx) } - val VIEW = { ctx: Context -> android.view.View(ctx) } - val VIEW_STUB = { ctx: Context -> android.view.ViewStub(ctx) } - val WEB_VIEW = { ctx: Context -> android.webkit.WebView(ctx) } - val ADAPTER_VIEW_FLIPPER = { ctx: Context -> android.widget.AdapterViewFlipper(ctx) } + val MEDIA_ROUTE_BUTTON = { ctx: Context -> MediaRouteButton(ctx) } + val GESTURE_OVERLAY_VIEW = { ctx: Context -> GestureOverlayView(ctx) } + val EXTRACT_EDIT_TEXT = { ctx: Context -> ExtractEditText(ctx) } + val TV_VIEW = { ctx: Context -> TvView(ctx) } + val G_L_SURFACE_VIEW = { ctx: Context -> GLSurfaceView(ctx) } + val SURFACE_VIEW = { ctx: Context -> SurfaceView(ctx) } + val TEXTURE_VIEW = { ctx: Context -> TextureView(ctx) } + val VIEW = { ctx: Context -> View(ctx) } + val VIEW_STUB = { ctx: Context -> ViewStub(ctx) } + val WEB_VIEW = { ctx: Context -> WebView(ctx) } + val ADAPTER_VIEW_FLIPPER = { ctx: Context -> AdapterViewFlipper(ctx) } //val ANALOG_CLOCK = { ctx: Context -> android.widget.AnalogClock(ctx) } - val AUTO_COMPLETE_TEXT_VIEW = { ctx: Context -> android.widget.AutoCompleteTextView(ctx) } - val BUTTON = { ctx: Context -> android.widget.Button(ctx) } - val CALENDAR_VIEW = { ctx: Context -> android.widget.CalendarView(ctx) } - val CHECK_BOX = { ctx: Context -> android.widget.CheckBox(ctx) } - val CHECKED_TEXT_VIEW = { ctx: Context -> android.widget.CheckedTextView(ctx) } - val CHRONOMETER = { ctx: Context -> android.widget.Chronometer(ctx) } - val DATE_PICKER = { ctx: Context -> android.widget.DatePicker(ctx) } + val AUTO_COMPLETE_TEXT_VIEW = { ctx: Context -> AppCompatAutoCompleteTextView(ctx) } + val BUTTON = { ctx: Context -> AppCompatButton(ctx) } + val CALENDAR_VIEW = { ctx: Context -> CalendarView(ctx) } + val CHECK_BOX = { ctx: Context -> AppCompatCheckBox(ctx) } + val CHECKED_TEXT_VIEW = { ctx: Context -> AppCompatCheckedTextView(ctx) } + val CHRONOMETER = { ctx: Context -> Chronometer(ctx) } + val DATE_PICKER = { ctx: Context -> DatePicker(ctx) } //val DIALER_FILTER = { ctx: Context -> android.widget.DialerFilter(ctx) } //val DIGITAL_CLOCK = { ctx: Context -> android.widget.DigitalClock(ctx) } - val EDIT_TEXT = { ctx: Context -> android.widget.EditText(ctx) } - val EXPANDABLE_LIST_VIEW = { ctx: Context -> android.widget.ExpandableListView(ctx) } - val IMAGE_BUTTON = { ctx: Context -> android.widget.ImageButton(ctx) } - val IMAGE_VIEW = { ctx: Context -> android.widget.ImageView(ctx) } - val LIST_VIEW = { ctx: Context -> android.widget.ListView(ctx) } + val EDIT_TEXT = { ctx: Context -> AppCompatEditText(ctx) } + val EXPANDABLE_LIST_VIEW = { ctx: Context -> ExpandableListView(ctx) } + val IMAGE_BUTTON = { ctx: Context -> AppCompatImageButton(ctx) } + val IMAGE_VIEW = { ctx: Context -> AppCompatImageView(ctx) } + val LIST_VIEW = { ctx: Context -> ListView(ctx) } val MULTI_AUTO_COMPLETE_TEXT_VIEW = - { ctx: Context -> android.widget.MultiAutoCompleteTextView(ctx) } - val NUMBER_PICKER = { ctx: Context -> android.widget.NumberPicker(ctx) } - val PROGRESS_BAR = { ctx: Context -> android.widget.ProgressBar(ctx) } - val QUICK_CONTACT_BADGE = { ctx: Context -> android.widget.QuickContactBadge(ctx) } - val RADIO_BUTTON = { ctx: Context -> android.widget.RadioButton(ctx) } - val RATING_BAR = { ctx: Context -> android.widget.RatingBar(ctx) } - val SEARCH_VIEW = { ctx: Context -> android.widget.SearchView(ctx) } - val SEEK_BAR = { ctx: Context -> android.widget.SeekBar(ctx) } + { ctx: Context -> AppCompatMultiAutoCompleteTextView(ctx) } + val NUMBER_PICKER = { ctx: Context -> NumberPicker(ctx) } + val PROGRESS_BAR = { ctx: Context -> ProgressBar(ctx) } + val QUICK_CONTACT_BADGE = { ctx: Context -> QuickContactBadge(ctx) } + val RADIO_BUTTON = { ctx: Context -> AppCompatRadioButton(ctx) } + val RATING_BAR = { ctx: Context -> AppCompatRatingBar(ctx) } + val SEARCH_VIEW = { ctx: Context -> SearchView(ctx) } + val SEEK_BAR = { ctx: Context -> AppCompatSeekBar(ctx) } // val SLIDING_DRAWER = { ctx: Context -> android.widget.SlidingDrawer(ctx, null) } - val SPACE = { ctx: Context -> android.widget.Space(ctx) } - val SPINNER = { ctx: Context -> android.widget.Spinner(ctx) } - val STACK_VIEW = { ctx: Context -> android.widget.StackView(ctx) } - val SWITCH = { ctx: Context -> android.widget.Switch(ctx) } + val SPACE = { ctx: Context -> Space(ctx) } + val SPINNER = { ctx: Context -> AppCompatSpinner(ctx) } + val STACK_VIEW = { ctx: Context -> StackView(ctx) } + val SWITCH = { ctx: Context -> SwitchCompat(ctx) } // val TAB_HOST = { ctx: Context -> android.widget.TabHost(ctx) } // val TAB_WIDGET = { ctx: Context -> android.widget.TabWidget(ctx) } - val TEXT_CLOCK = { ctx: Context -> android.widget.TextClock(ctx) } - val TEXT_VIEW = { ctx: Context -> android.widget.TextView(ctx) } - val TIME_PICKER = { ctx: Context -> android.widget.TimePicker(ctx) } - val TOGGLE_BUTTON = { ctx: Context -> android.widget.ToggleButton(ctx) } + val TEXT_CLOCK = { ctx: Context -> TextClock(ctx) } + val TEXT_VIEW = { ctx: Context -> AppCompatTextView(ctx) } + val TIME_PICKER = { ctx: Context -> TimePicker(ctx) } + val TOGGLE_BUTTON = { ctx: Context -> AppCompatToggleButton(ctx) } // val TWO_LINE_LIST_ITEM = { ctx: Context -> android.widget.TwoLineListItem(ctx) } - val VIDEO_VIEW = { ctx: Context -> android.widget.VideoView(ctx) } - val VIEW_FLIPPER = { ctx: Context -> android.widget.ViewFlipper(ctx) } + val VIDEO_VIEW = { ctx: Context -> VideoView(ctx) } + val VIEW_FLIPPER = { ctx: Context -> ViewFlipper(ctx) } // val ZOOM_BUTTON = { ctx: Context -> android.widget.ZoomButton(ctx) } // val ZOOM_CONTROLS = { ctx: Context -> android.widget.ZoomControls(ctx) } } -fun ViewManager.mediaRouteButton(): android.app.MediaRouteButton = mediaRouteButton() {} -inline fun ViewManager.mediaRouteButton(init: (@AnkoViewDslMarker android.app.MediaRouteButton).() -> Unit): android.app.MediaRouteButton { +fun ViewManager.mediaRouteButton(): MediaRouteButton = mediaRouteButton {} +inline fun ViewManager.mediaRouteButton(init: (@AnkoViewDslMarker MediaRouteButton).() -> Unit): MediaRouteButton { return ankoView(`$$Anko$Factories$Sdk28View`.MEDIA_ROUTE_BUTTON, theme = 0) { init() } } -fun ViewManager.themedMediaRouteButton(theme: Int = 0): android.app.MediaRouteButton = +fun ViewManager.themedMediaRouteButton(theme: Int = 0): MediaRouteButton = themedMediaRouteButton(theme) {} inline fun ViewManager.themedMediaRouteButton( theme: Int = 0, - init: (@AnkoViewDslMarker android.app.MediaRouteButton).() -> Unit, -): android.app.MediaRouteButton { + init: (@AnkoViewDslMarker MediaRouteButton).() -> Unit, +): MediaRouteButton { return ankoView(`$$Anko$Factories$Sdk28View`.MEDIA_ROUTE_BUTTON, theme) { init() } } -fun ViewManager.gestureOverlayView(): android.gesture.GestureOverlayView = - gestureOverlayView() {} +fun ViewManager.gestureOverlayView(): GestureOverlayView = + gestureOverlayView {} -inline fun ViewManager.gestureOverlayView(init: (@AnkoViewDslMarker android.gesture.GestureOverlayView).() -> Unit): android.gesture.GestureOverlayView { +inline fun ViewManager.gestureOverlayView(init: (@AnkoViewDslMarker GestureOverlayView).() -> Unit): GestureOverlayView { return ankoView(`$$Anko$Factories$Sdk28View`.GESTURE_OVERLAY_VIEW, theme = 0) { init() } } -fun ViewManager.themedGestureOverlayView(theme: Int = 0): android.gesture.GestureOverlayView = +fun ViewManager.themedGestureOverlayView(theme: Int = 0): GestureOverlayView = themedGestureOverlayView(theme) {} inline fun ViewManager.themedGestureOverlayView( theme: Int = 0, - init: (@AnkoViewDslMarker android.gesture.GestureOverlayView).() -> Unit, -): android.gesture.GestureOverlayView { + init: (@AnkoViewDslMarker GestureOverlayView).() -> Unit, +): GestureOverlayView { return ankoView(`$$Anko$Factories$Sdk28View`.GESTURE_OVERLAY_VIEW, theme) { init() } } -fun Context.gestureOverlayView(): android.gesture.GestureOverlayView = - gestureOverlayView() {} +fun Context.gestureOverlayView(): GestureOverlayView = + gestureOverlayView {} -inline fun Context.gestureOverlayView(init: (@AnkoViewDslMarker android.gesture.GestureOverlayView).() -> Unit): android.gesture.GestureOverlayView { +inline fun Context.gestureOverlayView(init: (@AnkoViewDslMarker GestureOverlayView).() -> Unit): GestureOverlayView { return ankoView(`$$Anko$Factories$Sdk28View`.GESTURE_OVERLAY_VIEW, theme = 0) { init() } } -fun Context.themedGestureOverlayView(theme: Int = 0): android.gesture.GestureOverlayView = +fun Context.themedGestureOverlayView(theme: Int = 0): GestureOverlayView = themedGestureOverlayView(theme) {} inline fun Context.themedGestureOverlayView( theme: Int = 0, - init: (@AnkoViewDslMarker android.gesture.GestureOverlayView).() -> Unit, -): android.gesture.GestureOverlayView { + init: (@AnkoViewDslMarker GestureOverlayView).() -> Unit, +): GestureOverlayView { return ankoView(`$$Anko$Factories$Sdk28View`.GESTURE_OVERLAY_VIEW, theme) { init() } } -fun Activity.gestureOverlayView(): android.gesture.GestureOverlayView = - gestureOverlayView() {} +fun Activity.gestureOverlayView(): GestureOverlayView = + gestureOverlayView {} -inline fun Activity.gestureOverlayView(init: (@AnkoViewDslMarker android.gesture.GestureOverlayView).() -> Unit): android.gesture.GestureOverlayView { +inline fun Activity.gestureOverlayView(init: (@AnkoViewDslMarker GestureOverlayView).() -> Unit): GestureOverlayView { return ankoView(`$$Anko$Factories$Sdk28View`.GESTURE_OVERLAY_VIEW, theme = 0) { init() } } -fun Activity.themedGestureOverlayView(theme: Int = 0): android.gesture.GestureOverlayView = +fun Activity.themedGestureOverlayView(theme: Int = 0): GestureOverlayView = themedGestureOverlayView(theme) {} inline fun Activity.themedGestureOverlayView( theme: Int = 0, - init: (@AnkoViewDslMarker android.gesture.GestureOverlayView).() -> Unit, -): android.gesture.GestureOverlayView { + init: (@AnkoViewDslMarker GestureOverlayView).() -> Unit, +): GestureOverlayView { return ankoView(`$$Anko$Factories$Sdk28View`.GESTURE_OVERLAY_VIEW, theme) { init() } } -fun ViewManager.extractEditText(): android.inputmethodservice.ExtractEditText = - extractEditText() {} +fun ViewManager.extractEditText(): ExtractEditText = + extractEditText {} -inline fun ViewManager.extractEditText(init: (@AnkoViewDslMarker android.inputmethodservice.ExtractEditText).() -> Unit): android.inputmethodservice.ExtractEditText { +inline fun ViewManager.extractEditText(init: (@AnkoViewDslMarker ExtractEditText).() -> Unit): ExtractEditText { return ankoView(`$$Anko$Factories$Sdk28View`.EXTRACT_EDIT_TEXT, theme = 0) { init() } } -fun ViewManager.themedExtractEditText(theme: Int = 0): android.inputmethodservice.ExtractEditText = +fun ViewManager.themedExtractEditText(theme: Int = 0): ExtractEditText = themedExtractEditText(theme) {} inline fun ViewManager.themedExtractEditText( theme: Int = 0, - init: (@AnkoViewDslMarker android.inputmethodservice.ExtractEditText).() -> Unit, -): android.inputmethodservice.ExtractEditText { + init: (@AnkoViewDslMarker ExtractEditText).() -> Unit, +): ExtractEditText { return ankoView(`$$Anko$Factories$Sdk28View`.EXTRACT_EDIT_TEXT, theme) { init() } } -fun ViewManager.tvView(): android.media.tv.TvView = tvView() {} -inline fun ViewManager.tvView(init: (@AnkoViewDslMarker android.media.tv.TvView).() -> Unit): android.media.tv.TvView { +fun ViewManager.tvView(): TvView = tvView {} +inline fun ViewManager.tvView(init: (@AnkoViewDslMarker TvView).() -> Unit): TvView { return ankoView(`$$Anko$Factories$Sdk28View`.TV_VIEW, theme = 0) { init() } } -fun ViewManager.themedTvView(theme: Int = 0): android.media.tv.TvView = +fun ViewManager.themedTvView(theme: Int = 0): TvView = themedTvView(theme) {} inline fun ViewManager.themedTvView( theme: Int = 0, - init: (@AnkoViewDslMarker android.media.tv.TvView).() -> Unit, -): android.media.tv.TvView { + init: (@AnkoViewDslMarker TvView).() -> Unit, +): TvView { return ankoView(`$$Anko$Factories$Sdk28View`.TV_VIEW, theme) { init() } } -fun Context.tvView(): android.media.tv.TvView = tvView() {} -inline fun Context.tvView(init: (@AnkoViewDslMarker android.media.tv.TvView).() -> Unit): android.media.tv.TvView { +fun Context.tvView(): TvView = tvView {} +inline fun Context.tvView(init: (@AnkoViewDslMarker TvView).() -> Unit): TvView { return ankoView(`$$Anko$Factories$Sdk28View`.TV_VIEW, theme = 0) { init() } } -fun Context.themedTvView(theme: Int = 0): android.media.tv.TvView = themedTvView(theme) {} +fun Context.themedTvView(theme: Int = 0): TvView = themedTvView(theme) {} inline fun Context.themedTvView( theme: Int = 0, - init: (@AnkoViewDslMarker android.media.tv.TvView).() -> Unit, -): android.media.tv.TvView { + init: (@AnkoViewDslMarker TvView).() -> Unit, +): TvView { return ankoView(`$$Anko$Factories$Sdk28View`.TV_VIEW, theme) { init() } } -fun Activity.tvView(): android.media.tv.TvView = tvView() {} -inline fun Activity.tvView(init: (@AnkoViewDslMarker android.media.tv.TvView).() -> Unit): android.media.tv.TvView { +fun Activity.tvView(): TvView = tvView {} +inline fun Activity.tvView(init: (@AnkoViewDslMarker TvView).() -> Unit): TvView { return ankoView(`$$Anko$Factories$Sdk28View`.TV_VIEW, theme = 0) { init() } } -fun Activity.themedTvView(theme: Int = 0): android.media.tv.TvView = themedTvView(theme) {} +fun Activity.themedTvView(theme: Int = 0): TvView = themedTvView(theme) {} inline fun Activity.themedTvView( theme: Int = 0, - init: (@AnkoViewDslMarker android.media.tv.TvView).() -> Unit, -): android.media.tv.TvView { + init: (@AnkoViewDslMarker TvView).() -> Unit, +): TvView { return ankoView(`$$Anko$Factories$Sdk28View`.TV_VIEW, theme) { init() } } -fun ViewManager.gLSurfaceView(): android.opengl.GLSurfaceView = gLSurfaceView() {} -inline fun ViewManager.gLSurfaceView(init: (@AnkoViewDslMarker android.opengl.GLSurfaceView).() -> Unit): android.opengl.GLSurfaceView { +fun ViewManager.gLSurfaceView(): GLSurfaceView = gLSurfaceView {} +inline fun ViewManager.gLSurfaceView(init: (@AnkoViewDslMarker GLSurfaceView).() -> Unit): GLSurfaceView { return ankoView(`$$Anko$Factories$Sdk28View`.G_L_SURFACE_VIEW, theme = 0) { init() } } -fun ViewManager.themedGLSurfaceView(theme: Int = 0): android.opengl.GLSurfaceView = +fun ViewManager.themedGLSurfaceView(theme: Int = 0): GLSurfaceView = themedGLSurfaceView(theme) {} inline fun ViewManager.themedGLSurfaceView( theme: Int = 0, - init: (@AnkoViewDslMarker android.opengl.GLSurfaceView).() -> Unit, -): android.opengl.GLSurfaceView { + init: (@AnkoViewDslMarker GLSurfaceView).() -> Unit, +): GLSurfaceView { return ankoView(`$$Anko$Factories$Sdk28View`.G_L_SURFACE_VIEW, theme) { init() } } -fun ViewManager.surfaceView(): android.view.SurfaceView = surfaceView() {} -inline fun ViewManager.surfaceView(init: (@AnkoViewDslMarker android.view.SurfaceView).() -> Unit): android.view.SurfaceView { +fun ViewManager.surfaceView(): SurfaceView = surfaceView {} +inline fun ViewManager.surfaceView(init: (@AnkoViewDslMarker SurfaceView).() -> Unit): SurfaceView { return ankoView(`$$Anko$Factories$Sdk28View`.SURFACE_VIEW, theme = 0) { init() } } -fun ViewManager.themedSurfaceView(theme: Int = 0): android.view.SurfaceView = +fun ViewManager.themedSurfaceView(theme: Int = 0): SurfaceView = themedSurfaceView(theme) {} inline fun ViewManager.themedSurfaceView( theme: Int = 0, - init: (@AnkoViewDslMarker android.view.SurfaceView).() -> Unit, -): android.view.SurfaceView { + init: (@AnkoViewDslMarker SurfaceView).() -> Unit, +): SurfaceView { return ankoView(`$$Anko$Factories$Sdk28View`.SURFACE_VIEW, theme) { init() } } -fun ViewManager.textureView(): android.view.TextureView = textureView() {} -inline fun ViewManager.textureView(init: (@AnkoViewDslMarker android.view.TextureView).() -> Unit): android.view.TextureView { +fun ViewManager.textureView(): TextureView = textureView {} +inline fun ViewManager.textureView(init: (@AnkoViewDslMarker TextureView).() -> Unit): TextureView { return ankoView(`$$Anko$Factories$Sdk28View`.TEXTURE_VIEW, theme = 0) { init() } } -fun ViewManager.themedTextureView(theme: Int = 0): android.view.TextureView = +fun ViewManager.themedTextureView(theme: Int = 0): TextureView = themedTextureView(theme) {} inline fun ViewManager.themedTextureView( theme: Int = 0, - init: (@AnkoViewDslMarker android.view.TextureView).() -> Unit, -): android.view.TextureView { + init: (@AnkoViewDslMarker TextureView).() -> Unit, +): TextureView { return ankoView(`$$Anko$Factories$Sdk28View`.TEXTURE_VIEW, theme) { init() } } -fun ViewManager.view(): android.view.View = view() {} -inline fun ViewManager.view(init: (@AnkoViewDslMarker android.view.View).() -> Unit): android.view.View { +fun ViewManager.view(): View = view {} +inline fun ViewManager.view(init: (@AnkoViewDslMarker View).() -> Unit): View { return ankoView(`$$Anko$Factories$Sdk28View`.VIEW, theme = 0) { init() } } -fun ViewManager.themedView(theme: Int = 0): android.view.View = themedView(theme) {} +fun ViewManager.themedView(theme: Int = 0): View = themedView(theme) {} inline fun ViewManager.themedView( theme: Int = 0, - init: (@AnkoViewDslMarker android.view.View).() -> Unit, -): android.view.View { + init: (@AnkoViewDslMarker View).() -> Unit, +): View { return ankoView(`$$Anko$Factories$Sdk28View`.VIEW, theme) { init() } } -fun ViewManager.viewStub(): android.view.ViewStub = viewStub() {} -inline fun ViewManager.viewStub(init: (@AnkoViewDslMarker android.view.ViewStub).() -> Unit): android.view.ViewStub { +fun ViewManager.viewStub(): ViewStub = viewStub {} +inline fun ViewManager.viewStub(init: (@AnkoViewDslMarker ViewStub).() -> Unit): ViewStub { return ankoView(`$$Anko$Factories$Sdk28View`.VIEW_STUB, theme = 0) { init() } } -fun ViewManager.themedViewStub(theme: Int = 0): android.view.ViewStub = +fun ViewManager.themedViewStub(theme: Int = 0): ViewStub = themedViewStub(theme) {} inline fun ViewManager.themedViewStub( theme: Int = 0, - init: (@AnkoViewDslMarker android.view.ViewStub).() -> Unit, -): android.view.ViewStub { + init: (@AnkoViewDslMarker ViewStub).() -> Unit, +): ViewStub { return ankoView(`$$Anko$Factories$Sdk28View`.VIEW_STUB, theme) { init() } } -fun ViewManager.webView(): android.webkit.WebView = webView() {} -inline fun ViewManager.webView(init: (@AnkoViewDslMarker android.webkit.WebView).() -> Unit): android.webkit.WebView { +fun ViewManager.webView(): WebView = webView {} +inline fun ViewManager.webView(init: (@AnkoViewDslMarker WebView).() -> Unit): WebView { return ankoView(`$$Anko$Factories$Sdk28View`.WEB_VIEW, theme = 0) { init() } } -fun ViewManager.themedWebView(theme: Int = 0): android.webkit.WebView = +fun ViewManager.themedWebView(theme: Int = 0): WebView = themedWebView(theme) {} inline fun ViewManager.themedWebView( theme: Int = 0, - init: (@AnkoViewDslMarker android.webkit.WebView).() -> Unit, -): android.webkit.WebView { + init: (@AnkoViewDslMarker WebView).() -> Unit, +): WebView { return ankoView(`$$Anko$Factories$Sdk28View`.WEB_VIEW, theme) { init() } } -fun Context.webView(): android.webkit.WebView = webView() {} -inline fun Context.webView(init: (@AnkoViewDslMarker android.webkit.WebView).() -> Unit): android.webkit.WebView { +fun Context.webView(): WebView = webView {} +inline fun Context.webView(init: (@AnkoViewDslMarker WebView).() -> Unit): WebView { return ankoView(`$$Anko$Factories$Sdk28View`.WEB_VIEW, theme = 0) { init() } } -fun Context.themedWebView(theme: Int = 0): android.webkit.WebView = themedWebView(theme) {} +fun Context.themedWebView(theme: Int = 0): WebView = themedWebView(theme) {} inline fun Context.themedWebView( theme: Int = 0, - init: (@AnkoViewDslMarker android.webkit.WebView).() -> Unit, -): android.webkit.WebView { + init: (@AnkoViewDslMarker WebView).() -> Unit, +): WebView { return ankoView(`$$Anko$Factories$Sdk28View`.WEB_VIEW, theme) { init() } } -fun Activity.webView(): android.webkit.WebView = webView() {} -inline fun Activity.webView(init: (@AnkoViewDslMarker android.webkit.WebView).() -> Unit): android.webkit.WebView { +fun Activity.webView(): WebView = webView {} +inline fun Activity.webView(init: (@AnkoViewDslMarker WebView).() -> Unit): WebView { return ankoView(`$$Anko$Factories$Sdk28View`.WEB_VIEW, theme = 0) { init() } } -fun Activity.themedWebView(theme: Int = 0): android.webkit.WebView = themedWebView(theme) {} +fun Activity.themedWebView(theme: Int = 0): WebView = themedWebView(theme) {} inline fun Activity.themedWebView( theme: Int = 0, - init: (@AnkoViewDslMarker android.webkit.WebView).() -> Unit, -): android.webkit.WebView { + init: (@AnkoViewDslMarker WebView).() -> Unit, +): WebView { return ankoView(`$$Anko$Factories$Sdk28View`.WEB_VIEW, theme) { init() } } -fun ViewManager.adapterViewFlipper(): android.widget.AdapterViewFlipper = - adapterViewFlipper() {} +fun ViewManager.adapterViewFlipper(): AdapterViewFlipper = + adapterViewFlipper {} -inline fun ViewManager.adapterViewFlipper(init: (@AnkoViewDslMarker android.widget.AdapterViewFlipper).() -> Unit): android.widget.AdapterViewFlipper { +inline fun ViewManager.adapterViewFlipper(init: (@AnkoViewDslMarker AdapterViewFlipper).() -> Unit): AdapterViewFlipper { return ankoView(`$$Anko$Factories$Sdk28View`.ADAPTER_VIEW_FLIPPER, theme = 0) { init() } } -fun ViewManager.themedAdapterViewFlipper(theme: Int = 0): android.widget.AdapterViewFlipper = +fun ViewManager.themedAdapterViewFlipper(theme: Int = 0): AdapterViewFlipper = themedAdapterViewFlipper(theme) {} inline fun ViewManager.themedAdapterViewFlipper( theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.AdapterViewFlipper).() -> Unit, -): android.widget.AdapterViewFlipper { + init: (@AnkoViewDslMarker AdapterViewFlipper).() -> Unit, +): AdapterViewFlipper { return ankoView(`$$Anko$Factories$Sdk28View`.ADAPTER_VIEW_FLIPPER, theme) { init() } } -fun Context.adapterViewFlipper(): android.widget.AdapterViewFlipper = adapterViewFlipper() {} -inline fun Context.adapterViewFlipper(init: (@AnkoViewDslMarker android.widget.AdapterViewFlipper).() -> Unit): android.widget.AdapterViewFlipper { +fun Context.adapterViewFlipper(): AdapterViewFlipper = adapterViewFlipper {} +inline fun Context.adapterViewFlipper(init: (@AnkoViewDslMarker AdapterViewFlipper).() -> Unit): AdapterViewFlipper { return ankoView(`$$Anko$Factories$Sdk28View`.ADAPTER_VIEW_FLIPPER, theme = 0) { init() } } -fun Context.themedAdapterViewFlipper(theme: Int = 0): android.widget.AdapterViewFlipper = +fun Context.themedAdapterViewFlipper(theme: Int = 0): AdapterViewFlipper = themedAdapterViewFlipper(theme) {} inline fun Context.themedAdapterViewFlipper( theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.AdapterViewFlipper).() -> Unit, -): android.widget.AdapterViewFlipper { + init: (@AnkoViewDslMarker AdapterViewFlipper).() -> Unit, +): AdapterViewFlipper { return ankoView(`$$Anko$Factories$Sdk28View`.ADAPTER_VIEW_FLIPPER, theme) { init() } } -fun Activity.adapterViewFlipper(): android.widget.AdapterViewFlipper = - adapterViewFlipper() {} +fun Activity.adapterViewFlipper(): AdapterViewFlipper = + adapterViewFlipper {} -inline fun Activity.adapterViewFlipper(init: (@AnkoViewDslMarker android.widget.AdapterViewFlipper).() -> Unit): android.widget.AdapterViewFlipper { +inline fun Activity.adapterViewFlipper(init: (@AnkoViewDslMarker AdapterViewFlipper).() -> Unit): AdapterViewFlipper { return ankoView(`$$Anko$Factories$Sdk28View`.ADAPTER_VIEW_FLIPPER, theme = 0) { init() } } -fun Activity.themedAdapterViewFlipper(theme: Int = 0): android.widget.AdapterViewFlipper = +fun Activity.themedAdapterViewFlipper(theme: Int = 0): AdapterViewFlipper = themedAdapterViewFlipper(theme) {} inline fun Activity.themedAdapterViewFlipper( theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.AdapterViewFlipper).() -> Unit, -): android.widget.AdapterViewFlipper { + init: (@AnkoViewDslMarker AdapterViewFlipper).() -> Unit, +): AdapterViewFlipper { return ankoView(`$$Anko$Factories$Sdk28View`.ADAPTER_VIEW_FLIPPER, theme) { init() } } @@ -371,37 +378,37 @@ inline fun Activity.themedAdapterViewFlipper( // return ankoView(`$$Anko$Factories$Sdk28View`.ANALOG_CLOCK, theme) { init() } //} -fun ViewManager.autoCompleteTextView(): android.widget.AutoCompleteTextView = - autoCompleteTextView() {} +fun ViewManager.autoCompleteTextView(): AppCompatAutoCompleteTextView = + autoCompleteTextView {} -inline fun ViewManager.autoCompleteTextView(init: (@AnkoViewDslMarker android.widget.AutoCompleteTextView).() -> Unit): android.widget.AutoCompleteTextView { +inline fun ViewManager.autoCompleteTextView(init: (@AnkoViewDslMarker AppCompatAutoCompleteTextView).() -> Unit): AppCompatAutoCompleteTextView { return ankoView(`$$Anko$Factories$Sdk28View`.AUTO_COMPLETE_TEXT_VIEW, theme = 0) { init() } } -fun ViewManager.themedAutoCompleteTextView(theme: Int = 0): android.widget.AutoCompleteTextView = +fun ViewManager.themedAutoCompleteTextView(theme: Int = 0): AppCompatAutoCompleteTextView = themedAutoCompleteTextView(theme) {} inline fun ViewManager.themedAutoCompleteTextView( theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.AutoCompleteTextView).() -> Unit, -): android.widget.AutoCompleteTextView { + init: (@AnkoViewDslMarker AppCompatAutoCompleteTextView).() -> Unit, +): AppCompatAutoCompleteTextView { return ankoView(`$$Anko$Factories$Sdk28View`.AUTO_COMPLETE_TEXT_VIEW, theme) { init() } } -fun ViewManager.button(): android.widget.Button = button() {} -inline fun ViewManager.button(init: (@AnkoViewDslMarker android.widget.Button).() -> Unit): android.widget.Button { +fun ViewManager.button(): AppCompatButton = button {} +inline fun ViewManager.button(init: (@AnkoViewDslMarker AppCompatButton).() -> Unit): AppCompatButton { return ankoView(`$$Anko$Factories$Sdk28View`.BUTTON, theme = 0) { init() } } -fun ViewManager.themedButton(theme: Int = 0): android.widget.Button = themedButton(theme) {} +fun ViewManager.themedButton(theme: Int = 0): AppCompatButton = themedButton(theme) {} inline fun ViewManager.themedButton( theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.Button).() -> Unit, -): android.widget.Button { + init: (@AnkoViewDslMarker AppCompatButton).() -> Unit, +): AppCompatButton { return ankoView(`$$Anko$Factories$Sdk28View`.BUTTON, theme) { init() } } -fun ViewManager.button(text: CharSequence?): android.widget.Button { +fun ViewManager.button(text: CharSequence?): AppCompatButton { return ankoView(`$$Anko$Factories$Sdk28View`.BUTTON, theme = 0) { setText(text) } @@ -409,15 +416,15 @@ fun ViewManager.button(text: CharSequence?): android.widget.Button { inline fun ViewManager.button( text: CharSequence?, - init: (@AnkoViewDslMarker android.widget.Button).() -> Unit, -): android.widget.Button { + init: (@AnkoViewDslMarker AppCompatButton).() -> Unit, +): AppCompatButton { return ankoView(`$$Anko$Factories$Sdk28View`.BUTTON, theme = 0) { init() setText(text) } } -fun ViewManager.themedButton(text: CharSequence?, theme: Int): android.widget.Button { +fun ViewManager.themedButton(text: CharSequence?, theme: Int): AppCompatButton { return ankoView(`$$Anko$Factories$Sdk28View`.BUTTON, theme) { setText(text) } @@ -426,15 +433,15 @@ fun ViewManager.themedButton(text: CharSequence?, theme: Int): android.widget.Bu inline fun ViewManager.themedButton( text: CharSequence?, theme: Int, - init: (@AnkoViewDslMarker android.widget.Button).() -> Unit, -): android.widget.Button { + init: (@AnkoViewDslMarker AppCompatButton).() -> Unit, +): AppCompatButton { return ankoView(`$$Anko$Factories$Sdk28View`.BUTTON, theme) { init() setText(text) } } -fun ViewManager.button(text: Int): android.widget.Button { +fun ViewManager.button(text: Int): AppCompatButton { return ankoView(`$$Anko$Factories$Sdk28View`.BUTTON, theme = 0) { setText(text) } @@ -442,15 +449,15 @@ fun ViewManager.button(text: Int): android.widget.Button { inline fun ViewManager.button( text: Int, - init: (@AnkoViewDslMarker android.widget.Button).() -> Unit, -): android.widget.Button { + init: (@AnkoViewDslMarker AppCompatButton).() -> Unit, +): AppCompatButton { return ankoView(`$$Anko$Factories$Sdk28View`.BUTTON, theme = 0) { init() setText(text) } } -fun ViewManager.themedButton(text: Int, theme: Int): android.widget.Button { +fun ViewManager.themedButton(text: Int, theme: Int): AppCompatButton { return ankoView(`$$Anko$Factories$Sdk28View`.BUTTON, theme) { setText(text) } @@ -459,75 +466,75 @@ fun ViewManager.themedButton(text: Int, theme: Int): android.widget.Button { inline fun ViewManager.themedButton( text: Int, theme: Int, - init: (@AnkoViewDslMarker android.widget.Button).() -> Unit, -): android.widget.Button { + init: (@AnkoViewDslMarker AppCompatButton).() -> Unit, +): AppCompatButton { return ankoView(`$$Anko$Factories$Sdk28View`.BUTTON, theme) { init() setText(text) } } -fun ViewManager.calendarView(): android.widget.CalendarView = calendarView() {} -inline fun ViewManager.calendarView(init: (@AnkoViewDslMarker android.widget.CalendarView).() -> Unit): android.widget.CalendarView { +fun ViewManager.calendarView(): CalendarView = calendarView {} +inline fun ViewManager.calendarView(init: (@AnkoViewDslMarker CalendarView).() -> Unit): CalendarView { return ankoView(`$$Anko$Factories$Sdk28View`.CALENDAR_VIEW, theme = 0) { init() } } -fun ViewManager.themedCalendarView(theme: Int = 0): android.widget.CalendarView = +fun ViewManager.themedCalendarView(theme: Int = 0): CalendarView = themedCalendarView(theme) {} inline fun ViewManager.themedCalendarView( theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.CalendarView).() -> Unit, -): android.widget.CalendarView { + init: (@AnkoViewDslMarker CalendarView).() -> Unit, +): CalendarView { return ankoView(`$$Anko$Factories$Sdk28View`.CALENDAR_VIEW, theme) { init() } } -fun Context.calendarView(): android.widget.CalendarView = calendarView() {} -inline fun Context.calendarView(init: (@AnkoViewDslMarker android.widget.CalendarView).() -> Unit): android.widget.CalendarView { +fun Context.calendarView(): CalendarView = calendarView {} +inline fun Context.calendarView(init: (@AnkoViewDslMarker CalendarView).() -> Unit): CalendarView { return ankoView(`$$Anko$Factories$Sdk28View`.CALENDAR_VIEW, theme = 0) { init() } } -fun Context.themedCalendarView(theme: Int = 0): android.widget.CalendarView = +fun Context.themedCalendarView(theme: Int = 0): CalendarView = themedCalendarView(theme) {} inline fun Context.themedCalendarView( theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.CalendarView).() -> Unit, -): android.widget.CalendarView { + init: (@AnkoViewDslMarker CalendarView).() -> Unit, +): CalendarView { return ankoView(`$$Anko$Factories$Sdk28View`.CALENDAR_VIEW, theme) { init() } } -fun Activity.calendarView(): android.widget.CalendarView = calendarView() {} -inline fun Activity.calendarView(init: (@AnkoViewDslMarker android.widget.CalendarView).() -> Unit): android.widget.CalendarView { +fun Activity.calendarView(): CalendarView = calendarView {} +inline fun Activity.calendarView(init: (@AnkoViewDslMarker CalendarView).() -> Unit): CalendarView { return ankoView(`$$Anko$Factories$Sdk28View`.CALENDAR_VIEW, theme = 0) { init() } } -fun Activity.themedCalendarView(theme: Int = 0): android.widget.CalendarView = +fun Activity.themedCalendarView(theme: Int = 0): CalendarView = themedCalendarView(theme) {} inline fun Activity.themedCalendarView( theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.CalendarView).() -> Unit, -): android.widget.CalendarView { + init: (@AnkoViewDslMarker CalendarView).() -> Unit, +): CalendarView { return ankoView(`$$Anko$Factories$Sdk28View`.CALENDAR_VIEW, theme) { init() } } -fun ViewManager.checkBox(): android.widget.CheckBox = checkBox() {} -inline fun ViewManager.checkBox(init: (@AnkoViewDslMarker android.widget.CheckBox).() -> Unit): android.widget.CheckBox { +fun ViewManager.checkBox(): AppCompatCheckBox = checkBox {} +inline fun ViewManager.checkBox(init: (@AnkoViewDslMarker AppCompatCheckBox).() -> Unit): AppCompatCheckBox { return ankoView(`$$Anko$Factories$Sdk28View`.CHECK_BOX, theme = 0) { init() } } -fun ViewManager.themedCheckBox(theme: Int = 0): android.widget.CheckBox = +fun ViewManager.themedCheckBox(theme: Int = 0): AppCompatCheckBox = themedCheckBox(theme) {} inline fun ViewManager.themedCheckBox( theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.CheckBox).() -> Unit, -): android.widget.CheckBox { + init: (@AnkoViewDslMarker AppCompatCheckBox).() -> Unit, +): AppCompatCheckBox { return ankoView(`$$Anko$Factories$Sdk28View`.CHECK_BOX, theme) { init() } } -fun ViewManager.checkBox(text: CharSequence?): android.widget.CheckBox { +fun ViewManager.checkBox(text: CharSequence?): AppCompatCheckBox { return ankoView(`$$Anko$Factories$Sdk28View`.CHECK_BOX, theme = 0) { setText(text) } @@ -535,15 +542,15 @@ fun ViewManager.checkBox(text: CharSequence?): android.widget.CheckBox { inline fun ViewManager.checkBox( text: CharSequence?, - init: (@AnkoViewDslMarker android.widget.CheckBox).() -> Unit, -): android.widget.CheckBox { + init: (@AnkoViewDslMarker AppCompatCheckBox).() -> Unit, +): AppCompatCheckBox { return ankoView(`$$Anko$Factories$Sdk28View`.CHECK_BOX, theme = 0) { init() setText(text) } } -fun ViewManager.themedCheckBox(text: CharSequence?, theme: Int): android.widget.CheckBox { +fun ViewManager.themedCheckBox(text: CharSequence?, theme: Int): AppCompatCheckBox { return ankoView(`$$Anko$Factories$Sdk28View`.CHECK_BOX, theme) { setText(text) } @@ -552,15 +559,15 @@ fun ViewManager.themedCheckBox(text: CharSequence?, theme: Int): android.widget. inline fun ViewManager.themedCheckBox( text: CharSequence?, theme: Int, - init: (@AnkoViewDslMarker android.widget.CheckBox).() -> Unit, -): android.widget.CheckBox { + init: (@AnkoViewDslMarker AppCompatCheckBox).() -> Unit, +): AppCompatCheckBox { return ankoView(`$$Anko$Factories$Sdk28View`.CHECK_BOX, theme) { init() setText(text) } } -fun ViewManager.checkBox(text: Int): android.widget.CheckBox { +fun ViewManager.checkBox(text: Int): AppCompatCheckBox { return ankoView(`$$Anko$Factories$Sdk28View`.CHECK_BOX, theme = 0) { setText(text) } @@ -568,15 +575,15 @@ fun ViewManager.checkBox(text: Int): android.widget.CheckBox { inline fun ViewManager.checkBox( text: Int, - init: (@AnkoViewDslMarker android.widget.CheckBox).() -> Unit, -): android.widget.CheckBox { + init: (@AnkoViewDslMarker AppCompatCheckBox).() -> Unit, +): AppCompatCheckBox { return ankoView(`$$Anko$Factories$Sdk28View`.CHECK_BOX, theme = 0) { init() setText(text) } } -fun ViewManager.themedCheckBox(text: Int, theme: Int): android.widget.CheckBox { +fun ViewManager.themedCheckBox(text: Int, theme: Int): AppCompatCheckBox { return ankoView(`$$Anko$Factories$Sdk28View`.CHECK_BOX, theme) { setText(text) } @@ -585,30 +592,30 @@ fun ViewManager.themedCheckBox(text: Int, theme: Int): android.widget.CheckBox { inline fun ViewManager.themedCheckBox( text: Int, theme: Int, - init: (@AnkoViewDslMarker android.widget.CheckBox).() -> Unit, -): android.widget.CheckBox { + init: (@AnkoViewDslMarker AppCompatCheckBox).() -> Unit, +): AppCompatCheckBox { return ankoView(`$$Anko$Factories$Sdk28View`.CHECK_BOX, theme) { init() setText(text) } } -fun ViewManager.checkBox(text: CharSequence?, checked: Boolean): android.widget.CheckBox { +fun ViewManager.checkBox(text: CharSequence?, checked: Boolean): AppCompatCheckBox { return ankoView(`$$Anko$Factories$Sdk28View`.CHECK_BOX, theme = 0) { setText(text) - setChecked(checked) + isChecked = checked } } inline fun ViewManager.checkBox( text: CharSequence?, checked: Boolean, - init: (@AnkoViewDslMarker android.widget.CheckBox).() -> Unit, -): android.widget.CheckBox { + init: (@AnkoViewDslMarker AppCompatCheckBox).() -> Unit, +): AppCompatCheckBox { return ankoView(`$$Anko$Factories$Sdk28View`.CHECK_BOX, theme = 0) { init() setText(text) - setChecked(checked) + isChecked = checked } } @@ -616,10 +623,10 @@ fun ViewManager.themedCheckBox( text: CharSequence?, checked: Boolean, theme: Int, -): android.widget.CheckBox { +): AppCompatCheckBox { return ankoView(`$$Anko$Factories$Sdk28View`.CHECK_BOX, theme) { setText(text) - setChecked(checked) + isChecked = checked } } @@ -627,31 +634,31 @@ inline fun ViewManager.themedCheckBox( text: CharSequence?, checked: Boolean, theme: Int, - init: (@AnkoViewDslMarker android.widget.CheckBox).() -> Unit, -): android.widget.CheckBox { + init: (@AnkoViewDslMarker AppCompatCheckBox).() -> Unit, +): AppCompatCheckBox { return ankoView(`$$Anko$Factories$Sdk28View`.CHECK_BOX, theme) { init() setText(text) - setChecked(checked) + isChecked = checked } } -fun ViewManager.checkBox(text: Int, checked: Boolean): android.widget.CheckBox { +fun ViewManager.checkBox(text: Int, checked: Boolean): AppCompatCheckBox { return ankoView(`$$Anko$Factories$Sdk28View`.CHECK_BOX, theme = 0) { setText(text) - setChecked(checked) + isChecked = checked } } inline fun ViewManager.checkBox( text: Int, checked: Boolean, - init: (@AnkoViewDslMarker android.widget.CheckBox).() -> Unit, -): android.widget.CheckBox { + init: (@AnkoViewDslMarker AppCompatCheckBox).() -> Unit, +): AppCompatCheckBox { return ankoView(`$$Anko$Factories$Sdk28View`.CHECK_BOX, theme = 0) { init() setText(text) - setChecked(checked) + isChecked = checked } } @@ -659,10 +666,10 @@ fun ViewManager.themedCheckBox( text: Int, checked: Boolean, theme: Int, -): android.widget.CheckBox { +): AppCompatCheckBox { return ankoView(`$$Anko$Factories$Sdk28View`.CHECK_BOX, theme) { setText(text) - setChecked(checked) + isChecked = checked } } @@ -670,87 +677,87 @@ inline fun ViewManager.themedCheckBox( text: Int, checked: Boolean, theme: Int, - init: (@AnkoViewDslMarker android.widget.CheckBox).() -> Unit, -): android.widget.CheckBox { + init: (@AnkoViewDslMarker AppCompatCheckBox).() -> Unit, +): AppCompatCheckBox { return ankoView(`$$Anko$Factories$Sdk28View`.CHECK_BOX, theme) { init() setText(text) - setChecked(checked) + isChecked = checked } } -fun ViewManager.checkedTextView(): android.widget.CheckedTextView = checkedTextView() {} -inline fun ViewManager.checkedTextView(init: (@AnkoViewDslMarker android.widget.CheckedTextView).() -> Unit): android.widget.CheckedTextView { +fun ViewManager.checkedTextView(): AppCompatCheckedTextView = checkedTextView {} +inline fun ViewManager.checkedTextView(init: (@AnkoViewDslMarker AppCompatCheckedTextView).() -> Unit): AppCompatCheckedTextView { return ankoView(`$$Anko$Factories$Sdk28View`.CHECKED_TEXT_VIEW, theme = 0) { init() } } -fun ViewManager.themedCheckedTextView(theme: Int = 0): android.widget.CheckedTextView = +fun ViewManager.themedCheckedTextView(theme: Int = 0): AppCompatCheckedTextView = themedCheckedTextView(theme) {} inline fun ViewManager.themedCheckedTextView( theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.CheckedTextView).() -> Unit, -): android.widget.CheckedTextView { + init: (@AnkoViewDslMarker AppCompatCheckedTextView).() -> Unit, +): AppCompatCheckedTextView { return ankoView(`$$Anko$Factories$Sdk28View`.CHECKED_TEXT_VIEW, theme) { init() } } -fun ViewManager.chronometer(): android.widget.Chronometer = chronometer() {} -inline fun ViewManager.chronometer(init: (@AnkoViewDslMarker android.widget.Chronometer).() -> Unit): android.widget.Chronometer { +fun ViewManager.chronometer(): Chronometer = chronometer {} +inline fun ViewManager.chronometer(init: (@AnkoViewDslMarker Chronometer).() -> Unit): Chronometer { return ankoView(`$$Anko$Factories$Sdk28View`.CHRONOMETER, theme = 0) { init() } } -fun ViewManager.themedChronometer(theme: Int = 0): android.widget.Chronometer = +fun ViewManager.themedChronometer(theme: Int = 0): Chronometer = themedChronometer(theme) {} inline fun ViewManager.themedChronometer( theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.Chronometer).() -> Unit, -): android.widget.Chronometer { + init: (@AnkoViewDslMarker Chronometer).() -> Unit, +): Chronometer { return ankoView(`$$Anko$Factories$Sdk28View`.CHRONOMETER, theme) { init() } } -fun ViewManager.datePicker(): android.widget.DatePicker = datePicker() {} -inline fun ViewManager.datePicker(init: (@AnkoViewDslMarker android.widget.DatePicker).() -> Unit): android.widget.DatePicker { +fun ViewManager.datePicker(): DatePicker = datePicker {} +inline fun ViewManager.datePicker(init: (@AnkoViewDslMarker DatePicker).() -> Unit): DatePicker { return ankoView(`$$Anko$Factories$Sdk28View`.DATE_PICKER, theme = 0) { init() } } -fun ViewManager.themedDatePicker(theme: Int = 0): android.widget.DatePicker = +fun ViewManager.themedDatePicker(theme: Int = 0): DatePicker = themedDatePicker(theme) {} inline fun ViewManager.themedDatePicker( theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.DatePicker).() -> Unit, -): android.widget.DatePicker { + init: (@AnkoViewDslMarker DatePicker).() -> Unit, +): DatePicker { return ankoView(`$$Anko$Factories$Sdk28View`.DATE_PICKER, theme) { init() } } -fun Context.datePicker(): android.widget.DatePicker = datePicker() {} -inline fun Context.datePicker(init: (@AnkoViewDslMarker android.widget.DatePicker).() -> Unit): android.widget.DatePicker { +fun Context.datePicker(): DatePicker = datePicker {} +inline fun Context.datePicker(init: (@AnkoViewDslMarker DatePicker).() -> Unit): DatePicker { return ankoView(`$$Anko$Factories$Sdk28View`.DATE_PICKER, theme = 0) { init() } } -fun Context.themedDatePicker(theme: Int = 0): android.widget.DatePicker = +fun Context.themedDatePicker(theme: Int = 0): DatePicker = themedDatePicker(theme) {} inline fun Context.themedDatePicker( theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.DatePicker).() -> Unit, -): android.widget.DatePicker { + init: (@AnkoViewDslMarker DatePicker).() -> Unit, +): DatePicker { return ankoView(`$$Anko$Factories$Sdk28View`.DATE_PICKER, theme) { init() } } -fun Activity.datePicker(): android.widget.DatePicker = datePicker() {} -inline fun Activity.datePicker(init: (@AnkoViewDslMarker android.widget.DatePicker).() -> Unit): android.widget.DatePicker { +fun Activity.datePicker(): DatePicker = datePicker {} +inline fun Activity.datePicker(init: (@AnkoViewDslMarker DatePicker).() -> Unit): DatePicker { return ankoView(`$$Anko$Factories$Sdk28View`.DATE_PICKER, theme = 0) { init() } } -fun Activity.themedDatePicker(theme: Int = 0): android.widget.DatePicker = +fun Activity.themedDatePicker(theme: Int = 0): DatePicker = themedDatePicker(theme) {} inline fun Activity.themedDatePicker( theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.DatePicker).() -> Unit, -): android.widget.DatePicker { + init: (@AnkoViewDslMarker DatePicker).() -> Unit, +): DatePicker { return ankoView(`$$Anko$Factories$Sdk28View`.DATE_PICKER, theme) { init() } } @@ -814,22 +821,22 @@ inline fun Activity.themedDatePicker( // return ankoView(`$$Anko$Factories$Sdk28View`.DIGITAL_CLOCK, theme) { init() } //} -fun ViewManager.editText(): android.widget.EditText = editText() {} -inline fun ViewManager.editText(init: (@AnkoViewDslMarker android.widget.EditText).() -> Unit): android.widget.EditText { +fun ViewManager.editText(): AppCompatEditText = editText {} +inline fun ViewManager.editText(init: (@AnkoViewDslMarker AppCompatEditText).() -> Unit): AppCompatEditText { return ankoView(`$$Anko$Factories$Sdk28View`.EDIT_TEXT, theme = 0) { init() } } -fun ViewManager.themedEditText(theme: Int = 0): android.widget.EditText = +fun ViewManager.themedEditText(theme: Int = 0): AppCompatEditText = themedEditText(theme) {} inline fun ViewManager.themedEditText( theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.EditText).() -> Unit, -): android.widget.EditText { + init: (@AnkoViewDslMarker AppCompatEditText).() -> Unit, +): AppCompatEditText { return ankoView(`$$Anko$Factories$Sdk28View`.EDIT_TEXT, theme) { init() } } -fun ViewManager.editText(text: CharSequence?): android.widget.EditText { +fun ViewManager.editText(text: CharSequence?): AppCompatEditText { return ankoView(`$$Anko$Factories$Sdk28View`.EDIT_TEXT, theme = 0) { setText(text) } @@ -837,15 +844,15 @@ fun ViewManager.editText(text: CharSequence?): android.widget.EditText { inline fun ViewManager.editText( text: CharSequence?, - init: (@AnkoViewDslMarker android.widget.EditText).() -> Unit, -): android.widget.EditText { + init: (@AnkoViewDslMarker AppCompatEditText).() -> Unit, +): AppCompatEditText { return ankoView(`$$Anko$Factories$Sdk28View`.EDIT_TEXT, theme = 0) { init() setText(text) } } -fun ViewManager.themedEditText(text: CharSequence?, theme: Int): android.widget.EditText { +fun ViewManager.themedEditText(text: CharSequence?, theme: Int): AppCompatEditText { return ankoView(`$$Anko$Factories$Sdk28View`.EDIT_TEXT, theme) { setText(text) } @@ -854,15 +861,15 @@ fun ViewManager.themedEditText(text: CharSequence?, theme: Int): android.widget. inline fun ViewManager.themedEditText( text: CharSequence?, theme: Int, - init: (@AnkoViewDslMarker android.widget.EditText).() -> Unit, -): android.widget.EditText { + init: (@AnkoViewDslMarker AppCompatEditText).() -> Unit, +): AppCompatEditText { return ankoView(`$$Anko$Factories$Sdk28View`.EDIT_TEXT, theme) { init() setText(text) } } -fun ViewManager.editText(text: Int): android.widget.EditText { +fun ViewManager.editText(text: Int): AppCompatEditText { return ankoView(`$$Anko$Factories$Sdk28View`.EDIT_TEXT, theme = 0) { setText(text) } @@ -870,15 +877,15 @@ fun ViewManager.editText(text: Int): android.widget.EditText { inline fun ViewManager.editText( text: Int, - init: (@AnkoViewDslMarker android.widget.EditText).() -> Unit, -): android.widget.EditText { + init: (@AnkoViewDslMarker AppCompatEditText).() -> Unit, +): AppCompatEditText { return ankoView(`$$Anko$Factories$Sdk28View`.EDIT_TEXT, theme = 0) { init() setText(text) } } -fun ViewManager.themedEditText(text: Int, theme: Int): android.widget.EditText { +fun ViewManager.themedEditText(text: Int, theme: Int): AppCompatEditText { return ankoView(`$$Anko$Factories$Sdk28View`.EDIT_TEXT, theme) { setText(text) } @@ -887,1908 +894,10 @@ fun ViewManager.themedEditText(text: Int, theme: Int): android.widget.EditText { inline fun ViewManager.themedEditText( text: Int, theme: Int, - init: (@AnkoViewDslMarker android.widget.EditText).() -> Unit, -): android.widget.EditText { + init: (@AnkoViewDslMarker AppCompatEditText).() -> Unit, +): AppCompatEditText { return ankoView(`$$Anko$Factories$Sdk28View`.EDIT_TEXT, theme) { init() setText(text) } } - -fun ViewManager.expandableListView(): android.widget.ExpandableListView = - expandableListView() {} - -inline fun ViewManager.expandableListView(init: (@AnkoViewDslMarker android.widget.ExpandableListView).() -> Unit): android.widget.ExpandableListView { - return ankoView(`$$Anko$Factories$Sdk28View`.EXPANDABLE_LIST_VIEW, theme = 0) { init() } -} - -fun ViewManager.themedExpandableListView(theme: Int = 0): android.widget.ExpandableListView = - themedExpandableListView(theme) {} - -inline fun ViewManager.themedExpandableListView( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.ExpandableListView).() -> Unit, -): android.widget.ExpandableListView { - return ankoView(`$$Anko$Factories$Sdk28View`.EXPANDABLE_LIST_VIEW, theme) { init() } -} - -fun Context.expandableListView(): android.widget.ExpandableListView = expandableListView() {} -inline fun Context.expandableListView(init: (@AnkoViewDslMarker android.widget.ExpandableListView).() -> Unit): android.widget.ExpandableListView { - return ankoView(`$$Anko$Factories$Sdk28View`.EXPANDABLE_LIST_VIEW, theme = 0) { init() } -} - -fun Context.themedExpandableListView(theme: Int = 0): android.widget.ExpandableListView = - themedExpandableListView(theme) {} - -inline fun Context.themedExpandableListView( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.ExpandableListView).() -> Unit, -): android.widget.ExpandableListView { - return ankoView(`$$Anko$Factories$Sdk28View`.EXPANDABLE_LIST_VIEW, theme) { init() } -} - -fun Activity.expandableListView(): android.widget.ExpandableListView = - expandableListView() {} - -inline fun Activity.expandableListView(init: (@AnkoViewDslMarker android.widget.ExpandableListView).() -> Unit): android.widget.ExpandableListView { - return ankoView(`$$Anko$Factories$Sdk28View`.EXPANDABLE_LIST_VIEW, theme = 0) { init() } -} - -fun Activity.themedExpandableListView(theme: Int = 0): android.widget.ExpandableListView = - themedExpandableListView(theme) {} - -inline fun Activity.themedExpandableListView( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.ExpandableListView).() -> Unit, -): android.widget.ExpandableListView { - return ankoView(`$$Anko$Factories$Sdk28View`.EXPANDABLE_LIST_VIEW, theme) { init() } -} - -fun ViewManager.imageButton(): android.widget.ImageButton = imageButton() {} -inline fun ViewManager.imageButton(init: (@AnkoViewDslMarker android.widget.ImageButton).() -> Unit): android.widget.ImageButton { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme = 0) { init() } -} - -fun ViewManager.themedImageButton(theme: Int = 0): android.widget.ImageButton = - themedImageButton(theme) {} - -inline fun ViewManager.themedImageButton( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.ImageButton).() -> Unit, -): android.widget.ImageButton { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme) { init() } -} - -fun ViewManager.imageButton(imageDrawable: android.graphics.drawable.Drawable?): android.widget.ImageButton { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme = 0) { - setImageDrawable(imageDrawable) - } -} - -inline fun ViewManager.imageButton( - imageDrawable: android.graphics.drawable.Drawable?, - init: (@AnkoViewDslMarker android.widget.ImageButton).() -> Unit, -): android.widget.ImageButton { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme = 0) { - init() - setImageDrawable(imageDrawable) - } -} - -fun ViewManager.themedImageButton( - imageDrawable: android.graphics.drawable.Drawable?, - theme: Int, -): android.widget.ImageButton { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme) { - setImageDrawable(imageDrawable) - } -} - -inline fun ViewManager.themedImageButton( - imageDrawable: android.graphics.drawable.Drawable?, - theme: Int, - init: (@AnkoViewDslMarker android.widget.ImageButton).() -> Unit, -): android.widget.ImageButton { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme) { - init() - setImageDrawable(imageDrawable) - } -} - -fun ViewManager.imageButton(imageResource: Int): android.widget.ImageButton { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme = 0) { - setImageResource(imageResource) - } -} - -inline fun ViewManager.imageButton( - imageResource: Int, - init: (@AnkoViewDslMarker android.widget.ImageButton).() -> Unit, -): android.widget.ImageButton { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme = 0) { - init() - setImageResource(imageResource) - } -} - -fun ViewManager.themedImageButton( - imageResource: Int, - theme: Int, -): android.widget.ImageButton { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme) { - setImageResource(imageResource) - } -} - -inline fun ViewManager.themedImageButton( - imageResource: Int, - theme: Int, - init: (@AnkoViewDslMarker android.widget.ImageButton).() -> Unit, -): android.widget.ImageButton { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme) { - init() - setImageResource(imageResource) - } -} - -fun ViewManager.imageView(): android.widget.ImageView = imageView() {} -inline fun ViewManager.imageView(init: (@AnkoViewDslMarker android.widget.ImageView).() -> Unit): android.widget.ImageView { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme = 0) { init() } -} - -fun ViewManager.themedImageView(theme: Int = 0): android.widget.ImageView = - themedImageView(theme) {} - -inline fun ViewManager.themedImageView( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.ImageView).() -> Unit, -): android.widget.ImageView { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme) { init() } -} - -fun ViewManager.imageView(imageDrawable: android.graphics.drawable.Drawable?): android.widget.ImageView { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme = 0) { - setImageDrawable(imageDrawable) - } -} - -inline fun ViewManager.imageView( - imageDrawable: android.graphics.drawable.Drawable?, - init: (@AnkoViewDslMarker android.widget.ImageView).() -> Unit, -): android.widget.ImageView { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme = 0) { - init() - setImageDrawable(imageDrawable) - } -} - -fun ViewManager.themedImageView( - imageDrawable: android.graphics.drawable.Drawable?, - theme: Int, -): android.widget.ImageView { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme) { - setImageDrawable(imageDrawable) - } -} - -inline fun ViewManager.themedImageView( - imageDrawable: android.graphics.drawable.Drawable?, - theme: Int, - init: (@AnkoViewDslMarker android.widget.ImageView).() -> Unit, -): android.widget.ImageView { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme) { - init() - setImageDrawable(imageDrawable) - } -} - -fun ViewManager.imageView(imageResource: Int): android.widget.ImageView { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme = 0) { - setImageResource(imageResource) - } -} - -inline fun ViewManager.imageView( - imageResource: Int, - init: (@AnkoViewDslMarker android.widget.ImageView).() -> Unit, -): android.widget.ImageView { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme = 0) { - init() - setImageResource(imageResource) - } -} - -fun ViewManager.themedImageView(imageResource: Int, theme: Int): android.widget.ImageView { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme) { - setImageResource(imageResource) - } -} - -inline fun ViewManager.themedImageView( - imageResource: Int, - theme: Int, - init: (@AnkoViewDslMarker android.widget.ImageView).() -> Unit, -): android.widget.ImageView { - return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme) { - init() - setImageResource(imageResource) - } -} - -fun ViewManager.listView(): android.widget.ListView = listView() {} -inline fun ViewManager.listView(init: (@AnkoViewDslMarker android.widget.ListView).() -> Unit): android.widget.ListView { - return ankoView(`$$Anko$Factories$Sdk28View`.LIST_VIEW, theme = 0) { init() } -} - -fun ViewManager.themedListView(theme: Int = 0): android.widget.ListView = - themedListView(theme) {} - -inline fun ViewManager.themedListView( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.ListView).() -> Unit, -): android.widget.ListView { - return ankoView(`$$Anko$Factories$Sdk28View`.LIST_VIEW, theme) { init() } -} - -fun Context.listView(): android.widget.ListView = listView() {} -inline fun Context.listView(init: (@AnkoViewDslMarker android.widget.ListView).() -> Unit): android.widget.ListView { - return ankoView(`$$Anko$Factories$Sdk28View`.LIST_VIEW, theme = 0) { init() } -} - -fun Context.themedListView(theme: Int = 0): android.widget.ListView = - themedListView(theme) {} - -inline fun Context.themedListView( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.ListView).() -> Unit, -): android.widget.ListView { - return ankoView(`$$Anko$Factories$Sdk28View`.LIST_VIEW, theme) { init() } -} - -fun Activity.listView(): android.widget.ListView = listView() {} -inline fun Activity.listView(init: (@AnkoViewDslMarker android.widget.ListView).() -> Unit): android.widget.ListView { - return ankoView(`$$Anko$Factories$Sdk28View`.LIST_VIEW, theme = 0) { init() } -} - -fun Activity.themedListView(theme: Int = 0): android.widget.ListView = - themedListView(theme) {} - -inline fun Activity.themedListView( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.ListView).() -> Unit, -): android.widget.ListView { - return ankoView(`$$Anko$Factories$Sdk28View`.LIST_VIEW, theme) { init() } -} - -fun ViewManager.multiAutoCompleteTextView(): android.widget.MultiAutoCompleteTextView = - multiAutoCompleteTextView() {} - -inline fun ViewManager.multiAutoCompleteTextView(init: (@AnkoViewDslMarker android.widget.MultiAutoCompleteTextView).() -> Unit): android.widget.MultiAutoCompleteTextView { - return ankoView( - `$$Anko$Factories$Sdk28View`.MULTI_AUTO_COMPLETE_TEXT_VIEW, - theme = 0 - ) { init() } -} - -fun ViewManager.themedMultiAutoCompleteTextView(theme: Int = 0): android.widget.MultiAutoCompleteTextView = - themedMultiAutoCompleteTextView(theme) {} - -inline fun ViewManager.themedMultiAutoCompleteTextView( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.MultiAutoCompleteTextView).() -> Unit, -): android.widget.MultiAutoCompleteTextView { - return ankoView(`$$Anko$Factories$Sdk28View`.MULTI_AUTO_COMPLETE_TEXT_VIEW, theme) { init() } -} - -fun ViewManager.numberPicker(): android.widget.NumberPicker = numberPicker() {} -inline fun ViewManager.numberPicker(init: (@AnkoViewDslMarker android.widget.NumberPicker).() -> Unit): android.widget.NumberPicker { - return ankoView(`$$Anko$Factories$Sdk28View`.NUMBER_PICKER, theme = 0) { init() } -} - -fun ViewManager.themedNumberPicker(theme: Int = 0): android.widget.NumberPicker = - themedNumberPicker(theme) {} - -inline fun ViewManager.themedNumberPicker( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.NumberPicker).() -> Unit, -): android.widget.NumberPicker { - return ankoView(`$$Anko$Factories$Sdk28View`.NUMBER_PICKER, theme) { init() } -} - -fun Context.numberPicker(): android.widget.NumberPicker = numberPicker() {} -inline fun Context.numberPicker(init: (@AnkoViewDslMarker android.widget.NumberPicker).() -> Unit): android.widget.NumberPicker { - return ankoView(`$$Anko$Factories$Sdk28View`.NUMBER_PICKER, theme = 0) { init() } -} - -fun Context.themedNumberPicker(theme: Int = 0): android.widget.NumberPicker = - themedNumberPicker(theme) {} - -inline fun Context.themedNumberPicker( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.NumberPicker).() -> Unit, -): android.widget.NumberPicker { - return ankoView(`$$Anko$Factories$Sdk28View`.NUMBER_PICKER, theme) { init() } -} - -fun Activity.numberPicker(): android.widget.NumberPicker = numberPicker() {} -inline fun Activity.numberPicker(init: (@AnkoViewDslMarker android.widget.NumberPicker).() -> Unit): android.widget.NumberPicker { - return ankoView(`$$Anko$Factories$Sdk28View`.NUMBER_PICKER, theme = 0) { init() } -} - -fun Activity.themedNumberPicker(theme: Int = 0): android.widget.NumberPicker = - themedNumberPicker(theme) {} - -inline fun Activity.themedNumberPicker( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.NumberPicker).() -> Unit, -): android.widget.NumberPicker { - return ankoView(`$$Anko$Factories$Sdk28View`.NUMBER_PICKER, theme) { init() } -} - -fun ViewManager.progressBar(): android.widget.ProgressBar = progressBar() {} -inline fun ViewManager.progressBar(init: (@AnkoViewDslMarker android.widget.ProgressBar).() -> Unit): android.widget.ProgressBar { - return ankoView(`$$Anko$Factories$Sdk28View`.PROGRESS_BAR, theme = 0) { init() } -} - -fun ViewManager.themedProgressBar(theme: Int = 0): android.widget.ProgressBar = - themedProgressBar(theme) {} - -inline fun ViewManager.themedProgressBar( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.ProgressBar).() -> Unit, -): android.widget.ProgressBar { - return ankoView(`$$Anko$Factories$Sdk28View`.PROGRESS_BAR, theme) { init() } -} - -fun ViewManager.quickContactBadge(): android.widget.QuickContactBadge = - quickContactBadge() {} - -inline fun ViewManager.quickContactBadge(init: (@AnkoViewDslMarker android.widget.QuickContactBadge).() -> Unit): android.widget.QuickContactBadge { - return ankoView(`$$Anko$Factories$Sdk28View`.QUICK_CONTACT_BADGE, theme = 0) { init() } -} - -fun ViewManager.themedQuickContactBadge(theme: Int = 0): android.widget.QuickContactBadge = - themedQuickContactBadge(theme) {} - -inline fun ViewManager.themedQuickContactBadge( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.QuickContactBadge).() -> Unit, -): android.widget.QuickContactBadge { - return ankoView(`$$Anko$Factories$Sdk28View`.QUICK_CONTACT_BADGE, theme) { init() } -} - -fun ViewManager.radioButton(): android.widget.RadioButton = radioButton() {} -inline fun ViewManager.radioButton(init: (@AnkoViewDslMarker android.widget.RadioButton).() -> Unit): android.widget.RadioButton { - return ankoView(`$$Anko$Factories$Sdk28View`.RADIO_BUTTON, theme = 0) { init() } -} - -fun ViewManager.themedRadioButton(theme: Int = 0): android.widget.RadioButton = - themedRadioButton(theme) {} - -inline fun ViewManager.themedRadioButton( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.RadioButton).() -> Unit, -): android.widget.RadioButton { - return ankoView(`$$Anko$Factories$Sdk28View`.RADIO_BUTTON, theme) { init() } -} - -fun ViewManager.ratingBar(): android.widget.RatingBar = ratingBar() {} -inline fun ViewManager.ratingBar(init: (@AnkoViewDslMarker android.widget.RatingBar).() -> Unit): android.widget.RatingBar { - return ankoView(`$$Anko$Factories$Sdk28View`.RATING_BAR, theme = 0) { init() } -} - -fun ViewManager.themedRatingBar(theme: Int = 0): android.widget.RatingBar = - themedRatingBar(theme) {} - -inline fun ViewManager.themedRatingBar( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.RatingBar).() -> Unit, -): android.widget.RatingBar { - return ankoView(`$$Anko$Factories$Sdk28View`.RATING_BAR, theme) { init() } -} - -fun ViewManager.searchView(): android.widget.SearchView = searchView() {} -inline fun ViewManager.searchView(init: (@AnkoViewDslMarker android.widget.SearchView).() -> Unit): android.widget.SearchView { - return ankoView(`$$Anko$Factories$Sdk28View`.SEARCH_VIEW, theme = 0) { init() } -} - -fun ViewManager.themedSearchView(theme: Int = 0): android.widget.SearchView = - themedSearchView(theme) {} - -inline fun ViewManager.themedSearchView( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.SearchView).() -> Unit, -): android.widget.SearchView { - return ankoView(`$$Anko$Factories$Sdk28View`.SEARCH_VIEW, theme) { init() } -} - -fun Context.searchView(): android.widget.SearchView = searchView() {} -inline fun Context.searchView(init: (@AnkoViewDslMarker android.widget.SearchView).() -> Unit): android.widget.SearchView { - return ankoView(`$$Anko$Factories$Sdk28View`.SEARCH_VIEW, theme = 0) { init() } -} - -fun Context.themedSearchView(theme: Int = 0): android.widget.SearchView = - themedSearchView(theme) {} - -inline fun Context.themedSearchView( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.SearchView).() -> Unit, -): android.widget.SearchView { - return ankoView(`$$Anko$Factories$Sdk28View`.SEARCH_VIEW, theme) { init() } -} - -fun Activity.searchView(): android.widget.SearchView = searchView() {} -inline fun Activity.searchView(init: (@AnkoViewDslMarker android.widget.SearchView).() -> Unit): android.widget.SearchView { - return ankoView(`$$Anko$Factories$Sdk28View`.SEARCH_VIEW, theme = 0) { init() } -} - -fun Activity.themedSearchView(theme: Int = 0): android.widget.SearchView = - themedSearchView(theme) {} - -inline fun Activity.themedSearchView( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.SearchView).() -> Unit, -): android.widget.SearchView { - return ankoView(`$$Anko$Factories$Sdk28View`.SEARCH_VIEW, theme) { init() } -} - -fun ViewManager.seekBar(): android.widget.SeekBar = seekBar() {} -inline fun ViewManager.seekBar(init: (@AnkoViewDslMarker android.widget.SeekBar).() -> Unit): android.widget.SeekBar { - return ankoView(`$$Anko$Factories$Sdk28View`.SEEK_BAR, theme = 0) { init() } -} - -fun ViewManager.themedSeekBar(theme: Int = 0): android.widget.SeekBar = - themedSeekBar(theme) {} - -inline fun ViewManager.themedSeekBar( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.SeekBar).() -> Unit, -): android.widget.SeekBar { - return ankoView(`$$Anko$Factories$Sdk28View`.SEEK_BAR, theme) { init() } -} - -//inline fun ViewManager.slidingDrawer(): android.widget.SlidingDrawer = slidingDrawer() {} -//inline fun ViewManager.slidingDrawer(init: (@AnkoViewDslMarker android.widget.SlidingDrawer).() -> Unit): android.widget.SlidingDrawer { -// return ankoView(`$$Anko$Factories$Sdk28View`.SLIDING_DRAWER, theme = 0) { init() } -//} -// -//inline fun ViewManager.themedSlidingDrawer(theme: Int = 0): android.widget.SlidingDrawer = -// themedSlidingDrawer(theme) {} -// -//inline fun ViewManager.themedSlidingDrawer( -// theme: Int = 0, -// init: (@AnkoViewDslMarker android.widget.SlidingDrawer).() -> Unit, -//): android.widget.SlidingDrawer { -// return ankoView(`$$Anko$Factories$Sdk28View`.SLIDING_DRAWER, theme) { init() } -//} -// -//inline fun Context.slidingDrawer(): android.widget.SlidingDrawer = slidingDrawer() {} -//inline fun Context.slidingDrawer(init: (@AnkoViewDslMarker android.widget.SlidingDrawer).() -> Unit): android.widget.SlidingDrawer { -// return ankoView(`$$Anko$Factories$Sdk28View`.SLIDING_DRAWER, theme = 0) { init() } -//} -// -//inline fun Context.themedSlidingDrawer(theme: Int = 0): android.widget.SlidingDrawer = -// themedSlidingDrawer(theme) {} -// -//inline fun Context.themedSlidingDrawer( -// theme: Int = 0, -// init: (@AnkoViewDslMarker android.widget.SlidingDrawer).() -> Unit, -//): android.widget.SlidingDrawer { -// return ankoView(`$$Anko$Factories$Sdk28View`.SLIDING_DRAWER, theme) { init() } -//} -// -//inline fun Activity.slidingDrawer(): android.widget.SlidingDrawer = slidingDrawer() {} -//inline fun Activity.slidingDrawer(init: (@AnkoViewDslMarker android.widget.SlidingDrawer).() -> Unit): android.widget.SlidingDrawer { -// return ankoView(`$$Anko$Factories$Sdk28View`.SLIDING_DRAWER, theme = 0) { init() } -//} -// -//inline fun Activity.themedSlidingDrawer(theme: Int = 0): android.widget.SlidingDrawer = -// themedSlidingDrawer(theme) {} -// -//inline fun Activity.themedSlidingDrawer( -// theme: Int = 0, -// init: (@AnkoViewDslMarker android.widget.SlidingDrawer).() -> Unit, -//): android.widget.SlidingDrawer { -// return ankoView(`$$Anko$Factories$Sdk28View`.SLIDING_DRAWER, theme) { init() } -//} - -fun ViewManager.space(): android.widget.Space = space() {} -inline fun ViewManager.space(init: (@AnkoViewDslMarker android.widget.Space).() -> Unit): android.widget.Space { - return ankoView(`$$Anko$Factories$Sdk28View`.SPACE, theme = 0) { init() } -} - -fun ViewManager.themedSpace(theme: Int = 0): android.widget.Space = themedSpace(theme) {} -inline fun ViewManager.themedSpace( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.Space).() -> Unit, -): android.widget.Space { - return ankoView(`$$Anko$Factories$Sdk28View`.SPACE, theme) { init() } -} - -fun ViewManager.spinner(): android.widget.Spinner = spinner() {} -inline fun ViewManager.spinner(init: (@AnkoViewDslMarker android.widget.Spinner).() -> Unit): android.widget.Spinner { - return ankoView(`$$Anko$Factories$Sdk28View`.SPINNER, theme = 0) { init() } -} - -fun ViewManager.themedSpinner(theme: Int = 0): android.widget.Spinner = - themedSpinner(theme) {} - -inline fun ViewManager.themedSpinner( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.Spinner).() -> Unit, -): android.widget.Spinner { - return ankoView(`$$Anko$Factories$Sdk28View`.SPINNER, theme) { init() } -} - -fun Context.spinner(): android.widget.Spinner = spinner() {} -inline fun Context.spinner(init: (@AnkoViewDslMarker android.widget.Spinner).() -> Unit): android.widget.Spinner { - return ankoView(`$$Anko$Factories$Sdk28View`.SPINNER, theme = 0) { init() } -} - -fun Context.themedSpinner(theme: Int = 0): android.widget.Spinner = themedSpinner(theme) {} -inline fun Context.themedSpinner( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.Spinner).() -> Unit, -): android.widget.Spinner { - return ankoView(`$$Anko$Factories$Sdk28View`.SPINNER, theme) { init() } -} - -fun Activity.spinner(): android.widget.Spinner = spinner() {} -inline fun Activity.spinner(init: (@AnkoViewDslMarker android.widget.Spinner).() -> Unit): android.widget.Spinner { - return ankoView(`$$Anko$Factories$Sdk28View`.SPINNER, theme = 0) { init() } -} - -fun Activity.themedSpinner(theme: Int = 0): android.widget.Spinner = themedSpinner(theme) {} -inline fun Activity.themedSpinner( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.Spinner).() -> Unit, -): android.widget.Spinner { - return ankoView(`$$Anko$Factories$Sdk28View`.SPINNER, theme) { init() } -} - -fun ViewManager.stackView(): android.widget.StackView = stackView() {} -inline fun ViewManager.stackView(init: (@AnkoViewDslMarker android.widget.StackView).() -> Unit): android.widget.StackView { - return ankoView(`$$Anko$Factories$Sdk28View`.STACK_VIEW, theme = 0) { init() } -} - -fun ViewManager.themedStackView(theme: Int = 0): android.widget.StackView = - themedStackView(theme) {} - -inline fun ViewManager.themedStackView( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.StackView).() -> Unit, -): android.widget.StackView { - return ankoView(`$$Anko$Factories$Sdk28View`.STACK_VIEW, theme) { init() } -} - -fun Context.stackView(): android.widget.StackView = stackView() {} -inline fun Context.stackView(init: (@AnkoViewDslMarker android.widget.StackView).() -> Unit): android.widget.StackView { - return ankoView(`$$Anko$Factories$Sdk28View`.STACK_VIEW, theme = 0) { init() } -} - -fun Context.themedStackView(theme: Int = 0): android.widget.StackView = - themedStackView(theme) {} - -inline fun Context.themedStackView( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.StackView).() -> Unit, -): android.widget.StackView { - return ankoView(`$$Anko$Factories$Sdk28View`.STACK_VIEW, theme) { init() } -} - -fun Activity.stackView(): android.widget.StackView = stackView() {} -inline fun Activity.stackView(init: (@AnkoViewDslMarker android.widget.StackView).() -> Unit): android.widget.StackView { - return ankoView(`$$Anko$Factories$Sdk28View`.STACK_VIEW, theme = 0) { init() } -} - -fun Activity.themedStackView(theme: Int = 0): android.widget.StackView = - themedStackView(theme) {} - -inline fun Activity.themedStackView( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.StackView).() -> Unit, -): android.widget.StackView { - return ankoView(`$$Anko$Factories$Sdk28View`.STACK_VIEW, theme) { init() } -} - -fun ViewManager.switch(): android.widget.Switch = switch() {} -inline fun ViewManager.switch(init: (@AnkoViewDslMarker android.widget.Switch).() -> Unit): android.widget.Switch { - return ankoView(`$$Anko$Factories$Sdk28View`.SWITCH, theme = 0) { init() } -} - -fun ViewManager.themedSwitch(theme: Int = 0): android.widget.Switch = themedSwitch(theme) {} -inline fun ViewManager.themedSwitch( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.Switch).() -> Unit, -): android.widget.Switch { - return ankoView(`$$Anko$Factories$Sdk28View`.SWITCH, theme) { init() } -} - -//inline fun ViewManager.tabHost(): android.widget.TabHost = tabHost() {} -//inline fun ViewManager.tabHost(init: (@AnkoViewDslMarker android.widget.TabHost).() -> Unit): android.widget.TabHost { -// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_HOST, theme = 0) { init() } -//} -// -//inline fun ViewManager.themedTabHost(theme: Int = 0): android.widget.TabHost = -// themedTabHost(theme) {} -// -//inline fun ViewManager.themedTabHost( -// theme: Int = 0, -// init: (@AnkoViewDslMarker android.widget.TabHost).() -> Unit, -//): android.widget.TabHost { -// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_HOST, theme) { init() } -//} -// -//inline fun Context.tabHost(): android.widget.TabHost = tabHost() {} -//inline fun Context.tabHost(init: (@AnkoViewDslMarker android.widget.TabHost).() -> Unit): android.widget.TabHost { -// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_HOST, theme = 0) { init() } -//} -// -//inline fun Context.themedTabHost(theme: Int = 0): android.widget.TabHost = themedTabHost(theme) {} -//inline fun Context.themedTabHost( -// theme: Int = 0, -// init: (@AnkoViewDslMarker android.widget.TabHost).() -> Unit, -//): android.widget.TabHost { -// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_HOST, theme) { init() } -//} -// -//inline fun Activity.tabHost(): android.widget.TabHost = tabHost() {} -//inline fun Activity.tabHost(init: (@AnkoViewDslMarker android.widget.TabHost).() -> Unit): android.widget.TabHost { -// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_HOST, theme = 0) { init() } -//} -// -//inline fun Activity.themedTabHost(theme: Int = 0): android.widget.TabHost = themedTabHost(theme) {} -//inline fun Activity.themedTabHost( -// theme: Int = 0, -// init: (@AnkoViewDslMarker android.widget.TabHost).() -> Unit, -//): android.widget.TabHost { -// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_HOST, theme) { init() } -//} -// -//inline fun ViewManager.tabWidget(): android.widget.TabWidget = tabWidget() {} -//inline fun ViewManager.tabWidget(init: (@AnkoViewDslMarker android.widget.TabWidget).() -> Unit): android.widget.TabWidget { -// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_WIDGET, theme = 0) { init() } -//} -// -//inline fun ViewManager.themedTabWidget(theme: Int = 0): android.widget.TabWidget = -// themedTabWidget(theme) {} -// -//inline fun ViewManager.themedTabWidget( -// theme: Int = 0, -// init: (@AnkoViewDslMarker android.widget.TabWidget).() -> Unit, -//): android.widget.TabWidget { -// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_WIDGET, theme) { init() } -//} -// -//inline fun Context.tabWidget(): android.widget.TabWidget = tabWidget() {} -//inline fun Context.tabWidget(init: (@AnkoViewDslMarker android.widget.TabWidget).() -> Unit): android.widget.TabWidget { -// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_WIDGET, theme = 0) { init() } -//} -// -//inline fun Context.themedTabWidget(theme: Int = 0): android.widget.TabWidget = -// themedTabWidget(theme) {} -// -//inline fun Context.themedTabWidget( -// theme: Int = 0, -// init: (@AnkoViewDslMarker android.widget.TabWidget).() -> Unit, -//): android.widget.TabWidget { -// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_WIDGET, theme) { init() } -//} -// -//inline fun Activity.tabWidget(): android.widget.TabWidget = tabWidget() {} -//inline fun Activity.tabWidget(init: (@AnkoViewDslMarker android.widget.TabWidget).() -> Unit): android.widget.TabWidget { -// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_WIDGET, theme = 0) { init() } -//} -// -//inline fun Activity.themedTabWidget(theme: Int = 0): android.widget.TabWidget = -// themedTabWidget(theme) {} -// -//inline fun Activity.themedTabWidget( -// theme: Int = 0, -// init: (@AnkoViewDslMarker android.widget.TabWidget).() -> Unit, -//): android.widget.TabWidget { -// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_WIDGET, theme) { init() } -//} - -fun ViewManager.textClock(): android.widget.TextClock = textClock() {} -inline fun ViewManager.textClock(init: (@AnkoViewDslMarker android.widget.TextClock).() -> Unit): android.widget.TextClock { - return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_CLOCK, theme = 0) { init() } -} - -fun ViewManager.themedTextClock(theme: Int = 0): android.widget.TextClock = - themedTextClock(theme) {} - -inline fun ViewManager.themedTextClock( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.TextClock).() -> Unit, -): android.widget.TextClock { - return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_CLOCK, theme) { init() } -} - -fun ViewManager.textView(): android.widget.TextView = textView() {} -inline fun ViewManager.textView(init: (@AnkoViewDslMarker android.widget.TextView).() -> Unit): android.widget.TextView { - return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme = 0) { init() } -} - -fun ViewManager.themedTextView(theme: Int = 0): android.widget.TextView = - themedTextView(theme) {} - -inline fun ViewManager.themedTextView( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.TextView).() -> Unit, -): android.widget.TextView { - return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme) { init() } -} - -fun ViewManager.textView(text: CharSequence?): android.widget.TextView { - return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme = 0) { - setText(text) - } -} - -inline fun ViewManager.textView( - text: CharSequence?, - init: (@AnkoViewDslMarker android.widget.TextView).() -> Unit, -): android.widget.TextView { - return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme = 0) { - init() - setText(text) - } -} - -fun ViewManager.themedTextView(text: CharSequence?, theme: Int): android.widget.TextView { - return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme) { - setText(text) - } -} - -inline fun ViewManager.themedTextView( - text: CharSequence?, - theme: Int, - init: (@AnkoViewDslMarker android.widget.TextView).() -> Unit, -): android.widget.TextView { - return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme) { - init() - setText(text) - } -} - -fun ViewManager.textView(text: Int): android.widget.TextView { - return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme = 0) { - setText(text) - } -} - -inline fun ViewManager.textView( - text: Int, - init: (@AnkoViewDslMarker android.widget.TextView).() -> Unit, -): android.widget.TextView { - return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme = 0) { - init() - setText(text) - } -} - -fun ViewManager.themedTextView(text: Int, theme: Int): android.widget.TextView { - return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme) { - setText(text) - } -} - -inline fun ViewManager.themedTextView( - text: Int, - theme: Int, - init: (@AnkoViewDslMarker android.widget.TextView).() -> Unit, -): android.widget.TextView { - return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme) { - init() - setText(text) - } -} - -fun ViewManager.timePicker(): android.widget.TimePicker = timePicker() {} -inline fun ViewManager.timePicker(init: (@AnkoViewDslMarker android.widget.TimePicker).() -> Unit): android.widget.TimePicker { - return ankoView(`$$Anko$Factories$Sdk28View`.TIME_PICKER, theme = 0) { init() } -} - -fun ViewManager.themedTimePicker(theme: Int = 0): android.widget.TimePicker = - themedTimePicker(theme) {} - -inline fun ViewManager.themedTimePicker( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.TimePicker).() -> Unit, -): android.widget.TimePicker { - return ankoView(`$$Anko$Factories$Sdk28View`.TIME_PICKER, theme) { init() } -} - -fun Context.timePicker(): android.widget.TimePicker = timePicker() {} -inline fun Context.timePicker(init: (@AnkoViewDslMarker android.widget.TimePicker).() -> Unit): android.widget.TimePicker { - return ankoView(`$$Anko$Factories$Sdk28View`.TIME_PICKER, theme = 0) { init() } -} - -fun Context.themedTimePicker(theme: Int = 0): android.widget.TimePicker = - themedTimePicker(theme) {} - -inline fun Context.themedTimePicker( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.TimePicker).() -> Unit, -): android.widget.TimePicker { - return ankoView(`$$Anko$Factories$Sdk28View`.TIME_PICKER, theme) { init() } -} - -fun Activity.timePicker(): android.widget.TimePicker = timePicker() {} -inline fun Activity.timePicker(init: (@AnkoViewDslMarker android.widget.TimePicker).() -> Unit): android.widget.TimePicker { - return ankoView(`$$Anko$Factories$Sdk28View`.TIME_PICKER, theme = 0) { init() } -} - -fun Activity.themedTimePicker(theme: Int = 0): android.widget.TimePicker = - themedTimePicker(theme) {} - -inline fun Activity.themedTimePicker( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.TimePicker).() -> Unit, -): android.widget.TimePicker { - return ankoView(`$$Anko$Factories$Sdk28View`.TIME_PICKER, theme) { init() } -} - -fun ViewManager.toggleButton(): android.widget.ToggleButton = toggleButton() {} -inline fun ViewManager.toggleButton(init: (@AnkoViewDslMarker android.widget.ToggleButton).() -> Unit): android.widget.ToggleButton { - return ankoView(`$$Anko$Factories$Sdk28View`.TOGGLE_BUTTON, theme = 0) { init() } -} - -fun ViewManager.themedToggleButton(theme: Int = 0): android.widget.ToggleButton = - themedToggleButton(theme) {} - -inline fun ViewManager.themedToggleButton( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.ToggleButton).() -> Unit, -): android.widget.ToggleButton { - return ankoView(`$$Anko$Factories$Sdk28View`.TOGGLE_BUTTON, theme) { init() } -} - -//inline fun ViewManager.twoLineListItem(): android.widget.TwoLineListItem = twoLineListItem() {} -//inline fun ViewManager.twoLineListItem(init: (@AnkoViewDslMarker android.widget.TwoLineListItem).() -> Unit): android.widget.TwoLineListItem { -// return ankoView(`$$Anko$Factories$Sdk28View`.TWO_LINE_LIST_ITEM, theme = 0) { init() } -//} -// -//inline fun ViewManager.themedTwoLineListItem(theme: Int = 0): android.widget.TwoLineListItem = -// themedTwoLineListItem(theme) {} -// -//inline fun ViewManager.themedTwoLineListItem( -// theme: Int = 0, -// init: (@AnkoViewDslMarker android.widget.TwoLineListItem).() -> Unit, -//): android.widget.TwoLineListItem { -// return ankoView(`$$Anko$Factories$Sdk28View`.TWO_LINE_LIST_ITEM, theme) { init() } -//} -// -//inline fun Context.twoLineListItem(): android.widget.TwoLineListItem = twoLineListItem() {} -//inline fun Context.twoLineListItem(init: (@AnkoViewDslMarker android.widget.TwoLineListItem).() -> Unit): android.widget.TwoLineListItem { -// return ankoView(`$$Anko$Factories$Sdk28View`.TWO_LINE_LIST_ITEM, theme = 0) { init() } -//} -// -//inline fun Context.themedTwoLineListItem(theme: Int = 0): android.widget.TwoLineListItem = -// themedTwoLineListItem(theme) {} -// -//inline fun Context.themedTwoLineListItem( -// theme: Int = 0, -// init: (@AnkoViewDslMarker android.widget.TwoLineListItem).() -> Unit, -//): android.widget.TwoLineListItem { -// return ankoView(`$$Anko$Factories$Sdk28View`.TWO_LINE_LIST_ITEM, theme) { init() } -//} -// -//inline fun Activity.twoLineListItem(): android.widget.TwoLineListItem = twoLineListItem() {} -//inline fun Activity.twoLineListItem(init: (@AnkoViewDslMarker android.widget.TwoLineListItem).() -> Unit): android.widget.TwoLineListItem { -// return ankoView(`$$Anko$Factories$Sdk28View`.TWO_LINE_LIST_ITEM, theme = 0) { init() } -//} -// -//inline fun Activity.themedTwoLineListItem(theme: Int = 0): android.widget.TwoLineListItem = -// themedTwoLineListItem(theme) {} -// -//inline fun Activity.themedTwoLineListItem( -// theme: Int = 0, -// init: (@AnkoViewDslMarker android.widget.TwoLineListItem).() -> Unit, -//): android.widget.TwoLineListItem { -// return ankoView(`$$Anko$Factories$Sdk28View`.TWO_LINE_LIST_ITEM, theme) { init() } -//} - -fun ViewManager.videoView(): android.widget.VideoView = videoView() {} -inline fun ViewManager.videoView(init: (@AnkoViewDslMarker android.widget.VideoView).() -> Unit): android.widget.VideoView { - return ankoView(`$$Anko$Factories$Sdk28View`.VIDEO_VIEW, theme = 0) { init() } -} - -fun ViewManager.themedVideoView(theme: Int = 0): android.widget.VideoView = - themedVideoView(theme) {} - -inline fun ViewManager.themedVideoView( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.VideoView).() -> Unit, -): android.widget.VideoView { - return ankoView(`$$Anko$Factories$Sdk28View`.VIDEO_VIEW, theme) { init() } -} - -fun ViewManager.viewFlipper(): android.widget.ViewFlipper = viewFlipper() {} -inline fun ViewManager.viewFlipper(init: (@AnkoViewDslMarker android.widget.ViewFlipper).() -> Unit): android.widget.ViewFlipper { - return ankoView(`$$Anko$Factories$Sdk28View`.VIEW_FLIPPER, theme = 0) { init() } -} - -fun ViewManager.themedViewFlipper(theme: Int = 0): android.widget.ViewFlipper = - themedViewFlipper(theme) {} - -inline fun ViewManager.themedViewFlipper( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.ViewFlipper).() -> Unit, -): android.widget.ViewFlipper { - return ankoView(`$$Anko$Factories$Sdk28View`.VIEW_FLIPPER, theme) { init() } -} - -fun Context.viewFlipper(): android.widget.ViewFlipper = viewFlipper() {} -inline fun Context.viewFlipper(init: (@AnkoViewDslMarker android.widget.ViewFlipper).() -> Unit): android.widget.ViewFlipper { - return ankoView(`$$Anko$Factories$Sdk28View`.VIEW_FLIPPER, theme = 0) { init() } -} - -fun Context.themedViewFlipper(theme: Int = 0): android.widget.ViewFlipper = - themedViewFlipper(theme) {} - -inline fun Context.themedViewFlipper( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.ViewFlipper).() -> Unit, -): android.widget.ViewFlipper { - return ankoView(`$$Anko$Factories$Sdk28View`.VIEW_FLIPPER, theme) { init() } -} - -fun Activity.viewFlipper(): android.widget.ViewFlipper = viewFlipper() {} -inline fun Activity.viewFlipper(init: (@AnkoViewDslMarker android.widget.ViewFlipper).() -> Unit): android.widget.ViewFlipper { - return ankoView(`$$Anko$Factories$Sdk28View`.VIEW_FLIPPER, theme = 0) { init() } -} - -fun Activity.themedViewFlipper(theme: Int = 0): android.widget.ViewFlipper = - themedViewFlipper(theme) {} - -inline fun Activity.themedViewFlipper( - theme: Int = 0, - init: (@AnkoViewDslMarker android.widget.ViewFlipper).() -> Unit, -): android.widget.ViewFlipper { - return ankoView(`$$Anko$Factories$Sdk28View`.VIEW_FLIPPER, theme) { init() } -} - -//inline fun ViewManager.zoomButton(): android.widget.ZoomButton = zoomButton() {} -//inline fun ViewManager.zoomButton(init: (@AnkoViewDslMarker android.widget.ZoomButton).() -> Unit): android.widget.ZoomButton { -// return ankoView(`$$Anko$Factories$Sdk28View`.ZOOM_BUTTON, theme = 0) { init() } -//} -// -//inline fun ViewManager.themedZoomButton(theme: Int = 0): android.widget.ZoomButton = -// themedZoomButton(theme) {} -// -//inline fun ViewManager.themedZoomButton( -// theme: Int = 0, -// init: (@AnkoViewDslMarker android.widget.ZoomButton).() -> Unit, -//): android.widget.ZoomButton { -// return ankoView(`$$Anko$Factories$Sdk28View`.ZOOM_BUTTON, theme) { init() } -//} -// -//inline fun ViewManager.zoomControls(): android.widget.ZoomControls = zoomControls() {} -//inline fun ViewManager.zoomControls(init: (@AnkoViewDslMarker android.widget.ZoomControls).() -> Unit): android.widget.ZoomControls { -// return ankoView(`$$Anko$Factories$Sdk28View`.ZOOM_CONTROLS, theme = 0) { init() } -//} -// -//inline fun ViewManager.themedZoomControls(theme: Int = 0): android.widget.ZoomControls = -// themedZoomControls(theme) {} -// -//inline fun ViewManager.themedZoomControls( -// theme: Int = 0, -// init: (@AnkoViewDslMarker android.widget.ZoomControls).() -> Unit, -//): android.widget.ZoomControls { -// return ankoView(`$$Anko$Factories$Sdk28View`.ZOOM_CONTROLS, theme) { init() } -//} -// -//inline fun Context.zoomControls(): android.widget.ZoomControls = zoomControls() {} -//inline fun Context.zoomControls(init: (@AnkoViewDslMarker android.widget.ZoomControls).() -> Unit): android.widget.ZoomControls { -// return ankoView(`$$Anko$Factories$Sdk28View`.ZOOM_CONTROLS, theme = 0) { init() } -//} -// -//inline fun Context.themedZoomControls(theme: Int = 0): android.widget.ZoomControls = -// themedZoomControls(theme) {} -// -//inline fun Context.themedZoomControls( -// theme: Int = 0, -// init: (@AnkoViewDslMarker android.widget.ZoomControls).() -> Unit, -//): android.widget.ZoomControls { -// return ankoView(`$$Anko$Factories$Sdk28View`.ZOOM_CONTROLS, theme) { init() } -//} -// -//inline fun Activity.zoomControls(): android.widget.ZoomControls = zoomControls() {} -//inline fun Activity.zoomControls(init: (@AnkoViewDslMarker android.widget.ZoomControls).() -> Unit): android.widget.ZoomControls { -// return ankoView(`$$Anko$Factories$Sdk28View`.ZOOM_CONTROLS, theme = 0) { init() } -//} -// -//inline fun Activity.themedZoomControls(theme: Int = 0): android.widget.ZoomControls = -// themedZoomControls(theme) {} -// -//inline fun Activity.themedZoomControls( -// theme: Int = 0, -// init: (@AnkoViewDslMarker android.widget.ZoomControls).() -> Unit, -//): android.widget.ZoomControls { -// return ankoView(`$$Anko$Factories$Sdk28View`.ZOOM_CONTROLS, theme) { init() } -//} - -@PublishedApi -internal object `$$Anko$Factories$Sdk28ViewGroup` { - val APP_WIDGET_HOST_VIEW = { ctx: Context -> _AppWidgetHostView(ctx) } - - //val ABSOLUTE_LAYOUT = { ctx: Context -> _AbsoluteLayout(ctx) } - val ACTION_MENU_VIEW = { ctx: Context -> _ActionMenuView(ctx) } - val FRAME_LAYOUT = { ctx: Context -> _FrameLayout(ctx) } - - //val GALLERY = { ctx: Context -> _Gallery(ctx) } - val GRID_LAYOUT = { ctx: Context -> _GridLayout(ctx) } - val GRID_VIEW = { ctx: Context -> _GridView(ctx) } - val HORIZONTAL_SCROLL_VIEW = { ctx: Context -> _HorizontalScrollView(ctx) } - val IMAGE_SWITCHER = { ctx: Context -> _ImageSwitcher(ctx) } - val LINEAR_LAYOUT = { ctx: Context -> _LinearLayout(ctx) } - val RADIO_GROUP = { ctx: Context -> _RadioGroup(ctx) } - val RELATIVE_LAYOUT = { ctx: Context -> _RelativeLayout(ctx) } - val SCROLL_VIEW = { ctx: Context -> _ScrollView(ctx) } - val TABLE_LAYOUT = { ctx: Context -> _TableLayout(ctx) } - val TABLE_ROW = { ctx: Context -> _TableRow(ctx) } - val TEXT_SWITCHER = { ctx: Context -> _TextSwitcher(ctx) } - val TOOLBAR = { ctx: Context -> _Toolbar(ctx) } - val VIEW_ANIMATOR = { ctx: Context -> _ViewAnimator(ctx) } - val VIEW_SWITCHER = { ctx: Context -> _ViewSwitcher(ctx) } -} - -fun ViewManager.appWidgetHostView(): android.appwidget.AppWidgetHostView = - appWidgetHostView() {} - -inline fun ViewManager.appWidgetHostView(init: (@AnkoViewDslMarker _AppWidgetHostView).() -> Unit): android.appwidget.AppWidgetHostView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.APP_WIDGET_HOST_VIEW, theme = 0) { init() } -} - -fun ViewManager.themedAppWidgetHostView(theme: Int = 0): android.appwidget.AppWidgetHostView = - themedAppWidgetHostView(theme) {} - -inline fun ViewManager.themedAppWidgetHostView( - theme: Int = 0, - init: (@AnkoViewDslMarker _AppWidgetHostView).() -> Unit, -): android.appwidget.AppWidgetHostView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.APP_WIDGET_HOST_VIEW, theme) { init() } -} - -fun Context.appWidgetHostView(): android.appwidget.AppWidgetHostView = appWidgetHostView() {} -inline fun Context.appWidgetHostView(init: (@AnkoViewDslMarker _AppWidgetHostView).() -> Unit): android.appwidget.AppWidgetHostView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.APP_WIDGET_HOST_VIEW, theme = 0) { init() } -} - -fun Context.themedAppWidgetHostView(theme: Int = 0): android.appwidget.AppWidgetHostView = - themedAppWidgetHostView(theme) {} - -inline fun Context.themedAppWidgetHostView( - theme: Int = 0, - init: (@AnkoViewDslMarker _AppWidgetHostView).() -> Unit, -): android.appwidget.AppWidgetHostView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.APP_WIDGET_HOST_VIEW, theme) { init() } -} - -fun Activity.appWidgetHostView(): android.appwidget.AppWidgetHostView = - appWidgetHostView() {} - -inline fun Activity.appWidgetHostView(init: (@AnkoViewDslMarker _AppWidgetHostView).() -> Unit): android.appwidget.AppWidgetHostView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.APP_WIDGET_HOST_VIEW, theme = 0) { init() } -} - -fun Activity.themedAppWidgetHostView(theme: Int = 0): android.appwidget.AppWidgetHostView = - themedAppWidgetHostView(theme) {} - -inline fun Activity.themedAppWidgetHostView( - theme: Int = 0, - init: (@AnkoViewDslMarker _AppWidgetHostView).() -> Unit, -): android.appwidget.AppWidgetHostView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.APP_WIDGET_HOST_VIEW, theme) { init() } -} - -//inline fun ViewManager.absoluteLayout(): android.widget.AbsoluteLayout = absoluteLayout() {} -//inline fun ViewManager.absoluteLayout(init: (@AnkoViewDslMarker _AbsoluteLayout).() -> Unit): android.widget.AbsoluteLayout { -// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ABSOLUTE_LAYOUT, theme = 0) { init() } -//} -// -//inline fun ViewManager.themedAbsoluteLayout(theme: Int = 0): android.widget.AbsoluteLayout = -// themedAbsoluteLayout(theme) {} -// -//inline fun ViewManager.themedAbsoluteLayout( -// theme: Int = 0, -// init: (@AnkoViewDslMarker _AbsoluteLayout).() -> Unit, -//): android.widget.AbsoluteLayout { -// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ABSOLUTE_LAYOUT, theme) { init() } -//} -// -//inline fun Context.absoluteLayout(): android.widget.AbsoluteLayout = absoluteLayout() {} -//inline fun Context.absoluteLayout(init: (@AnkoViewDslMarker _AbsoluteLayout).() -> Unit): android.widget.AbsoluteLayout { -// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ABSOLUTE_LAYOUT, theme = 0) { init() } -//} -// -//inline fun Context.themedAbsoluteLayout(theme: Int = 0): android.widget.AbsoluteLayout = -// themedAbsoluteLayout(theme) {} -// -//inline fun Context.themedAbsoluteLayout( -// theme: Int = 0, -// init: (@AnkoViewDslMarker _AbsoluteLayout).() -> Unit, -//): android.widget.AbsoluteLayout { -// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ABSOLUTE_LAYOUT, theme) { init() } -//} -// -//inline fun Activity.absoluteLayout(): android.widget.AbsoluteLayout = absoluteLayout() {} -//inline fun Activity.absoluteLayout(init: (@AnkoViewDslMarker _AbsoluteLayout).() -> Unit): android.widget.AbsoluteLayout { -// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ABSOLUTE_LAYOUT, theme = 0) { init() } -//} -// -//inline fun Activity.themedAbsoluteLayout(theme: Int = 0): android.widget.AbsoluteLayout = -// themedAbsoluteLayout(theme) {} -// -//inline fun Activity.themedAbsoluteLayout( -// theme: Int = 0, -// init: (@AnkoViewDslMarker _AbsoluteLayout).() -> Unit, -//): android.widget.AbsoluteLayout { -// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ABSOLUTE_LAYOUT, theme) { init() } -//} - -fun ViewManager.actionMenuView(): android.widget.ActionMenuView = actionMenuView() {} -inline fun ViewManager.actionMenuView(init: (@AnkoViewDslMarker _ActionMenuView).() -> Unit): android.widget.ActionMenuView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ACTION_MENU_VIEW, theme = 0) { init() } -} - -fun ViewManager.themedActionMenuView(theme: Int = 0): android.widget.ActionMenuView = - themedActionMenuView(theme) {} - -inline fun ViewManager.themedActionMenuView( - theme: Int = 0, - init: (@AnkoViewDslMarker _ActionMenuView).() -> Unit, -): android.widget.ActionMenuView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ACTION_MENU_VIEW, theme) { init() } -} - -fun Context.actionMenuView(): android.widget.ActionMenuView = actionMenuView() {} -inline fun Context.actionMenuView(init: (@AnkoViewDslMarker _ActionMenuView).() -> Unit): android.widget.ActionMenuView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ACTION_MENU_VIEW, theme = 0) { init() } -} - -fun Context.themedActionMenuView(theme: Int = 0): android.widget.ActionMenuView = - themedActionMenuView(theme) {} - -inline fun Context.themedActionMenuView( - theme: Int = 0, - init: (@AnkoViewDslMarker _ActionMenuView).() -> Unit, -): android.widget.ActionMenuView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ACTION_MENU_VIEW, theme) { init() } -} - -fun Activity.actionMenuView(): android.widget.ActionMenuView = actionMenuView() {} -inline fun Activity.actionMenuView(init: (@AnkoViewDslMarker _ActionMenuView).() -> Unit): android.widget.ActionMenuView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ACTION_MENU_VIEW, theme = 0) { init() } -} - -fun Activity.themedActionMenuView(theme: Int = 0): android.widget.ActionMenuView = - themedActionMenuView(theme) {} - -inline fun Activity.themedActionMenuView( - theme: Int = 0, - init: (@AnkoViewDslMarker _ActionMenuView).() -> Unit, -): android.widget.ActionMenuView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.ACTION_MENU_VIEW, theme) { init() } -} - -fun ViewManager.frameLayout(): android.widget.FrameLayout = frameLayout() {} -inline fun ViewManager.frameLayout(init: (@AnkoViewDslMarker _FrameLayout).() -> Unit): android.widget.FrameLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.FRAME_LAYOUT, theme = 0) { init() } -} - -fun ViewManager.themedFrameLayout(theme: Int = 0): android.widget.FrameLayout = - themedFrameLayout(theme) {} - -inline fun ViewManager.themedFrameLayout( - theme: Int = 0, - init: (@AnkoViewDslMarker _FrameLayout).() -> Unit, -): android.widget.FrameLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.FRAME_LAYOUT, theme) { init() } -} - -fun Context.frameLayout(): android.widget.FrameLayout = frameLayout() {} -inline fun Context.frameLayout(init: (@AnkoViewDslMarker _FrameLayout).() -> Unit): android.widget.FrameLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.FRAME_LAYOUT, theme = 0) { init() } -} - -fun Context.themedFrameLayout(theme: Int = 0): android.widget.FrameLayout = - themedFrameLayout(theme) {} - -inline fun Context.themedFrameLayout( - theme: Int = 0, - init: (@AnkoViewDslMarker _FrameLayout).() -> Unit, -): android.widget.FrameLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.FRAME_LAYOUT, theme) { init() } -} - -fun Activity.frameLayout(): android.widget.FrameLayout = frameLayout() {} -inline fun Activity.frameLayout(init: (@AnkoViewDslMarker _FrameLayout).() -> Unit): android.widget.FrameLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.FRAME_LAYOUT, theme = 0) { init() } -} - -fun Activity.themedFrameLayout(theme: Int = 0): android.widget.FrameLayout = - themedFrameLayout(theme) {} - -inline fun Activity.themedFrameLayout( - theme: Int = 0, - init: (@AnkoViewDslMarker _FrameLayout).() -> Unit, -): android.widget.FrameLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.FRAME_LAYOUT, theme) { init() } -} - -//inline fun ViewManager.gallery(): android.widget.Gallery = gallery() {} -//inline fun ViewManager.gallery(init: (@AnkoViewDslMarker _Gallery).() -> Unit): android.widget.Gallery { -// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GALLERY, theme = 0) { init() } -//} -// -//inline fun ViewManager.themedGallery(theme: Int = 0): android.widget.Gallery = -// themedGallery(theme) {} -// -//inline fun ViewManager.themedGallery( -// theme: Int = 0, -// init: (@AnkoViewDslMarker _Gallery).() -> Unit, -//): android.widget.Gallery { -// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GALLERY, theme) { init() } -//} - -//inline fun Context.gallery(): android.widget.Gallery = gallery() {} -//inline fun Context.gallery(init: (@AnkoViewDslMarker _Gallery).() -> Unit): android.widget.Gallery { -// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GALLERY, theme = 0) { init() } -//} -// -//inline fun Context.themedGallery(theme: Int = 0): android.widget.Gallery = themedGallery(theme) {} -//inline fun Context.themedGallery( -// theme: Int = 0, -// init: (@AnkoViewDslMarker _Gallery).() -> Unit, -//): android.widget.Gallery { -// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GALLERY, theme) { init() } -//} - -//inline fun Activity.gallery(): android.widget.Gallery = gallery() {} -//inline fun Activity.gallery(init: (@AnkoViewDslMarker _Gallery).() -> Unit): android.widget.Gallery { -// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GALLERY, theme = 0) { init() } -//} -// -//inline fun Activity.themedGallery(theme: Int = 0): android.widget.Gallery = themedGallery(theme) {} -//inline fun Activity.themedGallery( -// theme: Int = 0, -// init: (@AnkoViewDslMarker _Gallery).() -> Unit, -//): android.widget.Gallery { -// return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GALLERY, theme) { init() } -//} - -fun ViewManager.gridLayout(): android.widget.GridLayout = gridLayout() {} -inline fun ViewManager.gridLayout(init: (@AnkoViewDslMarker _GridLayout).() -> Unit): android.widget.GridLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_LAYOUT, theme = 0) { init() } -} - -fun ViewManager.themedGridLayout(theme: Int = 0): android.widget.GridLayout = - themedGridLayout(theme) {} - -inline fun ViewManager.themedGridLayout( - theme: Int = 0, - init: (@AnkoViewDslMarker _GridLayout).() -> Unit, -): android.widget.GridLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_LAYOUT, theme) { init() } -} - -fun Context.gridLayout(): android.widget.GridLayout = gridLayout() {} -inline fun Context.gridLayout(init: (@AnkoViewDslMarker _GridLayout).() -> Unit): android.widget.GridLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_LAYOUT, theme = 0) { init() } -} - -fun Context.themedGridLayout(theme: Int = 0): android.widget.GridLayout = - themedGridLayout(theme) {} - -inline fun Context.themedGridLayout( - theme: Int = 0, - init: (@AnkoViewDslMarker _GridLayout).() -> Unit, -): android.widget.GridLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_LAYOUT, theme) { init() } -} - -fun Activity.gridLayout(): android.widget.GridLayout = gridLayout() {} -inline fun Activity.gridLayout(init: (@AnkoViewDslMarker _GridLayout).() -> Unit): android.widget.GridLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_LAYOUT, theme = 0) { init() } -} - -fun Activity.themedGridLayout(theme: Int = 0): android.widget.GridLayout = - themedGridLayout(theme) {} - -inline fun Activity.themedGridLayout( - theme: Int = 0, - init: (@AnkoViewDslMarker _GridLayout).() -> Unit, -): android.widget.GridLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_LAYOUT, theme) { init() } -} - -fun ViewManager.gridView(): android.widget.GridView = gridView() {} -inline fun ViewManager.gridView(init: (@AnkoViewDslMarker _GridView).() -> Unit): android.widget.GridView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_VIEW, theme = 0) { init() } -} - -fun ViewManager.themedGridView(theme: Int = 0): android.widget.GridView = - themedGridView(theme) {} - -inline fun ViewManager.themedGridView( - theme: Int = 0, - init: (@AnkoViewDslMarker _GridView).() -> Unit, -): android.widget.GridView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_VIEW, theme) { init() } -} - -fun Context.gridView(): android.widget.GridView = gridView() {} -inline fun Context.gridView(init: (@AnkoViewDslMarker _GridView).() -> Unit): android.widget.GridView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_VIEW, theme = 0) { init() } -} - -fun Context.themedGridView(theme: Int = 0): android.widget.GridView = - themedGridView(theme) {} - -inline fun Context.themedGridView( - theme: Int = 0, - init: (@AnkoViewDslMarker _GridView).() -> Unit, -): android.widget.GridView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_VIEW, theme) { init() } -} - -fun Activity.gridView(): android.widget.GridView = gridView() {} -inline fun Activity.gridView(init: (@AnkoViewDslMarker _GridView).() -> Unit): android.widget.GridView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_VIEW, theme = 0) { init() } -} - -fun Activity.themedGridView(theme: Int = 0): android.widget.GridView = - themedGridView(theme) {} - -inline fun Activity.themedGridView( - theme: Int = 0, - init: (@AnkoViewDslMarker _GridView).() -> Unit, -): android.widget.GridView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.GRID_VIEW, theme) { init() } -} - -fun ViewManager.horizontalScrollView(): android.widget.HorizontalScrollView = - horizontalScrollView() {} - -inline fun ViewManager.horizontalScrollView(init: (@AnkoViewDslMarker _HorizontalScrollView).() -> Unit): android.widget.HorizontalScrollView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.HORIZONTAL_SCROLL_VIEW, theme = 0) { init() } -} - -fun ViewManager.themedHorizontalScrollView(theme: Int = 0): android.widget.HorizontalScrollView = - themedHorizontalScrollView(theme) {} - -inline fun ViewManager.themedHorizontalScrollView( - theme: Int = 0, - init: (@AnkoViewDslMarker _HorizontalScrollView).() -> Unit, -): android.widget.HorizontalScrollView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.HORIZONTAL_SCROLL_VIEW, theme) { init() } -} - -fun Context.horizontalScrollView(): android.widget.HorizontalScrollView = - horizontalScrollView() {} - -inline fun Context.horizontalScrollView(init: (@AnkoViewDslMarker _HorizontalScrollView).() -> Unit): android.widget.HorizontalScrollView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.HORIZONTAL_SCROLL_VIEW, theme = 0) { init() } -} - -fun Context.themedHorizontalScrollView(theme: Int = 0): android.widget.HorizontalScrollView = - themedHorizontalScrollView(theme) {} - -inline fun Context.themedHorizontalScrollView( - theme: Int = 0, - init: (@AnkoViewDslMarker _HorizontalScrollView).() -> Unit, -): android.widget.HorizontalScrollView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.HORIZONTAL_SCROLL_VIEW, theme) { init() } -} - -fun Activity.horizontalScrollView(): android.widget.HorizontalScrollView = - horizontalScrollView() {} - -inline fun Activity.horizontalScrollView(init: (@AnkoViewDslMarker _HorizontalScrollView).() -> Unit): android.widget.HorizontalScrollView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.HORIZONTAL_SCROLL_VIEW, theme = 0) { init() } -} - -fun Activity.themedHorizontalScrollView(theme: Int = 0): android.widget.HorizontalScrollView = - themedHorizontalScrollView(theme) {} - -inline fun Activity.themedHorizontalScrollView( - theme: Int = 0, - init: (@AnkoViewDslMarker _HorizontalScrollView).() -> Unit, -): android.widget.HorizontalScrollView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.HORIZONTAL_SCROLL_VIEW, theme) { init() } -} - -fun ViewManager.imageSwitcher(): android.widget.ImageSwitcher = imageSwitcher() {} -inline fun ViewManager.imageSwitcher(init: (@AnkoViewDslMarker _ImageSwitcher).() -> Unit): android.widget.ImageSwitcher { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.IMAGE_SWITCHER, theme = 0) { init() } -} - -fun ViewManager.themedImageSwitcher(theme: Int = 0): android.widget.ImageSwitcher = - themedImageSwitcher(theme) {} - -inline fun ViewManager.themedImageSwitcher( - theme: Int = 0, - init: (@AnkoViewDslMarker _ImageSwitcher).() -> Unit, -): android.widget.ImageSwitcher { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.IMAGE_SWITCHER, theme) { init() } -} - -fun Context.imageSwitcher(): android.widget.ImageSwitcher = imageSwitcher() {} -inline fun Context.imageSwitcher(init: (@AnkoViewDslMarker _ImageSwitcher).() -> Unit): android.widget.ImageSwitcher { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.IMAGE_SWITCHER, theme = 0) { init() } -} - -fun Context.themedImageSwitcher(theme: Int = 0): android.widget.ImageSwitcher = - themedImageSwitcher(theme) {} - -inline fun Context.themedImageSwitcher( - theme: Int = 0, - init: (@AnkoViewDslMarker _ImageSwitcher).() -> Unit, -): android.widget.ImageSwitcher { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.IMAGE_SWITCHER, theme) { init() } -} - -fun Activity.imageSwitcher(): android.widget.ImageSwitcher = imageSwitcher() {} -inline fun Activity.imageSwitcher(init: (@AnkoViewDslMarker _ImageSwitcher).() -> Unit): android.widget.ImageSwitcher { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.IMAGE_SWITCHER, theme = 0) { init() } -} - -fun Activity.themedImageSwitcher(theme: Int = 0): android.widget.ImageSwitcher = - themedImageSwitcher(theme) {} - -inline fun Activity.themedImageSwitcher( - theme: Int = 0, - init: (@AnkoViewDslMarker _ImageSwitcher).() -> Unit, -): android.widget.ImageSwitcher { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.IMAGE_SWITCHER, theme) { init() } -} - -fun ViewManager.linearLayout(): android.widget.LinearLayout = linearLayout() {} -inline fun ViewManager.linearLayout(init: (@AnkoViewDslMarker _LinearLayout).() -> Unit): android.widget.LinearLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.LINEAR_LAYOUT, theme = 0) { init() } -} - -fun ViewManager.themedLinearLayout(theme: Int = 0): android.widget.LinearLayout = - themedLinearLayout(theme) {} - -inline fun ViewManager.themedLinearLayout( - theme: Int = 0, - init: (@AnkoViewDslMarker _LinearLayout).() -> Unit, -): android.widget.LinearLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.LINEAR_LAYOUT, theme) { init() } -} - -fun Context.linearLayout(): android.widget.LinearLayout = linearLayout() {} -inline fun Context.linearLayout(init: (@AnkoViewDslMarker _LinearLayout).() -> Unit): android.widget.LinearLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.LINEAR_LAYOUT, theme = 0) { init() } -} - -fun Context.themedLinearLayout(theme: Int = 0): android.widget.LinearLayout = - themedLinearLayout(theme) {} - -inline fun Context.themedLinearLayout( - theme: Int = 0, - init: (@AnkoViewDslMarker _LinearLayout).() -> Unit, -): android.widget.LinearLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.LINEAR_LAYOUT, theme) { init() } -} - -fun Activity.linearLayout(): android.widget.LinearLayout = linearLayout() {} -inline fun Activity.linearLayout(init: (@AnkoViewDslMarker _LinearLayout).() -> Unit): android.widget.LinearLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.LINEAR_LAYOUT, theme = 0) { init() } -} - -fun Activity.themedLinearLayout(theme: Int = 0): android.widget.LinearLayout = - themedLinearLayout(theme) {} - -inline fun Activity.themedLinearLayout( - theme: Int = 0, - init: (@AnkoViewDslMarker _LinearLayout).() -> Unit, -): android.widget.LinearLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.LINEAR_LAYOUT, theme) { init() } -} - -fun ViewManager.radioGroup(): android.widget.RadioGroup = radioGroup() {} -inline fun ViewManager.radioGroup(init: (@AnkoViewDslMarker _RadioGroup).() -> Unit): android.widget.RadioGroup { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RADIO_GROUP, theme = 0) { init() } -} - -fun ViewManager.themedRadioGroup(theme: Int = 0): android.widget.RadioGroup = - themedRadioGroup(theme) {} - -inline fun ViewManager.themedRadioGroup( - theme: Int = 0, - init: (@AnkoViewDslMarker _RadioGroup).() -> Unit, -): android.widget.RadioGroup { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RADIO_GROUP, theme) { init() } -} - -fun Context.radioGroup(): android.widget.RadioGroup = radioGroup() {} -inline fun Context.radioGroup(init: (@AnkoViewDslMarker _RadioGroup).() -> Unit): android.widget.RadioGroup { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RADIO_GROUP, theme = 0) { init() } -} - -fun Context.themedRadioGroup(theme: Int = 0): android.widget.RadioGroup = - themedRadioGroup(theme) {} - -inline fun Context.themedRadioGroup( - theme: Int = 0, - init: (@AnkoViewDslMarker _RadioGroup).() -> Unit, -): android.widget.RadioGroup { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RADIO_GROUP, theme) { init() } -} - -fun Activity.radioGroup(): android.widget.RadioGroup = radioGroup() {} -inline fun Activity.radioGroup(init: (@AnkoViewDslMarker _RadioGroup).() -> Unit): android.widget.RadioGroup { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RADIO_GROUP, theme = 0) { init() } -} - -fun Activity.themedRadioGroup(theme: Int = 0): android.widget.RadioGroup = - themedRadioGroup(theme) {} - -inline fun Activity.themedRadioGroup( - theme: Int = 0, - init: (@AnkoViewDslMarker _RadioGroup).() -> Unit, -): android.widget.RadioGroup { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RADIO_GROUP, theme) { init() } -} - -fun ViewManager.relativeLayout(): android.widget.RelativeLayout = relativeLayout() {} -inline fun ViewManager.relativeLayout(init: (@AnkoViewDslMarker _RelativeLayout).() -> Unit): android.widget.RelativeLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RELATIVE_LAYOUT, theme = 0) { init() } -} - -fun ViewManager.themedRelativeLayout(theme: Int = 0): android.widget.RelativeLayout = - themedRelativeLayout(theme) {} - -inline fun ViewManager.themedRelativeLayout( - theme: Int = 0, - init: (@AnkoViewDslMarker _RelativeLayout).() -> Unit, -): android.widget.RelativeLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RELATIVE_LAYOUT, theme) { init() } -} - -fun Context.relativeLayout(): android.widget.RelativeLayout = relativeLayout() {} -inline fun Context.relativeLayout(init: (@AnkoViewDslMarker _RelativeLayout).() -> Unit): android.widget.RelativeLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RELATIVE_LAYOUT, theme = 0) { init() } -} - -fun Context.themedRelativeLayout(theme: Int = 0): android.widget.RelativeLayout = - themedRelativeLayout(theme) {} - -inline fun Context.themedRelativeLayout( - theme: Int = 0, - init: (@AnkoViewDslMarker _RelativeLayout).() -> Unit, -): android.widget.RelativeLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RELATIVE_LAYOUT, theme) { init() } -} - -fun Activity.relativeLayout(): android.widget.RelativeLayout = relativeLayout() {} -inline fun Activity.relativeLayout(init: (@AnkoViewDslMarker _RelativeLayout).() -> Unit): android.widget.RelativeLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RELATIVE_LAYOUT, theme = 0) { init() } -} - -fun Activity.themedRelativeLayout(theme: Int = 0): android.widget.RelativeLayout = - themedRelativeLayout(theme) {} - -inline fun Activity.themedRelativeLayout( - theme: Int = 0, - init: (@AnkoViewDslMarker _RelativeLayout).() -> Unit, -): android.widget.RelativeLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.RELATIVE_LAYOUT, theme) { init() } -} - -fun ViewManager.scrollView(): android.widget.ScrollView = scrollView() {} -inline fun ViewManager.scrollView(init: (@AnkoViewDslMarker _ScrollView).() -> Unit): android.widget.ScrollView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.SCROLL_VIEW, theme = 0) { init() } -} - -fun ViewManager.themedScrollView(theme: Int = 0): android.widget.ScrollView = - themedScrollView(theme) {} - -inline fun ViewManager.themedScrollView( - theme: Int = 0, - init: (@AnkoViewDslMarker _ScrollView).() -> Unit, -): android.widget.ScrollView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.SCROLL_VIEW, theme) { init() } -} - -fun Context.scrollView(): android.widget.ScrollView = scrollView() {} -inline fun Context.scrollView(init: (@AnkoViewDslMarker _ScrollView).() -> Unit): android.widget.ScrollView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.SCROLL_VIEW, theme = 0) { init() } -} - -fun Context.themedScrollView(theme: Int = 0): android.widget.ScrollView = - themedScrollView(theme) {} - -inline fun Context.themedScrollView( - theme: Int = 0, - init: (@AnkoViewDslMarker _ScrollView).() -> Unit, -): android.widget.ScrollView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.SCROLL_VIEW, theme) { init() } -} - -fun Activity.scrollView(): android.widget.ScrollView = scrollView() {} -inline fun Activity.scrollView(init: (@AnkoViewDslMarker _ScrollView).() -> Unit): android.widget.ScrollView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.SCROLL_VIEW, theme = 0) { init() } -} - -fun Activity.themedScrollView(theme: Int = 0): android.widget.ScrollView = - themedScrollView(theme) {} - -inline fun Activity.themedScrollView( - theme: Int = 0, - init: (@AnkoViewDslMarker _ScrollView).() -> Unit, -): android.widget.ScrollView { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.SCROLL_VIEW, theme) { init() } -} - -fun ViewManager.tableLayout(): android.widget.TableLayout = tableLayout() {} -inline fun ViewManager.tableLayout(init: (@AnkoViewDslMarker _TableLayout).() -> Unit): android.widget.TableLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_LAYOUT, theme = 0) { init() } -} - -fun ViewManager.themedTableLayout(theme: Int = 0): android.widget.TableLayout = - themedTableLayout(theme) {} - -inline fun ViewManager.themedTableLayout( - theme: Int = 0, - init: (@AnkoViewDslMarker _TableLayout).() -> Unit, -): android.widget.TableLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_LAYOUT, theme) { init() } -} - -fun Context.tableLayout(): android.widget.TableLayout = tableLayout() {} -inline fun Context.tableLayout(init: (@AnkoViewDslMarker _TableLayout).() -> Unit): android.widget.TableLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_LAYOUT, theme = 0) { init() } -} - -fun Context.themedTableLayout(theme: Int = 0): android.widget.TableLayout = - themedTableLayout(theme) {} - -inline fun Context.themedTableLayout( - theme: Int = 0, - init: (@AnkoViewDslMarker _TableLayout).() -> Unit, -): android.widget.TableLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_LAYOUT, theme) { init() } -} - -fun Activity.tableLayout(): android.widget.TableLayout = tableLayout() {} -inline fun Activity.tableLayout(init: (@AnkoViewDslMarker _TableLayout).() -> Unit): android.widget.TableLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_LAYOUT, theme = 0) { init() } -} - -fun Activity.themedTableLayout(theme: Int = 0): android.widget.TableLayout = - themedTableLayout(theme) {} - -inline fun Activity.themedTableLayout( - theme: Int = 0, - init: (@AnkoViewDslMarker _TableLayout).() -> Unit, -): android.widget.TableLayout { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_LAYOUT, theme) { init() } -} - -fun ViewManager.tableRow(): android.widget.TableRow = tableRow() {} -inline fun ViewManager.tableRow(init: (@AnkoViewDslMarker _TableRow).() -> Unit): android.widget.TableRow { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_ROW, theme = 0) { init() } -} - -fun ViewManager.themedTableRow(theme: Int = 0): android.widget.TableRow = - themedTableRow(theme) {} - -inline fun ViewManager.themedTableRow( - theme: Int = 0, - init: (@AnkoViewDslMarker _TableRow).() -> Unit, -): android.widget.TableRow { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_ROW, theme) { init() } -} - -fun Context.tableRow(): android.widget.TableRow = tableRow() {} -inline fun Context.tableRow(init: (@AnkoViewDslMarker _TableRow).() -> Unit): android.widget.TableRow { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_ROW, theme = 0) { init() } -} - -fun Context.themedTableRow(theme: Int = 0): android.widget.TableRow = - themedTableRow(theme) {} - -inline fun Context.themedTableRow( - theme: Int = 0, - init: (@AnkoViewDslMarker _TableRow).() -> Unit, -): android.widget.TableRow { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_ROW, theme) { init() } -} - -fun Activity.tableRow(): android.widget.TableRow = tableRow() {} -inline fun Activity.tableRow(init: (@AnkoViewDslMarker _TableRow).() -> Unit): android.widget.TableRow { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_ROW, theme = 0) { init() } -} - -fun Activity.themedTableRow(theme: Int = 0): android.widget.TableRow = - themedTableRow(theme) {} - -inline fun Activity.themedTableRow( - theme: Int = 0, - init: (@AnkoViewDslMarker _TableRow).() -> Unit, -): android.widget.TableRow { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TABLE_ROW, theme) { init() } -} - -fun ViewManager.textSwitcher(): android.widget.TextSwitcher = textSwitcher() {} -inline fun ViewManager.textSwitcher(init: (@AnkoViewDslMarker _TextSwitcher).() -> Unit): android.widget.TextSwitcher { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TEXT_SWITCHER, theme = 0) { init() } -} - -fun ViewManager.themedTextSwitcher(theme: Int = 0): android.widget.TextSwitcher = - themedTextSwitcher(theme) {} - -inline fun ViewManager.themedTextSwitcher( - theme: Int = 0, - init: (@AnkoViewDslMarker _TextSwitcher).() -> Unit, -): android.widget.TextSwitcher { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TEXT_SWITCHER, theme) { init() } -} - -fun Context.textSwitcher(): android.widget.TextSwitcher = textSwitcher() {} -inline fun Context.textSwitcher(init: (@AnkoViewDslMarker _TextSwitcher).() -> Unit): android.widget.TextSwitcher { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TEXT_SWITCHER, theme = 0) { init() } -} - -fun Context.themedTextSwitcher(theme: Int = 0): android.widget.TextSwitcher = - themedTextSwitcher(theme) {} - -inline fun Context.themedTextSwitcher( - theme: Int = 0, - init: (@AnkoViewDslMarker _TextSwitcher).() -> Unit, -): android.widget.TextSwitcher { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TEXT_SWITCHER, theme) { init() } -} - -fun Activity.textSwitcher(): android.widget.TextSwitcher = textSwitcher() {} -inline fun Activity.textSwitcher(init: (@AnkoViewDslMarker _TextSwitcher).() -> Unit): android.widget.TextSwitcher { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TEXT_SWITCHER, theme = 0) { init() } -} - -fun Activity.themedTextSwitcher(theme: Int = 0): android.widget.TextSwitcher = - themedTextSwitcher(theme) {} - -inline fun Activity.themedTextSwitcher( - theme: Int = 0, - init: (@AnkoViewDslMarker _TextSwitcher).() -> Unit, -): android.widget.TextSwitcher { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TEXT_SWITCHER, theme) { init() } -} - -fun ViewManager.toolbar(): android.widget.Toolbar = toolbar() {} -inline fun ViewManager.toolbar(init: (@AnkoViewDslMarker _Toolbar).() -> Unit): android.widget.Toolbar { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TOOLBAR, theme = 0) { init() } -} - -fun ViewManager.themedToolbar(theme: Int = 0): android.widget.Toolbar = - themedToolbar(theme) {} - -inline fun ViewManager.themedToolbar( - theme: Int = 0, - init: (@AnkoViewDslMarker _Toolbar).() -> Unit, -): android.widget.Toolbar { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TOOLBAR, theme) { init() } -} - -fun Context.toolbar(): android.widget.Toolbar = toolbar() {} -inline fun Context.toolbar(init: (@AnkoViewDslMarker _Toolbar).() -> Unit): android.widget.Toolbar { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TOOLBAR, theme = 0) { init() } -} - -fun Context.themedToolbar(theme: Int = 0): android.widget.Toolbar = themedToolbar(theme) {} -inline fun Context.themedToolbar( - theme: Int = 0, - init: (@AnkoViewDslMarker _Toolbar).() -> Unit, -): android.widget.Toolbar { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TOOLBAR, theme) { init() } -} - -fun Activity.toolbar(): android.widget.Toolbar = toolbar() {} -inline fun Activity.toolbar(init: (@AnkoViewDslMarker _Toolbar).() -> Unit): android.widget.Toolbar { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TOOLBAR, theme = 0) { init() } -} - -fun Activity.themedToolbar(theme: Int = 0): android.widget.Toolbar = themedToolbar(theme) {} -inline fun Activity.themedToolbar( - theme: Int = 0, - init: (@AnkoViewDslMarker _Toolbar).() -> Unit, -): android.widget.Toolbar { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.TOOLBAR, theme) { init() } -} - -fun ViewManager.viewAnimator(): android.widget.ViewAnimator = viewAnimator() {} -inline fun ViewManager.viewAnimator(init: (@AnkoViewDslMarker _ViewAnimator).() -> Unit): android.widget.ViewAnimator { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_ANIMATOR, theme = 0) { init() } -} - -fun ViewManager.themedViewAnimator(theme: Int = 0): android.widget.ViewAnimator = - themedViewAnimator(theme) {} - -inline fun ViewManager.themedViewAnimator( - theme: Int = 0, - init: (@AnkoViewDslMarker _ViewAnimator).() -> Unit, -): android.widget.ViewAnimator { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_ANIMATOR, theme) { init() } -} - -fun Context.viewAnimator(): android.widget.ViewAnimator = viewAnimator() {} -inline fun Context.viewAnimator(init: (@AnkoViewDslMarker _ViewAnimator).() -> Unit): android.widget.ViewAnimator { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_ANIMATOR, theme = 0) { init() } -} - -fun Context.themedViewAnimator(theme: Int = 0): android.widget.ViewAnimator = - themedViewAnimator(theme) {} - -inline fun Context.themedViewAnimator( - theme: Int = 0, - init: (@AnkoViewDslMarker _ViewAnimator).() -> Unit, -): android.widget.ViewAnimator { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_ANIMATOR, theme) { init() } -} - -fun Activity.viewAnimator(): android.widget.ViewAnimator = viewAnimator() {} -inline fun Activity.viewAnimator(init: (@AnkoViewDslMarker _ViewAnimator).() -> Unit): android.widget.ViewAnimator { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_ANIMATOR, theme = 0) { init() } -} - -fun Activity.themedViewAnimator(theme: Int = 0): android.widget.ViewAnimator = - themedViewAnimator(theme) {} - -inline fun Activity.themedViewAnimator( - theme: Int = 0, - init: (@AnkoViewDslMarker _ViewAnimator).() -> Unit, -): android.widget.ViewAnimator { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_ANIMATOR, theme) { init() } -} - -fun ViewManager.viewSwitcher(): android.widget.ViewSwitcher = viewSwitcher() {} -inline fun ViewManager.viewSwitcher(init: (@AnkoViewDslMarker _ViewSwitcher).() -> Unit): android.widget.ViewSwitcher { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_SWITCHER, theme = 0) { init() } -} - -fun ViewManager.themedViewSwitcher(theme: Int = 0): android.widget.ViewSwitcher = - themedViewSwitcher(theme) {} - -inline fun ViewManager.themedViewSwitcher( - theme: Int = 0, - init: (@AnkoViewDslMarker _ViewSwitcher).() -> Unit, -): android.widget.ViewSwitcher { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_SWITCHER, theme) { init() } -} - -fun Context.viewSwitcher(): android.widget.ViewSwitcher = viewSwitcher() {} -inline fun Context.viewSwitcher(init: (@AnkoViewDslMarker _ViewSwitcher).() -> Unit): android.widget.ViewSwitcher { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_SWITCHER, theme = 0) { init() } -} - -fun Context.themedViewSwitcher(theme: Int = 0): android.widget.ViewSwitcher = - themedViewSwitcher(theme) {} - -inline fun Context.themedViewSwitcher( - theme: Int = 0, - init: (@AnkoViewDslMarker _ViewSwitcher).() -> Unit, -): android.widget.ViewSwitcher { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_SWITCHER, theme) { init() } -} - -fun Activity.viewSwitcher(): android.widget.ViewSwitcher = viewSwitcher() {} -inline fun Activity.viewSwitcher(init: (@AnkoViewDslMarker _ViewSwitcher).() -> Unit): android.widget.ViewSwitcher { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_SWITCHER, theme = 0) { init() } -} - -fun Activity.themedViewSwitcher(theme: Int = 0): android.widget.ViewSwitcher = - themedViewSwitcher(theme) {} - -inline fun Activity.themedViewSwitcher( - theme: Int = 0, - init: (@AnkoViewDslMarker _ViewSwitcher).() -> Unit, -): android.widget.ViewSwitcher { - return ankoView(`$$Anko$Factories$Sdk28ViewGroup`.VIEW_SWITCHER, theme) { init() } -} diff --git a/anko/src/main/java/org/jetbrains/anko/Views2.kt b/anko/src/main/java/org/jetbrains/anko/Views2.kt new file mode 100644 index 00000000..14d7db73 --- /dev/null +++ b/anko/src/main/java/org/jetbrains/anko/Views2.kt @@ -0,0 +1,1028 @@ +@file:Suppress("TooManyFunctions", "ClassNaming") +@file:JvmName("Sdk28Views2Kt") + +package org.jetbrains.anko + +import android.app.* +import android.content.Context +import android.view.ViewManager +import android.widget.* +import androidx.appcompat.widget.* +import androidx.appcompat.widget.SearchView +import org.jetbrains.anko.custom.* + +fun ViewManager.expandableListView(): ExpandableListView = + expandableListView {} + +inline fun ViewManager.expandableListView(init: (@AnkoViewDslMarker ExpandableListView).() -> Unit): ExpandableListView { + return ankoView(`$$Anko$Factories$Sdk28View`.EXPANDABLE_LIST_VIEW, theme = 0) { init() } +} + +fun ViewManager.themedExpandableListView(theme: Int = 0): ExpandableListView = + themedExpandableListView(theme) {} + +inline fun ViewManager.themedExpandableListView( + theme: Int = 0, + init: (@AnkoViewDslMarker ExpandableListView).() -> Unit, +): ExpandableListView { + return ankoView(`$$Anko$Factories$Sdk28View`.EXPANDABLE_LIST_VIEW, theme) { init() } +} + +fun Context.expandableListView(): ExpandableListView = expandableListView {} +inline fun Context.expandableListView(init: (@AnkoViewDslMarker ExpandableListView).() -> Unit): ExpandableListView { + return ankoView(`$$Anko$Factories$Sdk28View`.EXPANDABLE_LIST_VIEW, theme = 0) { init() } +} + +fun Context.themedExpandableListView(theme: Int = 0): ExpandableListView = + themedExpandableListView(theme) {} + +inline fun Context.themedExpandableListView( + theme: Int = 0, + init: (@AnkoViewDslMarker ExpandableListView).() -> Unit, +): ExpandableListView { + return ankoView(`$$Anko$Factories$Sdk28View`.EXPANDABLE_LIST_VIEW, theme) { init() } +} + +fun Activity.expandableListView(): ExpandableListView = + expandableListView {} + +inline fun Activity.expandableListView(init: (@AnkoViewDslMarker ExpandableListView).() -> Unit): ExpandableListView { + return ankoView(`$$Anko$Factories$Sdk28View`.EXPANDABLE_LIST_VIEW, theme = 0) { init() } +} + +fun Activity.themedExpandableListView(theme: Int = 0): ExpandableListView = + themedExpandableListView(theme) {} + +inline fun Activity.themedExpandableListView( + theme: Int = 0, + init: (@AnkoViewDslMarker ExpandableListView).() -> Unit, +): ExpandableListView { + return ankoView(`$$Anko$Factories$Sdk28View`.EXPANDABLE_LIST_VIEW, theme) { init() } +} + +fun ViewManager.imageButton(): AppCompatImageButton = imageButton {} +inline fun ViewManager.imageButton(init: (@AnkoViewDslMarker AppCompatImageButton).() -> Unit): AppCompatImageButton { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme = 0) { init() } +} + +fun ViewManager.themedImageButton(theme: Int = 0): AppCompatImageButton = + themedImageButton(theme) {} + +inline fun ViewManager.themedImageButton( + theme: Int = 0, + init: (@AnkoViewDslMarker AppCompatImageButton).() -> Unit, +): AppCompatImageButton { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme) { init() } +} + +fun ViewManager.imageButton(imageDrawable: android.graphics.drawable.Drawable?): AppCompatImageButton { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme = 0) { + setImageDrawable(imageDrawable) + } +} + +inline fun ViewManager.imageButton( + imageDrawable: android.graphics.drawable.Drawable?, + init: (@AnkoViewDslMarker AppCompatImageButton).() -> Unit, +): AppCompatImageButton { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme = 0) { + init() + setImageDrawable(imageDrawable) + } +} + +fun ViewManager.themedImageButton( + imageDrawable: android.graphics.drawable.Drawable?, + theme: Int, +): AppCompatImageButton { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme) { + setImageDrawable(imageDrawable) + } +} + +inline fun ViewManager.themedImageButton( + imageDrawable: android.graphics.drawable.Drawable?, + theme: Int, + init: (@AnkoViewDslMarker AppCompatImageButton).() -> Unit, +): AppCompatImageButton { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme) { + init() + setImageDrawable(imageDrawable) + } +} + +fun ViewManager.imageButton(imageResource: Int): AppCompatImageButton { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme = 0) { + setImageResource(imageResource) + } +} + +inline fun ViewManager.imageButton( + imageResource: Int, + init: (@AnkoViewDslMarker AppCompatImageButton).() -> Unit, +): AppCompatImageButton { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme = 0) { + init() + setImageResource(imageResource) + } +} + +fun ViewManager.themedImageButton( + imageResource: Int, + theme: Int, +): AppCompatImageButton { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme) { + setImageResource(imageResource) + } +} + +inline fun ViewManager.themedImageButton( + imageResource: Int, + theme: Int, + init: (@AnkoViewDslMarker AppCompatImageButton).() -> Unit, +): AppCompatImageButton { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_BUTTON, theme) { + init() + setImageResource(imageResource) + } +} + +fun ViewManager.imageView(): AppCompatImageView = imageView {} +inline fun ViewManager.imageView(init: (@AnkoViewDslMarker AppCompatImageView).() -> Unit): AppCompatImageView { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme = 0) { init() } +} + +fun ViewManager.themedImageView(theme: Int = 0): AppCompatImageView = + themedImageView(theme) {} + +inline fun ViewManager.themedImageView( + theme: Int = 0, + init: (@AnkoViewDslMarker AppCompatImageView).() -> Unit, +): AppCompatImageView { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme) { init() } +} + +fun ViewManager.imageView(imageDrawable: android.graphics.drawable.Drawable?): AppCompatImageView { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme = 0) { + setImageDrawable(imageDrawable) + } +} + +inline fun ViewManager.imageView( + imageDrawable: android.graphics.drawable.Drawable?, + init: (@AnkoViewDslMarker AppCompatImageView).() -> Unit, +): AppCompatImageView { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme = 0) { + init() + setImageDrawable(imageDrawable) + } +} + +fun ViewManager.themedImageView( + imageDrawable: android.graphics.drawable.Drawable?, + theme: Int, +): AppCompatImageView { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme) { + setImageDrawable(imageDrawable) + } +} + +inline fun ViewManager.themedImageView( + imageDrawable: android.graphics.drawable.Drawable?, + theme: Int, + init: (@AnkoViewDslMarker AppCompatImageView).() -> Unit, +): AppCompatImageView { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme) { + init() + setImageDrawable(imageDrawable) + } +} + +fun ViewManager.imageView(imageResource: Int): AppCompatImageView { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme = 0) { + setImageResource(imageResource) + } +} + +inline fun ViewManager.imageView( + imageResource: Int, + init: (@AnkoViewDslMarker AppCompatImageView).() -> Unit, +): AppCompatImageView { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme = 0) { + init() + setImageResource(imageResource) + } +} + +fun ViewManager.themedImageView(imageResource: Int, theme: Int): AppCompatImageView { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme) { + setImageResource(imageResource) + } +} + +inline fun ViewManager.themedImageView( + imageResource: Int, + theme: Int, + init: (@AnkoViewDslMarker AppCompatImageView).() -> Unit, +): AppCompatImageView { + return ankoView(`$$Anko$Factories$Sdk28View`.IMAGE_VIEW, theme) { + init() + setImageResource(imageResource) + } +} + +fun ViewManager.listView(): ListView = listView {} +inline fun ViewManager.listView(init: (@AnkoViewDslMarker ListView).() -> Unit): ListView { + return ankoView(`$$Anko$Factories$Sdk28View`.LIST_VIEW, theme = 0) { init() } +} + +fun ViewManager.themedListView(theme: Int = 0): ListView = + themedListView(theme) {} + +inline fun ViewManager.themedListView( + theme: Int = 0, + init: (@AnkoViewDslMarker ListView).() -> Unit, +): ListView { + return ankoView(`$$Anko$Factories$Sdk28View`.LIST_VIEW, theme) { init() } +} + +fun Context.listView(): ListView = listView {} +inline fun Context.listView(init: (@AnkoViewDslMarker ListView).() -> Unit): ListView { + return ankoView(`$$Anko$Factories$Sdk28View`.LIST_VIEW, theme = 0) { init() } +} + +fun Context.themedListView(theme: Int = 0): ListView = + themedListView(theme) {} + +inline fun Context.themedListView( + theme: Int = 0, + init: (@AnkoViewDslMarker ListView).() -> Unit, +): ListView { + return ankoView(`$$Anko$Factories$Sdk28View`.LIST_VIEW, theme) { init() } +} + +fun Activity.listView(): ListView = listView {} +inline fun Activity.listView(init: (@AnkoViewDslMarker ListView).() -> Unit): ListView { + return ankoView(`$$Anko$Factories$Sdk28View`.LIST_VIEW, theme = 0) { init() } +} + +fun Activity.themedListView(theme: Int = 0): ListView = + themedListView(theme) {} + +inline fun Activity.themedListView( + theme: Int = 0, + init: (@AnkoViewDslMarker ListView).() -> Unit, +): ListView { + return ankoView(`$$Anko$Factories$Sdk28View`.LIST_VIEW, theme) { init() } +} + +fun ViewManager.multiAutoCompleteTextView(): AppCompatMultiAutoCompleteTextView = + multiAutoCompleteTextView {} + +inline fun ViewManager.multiAutoCompleteTextView(init: (@AnkoViewDslMarker AppCompatMultiAutoCompleteTextView).() -> Unit): AppCompatMultiAutoCompleteTextView { + return ankoView( + `$$Anko$Factories$Sdk28View`.MULTI_AUTO_COMPLETE_TEXT_VIEW, + theme = 0 + ) { init() } +} + +fun ViewManager.themedMultiAutoCompleteTextView(theme: Int = 0): AppCompatMultiAutoCompleteTextView = + themedMultiAutoCompleteTextView(theme) {} + +inline fun ViewManager.themedMultiAutoCompleteTextView( + theme: Int = 0, + init: (@AnkoViewDslMarker AppCompatMultiAutoCompleteTextView).() -> Unit, +): AppCompatMultiAutoCompleteTextView { + return ankoView(`$$Anko$Factories$Sdk28View`.MULTI_AUTO_COMPLETE_TEXT_VIEW, theme) { init() } +} + +fun ViewManager.numberPicker(): NumberPicker = numberPicker {} +inline fun ViewManager.numberPicker(init: (@AnkoViewDslMarker NumberPicker).() -> Unit): NumberPicker { + return ankoView(`$$Anko$Factories$Sdk28View`.NUMBER_PICKER, theme = 0) { init() } +} + +fun ViewManager.themedNumberPicker(theme: Int = 0): NumberPicker = + themedNumberPicker(theme) {} + +inline fun ViewManager.themedNumberPicker( + theme: Int = 0, + init: (@AnkoViewDslMarker NumberPicker).() -> Unit, +): NumberPicker { + return ankoView(`$$Anko$Factories$Sdk28View`.NUMBER_PICKER, theme) { init() } +} + +fun Context.numberPicker(): NumberPicker = numberPicker {} +inline fun Context.numberPicker(init: (@AnkoViewDslMarker NumberPicker).() -> Unit): NumberPicker { + return ankoView(`$$Anko$Factories$Sdk28View`.NUMBER_PICKER, theme = 0) { init() } +} + +fun Context.themedNumberPicker(theme: Int = 0): NumberPicker = + themedNumberPicker(theme) {} + +inline fun Context.themedNumberPicker( + theme: Int = 0, + init: (@AnkoViewDslMarker NumberPicker).() -> Unit, +): NumberPicker { + return ankoView(`$$Anko$Factories$Sdk28View`.NUMBER_PICKER, theme) { init() } +} + +fun Activity.numberPicker(): NumberPicker = numberPicker {} +inline fun Activity.numberPicker(init: (@AnkoViewDslMarker NumberPicker).() -> Unit): NumberPicker { + return ankoView(`$$Anko$Factories$Sdk28View`.NUMBER_PICKER, theme = 0) { init() } +} + +fun Activity.themedNumberPicker(theme: Int = 0): NumberPicker = + themedNumberPicker(theme) {} + +inline fun Activity.themedNumberPicker( + theme: Int = 0, + init: (@AnkoViewDslMarker NumberPicker).() -> Unit, +): NumberPicker { + return ankoView(`$$Anko$Factories$Sdk28View`.NUMBER_PICKER, theme) { init() } +} + +fun ViewManager.progressBar(): ProgressBar = progressBar {} +inline fun ViewManager.progressBar(init: (@AnkoViewDslMarker ProgressBar).() -> Unit): ProgressBar { + return ankoView(`$$Anko$Factories$Sdk28View`.PROGRESS_BAR, theme = 0) { init() } +} + +fun ViewManager.themedProgressBar(theme: Int = 0): ProgressBar = + themedProgressBar(theme) {} + +inline fun ViewManager.themedProgressBar( + theme: Int = 0, + init: (@AnkoViewDslMarker ProgressBar).() -> Unit, +): ProgressBar { + return ankoView(`$$Anko$Factories$Sdk28View`.PROGRESS_BAR, theme) { init() } +} + +fun ViewManager.quickContactBadge(): QuickContactBadge = + quickContactBadge {} + +inline fun ViewManager.quickContactBadge(init: (@AnkoViewDslMarker QuickContactBadge).() -> Unit): QuickContactBadge { + return ankoView(`$$Anko$Factories$Sdk28View`.QUICK_CONTACT_BADGE, theme = 0) { init() } +} + +fun ViewManager.themedQuickContactBadge(theme: Int = 0): QuickContactBadge = + themedQuickContactBadge(theme) {} + +inline fun ViewManager.themedQuickContactBadge( + theme: Int = 0, + init: (@AnkoViewDslMarker QuickContactBadge).() -> Unit, +): QuickContactBadge { + return ankoView(`$$Anko$Factories$Sdk28View`.QUICK_CONTACT_BADGE, theme) { init() } +} + +fun ViewManager.radioButton(): AppCompatRadioButton = radioButton {} +inline fun ViewManager.radioButton(init: (@AnkoViewDslMarker AppCompatRadioButton).() -> Unit): AppCompatRadioButton { + return ankoView(`$$Anko$Factories$Sdk28View`.RADIO_BUTTON, theme = 0) { init() } +} + +fun ViewManager.themedRadioButton(theme: Int = 0): AppCompatRadioButton = + themedRadioButton(theme) {} + +inline fun ViewManager.themedRadioButton( + theme: Int = 0, + init: (@AnkoViewDslMarker AppCompatRadioButton).() -> Unit, +): AppCompatRadioButton { + return ankoView(`$$Anko$Factories$Sdk28View`.RADIO_BUTTON, theme) { init() } +} + +fun ViewManager.ratingBar(): AppCompatRatingBar = ratingBar {} +inline fun ViewManager.ratingBar(init: (@AnkoViewDslMarker AppCompatRatingBar).() -> Unit): AppCompatRatingBar { + return ankoView(`$$Anko$Factories$Sdk28View`.RATING_BAR, theme = 0) { init() } +} + +fun ViewManager.themedRatingBar(theme: Int = 0): AppCompatRatingBar = + themedRatingBar(theme) {} + +inline fun ViewManager.themedRatingBar( + theme: Int = 0, + init: (@AnkoViewDslMarker AppCompatRatingBar).() -> Unit, +): AppCompatRatingBar { + return ankoView(`$$Anko$Factories$Sdk28View`.RATING_BAR, theme) { init() } +} + +fun ViewManager.searchView(): SearchView = searchView {} +inline fun ViewManager.searchView(init: (@AnkoViewDslMarker SearchView).() -> Unit): SearchView { + return ankoView(`$$Anko$Factories$Sdk28View`.SEARCH_VIEW, theme = 0) { init() } +} + +fun ViewManager.themedSearchView(theme: Int = 0): SearchView = + themedSearchView(theme) {} + +inline fun ViewManager.themedSearchView( + theme: Int = 0, + init: (@AnkoViewDslMarker SearchView).() -> Unit, +): SearchView { + return ankoView(`$$Anko$Factories$Sdk28View`.SEARCH_VIEW, theme) { init() } +} + +fun Context.searchView(): SearchView = searchView {} +inline fun Context.searchView(init: (@AnkoViewDslMarker SearchView).() -> Unit): SearchView { + return ankoView(`$$Anko$Factories$Sdk28View`.SEARCH_VIEW, theme = 0) { init() } +} + +fun Context.themedSearchView(theme: Int = 0): SearchView = + themedSearchView(theme) {} + +inline fun Context.themedSearchView( + theme: Int = 0, + init: (@AnkoViewDslMarker SearchView).() -> Unit, +): SearchView { + return ankoView(`$$Anko$Factories$Sdk28View`.SEARCH_VIEW, theme) { init() } +} + +fun Activity.searchView(): SearchView = searchView {} +inline fun Activity.searchView(init: (@AnkoViewDslMarker SearchView).() -> Unit): SearchView { + return ankoView(`$$Anko$Factories$Sdk28View`.SEARCH_VIEW, theme = 0) { init() } +} + +fun Activity.themedSearchView(theme: Int = 0): SearchView = + themedSearchView(theme) {} + +inline fun Activity.themedSearchView( + theme: Int = 0, + init: (@AnkoViewDslMarker SearchView).() -> Unit, +): SearchView { + return ankoView(`$$Anko$Factories$Sdk28View`.SEARCH_VIEW, theme) { init() } +} + +fun ViewManager.seekBar(): AppCompatSeekBar = seekBar {} +inline fun ViewManager.seekBar(init: (@AnkoViewDslMarker AppCompatSeekBar).() -> Unit): AppCompatSeekBar { + return ankoView(`$$Anko$Factories$Sdk28View`.SEEK_BAR, theme = 0) { init() } +} + +fun ViewManager.themedSeekBar(theme: Int = 0): AppCompatSeekBar = + themedSeekBar(theme) {} + +inline fun ViewManager.themedSeekBar( + theme: Int = 0, + init: (@AnkoViewDslMarker AppCompatSeekBar).() -> Unit, +): AppCompatSeekBar { + return ankoView(`$$Anko$Factories$Sdk28View`.SEEK_BAR, theme) { init() } +} + +//inline fun ViewManager.slidingDrawer(): android.widget.SlidingDrawer = slidingDrawer() {} +//inline fun ViewManager.slidingDrawer(init: (@AnkoViewDslMarker android.widget.SlidingDrawer).() -> Unit): android.widget.SlidingDrawer { +// return ankoView(`$$Anko$Factories$Sdk28View`.SLIDING_DRAWER, theme = 0) { init() } +//} +// +//inline fun ViewManager.themedSlidingDrawer(theme: Int = 0): android.widget.SlidingDrawer = +// themedSlidingDrawer(theme) {} +// +//inline fun ViewManager.themedSlidingDrawer( +// theme: Int = 0, +// init: (@AnkoViewDslMarker android.widget.SlidingDrawer).() -> Unit, +//): android.widget.SlidingDrawer { +// return ankoView(`$$Anko$Factories$Sdk28View`.SLIDING_DRAWER, theme) { init() } +//} +// +//inline fun Context.slidingDrawer(): android.widget.SlidingDrawer = slidingDrawer() {} +//inline fun Context.slidingDrawer(init: (@AnkoViewDslMarker android.widget.SlidingDrawer).() -> Unit): android.widget.SlidingDrawer { +// return ankoView(`$$Anko$Factories$Sdk28View`.SLIDING_DRAWER, theme = 0) { init() } +//} +// +//inline fun Context.themedSlidingDrawer(theme: Int = 0): android.widget.SlidingDrawer = +// themedSlidingDrawer(theme) {} +// +//inline fun Context.themedSlidingDrawer( +// theme: Int = 0, +// init: (@AnkoViewDslMarker android.widget.SlidingDrawer).() -> Unit, +//): android.widget.SlidingDrawer { +// return ankoView(`$$Anko$Factories$Sdk28View`.SLIDING_DRAWER, theme) { init() } +//} +// +//inline fun Activity.slidingDrawer(): android.widget.SlidingDrawer = slidingDrawer() {} +//inline fun Activity.slidingDrawer(init: (@AnkoViewDslMarker android.widget.SlidingDrawer).() -> Unit): android.widget.SlidingDrawer { +// return ankoView(`$$Anko$Factories$Sdk28View`.SLIDING_DRAWER, theme = 0) { init() } +//} +// +//inline fun Activity.themedSlidingDrawer(theme: Int = 0): android.widget.SlidingDrawer = +// themedSlidingDrawer(theme) {} +// +//inline fun Activity.themedSlidingDrawer( +// theme: Int = 0, +// init: (@AnkoViewDslMarker android.widget.SlidingDrawer).() -> Unit, +//): android.widget.SlidingDrawer { +// return ankoView(`$$Anko$Factories$Sdk28View`.SLIDING_DRAWER, theme) { init() } +//} + +fun ViewManager.space(): Space = space {} +inline fun ViewManager.space(init: (@AnkoViewDslMarker Space).() -> Unit): Space { + return ankoView(`$$Anko$Factories$Sdk28View`.SPACE, theme = 0) { init() } +} + +fun ViewManager.themedSpace(theme: Int = 0): Space = themedSpace(theme) {} +inline fun ViewManager.themedSpace( + theme: Int = 0, + init: (@AnkoViewDslMarker Space).() -> Unit, +): Space { + return ankoView(`$$Anko$Factories$Sdk28View`.SPACE, theme) { init() } +} + +fun ViewManager.spinner(): AppCompatSpinner = spinner {} +inline fun ViewManager.spinner(init: (@AnkoViewDslMarker AppCompatSpinner).() -> Unit): AppCompatSpinner { + return ankoView(`$$Anko$Factories$Sdk28View`.SPINNER, theme = 0) { init() } +} + +fun ViewManager.themedSpinner(theme: Int = 0): AppCompatSpinner = + themedSpinner(theme) {} + +inline fun ViewManager.themedSpinner( + theme: Int = 0, + init: (@AnkoViewDslMarker AppCompatSpinner).() -> Unit, +): AppCompatSpinner { + return ankoView(`$$Anko$Factories$Sdk28View`.SPINNER, theme) { init() } +} + +fun Context.spinner(): AppCompatSpinner = spinner {} +inline fun Context.spinner(init: (@AnkoViewDslMarker AppCompatSpinner).() -> Unit): AppCompatSpinner { + return ankoView(`$$Anko$Factories$Sdk28View`.SPINNER, theme = 0) { init() } +} + +fun Context.themedSpinner(theme: Int = 0): AppCompatSpinner = themedSpinner(theme) {} +inline fun Context.themedSpinner( + theme: Int = 0, + init: (@AnkoViewDslMarker AppCompatSpinner).() -> Unit, +): AppCompatSpinner { + return ankoView(`$$Anko$Factories$Sdk28View`.SPINNER, theme) { init() } +} + +fun Activity.spinner(): AppCompatSpinner = spinner {} +inline fun Activity.spinner(init: (@AnkoViewDslMarker AppCompatSpinner).() -> Unit): AppCompatSpinner { + return ankoView(`$$Anko$Factories$Sdk28View`.SPINNER, theme = 0) { init() } +} + +fun Activity.themedSpinner(theme: Int = 0): AppCompatSpinner = themedSpinner(theme) {} +inline fun Activity.themedSpinner( + theme: Int = 0, + init: (@AnkoViewDslMarker AppCompatSpinner).() -> Unit, +): AppCompatSpinner { + return ankoView(`$$Anko$Factories$Sdk28View`.SPINNER, theme) { init() } +} + +fun ViewManager.stackView(): StackView = stackView {} +inline fun ViewManager.stackView(init: (@AnkoViewDslMarker StackView).() -> Unit): StackView { + return ankoView(`$$Anko$Factories$Sdk28View`.STACK_VIEW, theme = 0) { init() } +} + +fun ViewManager.themedStackView(theme: Int = 0): StackView = + themedStackView(theme) {} + +inline fun ViewManager.themedStackView( + theme: Int = 0, + init: (@AnkoViewDslMarker StackView).() -> Unit, +): StackView { + return ankoView(`$$Anko$Factories$Sdk28View`.STACK_VIEW, theme) { init() } +} + +fun Context.stackView(): StackView = stackView {} +inline fun Context.stackView(init: (@AnkoViewDslMarker StackView).() -> Unit): StackView { + return ankoView(`$$Anko$Factories$Sdk28View`.STACK_VIEW, theme = 0) { init() } +} + +fun Context.themedStackView(theme: Int = 0): StackView = + themedStackView(theme) {} + +inline fun Context.themedStackView( + theme: Int = 0, + init: (@AnkoViewDslMarker StackView).() -> Unit, +): StackView { + return ankoView(`$$Anko$Factories$Sdk28View`.STACK_VIEW, theme) { init() } +} + +fun Activity.stackView(): StackView = stackView {} +inline fun Activity.stackView(init: (@AnkoViewDslMarker StackView).() -> Unit): StackView { + return ankoView(`$$Anko$Factories$Sdk28View`.STACK_VIEW, theme = 0) { init() } +} + +fun Activity.themedStackView(theme: Int = 0): StackView = + themedStackView(theme) {} + +inline fun Activity.themedStackView( + theme: Int = 0, + init: (@AnkoViewDslMarker StackView).() -> Unit, +): StackView { + return ankoView(`$$Anko$Factories$Sdk28View`.STACK_VIEW, theme) { init() } +} + +fun ViewManager.switch(): SwitchCompat = switch {} +inline fun ViewManager.switch(init: (@AnkoViewDslMarker SwitchCompat).() -> Unit): SwitchCompat { + return ankoView(`$$Anko$Factories$Sdk28View`.SWITCH, theme = 0) { init() } +} + +fun ViewManager.themedSwitch(theme: Int = 0): SwitchCompat = themedSwitch(theme) {} +inline fun ViewManager.themedSwitch( + theme: Int = 0, + init: (@AnkoViewDslMarker SwitchCompat).() -> Unit, +): SwitchCompat { + return ankoView(`$$Anko$Factories$Sdk28View`.SWITCH, theme) { init() } +} + +//inline fun ViewManager.tabHost(): android.widget.TabHost = tabHost() {} +//inline fun ViewManager.tabHost(init: (@AnkoViewDslMarker android.widget.TabHost).() -> Unit): android.widget.TabHost { +// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_HOST, theme = 0) { init() } +//} +// +//inline fun ViewManager.themedTabHost(theme: Int = 0): android.widget.TabHost = +// themedTabHost(theme) {} +// +//inline fun ViewManager.themedTabHost( +// theme: Int = 0, +// init: (@AnkoViewDslMarker android.widget.TabHost).() -> Unit, +//): android.widget.TabHost { +// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_HOST, theme) { init() } +//} +// +//inline fun Context.tabHost(): android.widget.TabHost = tabHost() {} +//inline fun Context.tabHost(init: (@AnkoViewDslMarker android.widget.TabHost).() -> Unit): android.widget.TabHost { +// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_HOST, theme = 0) { init() } +//} +// +//inline fun Context.themedTabHost(theme: Int = 0): android.widget.TabHost = themedTabHost(theme) {} +//inline fun Context.themedTabHost( +// theme: Int = 0, +// init: (@AnkoViewDslMarker android.widget.TabHost).() -> Unit, +//): android.widget.TabHost { +// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_HOST, theme) { init() } +//} +// +//inline fun Activity.tabHost(): android.widget.TabHost = tabHost() {} +//inline fun Activity.tabHost(init: (@AnkoViewDslMarker android.widget.TabHost).() -> Unit): android.widget.TabHost { +// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_HOST, theme = 0) { init() } +//} +// +//inline fun Activity.themedTabHost(theme: Int = 0): android.widget.TabHost = themedTabHost(theme) {} +//inline fun Activity.themedTabHost( +// theme: Int = 0, +// init: (@AnkoViewDslMarker android.widget.TabHost).() -> Unit, +//): android.widget.TabHost { +// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_HOST, theme) { init() } +//} +// +//inline fun ViewManager.tabWidget(): android.widget.TabWidget = tabWidget() {} +//inline fun ViewManager.tabWidget(init: (@AnkoViewDslMarker android.widget.TabWidget).() -> Unit): android.widget.TabWidget { +// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_WIDGET, theme = 0) { init() } +//} +// +//inline fun ViewManager.themedTabWidget(theme: Int = 0): android.widget.TabWidget = +// themedTabWidget(theme) {} +// +//inline fun ViewManager.themedTabWidget( +// theme: Int = 0, +// init: (@AnkoViewDslMarker android.widget.TabWidget).() -> Unit, +//): android.widget.TabWidget { +// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_WIDGET, theme) { init() } +//} +// +//inline fun Context.tabWidget(): android.widget.TabWidget = tabWidget() {} +//inline fun Context.tabWidget(init: (@AnkoViewDslMarker android.widget.TabWidget).() -> Unit): android.widget.TabWidget { +// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_WIDGET, theme = 0) { init() } +//} +// +//inline fun Context.themedTabWidget(theme: Int = 0): android.widget.TabWidget = +// themedTabWidget(theme) {} +// +//inline fun Context.themedTabWidget( +// theme: Int = 0, +// init: (@AnkoViewDslMarker android.widget.TabWidget).() -> Unit, +//): android.widget.TabWidget { +// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_WIDGET, theme) { init() } +//} +// +//inline fun Activity.tabWidget(): android.widget.TabWidget = tabWidget() {} +//inline fun Activity.tabWidget(init: (@AnkoViewDslMarker android.widget.TabWidget).() -> Unit): android.widget.TabWidget { +// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_WIDGET, theme = 0) { init() } +//} +// +//inline fun Activity.themedTabWidget(theme: Int = 0): android.widget.TabWidget = +// themedTabWidget(theme) {} +// +//inline fun Activity.themedTabWidget( +// theme: Int = 0, +// init: (@AnkoViewDslMarker android.widget.TabWidget).() -> Unit, +//): android.widget.TabWidget { +// return ankoView(`$$Anko$Factories$Sdk28View`.TAB_WIDGET, theme) { init() } +//} + +fun ViewManager.textClock(): TextClock = textClock {} +inline fun ViewManager.textClock(init: (@AnkoViewDslMarker TextClock).() -> Unit): TextClock { + return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_CLOCK, theme = 0) { init() } +} + +fun ViewManager.themedTextClock(theme: Int = 0): TextClock = + themedTextClock(theme) {} + +inline fun ViewManager.themedTextClock( + theme: Int = 0, + init: (@AnkoViewDslMarker TextClock).() -> Unit, +): TextClock { + return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_CLOCK, theme) { init() } +} + +fun ViewManager.textView(): AppCompatTextView = textView {} +inline fun ViewManager.textView(init: (@AnkoViewDslMarker AppCompatTextView).() -> Unit): AppCompatTextView { + return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme = 0) { init() } +} + +fun ViewManager.themedTextView(theme: Int = 0): AppCompatTextView = + themedTextView(theme) {} + +inline fun ViewManager.themedTextView( + theme: Int = 0, + init: (@AnkoViewDslMarker AppCompatTextView).() -> Unit, +): AppCompatTextView { + return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme) { init() } +} + +fun ViewManager.textView(text: CharSequence?): AppCompatTextView { + return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme = 0) { + setText(text) + } +} + +inline fun ViewManager.textView( + text: CharSequence?, + init: (@AnkoViewDslMarker AppCompatTextView).() -> Unit, +): AppCompatTextView { + return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme = 0) { + init() + setText(text) + } +} + +fun ViewManager.themedTextView(text: CharSequence?, theme: Int): AppCompatTextView { + return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme) { + setText(text) + } +} + +inline fun ViewManager.themedTextView( + text: CharSequence?, + theme: Int, + init: (@AnkoViewDslMarker AppCompatTextView).() -> Unit, +): AppCompatTextView { + return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme) { + init() + setText(text) + } +} + +fun ViewManager.textView(text: Int): AppCompatTextView { + return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme = 0) { + setText(text) + } +} + +inline fun ViewManager.textView( + text: Int, + init: (@AnkoViewDslMarker AppCompatTextView).() -> Unit, +): AppCompatTextView { + return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme = 0) { + init() + setText(text) + } +} + +fun ViewManager.themedTextView(text: Int, theme: Int): AppCompatTextView { + return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme) { + setText(text) + } +} + +inline fun ViewManager.themedTextView( + text: Int, + theme: Int, + init: (@AnkoViewDslMarker AppCompatTextView).() -> Unit, +): AppCompatTextView { + return ankoView(`$$Anko$Factories$Sdk28View`.TEXT_VIEW, theme) { + init() + setText(text) + } +} + +fun ViewManager.timePicker(): TimePicker = timePicker {} +inline fun ViewManager.timePicker(init: (@AnkoViewDslMarker TimePicker).() -> Unit): TimePicker { + return ankoView(`$$Anko$Factories$Sdk28View`.TIME_PICKER, theme = 0) { init() } +} + +fun ViewManager.themedTimePicker(theme: Int = 0): TimePicker = + themedTimePicker(theme) {} + +inline fun ViewManager.themedTimePicker( + theme: Int = 0, + init: (@AnkoViewDslMarker TimePicker).() -> Unit, +): TimePicker { + return ankoView(`$$Anko$Factories$Sdk28View`.TIME_PICKER, theme) { init() } +} + +fun Context.timePicker(): TimePicker = timePicker {} +inline fun Context.timePicker(init: (@AnkoViewDslMarker TimePicker).() -> Unit): TimePicker { + return ankoView(`$$Anko$Factories$Sdk28View`.TIME_PICKER, theme = 0) { init() } +} + +fun Context.themedTimePicker(theme: Int = 0): TimePicker = + themedTimePicker(theme) {} + +inline fun Context.themedTimePicker( + theme: Int = 0, + init: (@AnkoViewDslMarker TimePicker).() -> Unit, +): TimePicker { + return ankoView(`$$Anko$Factories$Sdk28View`.TIME_PICKER, theme) { init() } +} + +fun Activity.timePicker(): TimePicker = timePicker {} +inline fun Activity.timePicker(init: (@AnkoViewDslMarker TimePicker).() -> Unit): TimePicker { + return ankoView(`$$Anko$Factories$Sdk28View`.TIME_PICKER, theme = 0) { init() } +} + +fun Activity.themedTimePicker(theme: Int = 0): TimePicker = + themedTimePicker(theme) {} + +inline fun Activity.themedTimePicker( + theme: Int = 0, + init: (@AnkoViewDslMarker TimePicker).() -> Unit, +): TimePicker { + return ankoView(`$$Anko$Factories$Sdk28View`.TIME_PICKER, theme) { init() } +} + +fun ViewManager.toggleButton(): AppCompatToggleButton = toggleButton {} +inline fun ViewManager.toggleButton(init: (@AnkoViewDslMarker AppCompatToggleButton).() -> Unit): AppCompatToggleButton { + return ankoView(`$$Anko$Factories$Sdk28View`.TOGGLE_BUTTON, theme = 0) { init() } +} + +fun ViewManager.themedToggleButton(theme: Int = 0): AppCompatToggleButton = + themedToggleButton(theme) {} + +inline fun ViewManager.themedToggleButton( + theme: Int = 0, + init: (@AnkoViewDslMarker AppCompatToggleButton).() -> Unit, +): AppCompatToggleButton { + return ankoView(`$$Anko$Factories$Sdk28View`.TOGGLE_BUTTON, theme) { init() } +} + +//inline fun ViewManager.twoLineListItem(): android.widget.TwoLineListItem = twoLineListItem() {} +//inline fun ViewManager.twoLineListItem(init: (@AnkoViewDslMarker android.widget.TwoLineListItem).() -> Unit): android.widget.TwoLineListItem { +// return ankoView(`$$Anko$Factories$Sdk28View`.TWO_LINE_LIST_ITEM, theme = 0) { init() } +//} +// +//inline fun ViewManager.themedTwoLineListItem(theme: Int = 0): android.widget.TwoLineListItem = +// themedTwoLineListItem(theme) {} +// +//inline fun ViewManager.themedTwoLineListItem( +// theme: Int = 0, +// init: (@AnkoViewDslMarker android.widget.TwoLineListItem).() -> Unit, +//): android.widget.TwoLineListItem { +// return ankoView(`$$Anko$Factories$Sdk28View`.TWO_LINE_LIST_ITEM, theme) { init() } +//} +// +//inline fun Context.twoLineListItem(): android.widget.TwoLineListItem = twoLineListItem() {} +//inline fun Context.twoLineListItem(init: (@AnkoViewDslMarker android.widget.TwoLineListItem).() -> Unit): android.widget.TwoLineListItem { +// return ankoView(`$$Anko$Factories$Sdk28View`.TWO_LINE_LIST_ITEM, theme = 0) { init() } +//} +// +//inline fun Context.themedTwoLineListItem(theme: Int = 0): android.widget.TwoLineListItem = +// themedTwoLineListItem(theme) {} +// +//inline fun Context.themedTwoLineListItem( +// theme: Int = 0, +// init: (@AnkoViewDslMarker android.widget.TwoLineListItem).() -> Unit, +//): android.widget.TwoLineListItem { +// return ankoView(`$$Anko$Factories$Sdk28View`.TWO_LINE_LIST_ITEM, theme) { init() } +//} +// +//inline fun Activity.twoLineListItem(): android.widget.TwoLineListItem = twoLineListItem() {} +//inline fun Activity.twoLineListItem(init: (@AnkoViewDslMarker android.widget.TwoLineListItem).() -> Unit): android.widget.TwoLineListItem { +// return ankoView(`$$Anko$Factories$Sdk28View`.TWO_LINE_LIST_ITEM, theme = 0) { init() } +//} +// +//inline fun Activity.themedTwoLineListItem(theme: Int = 0): android.widget.TwoLineListItem = +// themedTwoLineListItem(theme) {} +// +//inline fun Activity.themedTwoLineListItem( +// theme: Int = 0, +// init: (@AnkoViewDslMarker android.widget.TwoLineListItem).() -> Unit, +//): android.widget.TwoLineListItem { +// return ankoView(`$$Anko$Factories$Sdk28View`.TWO_LINE_LIST_ITEM, theme) { init() } +//} + +fun ViewManager.videoView(): VideoView = videoView {} +inline fun ViewManager.videoView(init: (@AnkoViewDslMarker VideoView).() -> Unit): VideoView { + return ankoView(`$$Anko$Factories$Sdk28View`.VIDEO_VIEW, theme = 0) { init() } +} + +fun ViewManager.themedVideoView(theme: Int = 0): VideoView = + themedVideoView(theme) {} + +inline fun ViewManager.themedVideoView( + theme: Int = 0, + init: (@AnkoViewDslMarker VideoView).() -> Unit, +): VideoView { + return ankoView(`$$Anko$Factories$Sdk28View`.VIDEO_VIEW, theme) { init() } +} + +fun ViewManager.viewFlipper(): ViewFlipper = viewFlipper {} +inline fun ViewManager.viewFlipper(init: (@AnkoViewDslMarker ViewFlipper).() -> Unit): ViewFlipper { + return ankoView(`$$Anko$Factories$Sdk28View`.VIEW_FLIPPER, theme = 0) { init() } +} + +fun ViewManager.themedViewFlipper(theme: Int = 0): ViewFlipper = + themedViewFlipper(theme) {} + +inline fun ViewManager.themedViewFlipper( + theme: Int = 0, + init: (@AnkoViewDslMarker ViewFlipper).() -> Unit, +): ViewFlipper { + return ankoView(`$$Anko$Factories$Sdk28View`.VIEW_FLIPPER, theme) { init() } +} + +fun Context.viewFlipper(): ViewFlipper = viewFlipper {} +inline fun Context.viewFlipper(init: (@AnkoViewDslMarker ViewFlipper).() -> Unit): ViewFlipper { + return ankoView(`$$Anko$Factories$Sdk28View`.VIEW_FLIPPER, theme = 0) { init() } +} + +fun Context.themedViewFlipper(theme: Int = 0): ViewFlipper = + themedViewFlipper(theme) {} + +inline fun Context.themedViewFlipper( + theme: Int = 0, + init: (@AnkoViewDslMarker ViewFlipper).() -> Unit, +): ViewFlipper { + return ankoView(`$$Anko$Factories$Sdk28View`.VIEW_FLIPPER, theme) { init() } +} + +fun Activity.viewFlipper(): ViewFlipper = viewFlipper {} +inline fun Activity.viewFlipper(init: (@AnkoViewDslMarker ViewFlipper).() -> Unit): ViewFlipper { + return ankoView(`$$Anko$Factories$Sdk28View`.VIEW_FLIPPER, theme = 0) { init() } +} + +fun Activity.themedViewFlipper(theme: Int = 0): ViewFlipper = + themedViewFlipper(theme) {} + +inline fun Activity.themedViewFlipper( + theme: Int = 0, + init: (@AnkoViewDslMarker ViewFlipper).() -> Unit, +): ViewFlipper { + return ankoView(`$$Anko$Factories$Sdk28View`.VIEW_FLIPPER, theme) { init() } +} + +//inline fun ViewManager.zoomButton(): android.widget.ZoomButton = zoomButton() {} +//inline fun ViewManager.zoomButton(init: (@AnkoViewDslMarker android.widget.ZoomButton).() -> Unit): android.widget.ZoomButton { +// return ankoView(`$$Anko$Factories$Sdk28View`.ZOOM_BUTTON, theme = 0) { init() } +//} +// +//inline fun ViewManager.themedZoomButton(theme: Int = 0): android.widget.ZoomButton = +// themedZoomButton(theme) {} +// +//inline fun ViewManager.themedZoomButton( +// theme: Int = 0, +// init: (@AnkoViewDslMarker android.widget.ZoomButton).() -> Unit, +//): android.widget.ZoomButton { +// return ankoView(`$$Anko$Factories$Sdk28View`.ZOOM_BUTTON, theme) { init() } +//} +// +//inline fun ViewManager.zoomControls(): android.widget.ZoomControls = zoomControls() {} +//inline fun ViewManager.zoomControls(init: (@AnkoViewDslMarker android.widget.ZoomControls).() -> Unit): android.widget.ZoomControls { +// return ankoView(`$$Anko$Factories$Sdk28View`.ZOOM_CONTROLS, theme = 0) { init() } +//} +// +//inline fun ViewManager.themedZoomControls(theme: Int = 0): android.widget.ZoomControls = +// themedZoomControls(theme) {} +// +//inline fun ViewManager.themedZoomControls( +// theme: Int = 0, +// init: (@AnkoViewDslMarker android.widget.ZoomControls).() -> Unit, +//): android.widget.ZoomControls { +// return ankoView(`$$Anko$Factories$Sdk28View`.ZOOM_CONTROLS, theme) { init() } +//} +// +//inline fun Context.zoomControls(): android.widget.ZoomControls = zoomControls() {} +//inline fun Context.zoomControls(init: (@AnkoViewDslMarker android.widget.ZoomControls).() -> Unit): android.widget.ZoomControls { +// return ankoView(`$$Anko$Factories$Sdk28View`.ZOOM_CONTROLS, theme = 0) { init() } +//} +// +//inline fun Context.themedZoomControls(theme: Int = 0): android.widget.ZoomControls = +// themedZoomControls(theme) {} +// +//inline fun Context.themedZoomControls( +// theme: Int = 0, +// init: (@AnkoViewDslMarker android.widget.ZoomControls).() -> Unit, +//): android.widget.ZoomControls { +// return ankoView(`$$Anko$Factories$Sdk28View`.ZOOM_CONTROLS, theme) { init() } +//} +// +//inline fun Activity.zoomControls(): android.widget.ZoomControls = zoomControls() {} +//inline fun Activity.zoomControls(init: (@AnkoViewDslMarker android.widget.ZoomControls).() -> Unit): android.widget.ZoomControls { +// return ankoView(`$$Anko$Factories$Sdk28View`.ZOOM_CONTROLS, theme = 0) { init() } +//} +// +//inline fun Activity.themedZoomControls(theme: Int = 0): android.widget.ZoomControls = +// themedZoomControls(theme) {} +// +//inline fun Activity.themedZoomControls( +// theme: Int = 0, +// init: (@AnkoViewDslMarker android.widget.ZoomControls).() -> Unit, +//): android.widget.ZoomControls { +// return ankoView(`$$Anko$Factories$Sdk28View`.ZOOM_CONTROLS, theme) { init() } +//} diff --git a/anko/src/main/java/org/jetbrains/anko/appcompat/v7/SupportAlertBuilder.kt b/anko/src/main/java/org/jetbrains/anko/appcompat/v7/SupportAlertBuilder.kt index 767545ed..ce838b63 100644 --- a/anko/src/main/java/org/jetbrains/anko/appcompat/v7/SupportAlertBuilder.kt +++ b/anko/src/main/java/org/jetbrains/anko/appcompat/v7/SupportAlertBuilder.kt @@ -1,152 +1,152 @@ -/* - * Copyright 2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.anko.appcompat.v7 - -import android.content.Context -import android.content.DialogInterface -import android.graphics.drawable.Drawable -import android.view.KeyEvent -import android.view.View -import androidx.appcompat.app.AlertDialog -import org.jetbrains.anko.AlertBuilder -import org.jetbrains.anko.AlertBuilderFactory -import org.jetbrains.anko.internals.AnkoInternals -import org.jetbrains.anko.internals.AnkoInternals.NO_GETTER -import kotlin.DeprecationLevel.ERROR - -val Appcompat: AlertBuilderFactory = ::AppcompatAlertBuilder - -internal class AppcompatAlertBuilder(override val ctx: Context) : AlertBuilder { - private val builder = AlertDialog.Builder(ctx) - - override var title: CharSequence - @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() - set(value) { - builder.setTitle(value) - } - - override var titleResource: Int - @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() - set(value) { - builder.setTitle(value) - } - - override var message: CharSequence - @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() - set(value) { - builder.setMessage(value) - } - - override var messageResource: Int - @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() - set(value) { - builder.setMessage(value) - } - - override var icon: Drawable - @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() - set(value) { - builder.setIcon(value) - } - - override var iconResource: Int - @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() - set(value) { - builder.setIcon(value) - } - - override var customTitle: View - @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() - set(value) { - builder.setCustomTitle(value) - } - - override var customView: View - @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() - set(value) { - builder.setView(value) - } - - override var isCancelable: Boolean - @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() - set(value) { - builder.setCancelable(value) - } - - override fun onCancelled(handler: (DialogInterface) -> Unit) { - builder.setOnCancelListener(handler) - } - - override fun onKeyPressed(handler: (dialog: DialogInterface, keyCode: Int, e: KeyEvent) -> Boolean) { - builder.setOnKeyListener(handler) - } - - override fun positiveButton(buttonText: String, onClicked: (dialog: DialogInterface) -> Unit) { - builder.setPositiveButton(buttonText) { dialog, _ -> onClicked(dialog) } - } - - override fun positiveButton( - buttonTextResource: Int, - onClicked: (dialog: DialogInterface) -> Unit, - ) { - builder.setPositiveButton(buttonTextResource) { dialog, _ -> onClicked(dialog) } - } - - override fun negativeButton(buttonText: String, onClicked: (dialog: DialogInterface) -> Unit) { - builder.setNegativeButton(buttonText) { dialog, _ -> onClicked(dialog) } - } - - override fun negativeButton( - buttonTextResource: Int, - onClicked: (dialog: DialogInterface) -> Unit, - ) { - builder.setNegativeButton(buttonTextResource) { dialog, _ -> onClicked(dialog) } - } - - override fun neutralPressed(buttonText: String, onClicked: (dialog: DialogInterface) -> Unit) { - builder.setNeutralButton(buttonText) { dialog, _ -> onClicked(dialog) } - } - - override fun neutralPressed( - buttonTextResource: Int, - onClicked: (dialog: DialogInterface) -> Unit, - ) { - builder.setNeutralButton(buttonTextResource) { dialog, _ -> onClicked(dialog) } - } - - override fun items( - items: List, - onItemSelected: (dialog: DialogInterface, index: Int) -> Unit, - ) { - builder.setItems(Array(items.size) { i -> items[i].toString() }) { dialog, which -> - onItemSelected(dialog, which) - } - } - - override fun items( - items: List, - onItemSelected: (dialog: DialogInterface, item: T, index: Int) -> Unit, - ) { - builder.setItems(Array(items.size) { i -> items[i].toString() }) { dialog, which -> - onItemSelected(dialog, items[which], which) - } - } - - override fun build(): AlertDialog = builder.create() - - override fun show(): AlertDialog = builder.show() -} +///* +// * Copyright 2016 JetBrains s.r.o. +// * +// * Licensed under the Apache License, Version 2.0 (the "License"); +// * you may not use this file except in compliance with the License. +// * You may obtain a copy of the License at +// * +// * http://www.apache.org/licenses/LICENSE-2.0 +// * +// * Unless required by applicable law or agreed to in writing, software +// * distributed under the License is distributed on an "AS IS" BASIS, +// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// * See the License for the specific language governing permissions and +// * limitations under the License. +// */ +// +//package org.jetbrains.anko.appcompat.v7 +// +//import android.content.Context +//import android.content.DialogInterface +//import android.graphics.drawable.Drawable +//import android.view.KeyEvent +//import android.view.View +//import androidx.appcompat.app.AlertDialog +//import org.jetbrains.anko.AlertBuilder +//import org.jetbrains.anko.AlertBuilderFactory +//import org.jetbrains.anko.internals.AnkoInternals +//import org.jetbrains.anko.internals.AnkoInternals.NO_GETTER +//import kotlin.DeprecationLevel.ERROR +// +//val Appcompat: AlertBuilderFactory = ::AppcompatAlertBuilder +// +//internal class AppcompatAlertBuilder(override val ctx: Context) : AlertBuilder { +// private val builder = AlertDialog.Builder(ctx) +// +// override var title: CharSequence +// @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() +// set(value) { +// builder.setTitle(value) +// } +// +// override var titleResource: Int +// @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() +// set(value) { +// builder.setTitle(value) +// } +// +// override var message: CharSequence +// @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() +// set(value) { +// builder.setMessage(value) +// } +// +// override var messageResource: Int +// @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() +// set(value) { +// builder.setMessage(value) +// } +// +// override var icon: Drawable +// @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() +// set(value) { +// builder.setIcon(value) +// } +// +// override var iconResource: Int +// @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() +// set(value) { +// builder.setIcon(value) +// } +// +// override var customTitle: View +// @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() +// set(value) { +// builder.setCustomTitle(value) +// } +// +// override var customView: View +// @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() +// set(value) { +// builder.setView(value) +// } +// +// override var isCancelable: Boolean +// @Deprecated(NO_GETTER, level = ERROR) get() = AnkoInternals.noGetter() +// set(value) { +// builder.setCancelable(value) +// } +// +// override fun onCancelled(handler: (DialogInterface) -> Unit) { +// builder.setOnCancelListener(handler) +// } +// +// override fun onKeyPressed(handler: (dialog: DialogInterface, keyCode: Int, e: KeyEvent) -> Boolean) { +// builder.setOnKeyListener(handler) +// } +// +// override fun positiveButton(buttonText: String, onClicked: (dialog: DialogInterface) -> Unit) { +// builder.setPositiveButton(buttonText) { dialog, _ -> onClicked(dialog) } +// } +// +// override fun positiveButton( +// buttonTextResource: Int, +// onClicked: (dialog: DialogInterface) -> Unit, +// ) { +// builder.setPositiveButton(buttonTextResource) { dialog, _ -> onClicked(dialog) } +// } +// +// override fun negativeButton(buttonText: String, onClicked: (dialog: DialogInterface) -> Unit) { +// builder.setNegativeButton(buttonText) { dialog, _ -> onClicked(dialog) } +// } +// +// override fun negativeButton( +// buttonTextResource: Int, +// onClicked: (dialog: DialogInterface) -> Unit, +// ) { +// builder.setNegativeButton(buttonTextResource) { dialog, _ -> onClicked(dialog) } +// } +// +// override fun neutralPressed(buttonText: String, onClicked: (dialog: DialogInterface) -> Unit) { +// builder.setNeutralButton(buttonText) { dialog, _ -> onClicked(dialog) } +// } +// +// override fun neutralPressed( +// buttonTextResource: Int, +// onClicked: (dialog: DialogInterface) -> Unit, +// ) { +// builder.setNeutralButton(buttonTextResource) { dialog, _ -> onClicked(dialog) } +// } +// +// override fun items( +// items: List, +// onItemSelected: (dialog: DialogInterface, index: Int) -> Unit, +// ) { +// builder.setItems(Array(items.size) { i -> items[i].toString() }) { dialog, which -> +// onItemSelected(dialog, which) +// } +// } +// +// override fun items( +// items: List, +// onItemSelected: (dialog: DialogInterface, item: T, index: Int) -> Unit, +// ) { +// builder.setItems(Array(items.size) { i -> items[i].toString() }) { dialog, which -> +// onItemSelected(dialog, items[which], which) +// } +// } +// +// override fun build(): AlertDialog = builder.create() +// +// override fun show(): AlertDialog = builder.show() +//} diff --git a/anko/src/main/java/org/jetbrains/anko/buildSpanned.kt b/anko/src/main/java/org/jetbrains/anko/buildSpanned.kt index 9cbc0635..09ba18ee 100644 --- a/anko/src/main/java/org/jetbrains/anko/buildSpanned.kt +++ b/anko/src/main/java/org/jetbrains/anko/buildSpanned.kt @@ -1,93 +1,93 @@ -/* - * Copyright 2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@file:Suppress("unused", "NOTHING_TO_INLINE") -package org.jetbrains.anko - -import android.graphics.Typeface -import android.text.SpannableStringBuilder -import android.text.Spanned -import android.text.style.BackgroundColorSpan -import android.text.style.ClickableSpan -import android.text.style.ForegroundColorSpan -import android.text.style.StrikethroughSpan -import android.text.style.StyleSpan -import android.text.style.URLSpan -import android.text.style.UnderlineSpan -import android.view.View - -inline fun buildSpanned(f: SpannableStringBuilder.() -> Unit): Spanned = - SpannableStringBuilder().apply(f) - -inline val SpannableStringBuilder.Bold: StyleSpan - get() = StyleSpan(Typeface.BOLD) - -inline val SpannableStringBuilder.Italic: StyleSpan - get() = StyleSpan(Typeface.ITALIC) - -inline val SpannableStringBuilder.Underline: UnderlineSpan - get() = UnderlineSpan() - -inline val SpannableStringBuilder.Strikethrough: StrikethroughSpan - get() = StrikethroughSpan() - -inline fun SpannableStringBuilder.foregroundColor(color: Int): ForegroundColorSpan = - ForegroundColorSpan(color) - -inline fun SpannableStringBuilder.backgroundColor(color: Int): BackgroundColorSpan = - BackgroundColorSpan(color) - -inline fun SpannableStringBuilder.clickable(crossinline onClick: (View) -> Unit): ClickableSpan { - return object : ClickableSpan() { - override fun onClick(widget: View) { - onClick(widget) - } - } -} - -inline fun SpannableStringBuilder.link(url: String): URLSpan { - return URLSpan(url) -} - -fun SpannableStringBuilder.append(text: CharSequence, vararg spans: Any) { - val textLength = text.length - append(text) - spans.forEach { span -> - setSpan(span, this.length - textLength, length, Spanned.SPAN_INCLUSIVE_EXCLUSIVE) - } -} - -fun SpannableStringBuilder.append(text: CharSequence, span: Any) { - val textLength = text.length - append(text) - setSpan(span, this.length - textLength, length, Spanned.SPAN_INCLUSIVE_EXCLUSIVE) -} - -inline fun SpannableStringBuilder.append(span: Any, f: SpannableStringBuilder.() -> Unit) = apply { - val start = length - f() - setSpan(span, start, length, Spanned.SPAN_INCLUSIVE_EXCLUSIVE) -} - -inline fun SpannableStringBuilder.appendln(text: CharSequence, vararg spans: Any) { - append(text, *spans) - appendln() -} - -inline fun SpannableStringBuilder.appendln(text: CharSequence, span: Any) { - append(text, span) - appendln() -} +///* +// * Copyright 2016 JetBrains s.r.o. +// * +// * Licensed under the Apache License, Version 2.0 (the "License"); +// * you may not use this file except in compliance with the License. +// * You may obtain a copy of the License at +// * +// * http://www.apache.org/licenses/LICENSE-2.0 +// * +// * Unless required by applicable law or agreed to in writing, software +// * distributed under the License is distributed on an "AS IS" BASIS, +// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// * See the License for the specific language governing permissions and +// * limitations under the License. +// */ +// +//@file:Suppress("unused", "NOTHING_TO_INLINE") +//package org.jetbrains.anko +// +//import android.graphics.Typeface +//import android.text.SpannableStringBuilder +//import android.text.Spanned +//import android.text.style.BackgroundColorSpan +//import android.text.style.ClickableSpan +//import android.text.style.ForegroundColorSpan +//import android.text.style.StrikethroughSpan +//import android.text.style.StyleSpan +//import android.text.style.URLSpan +//import android.text.style.UnderlineSpan +//import android.view.View +// +//inline fun buildSpanned(f: SpannableStringBuilder.() -> Unit): Spanned = +// SpannableStringBuilder().apply(f) +// +//inline val SpannableStringBuilder.Bold: StyleSpan +// get() = StyleSpan(Typeface.BOLD) +// +//inline val SpannableStringBuilder.Italic: StyleSpan +// get() = StyleSpan(Typeface.ITALIC) +// +//inline val SpannableStringBuilder.Underline: UnderlineSpan +// get() = UnderlineSpan() +// +//inline val SpannableStringBuilder.Strikethrough: StrikethroughSpan +// get() = StrikethroughSpan() +// +//inline fun SpannableStringBuilder.foregroundColor(color: Int): ForegroundColorSpan = +// ForegroundColorSpan(color) +// +//inline fun SpannableStringBuilder.backgroundColor(color: Int): BackgroundColorSpan = +// BackgroundColorSpan(color) +// +//inline fun SpannableStringBuilder.clickable(crossinline onClick: (View) -> Unit): ClickableSpan { +// return object : ClickableSpan() { +// override fun onClick(widget: View) { +// onClick(widget) +// } +// } +//} +// +//inline fun SpannableStringBuilder.link(url: String): URLSpan { +// return URLSpan(url) +//} +// +//fun SpannableStringBuilder.append(text: CharSequence, vararg spans: Any) { +// val textLength = text.length +// append(text) +// spans.forEach { span -> +// setSpan(span, this.length - textLength, length, Spanned.SPAN_INCLUSIVE_EXCLUSIVE) +// } +//} +// +//fun SpannableStringBuilder.append(text: CharSequence, span: Any) { +// val textLength = text.length +// append(text) +// setSpan(span, this.length - textLength, length, Spanned.SPAN_INCLUSIVE_EXCLUSIVE) +//} +// +//inline fun SpannableStringBuilder.append(span: Any, f: SpannableStringBuilder.() -> Unit) = apply { +// val start = length +// f() +// setSpan(span, start, length, Spanned.SPAN_INCLUSIVE_EXCLUSIVE) +//} +// +//inline fun SpannableStringBuilder.appendln(text: CharSequence, vararg spans: Any) { +// append(text, *spans) +// appendln() +//} +// +//inline fun SpannableStringBuilder.appendln(text: CharSequence, span: Any) { +// append(text, span) +// appendln() +//} diff --git a/anko/src/main/java/org/jetbrains/anko/collections/Collections.kt b/anko/src/main/java/org/jetbrains/anko/collections/Collections.kt index 58842476..5e821397 100644 --- a/anko/src/main/java/org/jetbrains/anko/collections/Collections.kt +++ b/anko/src/main/java/org/jetbrains/anko/collections/Collections.kt @@ -14,7 +14,6 @@ * limitations under the License. */ -@file:Suppress("unused", "NOTHING_TO_INLINE") package org.jetbrains.anko.collections /** @@ -66,19 +65,3 @@ inline fun List.forEachReversedWithIndex(f: (Int, T) -> Unit) { i-- } } - -/** - * Convert the Android pair to a Kotlin one. - * - * @see [toAndroidPair]. - */ -@Deprecated(message = "Use the Android KTX version", replaceWith = ReplaceWith("toKotlinPair()", "androidx.core.util.toKotlinPair")) -inline fun android.util.Pair.toKotlinPair(): Pair = first to second - -/** - * Convert the Kotlin pair to an Android one. - * - * @see [toKotlinPair]. - */ -@Deprecated(message = "Use the Android KTX version", replaceWith = ReplaceWith("toAndroidPair()", "androidx.core.util.toAndroidPair")) -inline fun Pair.toAndroidPair(): android.util.Pair = android.util.Pair(first, second) diff --git a/anko/src/main/java/org/jetbrains/anko/collections/SparseArrays.kt b/anko/src/main/java/org/jetbrains/anko/collections/SparseArrays.kt deleted file mode 100644 index 0aac3c4e..00000000 --- a/anko/src/main/java/org/jetbrains/anko/collections/SparseArrays.kt +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.anko.collections - -import android.util.SparseArray -import android.util.SparseBooleanArray -import android.util.SparseIntArray -import java.util.ConcurrentModificationException - -/** - * Iterate the receiver [SparseArray] - * @action an action to invoke on each key value pair - * @throws [ConcurrentModificationException] if modified while iterating - */ -@Deprecated(message = "Use the Android KTX version", replaceWith = ReplaceWith("forEach(action)", "androidx.core.util.forEach")) -inline fun SparseArray.forEach(action: (Int, E) -> Unit) { - val size = this.size() - for (i in 0..size - 1) { - if (size != this.size()) throw ConcurrentModificationException() - action(this.keyAt(i), this.valueAt(i)) - } -} - -/** - * Iterate the receiver [SparseBooleanArray] - * @action an action to invoke on each key value pair - * @throws [ConcurrentModificationException] if modified while iterating - */ -@Deprecated(message = "Use the Android KTX version", replaceWith = ReplaceWith("forEach(action)", "androidx.core.util.forEach")) -inline fun SparseBooleanArray.forEach(action: (Int, Boolean) -> Unit) { - val size = this.size() - for (i in 0..size - 1) { - if (size != this.size()) throw ConcurrentModificationException() - action(this.keyAt(i), this.valueAt(i)) - } -} - -/** - * Iterate the receiver [SparseIntArray] - * @action an action to invoke on each key value pair - * @throws [ConcurrentModificationException] if modified while iterating - */ -@Deprecated(message = "Use the Android KTX version", replaceWith = ReplaceWith("forEach(action)", "androidx.core.util.forEach")) -inline fun SparseIntArray.forEach(action: (Int, Int) -> Unit) { - val size = this.size() - for (i in 0..size - 1) { - if (size != this.size()) throw ConcurrentModificationException() - action(this.keyAt(i), this.valueAt(i)) - } -} diff --git a/anko/src/main/java/org/jetbrains/anko/custom/Custom.kt b/anko/src/main/java/org/jetbrains/anko/custom/Custom.kt index a567565b..9b512efc 100644 --- a/anko/src/main/java/org/jetbrains/anko/custom/Custom.kt +++ b/anko/src/main/java/org/jetbrains/anko/custom/Custom.kt @@ -14,7 +14,6 @@ * limitations under the License. */ -@file:Suppress("unused") package org.jetbrains.anko.custom @@ -67,4 +66,4 @@ inline fun Context.customView(theme: Int = 0, init: T.() -> U ankoView({ ctx -> AnkoInternals.initiateView(ctx, T::class.java) }, theme) { init() } inline fun Activity.customView(theme: Int = 0, init: T.() -> Unit): T = - ankoView({ ctx -> AnkoInternals.initiateView(ctx, T::class.java) }, theme) { init() } \ No newline at end of file + ankoView({ ctx -> AnkoInternals.initiateView(ctx, T::class.java) }, theme) { init() } diff --git a/anko/src/main/java/org/jetbrains/anko/custom/Deprecated.kt b/anko/src/main/java/org/jetbrains/anko/custom/Deprecated.kt deleted file mode 100644 index 3953fc86..00000000 --- a/anko/src/main/java/org/jetbrains/anko/custom/Deprecated.kt +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@file:Suppress("unused") - -package org.jetbrains.anko.custom - -import android.content.Context -import android.view.View -import androidx.fragment.app.Fragment -import org.jetbrains.anko.AnkoAsyncContext -import org.jetbrains.anko.BackgroundExecutor -import org.jetbrains.anko.applyRecursively -import org.jetbrains.anko.collections.forEachReversedByIndex -import org.jetbrains.anko.runOnUiThread -import java.lang.ref.WeakReference -import java.util.concurrent.ExecutorService -import java.util.concurrent.Future - -@Deprecated( - "Use forEachReversedByIndex(f) instead.", - ReplaceWith( - "forEachReversedByIndex(f)", - "org.jetbrains.anko.collections.forEachReversedByIndex" - ) -) -inline fun Array.forEachReversed(f: (T) -> Unit) = forEachReversedByIndex(f) - -@Deprecated( - "Use forEachReversedByIndex(f) instead.", - ReplaceWith( - "forEachReversedByIndex(f)", - "org.jetbrains.anko.collections.forEachReversedByIndex" - ) -) -inline fun List.forEachReversed(f: (T) -> Unit) = forEachReversedByIndex(f) - -@Deprecated("Use runOnUiThread(f) instead.", ReplaceWith("runOnUiThread(f)")) -inline fun Fragment.onUiThread(crossinline f: () -> Unit) = runOnUiThread(f) - -@Deprecated("Use runOnUiThread(f) instead.", ReplaceWith("runOnUiThread(f)")) -fun Context.onUiThread(f: Context.() -> Unit) = runOnUiThread(f) - -@Deprecated("Use doAsync(task) instead.", ReplaceWith("doAsync(task)")) -fun T.async(task: AnkoAsyncContext.() -> Unit): Future { - val context = AnkoAsyncContext(WeakReference(this)) - return BackgroundExecutor.submit { context.task() } -} - -@Deprecated( - "Use doAsync(executorService, task) instead.", - ReplaceWith("doAsync(executorService, task)") -) -fun T.async( - executorService: ExecutorService, - task: AnkoAsyncContext.() -> Unit, -): Future { - val context = AnkoAsyncContext(WeakReference(this)) - return executorService.submit { context.task() } -} - -@Deprecated("Use doAsyncResult(task) instead.", ReplaceWith("doAsyncResult(task)")) -fun T.asyncResult(task: AnkoAsyncContext.() -> R): Future { - val context = AnkoAsyncContext(WeakReference(this)) - return BackgroundExecutor.submit { context.task() } -} - -@Deprecated( - "Use doAsyncResult(executorService, task) instead.", - ReplaceWith("doAsyncResult(executorService, task)") -) -fun T.asyncResult( - executorService: ExecutorService, - task: AnkoAsyncContext.() -> R, -): Future { - val context = AnkoAsyncContext(WeakReference(this)) - return executorService.submit { context.task() } -} - -@Deprecated("Use applyRecursively(block) instead.", ReplaceWith("applyRecursively(style)")) -fun T.style(style: (View) -> Unit): T = applyRecursively(style) \ No newline at end of file diff --git a/anko/src/main/java/org/jetbrains/anko/menuItemsSequences.kt b/anko/src/main/java/org/jetbrains/anko/menuItemsSequences.kt deleted file mode 100644 index 87c4add3..00000000 --- a/anko/src/main/java/org/jetbrains/anko/menuItemsSequences.kt +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@file:Suppress("unused") -package org.jetbrains.anko - -import android.view.Menu -import android.view.MenuItem -import java.util.ConcurrentModificationException -import java.util.NoSuchElementException - -@Deprecated(message = "Use the Android KTX version", replaceWith = ReplaceWith("children", "androidx.core.view.children")) -fun Menu.itemsSequence(): Sequence = MenuItemsSequence(this) - -private class MenuItemsSequence(private val menu: Menu) : Sequence { - override fun iterator(): Iterator = MenuItemIterator(menu) - - private class MenuItemIterator(private val menu: Menu) : Iterator { - private var index = 0 - private val count = menu.size() - - override fun next(): MenuItem { - if (!hasNext()) { - throw NoSuchElementException() - } - - return menu.getItem(index++) - } - - override fun hasNext(): Boolean { - if (count != menu.size()) { - throw ConcurrentModificationException() - } - - return index < count - } - } -} diff --git a/anko/src/main/java/org/jetbrains/anko/viewChildrenSequences.kt b/anko/src/main/java/org/jetbrains/anko/viewChildrenSequences.kt index c48239ad..1650e7d9 100644 --- a/anko/src/main/java/org/jetbrains/anko/viewChildrenSequences.kt +++ b/anko/src/main/java/org/jetbrains/anko/viewChildrenSequences.kt @@ -13,43 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -@file:Suppress("unused") - package org.jetbrains.anko import android.view.View import android.view.ViewGroup - -/** - * Execute [action] for each child of the received [ViewGroup]. - * - * @param action the action to execute. - */ -@Deprecated( - message = "Use the Android KTX version", - replaceWith = ReplaceWith("forEach(action)", "androidx.core.view.forEach") -) -inline fun ViewGroup.forEachChild(action: (View) -> Unit) { - for (i in 0..childCount - 1) { - action(getChildAt(i)) - } -} - -/** - * Execute [action] for each child of the received [ViewGroup]. - * - * @param action the action to execute. The first index is 0. - */ -@Deprecated( - message = "Use the Android KTX version", - replaceWith = ReplaceWith("forEachIndexed(action)", "androidx.core.view.forEachIndexed") -) -inline fun ViewGroup.forEachChildWithIndex(action: (Int, View) -> Unit) { - for (i in 0..childCount - 1) { - action(i, getChildAt(i)) - } -} +import androidx.core.view.children /** * Return the first child [View] matching the given [predicate]. @@ -70,7 +38,7 @@ inline fun ViewGroup.firstChild(predicate: (View) -> Boolean): View { * @return the child [View] that matches [predicate], or null if no such child was found. */ inline fun ViewGroup.firstChildOrNull(predicate: (View) -> Boolean): View? { - for (i in 0..childCount - 1) { + for (i in 0 until childCount) { val child = getChildAt(i) if (predicate(child)) { return child @@ -79,18 +47,6 @@ inline fun ViewGroup.firstChildOrNull(predicate: (View) -> Boolean): View? { return null } -/** - * Return the sequence of children of the received [View]. - * Note that the sequence is not thread-safe. - * - * @return the [Sequence] of children. - */ -@Deprecated( - message = "Use the Android KTX version", - replaceWith = ReplaceWith("children", "androidx.core.view.children") -) -fun View.childrenSequence(): Sequence = ViewChildrenSequence(this) - /** * Return the [Sequence] of all children of the received [View], recursively. * Note that the sequence is not thread-safe. @@ -132,14 +88,15 @@ private class ViewChildrenRecursiveSequence(private val view: View) : Sequence { - private val sequences = arrayListOf(view.childrenSequence()) + + private val sequences = arrayListOf((view as? ViewGroup)?.children ?: sequenceOf(view)) private var current = sequences.removeLast().iterator() override fun next(): View { if (!hasNext()) throw NoSuchElementException() val view = current.next() if (view is ViewGroup && view.childCount > 0) { - sequences.add(view.childrenSequence()) + sequences.add(view.children) } return view } diff --git a/app/build.gradle b/app/build.gradle index d2192b10..c16c0e80 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -58,14 +58,17 @@ android { buildTypes { release { - minifyEnabled false - shrinkResources false + minifyEnabled true + shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' lintOptions { disable 'MissingTranslation' } } + debug{ + + } } // Specifies comma-separated list of flavor dimensions. @@ -137,7 +140,8 @@ dependencies { implementation project(':anko') implementation fileTree(include: ['*.aar'], dir: 'src/main/libs') - implementation "org.conscrypt:conscrypt-openjdk-uber:$conscryptVersion" + // implementation "org.conscrypt:conscrypt-android:$conscryptVersion" + api "org.conscrypt:conscrypt-android:$conscryptVersion" kapt "androidx.annotation:annotation:$androidxAnnotationVersion" kapt "androidx.room:room-compiler:$roomVersion" diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 641439f1..afae16cc 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -41,7 +41,7 @@ -dontobfuscate -keepattributes *Annotation*, InnerClasses --dontnote kotlinx.serialization.AnnotationsKt # core serialization annotations +#-dontnote kotlinx.serialization.AnnotationsKt # core serialization annotations # kotlinx-serialization-json specific. Add this if you have java.lang.NoClassDefFoundError kotlinx.serialization.json.JsonObjectSerializer -keepclassmembers class kotlinx.serialization.json.** { @@ -59,3 +59,7 @@ -keepclasseswithmembers class jp.juggler.subwaytooter.** { kotlinx.serialization.KSerializer serializer(...); } + +# keep everything +-keep class ** { *; } +-keepclassmembers class ** { *** Companion; } diff --git a/base/build.gradle b/base/build.gradle index 09c6e06d..745cca30 100644 --- a/base/build.gradle +++ b/base/build.gradle @@ -94,7 +94,7 @@ dependencies { api "commons-codec:commons-codec:1.15" api "io.github.inflationx:calligraphy3:3.1.1" api "io.github.inflationx:viewpump:2.0.3" - api "org.bouncycastle:bcpkix-jdk15on:1.70" + api "org.bouncycastle:bcprov-jdk15on:1.70" api "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion" api "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinxCoroutinesVersion" api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion" @@ -151,6 +151,5 @@ dependencies { // conscrypt をUnitテストするための指定 // https://github.com/google/conscrypt/issues/649 - compileOnly "org.conscrypt:conscrypt-openjdk-uber:$conscryptVersion" - testImplementation "org.conscrypt:conscrypt-openjdk-uber:$conscryptVersion" + api "org.conscrypt:conscrypt-android:$conscryptVersion" } diff --git a/base/src/test/java/jp/juggler/WebPushCryptTest.kt b/base/src/androidTest/java/jp/juggler/WebPushCryptTest.kt similarity index 99% rename from base/src/test/java/jp/juggler/WebPushCryptTest.kt rename to base/src/androidTest/java/jp/juggler/WebPushCryptTest.kt index 4423eecf..744487ca 100644 --- a/base/src/test/java/jp/juggler/WebPushCryptTest.kt +++ b/base/src/androidTest/java/jp/juggler/WebPushCryptTest.kt @@ -1,14 +1,17 @@ package jp.juggler +import androidx.test.ext.junit.runners.AndroidJUnit4 import jp.juggler.crypt.* import jp.juggler.util.data.decodeBase64 import jp.juggler.util.data.decodeJsonObject import jp.juggler.util.log.AdbLog import org.junit.Assert.* import org.junit.Test +import org.junit.runner.RunWith import java.security.interfaces.ECPrivateKey @Suppress("SpellCheckingInspection") +@RunWith(AndroidJUnit4::class) class WebPushCryptTest { // https://developers.google.com/web/updates/2016/03/web-push-encryption diff --git a/base/src/main/java/jp/juggler/crypt/CryptUtils.kt b/base/src/main/java/jp/juggler/crypt/CryptUtils.kt index 9d9a057d..625dc94c 100644 --- a/base/src/main/java/jp/juggler/crypt/CryptUtils.kt +++ b/base/src/main/java/jp/juggler/crypt/CryptUtils.kt @@ -12,6 +12,7 @@ import java.security.spec.ECGenParameterSpec import java.security.spec.ECPrivateKeySpec import java.security.spec.ECPublicKeySpec import java.security.spec.PKCS8EncodedKeySpec +import java.util.* import javax.crypto.KeyAgreement import javax.crypto.Mac import javax.crypto.spec.SecretKeySpec