MaxstARSDK  3.5.0
All Classes Functions Variables
WearableDeviceController.java
1 /*
2  * Copyright 2017 Maxst, Inc. All Rights Reserved.
3  */
4 
5 package com.maxst.ar.wearable;
6 
7 import android.app.Activity;
8 import android.os.Build;
9 
10 public abstract class WearableDeviceController {
11 
12 // /**
13 // * Check if this android device is in our supported list
14 // * @return True supported device
15 // * False not supported device
16 // */
17 // public static boolean isSupportedWearableDevice() {
18 // switch (Build.MODEL) {
19 // case "embt2":
20 // case "EMBT3C":
21 // case "R7-W":
22 // return true;
23 //
24 // default:
25 // return false;
26 // }
27 // }
28 
34  public static WearableDeviceController createDeviceController(Activity activity) {
35  WearableDeviceController instance;
36  if (Build.MODEL.equalsIgnoreCase("embt2")) {
37  instance = new BT200Controller(activity, Build.MODEL, true);
38  } else if (Build.MODEL.equalsIgnoreCase("EMBT3C") || Build.MODEL.equalsIgnoreCase("EMBT3S")) {
39  instance = new BT300SeriesController(activity, Build.MODEL, true);
40  } else if (Build.MODEL.equalsIgnoreCase("R7-W")) {
41  instance = new ODGR7Controller(activity, Build.MODEL, true);
42  } else {
43  instance = new NullWearableController(activity, Build.MODEL, false);
44  }
45 
46  return instance;
47  }
48 
49  private String modelName;
50  private boolean surfaceExtended = false;
51  private boolean windowExtended = false;
52  private boolean stereoEnabled = false;
53  private boolean supportedWearableDevice = false;
54  protected Activity activity;
55 
56  WearableDeviceController(Activity activity, String modelName, boolean supportedDevice) {
57  this.activity = activity;
58  this.modelName = modelName;
59  this.supportedWearableDevice = supportedDevice;
60  }
61 
62  public boolean isSupportedWearableDevice() {
63  return supportedWearableDevice;
64  }
65 
71  public String getModelName() {
72  return modelName;
73  }
74 
80  public void extendSurface(boolean toggle) {
81  surfaceExtended = toggle;
82  }
83 
89  public void extendWindow(boolean toggle) {
90  windowExtended = toggle;
91  }
92 
99  public void setStereoMode(boolean toggle) {
100  stereoEnabled = toggle;
101  }
102 
103  public boolean isSurfaceExtended() {
104  return surfaceExtended;
105  }
106 
107  public boolean isWindowExtended() {
108  return windowExtended;
109  }
110 
111  public boolean isStereoEnabled() {
112  return stereoEnabled;
113  }
114 }
static WearableDeviceController createDeviceController(Activity activity)