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 isLowMemory(): Boolean { | |
val memoryLimit: Long = (getTotalInternalMemorySize() * DEFAULT_THRESHOLD_PERCENTAGE) / 100; | |
return availableMemorySize() <= tenPercentLimit; | |
} |
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
plop.addHelper('lowerCase', (text) => text.toLowerCase()); |
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
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?' |
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
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 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 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 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 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 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) |