From 7525a58477553e5892cc705b395d8089fe5be345 Mon Sep 17 00:00:00 2001 From: jwinterm Date: Thu, 24 Dec 2015 04:15:09 -0800 Subject: [PATCH] Moved check wallet queue out of timer to render loop. Added tiny fony. --- android/assets/skin/tiny.fnt | 100 ++++++++++++++++++ android/assets/skin/tiny.png | Bin 0 -> 5028 bytes android/assets/skin/uiskin.json | 6 +- .../jw/lightwallet/screens/CreateScreen.java | 13 ++- .../jw/lightwallet/screens/DaemonView.java | 12 ++- .../lightwallet/screens/ImportKeysScreen.java | 22 ++-- .../jw/lightwallet/screens/MainScreen.java | 45 +++++++- .../lightwallet/screens/TransactionView.java | 20 ++-- 8 files changed, 188 insertions(+), 30 deletions(-) create mode 100644 android/assets/skin/tiny.fnt create mode 100644 android/assets/skin/tiny.png diff --git a/android/assets/skin/tiny.fnt b/android/assets/skin/tiny.fnt new file mode 100644 index 0000000..78f669a --- /dev/null +++ b/android/assets/skin/tiny.fnt @@ -0,0 +1,100 @@ +info face="Droid Sans" size=11 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=0,0 +common lineHeight=14 base=11 scaleW=512 scaleH=512 pages=1 packed=0 +page id=0 file="tiny.png" +chars count=94 +char id=32 x=0 y=0 width=0 height=0 xoffset=0 yoffset=11 xadvance=3 page=0 chnl=0 +char id=124 x=0 y=0 width=2 height=13 xoffset=2 yoffset=2 xadvance=5 page=0 chnl=0 +char id=106 x=2 y=0 width=4 height=13 xoffset=-1 yoffset=2 xadvance=2 page=0 chnl=0 +char id=93 x=6 y=0 width=4 height=12 xoffset=0 yoffset=2 xadvance=3 page=0 chnl=0 +char id=91 x=10 y=0 width=4 height=12 xoffset=1 yoffset=2 xadvance=3 page=0 chnl=0 +char id=41 x=14 y=0 width=4 height=12 xoffset=0 yoffset=2 xadvance=3 page=0 chnl=0 +char id=40 x=18 y=0 width=3 height=12 xoffset=0 yoffset=2 xadvance=3 page=0 chnl=0 +char id=81 x=21 y=0 width=8 height=12 xoffset=1 yoffset=2 xadvance=9 page=0 chnl=0 +char id=74 x=29 y=0 width=5 height=12 xoffset=-1 yoffset=2 xadvance=3 page=0 chnl=0 +char id=36 x=34 y=0 width=6 height=11 xoffset=0 yoffset=2 xadvance=6 page=0 chnl=0 +char id=125 x=40 y=0 width=5 height=11 xoffset=0 yoffset=3 xadvance=4 page=0 chnl=0 +char id=123 x=45 y=0 width=5 height=11 xoffset=1 yoffset=3 xadvance=4 page=0 chnl=0 +char id=121 x=50 y=0 width=8 height=11 xoffset=-1 yoffset=4 xadvance=6 page=0 chnl=0 +char id=113 x=58 y=0 width=7 height=11 xoffset=0 yoffset=4 xadvance=6 page=0 chnl=0 +char id=112 x=65 y=0 width=7 height=11 xoffset=0 yoffset=4 xadvance=6 page=0 chnl=0 +char id=103 x=72 y=0 width=7 height=11 xoffset=0 yoffset=4 xadvance=6 page=0 chnl=0 +char id=35 x=79 y=0 width=9 height=10 xoffset=0 yoffset=2 xadvance=7 page=0 chnl=0 +char id=37 x=88 y=0 width=9 height=10 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=0 +char id=92 x=97 y=0 width=7 height=10 xoffset=-1 yoffset=2 xadvance=4 page=0 chnl=0 +char id=64 x=104 y=0 width=10 height=10 xoffset=1 yoffset=3 xadvance=10 page=0 chnl=0 +char id=47 x=114 y=0 width=7 height=10 xoffset=-1 yoffset=2 xadvance=4 page=0 chnl=0 +char id=59 x=121 y=0 width=3 height=10 xoffset=0 yoffset=4 xadvance=3 page=0 chnl=0 +char id=33 x=124 y=0 width=4 height=10 xoffset=0 yoffset=2 xadvance=3 page=0 chnl=0 +char id=48 x=128 y=0 width=7 height=10 xoffset=0 yoffset=2 xadvance=6 page=0 chnl=0 +char id=57 x=135 y=0 width=7 height=10 xoffset=0 yoffset=2 xadvance=6 page=0 chnl=0 +char id=56 x=142 y=0 width=7 height=10 xoffset=0 yoffset=2 xadvance=6 page=0 chnl=0 +char id=55 x=149 y=0 width=7 height=10 xoffset=0 yoffset=2 xadvance=6 page=0 chnl=0 +char id=54 x=156 y=0 width=7 height=10 xoffset=0 yoffset=2 xadvance=6 page=0 chnl=0 +char id=53 x=163 y=0 width=6 height=10 xoffset=0 yoffset=2 xadvance=6 page=0 chnl=0 +char id=52 x=169 y=0 width=7 height=10 xoffset=0 yoffset=2 xadvance=6 page=0 chnl=0 +char id=51 x=176 y=0 width=7 height=10 xoffset=0 yoffset=2 xadvance=6 page=0 chnl=0 +char id=50 x=183 y=0 width=7 height=10 xoffset=0 yoffset=2 xadvance=6 page=0 chnl=0 +char id=49 x=190 y=0 width=4 height=10 xoffset=1 yoffset=2 xadvance=6 page=0 chnl=0 +char id=108 x=194 y=0 width=2 height=10 xoffset=0 yoffset=2 xadvance=2 page=0 chnl=0 +char id=107 x=196 y=0 width=6 height=10 xoffset=0 yoffset=2 xadvance=5 page=0 chnl=0 +char id=105 x=202 y=0 width=4 height=10 xoffset=-1 yoffset=2 xadvance=2 page=0 chnl=0 +char id=104 x=206 y=0 width=7 height=10 xoffset=0 yoffset=2 xadvance=6 page=0 chnl=0 +char id=102 x=213 y=0 width=5 height=10 xoffset=0 yoffset=2 xadvance=4 page=0 chnl=0 +char id=100 x=218 y=0 width=7 height=10 xoffset=0 yoffset=2 xadvance=6 page=0 chnl=0 +char id=98 x=225 y=0 width=7 height=10 xoffset=0 yoffset=2 xadvance=6 page=0 chnl=0 +char id=90 x=232 y=0 width=7 height=10 xoffset=1 yoffset=2 xadvance=7 page=0 chnl=0 +char id=89 x=239 y=0 width=10 height=10 xoffset=-1 yoffset=2 xadvance=7 page=0 chnl=0 +char id=88 x=249 y=0 width=9 height=10 xoffset=-1 yoffset=2 xadvance=6 page=0 chnl=0 +char id=87 x=258 y=0 width=12 height=10 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 +char id=86 x=270 y=0 width=10 height=10 xoffset=-1 yoffset=2 xadvance=7 page=0 chnl=0 +char id=85 x=280 y=0 width=8 height=10 xoffset=1 yoffset=2 xadvance=8 page=0 chnl=0 +char id=84 x=288 y=0 width=7 height=10 xoffset=0 yoffset=2 xadvance=5 page=0 chnl=0 +char id=82 x=295 y=0 width=7 height=10 xoffset=1 yoffset=2 xadvance=7 page=0 chnl=0 +char id=80 x=302 y=0 width=5 height=10 xoffset=1 yoffset=2 xadvance=6 page=0 chnl=0 +char id=79 x=307 y=0 width=8 height=10 xoffset=1 yoffset=2 xadvance=9 page=0 chnl=0 +char id=78 x=315 y=0 width=8 height=10 xoffset=1 yoffset=2 xadvance=8 page=0 chnl=0 +char id=77 x=323 y=0 width=10 height=10 xoffset=1 yoffset=2 xadvance=10 page=0 chnl=0 +char id=76 x=333 y=0 width=5 height=10 xoffset=1 yoffset=2 xadvance=5 page=0 chnl=0 +char id=75 x=338 y=0 width=8 height=10 xoffset=1 yoffset=2 xadvance=7 page=0 chnl=0 +char id=73 x=346 y=0 width=4 height=10 xoffset=0 yoffset=2 xadvance=3 page=0 chnl=0 +char id=72 x=350 y=0 width=8 height=10 xoffset=1 yoffset=2 xadvance=8 page=0 chnl=0 +char id=71 x=358 y=0 width=8 height=10 xoffset=1 yoffset=2 xadvance=8 page=0 chnl=0 +char id=70 x=366 y=0 width=6 height=10 xoffset=1 yoffset=2 xadvance=5 page=0 chnl=0 +char id=69 x=372 y=0 width=6 height=10 xoffset=1 yoffset=2 xadvance=6 page=0 chnl=0 +char id=68 x=378 y=0 width=8 height=10 xoffset=1 yoffset=2 xadvance=8 page=0 chnl=0 +char id=67 x=386 y=0 width=8 height=10 xoffset=1 yoffset=2 xadvance=7 page=0 chnl=0 +char id=66 x=394 y=0 width=7 height=10 xoffset=1 yoffset=2 xadvance=7 page=0 chnl=0 +char id=65 x=401 y=0 width=10 height=10 xoffset=-1 yoffset=2 xadvance=7 page=0 chnl=0 +char id=38 x=411 y=0 width=8 height=9 xoffset=0 yoffset=3 xadvance=8 page=0 chnl=0 +char id=63 x=419 y=0 width=5 height=9 xoffset=0 yoffset=3 xadvance=5 page=0 chnl=0 +char id=116 x=424 y=0 width=5 height=9 xoffset=0 yoffset=3 xadvance=4 page=0 chnl=0 +char id=83 x=429 y=0 width=7 height=9 xoffset=0 yoffset=3 xadvance=6 page=0 chnl=0 +char id=58 x=436 y=0 width=2 height=8 xoffset=1 yoffset=4 xadvance=3 page=0 chnl=0 +char id=122 x=438 y=0 width=6 height=8 xoffset=0 yoffset=4 xadvance=5 page=0 chnl=0 +char id=120 x=444 y=0 width=6 height=8 xoffset=0 yoffset=4 xadvance=6 page=0 chnl=0 +char id=119 x=450 y=0 width=10 height=8 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 +char id=118 x=460 y=0 width=8 height=8 xoffset=-1 yoffset=4 xadvance=6 page=0 chnl=0 +char id=117 x=468 y=0 width=7 height=8 xoffset=0 yoffset=4 xadvance=6 page=0 chnl=0 +char id=115 x=475 y=0 width=6 height=8 xoffset=-1 yoffset=4 xadvance=5 page=0 chnl=0 +char id=114 x=481 y=0 width=4 height=8 xoffset=0 yoffset=4 xadvance=4 page=0 chnl=0 +char id=111 x=485 y=0 width=7 height=8 xoffset=0 yoffset=4 xadvance=6 page=0 chnl=0 +char id=110 x=492 y=0 width=7 height=8 xoffset=0 yoffset=4 xadvance=6 page=0 chnl=0 +char id=109 x=499 y=0 width=11 height=8 xoffset=0 yoffset=4 xadvance=10 page=0 chnl=0 +char id=101 x=0 y=13 width=7 height=8 xoffset=0 yoffset=4 xadvance=6 page=0 chnl=0 +char id=99 x=7 y=13 width=5 height=8 xoffset=0 yoffset=4 xadvance=5 page=0 chnl=0 +char id=97 x=12 y=13 width=7 height=8 xoffset=0 yoffset=4 xadvance=6 page=0 chnl=0 +char id=42 x=19 y=13 width=8 height=7 xoffset=-1 yoffset=2 xadvance=6 page=0 chnl=0 +char id=43 x=27 y=13 width=7 height=7 xoffset=-1 yoffset=4 xadvance=6 page=0 chnl=0 +char id=94 x=34 y=13 width=7 height=7 xoffset=0 yoffset=2 xadvance=6 page=0 chnl=0 +char id=62 x=41 y=13 width=6 height=6 xoffset=1 yoffset=5 xadvance=6 page=0 chnl=0 +char id=60 x=47 y=13 width=6 height=6 xoffset=1 yoffset=5 xadvance=6 page=0 chnl=0 +char id=61 x=53 y=13 width=6 height=5 xoffset=1 yoffset=5 xadvance=6 page=0 chnl=0 +char id=44 x=59 y=13 width=3 height=5 xoffset=0 yoffset=9 xadvance=3 page=0 chnl=0 +char id=39 x=62 y=13 width=3 height=5 xoffset=1 yoffset=2 xadvance=3 page=0 chnl=0 +char id=34 x=65 y=13 width=5 height=5 xoffset=1 yoffset=2 xadvance=5 page=0 chnl=0 +char id=46 x=70 y=13 width=2 height=4 xoffset=1 yoffset=8 xadvance=3 page=0 chnl=0 +char id=96 x=72 y=13 width=4 height=4 xoffset=2 yoffset=1 xadvance=6 page=0 chnl=0 +char id=126 x=76 y=13 width=6 height=3 xoffset=1 yoffset=6 xadvance=6 page=0 chnl=0 +char id=95 x=82 y=13 width=7 height=3 xoffset=0 yoffset=11 xadvance=5 page=0 chnl=0 +char id=45 x=89 y=13 width=5 height=3 xoffset=0 yoffset=7 xadvance=4 page=0 chnl=0 +kernings count=-1 diff --git a/android/assets/skin/tiny.png b/android/assets/skin/tiny.png new file mode 100644 index 0000000000000000000000000000000000000000..8404c58d4a7651e84e28b763bffb2680c2347c6b GIT binary patch literal 5028 zcmeHK`8U*y|9*2_shjAkD`Tmslx&G)8B&bwYsxy7YYQ_C#=ca#l1wTx2{VC~B4Zz7W@MScFq3V@SZ2Q6&!6!<_xa`Z{P3LDIj`qD=Q-!~$kEB?_D{eEPePVB*c`J z{eM+f7Cn3~<6pd1`OrVXyu5ry>I(S?tT=l4Pk zj%hqB4vcLuZX#vdGe>vfm# zsYT@tH7Z%Afn_B(0@c5YhqV&c64Z#i&<6EV9!ZXYNFeBX^hYut@l4U=m0Sv3Ww>Dll}`H)PKkHJef|^ixWeik?tBy<5x`^VS#Lx2Kqq z>?bYBAtQv!)11C;o|b=s)bJ(K62pbS60*fI#nr(R>GUnV!t2a_>e zKZ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Nq@XEG%Bd~!J>xu{?ahm0mE=sz}z3a{)m+%vuXPBKFhUvz} z5Mzj2(|fi9($a;fOo}zK6ZgD*gpo5|KC5#rCGhV*37fidFw_Fk7^%J0({H+rlDBvoP=8m zfpC~a6UmH)Ah$eRd`=5>Ww_9#0rk14!C?tX0<(2)!f!Tm0!ii@TNAq7fIIo{Phq-G zJ0iadtXgBA-~V7G((bj~VKMi}Z-0}j-Ub>q39Rp^qCE5Q4XmD_(FZFjp;_D_{d9JL ziX9@nUIs*1?A}=~jnW>aA`#hbra%Za@`zkaX<-BG?YOIo%r0#lTk0HQ+Mq^AaEPqP zxCCF%8R4=Hi;Iq%_{EI0`K``;zGIrX04bT`!L_!3lkFMDX+P)@9{V+gOZ3mNi1^Qz(n^T7x+~5Rjk!!LN(UN9G4SyH}W)nzwkOJ<>MN;JVvic zL4!nlsyFb%02~@&p!b|CpGp_FiyiD83~5wi;z5KZ2N@+VXRN9AQSdf9yHuep_@pVJ z%OwZ1vA5qEn68mzb`VWtWWam9Bhpeci}sw^O@9aA$0^Ky?VG|(=j}e{cxf`LdzfUb z3IHko(mxFMzTbPSv%7bOA)(N9s(s&Teia-3#>NcT;)#n4CuiTyB8@R#`}XJ|etzix k;XeodbKw7p15G(Xk-R<1)~ZOsz`rM1S=gIbU-iBJf7FLkDgXcg literal 0 HcmV?d00001 diff --git a/android/assets/skin/uiskin.json b/android/assets/skin/uiskin.json index dcc8af2..e8838ea 100644 --- a/android/assets/skin/uiskin.json +++ b/android/assets/skin/uiskin.json @@ -1,5 +1,8 @@ { -com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file: default.fnt } }, +com.badlogic.gdx.graphics.g2d.BitmapFont: { + default-font: { file: default.fnt }, + tiny-font: { file: tiny.fnt } +}, com.badlogic.gdx.graphics.Color: { green: { a: 1, b: 0, g: 1, r: 0 }, white: { a: 1, b: 1, g: 1, r: 1 }, @@ -50,6 +53,7 @@ com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: { }, com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle: { default: { selection: selection, background: textfield, font: default-font, fontColor: white, cursor: cursor } + tinytext: { selection: selection, background: textfield, font: tiny-font, fontColor: white, cursor: cursor } }, com.badlogic.gdx.scenes.scene2d.ui.CheckBox$CheckBoxStyle: { default: { checkboxOn: check-on, checkboxOff: check-off, font: default-font, fontColor: white } diff --git a/core/src/com/jw/lightwallet/screens/CreateScreen.java b/core/src/com/jw/lightwallet/screens/CreateScreen.java index 3ddacbe..30d226a 100644 --- a/core/src/com/jw/lightwallet/screens/CreateScreen.java +++ b/core/src/com/jw/lightwallet/screens/CreateScreen.java @@ -171,10 +171,11 @@ public class CreateScreen extends AbstractScreen { }; Label success_label = new Label("Wallet successfully created. " + name + " file is your binary wallet file. " + name + ".keys is your keys file; " - + "the keys file is password protected and you can restore your binary wallet file with it. " + - " A text file named " + name + "info.txt has also been created. This file contains your wallet recovery seed and view key. " + - "Please encrypt this file or print it and delete it. Your wallet seed allows wallet recovery and bypasses your password." + - "A file named lightwallet.conf has also been created; this file specifies the wallet and node currently in use.", uiSkin); + + "the keys file is password protected and you can restore your binary wallet file with it. " + + " A text file named " + name + "info.txt has also been created. This file contains your wallet recovery seed and view key. " + + "Please encrypt this file or print it and delete it. Your wallet seed allows wallet recovery and bypasses your password." + + "The text file " + name + "txs.txt is empty, but will contain your tx history after syncing the wallet and making txs. " + + "A file named lightwallet.conf has also been created; this file specifies the wallet and node currently in use.", uiSkin); success_label.setWrap(true); success_dialog.add(success_label).width(400).row(); success_dialog.button("Continue", true).addListener(new ClickListener() { @@ -246,6 +247,10 @@ public class CreateScreen extends AbstractScreen { confwriter.println("Node address: " + nodetext.getText()); confwriter.close(); + PrintWriter txwriter = new PrintWriter(name + "tx.txt", "UTF-8"); + txwriter.println("Transaction history: "); + txwriter.close(); + success_dialog.show(stage); } diff --git a/core/src/com/jw/lightwallet/screens/DaemonView.java b/core/src/com/jw/lightwallet/screens/DaemonView.java index 09446a4..ffcca91 100644 --- a/core/src/com/jw/lightwallet/screens/DaemonView.java +++ b/core/src/com/jw/lightwallet/screens/DaemonView.java @@ -4,13 +4,15 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.scenes.scene2d.ui.Label; import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.scenes.scene2d.ui.Table; -import com.jw.lightwallet.utils.Constants; +import com.jw.lightwallet.LightWallet; import com.jw.lightwallet.utils.DaemonValues; import java.text.DecimalFormat; public class DaemonView { + LightWallet game; + Table daemonlayout; Label nodelabel; @@ -29,9 +31,11 @@ public class DaemonView { int padvalue; - public DaemonView () { + public DaemonView (final LightWallet game) { + + this.game = game; - Skin uiSkin = new Skin(Gdx.files.internal("skin/uiskin.json")); + Skin uiSkin = new Skin(Gdx.files.internal("skin/uiskin.json")); daemonlayout = new Table(); padvalue = 15; @@ -69,7 +73,7 @@ public class DaemonView { } public void Update(DaemonValues daemonvalues) { - nodevalue.setText(Constants.moneroclubdmn); + nodevalue.setText(game.walletvalues.getNode()); statusvalue.setText(daemonvalues.getStatus()); heightvalue.setText(String.valueOf(daemonvalues.getBlockheight())); hashratevalue.setText(new DecimalFormat("##.##").format(daemonvalues.getHashrate()) + " Mh/s"); diff --git a/core/src/com/jw/lightwallet/screens/ImportKeysScreen.java b/core/src/com/jw/lightwallet/screens/ImportKeysScreen.java index b1d6150..ce6d495 100644 --- a/core/src/com/jw/lightwallet/screens/ImportKeysScreen.java +++ b/core/src/com/jw/lightwallet/screens/ImportKeysScreen.java @@ -170,13 +170,7 @@ public class ImportKeysScreen extends AbstractScreen { System.out.println("result "+obj); } }; - Label successlabel = new Label("Wallet successfully imported. " + game.walletvalues.getName() + " file is your binary wallet file. " - + game.walletvalues.getName() + ".keys is your keys file; " - + "the keys file is password protected and you can restore your binary wallet file with it. " - + " A text file named " + game.walletvalues.getName() + "info.txt has also been created. " - + "This file contains your wallet recovery seed and view key. " - + "Please encrypt this file or print it and delete it. Your wallet seed allows wallet recovery and bypasses your password." - + "A file named lightwallet.conf has also been created; this file specifies the wallet and node currently in use.", uiSkin); + Label successlabel = new Label("", uiSkin); successlabel.setWrap(true); successdialog.add(successlabel).width(400).row(); successdialog.button("Continue", true).addListener(new ClickListener() { @@ -230,7 +224,7 @@ public class ImportKeysScreen extends AbstractScreen { try { - Process tr = Runtime.getRuntime().exec("simplewallet --wallet-file " + name + " --password " + pw); + Process tr = Runtime.getRuntime().exec("simplewallet --wallet-file " + name + " --password " + pw + " --daemon-address http://localhost:66666"); Writer wr = new OutputStreamWriter( tr.getOutputStream() ); BufferedReader rd = new BufferedReader( new InputStreamReader( tr.getInputStream() ) ); @@ -284,6 +278,18 @@ public class ImportKeysScreen extends AbstractScreen { confwriter.println("Node address: " + nodetext.getText()); confwriter.close(); + PrintWriter txwriter = new PrintWriter(name + "tx.txt", "UTF-8"); + txwriter.println("Transaction history: "); + txwriter.close(); + + successlabel.setText("Wallet successfully imported. " + game.walletvalues.getName() + " file is your binary wallet file. " + + game.walletvalues.getName() + ".keys is your keys file; " + + "the keys file is password protected and you can restore your binary wallet file with it. " + + " A text file named " + game.walletvalues.getName() + "info.txt has also been created. " + + "This file contains your wallet recovery seed and view key. " + + "Please encrypt this file or print it and delete it. Your wallet seed allows wallet recovery and bypasses your password." + + "The text file " + game.walletvalues.getName() + "txs.txt is empty, but will contain your tx history after syncing the wallet. " + + "A file named lightwallet.conf has also been created; this file specifies the wallet and node currently in use."); successdialog.show(stage); } diff --git a/core/src/com/jw/lightwallet/screens/MainScreen.java b/core/src/com/jw/lightwallet/screens/MainScreen.java index 87535d0..acd8a10 100644 --- a/core/src/com/jw/lightwallet/screens/MainScreen.java +++ b/core/src/com/jw/lightwallet/screens/MainScreen.java @@ -1,8 +1,11 @@ package com.jw.lightwallet.screens; import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; +import java.io.PrintWriter; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Texture; @@ -132,7 +135,7 @@ public class MainScreen extends AbstractScreen { screenlayout.add(logo).pad(10).center().row(); - daemonview = new DaemonView(); + daemonview = new DaemonView(game); walletview = new WalletView(game); transactionview = new TransactionView(); historyview = new HistoryView(); @@ -187,7 +190,7 @@ public class MainScreen extends AbstractScreen { }, 1f, 10f); // Timer task to get output from simplewallet logging and check balances - wallettimer.scheduleTask(new Timer.Task() { + /*wallettimer.scheduleTask(new Timer.Task() { @Override public void run() { String queuepoll = wq.poll(); @@ -201,9 +204,20 @@ public class MainScreen extends AbstractScreen { String height = queuepoll.split("height ")[1].split(",")[0]; walletview.syncvalue.setText(height + " / " + daemonvalues.getBlockheight()); } + else if (queuepoll != null && queuepoll.contains("money")) { + PrintWriter txout; + try { + txout = new PrintWriter(new BufferedWriter(new FileWriter(game.walletvalues.getName() + "tx.txt", true))); + txout.println(queuepoll); + txout.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } } catch (NullPointerException e){e.printStackTrace();} } - }, 1f, 0.05f); + }, 1f, 0.05f);*/ // Timer task to get network info from daemon balancetimer.scheduleTask(new Timer.Task() { @@ -221,6 +235,31 @@ public class MainScreen extends AbstractScreen { stage.draw(); stage.act(delta); + // Poll wallet thread and check block height and if transaction data is in output + String queuepoll = wq.poll(); + // Gdx.app.log(LightWallet.LOG, "Queue result: " + queuepoll); + try{ + if (queuepoll != null && queuepoll.contains("height:")) { + String height = queuepoll.split("height: ")[1].split(",")[0]; + walletview.syncvalue.setText(height + " / " + daemonvalues.getBlockheight()); + } + else if (queuepoll != null && queuepoll.contains("height ")) { + String height = queuepoll.split("height ")[1].split(",")[0]; + walletview.syncvalue.setText(height + " / " + daemonvalues.getBlockheight()); + } + else if (queuepoll != null && queuepoll.contains("money")) { + PrintWriter txout; + try { + txout = new PrintWriter(new BufferedWriter(new FileWriter(game.walletvalues.getName() + "tx.txt", true))); + txout.println(queuepoll); + txout.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } catch (NullPointerException e){e.printStackTrace();} + } public void dispose() { diff --git a/core/src/com/jw/lightwallet/screens/TransactionView.java b/core/src/com/jw/lightwallet/screens/TransactionView.java index 5b78385..ec1ce40 100644 --- a/core/src/com/jw/lightwallet/screens/TransactionView.java +++ b/core/src/com/jw/lightwallet/screens/TransactionView.java @@ -34,24 +34,24 @@ public class TransactionView { padvalue = 15; addresslabel = new Label("Send to address: ", uiSkin); - addressvalue = new TextField("", uiSkin); - txlayout.add(addresslabel).pad(padvalue).width(150); - txlayout.add(addressvalue).pad(padvalue).width(650).row(); + addressvalue = new TextField("", uiSkin, "tinytext"); + txlayout.add(addresslabel).pad(padvalue).width(100); + txlayout.add(addressvalue).pad(padvalue).width(600).row(); amountlabel = new Label("Send amount XMR: ", uiSkin); amountvalue = new TextField("", uiSkin); - txlayout.add(amountlabel).pad(padvalue).width(150); - txlayout.add(amountvalue).pad(padvalue).width(650).row(); + txlayout.add(amountlabel).pad(padvalue).width(100); + txlayout.add(amountvalue).pad(padvalue).width(100).row(); mixinlabel = new Label("Mixin level: ", uiSkin); mixinvalue = new TextField("", uiSkin); - txlayout.add(mixinlabel).pad(padvalue).width(150); - txlayout.add(mixinvalue).pad(padvalue).width(650).row(); + txlayout.add(mixinlabel).pad(padvalue).width(100); + txlayout.add(mixinvalue).pad(padvalue).width(50).row(); idlabel = new Label("Payment id: ", uiSkin); - idvalue = new TextField("", uiSkin); - txlayout.add(idlabel).pad(padvalue).width(150); - txlayout.add(idvalue).pad(padvalue).width(650).row(); + idvalue = new TextField("", uiSkin, "tinytext"); + txlayout.add(idlabel).pad(padvalue).width(100); + txlayout.add(idvalue).pad(padvalue).width(600).row(); sendbtn = new TextButton("Payola!", uiSkin); txlayout.add(sendbtn).row();