File tree Expand file tree Collapse file tree 6 files changed +158
-131
lines changed
src/processing/mode/android Expand file tree Collapse file tree 6 files changed +158
-131
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,10 @@ public boolean canDraw() {
103103 public void dispose () {
104104 }
105105
106+ public void requestPermissions () {
107+
108+ }
109+
106110 public void onPermissionsGranted () {
107111
108112 }
@@ -126,6 +130,7 @@ public void onCreate(SurfaceHolder surfaceHolder) {
126130 sketch .preview = isPreview ();
127131 // By default we don't get touch events, so enable them.
128132 setTouchEventsEnabled (true );
133+ if (!sketch .preview ) requestPermissions ();
129134 }
130135 }
131136
Original file line number Diff line number Diff line change @@ -96,6 +96,10 @@ public void setSketch(PApplet sketch) {
9696 public void dispose () {
9797 }
9898
99+ public void requestPermissions () {
100+
101+ }
102+
99103 public void onPermissionsGranted () {
100104
101105 }
@@ -131,6 +135,7 @@ public void onCreate(SurfaceHolder surfaceHolder) {
131135 PGraphicsAndroid2D .useBitmap = false ;
132136 sketch .initSurface (PWatchFaceCanvas .this , null );
133137 sketch .startSurface ();
138+ requestPermissions ();
134139 }
135140 }
136141
Original file line number Diff line number Diff line change @@ -93,10 +93,13 @@ public void setSketch(PApplet sketch) {
9393 public void dispose () {
9494 }
9595
96- public void onPermissionsGranted () {
96+ public void requestPermissions () {
9797
9898 }
9999
100+ public void onPermissionsGranted () {
101+
102+ }
100103
101104 @ Override
102105 public Engine onCreateEngine () {
@@ -129,6 +132,7 @@ public void onCreate(SurfaceHolder surfaceHolder) {
129132 if (sketch != null ) {
130133 sketch .initSurface (PWatchFaceGLES .this , null );
131134 sketch .startSurface ();
135+ requestPermissions ();
132136 }
133137 }
134138
Original file line number Diff line number Diff line change @@ -248,6 +248,8 @@ public void setSystemUiVisibility(int visibility) {
248248
249249 @ Override
250250 public void finish () {
251+ if (component == null ) return ;
252+
251253 if (component .getKind () == AppComponent .FRAGMENT ) {
252254 activity .finish ();
253255 } else if (component .getKind () == AppComponent .WALLPAPER ) {
You can’t perform that action at this time.
0 commit comments