From dae073dc6205512f3502f160edb05c72994b1ccd Mon Sep 17 00:00:00 2001 From: dtvv Date: Mon, 24 Sep 2018 19:41:33 -0500 Subject: [PATCH] Fix code to get better performance in validations --- .../crystalwallet/activities/LicenseActivity.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/cy/agorise/crystalwallet/activities/LicenseActivity.java b/app/src/main/java/cy/agorise/crystalwallet/activities/LicenseActivity.java index 0cf6e82..6e9a0d7 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/activities/LicenseActivity.java +++ b/app/src/main/java/cy/agorise/crystalwallet/activities/LicenseActivity.java @@ -29,11 +29,6 @@ public class LicenseActivity extends AppCompatActivity { ButterKnife.bind(this); - // TODO check if license has been agreed - - String html = getString(R.string.licence_html); - wvEULA.loadData(html, "text/html", "UTF-8"); - db = CrystalDatabase.getAppDatabase(this.getApplicationContext()); int licenseVersion = getResources().getInteger(R.integer.license_version); GeneralSetting generalSettingLastLicenseRead = db.generalSettingDao().getSettingByName(GeneralSetting.SETTING_LAST_LICENSE_READ); @@ -43,6 +38,14 @@ public class LicenseActivity extends AppCompatActivity { startActivity(intent); finish(); } + else{ + + /* + * Load the licence only if it is necesarry + * */ + String html = getString(R.string.licence_html); + wvEULA.loadData(html, "text/html", "UTF-8"); + } } @OnClick(R.id.btnAgree)