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
| textView.setMovementMethod(LinkMovementMethod.getInstance()); | |
| textView.setText(new Truss() | |
| .append("Click Me!", new Snippety.OnClickListener() { | |
| @Override | |
| public void onClick() { | |
| Toast.makeText(getContext(), "Oooh it tickles!", Toast.LENGTH_SHORT).show(); | |
| } | |
| }) | |
| .build()); |
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
| /** | |
| * initialize all resources | |
| * set current page to 1 | |
| * create paginator and subscribe to events | |
| */ | |
| override fun initialize() { | |
| currentPage = 1 // set page = 1 | |
| paginator = PublishProcessor.create() // create PublishProcessor | |
| val d = paginator.onBackpressureDrop() |
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
| /** | |
| * @param recyclerView RecyclerView to bind to RecyclerViewScrollCallback | |
| * @param visibleThreshold The minimum number of items to have below your current scroll position before loading more. | |
| * @param resetLoadingState Reset endless scroll listener when performing a new search | |
| * @param onScrolledListener OnScrolledListener for RecyclerView scrolled | |
| */ | |
| @BindingAdapter(value = *arrayOf("visibleThreshold", "resetLoadingState", "onScrolledToBottom"), requireAll = false) | |
| fun setRecyclerViewScrollCallback(recyclerView: RecyclerView, visibleThreshold: Int, resetLoadingState: Boolean, | |
| onScrolledListener: RecyclerViewScrollCallback.OnScrolledListener) { |
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
| /** | |
| * @param swipeRefreshLayout Bind swipeRefreshLayout with OnRefreshListener | |
| * @param onRefresh Listener for onRefresh when swiped | |
| */ | |
| @BindingAdapter("onPulledToRefresh") | |
| fun setOnSwipeRefreshListener(swipeRefreshLayout: SwipeRefreshLayout, onPulledToRefresh: Runnable) { | |
| swipeRefreshLayout.setOnRefreshListener { onPulledToRefresh.run() } | |
| } |
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
| <android.support.v4.widget.SwipeRefreshLayout | |
| android:id="@+id/srl" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| bind:onPulledToRefresh="@{() -> presenter.initialize()}"> | |
| <android.support.v7.widget.RecyclerView | |
| android:id="@+id/rv" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" |
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.fueled.collapsingnotifications.util | |
| /** | |
| * Copyright (c) 2017 Fueled. All rights reserved. | |
| * | |
| * @author chetansachdeva on 22/09/17 | |
| */ | |
| class MultiValuedMap<K, V> { |
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
| @Reusable | |
| class CollapsingNotificationManager @Inject | |
| constructor(private val collapsingNotificationStore: CollapsingNotificationStore) { | |
| private val collapsingNotifications = getCollapsingNotifications() | |
| /** | |
| * get notifications to collapse | |
| */ | |
| fun getNotificationsToCollapse(data: Map<String, String>): List<Int>? { |
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
| public class LoginModel extends BaseObservable { | |
| private String email; | |
| private String password; | |
| private boolean loginEnabled; | |
| @Bindable | |
| public String getEmail() { | |
| return email; | |
| } |
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"?> | |
| <layout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| xmlns:tools="http://schemas.android.com/tools"> | |
| <data> | |
| <variable | |
| name="model" | |
| type="com.fueled.loginbindings.LoginModel"/> | |
| <variable |
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
| public interface MainHandler { | |
| void onLoginClicked(String email, String password); | |
| } |