From c8e907efedf04772498e31c58aaad26c82026797 Mon Sep 17 00:00:00 2001 From: msmannan00 Date: Mon, 12 Aug 2019 01:59:59 +0500 Subject: [PATCH] bug fixes --- .../setting_manager/setting_controller.java | 8 ++++++++ .../setting_manager/setting_view_controller.java | 12 ++++++------ .../setting_manager/settings_ehandler.java | 8 ++++---- app/variables.gradle | 16 ++++++++-------- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/setting_manager/setting_controller.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/setting_manager/setting_controller.java index 270a0537..32a99c46 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/setting_manager/setting_controller.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/setting_manager/setting_controller.java @@ -4,8 +4,12 @@ import android.os.Bundle; import android.view.View; import android.widget.Spinner; import androidx.appcompat.app.AppCompatActivity; +import com.darkweb.genesissearchengine.constants.status; import com.example.myapplication.R; +import static com.darkweb.genesissearchengine.constants.status.history_status; +import static com.darkweb.genesissearchengine.constants.status.java_status; + public class setting_controller extends AppCompatActivity { @@ -28,6 +32,10 @@ public class setting_controller extends AppCompatActivity viewsInitializations(); listenersInitializations(); initializeModel(); + + setting_model.getInstance().java_status = java_status; + setting_model.getInstance().history_status = history_status; + setting_model.getInstance().search_status = status.search_status; } public void viewsInitializations() diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/setting_manager/setting_view_controller.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/setting_manager/setting_view_controller.java index d41e3a9c..5eafbe7f 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/setting_manager/setting_view_controller.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/setting_manager/setting_view_controller.java @@ -45,7 +45,6 @@ class setting_view_controller private void initJavascript() { - setting_model.getInstance().java_status = java_status; if (java_status) { javascript.setSelection(0); @@ -58,7 +57,6 @@ class setting_view_controller private void initHistory() { - setting_model.getInstance().history_status = history_status; if (history_status) { history.setSelection(0); @@ -73,7 +71,6 @@ class setting_view_controller private void initSearchEngine() { String myString = preference_manager.getInstance().getString(keys.search_engine, strings.darkweb); - setting_model.getInstance().search_status = myString; ArrayAdapter myAdap = (ArrayAdapter) search.getAdapter(); int spinnerPosition = myAdap.getPosition(myString); @@ -91,15 +88,18 @@ class setting_view_controller home_model.getInstance().getHomeInstance().initSearchEngine(); preference_manager.getInstance().setString(keys.search_engine, setting_model.getInstance().search_status); } - else if(status.java_status != setting_model.getInstance().java_status) + if(status.java_status != setting_model.getInstance().java_status) { status.java_status = setting_model.getInstance().java_status; home_model.getInstance().getHomeInstance().onReInitGeckoView(); preference_manager.getInstance().setBool(keys.java_script, status.java_status); } + if(status.history_status != setting_model.getInstance().history_status) + { + status.history_status = setting_model.getInstance().history_status; + preference_manager.getInstance().setBool(keys.history_clear, status.history_status); + } - status.history_status = setting_model.getInstance().history_status; - preference_manager.getInstance().setBool(keys.history_clear, status.history_status); setting_model.getInstance().getSettingInstance().finish(); } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/setting_manager/settings_ehandler.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/setting_manager/settings_ehandler.java index dd96727e..e060a996 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/setting_manager/settings_ehandler.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/setting_manager/settings_ehandler.java @@ -26,11 +26,11 @@ public class settings_ehandler private void onJavaScriptListener(int position) { - if(position==0 && setting_model.getInstance().java_status) + if(position==1 && setting_model.getInstance().java_status) { setting_model.getInstance().java_status = false; } - else if(!setting_model.getInstance().java_status) + else if(position==0 && !setting_model.getInstance().java_status) { setting_model.getInstance().java_status = true; } @@ -46,11 +46,11 @@ public class settings_ehandler private void onHistoryListener(int position) { - if(position==0 && setting_model.getInstance().history_status) + if(position==1 && setting_model.getInstance().history_status) { setting_model.getInstance().history_status = false; } - else if(!setting_model.getInstance().history_status) + else if(position==0 && !setting_model.getInstance().history_status) { setting_model.getInstance().history_status = true; } diff --git a/app/variables.gradle b/app/variables.gradle index f03d665a..4d0c689b 100644 --- a/app/variables.gradle +++ b/app/variables.gradle @@ -1,18 +1,18 @@ /*arm versions*/ - project.ext.arm_vname = '200' - project.ext.arm_vcode = 200 + project.ext.arm_vname = '205' + project.ext.arm_vcode = 205 /*aarch versions*/ - project.ext.aarch_vname = '201' - project.ext.aarch_vcode = 201 + project.ext.aarch_vname = '206' + project.ext.aarch_vcode = 206 /*x86 versions*/ - project.ext.x86_vname = '202' - project.ext.x86_vcode = 202 + project.ext.x86_vname = '207' + project.ext.x86_vcode = 207 /*x64 versions*/ - project.ext.x64_vname = '203' - project.ext.x64_vcode = 203 + project.ext.x64_vname = '208' + project.ext.x64_vcode = 208 /*dimension*/ project.ext.dimen = 'abi'