This file contains 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
public static String getDate(String time) { | |
DateFormat utcFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.ENGLISH); | |
utcFormat.setTimeZone(TimeZone.getTimeZone("UTC")); | |
try { | |
Date date = utcFormat.parse(time); | |
long timeDiff = System.currentTimeMillis() - date.getTime(); | |
if (timeDiff < 86400000) { | |
if (timeDiff < 60) { | |
return "Just now"; |
This file contains 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
//In this example the value 'a' is written to the console: | |
fun BehaviorSubjectExample(){ | |
//Need to provide a default value. | |
var subject = new BehaviorSubject<string>("a") | |
subject.Subscribe(println(it)) | |
} | |
//In this example the value 'b' is written to the console, but not 'a'. | |
fun BehaviorSubjectExample2(){ | |
var subject = new BehaviorSubject<string>("a") |
This file contains 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
//In this example no values will be published as the sequence never completes. No values will be written to the console. | |
fun asyncSubjectExample1(){ | |
var subject = new AsyncSubject<string>() | |
subject.onNext("a") | |
subject.onNext("b") | |
subject.onNext("c") | |
subject.subscribe(println(it)) | |
} | |
//In this example we invoke the OnCompleted method so the last value 'c' is written to the console: |
This file contains 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
<activity | |
android:name="com.beebom.app.BeebomActivity" | |
android:label="@string/title_beebom" > | |
<intent-filter android:label="@string/filter_view_posts_beebom"> | |
<action android:name="android.intent.action.VIEW" /> | |
<category android:name="android.intent.category.DEFAULT" /> | |
<category android:name="android.intent.category.BROWSABLE" /> | |
<!-- Accepts URIs that begin with "https://app.beebom.com/posts" --> | |
<data android:scheme="https" | |
android:host="app.beebom.com" |
This file contains 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
class RelaySubjectExampleBuffer { | |
fun main(args : Array<String>){ | |
val bufferSize = 2 | |
val subject = RelaySubject<String>(bufferSize) | |
val myObserver = MyObserver() | |
subject.onNext("a") | |
subject.onNext("b") | |
subject.onNext("c") | |
subject.subscribe(myObserver) | |
subject.onNext("d") |
This file contains 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
class RelaySubjectExample1 { | |
fun main(args : Array<String>){ | |
val subject = RelaySubject<String>() | |
val myObserver = MyObserver() | |
subject.onNext("a") | |
subject.subscribe(myObserver) | |
subject.onNext("b") | |
subject.onNext("c") | |
subject.onComplete() | |
} |
This file contains 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
class RxSubjectExample2 { | |
fun main(args : Array<String>){ | |
val subject = Subject<String>() | |
val myObserver = MyObserver() | |
subject.onNext("a") | |
subject.subscribe(myObserver) | |
subject.onNext("b") | |
subject.onNext("c") | |
subject.onComplete() |
This file contains 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
class RxSubjectExample { | |
fun main(args : Array<String>){ | |
val subject = Subject<String>() | |
val myObserver = MyObserver() | |
subject.subscribe(myObserver) | |
subject.onNext("a") | |
subject.onNext("b") | |
subject.onNext("c") | |
subject.onComplete() |
This file contains 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
class ObservableObserverExample { | |
fun main(args : Array<String>){ | |
val myObserver = MyObserver() | |
val myObservable = MyObservable() | |
myObservable.subscribe(myObserver) | |
} | |
class MyObserver : Observer<String>{ | |
override fun onComplete() { |
This file contains 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
{ | |
"org.moire.opensudoku.gui.inputmethod.IMControlPanel$1":{ | |
"onCellTapped":{ | |
"action": "LOG" | |
} | |
}, | |
"org.moire.opensudoku.gui.inputmethod.IMControlPanel":{ | |
"easterEgg":{ | |
"action": "TRY_CATCH" | |
} |