NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
public class DemoPresenter extends DemoBasePresenter<DemoContract.View> implements DemoContract.Presenter { | |
@Inject | |
public DemoPresenter(DemoContract.View view) { | |
super(view); | |
} | |
@Override | |
public void unSubscribe() { |
public interface DemoContract { | |
interface View extends DemoBaseContract.ActivityView { | |
} | |
interface Presenter extends DemoBaseContract.Presenter { | |
} | |
} |
@Module | |
public abstract class DemoActivityModule { | |
@Binds | |
@PerActivity | |
abstract DemoContract.Presenter providesPresenter(DemoPresenter demoPresenter); | |
@Binds | |
@PerActivity | |
abstract DemoContract.View providesView(DemoActivity demoActivity); | |
} |
@Module | |
public abstract class DemoActivityModule { | |
@Binds | |
@PerActivity | |
abstract DemoContract.Presenter providesPresenter(DemoPresenter demoPresenter); | |
@Binds | |
@PerActivity | |
abstract DemoContract.View providesView(DemoActivity demoActivity); | |
} |
public class DemoActivity extends DemoBaseActivity<DemoContract.Presenter> implements DemoContract.View { | |
@Override | |
public void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_demo); | |
} | |
} |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
''' | |
(Python) | |
Using yes and no (intents) worked very well for me. | |
I enjoy coding for yes and no intents. | |
I found that users enjoy the experience and understand it intuitively. | |
The below variables derive from: | |
... | |
attributes_in = session['attributes'] <-- if session.get('attributes') <-- session obj |
The above gradients compare interpolation in RGB, HSL, CIE Lab and CIE LCh color spaces. For more on color spaces, see Gregor Aisch’s post, How To Avoid Equidistant HSV Colors.
This example is built with D3. Code and documentation are available as the d3.cie plugin.
import 'dart:async'; | |
import 'dart:ui' as ui; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'package:flutter/animation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/scheduler.dart' show timeDilation; | |
class DemoPage extends StatefulWidget { | |
@override |
import 'dart:ui' as ui; | |
import 'dart:async'; | |
import 'dart:math'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'package:flutter/animation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/scheduler.dart' show timeDilation; | |
class DemoPage extends StatefulWidget { |