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 android.support.annotation.IdRes | |
import android.support.v7.widget.SearchView | |
import android.support.v7.widget.Toolbar | |
import android.view.MenuItem | |
@DslMarker | |
annotation class ToolbarSearchDsl | |
@ToolbarSearchDsl |
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 android.graphics.Canvas | |
import android.support.v7.widget.RecyclerView | |
import android.support.v7.widget.helper.ItemTouchHelper | |
import android.support.v7.widget.helper.ItemTouchHelper.* | |
import android.view.View | |
abstract class GenericSwipeCallback( | |
private var swipeLeft: SwipeAction? = null, | |
private var swipeRight: SwipeAction? = null | |
) : ItemTouchHelper.Callback() { |
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
object WebSocket : WebSocketListener() { | |
private lateinit var broadcaster: FlowableEmitter<String> | |
private lateinit var disposable: Disposable | |
private lateinit var webSocket: WebSocket | |
private val flowable = Flowable.create(FlowableOnSubscribe<String> { emitter -> broadcaster = emitter }, BackpressureStrategy.BUFFER) | |
fun subscribe(): Flowable<String> { | |
val client = OkHttpClient.Builder() | |
.readTimeout(0, TimeUnit.MILLISECONDS) |
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
object SignalrSocket { | |
private lateinit var broadcaster: FlowableEmitter<String> | |
private lateinit var disposable: Disposable | |
private val flowable = Flowable.create(FlowableOnSubscribe<String> { emitter -> broadcaster = emitter }, BackpressureStrategy.BUFFER) | |
private lateinit var mHubConnection: HubConnection | |
private lateinit var mHubProxy: HubProxy | |
@Throws(InterruptedException::class, ExecutionException::class) |
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
<my.package.MyCustomView | |
android:id="@+id/my_view" | |
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
<fragment android:name="my.package.MyFragment" | |
android:id="@+id/my_fragment" | |
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
MyCustomView customView = new MyCustomView(context); | |
parentView.removeAllViews(); | |
parentView.add(customView); |
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
MyFragment fragment = MyFragment.newInstance(index); | |
FragmentTransaction ft = getFragmentManager().beginTransaction(); | |
ft.replace(R.id.parent, fragment); | |
ft.commit(); |
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
module.exports = function (plop) { | |
plop.addHelper('lowerCase', (text) => text.toLowerCase()); | |
// add more helpers here | |
plop.setGenerator('feature', { | |
description: 'creates a new mvp-based feature', | |
prompts: [{ | |
type: 'input', |
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
plop.setGenerator('feature', { | |
description: 'creates a new mvp-based feature', | |
prompts: [{ | |
type: 'input', | |
name: 'package', | |
message: 'Package name?' | |
},{ | |
type: 'input', | |
name: 'feature', | |
message: 'Feature name?' |