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
val testPublisher = PublishSubject.create<String>() | |
var value:String = "initial" | |
fun myRxFunction(ioThread:Scheduler,mainThread:Scheduler){ | |
testPublisher | |
.subscribeOn(ioThread) | |
.observeOn(mainThread) | |
.subscribe{ | |
saveString(it) |
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
val testPublisher = PublishSubject.create<String>() | |
var value:String = "initial" | |
fun myRxFunction(ioThread:Scheduler,mainThread:Scheduler){ | |
testPublisher | |
.subscribeOn(ioThread) | |
.observeOn(mainThread) | |
.subscribe{ | |
saveString(it) |
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
val TAG = StaticSampleActivity::class.simpleName | |
class StaticSampleActivity: Activity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
Log.i(TAG,"I am in Logcat!!") | |
} | |
} |
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
import my.package.CONSTANT1 | |
import my.package.utility1 | |
class TestClass{ | |
fun func1() = CONSTANT1 | |
fun func2() = utility1() | |
} |
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
fun utility1() = "do some stuff!" | |
fun utility2() = "do some other stuff!" |
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
const val CONSTANT1 = "CONSTANT1" | |
const val CONSTANT2 = "CONSTANT2" |
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
new Fabulous.Builder(this) | |
.setFab(binding.exampleTwo) | |
.setMenuId(R.menu.menu_sample) | |
.setMenuPattern(new CirclePattern()) | |
.setFabTransition(new NinetyDegRotationTransition()) | |
.setFABOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Analytics.trackEvent("menu_clicked"); | |
} |
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
new Fabulous.Builder(this) | |
.setFab(binding.exampleTwo) | |
.setMenuId(R.menu.menu_sample) | |
.setMenuPattern(new CirclePattern()) | |
.setFabTransition(new NinetyDegRotationTransition()) | |
.build(); |
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 class NinetyDegRotationTransition implements FabulousTransition { | |
private static final int MAIN_FAB_ANIMATION_DURATION = 200; | |
@NotNull | |
@Override | |
public AnimatorSet getClosingAnimation(@NotNull View element, float destX, float destY) { | |
AnimatorSet anim = new AnimatorSet(); | |
ObjectAnimator fabX = ObjectAnimator.ofFloat(element, View.ROTATION, 0); | |
fabX.setDuration(MAIN_FAB_ANIMATION_DURATION); | |
anim.play(fabX); |
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
new Fabulous.Builder(this) | |
.setFab(binding.exampleOne) | |
.setFabOverlay(findViewById(R.id.overlay)) | |
.setMenuId(R.menu.menu_sample) | |
.setMenuPattern(new LinearPattern()) | |
.build(); |
NewerOlder