From 7ef640213de454f68787c1553099cc8d0c5454ac Mon Sep 17 00:00:00 2001 From: Adrian Tiberius Date: Wed, 12 Aug 2015 17:45:24 +0200 Subject: [PATCH] Add Wallet and COntacts default dapps. --- .../java/io/syng/activity/BaseActivity.java | 5 ----- app/src/main/java/io/syng/entity/Profile.java | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/syng/activity/BaseActivity.java b/app/src/main/java/io/syng/activity/BaseActivity.java index 27982b4..edad7da 100644 --- a/app/src/main/java/io/syng/activity/BaseActivity.java +++ b/app/src/main/java/io/syng/activity/BaseActivity.java @@ -48,7 +48,6 @@ import java.nio.MappedByteBuffer; import java.nio.channels.FileChannel; import java.nio.charset.Charset; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import io.syng.R; @@ -216,10 +215,6 @@ public abstract class BaseActivity extends AppCompatActivity implements if (SyngApplication.currentProfile != null) { mDApps = SyngApplication.currentProfile.getDapps(); } - // Add default Console dapp if not present - if (mDApps.size() == 0) { - mDApps.add(new Dapp("Console")); - } updateAppList(mSearchTextView.getText().toString()); } diff --git a/app/src/main/java/io/syng/entity/Profile.java b/app/src/main/java/io/syng/entity/Profile.java index 3763feb..9b576f0 100644 --- a/app/src/main/java/io/syng/entity/Profile.java +++ b/app/src/main/java/io/syng/entity/Profile.java @@ -35,16 +35,36 @@ public class Profile implements Serializable { public Profile() { this.privateKeys.add(createPrivateKey()); + addDefaultApps(); } public Profile(String privateKey) { this.privateKeys.add(privateKey); + addDefaultApps(); } public Profile(List privateKeys) { this.privateKeys = privateKeys; + addDefaultApps(); + } + + protected void addDefaultApps() { + + // Add console dapp + Dapp console = new Dapp("Console"); + dapps.add(console); + + // Add wallet dapp + Dapp wallet = new Dapp("Wallet"); + wallet.setUrl("http://syng.io/dapps/wallet"); + dapps.add(wallet); + + // Add contacts dapp + Dapp contacts = new Dapp("Contacts"); + contacts.setUrl("http://syng.io/dapps/contacts"); + dapps.add(contacts); } protected String createPrivateKey() {