use of com.instructure.candroid.fragment.InternalWebviewFragment in project instructure-android by instructure.
the class InternalWebViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getToolbar() != null) {
ViewStyler.themeToolbar(this, getToolbar(), Color.WHITE, Color.BLACK, false);
}
if (savedInstanceState == null) {
Bundle bundle = getIntent().getBundleExtra(Const.EXTRAS);
if (bundle.containsKey(Const.ACTION_BAR_TITLE)) {
getToolbar().setTitle(bundle.getString(Const.ACTION_BAR_TITLE));
}
if (bundle.containsKey(Const.CANVAS_CONTEXT)) {
CanvasContext canvasContext = bundle.getParcelable(Const.CANVAS_CONTEXT);
if (canvasContext != null) {
// want the internalWebViewFragment to hide its toolbar
if (canvasContext.getId() == 0) {
bundle.putBoolean(HIDE_TOOLBAR, true);
} else {
// todo fix actionbar setting with viewstyler
final int color = ColorKeeper.getOrGenerateColor(canvasContext);
setActionBarStatusBarColors(color, color);
getSupportActionBar().setTitle(canvasContext.getName());
}
}
}
InternalWebviewFragment fragment = FragUtils.getFrag(InternalWebviewFragment.class, bundle);
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.add(R.id.container, fragment, InternalWebviewFragment.class.getName());
ft.commitAllowingStateLoss();
}
}
Aggregations