use of androidx.constraintlayout.widget.ConstraintLayout in project mapbox-plugins-android by mapbox.
the class OfflineActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Hide any toolbar an apps theme might automatically place in activities. Typically creating an
// activity style would cover this issue but this seems to prevent us from getting the users
// application colorPrimary color.
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
getSupportActionBar().hide();
setContentView(R.layout.mapbox_offline_activity);
ConstraintLayout toolbar = findViewById(R.id.place_picker_toolbar);
int color = ColorUtils.getMaterialColor(this, R.attr.colorPrimary);
toolbar.setBackgroundColor(color);
// Add autocomplete fragment if this is first creation
if (savedInstanceState == null) {
RegionSelectionFragment fragment;
RegionSelectionOptions regionSelectionOptions = getIntent().getParcelableExtra(OfflinePluginConstants.REGION_SELECTION_OPTIONS);
if (regionSelectionOptions != null) {
fragment = RegionSelectionFragment.newInstance(regionSelectionOptions);
} else {
fragment = RegionSelectionFragment.newInstance();
}
getSupportFragmentManager().beginTransaction().add(R.id.fragment_container, fragment, RegionSelectionFragment.TAG).commit();
fragment.setSelectedCallback(this);
}
}
use of androidx.constraintlayout.widget.ConstraintLayout in project mapbox-plugins-android by mapbox.
the class PlacePickerActivity method customizeViews.
private void customizeViews() {
ConstraintLayout toolbar = findViewById(R.id.place_picker_toolbar);
if (options != null && options.toolbarColor() != null) {
toolbar.setBackgroundColor(options.toolbarColor());
} else {
int color = ColorUtils.getMaterialColor(this, R.attr.colorPrimary);
toolbar.setBackgroundColor(color);
}
}
Aggregations