File tree 6 files changed +158
-131
lines changed
src/processing/mode/android
6 files changed +158
-131
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,10 @@ public boolean canDraw() {
103
103
public void dispose () {
104
104
}
105
105
106
+ public void requestPermissions () {
107
+
108
+ }
109
+
106
110
public void onPermissionsGranted () {
107
111
108
112
}
@@ -126,6 +130,7 @@ public void onCreate(SurfaceHolder surfaceHolder) {
126
130
sketch .preview = isPreview ();
127
131
// By default we don't get touch events, so enable them.
128
132
setTouchEventsEnabled (true );
133
+ if (!sketch .preview ) requestPermissions ();
129
134
}
130
135
}
131
136
Original file line number Diff line number Diff line change @@ -96,6 +96,10 @@ public void setSketch(PApplet sketch) {
96
96
public void dispose () {
97
97
}
98
98
99
+ public void requestPermissions () {
100
+
101
+ }
102
+
99
103
public void onPermissionsGranted () {
100
104
101
105
}
@@ -131,6 +135,7 @@ public void onCreate(SurfaceHolder surfaceHolder) {
131
135
PGraphicsAndroid2D .useBitmap = false ;
132
136
sketch .initSurface (PWatchFaceCanvas .this , null );
133
137
sketch .startSurface ();
138
+ requestPermissions ();
134
139
}
135
140
}
136
141
Original file line number Diff line number Diff line change @@ -93,10 +93,13 @@ public void setSketch(PApplet sketch) {
93
93
public void dispose () {
94
94
}
95
95
96
- public void onPermissionsGranted () {
96
+ public void requestPermissions () {
97
97
98
98
}
99
99
100
+ public void onPermissionsGranted () {
101
+
102
+ }
100
103
101
104
@ Override
102
105
public Engine onCreateEngine () {
@@ -129,6 +132,7 @@ public void onCreate(SurfaceHolder surfaceHolder) {
129
132
if (sketch != null ) {
130
133
sketch .initSurface (PWatchFaceGLES .this , null );
131
134
sketch .startSurface ();
135
+ requestPermissions ();
132
136
}
133
137
}
134
138
Original file line number Diff line number Diff line change @@ -248,6 +248,8 @@ public void setSystemUiVisibility(int visibility) {
248
248
249
249
@ Override
250
250
public void finish () {
251
+ if (component == null ) return ;
252
+
251
253
if (component .getKind () == AppComponent .FRAGMENT ) {
252
254
activity .finish ();
253
255
} else if (component .getKind () == AppComponent .WALLPAPER ) {
You can’t perform that action at this time.
0 commit comments