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
| class CounterTextView: AppCompatTextView() { | |
| private var startValue = 0 | |
| private var endValue = 0 | |
| private var duration = 1200 | |
| private var format = "%d" | |
| private var interpolator: TimeInterpolator? = null |
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
| var count: Int? = null | |
| count = count?.dec() ?: 0 | |
| println(count) | |
| Result: 0 |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
| package="com.ingloriousengineers.androidsample"> | |
| <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |
| <uses-permission android:name="android.permission.INTERNET" /> | |
| <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> | |
| <application | |
| android:allowBackup="true" |
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
| fun main(args: Array<String>) { | |
| var myString = "Not empty" | |
| if( myString != "") { | |
| println("is not empty") | |
| } else { | |
| println("is empty") | |
| } | |
| val result = if(myString != "") { |
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
| fun main(args: Array<String>) { | |
| val cities = listOf("Mumbai", "pune", "kolhpur", "delhi", "banglore") | |
| for(city in cities ) { | |
| println(city) | |
| } | |
| for(a in 1..10) { | |
| println(a) | |
| } | |
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.example.sachinsandbhor.rxjavasamplecode; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.os.Bundle; | |
| import android.util.Log; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import io.reactivex.Observable; |
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
| Observable.just("1", "2", "3,","4", "hello", "This", "is", "Sample", "program") | |
| .subscribeOn(Schedulers.io()) | |
| .observeOn(AndroidSchedulers.mainThread()) | |
| .subscribe(new Observer<String>() { | |
| @Override | |
| public void onSubscribe(Disposable d) { | |
| } | |
| @Override |
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.example.sachinsandbhor.rxjavasamplecode; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.os.Bundle; | |
| import android.util.Log; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import io.reactivex.Observable; |
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.example.sachinsandbhor.rxjavasamplecode; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.os.Bundle; | |
| import android.util.Log; | |
| import io.reactivex.Observable; | |
| import io.reactivex.Observer; | |
| import io.reactivex.android.schedulers.AndroidSchedulers; | |
| import io.reactivex.disposables.CompositeDisposable; |
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.example.sachinsandbhor.rxjavasamplecode; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.os.Bundle; | |
| import android.util.Log; | |
| import io.reactivex.Observable; | |
| import io.reactivex.Observer; | |
| import io.reactivex.android.schedulers.AndroidSchedulers; | |
| import io.reactivex.disposables.Disposable; |
NewerOlder