Skip to content

Commit cc1b31b

Browse files
authored
Merge pull request #172 from TeamOpenSmartGlasses/dev
Dev
2 parents cf6a399 + a50e1f7 commit cc1b31b

File tree

75 files changed

+3332
-1547
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+3332
-1547
lines changed

SmartGlassesManager/SGM_android/SmartGlassesManager/src/main/java/com/teamopensmartglasses/smartglassesmanager/SmartGlassesAndroidService.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ public void sendUiUpdate() {
258258

259259
// Update preferred wearable if connected
260260
if(connectionState == 2){
261+
Log.d(TAG, "sendUiUpdate updates preferred wearable");
261262
savePreferredWearable(this, smartGlassesRepresentative.smartGlassesDevice.deviceModelName);
262263
onGlassesConnected(smartGlassesRepresentative.smartGlassesDevice);
263264
EventBus.getDefault().post(new SmartGlassesConnectedEvent(smartGlassesRepresentative.smartGlassesDevice));
@@ -309,11 +310,13 @@ public static void saveApiKey(Context context, String key) {
309310

310311
/** Gets the preferred wearable from shared preference. */
311312
public static String getPreferredWearable(Context context) {
313+
// Log.d(TAG, "GETTING PREFERRED WEARABLE");
312314
return PreferenceManager.getDefaultSharedPreferences(context).getString(context.getResources().getString(R.string.PREFERRED_WEARABLE), "");
313315
}
314316

315317
/** Saves the preferred wearable in user shared preference. */
316318
public static void savePreferredWearable(Context context, String wearableName) {
319+
// Log.d(TAG, "SAVING PREFERRED WEARABLE");
317320
PreferenceManager.getDefaultSharedPreferences(context)
318321
.edit()
319322
.putString(context.getResources().getString(R.string.PREFERRED_WEARABLE), wearableName)
@@ -628,11 +631,6 @@ public static void sendReferenceCard(String title, String body) {
628631
EventBus.getDefault().post(new ReferenceCardSimpleViewRequestEvent(title, body));
629632
}
630633

631-
//show a reference card on the smart glasses with title and body text
632-
public static void sendReferenceCard(String title, String body, int lingerTimeMs) {
633-
EventBus.getDefault().post(new ReferenceCardSimpleViewRequestEvent(title, body, lingerTimeMs));
634-
}
635-
636634
//show a text wall card on the smart glasses
637635
public static void sendTextWall(String text) {
638636
EventBus.getDefault().post(new TextWallViewRequestEvent(text));

SmartGlassesManager/SGM_android/SmartGlassesManager/src/main/java/com/teamopensmartglasses/smartglassesmanager/SmartGlassesRepresentative.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public int getConnectionState(){
196196

197197
public void showReferenceCard(String title, String body){
198198
if (smartGlassesCommunicator != null) {
199-
smartGlassesCommunicator.displayReferenceCardSimple(title, body, -1);
199+
smartGlassesCommunicator.displayReferenceCardSimple(title, body);
200200
}
201201
}
202202

@@ -259,7 +259,7 @@ public void onDoubleTextWallViewEvent(DoubleTextWallViewRequestEvent receivedEve
259259
public void onReferenceCardSimpleViewEvent(ReferenceCardSimpleViewRequestEvent receivedEvent){
260260
Log.d(TAG, "SHOWING REFERENCE CARD");
261261
if (smartGlassesCommunicator != null) {
262-
smartGlassesCommunicator.displayReferenceCardSimple(receivedEvent.title, receivedEvent.body, receivedEvent.lingerTimeMs);
262+
smartGlassesCommunicator.displayReferenceCardSimple(receivedEvent.title, receivedEvent.body);
263263
// homeUiAfterDelay(referenceCardDelayTime);
264264
}
265265
}
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package com.teamopensmartglasses.smartglassesmanager.eventbusmessages;
22

3-
public class GlassesBatteryLevelEvent {
3+
public class BatteryLevelEvent {
4+
// -1 is auto brightness
5+
46
public final int batteryLevel;
5-
public GlassesBatteryLevelEvent(int batteryLevel) {
7+
public BatteryLevelEvent(int batteryLevel) {
68
this.batteryLevel = batteryLevel;
79
}
810
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.teamopensmartglasses.smartglassesmanager.eventbusmessages;
2+
3+
public class BrightnessLevelEvent {
4+
public final int brightnessLevel;
5+
public BrightnessLevelEvent(int brightnessLevel) {
6+
this.brightnessLevel = brightnessLevel;
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.teamopensmartglasses.smartglassesmanager.eventbusmessages;
2+
3+
public class GlassesDisplayPowerEvent {
4+
public boolean turnedOn;
5+
public GlassesDisplayPowerEvent(boolean turnedOn){
6+
this.turnedOn = turnedOn;
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.teamopensmartglasses.smartglassesmanager.eventbusmessages;
2+
3+
public class GlassesHeadDownEvent {
4+
5+
public GlassesHeadDownEvent(){
6+
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.teamopensmartglasses.smartglassesmanager.eventbusmessages;
2+
3+
public class GlassesHeadUpEvent {
4+
5+
public GlassesHeadUpEvent(){
6+
7+
}
8+
}

SmartGlassesManager/SGM_android/SmartGlassesManager/src/main/java/com/teamopensmartglasses/smartglassesmanager/smartglassescommunicators/AndroidSGC.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ public void destroy(){
563563
}
564564
}
565565

566-
public void displayReferenceCardSimple(String title, String body, int lingerTimeMs){
566+
public void displayReferenceCardSimple(String title, String body){
567567
try{
568568
//build json object to send command result
569569
JSONObject commandResponseObject = new JSONObject();
@@ -759,7 +759,7 @@ public void displayPromptView(String prompt, String [] options){
759759
}
760760

761761
public void displayTextLine(String text){
762-
displayReferenceCardSimple("", text, -1);
762+
displayReferenceCardSimple("", text);
763763
}
764764

765765
public void displayCenteredText(String text){
@@ -768,7 +768,7 @@ public void displayCenteredText(String text){
768768
}
769769

770770
public void displayCustomContent(String json) {
771-
displayReferenceCardSimple("CustomDisplayNotImplemented", json, -1);
771+
displayReferenceCardSimple("CustomDisplayNotImplemented", json);
772772
}
773773

774774

SmartGlassesManager/SGM_android/SmartGlassesManager/src/main/java/com/teamopensmartglasses/smartglassesmanager/smartglassescommunicators/AudioWearableSGC.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void destroy(){
4545
killme = true;
4646
}
4747

48-
public void displayReferenceCardSimple(String title, String body, int lingerTimeMs){
48+
public void displayReferenceCardSimple(String title, String body){
4949
Log.d(TAG, "TTS reference card");
5050
EventBus.getDefault().post(new TextToSpeechEvent(title + ", " + body, "english"));
5151
}

0 commit comments

Comments
 (0)