Search in sources :

Example 1 with RegionSelectionOptions

use of com.mapbox.mapboxsdk.plugins.offline.model.RegionSelectionOptions 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);
    }
}
Also used : RegionSelectionOptions(com.mapbox.mapboxsdk.plugins.offline.model.RegionSelectionOptions) ConstraintLayout(androidx.constraintlayout.widget.ConstraintLayout)

Aggregations

ConstraintLayout (androidx.constraintlayout.widget.ConstraintLayout)1 RegionSelectionOptions (com.mapbox.mapboxsdk.plugins.offline.model.RegionSelectionOptions)1