fun TextView.breakLetter() {
// original Text
var processingString = text.toString()
var availableLetterCount = 0
val stringBuilder = StringBuilder()
while (availableLetterCount < processingString.length) {
availableLetterCount =
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kotlinx.coroutines.* | |
import kotlinx.coroutines.flow.* | |
fun main(){ | |
runBlocking { | |
println("main started") | |
val normalFlow = flow { | |
println("Flow starts emit") | |
emit(10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override suspend fun collect(collector: FlowCollector<T>) { | |
val slot = allocateSlot() | |
try { | |
if (collector is SubscribedFlowCollector) collector.onSubscription() | |
val collectorJob = currentCoroutineContext()[Job] | |
var oldState: Any? = null // previously emitted T!! | NULL (null -- nothing emitted yet) | |
// The loop is arranged so that it starts delivering current value without waiting first | |
while (true) { | |
// Here the coroutine could have waited for a while to be dispatched, | |
// so we use the most recent state here to ensure the best possible conflation of stale values |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
/// This Widget is the main application widget. | |
class MyApp extends StatelessWidget { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
theme: ThemeData( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
theme: ThemeData( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
print("main started"); | |
requestApi().then((result) { | |
print(result); | |
}); | |
print("main finished"); | |
} | |
Future<String> requestApi() async { | |
return "result"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math'; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
μλλ‘μ΄λ 7.1 (25) μ΄μμμ, μ±μ λν λ°λ‘κ°κΈ° λ₯Ό μ€μ κ°λ₯ν©λλ€. μ¬μ©νλ λ°μ²μμ νμλ©λλ€. μμ£Ό μ¬μ©νλ μμ μ΄λ κΆμ₯λλ μμ μ 빨리 μ κ·Ό ν μ μκ² ν΄μ€λλ€. (Works λμλμ΄ μμ΅λλ€.)
κΎΉ λλ¬μ νμ κ°λ₯νλ°, κΈ°μ‘΄μ UX μ κ²Ήμ³μ μ¬λλ€μ΄ λ§μ΄ μ°λλ°λ μκ°μ΄ 걸릴 λ― ν©λλ€.
κ° λ°λ‘κ°κΈ°λ νκ° λλ μ¬λ¬κ°μ intent
λ₯Ό κ°μ§κ³ μμ΅λλ€. ν΄λΉ intent λ‘ μ΄λ€ μμ
μ νκ² ν μ§ μ ν μ μμ΅λλ€.
- μ§λμμ νΉμ μμΉλ‘ λ°λ‘ μ΄λ
- μΉκ΅¬μκ² λ©μμ§ λ³΄λ΄κΈ°
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.foo.ui.view; | |
import android.content.Context; | |
import android.support.v4.view.ViewPager; | |
import android.util.AttributeSet; | |
import android.view.View; | |
/** | |
* Created by fdoyle on 11/2/15. | |
*/ |