Sub Activity_Create(FirstTime As Boolean)
Dim r As Reflector
r.Target = r.RunStaticMethod("android.app.WallpaperManager", "getInstance", _
Array As Object(r.GetContext), Array As String("android.content.Context"))
r.RunMethod4("suggestDesiredDimensions", Array As Object(Activity.width * 2, Activity.height), _
Array As String("java.lang.int", "java.lang.int"))
Dim pagesx As Float
Dim pagesy As Float
pagesx = 1.00 / 5
pagesy = 1.00
r.RunMethod4("setWallpaperOffsetSteps", Array As Object(pagesx, pagesy), _
Array As String("java.lang.float", "java.lang.float"))
End Sub
Sub Pager_PageChanged (Position As Int)
Log ("Page Changed to " & Position)
CurrentPage = Position
SetButtonText
targetx = (1.00 / 5) * (Position)
times = 0
If targetx > x Then
increments = (targetx - x) / 10
up = 1
Else
increments = (x - targetx) / 10
up = 0
End If
End Sub
Sub timer1_Tick
If times = 10 Then
x = targetx
Dim r As Reflector
r.Target = r.RunStaticMethod("android.app.WallpaperManager", "getInstance", _
Array As Object(r.GetContext), Array As String("android.content.Context"))
Dim o As Reflector
o.Target = pager
r.RunMethod4("setWallpaperOffsets", Array As Object(o.RunMethod("getWindowToken"), x, y), _
Array As String("android.os.IBinder", "java.lang.float", "java.lang.float"))
times = 11
End If
If targetx <> x Then
times = times + 1
If targetx > x Then
x = x + increments
Else If targetx < x Then
x = x - increments
End If
Dim r As Reflector
r.Target = r.RunStaticMethod("android.app.WallpaperManager", "getInstance", _
Array As Object(r.GetContext), Array As String("android.content.Context"))
Dim o As Reflector
o.Target = pager
r.RunMethod4("setWallpaperOffsets", Array As Object(o.RunMethod("getWindowToken"), x, y), _
Array As String("android.os.IBinder", "java.lang.float", "java.lang.float"))
End If
End Sub