This repository has been archived by the owner on May 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsteenfo.b4a
1077 lines (987 loc) · 41.3 KB
/
steenfo.b4a
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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Build1=Default,eu.dimitrisp.steenfo
File1=author.bal
File10=outgoing.png
File11=outgoing2.png
File12=post.html
File13=post-blank-pic.png
File14=post-bootstrap.bundle.min.js
File15=post-bootstrap.min.css
File16=post-custom.css
File17=post-custom.js
File18=post-jquery.min.js
File19=posts.bal
File2=author.png
File20=posts.png
File21=posts2.png
File22=post-showdown.min.js
File23=ShowPost.bal
File24=upvotes.bal
File25=upvotes2.bal
File3=author2.png
File4=curation.bal
File5=curation.png
File6=curation2.png
File7=incoming.png
File8=incoming2.png
File9=main.bal
FileGroup1=Default Group
FileGroup10=Default Group
FileGroup11=Default Group
FileGroup12=Default Group
FileGroup13=Default Group
FileGroup14=Default Group
FileGroup15=Default Group
FileGroup16=Default Group
FileGroup17=Default Group
FileGroup18=Default Group
FileGroup19=Default Group
FileGroup2=Default Group
FileGroup20=Default Group
FileGroup21=Default Group
FileGroup22=Default Group
FileGroup23=Default Group
FileGroup24=Default Group
FileGroup25=Default Group
FileGroup3=Default Group
FileGroup4=Default Group
FileGroup5=Default Group
FileGroup6=Default Group
FileGroup7=Default Group
FileGroup8=Default Group
FileGroup9=Default Group
Group=Default Group
IconFile=
Library1=core
Library2=okhttputils2
Library3=json
Library4=phone
Library5=ahpreferenceactivity
Library6=richstring
ManifestCode='This code will be applied to the manifest file during compilation.~\n~'You do not need to modify it in most cases.~\n~'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136~\n~AddManifestText(~\n~<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>~\n~<supports-screens android:largeScreens="true" ~\n~ android:normalScreens="true" ~\n~ android:smallScreens="true" ~\n~ android:anyDensity="true"/>)~\n~SetApplicationAttribute(android:icon, "@drawable/icon")~\n~SetApplicationAttribute(android:label, "$LABEL$")~\n~'SetApplicationAttribute(android:theme, "@style/Theme.AppCompat")~\n~~\n~'End of default text.~\n~CreateResourceFromFile(Macro, Themes.DarkTheme)~\n~AddApplicationText(<activity android:name="de.amberhome.objects.preferenceactivity"/>)
Module1=ShowPost
NumberOfFiles=25
NumberOfLibraries=6
NumberOfModules=1
Version=8.3
@EndOfDesignText@
#Region Project Attributes
#ApplicationLabel: SteemiAPP
#VersionCode: 19
#VersionName: Amberdawn
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: True
#DebuggerForceStandardAssets : true
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: False
#IgnoreWarnings: 15
#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 manager As AHPreferenceManager
Dim screen As AHPreferenceScreen
Dim ChosenPostBody, ChosenPostTitle, ChosenPostPPV, ChosenPostAuthor, ChosenPostCreated, ChosenPostURL, ChosenUpvotedBy, ChosenPostReplies As String
Dim appver As Int = 19
Dim Animator As Timer
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 ScreenWidth As Int = GetDeviceLayoutValues.Width
Private btnrefresh As Label
Private TabHost1 As TabHost
Private lvIncoming, lvOutgoing, lvCuration, lvAuthor, lvPosts As ListView
Dim auth1, auth2, in1, in2, out1, out2, posts1, posts2, cur1, cur2 As Bitmap
Dim uOut, uIn, uCur, uAuth As List
Dim username, server, entriesno, postsno, pricehistory As String
Dim TVFS, TVS As Float
Dim AppSettings As Map
Private totalAuth, totalCur, totalPend, lblSTEEMChange, lblSTEEMPrice, lblSBDChange, lblSBDPrice As Label
Dim TotalSBD, TotalSP, TotalAuthSP, TotalAuthSBD, TotalAuthSTEEM, userRep, RewardBalance, RecentClaims As Double = 0
Dim pnPrice As Panel
Private lblPriceLoading As Label
Private lblSidebar As Label
Private pnMenu As Panel
Dim SideBarWidth As Int
Private pnMenuClose As Label
Private lvMenu As ListView
Private pbVotePower As ProgressBar
Private lblVPText As Label
Private lvMyFeed As ListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Load layout
Activity.LoadLayout("main")
'Initialize settings activity
AppSettings.Initialize
CreatePreferenceScreen
'Check if settings are already set (meaning, the app has started again), and if not set defaults
If manager.GetAll.Size = 0 Then SetDefaults
'Fetch the details we need
server = manager.GetString("server")
username = manager.GetString("username").ToLowerCase
entriesno = manager.GetString("entriesno")
postsno = manager.GetString("postsno")
pricehistory = manager.GetString("pricehistory")
'Block app input while loading data
ProgressDialogShow2("Loading blockchain data...", False)
'Start fetchng data, starting with the global properties (used to calculate SP/Vests etc)
Dim job1 As HttpJob
job1.Initialize("DynGlobalProps",Me)
job1.PostString("https://api.steemit.com","{""jsonrpc"":""2.0"",""method"":""call"",""params"":[""database_api"",""get_dynamic_global_properties""]}")
'Setup the user interface, and initialise the lists
SetupUI
uOut.Initialize
uIn.Initialize
uCur.Initialize
uAuth.Initialize
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event 'ignore
If KeyCode = KeyCodes.KEYCODE_BACK Then
If pnMenu.Visible = True Then ' If the menu is open, close the menu and keep the app running
pnMenu.Visible = False
Return True
End If
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub JobDone (Job As HttpJob)
Log("Current job: " & Job.JobName)
Dim job1 As HttpJob
If Job.Success = True Then
Select Job.JobName
Case "DynGlobalProps"
'Parse the reply from the server
DynGlobalProps(Job.GetString)
'Start fetching user posts
job1.Initialize("GetUserPosts",Me)
job1.PostString("https://" & server,"{""id"":1,""jsonrpc"":""2.0"",""method"":""call"",""params"":[""database_api"",""get_discussions_by_blog"",[{""tag"":"""&username&""",""limit"":"&postsno&",""start_author"":null,""start_permlink"":null}]]}")
Dim job2, job3 As HttpJob
job2.Initialize("GetAccountInfo", Me)
job2.PostString("https://" & server,"{""jsonrpc"":""2.0"", ""method"":""condenser_api.get_accounts"", ""params"":[["""&username&"""]], ""id"":1}")
job3.Initialize("GetRewardFund", Me)
job3.PostString("https://" & server,"{""jsonrpc"":""2.0"", ""method"":""condenser_api.get_reward_fund"", ""params"":[""post""], ""id"":1}")
Case "GetUserPosts"
'Parse user posts reply from server
ParseUserPost(Job.GetString)
'Start fetching account history
job1.Initialize("GetAccHistory",Me)
job1.PostString("https://" & server,"{""id"":1,""jsonrpc"":""2.0"",""method"":""call"",""params"":[""database_api"",""get_account_history"",["""&username&""",-1,"&entriesno&"]]}")
Case "GetAccHistory"
'Parse the reply from the server
ParseAccHistory(Job.GetString)
Case "GetAccountInfo"
'Parse the reply from the server
ParseAccInfo(Job.GetString)
Case "GetSBDPrice"
'Parse the reply from the server
ParsePrice(Job.GetString)
'Fetch STEEM price
job1.Initialize("GetSTEEMPrice",Me)
job1.Download("https://api.coinmarketcap.com/v2/ticker/1230/")
Case "GetSTEEMPrice"
'Parse the reply from the server
ParsePrice(Job.GetString)
Case "GetRewardFund"
Log("Parsing reward fund")
ParseRewardFund(Job.GetString)
Case "GetUserFeed"
ParseFeed(Job.GetString)
Case "GetReplies"
ChosenPostReplies = ""
ParsePostReplies(Job.GetString)
Case "GetReplyChild"
'ParsePostReplyChild(Job.GetString)
Case "ShowPost"
'Parse the reply from the server
ParseSinglePost(Job.GetString)
End Select
Else ' Job could not complete, show messages and hide the loading screen.
Msgbox("API Node is busy or not responding. Please try again later, or choose a different API node.", "Error")
ProgressDialogHide
End If
Job.Release
End Sub
Sub btnPrice_Click
'Price button clicked. Start fetching SBD/STEEM price from Coinmarketcap
' First, get the setting again
pricehistory = manager.GetString("pricehistory")
lblPriceLoading.Text = "Loading..."
'Start a download job for the CMC json
Dim job1 As HttpJob
job1.Initialize("GetSBDPrice",Me)
job1.Download("https://api.coinmarketcap.com/v2/ticker/1312/")
'Show the price panel
pnPrice.Visible = True
'SetupUI
End Sub
Sub btnrefresh_Click
' Re-set the details, just in case something changed.
server = manager.GetString("server")
username = manager.GetString("username").ToLowerCase
entriesno = manager.GetString("entriesno")
postsno = manager.GetString("postsno")
'Start fetching all data from the blockchain and block user input
ProgressDialogShow2("Loading blockchain data...", False)
Dim job1,job2 As HttpJob
job1.Initialize("GetAccountInfo", Me)
job1.PostString("https://" & server,"{""jsonrpc"":""2.0"", ""method"":""condenser_api.get_accounts"", ""params"":[["""&username&"""]], ""id"":1}")
job2.Initialize("DynGlobalProps",Me)
job2.PostString("https://api.steemit.com","{""id"":""1"", ""jsonrpc"":""2.0"",""method"":""call"",""params"":[""database_api"",""get_dynamic_global_properties""]}")
End Sub
Sub CalculateVP(VP As Long, Timestamp As String)
' Calculation logic taken from
' https://steemkr.com/utopian-io/@stoodkev/steem-js-for-dummies-1-how-to-calculate-the-current-voting-power
Dim Elapsed As Long
Dim RealVP As Float
DateTime.DateFormat = "yyyy-MM-dd HH:mm:ss"
DateTime.SetTimeZone(0)
' Log("Timestamp: " & Timestamp)
Elapsed = (DateTime.Now - DateTime.DateParse(Timestamp.Replace("T", " "))) / 1000
RealVP = Min((VP + (10000 * Elapsed / 432000))/100, 100)
' Change progress bar color, depending on the VP %
If RealVP > 0 And RealVP < 20 Then
pbVotePower.Color = Colors.Red
Else If RealVP >= 20 And RealVP < 40 Then
pbVotePower.Color = Colors.RGB(255, 102, 0)
Else If RealVP >= 40 And RealVP < 80 Then
pbVotePower.Color = Colors.Yellow
Else
pbVotePower.Color = Colors.Green
End If
pbVotePower.Progress = RealVP
lblVPText.Text = "VP: " & Round2(RealVP, 2) & "%"
End Sub
Sub CombineTextWithMaterialIcons(s As String) As RichString
Dim rs As RichString
rs.Initialize(s)
For i = 0 To rs.Length - 1
' Log( Asc(s.CharAt(i)))
If Asc(s.CharAt(i)) > 0xe000 Then
rs.TypefaceCustom(lblSidebar.Typeface, i, i + 1)
End If
Next
Return rs
End Sub
Sub ConvertVestToSP(Vests As String) As Float
Dim Vest, V2SP As Float
Vest = Vests.Replace(" VESTS", "")
V2SP = TVFS * Vest / TVS
Return V2SP
End Sub
Sub CreatePreferenceScreen
screen.Initialize("Settings", "")
'create two categories
Dim cat1, cat2 ,cat3 As AHPreferenceCategory
Dim SettingsIntent As PhoneIntents
cat1.Initialize("About You")
cat1.AddEditText("username", "Username", "Your steemit username without ""@""", "dimitrisp", "")
cat2.Initialize("API Settings")
cat2.AddList("entriesno", "Entries to Fetch", "How many entries I should fetch from the API Server", "250", "", Array As String("100", "150", "200", "250", "300", "350", "400", "450", "500", "550"))
cat2.AddList("postsno", "Posts to Fetch", "How many posts should I fetch? Helpful if you post more than 15 times per week!", "15", "", Array As String(10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 110, 120))
cat2.AddList("server", "API Node", "The preferred Steemit API node", "api.steemit.com", "", Array As String("api.steemit.com", "steemd.minnowsupportproject.org", "steemd.privex.io", "rpc.steemviz.com", "rpc.curiesteem.com"))
cat2.AddList("pricehistory", "Price History", "Choose the price change to show", "24 Hours", "", Array As String("1 Hour", "24 Hours", "7 Days"))
cat3.Initialize("About SteemiAPP")
cat3.AddIntent("App Version", "Amberdawn/r"& appver&" - tap for changelog", SettingsIntent.OpenBrowser("https://steemi.app/changelog.html#r"& appver), "")
cat3.AddIntent("About", "App created by @dimitrisp. Tap to visit my Steemit Blog", SettingsIntent.OpenBrowser("https://steemit.com/@dimitrisp"), "")
cat3.AddIntent("Rate me?", "Rate this app! Tell me how to improve it!", SettingsIntent.OpenBrowser("https://play.google.com/store/apps/details?id=eu.dimitrisp.steenfo"), "")
'add the categories to the main screen
screen.AddPreferenceCategory(cat1)
screen.AddPreferenceCategory(cat2)
screen.AddPreferenceCategory(cat3)
End Sub
Sub DynGlobalProps(Props As String)
'Parse global properties to convert Vests to SP
' Log(Props)
Dim TempTVFS, TempTVFSPrecision, TempTVS, TempTVSPrecision As String
Dim parser As JSONParser
parser.Initialize(Props)
Dim root As Map = parser.NextObject
Dim currentProps As Map = root.Get("result")
' Blockchain sends named arrays some times, not sure why...
' Because of this, we have to handle both, by catching the error
Try
Dim curTVSMap As Map = currentProps.Get("total_vesting_shares")
TempTVS = curTVSMap.Get("amount")
TempTVSPrecision = curTVSMap.Get("precision")
Catch
Dim curTVS As List = currentProps.Get("total_vesting_shares")
TempTVS = curTVS.Get(0)
TempTVSPrecision = curTVS.Get(1)
End Try
Try
Dim curTVFSMap As Map = currentProps.Get("total_vesting_fund_steem")
TempTVFS = curTVFSMap.Get("amount")
TempTVFSPrecision = curTVFSMap.Get("precision")
Catch
Dim curTVFS As List = currentProps.Get("total_vesting_fund_steem")
TempTVFS = curTVFS.Get(0)
TempTVFSPrecision = curTVFS.Get(1)
End Try
TVFS = TempTVFS.SubString2(0, TempTVFS.Length - TempTVFSPrecision) & "." & TempTVFS.SubString(TempTVFS.Length - TempTVFSPrecision)
TVS = TempTVS.SubString2(0, TempTVS.Length - TempTVSPrecision) & "." & TempTVS.SubString(TempTVS.Length - TempTVSPrecision)
End Sub
Sub lblSidebar_Click
SideBarWidth = ScreenWidth - (ScreenWidth * 40 / 100)
' Log(SideBarWidth)
pnMenu.Visible = True
pnMenu.Width = ScreenWidth
Animator.Initialize("pnAnimator", 1)
Animator.Enabled = True
End Sub
Sub lblSidebar_LongClick
StartActivity(screen.CreateIntent)
End Sub
Sub lvAuthor_ItemClick (Position As Int, Value As Object)
ProgressDialogShow("Loading post, please wait...")
Dim PostArray() As String
PostArray = Regex.Split("/", Value)
'Log(Value)
'Log("Username: " & PostArray(0))
'Log("permlink: " & PostArray(1))
Dim job1,job2 As HttpJob
job1.Initialize("ShowPost",Me)
job1.PostString("https://" & server,"{""jsonrpc"":""2.0"", ""method"":""condenser_api.get_content"", ""params"":["""&PostArray(0)&""", """&PostArray(1)&"""], ""id"":1}")
End Sub
Sub lvClick(Value As Object)
'Used to handle the listview taps and load the selected post
ProgressDialogShow("Loading post, please wait...")
Dim PostArray() As String
PostArray = Regex.Split("/", Value)
Dim job1,job2 As HttpJob
job1.Initialize("ShowPost",Me)
job1.PostString("https://" & server,"{""jsonrpc"":""2.0"", ""method"":""condenser_api.get_content"", ""params"":["""&PostArray(0)&""", """&PostArray(1)&"""], ""id"":1}")
End Sub
Sub lvCuration_ItemClick (Position As Int, Value As Object)
lvClick(Value)
End Sub
Sub lvIncoming_ItemClick (Position As Int, Value As Object)
lvClick(Value)
End Sub
Sub lvMenu_ItemClick (Position As Int, Value As Object)
If Value = "Feed" Then
'Msgbox("Your Steemit feed will be available on a later version, by clicking here", "Coming Soon!")
Dim job1 As HttpJob
job1.Initialize("GetUserFeed", Me)
job1.PostString("https://" & server,"{""jsonrpc"":""2.0"", ""method"":""condenser_api.get_feed"", ""params"":["""&username&""",0,15], ""id"":1}")
Else If Value = "Refresh" Then
btnrefresh_Click
pnMenuClose_Click
Else If Value = "Price" Then
btnPrice_Click
pnMenuClose_Click
Else If Value = "Settings" Then
StartActivity(screen.CreateIntent)
pnMenuClose_Click
Else
End If
End Sub
Sub lvOutgoing_ItemClick (Position As Int, Value As Object)
lvClick(Value)
End Sub
Sub lvPosts_ItemClick (Position As Int, Value As Object)
lvClick(Value)
End Sub
Sub ParseAccHistory(AccHistory As String)
' Log(AccHistory)
Dim parser As JSONParser
parser.Initialize(AccHistory)
TotalSP = 0
'Clear previous data
lvAuthor.Clear
lvCuration.Clear
lvIncoming.Clear
lvOutgoing.Clear
uAuth.Clear
uCur.Clear
uIn.Clear
uOut.Clear
If AccHistory.Length < 3 Then
MsgboxAsync("The account name you've chosen, does not exist. If you believe this is an error, please choose a different API node","Error")
ProgressDialogHide
Return
End If
' Parse the server reply to get the account history
Dim root As Map = parser.NextObject
Dim result As List = root.Get("result")
'For Each result As List In parser.NextArray
For Each colroot2 As List In result
'Log(colroot2)
For Each colroot In colroot2
'Log(colroot)
Dim ColMap,OpMap,TXMap As Map
Dim ColInt As Int'ignore
Dim ThisType As String
TXMap.Initialize
If colroot Is Map Then
'Log("it's a map")
ColMap = colroot
Dim trx_id As String = ColMap.Get("trx_id")
Dim virtual_op As Int = ColMap.Get("virtual_op") 'ignore
Dim op As List = ColMap.Get("op")
Dim op_in_trx As Int = ColMap.Get("op_in_trx") 'ignore
Dim block As Int = ColMap.Get("block")
Dim trx_in_block As String = ColMap.Get("trx_in_block") 'ignore
Dim timestamp As String = ColMap.Get("timestamp")
For Each colop In op
If colop Is List Then
Else if colop Is Map Then
OpMap=colop
Else If colop Is String Then
ThisType = colop
Else
End If
Next
TXMap.Put("TXID", trx_id)
TXMap.Put("Block", block)
TXMap.Put("Timestamp", timestamp)
ParseTX(ThisType, TXMap, OpMap)
Else
'Not interested in any other type, so we skip it. Our data are stored in a map.
End If
Next
Next
' Fill incoming upvotes list view
For i = uIn.Size - 1 To 0 Step -1
Dim ThisTX() As String
ThisTX = Regex.Split("\^\$\^", uIn.Get(i))
lvIncoming.AddTwoLines2(ThisTX(0), ThisTX(1), ThisTX(2))
Next
'Fill outgoing upvotes list view
For i = uOut.Size - 1 To 0 Step -1
Dim ThisTX() As String
ThisTX = Regex.Split("\^\$\^", uOut.Get(i))
lvOutgoing.AddTwoLines2(ThisTX(0), ThisTX(1), ThisTX(2))
Next
'Fill curation rewards
For i = uCur.Size - 1 To 0 Step -1
Dim ThisTX() As String
ThisTX = Regex.Split("\^\$\^", uCur.Get(i))
'Log(ThisTX)
lvCuration.AddTwoLines2(ThisTX(0), ThisTX(1), ThisTX(2))
Next
'Fill recent Curation/Author rewards labels
totalCur.Text = Round2(TotalSP,3) & " Steem in Curation Rewards"
totalAuth.Text = "Total: " & Round2(TotalAuthSBD,3) & " SBD - " & Round2(TotalAuthSP,3) & " SP - " & Round2(TotalAuthSTEEM, 3) & " STEEM"
'Fill author rewards
For i = uAuth.Size - 1 To 0 Step -1
Dim ThisTX() As String
ThisTX = Regex.Split("\^\$\^", uAuth.Get(i))
'Log(ThisTX)
lvAuthor.AddTwoLines2(ThisTX(0), ThisTX(1), ThisTX(2))
Next
ProgressDialogHide
End Sub
Sub ParseAccInfo(AccInfo As String)
Dim parser As JSONParser
parser.Initialize(AccInfo)
Dim root As Map = parser.NextObject
Dim result As List = root.Get("result")
For Each colresult As Map In result
''' Generic Account Info
Dim last_account_update As String = colresult.Get("last_account_update")
Dim steemid As Int = colresult.Get("id")
Dim to_withdraw As Int = colresult.Get("to_withdraw")
Dim created As String = colresult.Get("created")
Dim received_vesting_shares As String = colresult.Get("received_vesting_shares") ' incoming delegations
Dim delegated_vesting_shares As String = colresult.Get("delegated_vesting_shares") ' outgoing delegations
Dim post_count As Int = colresult.Get("post_count")
Dim last_root_post As String = colresult.Get("last_root_post")
Dim last_post As String = colresult.Get("last_post")
Dim json_metadata As String = colresult.Get("json_metadata")
Dim last_owner_update As String = colresult.Get("last_owner_update")
Dim reputation As String = colresult.Get("reputation")
''' Wallet Info
Dim savings_balance As String = colresult.Get("savings_balance") ' STEEM Savings
Dim savings_sbd_balance As String = colresult.Get("savings_sbd_balance") ' SBD Savings
Dim balance As String = colresult.Get("balance") ' STEEM
Dim sbd_balance As String = colresult.Get("sbd_balance") ' SBD
''' Pending Rewards Data
Dim reward_steem_balance As String = colresult.Get("reward_steem_balance")
Dim reward_sbd_balance As String = colresult.Get("reward_sbd_balance")
Dim reward_vesting_balance As String = colresult.Get("reward_vesting_balance") ' Vests
Dim reward_vesting_steem As String = colresult.Get("reward_vesting_steem") ' SP
''' Vest Data
Dim vesting_withdraw_rate As String = colresult.Get("vesting_withdraw_rate")
Dim next_vesting_withdrawal As String = colresult.Get("next_vesting_withdrawal")
Dim vesting_shares As String = colresult.Get("vesting_shares")
Dim withdrawn As Int = colresult.Get("withdrawn") ' Vests withdrawn
''' Voting Power Calculation Data
Dim last_vote_time As String = colresult.Get("last_vote_time")
Dim voting_power As Int = colresult.Get("voting_power")
''' Witness Data
Dim proxy As String = colresult.Get("proxy") ' Witness proxy
Dim witnesses_voted_for As Int = colresult.Get("witnesses_voted_for")
'Dim witness_votes As List = colresult.Get("witness_votes")
'For Each colwitness_votes As String In witness_votes
'Next
Next
CalculateVP(voting_power, last_vote_time)
' Reputation calculation logic taken from
' https://steemit.com/steemit/@digitalnotvir/how-reputation-scores-are-calculated-the-details-explained-with-simple-math
userRep = Round2((((Logarithm(reputation, 10) - 9) * 9) + 25), 2)
SetupMenu ' To update Reputation
End Sub
Sub ParseFeed(FeedInput As String)
Dim parser As JSONParser
Dim uFeed As List
uFeed.Initialize
parser.Initialize(FeedInput)
Dim root As Map = parser.NextObject
Dim result As List = root.Get("result")
For Each colresult As Map In result
'Log(colresult)
Dim comment As Map = colresult.Get("comment")
Dim total_payout_value As String = comment.Get("total_payout_value")
Dim net_votes As Int = comment.Get("net_votes")
Dim root_author As String = comment.Get("root_author")
Dim title As String = comment.Get("title")
Dim body As String = comment.Get("body")
Dim net_rshares As String = comment.Get("net_rshares")
Log("Reward Balance = " & RewardBalance)
Log("Recent Claims = " & RecentClaims)
Log("Reward Shares = " & net_rshares)
''''''
' To calculate STEEM & SBD from RShares, use the following formula:
' STEEM = RewardShares * rewrd_balance / recent_claims
Dim SteemRewards As Double = net_rshares * RewardBalance / RecentClaims
Log("STEEM Rewards: " & SteemRewards)
Dim children As Int = comment.Get("children")
'Dim last_update As String = colresult.Get("last_update")
Dim permlink As String = comment.Get("permlink")
Dim created As String = comment.Get("created")
If body.Length > 40 Then
body = body.SubString2(0,40) & "..."
End If
Log(title & "^$^" & body.SubString2(0,20) & "^$^" & SteemRewards & "^$^" & net_votes & "^$^" & children & "^$^" & created & "^$^" & root_author & "/" & permlink)
uFeed.Add(title & "^$^" & body & "^$^" & SteemRewards & "^$^" & net_votes & "^$^" & children & "^$^" & created & "^$^" & root_author & "/" & permlink)
Next
End Sub
Sub ParsePrice(PriceInput As String)
If (PriceInput.Length < 20) Then
Msgbox("CoinMarketCap returned error. Please try again later","CoinMarketCap Error")
'ToastMessageShow("Remote server is busy, try again later...", True)
Return
End If
Dim parser As JSONParser
parser.Initialize(PriceInput)
Dim root As Map = parser.NextObject
'Dim metadata As Map = root.Get("metadata")
'Dim timestamp As Int = metadata.Get("timestamp")
Try
Dim data As Map = root.Get("data")
Catch
Msgbox("CoinMarketCap returned error. Please try again later","CoinMarketCap Error")
End Try
Dim pricehistoryfetch As String
If pricehistory = "1 Hour" Then
pricehistoryfetch = "percent_change_1h"
Else if pricehistory = "24 Hours" Then
pricehistoryfetch = "percent_change_24h"
Else if pricehistory = "7 Days" Then
pricehistoryfetch = "percent_change_7d"
Else
pricehistoryfetch = "percent_change_24h" 'Default if for some reason there is nothing set.
End If
Dim symbol As String = data.Get("symbol")
Dim quotes As Map = data.Get("quotes")
Dim USD As Map = quotes.Get("USD")
Try
Dim percent_change As Double = USD.Get(pricehistoryfetch)
Catch
Dim percent_change As Double = USD.Get("percent_change_24h")
End Try
Dim price As Double = USD.Get("price")
If symbol = "SBD" Then
lblSBDPrice.text = "$" & price
If percent_change < 0 Then
lblSBDChange.TextColor = Colors.RGB(255, 89, 89)
Else If percent_change > 0 Then
lblSBDChange.TextColor = Colors.RGB(123, 255, 89)
Else
lblSBDChange.TextColor = Colors.White
End If
lblSBDChange.Text = "Change: " & percent_change & "%"
Else If symbol = "STEEM" Then
lblSTEEMPrice.Text = "$" & price
If percent_change < 0 Then
lblSTEEMChange.TextColor = Colors.RGB(255, 89, 89)
Else If percent_change > 0 Then
lblSTEEMChange.TextColor = Colors.RGB(123, 255, 89)
Else
lblSTEEMChange.TextColor = Colors.White
End If
lblSTEEMChange.Text = "Change: " & percent_change & "%"
lblPriceLoading.Text = ""
End If
End Sub
Sub ParseRewardFund (RewardFunds As String)
Dim parser As JSONParser
parser.Initialize(RewardFunds)
Dim root As Map = parser.NextObject
Dim result As Map = root.Get("result")
Dim recent_claims, reward_balance As String
'RecentClaims = recent_claims.SubString2(0, recent_claims.IndexOf(" "))
RecentClaims = result.Get("recent_claims")
reward_balance = result.Get("reward_balance")
Log("Reward balance: " & reward_balance)
RewardBalance = reward_balance.SubString2(0, reward_balance.IndexOf(" "))
End Sub
Sub ParseSinglePost (TX As String)
'Log(TX)
' Log(TX)
If TX.Length < 20 Then
MsgboxAsync("Server error. Please try again later or choose a different API node","Error")
End If
Dim Parser As JSONParser
Parser.Initialize(TX)
Dim root As Map = Parser.NextObject
Try
Dim result As Map = root.Get("result")
Dim title As String = result.Get("title")
Catch
ProgressDialogHide
Msgbox("Unable to fetch post. API Node returns error. If the problem persists, please choose a different API node", "Error")
Return
End Try
Dim body As String = result.Get("body")
Dim permlink As String = result.Get("permlink")
'Dim promoted As String = result.Get("promoted")
Dim pending_payout_value As String = result.Get("pending_payout_value")
'Dim reblogged_by As List = result.Get("reblogged_by")
Dim active_votes As List = result.Get("active_votes")
Dim votescount, thisvote As Int = 0
votescount = active_votes.Size
ChosenUpvotedBy = ""
For Each colactive_votes As Map In active_votes
'Dim weight As Int = colactive_votes.Get("weight")
'Dim reputation As String = colactive_votes.Get("reputation")
Dim voter As String = colactive_votes.Get("voter")
thisvote = thisvote + 1
If votescount > 6 Then
If thisvote < 6 Then
ChosenUpvotedBy = voter & ", " & ChosenUpvotedBy
Else if thisvote = 6 Then
ChosenUpvotedBy = voter & ", " & ChosenUpvotedBy & " " & (votescount - thisvote) & " more"
Else
End If
Else ' votescount 6 or less
If thisvote = 1 Then
ChosenUpvotedBy = voter
Else
ChosenUpvotedBy = voter & ", " & ChosenUpvotedBy
End If
End If
Next
Dim author As String = result.Get("author")
Dim created As String = result.Get("created")
Dim url As String = result.Get("url")
ChosenPostBody = body
' Hack for Steepshot's broken horizontal line
ChosenPostURL = "https://steemit.com/" & url
ChosenPostBody = ChosenPostBody.Replace("- -- - - --- -- - - -- - - ----- -- - - ---- - - - --", "---")
ChosenPostBody =ChosenPostBody.Replace("-- - - - ---- - - -- ----- - - -- - - -- --- - - -- -", "---")
ChosenPostTitle = title
ChosenPostPPV = pending_payout_value
ChosenPostAuthor = author
ChosenPostCreated = TimeStampConvert(created, "Past")
Log("Post URL: " & permlink)
Dim job1 As HttpJob
job1.Initialize("GetReplies",Me)
job1.PostString("https://" & server,"{""jsonrpc"":""2.0"", ""method"":""condenser_api.get_content_replies"", ""params"":["""&ChosenPostAuthor&""", """&permlink&"""], ""id"":1}")
End Sub
Sub ParsePostReplies(RemoteReplies As String)
Dim parser As JSONParser
parser.Initialize(RemoteReplies)
Dim root As Map = parser.NextObject
Dim result As List = root.Get("result")
For Each colresult As Map In result
Dim parent_author As String = colresult.Get("parent_author")
Dim max_accepted_payout As String = colresult.Get("max_accepted_payout")
Dim total_payout_value As String = colresult.Get("total_payout_value")
Dim net_votes As Int = colresult.Get("net_votes")
Dim root_author As String = colresult.Get("root_author")
Dim reward_weight As Int = colresult.Get("reward_weight")
Dim title As String = colresult.Get("title")
Dim body As String = colresult.Get("body")
Dim promoted As String = colresult.Get("promoted")
Dim curator_payout_value As String = colresult.Get("curator_payout_value")
Dim total_vote_weight As Int = colresult.Get("total_vote_weight")
Dim pending_payout_value As String = colresult.Get("pending_payout_value")
Dim reblogged_by As List = colresult.Get("reblogged_by")
Dim allow_curation_rewards As String = colresult.Get("allow_curation_rewards")
Dim allow_replies As String = colresult.Get("allow_replies")
Dim children As Int = colresult.Get("children")
Dim last_update As String = colresult.Get("last_update")
Dim active_votes As List = colresult.Get("active_votes")
Dim id As Int = colresult.Get("id")
Dim last_payout As String = colresult.Get("last_payout")
Dim vote_rshares As Int = colresult.Get("vote_rshares")
Dim beneficiaries As List = colresult.Get("beneficiaries")
Dim parent_permlink As String = colresult.Get("parent_permlink")
Dim abs_rshares As Int = colresult.Get("abs_rshares")
Dim author As String = colresult.Get("author")
Dim created As String = colresult.Get("created")
Dim active As String = colresult.Get("active")
Dim allow_votes As String = colresult.Get("allow_votes")
Dim author_reputation As String = colresult.Get("author_reputation")
Dim children_abs_rshares As Int = colresult.Get("children_abs_rshares")
Dim root_permlink As String = colresult.Get("root_permlink")
Dim url As String = colresult.Get("url")
Dim body_length As Int = colresult.Get("body_length")
Dim percent_steem_dollars As Int = colresult.Get("percent_steem_dollars")
Dim depth As Int = colresult.Get("depth")
Dim total_pending_payout_value As String = colresult.Get("total_pending_payout_value")
Dim max_cashout_time As String = colresult.Get("max_cashout_time")
Dim Replies As List = colresult.Get("replies")
Dim cashout_time As String = colresult.Get("cashout_time")
Dim category As String = colresult.Get("category")
Dim root_title As String = colresult.Get("root_title")
Dim permlink As String = colresult.Get("permlink")
Dim json_metadata As String = colresult.Get("json_metadata")
Dim author_rewards As Int = colresult.Get("author_rewards")
Dim net_rshares As Int = colresult.Get("net_rshares")
Log("==== Comment Details ====")
Log("Author: " & author)
Log("Body: " & body)
Log("Number of replies: " & children)
Log("Net Votes: " & net_votes)
If net_votes = 1 Then
Dim votestext As String = "Vote"
Else
Dim votestext As String = "Votes"
End If
If children = 1 Then
Dim repliestext As String = "Reply"
Else if children > 1 Then
Dim repliestext As String = "Replies"
Else
Dim repliestext As String = "Replies"
End If
' Comment Header
ChosenPostReplies = ChosenPostReplies & "<p class=""lead"" style=""margin-top:20px;""><img src=""https://cdn.steemitimages.com/u/" & author & "/avatar"" style=""display: inline-block;background-size: cover;background-repeat: no-repeat;background-position: 50% 50%;border-radius: 50%;width: 48px;height: 48px;""> <a href=""#"">" & author & "</a> <small><a href=""#"">" & TimeStampConvert(created, "Past") & "</a></small> </p>"
' Comment Body
ChosenPostReplies = ChosenPostReplies & body & "<br />"
' Comment footer
ChosenPostReplies = ChosenPostReplies & "<p style=""margin-top:10px;""><span class=""Icon chevron-up-circle"" style=""display: inline-block; width: 1.12rem; height: 1.12rem;""><svg enable-background=""new 0 0 33 33"" version=""1.1"" viewBox=""0 0 33 33"" xml:space=""preserve"" xmlns=""http://www.w3.org/2000/svg"" xmlns:xlink=""http://www.w3.org/1999/xlink""><g id=""Chevron_Up_Circle""><circle cx=""16"" cy=""16"" r=""15"" stroke=""#121313"" fill=""none""></circle><path d=""M16.699,11.293c-0.384-0.38-1.044-0.381-1.429,0l-6.999,6.899c-0.394,0.391-0.394,1.024,0,1.414 c0.395,0.391,1.034,0.391,1.429,0l6.285-6.195l6.285,6.196c0.394,0.391,1.034,0.391,1.429,0c0.394-0.391,0.394-1.024,0-1.414 L16.699,11.293z"" fill=""#121313""></path></g></svg></span> $" & total_payout_value & " | " & net_votes & " " & votestext & " | " & children & " " & repliestext & "</p>"
Next
'Dim id As Int = root.Get("id")
'Dim jsonrpc As String = root.Get("jsonrpc")
ProgressDialogHide
StartActivity("ShowPost")
End Sub
Sub ParseTX(TXType As String, TXData As Map, OpData As Map)
'Log("Called for " & TXType)
' TX Data {TXID=93693a4670ec71c0d0730be92a697978bac8b139, Block=22557278, Timestamp=2018-05-19T04:29:27}
Dim txID As String = TXData.Get("TXID")
Dim BlockID As String = TXData.Get("Block")
Dim timestamp As String = TimeStampConvert(TXData.Get("Timestamp"), "Past")
If TXType = "vote" Then
' Vote Data {voter=dimitrisp, author=nadia.greece, permlink=you-would-live-in-this-house, weight=9000}
Dim Voter As String = OpData.Get("voter")
Dim Author As String = OpData.Get("author")
Dim PermLink As String = OpData.Get("permlink")
Dim Weight As Float = OpData.Get("weight") / 100
If Voter = username Then
'lvOutgoing.AddTwoLines2(Author & " - " & Weight & "% weight", PermLink, TXType & "^" & txID & "^" &BlockID & "^" & PermLink)
uOut.Add(Author & " (" & Round2(Weight, 2) & "%) " & timestamp & "^$^" & PermLink & "^$^" & Author & "/" & PermLink)
Else
' & "^$^" &
'lvIncoming.AddTwoLines2(Voter & " - " & Weight & "%", PermLink, TXType & "^" & txID & "^" &BlockID & "^" & PermLink)
uIn.Add(Voter & " (" & Round2(Weight,2) & "%) " & timestamp & "^$^" & PermLink & "^$^" & Author & "/" & PermLink)
End If
Else If TXType = "curation_reward" Then
' Curation Data: {curator=dimitrisp, reward=10.173043 VESTS, comment_author=evimeria, comment_permlink=7-day-wayback-music-challenge-day-2-bee-geesstaying-alive}
' lvCuration.AddTwoLines2(Round2(ConvertVestToSP(OpData.Get("reward")),3) & "SP @ " & timestamp, "@" & OpData.Get("comment_author") & "/" & OpData.Get("comment_permlink"), TXType & "^" & txID & "^" &BlockID & "^" & PermLink)
'
Dim SP As String = OpData.Get("reward")
Dim Author As String = OpData.Get("comment_author")
Dim PermLink As String = OpData.Get("comment_permlink")
SP = ConvertVestToSP(OpData.Get("reward"))
uCur.Add(Round2(SP ,3) & "SP - " & timestamp & "^$^" & "@" & OpData.Get("comment_author") & "/" & OpData.Get("comment_permlink") & "^$^" & Author & "/" & PermLink)
TotalSP = TotalSP + SP
'pLog(TotalSP & " SP so far")
Else If TXType = "author_reward" Then
'Log(OpData)
' Author data: {author=dimitrisp, permlink=just-groomed--2018-05-11-13-45-28, sbd_payout=3.280 SBD, steem_payout=0.000 STEEM, vesting_payout=2348.010523 VESTS}
Dim Author As String = OpData.Get("Author")
Dim PermLink As String = OpData.Get("permlink")
Dim SBD As String = OpData.Get("sbd_payout")
Dim STEEM As String = OpData.Get("steem_payout")
Dim SP As String = OpData.Get("vesting_payout")
SP = ConvertVestToSP(SP)
If PermLink.Length <= 60 Then
Else
PermLink = PermLink.SubString2(0, 60) & "..."
End If
If STEEM = "0.000 STEEM" Then
STEEM = ""
Else
TotalAuthSTEEM = TotalAuthSTEEM + STEEM.Replace(" STEEM", "")
STEEM = ", " & STEEM.Replace(" ", "")
End If
TotalAuthSBD = TotalAuthSBD + SBD.Replace(" SBD", "")
TotalAuthSP = TotalAuthSP + Round2(SP, 3)
uAuth.Add(SBD.Replace(" ", "") & STEEM & ", " & Round2(SP, 3) & "SP - " & timestamp & "^$^" & PermLink & "^$^" & TXType & "^" & txID & "^" &BlockID & "^" & Author & "/" & PermLink)
Else
'Log (TXType)
End If
End Sub
Sub ParseUserPost(PostHistory As String)
Dim parser As JSONParser
parser.Initialize(PostHistory)
Dim uPosts As List
uPosts.Initialize
lvPosts.Clear
TotalSBD = 0
If PostHistory.Length < 20 Then
Return
End If
Dim root As Map = parser.NextObject
Dim result As List = root.Get("result")
For Each root As Map In result
'Log(root)
Dim title As String = root.Get("title")
Dim pending_payout_value As String = root.Get("pending_payout_value")
Dim last_payout As String = root.Get("last_payout")
Dim author As String = root.Get("author")
Dim cashout_time As String = TimeStampConvert(root.Get("cashout_time"), "Future")
Dim permlink As String = root.Get("permlink")
If author = username And last_payout = "1970-01-01T00:00:00" Then
uPosts.Add(title & "^$^" & pending_payout_value & " in " & cashout_time & "^$^" & author & "/" & permlink)
TotalSBD = TotalSBD + pending_payout_value.Replace(" SBD", "")
End If
Next
'Log(uPosts.Size)
For i = 0 To uPosts.Size - 1
Dim ThisPost() As String
'Log(uPosts.Get(i))
ThisPost = Regex.Split("\^\$\^", uPosts.Get(i))
'Log(ThisPost)
Dim PostTitle As String
If ThisPost(0).Length <= 45 Then
PostTitle = ThisPost(0)
Else
PostTitle = ThisPost(0).SubString2(0, 45) & "..."
End If
lvPosts.AddTwoLines2(PostTitle, ThisPost(1), ThisPost(2))
Next
totalPend.Text = Round2(TotalSBD,3) & " SBD in Pending Rewards"
uPosts.Clear
End Sub
Sub pnAnimator_tick
If lvMenu.Width < SideBarWidth Then
lvMenu.Width = lvMenu.Width + 35
Else
Animator.Enabled = False
End If
End Sub
Sub pnMenu_Click
' Duplicate of pnMenuClose_Click
pnMenu.Visible = False
lvMenu.Width = 0
End Sub
Sub pnMenuClose_Click
' Duplicate of pnMenu_Click
pnMenu.Visible = False
lvMenu.Width = 0
End Sub
Sub pnPrice_Click
pnPrice.Visible = False
End Sub
Sub SetDefaults
'defaults are only set on the first run.
manager.SetString("username", "dimitrisp")
manager.SetString("server", "api.steemit.com")
manager.SetString("entriesno", "250")
manager.SetString("postsno", "15")
manager.SetString("pricehistory", "24 Hours")
End Sub
Sub SetupMenu()
lvMenu.Clear
lvMenu.AddSingleLine2(username & " (" & userRep & ")", "About")
lvMenu.AddSingleLine2(CombineTextWithMaterialIcons(Chr(0xe0e5) & " My Feed"), "Feed")
lvMenu.AddSingleLine2(CombineTextWithMaterialIcons(Chr(0xe5d5) & " Refresh"), "Refresh")
lvMenu.AddSingleLine2(CombineTextWithMaterialIcons(Chr(0xe84f) & " SBD/Steem Price"), "Price")
lvMenu.AddSingleLine2(CombineTextWithMaterialIcons(Chr(0xe8b8) & " Settings"), "Settings")
End Sub
Sub SetupUI()
auth1 = LoadBitmap(File.DirAssets, "author.png")
auth2 = LoadBitmap(File.DirAssets, "author2.png")
in1 = LoadBitmap(File.DirAssets, "incoming.png")
in2 = LoadBitmap(File.DirAssets, "incoming2.png")
out1 = LoadBitmap(File.DirAssets, "outgoing.png")
out2 = LoadBitmap(File.DirAssets, "outgoing2.png")
posts1 = LoadBitmap(File.DirAssets, "posts.png")
posts2 = LoadBitmap(File.DirAssets, "posts2.png")
cur1 = LoadBitmap(File.DirAssets, "curation.png")