summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/textureview/TextureViewDebugModeActivity.java
blob: d2d527f6a7451e8a3c497a86b4f8b0106b0058bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.mapbox.mapboxsdk.testapp.activity.textureview;

import android.view.MenuItem;
import com.mapbox.mapboxsdk.maps.MapboxMapOptions;
import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
import com.mapbox.mapboxsdk.testapp.activity.maplayout.DebugModeActivity;
import com.mapbox.mapboxsdk.testapp.utils.NavUtils;

/**
 * Test activity showcasing the different debug modes and allows to cycle between the default map styles.
 */
public class TextureViewDebugModeActivity extends DebugModeActivity implements OnMapReadyCallback {

  @Override
  protected MapboxMapOptions setupMapboxMapOptions() {
    MapboxMapOptions mapboxMapOptions = super.setupMapboxMapOptions();
    mapboxMapOptions.textureMode(true);
    return mapboxMapOptions;
  }

  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
      case android.R.id.home:
        // activity uses singleInstance for testing purposes
        // code below provides a default navigation when using the app
        onBackPressed();
        return true;
    }
    return super.onOptionsItemSelected(item);
  }


  @Override
  public void onBackPressed() {
    // activity uses singleInstance for testing purposes
    // code below provides a default navigation when using the app
    NavUtils.navigateHome(this);
  }
}