File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 23
23
package processing .android ;
24
24
25
25
import android .service .wallpaper .WallpaperService ;
26
- import android .util .DisplayMetrics ;
26
+ // import android.util.DisplayMetrics;
27
27
import android .view .MotionEvent ;
28
28
import android .view .SurfaceHolder ;
29
29
import android .view .WindowManager ;
30
30
import processing .core .PApplet ;
31
31
import android .util .Log ;
32
32
import android .os .Build ;
33
- import android .view .WindowManager ;
33
+ // import android.view.WindowManager;
34
34
import android .view .Display ;
35
35
import android .graphics .Point ;
36
36
37
37
public class PWallpaper extends WallpaperService implements AppComponent {
38
38
String TAG = "PWallpaper" ;
39
39
40
40
private Point size ;
41
- private DisplayMetrics metrics ;
41
+ // private DisplayMetrics metrics;
42
42
private PEngine engine ;
43
43
44
44
public PWallpaper () {
@@ -116,6 +116,7 @@ public void onCreate(SurfaceHolder surfaceHolder) {
116
116
if (sketch != null ) {
117
117
sketch .initSurface (PWallpaper .this , getSurfaceHolder ());
118
118
sketch .startSurface ();
119
+ sketch .preview = isPreview ();
119
120
// By default we don't get touch events, so enable them.
120
121
setTouchEventsEnabled (true );
121
122
}
Original file line number Diff line number Diff line change @@ -301,6 +301,11 @@ public class PApplet extends Object implements PConstants {
301
301
public float offsetX = 0 ;
302
302
public float offsetY = 0 ;
303
303
304
+ /**
305
+ * Indicates if the wallpaper is in preview mode.
306
+ */
307
+ public boolean preview = false ;
308
+
304
309
/**
305
310
* true if the applet is online.
306
311
* <P>
You can’t perform that action at this time.
0 commit comments