Paul Woitaschek
11/14/2018, 2:59 PMuhe
11/14/2018, 3:07 PMjishindev
11/15/2018, 4:22 PMdylan
11/16/2018, 9:49 AMapp:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
already look in androidx.databinding:databinding-adapters
but its not thereCamilleBC
11/16/2018, 1:05 PMfun init(application: Application) {//do stuff}
or is there a better way?jurajsolarml
11/16/2018, 3:32 PMigor.wojda
11/17/2018, 11:29 PMPaul Woitaschek
11/18/2018, 7:58 AMPaul Woitaschek
11/18/2018, 12:39 PMSudhir Singh Khanger
11/19/2018, 8:53 AMLG
11/19/2018, 3:50 PMval listener = {
lottieAnimationView.viewTreeObserver.removeOnGlobalLayoutListener(listener) <<<---- here's the problem
}
lottieAnimationView.viewTreeObserver.addOnGlobalLayoutListener(listener)
Can anybody help on this please ?Jake
11/19/2018, 4:37 PMMainActivity implements RxViewDispatch
and catches store changes. On a store change I'm trying to update a single fragment that seemingly cannot listen to the store for changes. Is there a succinct way to broadcast from MainActivity.java to the single Fragment.java class to preform a visual update using the store changes?MrNiamh
11/19/2018, 8:56 PMjurajsolarml
11/20/2018, 8:35 AMsaurabha5
11/20/2018, 1:02 PMSteven McLaughlin
11/20/2018, 2:59 PMneuber
11/21/2018, 7:55 PMMike Palarz
11/21/2018, 10:58 PMfun fetchCharacterData(): Deferred<CharacterGenerator.CharacterData> {
return GlobalScope.async(Dispatchers.Default) {
val apiData = URL(CHARACTER_DATA_ENDPOINT).readText()
CharacterGenerator.fromApiData(apiData)
}
}
Then, in my main activity, I do the following within `onCreate()`:
generateButton.setOnClickListener {
GlobalScope.launch(Dispatchers.Main){
characterData = fetchCharacterData().await()
displayCharacterData()
}
}
However, I am getting an ANR whenever the button is pressed. I also get a very vague error message in logcat: FATAL EXCEPTION: main.
Would anyone have any insight as to what the issue could be?Sergio Crespo Toubes
11/22/2018, 10:14 AMMassimo Carli
11/22/2018, 11:36 AM@ExperimentalContracts
inline fun runIfGranted(context: Context, permission: String, fn: () -> Unit) {
contract { returns(true) implies WHAT'S HERE? }
if (ContextCompat.checkSelfPermission(
context,
permission
) == PackageManager.PERMISSION_GRANTED
) {
fn()
}
}
. In order to remove the IntelliJ warning, I could use the @SuppressLint("MissingPermission")
but I think that a contract would be the right solution. In that case, what should I put in the comment in the previous code in place of the literal true
?dave08
11/22/2018, 12:49 PMval foo: String = prefs.getString("foo", "") ?: ""
?Neal Sanche
11/23/2018, 9:25 PM@delegate:Transient
, but in the end, removed the 'by lazy' in favour of a Getter. Thanks for any advice or clarification.kim00123
11/24/2018, 10:06 AMHarun
11/25/2018, 7:42 AMigor.wojda
11/26/2018, 9:15 AMigor.wojda
11/26/2018, 12:27 PMDebouncedOnClickListener.java
https://gist.github.com/rfreedman/5573388 - this should be a good start for mejurajsolarml
11/26/2018, 3:27 PMMike Palarz
11/26/2018, 4:53 PMdan.the.man
11/26/2018, 7:11 PMAny
not work for any generic? I have code that's
Expected : <http://Request.POST|Request.POST><Any, O>
Actual: <http://Request.POST|Request.POST><I, O>
and that's causing me some issuesDanshima
11/27/2018, 2:03 PMDanshima
11/27/2018, 2:03 PMgildor
11/27/2018, 4:48 PMjcminarro
11/27/2018, 5:54 PM