-
Notifications
You must be signed in to change notification settings - Fork 2
/
Content.bas
294 lines (252 loc) · 7.39 KB
/
Content.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
Type=Activity
Version=5.02
ModulesStructureVersion=1
B4A=true
@EndOfDesignText@
#Region iActivity Attributes
#FullScreen: False
#IncludeTitle: False
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim i As Int
Dim a As Object
Dim gambar As Map
Private pm As PackageManager
Private ups As Intent
Private ipack As Int
'Dim Cok As String
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim ivMovies As ImageView
Private Params As BD_CustomDlgParams
Private BD As BetterDialogs
Private pShare As Panel
Private ivShare As ImageView
Dim iShare As Int=1
Private ivPlay As ImageView
Private wvOrder As WebView
Private lblCerita As Label
Private lblFilm As Label
Private lblCate As Label
Private lblDirec As Label
Private lblNama As Label
Private lblGenre As Label
Private lblJudul As Label
Private lblTitle As Label
Private lblCast As Label
Private lblNmCast As Label
Private lblTake As Label
Private lblAllSyn As Label
Private ivMovie As ImageView
Private lblAtas As Label
Private lblBawah As Label
Private lblTrailer As Label
Private ivTrailer As ImageView
Private lblComment As Label
Private ivComment As ImageView
Private etDesc As EditText
Private lblComments As Label
Private bShare As Button
Private bCancel As Button
Private pUtama As Panel
Private ivCancel As ImageView
Private ivAction As ImageView
Private lblAction As Label
Private lblNmWrite As Label
Private lblNmWriter As Label
Private ivComments As ImageView
Dim git As Int
Private GifSmart As MovieViewControl
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("Content")
ivMovies.Bitmap = a
GifSmart.Load(File.DirAssets, "spin.gif", True)
' GifSmart.Visible = False
#Region director
Dim Cate0 As Map
Cate0.Initialize
gambar.Get("contentDirectors")
Dim Cate1 As List = gambar.Get("contentDirectors")
For Each Cate2 As Map In Cate1
Cate0 = Cate2.Get("idDirector")
Next
Cate0.Get("name")
lblDirec.Text = Cate0.Get("name")
#End Region
#Region Genre
Dim Genre0 As Map
Genre0.Initialize
gambar.Get("contentGenres")
Dim Genre1 As List = gambar.Get("contentGenres")
For Each Gender2 As Map In Genre1
Genre0 = Gender2.Get("idGenre")
Next
Genre0.Get("name")
lblGenre.Text = Genre0.Get("name")
#End Region
#Region Cast
Dim Cast0 As Map
Cast0.Initialize
gambar.Get("contentCasts")
Dim Cast1 As List = gambar.Get("contentCasts")
For Each Cast2 As Map In Cast1
Cast0 = Cast2.Get("idCast")
'Log(Gender2.Get("idGenre"))
Next
Cast0.Get("name")
'Log(Gender0.Get("name"))
lblNmCast.Text = Cast0.Get("name")
#End Region
#Region Writer
Dim Writer0 As Map
Writer0.Initialize
gambar.Get("contentProducers")
'Log(gambar.Get("contentProducers"))
Dim Writer1 As List = gambar.Get("contentProducers")
For Each Writer2 As Map In Writer1
Writer0 = Writer2.Get("idProducer")
'Log(Gender2.Get("idGenre"))
Next
Writer0.Get("name")
'Log(Gender0.Get("name"))
lblNmWriter.Text = Writer0.Get("name")
#End Region
Log(gambar)
For x2=0 To gambar.Size-1
Select gambar.GetKeyAt(x2)
Case "synopsis"
lblCerita.Text = gambar.Get("synopsis")
Case "type"
lblBawah.Text = gambar.Get("type")
Case "title"
lblAtas.Text = gambar.Get("title")
lblTitle.Text = gambar.Get("title")
End Select
Next
End Sub
Sub Activity_Resume
ivPlay.Visible = True
GifSmart.Visible = False
End Sub
Sub Activity_Pause (UserClosed As Boolean)
ivPlay.Visible = False
GifSmart.Visible = True
End Sub
Sub ivBack_Click
Activity.Finish
End Sub
Sub ivShare_Click
StartActivity("Share")
End Sub
Sub ivPlay_Click
ivPlay.Visible = False
GifSmart.Visible=True
CallSub(ImageDownloader, "ActivityIsPaused")
CallSub(EPGDownloader, "ActivityIsPaused")
StopService(MNCUtils2Service)
CancelScheduledService(MNCUtils2Service)
StopService(ImageDownloader)
CancelScheduledService(ImageDownloader)
StopService(EPGDownloader)
CancelScheduledService(EPGDownloader)
For x2=0 To gambar.Size-1
Select gambar.GetKeyAt(x2)
Case "pathVideo"
If gambar.Get("pathVideo") = Null Then
Msgbox2("Video not found !", "Moviebay", "OK", "", "", LoadBitmap(File.DirAssets, "warning.png"))
Else
#Region Awal aplikasi mulai
If File.Exists(Fungsi.DirDBS, "nexplayersdklitevm.apk") = False Then
ProgressDialogShow2("Please wait...", False)
DoEvents
File.Copy(File.DirAssets, "nexplayersdklitevm.apk", Fungsi.DirDBS, "nexplayersdklitevm.apk")
ProgressDialogHide
DoEvents
End If
Dim pacList As List = pm.GetInstalledPackages
ipack = pacList.IndexOf("com.nexstreaming.app.nexplayersample")
If ipack < 0 Then
ups.Initialize(ups.ACTION_VIEW, "file://" & File.Combine(Fungsi.DirDBS, "nexplayersdklitevm.apk"))
ups.SetType("application/vnd.android.package-archive")
StartActivity(ups)
End If
#End Region
ups.Initialize(ups.ACTION_MAIN, "")
ups = pm.GetApplicationIntent("com.nexstreaming.app.nexplayersample")
'Log(gambar.Get("pathVideo"))
ups.PutExtra("LinkURL", gambar.Get("pathVideo"))
ups.PutExtra("Company", "PT-Infokom")
ups.PutExtra("VCASAddr", "202.80.222.36:80")
If ups.IsInitialized Then StartActivity(ups)
' StartActivity(ups)
End If
End Select
Next
End Sub
Sub ivMovies_Click
'ivPlay_Click
End Sub
Sub lblTrailer_Click
For x2=0 To gambar.Size-1
Select gambar.GetKeyAt(x2)
Case "pathVideo"
If gambar.Get("pathVideo") = Null Then
Msgbox2("Video not found !", "Moviebay", "OK", "", "", LoadBitmap(File.DirAssets, "warning.png"))
Else
' Pemutar.URLChannel = gambar.Get("pathVideo")
ups.Initialize(ups.ACTION_MAIN, "")
ups = pm.GetApplicationIntent("com.nexstreaming.app.nexplayersample")
ups.PutExtra("LinkURL", gambar.Get("http://media.mncplaymedia.net/hls2/animalplanet/animalplanet.m3u8"))
ups.PutExtra("Company", "PT-Infokom")
ups.PutExtra("VCASAddr", "202.80.222.36:80")
If ups.IsInitialized Then StartActivity(ups)
StartActivity(ups)
' StartActivity("Pemutar")
End If
End Select
Next
End Sub
Sub ivTrailer_Click
lblTrailer_Click
End Sub
Sub ivCancel_Click
StartActivity("Content")
End Sub
Sub lblComments_Click
Private pnlBody As Panel
pnlBody.Initialize("")
pnlBody.Color = Colors.Transparent
pnlBody.LoadLayout("comments")
etDesc.Background = Fungsi.GetDrawable ("pass_input_")
Params.Initialize
Params.DialogBody = pnlBody
Params.BodyWidth = pUtama.Width
Params.BodyHeight = pUtama.Height
BD.CustomDialog(Params, "CD2")
End Sub
Sub ivComments_Click
lblComments_Click
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event
If KeyCode = 4 Then ' Back Key
CallSub(ImageDownloader, "ActivityIsPaused")
CallSub(EPGDownloader, "ActivityIsPaused")
StopService(MNCUtils2Service)
CancelScheduledService(MNCUtils2Service)
StopService(ImageDownloader)
CancelScheduledService(ImageDownloader)
StopService(EPGDownloader)
CancelScheduledService(EPGDownloader)
StartActivity(Utama)
Activity.Finish
Else
Return True
End If
End Sub