Pradyumna
05/07/2018, 11:09 AMSlackbot
05/09/2018, 12:38 AMjfelrod1960
05/09/2018, 8:50 PMamanda.hinchman-dominguez
05/10/2018, 2:18 AM// Replace contents of a view invoked by the layout manager
(no override) fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
holder as ImageViewHolder
holder.bindView(position)
}
kikebodi
05/10/2018, 3:40 PMLukas Anda
05/11/2018, 10:34 AMrCorbellini
05/11/2018, 1:48 PMkenkyee
05/11/2018, 10:32 PMarekolek
05/12/2018, 7:59 PMandroid.databinding.ViewDataBinding#setLifecycleOwner
that doesn't have a corresponding getter, which means that we can't use property access syntax, unless https://youtrack.jetbrains.com/issue/KT-6519 is resolved.samp
05/12/2018, 8:36 PMyuvraj24
05/13/2018, 5:40 AMFilip Husnjak
05/13/2018, 10:01 AMpublic interface Callback {
void onSuccess(Class item);
void onError(Error error);
}
I was thinking of replacing this callback with a closure instead and my question is if it is better to add two closure parameters or to just have one? Is there a best practice for this?
Ex:
onSuccess: (item: Class) -> Unit, onError: (error: Error) -> Unit
OR
callback: (item: Class, error: Error) -> Unit
/Thankskioba
05/14/2018, 9:47 AM@Nullable
annotation on the getActivity()
and getContext()
in the android SDK 27 changes ? Personally I’m not keen to spread the nullable context all around the app.w_bianrytree
05/14/2018, 10:23 AMpreprodDebugImplementation
.
Anyone knows why?
Error:(96, 0) Could not find method preprodDebugImplementation() for arguments [] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Thanks!sindrenm
05/14/2018, 11:34 AMView
in android-ktx? I find the getters really handy and readable, but the setters feel “imbalanced” and not thought through:
inline var View.isVisible: Boolean
get() = visibility == View.VISIBLE
set(value) {
visibility = if (value) View.VISIBLE else View.GONE
}
inline var View.isInvisible: Boolean
get() = visibility == View.INVISIBLE
set(value) {
visibility = if (value) View.INVISIBLE else View.VISIBLE
}
inline var View.isGone: Boolean
get() = visibility == View.GONE
set(value) {
visibility = if (value) View.GONE else View.VISIBLE
}
In my opinion, saying button.isVisible = false
in Android doesn't really make sense because of the difference between View.INVISIBLE
and View.GONE
. What do you guys think?Znkenza
05/14/2018, 11:48 AMrkeazor
05/15/2018, 2:21 AMDarshan Mistry
05/15/2018, 5:17 AMoleksiyp
05/15/2018, 9:21 PMdamian
05/15/2018, 9:21 PMkotlinx.android
synthetic extensions lately... I would say that they're just unresolved 80% of the time, which makes editing very difficult. I keep looking at the bug tracker but haven't seen any issues... is this a known or common problem? Has it been fixed in a recent update to something that I'm not aware of? Currently on AS 3.1.2 w/ Kotlin plugin 1.2.41-release-Studio3.1-1
of the plugin 😕sudhanshu singh
05/16/2018, 8:24 AMclass UserManager private constructor() {
private object Holder {
val INSTANCE = UserManager()
}
var currentUser: UserModel? = null
private set
companion object {
val instance: UserManager by lazy { Holder.
and I want to use this in xml for databinding, but the following gives
android:text="UserManager.Companion.getInstance().getCurrentUser()}
error: Could not find accessor for UserManager.Companion.
paras
05/16/2018, 9:17 AMadams2
05/16/2018, 4:24 PMsudhanshu singh
05/17/2018, 11:05 AMval isEmpty: Boolean
get() = this.size == 0
val isEmpty = this.size==0
nickk
05/18/2018, 9:37 AMcompile
with implementation
in my Gradle build files and now I am getting this cryptic error:
Internal compiler error. See log for more details
Caused by: java.lang.AssertionError: annotation tree hasn't been attributed yet: @kotlin.Metadata(mv = {1, 1, 10}, bv = {1, 0, 2}, k = 1, d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\u0018\u00002\u00020\u0001B\u0005\u00a2\u0006\u0002\u0010\u0002J\b\u0010\u0003\u001a\u00020\u0004H\u0016\u00a8\u0006\u0005"}, d2 = {"Lgr/test/fieldobservations/ui/LocationPickerExt;", "Lgr/test/ui/LocationPicker;", "()V", "createAnnotations", "", "app_debug"})
Any idea? (using AS 3.1, Kotlin 1.2.41)
This seems to be related to kapt.ghedeon
05/18/2018, 2:44 PMhttps://i.imgur.com/QzedJhB.png▾
https://i.imgur.com/Bdg931e.gif▾
Generate Synthetic
action is added, that imports ids from layout file with alias that can be edited to your taste. Also, it can be configured to convert underscore to camelCase.
Now, the real question is, would it benefit anyone or I'm solving nonexistent problem?)Ronald Daugherty
05/18/2018, 3:06 PMDarius Morar
05/18/2018, 5:58 PMpga4711
05/18/2018, 9:20 PMhenrytao
05/20/2018, 1:55 AMval liveData: MutableLiveDataBoolean = MutableLiveData()
liveData
.distinct()
.filter { it == false }
.map { true }
.nonNull()
.observe(lifecycleOwner, { result ->
// result is non-null and always true
})
Check it out: https://medium.com/@henrytao/chaining-livedata-like-rxjava-with-kotlin-extension-e3a2c15ac11