fixed static
This commit is contained in:
parent
ef86c19311
commit
d69bae5267
|
|
@ -39,7 +39,7 @@ dependencies {
|
|||
provided('com.google.http-client:google-http-client-jackson2:1.21.0') {
|
||||
exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
|
||||
}
|
||||
provided 'com.squareup.okhttp:okhttp:2.7.0'
|
||||
provided 'com.squareup.okhttp:okhttp:2.7.2'
|
||||
provided 'com.facebook.fresco:fbcore:0.8.1'
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ public abstract class AbstractBaseActivity extends AppCompatActivity
|
|||
fragmentManager.popBackStackImmediate(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
|
||||
}
|
||||
|
||||
return setFragment(fragmentClass);
|
||||
return setFragment(fragmentClass, args);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ public class ViewController<TLogicBridge,
|
|||
@NonNull
|
||||
private final View view;
|
||||
|
||||
//not completed yet
|
||||
@SuppressWarnings("PMD.UnusedFormalParameter")
|
||||
public ViewController(@NonNull final CreationContext<TLogicBridge, TActivity, TFragment> creationContext,
|
||||
@Nullable final Bundle savedInstanceState) {
|
||||
this.logicBridge = creationContext.logicBridge;
|
||||
|
|
|
|||
|
|
@ -64,6 +64,8 @@ public abstract class ViewControllerFragment<TLogicBridge, TActivity extends App
|
|||
protected abstract Class<ViewController<TLogicBridge, TActivity,
|
||||
? extends ViewControllerFragment<TLogicBridge, TActivity>>> getViewControllerClass();
|
||||
|
||||
// need throwable for app stability
|
||||
@SuppressWarnings("PMD.AvoidCatchingThrowable")
|
||||
@Override
|
||||
public void onCreate(@Nullable final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
|
@ -73,25 +75,25 @@ public abstract class ViewControllerFragment<TLogicBridge, TActivity extends App
|
|||
RxAndroidUtils.<LogicService<TLogicBridge>>observeService(getContext(), getLogicServiceClass())
|
||||
.map(service -> service != null ? service.getLogicBridge() : null)
|
||||
.distinctUntilChanged(),
|
||||
(activity, view, logicBridge) -> {
|
||||
if (activity == null || view == null || logicBridge == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final ViewController.CreationContext<TLogicBridge, TActivity,
|
||||
? extends ViewControllerFragment<TLogicBridge, TActivity>> creationContext
|
||||
= new ViewController.CreationContext<>(logicBridge, activity, this, view.first);
|
||||
if (getViewControllerClass().getConstructors().length == 1) {
|
||||
try {
|
||||
return (ViewController) getViewControllerClass().getConstructors()[0].newInstance(creationContext, view.second);
|
||||
} catch (Throwable throwable) {
|
||||
Lc.assertion(throwable);
|
||||
}
|
||||
} else {
|
||||
Lc.assertion("There should be single constructor for " + getViewControllerClass());
|
||||
}
|
||||
(activity, view, logicBridge) -> {
|
||||
if (activity == null || view == null || logicBridge == null) {
|
||||
return null;
|
||||
}).subscribe(this::onViewControllerChanged);
|
||||
}
|
||||
|
||||
final ViewController.CreationContext<TLogicBridge, TActivity,
|
||||
? extends ViewControllerFragment<TLogicBridge, TActivity>> creationContext
|
||||
= new ViewController.CreationContext<>(logicBridge, activity, this, view.first);
|
||||
if (getViewControllerClass().getConstructors().length == 1) {
|
||||
try {
|
||||
return (ViewController) getViewControllerClass().getConstructors()[0].newInstance(creationContext, view.second);
|
||||
} catch (Throwable throwable) {
|
||||
Lc.assertion(throwable);
|
||||
}
|
||||
} else {
|
||||
Lc.assertion("There should be single constructor for " + getViewControllerClass());
|
||||
}
|
||||
return null;
|
||||
}).subscribe(this::onViewControllerChanged);
|
||||
} else {
|
||||
Lc.assertion("Context is null in onCreate.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue