diff --git a/app/build.gradle b/app/build.gradle index 91384f77..01691d0b 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -151,7 +151,7 @@ dependencies { implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - implementation 'com.google.android.material:material:1.4.0-alpha01' + implementation 'com.google.android.material:material:1.4.0-alpha02' implementation 'androidx.preference:preference:1.1.1' implementation 'com.google.android.material:material:1.3.0' implementation 'androidx.appcompat:appcompat:1.2.0' diff --git a/app/src/main/assets/Homepage/homepage-dark.html b/app/src/main/assets/Homepage/homepage-dark.html index 5b7f1c9a..d0d0a3c3 100644 --- a/app/src/main/assets/Homepage/homepage-dark.html +++ b/app/src/main/assets/Homepage/homepage-dark.html @@ -29,7 +29,7 @@ - +

diff --git a/app/src/main/assets/Homepage/homepage.html b/app/src/main/assets/Homepage/homepage.html index 0e05ef53..15b8086f 100644 --- a/app/src/main/assets/Homepage/homepage.html +++ b/app/src/main/assets/Homepage/homepage.html @@ -29,7 +29,7 @@ - +

diff --git a/app/src/main/assets/Homepage/javascript/js-homepage-dark.js b/app/src/main/assets/Homepage/javascript/js-homepage-dark.js index 450b3cc0..56327496 100644 --- a/app/src/main/assets/Homepage/javascript/js-homepage-dark.js +++ b/app/src/main/assets/Homepage/javascript/js-homepage-dark.js @@ -71,9 +71,12 @@ function onTriggerScriptHandler(pCommand,pData) { $(window).on('load', function() { /* For Local Testing */ - var mResponseJson = '[{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://wikileaks.org/static/img/wl-logo.png", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"}]'; - setTimeout(mHomepageLoader.onLoadReferenceWebsites, 500); - setTimeout(mHomepageLoader.onLoadReferenceWebsiteContent, 1000, mResponseJson); + // var mResponseJson = '[{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://wikileaks.org/static/img/wl-logo.png", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"}]'; + // setTimeout(mHomepageLoader.onLoadReferenceWebsites, 500); + // setTimeout(mHomepageLoader.onLoadReferenceWebsiteContent, 1000, mResponseJson); + document.getElementById("pBody").classList.toggle('body_fadein'); + setTimeout(function (){ onTriggerScriptHandler(Commands.onLoadReferenceWebsites, null) + }, 100); }); diff --git a/app/src/main/assets/Homepage/javascript/js-homepage.js b/app/src/main/assets/Homepage/javascript/js-homepage.js index 64404f8b..8934820a 100644 --- a/app/src/main/assets/Homepage/javascript/js-homepage.js +++ b/app/src/main/assets/Homepage/javascript/js-homepage.js @@ -74,6 +74,9 @@ $(window).on('load', function() { // var mResponseJson = '[{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://wikileaks.org/static/img/wl-logo.png", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"}]'; // setTimeout(mHomepageLoader.onLoadReferenceWebsites, 500); // setTimeout(mHomepageLoader.onLoadReferenceWebsiteContent, 1000, mResponseJson); + document.getElementById("pBody").classList.toggle('body_fadein'); + setTimeout(function (){ onTriggerScriptHandler(Commands.onLoadReferenceWebsites, null) + }, 1000); }); diff --git a/app/src/main/assets/Homepage/style/cs-homepage-dark.css b/app/src/main/assets/Homepage/style/cs-homepage-dark.css index ebfe7cc3..af83d036 100644 --- a/app/src/main/assets/Homepage/style/cs-homepage-dark.css +++ b/app/src/main/assets/Homepage/style/cs-homepage-dark.css @@ -1,4 +1,16 @@ /*Search*/ +body{ + opacity: 0; + transition: opacity 2s; + -webkit-transition: opacity 2s; /* Safari */ +} + +.body_fadein { + opacity: 1; + transition-duration: 0.5s; + transition-property: opacity; +} + .line-style { border: 0; height: 1px; diff --git a/app/src/main/assets/Homepage/style/cs-homepage.css b/app/src/main/assets/Homepage/style/cs-homepage.css index de14b372..bc5e08ee 100644 --- a/app/src/main/assets/Homepage/style/cs-homepage.css +++ b/app/src/main/assets/Homepage/style/cs-homepage.css @@ -1,4 +1,16 @@ /*Search*/ +body{ + opacity: 0; + transition: opacity 2s; + -webkit-transition: opacity 2s; /* Safari */ +} + +.body_fadein { + opacity: 1; + transition-duration: 0.5s; + transition-property: opacity; +} + .line-style { border: 0; height: 1px; diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/bookmarkManager/bookmarkAdapter.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/bookmarkManager/bookmarkAdapter.java index 4da066f3..e7d2ca3d 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/bookmarkManager/bookmarkAdapter.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/bookmarkManager/bookmarkAdapter.java @@ -2,6 +2,8 @@ package com.darkweb.genesissearchengine.appManager.bookmarkManager; import android.annotation.SuppressLint; import android.content.Context; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.os.Handler; import android.view.LayoutInflater; import android.view.MotionEvent; @@ -17,6 +19,9 @@ import com.darkweb.genesissearchengine.constants.strings; import com.darkweb.genesissearchengine.helperManager.eventObserver; import com.darkweb.genesissearchengine.helperManager.helperMethod; import com.example.myapplication.R; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; @@ -441,7 +446,13 @@ public class bookmarkAdapter extends RecyclerView.Adapter mFaviconLogo.setImageDrawable(mHindTypeIconTemp.getDrawable())); + mContext.runOnUiThread(() -> { + Bitmap mBitmap = helperMethod.drawableToBitmap(mHindTypeIconTemp.getDrawable()); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + mBitmap.compress(Bitmap.CompressFormat.PNG, 20, out); + Bitmap decoded = BitmapFactory.decodeStream(new ByteArrayInputStream(out.toByteArray())); + mFaviconLogo.setImageBitmap(decoded); + }); } catch (InterruptedException e) { e.printStackTrace(); } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/bridgeManager/bridgeController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/bridgeManager/bridgeController.java index 64042d1f..cada3377 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/bridgeManager/bridgeController.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/bridgeManager/bridgeController.java @@ -83,7 +83,7 @@ public class bridgeController extends AppCompatActivity { mCustomBridgeBlocker = findViewById(R.id.pCustomBridgeBlocker); mBridgeViewController.initialization(mCustomPort, mBridgeButton,this, mBridgeObfs, mBridgeChina, mBridgeCustom, mCustomBridgeBlocker); - mBridgeViewController.onTrigger(bridgeEnums.eBridgeViewCommands.M_INIT_VIEWS, Arrays.asList(status.sBridgeCustomBridge,0)); + mBridgeViewController.onTrigger(bridgeEnums.eBridgeViewCommands.M_INIT_VIEWS, Arrays.asList(status.sBridgeCustomBridge,0,status.sBridgeCustomType)); mBridgeModel = new bridgeModel(new bridgeController.bridgeModelCallback(), this); } @@ -127,10 +127,10 @@ public class bridgeController extends AppCompatActivity { /* EXTERNAL LISTENERS */ - public void onUpdateBridges(String pString) { - if(pString.length()>5){ - mBridgeModel.onTrigger(bridgeEnums.eBridgeModelCommands.M_CUSTOM_BRIDGE, Collections.singletonList(pString)); - mBridgeViewController.onTrigger(bridgeEnums.eBridgeViewCommands.M_INIT_VIEWS, Arrays.asList(status.sBridgeCustomBridge,250)); + public void onUpdateBridges(String pBridge, String pType) { + if(pBridge.length()>5){ + mBridgeModel.onTrigger(bridgeEnums.eBridgeModelCommands.M_CUSTOM_BRIDGE, Arrays.asList(pBridge, pType)); + mBridgeViewController.onTrigger(bridgeEnums.eBridgeViewCommands.M_INIT_VIEWS, Arrays.asList(status.sBridgeCustomBridge,250, status.sBridgeCustomType)); }else { if(status.sBridgeCustomBridge.equals("meek")){ mBridgeModel.onTrigger(bridgeEnums.eBridgeModelCommands.M_MEEK_BRIDGE, null); @@ -198,10 +198,10 @@ public class bridgeController extends AppCompatActivity { } public void onMeekChecked(View view){ mBridgeModel.onTrigger(bridgeEnums.eBridgeModelCommands.M_MEEK_BRIDGE, null); - mBridgeViewController.onTrigger(bridgeEnums.eBridgeViewCommands.M_INIT_VIEWS, Arrays.asList(status.sBridgeCustomBridge,250)); + mBridgeViewController.onTrigger(bridgeEnums.eBridgeViewCommands.M_INIT_VIEWS, Arrays.asList(status.sBridgeCustomBridge,250, status.sBridgeCustomType)); } public void onObfsChecked(View view){ mBridgeModel.onTrigger(bridgeEnums.eBridgeModelCommands.M_OBFS_CHECK, null); - mBridgeViewController.onTrigger(bridgeEnums.eBridgeViewCommands.M_INIT_VIEWS, Arrays.asList(status.sBridgeCustomBridge,250)); + mBridgeViewController.onTrigger(bridgeEnums.eBridgeViewCommands.M_INIT_VIEWS, Arrays.asList(status.sBridgeCustomBridge,250, status.sBridgeCustomType)); } } \ No newline at end of file diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/bridgeManager/bridgeModel.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/bridgeManager/bridgeModel.java index 998202f8..6fd5a868 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/bridgeManager/bridgeModel.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/bridgeManager/bridgeModel.java @@ -16,6 +16,9 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; +import static com.darkweb.genesissearchengine.constants.strings.BRIDGE_CUSTOM_BRIDGE_MEEK; +import static com.darkweb.genesissearchengine.constants.strings.BRIDGE_CUSTOM_BRIDGE_OBFS4; +import static com.darkweb.genesissearchengine.constants.strings.GENERIC_EMPTY_STR; import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.M_BRIDGE_MAIL; class bridgeModel @@ -38,18 +41,32 @@ class bridgeModel pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(constants.CONST_BACKEND_GOOGLE_URL, mContext), M_BRIDGE_MAIL); } - public void onCustomChecked(String pString){ - status.sBridgeCustomBridge = pString; - dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_BRIDGE_1,status.sBridgeCustomBridge)); + public void onCustomChecked(String pBridge, String pType){ + status.sBridgeCustomBridge = pBridge; + status.sBridgeCustomType = pType; + status.sBridgeGatewayManual = true; + dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_BRIDGE_1,status.sBridgeCustomBridge)); + dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_TYPE,status.sBridgeCustomType)); + dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_GATEWAY_MANUAL,status.sBridgeGatewayManual)); } public void onMeekChecked(){ - status.sBridgeCustomBridge = strings.BRIDGE_CUSTOM_BRIDGE_MEEK; + status.sBridgeCustomBridge = BRIDGE_CUSTOM_BRIDGE_MEEK; + status.sBridgeCustomType = GENERIC_EMPTY_STR; + status.sBridgeGatewayManual = false; + dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_BRIDGE_1,status.sBridgeCustomBridge)); + dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_TYPE,status.sBridgeCustomType)); + dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_GATEWAY_MANUAL,status.sBridgeGatewayManual)); } public void onObfsChecked(){ - status.sBridgeCustomBridge = strings.BRIDGE_CUSTOM_BRIDGE_OBFS4; + status.sBridgeCustomBridge = BRIDGE_CUSTOM_BRIDGE_OBFS4; + status.sBridgeCustomType = GENERIC_EMPTY_STR; + status.sBridgeGatewayManual = false; + dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_BRIDGE_1,status.sBridgeCustomBridge)); + dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_TYPE,status.sBridgeCustomType)); + dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_GATEWAY_MANUAL,status.sBridgeGatewayManual)); } public void onTrigger(bridgeEnums.eBridgeModelCommands pCommands, List pData){ @@ -57,7 +74,7 @@ class bridgeModel requestBridges(); } else if(pCommands == bridgeEnums.eBridgeModelCommands.M_CUSTOM_BRIDGE){ - onCustomChecked((String) pData.get(0)); + onCustomChecked((String) pData.get(0), (String) pData.get(1)); } else if(pCommands == bridgeEnums.eBridgeModelCommands.M_MEEK_BRIDGE){ onMeekChecked(); diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/bridgeManager/bridgeViewController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/bridgeManager/bridgeViewController.java index de9edb14..bdebe113 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/bridgeManager/bridgeViewController.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/bridgeManager/bridgeViewController.java @@ -106,7 +106,7 @@ class bridgeViewController mCustomBridgeBlocker.setVisibility(View.GONE); } - private void initViews(String p_bridge, int p_duration){ + private void initViews(String p_bridge, int p_duration, String pType){ resetRadioButtons(p_duration); if(p_bridge.equals(strings.BRIDGE_CUSTOM_BRIDGE_OBFS4)){ animateColor(mBridgeObfs, mBridgeObfs.getCurrentTextColor(), mContext.getResources().getColor(R.color.c_text_v1), "textColor", p_duration); @@ -126,13 +126,13 @@ class bridgeViewController mCustomPort.setText(strings.GENERIC_EMPTY_STR); }else { onEnableCustomBridge(); - mCustomPort.setText(p_bridge.replace("\n","")); + mCustomPort.setText(("(Type) " + pType + " ➔ " + "(Config) "+p_bridge.replace("\n",""))); } } public void onTrigger(bridgeEnums.eBridgeViewCommands p_commands, List p_data){ if(p_commands == bridgeEnums.eBridgeViewCommands.M_INIT_VIEWS){ - initViews((String) p_data.get(0), (int)p_data.get(1)); + initViews((String) p_data.get(0), (int)p_data.get(1), (String) p_data.get(2)); } if(p_commands == bridgeEnums.eBridgeViewCommands.M_ENABLE_CUSTOM_BRIDGE){ onEnableCustomBridge(); diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyAdapter.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyAdapter.java index d4f2b37c..2008210f 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyAdapter.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyAdapter.java @@ -2,6 +2,8 @@ package com.darkweb.genesissearchengine.appManager.historyManager; import android.annotation.SuppressLint; import android.content.Context; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.os.Handler; import android.util.Log; import android.view.LayoutInflater; @@ -19,6 +21,9 @@ import com.darkweb.genesissearchengine.constants.strings; import com.darkweb.genesissearchengine.helperManager.eventObserver; import com.darkweb.genesissearchengine.helperManager.helperMethod; import com.example.myapplication.R; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; @@ -488,7 +493,13 @@ public class historyAdapter extends RecyclerView.Adapter mFaviconLogo.setImageDrawable(mHindTypeIconTemp.getDrawable())); + mContext.runOnUiThread(() -> { + Bitmap mBitmap = helperMethod.drawableToBitmap(mHindTypeIconTemp.getDrawable()); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + mBitmap.compress(Bitmap.CompressFormat.PNG, 20, out); + Bitmap decoded = BitmapFactory.decodeStream(new ByteArrayInputStream(out.toByteArray())); + mFaviconLogo.setImageBitmap(decoded); + }); } catch (InterruptedException e) { e.printStackTrace(); } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/NestedGeckoView.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/NestedGeckoView.java index 38adbe6f..8ea8b29f 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/NestedGeckoView.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/NestedGeckoView.java @@ -9,9 +9,7 @@ import android.view.MotionEvent; import com.darkweb.genesissearchengine.constants.status; import com.darkweb.genesissearchengine.helperManager.eventObserver; import org.mozilla.geckoview.GeckoView; - import java.util.Collections; - import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_CHANGED; public class NestedGeckoView extends GeckoView { @@ -48,6 +46,7 @@ public class NestedGeckoView extends GeckoView { switch (action) { case MotionEvent.ACTION_MOVE: + // mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_FINISHED); final boolean allowScroll = status.sFullScreenBrowsing; int deltaY = mLastY - eventY; @@ -76,15 +75,18 @@ public class NestedGeckoView extends GeckoView { case MotionEvent.ACTION_DOWN: mLastY = eventY; startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL); + // mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_FINISHED); break; case MotionEvent.ACTION_UP: + // mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_FINISHED); case MotionEvent.ACTION_CANCEL: + // mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_FINISHED); stopNestedScroll(); break; default: - // We don't care about other touch events + // mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_FINISHED); } // Execute event handler from parent class in all cases diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoClients.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoClients.java index 888abf1c..0251f94a 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoClients.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoClients.java @@ -14,6 +14,8 @@ import com.darkweb.genesissearchengine.helperManager.helperMethod; import java.io.File; import java.util.List; + +import static com.darkweb.genesissearchengine.constants.constants.CONST_REPORT_URL; import static com.darkweb.genesissearchengine.constants.enums.etype.on_handle_external_intent; import static org.mozilla.geckoview.GeckoSessionSettings.USER_AGENT_MODE_MOBILE; import static org.mozilla.geckoview.StorageController.ClearFlags.AUTH_SESSIONS; @@ -70,10 +72,10 @@ public class geckoClients onUpdateFont(); } - public void onValidateInitializeFromStartup(){ + public void onValidateInitializeFromStartup(NestedGeckoView mNestedGeckoView){ boolean mStatus = mSession.onValidateInitializeFromStartup(); if(mStatus){ - loadURL(mSession.getCurrentURL()); + loadURL(mSession.getCurrentURL(), mNestedGeckoView); } } @@ -145,7 +147,7 @@ public class geckoClients } @SuppressLint("WrongConstant") - public void updateSetting(){ + public void updateSetting(NestedGeckoView mNestedGeckoView){ mRuntime.getSettings().setRemoteDebuggingEnabled(false); mRuntime.getSettings().setWebFontsEnabled(status.sShowWebFonts); mRuntime.getSettings().getContentBlocking().setCookieBehavior(getCookiesBehaviour()); @@ -166,7 +168,7 @@ public class geckoClients mSession.getSettings().setUserAgentMode(USER_AGENT_MODE_MOBILE ); mSession.getSettings().setAllowJavascript(status.sSettingJavaStatus); onUpdateFont(); - onReload(); + onReload(mNestedGeckoView); } public void initSession(geckoSession mSession){ @@ -190,22 +192,24 @@ public class geckoClients mSession.initURL(url); } - public void loadURL(String url) { + public void loadURL(String url, NestedGeckoView mNestedGeckoView) { + mSession = (geckoSession)mNestedGeckoView.getSession(); + if(mSession==null){ + return; + } if(mSession.onGetInitializeFromStartup()){ mSession.initURL(url); - if(url.startsWith("https://boogle.store/?pG") || url.startsWith("https://boogle.store?pG") || url.endsWith("boogle.store") || url.endsWith(constants.CONST_GENESIS_DOMAIN_URL_SLASHED)){ + if(!url.startsWith(CONST_REPORT_URL) && (url.startsWith("https://boogle.store/?pG") || url.startsWith("https://boogle.store?pG") || url.endsWith("boogle.store") || url.endsWith(constants.CONST_GENESIS_DOMAIN_URL_SLASHED))){ try{ mSession.initURL(constants.CONST_GENESIS_DOMAIN_URL); if(status.sTheme == enums.Theme.THEME_LIGHT || helperMethod.isDayMode(context)){ String mURL = constants.CONST_GENESIS_URL_CACHED + "?pData="+ dataController.getInstance().invokeReferenceWebsite(dataEnums.eReferenceWebsiteCommands.M_FETCH,null); mSession.getSettings().setAllowJavascript(true); mSession.loadUri(mURL); - return; }else { String mURL = constants.CONST_GENESIS_URL_CACHED_DARK + "?pData="+ dataController.getInstance().invokeReferenceWebsite(dataEnums.eReferenceWebsiteCommands.M_FETCH,null); mSession.getSettings().setAllowJavascript(true); mSession.loadUri(mURL); - return; } }catch (Exception ex){ ex.printStackTrace(); @@ -217,19 +221,17 @@ public class geckoClients if(status.sTheme == enums.Theme.THEME_LIGHT || helperMethod.isDayMode(context)){ mSession.getSettings().setAllowJavascript(true); mSession.loadUri(constants.CONST_GENESIS_HELP_URL_CACHE); - return; }else { mSession.getSettings().setAllowJavascript(true); mSession.loadUri(constants.CONST_GENESIS_HELP_URL_CACHE_DARK); - return; } }catch (Exception ex){ ex.printStackTrace(); } }else { + mSession.getSettings().setAllowJavascript(status.sSettingJavaStatus); mSession.loadUri(url); } - mSession.getSettings().setAllowJavascript(status.sSettingJavaStatus); } } @@ -310,9 +312,9 @@ public class geckoClients mSession.stop(); } - public void onReload(){ + public void onReload(NestedGeckoView mNestedGeckoView){ mSession.stop(); - loadURL(mSession.getCurrentURL()); + loadURL(mSession.getCurrentURL(), mNestedGeckoView); } public void manual_download(String url, AppCompatActivity context){ @@ -361,7 +363,10 @@ public class geckoClients @Override public Object invokeObserver(List data, Object e_type) { - if (mSessionID!=null && mSessionID.equals(data.get(1)) || e_type.equals(enums.etype.FINDER_RESULT_CALLBACK) || e_type.equals(enums.etype.ON_UPDATE_TAB_TITLE) || e_type.equals(enums.etype.on_update_favicon) ||e_type.equals(enums.etype.on_update_history) || e_type.equals(enums.etype.on_request_completed) || e_type.equals(enums.etype.on_update_suggestion) || e_type.equals(enums.etype.on_update_suggestion_url)) + if(e_type.equals(enums.etype.SESSION_ID)){ + return mSession.getSessionID(); + } + else if (mSessionID!=null && mSessionID.equals(data.get(1)) || e_type.equals(enums.etype.FINDER_RESULT_CALLBACK) || e_type.equals(enums.etype.ON_UPDATE_TAB_TITLE) || e_type.equals(enums.etype.on_update_favicon) ||e_type.equals(enums.etype.on_update_history) || e_type.equals(enums.etype.on_request_completed) || e_type.equals(enums.etype.on_update_suggestion) || e_type.equals(enums.etype.on_update_suggestion_url)) { if (e_type.equals(on_handle_external_intent)) { diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoSession.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoSession.java index e245add7..db59b0b3 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoSession.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoSession.java @@ -23,6 +23,8 @@ import android.view.autofill.AutofillManager; import android.view.autofill.AutofillValue; import android.view.inputmethod.InputMethodManager; import android.widget.Toast; + +import androidx.annotation.AnyThread; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; @@ -95,6 +97,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele private String mTheme = null; private boolean mPreviousErrorPage = false; private boolean mRemovableFromBackPressed = false; + private boolean mThemeChanged = false; /*Temp Variables*/ private GeckoSession.HistoryDelegate.HistoryList mHistoryList = null; @@ -120,6 +123,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele setContentDelegate(this); setAutoFillDelegate(); setPermissionDelegate(this); + setScrollDelegate(this); mDownloadManager = new geckoDownloadManager(); setPromptDelegate(new geckoPromptView(mContext)); } @@ -148,6 +152,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele } public void onSessionReinit(){ + mCrashCount = 0; if(!isFirstPaintExecuted){ event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id), enums.etype.ON_SESSION_REINIT); }else { @@ -164,6 +169,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele void initURL(String url){ if(mIsLoaded){ + mCrashCount = 0; isPageLoading = true; setURL(url); mCurrentTitle = mCurrentURL; @@ -179,6 +185,10 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele } /*Scroll Delegate*/ + @UiThread + public void onScrollChanged(@NonNull GeckoSession session, int scrollX, int scrollY) { + event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme), enums.etype.M_UPDATE_PIXEL_BACKGROUND); + } /*Autofill Delegate*/ @@ -251,13 +261,15 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele if(!isPageLoading){ mCurrentTitle = "loading"; m_current_url_id = -1; - mTheme = null; + //mTheme = null; + mThemeChanged = false; } isPageLoading = true; if(!var2.equals("about:blank") && !mCurrentTitle.equals("loading")){ mProgress = 5; event.invokeObserver(Arrays.asList(5, mSessionID), enums.etype.progress_update); - mTheme = null; + //mTheme = null; + mThemeChanged = false; } } } @@ -266,13 +278,24 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele public void onPageStop(@NonNull GeckoSession var1, boolean var2) { if(var2){ if(mProgress>=100){ - event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.ON_UPDATE_THEME); + //event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.ON_UPDATE_THEME); event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme), enums.etype.on_update_favicon); event.invokeObserver(Arrays.asList(null,mSessionID), enums.etype.on_page_loaded); + + if(!mThemeChanged){ + new Handler().postDelayed(() -> + { + if(!mThemeChanged){ + mTheme = null; + event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.ON_UPDATE_THEME); + } + }, 500); + } } } } + @Override public void onProgressChange(@NonNull GeckoSession session, int progress) { @@ -283,6 +306,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele if(!mIsProgressBarChanging){ mIsProgressBarChanging = true; mContext.runOnUiThread(() -> event.invokeObserver(Arrays.asList(mProgress,mSessionID), enums.etype.progress_update)); + event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme), enums.etype.M_UPDATE_PIXEL_BACKGROUND); } }else { mIsProgressBarChanging = false; @@ -315,6 +339,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele mHistoryList = var2; } + /*Navigation Delegate*/ public void onLocationChange(@NonNull GeckoSession var1, @Nullable String var2) { @@ -461,8 +486,8 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele @UiThread public void onFirstContentfulPaint(@NonNull GeckoSession var1) { - isFirstPaintExecuted = true; + isFirstPaintExecuted = true; if(mPreviousErrorPage || mCurrentURL.contains("boogle.store") || mCurrentURL.startsWith(CONST_GENESIS_URL_CACHED) || mCurrentURL.startsWith(CONST_GENESIS_URL_CACHED_DARK) || mCurrentURL.startsWith(CONST_GENESIS_HELP_URL_CACHE) || mCurrentURL.toString().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){ event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, false), enums.etype.M_ON_BANNER_UPDATE); }else { @@ -475,6 +500,8 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele }else { onSessionReinit(); } + + event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme), enums.etype.M_UPDATE_PIXEL_BACKGROUND); } @UiThread @@ -485,9 +512,12 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele @UiThread public void onWebAppManifest(@NonNull GeckoSession var1, @NonNull JSONObject var2) { try { + mThemeChanged = true; mTheme = var2.getString("theme_color"); event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.ON_UPDATE_THEME); } catch (Exception ex) { + mTheme = null; + event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.ON_UPDATE_THEME); ex.printStackTrace(); } event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme), enums.etype.ON_UPDATE_TAB_TITLE); @@ -509,6 +539,39 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele } } + int mCrashCount = 0; + @UiThread + public void onCrash(@NonNull GeckoSession session) { + String mSessionID = (String) event.invokeObserver(null, enums.etype.SESSION_ID); + if(mSessionID.equals(getSessionID())){ + if(mCrashCount<=5){ + final Handler handler = new Handler(); + handler.postDelayed(() -> { + if(!session.isOpen()){ + event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.M_OPEN_SESSION); + } + }, mCrashCount*500); + } + mCrashCount+=1; + } + } + + @UiThread + public void onKill(@NonNull GeckoSession session) { + String mSessionID = (String) event.invokeObserver(null, enums.etype.SESSION_ID); + if(mSessionID.equals(getSessionID())){ + if(mCrashCount<=5){ + final Handler handler = new Handler(); + handler.postDelayed(() -> { + if(!session.isOpen()){ + event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.M_OPEN_SESSION); + } + }, mCrashCount*500); + } + mCrashCount+=1; + } + } + @Override public void onFullScreen(@NonNull GeckoSession var1, boolean var2) { mFullScreen = var2; @@ -786,7 +849,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele try { mCounter+=1; sleep(100); - if(mCounter>10){ + if(mCounter>100){ return; } } catch (InterruptedException e) { @@ -795,7 +858,8 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele } try { - FinderResult mResult = mFinder.poll(); + FinderResult mResult = mFinder.poll(1000); + Log.i("FUCK","FUCK : " + mResult.found + "----" + mResult.current + "-----" + mResult.total); event.invokeObserver(Arrays.asList(mResult.total, mResult.current), enums.etype.FINDER_RESULT_CALLBACK); } catch (Throwable throwable) { throwable.printStackTrace(); diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintAdapter.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintAdapter.java index b58beb08..cfe0b3a8 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintAdapter.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintAdapter.java @@ -2,6 +2,8 @@ package com.darkweb.genesissearchengine.appManager.homeManager.hintManager; import android.annotation.SuppressLint; import android.content.res.Resources; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.graphics.drawable.Drawable; import android.util.Log; import android.view.LayoutInflater; @@ -15,6 +17,8 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.RecyclerView; +import androidx.room.Ignore; + import com.darkweb.genesissearchengine.appManager.historyManager.historyRowModel; import com.darkweb.genesissearchengine.appManager.tabManager.tabEnums; import com.darkweb.genesissearchengine.constants.enums; @@ -22,6 +26,9 @@ import com.darkweb.genesissearchengine.constants.strings; import com.darkweb.genesissearchengine.helperManager.eventObserver; import com.darkweb.genesissearchengine.helperManager.helperMethod; import com.example.myapplication.R; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -95,7 +102,7 @@ public class hintAdapter extends RecyclerView.Adapter6){ - break; + if(mURLLink.contains("boogle.store") || mURLLink.contains("genesis.onion")){ + mHintWebIcon.setColorFilter(null); + mHintWebIcon.clearColorFilter(); + mHintWebIcon.setImageTintList(null); + mHintWebIcon.setClipToOutline(true); + mHintWebIcon.setImageDrawable(itemView.getResources().getDrawable(R.drawable.genesis)); + }else + { + new Thread(){ + public void run(){ + try { + mHindTypeIconTemp.setImageDrawable(null); + mEvent.invokeObserver(Arrays.asList(mHindTypeIconTemp, "https://" + helperMethod.getDomainName(model.getDescription())), enums.etype.fetch_favicon); + while (true){ + int mCounter=0; + if(mHindTypeIconTemp.isAttachedToWindow() || mHindTypeIconTemp.getDrawable()==null){ + sleep(10); + mCounter+=1; + }else { + Log.i("BREAK",""); + break; + } + if(mCounter>6){ + break; + } } + + mContext.runOnUiThread(() -> { + mHintWebIcon.setColorFilter(null); + mHintWebIcon.clearColorFilter(); + mHintWebIcon.setImageTintList(null); + mHintWebIcon.setClipToOutline(true); + mWebIcon.put(mURLLink,mHindTypeIconTemp.getDrawable()); + mHintWebIcon.setImageDrawable(mHindTypeIconTemp.getDrawable()); + + }); + + } catch (InterruptedException e) { + e.printStackTrace(); } - - mContext.runOnUiThread(() -> { - mHintWebIcon.setColorFilter(null); - mHintWebIcon.clearColorFilter(); - mHintWebIcon.setImageTintList(null); - mHintWebIcon.setClipToOutline(true); - mHintWebIcon.setImageDrawable(mHindTypeIconTemp.getDrawable()); - mWebIcon.put(mURLLink,mHindTypeIconTemp.getDrawable()); - }); - - } catch (InterruptedException e) { - e.printStackTrace(); } - } - }.start(); + }.start(); + } } } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeController.java index 7e883401..408746e3 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeController.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeController.java @@ -89,7 +89,6 @@ import java.util.List; import java.util.Locale; import java.util.Objects; import java.util.concurrent.Callable; - import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_HELP_URL_CACHE; import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_HELP_URL_CACHE_DARK; import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_URL_CACHED; @@ -97,6 +96,7 @@ import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_ import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_CHANGED; import static com.darkweb.genesissearchengine.constants.enums.etype.M_INITIALIZE_TAB_LINK; import static com.darkweb.genesissearchengine.constants.enums.etype.M_INITIALIZE_TAB_SINGLE; +import static com.darkweb.genesissearchengine.constants.enums.etype.ON_OPEN_TAB_VIEW; import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.*; import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManagerCallbacks.M_RATE_APPLICATION; import static java.lang.Character.isLetter; @@ -157,7 +157,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba private boolean isFocusChanging = false; private boolean mAppRestarted = false; private boolean mSearchBarLoading = false; + private boolean mSearchBarWasBackButtonPressed = false; private String mSearchBarPreviousText = strings.GENERIC_EMPTY_STR; + private Handler mScrollHandler = null; + private Runnable mScrollRunnable = null; /*-------------------------------------------------------INITIALIZATION-------------------------------------------------------*/ @@ -266,21 +269,39 @@ public class homeController extends AppCompatActivity implements ComponentCallba } public void onLoadTabFromTabController(){ - Object mTempModel = dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null); - if(mTempModel!=null){ - tabRowModel model = (tabRowModel)mTempModel; - mGeckoView.releaseSession(); - mGeckoClient.initSession(model.getSession()); - mGeckoView.setSession(model.getSession()); - mHomeViewController.onUpdateSearchBar(model.getSession().getCurrentURL(), false, false, false); + Object mTempModel = dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null); + if(mTempModel!=null){ + tabRowModel model = (tabRowModel)mTempModel; + if(model.getSession().onGetInitializeFromStartup()){ + mGeckoClient.getmRuntime(); + mGeckoClient.initSession(model.getSession()); + mGeckoView.releaseSession(); + mGeckoView.setSession(model.getSession()); - if(model.getSession().getCurrentURL().contains("boogle.store") || mGeckoClient.wasPreviousErrorPage() || model.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || model.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || model.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || model.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){ - mHomeViewController.updateBannerAdvertStatus(false, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); + if(!model.getSession().isOpen()){ + model.getSession().open(mGeckoClient.getmRuntime()); + onLoadURL(model.getSession().getCurrentURL()); + } + + mGeckoClient.onValidateInitializeFromStartup(mGeckoView); + mGeckoClient.onSessionReinit(); + } + + if(mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("boogle.store") || mGeckoClient.wasPreviousErrorPage() || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){ + mHomeViewController.updateBannerAdvertStatus(false, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); + if(model.getSession().onGetInitializeFromStartup()) { + mHomeViewController.progressBarReset(); + } + }else { + mHomeViewController.updateBannerAdvertStatus(true, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); + } + mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,false,false); }else { - mHomeViewController.updateBannerAdvertStatus(true, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); + if(status.sSettingSearchStatus.equals(constants.CONST_BACKEND_GENESIS_URL)){ + mHomeViewController.updateBannerAdvertStatus(false, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); + } } - } } public void onLoadTabOnResume(){ @@ -296,7 +317,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba onNewIntent(getIntent()); onOpenLinkNewTab(helperMethod.getDomainName(mHomeModel.getSearchEngine())); } - initTabCount(); + initTabCountForced(); if(!status.mThemeApplying){ mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(), false, false, false); } @@ -408,7 +429,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba mHomeViewController.initialization(new homeViewCallback(),this,mNewTab, mWebViewContainer, mLoadingText, mProgressBar, mSearchbar, mSplashScreen, mLoadingIcon, mBannerAds, mGatewaySplash, mTopBar, mGeckoView, mBackSplash, mConnectButton, mFindBar, mFindText, mFindCount, mTopLayout, mVoiceInput, mMenu, mNestedScroll, mBlocker, mBlockerFullSceen, mSearchEngineBar, mCopyright, mHintListView, mAppBar, mOrbotLogManager, mInfoLandscape, mInfoPortrait, mProgressBarIndeterminate, mTabFragment, mTopBarContainer, mSearchLock, mPopupLoadNewTab, mTopBarHider); mGeckoView.onSetHomeEvent(new nestedGeckoViewCallback()); mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,false); - mGeckoClient.onValidateInitializeFromStartup(); + mGeckoClient.onValidateInitializeFromStartup(mGeckoView); dataController.getInstance().initializeListData(); } @@ -451,12 +472,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba public void initializeGeckoView(boolean isForced, boolean pDatabaseSavable){ mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,isForced); onSaveCurrentTab(mGeckoClient.getSession(),pDatabaseSavable); - mHomeViewController.initTab((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null), false); + initTabCountForced(); } public void initTab(boolean isKeyboardOpened){ postNewTabAnimation(isKeyboardOpened, false); - mHomeViewController.initTab((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null), false); + initTabCountForced(); } @Override @@ -479,13 +500,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba public void onGetThumbnail(ImageView pImageView,boolean pLoadTabView){ try{ mRenderedBitmap = mGeckoView.capturePixels(); - dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, pImageView, mGeckoView, pLoadTabView)); - }catch (Exception ex){ - ex.printStackTrace(); - if(pLoadTabView){ - onOpenTabReady(); - } + }catch (Exception ignored){} + if(mScrollHandler!=null){ + mScrollHandler.removeCallbacksAndMessages(null); } + new Handler().postDelayed(() -> + { + dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, pImageView, mGeckoView, pLoadTabView)); + }, 100); } @@ -502,7 +524,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba public void initRuntimeSettings() { - mGeckoClient.updateSetting(); + mGeckoClient.updateSetting(mGeckoView); } public void onReDrawGeckoview(){ @@ -511,15 +533,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba } public void onLoadURL(String url){ - - if(mGeckoView!=null && mGeckoView.getSession()!=null && !mGeckoView.getSession().isOpen()){ + if(mGeckoView.getSession()!=null && !mGeckoView.getSession().isOpen()){ mGeckoView.getSession().open(mGeckoClient.getmRuntime()); } mAppBar.animate().cancel(); mHomeViewController.onClearSelections(true); Objects.requireNonNull(mGeckoView.getSession()).stop(); - mGeckoClient.loadURL(url.replace("genesis.onion","boogle.store")); + mGeckoClient.loadURL(url.replace("genesis.onion","boogle.store"),mGeckoView); } public void onLoadTab(geckoSession mTempSession, boolean isSessionClosed, boolean pExpandAppBar){ @@ -546,7 +567,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba mHomeViewController.progressBarReset(); } - mGeckoClient.onValidateInitializeFromStartup(); + mGeckoClient.onValidateInitializeFromStartup(mGeckoView); mGeckoClient.onSessionReinit(); mHomeViewController.onUpdateStatusBarTheme(mTempSession.getTheme(), false); mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(), false, false, false); @@ -560,7 +581,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba mHomeViewController.expandTopBar(); } - if(mGeckoClient.getSession().getCurrentURL().contains("boogle.store") || mGeckoClient.wasPreviousErrorPage() || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){ + if(mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("boogle.store") || mGeckoClient.wasPreviousErrorPage() || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){ mHomeViewController.updateBannerAdvertStatus(false, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); }else { mHomeViewController.updateBannerAdvertStatus(true, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); @@ -610,7 +631,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba case TRIM_MEMORY_MODERATE: Log.i("wow : ", "trim memory requested: clean up some memory"); break; - case TRIM_MEMORY_RUNNING_CRITICAL: Log.i("wow : ", "trim memory requested: memory on device is very low and critical"); break; @@ -648,6 +668,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba mNewTab.setOnTouchListener((v, event) -> { if(event.getAction() == MotionEvent.ACTION_DOWN){ onOpenTabViewBoundary(null); + initTabCount(null, null); } return false; }); @@ -779,6 +800,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba mSearchbar.setOnFocusChangeListener((v, hasFocus) -> { if(!hasFocus) { + mSearchBarWasBackButtonPressed = true; + new Handler().postDelayed(() -> + { + mSearchBarWasBackButtonPressed = false; + }, 100); + if(!isSuggestionSearchOpened){ if(isSuggestionChanged){ isSuggestionChanged = false; @@ -795,6 +822,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba } mSearchbar.setSelection(0); }else { + mSearchBarWasBackButtonPressed = false; if(!isFocusChanging){ if(!status.mThemeApplying){ mHomeViewController.initSearchBarFocus(true, isKeyboardOpened); @@ -822,6 +850,15 @@ public class homeController extends AppCompatActivity implements ComponentCallba }); KeyboardUtils.addKeyboardToggleListener(this, isVisible -> isKeyboardOpened = isVisible); + + + mNestedScroll.setOnScrollChangeListener((NestedScrollView.OnScrollChangeListener) (v, scrollX, scrollY, oldScrollX, oldScrollY) -> { + if(v.getChildAt(v.getChildCount() - 1) != null) { + if ((scrollY >= (v.getChildAt(v.getChildCount() - 1).getMeasuredHeight() - v.getMeasuredHeight())) && + scrollY > oldScrollY) { + } + } + }); } private ArrayList mSuggestions; @@ -862,6 +899,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba } public void onHomeButton(View view){ + + mGeckoClient.getSession().setTheme(null); + mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), true); onLoadURL(helperMethod.getDomainName(mHomeModel.getSearchEngine())); mHomeViewController.onUpdateLogo(); } @@ -910,15 +950,16 @@ public class homeController extends AppCompatActivity implements ComponentCallba mGeckoView.getSession().open(mGeckoClient.getmRuntime()); } - onLoadURL(helperMethod.getDomainName(status.sSettingSearchStatus)); mHomeViewController. onUpdateSearchBar(helperMethod.getDomainName(status.sSettingSearchStatus),false,true, false); + onLoadURL(helperMethod.getDomainName(status.sSettingSearchStatus)); + mGeckoView.getSession().setActive(true); + }else { onLoadURL("about:blank"); mHomeViewController. onUpdateSearchBar(strings.HOME_BLANK_PAGE,false,true, false); mHomeViewController.onNewTab(); } mHomeViewController.progressBarReset(); - mHomeViewController.onSessionChanged(); mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), false); } @@ -927,7 +968,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba initializeGeckoView(true, true); mHomeViewController.progressBarReset(); mHomeViewController.onUpdateSearchBar(url,false,true, false); - mGeckoClient.loadURL(url); + mGeckoClient.loadURL(url, mGeckoView); if(isRemovable){ mGeckoClient.setRemovableFromBackPressed(true); @@ -946,24 +987,29 @@ public class homeController extends AppCompatActivity implements ComponentCallba mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,true); mHomeViewController.progressBarReset(); mGeckoClient.initURL(url); - mGeckoClient.loadURL(url); + mGeckoClient.loadURL(url, mGeckoView); mGeckoClient.getSession().setURL(url); onSaveCurrentTab(mGeckoClient.getSession(),false); onLoadTab(mSession,false,false); mAppBar.setTag(R.id.expandableBar,true); - initTabCount(); + initTabCountForced(); mHomeViewController.onUpdateSearchBar(mSession.getCurrentURL(),false,true, false); } public void onNewTab(boolean isKeyboardOpenedTemp, boolean isKeyboardOpened){ - try { - onGetThumbnail(null, false); - }catch (Exception ignored){} - final Handler handler = new Handler(); - handler.postDelayed(() -> mHomeViewController.onNewTabAnimation(Arrays.asList(isKeyboardOpenedTemp, isKeyboardOpened), M_INITIALIZE_TAB_SINGLE), 100); + mRenderedBitmap = mGeckoView.capturePixels(); + new Handler().postDelayed(() -> + { + dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, null, mGeckoView, false)); + mHomeViewController.onNewTabAnimation(Arrays.asList(isKeyboardOpenedTemp, isKeyboardOpened), M_INITIALIZE_TAB_SINGLE); + }, 100); + } + + public void onUpdateScreenPixel(){ + } public void onNewTabBackground(boolean isKeyboardOpenedTemp, boolean isKeyboardOpened){ @@ -980,21 +1026,24 @@ public class homeController extends AppCompatActivity implements ComponentCallba } public void onOpenTabViewBoundary(View view){ - onGetThumbnail(null, true); - mGeckoClient.onRedrawPixel(); + onInvokePixelGenerator(); mNewTab.setPressed(true); + onOpenTabReady(); } public void onOpenTabReady(){ if(!status.mThemeApplying){ runOnUiThread(() -> { - activityContextManager.getInstance().getTabController().onInit(); mHomeViewController.onShowTabContainer(); - // overridePendingTransition(R.anim.popup_anim_in, R.anim.popup_anim_out); + activityContextManager.getInstance().getTabController().onInit(); }); } } + public void onLoadFirstElement(){ + activityContextManager.getInstance().getTabController().onInitFirstElement(); + } + public void onLockSecure(View view){ pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(mGeckoClient.getSession().getCurrentURL(), status.sSettingJavaStatus, status.sStatusDoNotTrack, status.sSettingTrackingProtection, status.sSettingCookieStatus, this), M_SECURE_CONNECTION); } @@ -1033,14 +1082,17 @@ public class homeController extends AppCompatActivity implements ComponentCallba @Override public void onBackPressed(){ if(mTabFragment.getVisibility()==View.VISIBLE){ - onResumeDump(); - mHomeViewController.onHideTabContainer(); - activityContextManager.getInstance().getTabController().onPostExit(); - activityContextManager.getInstance().getTabController().onBackPressed(); + if(activityContextManager.getInstance().getTabController().getSelectionCount()>0){ + activityContextManager.getInstance().getTabController().onClearSelection(null); + }else { + onResumeDump(); + mHomeViewController.onHideTabContainer(); + activityContextManager.getInstance().getTabController().onPostExit(); + activityContextManager.getInstance().getTabController().onBackPressed(); + } return; } - mSearchbar.clearFocus(); if(mFindBar!=null && mFindBar.getVisibility() == View.VISIBLE){ mHomeViewController.onUpdateFindBar(false); } @@ -1052,7 +1104,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba mGeckoClient.onExitFullScreen(); mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), false); } - else { + else if(mSearchbar.isFocused() || isKeyboardOpened){ + mHomeViewController.onClearSelections(true); + } + else if(!mSearchBarWasBackButtonPressed){ mGeckoClient.onBackPressed(true); } } @@ -1104,7 +1159,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba mHomeViewController.onSetBannerAdMargin(true,(boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); } - if(mGeckoClient.getSession().getCurrentURL().contains("boogle.store") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){ + if(mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("boogle.store") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){ mHomeViewController.updateBannerAdvertStatus(false, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); }else { mHomeViewController.updateBannerAdvertStatus(true, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); @@ -1139,6 +1194,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), false); pluginController.getInstance().onMessageManagerInvoke(null, M_RESET); pluginController.getInstance().onNotificationInvoke(Collections.singletonList(1296000000) /* Every 15 Days */ , pluginEnums.eNotificationManager.M_CREATE_NOTIFICATION); + mSearchBarWasBackButtonPressed = false; } @Override @@ -1179,6 +1235,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba pluginController.getInstance().onNotificationInvoke(null, pluginEnums.eNotificationManager.M_CLEAR_NOTIFICATION ); initWidget(); + initTabCountForced(); super.onResume(); } @@ -1263,7 +1320,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba } }else { - onSearchBarInvoked(mSearchbar); + mHomeViewController.onClearSelections(true); } } /*-------------------------------------------------------External Callback Methods-------------------------------------------------------*/ @@ -1323,7 +1380,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba session.stop(); session.close(); - initTabCount(); + initTabCountForced(); if(model!=null){ if(mTabFragment.getVisibility()!=View.VISIBLE){ @@ -1340,12 +1397,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba } } - public void initTabCount(){ - mHomeViewController.initTab((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null), false); + public void initTabCount(enums.etype pEvent, List pData){ + mHomeViewController.initTab((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null), false, pEvent, pData); } public void initTabCountForced(){ - mHomeViewController.initTab((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null), true); + mHomeViewController.initTab((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null), true, null, null); } /*-------------------------------------------------------CALLBACKS-------------------------------------------------------*/ @@ -1398,8 +1455,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba else if (menuId == R.id.menu9) { helperMethod.hideKeyboard(this); mGeckoClient.onRedrawPixel(); - activityContextManager.getInstance().getTabController().onInit(); mHomeViewController.onShowTabContainer(); + activityContextManager.getInstance().getTabController().onInit(); } else if (menuId == R.id.menu8) { helperMethod.hideKeyboard(this); @@ -1420,8 +1477,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba } else if (menuId == R.id.pMenuOpenRecentTab) { - activityContextManager.getInstance().getTabController().onInit(); mHomeViewController.onShowTabContainer(); + activityContextManager.getInstance().getTabController().onInit(); // overridePendingTransition(R.anim.popup_anim_in, R.anim.popup_anim_out); } else if (menuId == R.id.pMenuOpenNewTab) @@ -1501,7 +1558,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba if (menuId == R.id.menu26 || menuId == R.id.menu27) { helperMethod.hideKeyboard(this); mGeckoClient.toogleUserAgent(); - mGeckoClient.onReload(); + mGeckoClient.onReload(mGeckoView); } if(menuId == R.id.menu25){ helperMethod.hideKeyboard(this); @@ -1537,9 +1594,28 @@ public class homeController extends AppCompatActivity implements ComponentCallba @Override public Object invokeObserver(List data, Object e_type) { - if(e_type.equals(enums.etype.M_INIT_TAB_COUNT)) + if(e_type.equals(enums.etype.M_INIT_TAB_COUNT_FORCED)) { - initTabCount(); + initTabCountForced(); + } + else if(e_type.equals(enums.etype.M_CACHE_UPDATE_TAB)){ + new Handler().postDelayed(() -> + { + mTabFragment.setAlpha(0.01f); + mTabFragment.setVisibility(View.VISIBLE); + activityContextManager.getInstance().getTabController().onInit(); + mTabFragment.setVisibility(View.GONE); + mHomeViewController.onHideTabContainer(); + }, 1000); + } + else if(e_type.equals(enums.etype.M_UPDATE_PIXEL_BACKGROUND)){ + onInvokePixelGenerator(); + } + else if(e_type.equals(enums.etype.ON_NEW_TAB_ANIMATION)){ + postNewTabAnimation((boolean)data.get(0),(boolean)data.get(1)); + } + else if(e_type.equals(enums.etype.ON_OPEN_TAB_VIEW)){ + onOpenTabViewBoundary(null); } else if(e_type.equals(enums.etype.download_folder)) { @@ -1553,7 +1629,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(),false); } else if(e_type.equals(M_INITIALIZE_TAB_SINGLE)){ - postNewTabAnimation((boolean)data.get(0),(boolean)data.get(1)); + initTabCount(enums.etype.ON_NEW_TAB_ANIMATION,data); } else if(e_type.equals(M_INITIALIZE_TAB_LINK)){ postNewLinkTabAnimation((String)data.get(0),false); @@ -1673,6 +1749,47 @@ public class homeController extends AppCompatActivity implements ComponentCallba } } + public void onClearSettings(){ + mHomeViewController.updateBannerAdvertStatus(false, true); + dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLEAR_TAB, null); + activityContextManager.getInstance().getTabController().onCloseAllTabs(); + onLoadTabFromTabController(); + initTabCountForced(); + } + + public void onClearAllTabs(){ + mHomeViewController.updateBannerAdvertStatus(false, true); + } + + public void onInvokePixelGenerator(){ + + if(mTabFragment.getVisibility()==View.VISIBLE){ + return; + } + + if(mScrollHandler!=null){ + mScrollHandler.removeCallbacksAndMessages(null); + } + + mScrollHandler = new Handler(); + mScrollRunnable = () -> { + + try{ + mRenderedBitmap = mGeckoView.capturePixels(); + }catch (Exception ignored){} + new Handler().postDelayed(() -> + { + if(mTabFragment.getVisibility()!=View.VISIBLE){ + dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, null, mGeckoView, true)); + }else { + dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, null, mGeckoView, true)); + } + }, 150); + + }; + mScrollHandler.postDelayed(mScrollRunnable, 250); + } + public class geckoViewCallback implements eventObserver.eventListener{ @Override @@ -1801,6 +1918,17 @@ public class homeController extends AppCompatActivity implements ComponentCallba else if(e_type.equals(enums.etype.M_ON_MAIL)){ helperMethod.sendCustomMail(homeController.this, (String)data.get(0)); } + else if(e_type.equals(enums.etype.M_OPEN_SESSION)){ + tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null); + if(model!=null){ + onLoadTab(model.getSession(),true,true); + onLoadURL(model.getSession().getCurrentURL()); + } + } + else if(e_type.equals(enums.etype.M_UPDATE_PIXEL_BACKGROUND)){ + onInvokePixelGenerator(); + } + return null; } } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeModel.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeModel.java index 8968017a..c34f6069 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeModel.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeModel.java @@ -15,7 +15,10 @@ class homeModel } String urlComplete(String pURL, String pSearchEngine){ - if(pURL.equals("about:config")){ + if(pURL.equals("about:blank")){ + return helperMethod.completeURL("boogle.store"); + } + else if(pURL.equals("about:config")){ return pURL; }else { try diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeViewController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeViewController.java index 493d2282..aea6598c 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeViewController.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeViewController.java @@ -3,6 +3,7 @@ package com.darkweb.genesissearchengine.appManager.homeManager.homeController; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; +import android.animation.PropertyValuesHolder; import android.animation.ValueAnimator; import android.annotation.SuppressLint; import android.content.Context; @@ -178,6 +179,7 @@ class homeViewController updateBannerAdvertStatus(false, false); expandTopBar(); + mBlockerFullSceen.setVisibility(View.GONE); } public void initTopBarPadding(){ @@ -232,43 +234,31 @@ class homeViewController } public void onShowTabContainer(){ + if(mTabFragment.getAlpha()==0 || mTabFragment.getAlpha()==1){ - onUpdateStatusBarTheme(null, false); - + mTabFragment.animate().cancel(); mTabFragment.setAlpha(0); - mTabFragment.setTranslationY(0); mTabFragment.setVisibility(View.VISIBLE); - mTabFragment.setTranslationY(-1 * helperMethod.pxFromDp(15)); - mTopBarHider.setVisibility(View.VISIBLE); - mTopBarHider.animate().alpha(1).setDuration(0); + mTabFragment.animate().alpha(1).setDuration(250); - new Handler().postDelayed(() -> - { - mTabFragment.setLayerType(View.LAYER_TYPE_HARDWARE, null); - mTabFragment.animate().withLayer() - .setDuration(250) - .translationY(0) - .alpha(1f) - .withEndAction( - () -> mTabFragment.setLayerType(View.LAYER_TYPE_NONE, null) - ).start(); - - }, 10); + onUpdateStatusBarTheme(null, false); } } public void onHideTabContainer(){ - if(mTabFragment.getAlpha()==1){ + if(mTabFragment.getAlpha()>0 || mTabFragment.getVisibility()!=View.GONE){ new Handler().postDelayed(() -> { - mTopBarHider.animate().alpha(0).setDuration(0).setStartDelay(0).withEndAction(() -> mTopBarHider.setVisibility(View.GONE)); + mTopBarHider.animate().alpha(0).setDuration(250).setStartDelay(0).withEndAction(() -> mTopBarHider.setVisibility(View.GONE)); mEvent.invokeObserver(null, enums.etype.M_UPDATE_THEME); - }, 150); + }, 250); - mTabFragment.animate() .setDuration(150).alpha(0f).withEndAction(() -> mTabFragment.setVisibility(View.GONE)); - mEvent.invokeObserver(Collections.singletonList(status.sSettingSearchStatus), enums.etype.M_INIT_TAB_COUNT); + mTabFragment.animate().setDuration(150).setStartDelay(150).alpha(0f).withEndAction(() -> { + mTabFragment.setVisibility(View.GONE); + mEvent.invokeObserver(null, enums.etype.M_UPDATE_PIXEL_BACKGROUND); + }); } } @@ -357,6 +347,18 @@ class homeViewController final Handler handler = new Handler(); handler.postDelayed(() -> { + Drawable drawable; + Resources res = mContext.getResources(); + try { + if(status.sSettingEnableVoiceInput){ + drawable = Drawable.createFromXml(res, res.getXml(R.xml.ic_baseline_keyboard_voice)); + }else { + drawable = Drawable.createFromXml(res, res.getXml(R.xml.ic_baseline_cancel)); + } + mVoiceInput.setImageDrawable(drawable); + } catch (Exception ex) { + ex.printStackTrace(); + } mVoiceInput.setVisibility(View.VISIBLE); }, 0); @@ -381,25 +383,35 @@ class homeViewController } } - void initTab(int count, boolean pForced){ + void initTab(int count, boolean pForced, enums.etype pEvent, List pData){ if(!pForced){ - mNewTab.animate().cancel(); - mNewTab.animate().withLayer() - .rotationX(60) - .alpha(0.4f) - .setDuration(120) - .withEndAction( - new Runnable() { - @Override public void run() { - mNewTab.setRotationX(-60); - mNewTab.animate().withLayer() - .rotationX(0) - .alpha(1) - .setDuration(150) - .start(); - } - } - ).start(); + ObjectAnimator scaleDown = ObjectAnimator.ofPropertyValuesHolder(mNewTab, + PropertyValuesHolder.ofFloat("scaleX", 1, 0.70f, 1), + PropertyValuesHolder.ofFloat("scaleY", 1, 0.70f, 1)); + scaleDown.setDuration(250); + scaleDown.start(); + + scaleDown.addListener(new Animator.AnimatorListener() { + + @Override + public void onAnimationStart(Animator arg0) { + } + + @Override + public void onAnimationRepeat(Animator arg0) { + } + + @Override + public void onAnimationEnd(Animator arg0) { + if(pEvent!=null){ + mEvent.invokeObserver(pData, pEvent); + } + } + + @Override + public void onAnimationCancel(Animator arg0) { + } + }); } mNewTab.setText((count+strings.GENERIC_EMPTY_STR)); @@ -423,7 +435,7 @@ class homeViewController public void initStatusBarColor(boolean mInstant) { animatedColor oneToTwo = new animatedColor(ContextCompat.getColor(mContext, R.color.landing_ease_blue), ContextCompat.getColor(mContext, R.color.green_dark_v2)); - int mDelay = 500; + int mDelay = 800; if(status.mThemeApplying || mInstant){ mDelay = 0; } @@ -515,12 +527,15 @@ class homeViewController private void initSplashScreen(){ mIsAnimating = false; - mSearchbar.setEnabled(false); helperMethod.hideKeyboard(mContext); mSearchLock.setTag(R.id.themed,false); mAppBar.setTag(R.id.expandableBar,true); - mSearchbar.setEnabled(false); + if(!status.mThemeApplying){ + mSearchbar.setEnabled(false); + }else { + mSearchbar.setEnabled(true); + } View root = mSearchbar.getRootView(); root.setBackgroundColor(ContextCompat.getColor(mContext, R.color.c_background_keyboard)); @@ -586,7 +601,7 @@ class homeViewController triggerPostUI(); mProgressBar.setVisibility(View.GONE); mSplashScreen.animate().cancel(); - mProgressBarIndeterminate.animate().setDuration(250).alpha(0).withEndAction(() -> mSplashScreen.animate().setDuration(350).setStartDelay(200).alpha(0).withEndAction(() -> { + mProgressBarIndeterminate.animate().setStartDelay(300).setDuration(250).alpha(0).withEndAction(() -> mSplashScreen.animate().setDuration(350).setStartDelay(200).alpha(0).withEndAction(() -> { mProgressBarIndeterminate.setVisibility(View.GONE); mSplashScreen.setClickable(false); mSplashScreen.setFocusable(false); @@ -598,7 +613,7 @@ class homeViewController mBlocker.setVisibility(View.GONE); mGatewaySplash.setVisibility(View.GONE); mConnectButton.setVisibility(View.GONE); - + mEvent.invokeObserver(null, enums.etype.M_CACHE_UPDATE_TAB); })); mEvent.invokeObserver(null, enums.etype.M_WELCOME_MESSAGE); mOrbotLogManager.setClickable(false); @@ -820,8 +835,10 @@ class homeViewController { if(total==0){ mFindCount.setText("0/0"); + mFindCount.setTextColor(ContextCompat.getColor(mContext, R.color.dark_red_soft)); }else { mFindCount.setText((total + "/" + index)); + mFindCount.setTextColor(ContextCompat.getColor(mContext, R.color.c_text_v6)); } } @@ -835,7 +852,7 @@ class homeViewController mColor = -1; } - if(!mSearchbar.isFocused() && pTheme!=null && status.sToolbarTheme && mColor!=-1 && helperMethod.getColorDensity(mColor)<0.80){ + if(!mSearchbar.isFocused() && pTheme!=null && status.sToolbarTheme && mColor!=-1 && helperMethod.getColorDensity(mColor)<0.80 && status.sTheme != enums.Theme.THEME_DARK){ mTopBar.setBackgroundColor(mColor); mSearchbar.setTextColor(helperMethod.invertedGrayColor(mColor)); mSearchbar.setHintTextColor(helperMethod.invertedGrayColor(mColor)); @@ -891,6 +908,7 @@ class homeViewController View decorView = mContext.getWindow().getDecorView(); //set status background black decorView.setSystemUiVisibility(decorView.getSystemUiVisibility() & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } + mTopBarHider.setBackgroundColor(mColor); } else{ mSearchLock.setTag(R.id.themed,false); @@ -936,6 +954,8 @@ class homeViewController View decorView = mContext.getWindow().getDecorView(); decorView.setSystemUiVisibility(decorView.getSystemUiVisibility() & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } + + mTopBarHider.setBackground(ContextCompat.getDrawable(mContext, R.color.c_background)); } } } @@ -947,6 +967,8 @@ class homeViewController mFindBar.setVisibility(View.VISIBLE); mFindBar.setAlpha(1); mFindText.requestFocus(); + mFindCount.setText("0/0"); + mFindCount.setTextColor(ContextCompat.getColor(mContext, R.color.c_text_v6)); final Handler handler = new Handler(); handler.postDelayed(() -> { diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/settingManager/clearManager/settingClearController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/settingManager/clearManager/settingClearController.java index b60a7f56..bce61390 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/settingManager/clearManager/settingClearController.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/settingManager/clearManager/settingClearController.java @@ -156,8 +156,7 @@ public class settingClearController extends AppCompatActivity { pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(this), M_DATA_CLEARED); if(mHomeInvoked){ - activityContextManager.getInstance().getHomeController().initializeGeckoView(true, true); - activityContextManager.getInstance().getHomeController().onHomeButton(null); + activityContextManager.getInstance().getHomeController().onClearSettings(); } } @@ -171,7 +170,7 @@ public class settingClearController extends AppCompatActivity { dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_IS_WELCOME_ENABLED,true)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.PROXY_IS_APP_RATED,false)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.VPN_ENABLED,false)); - dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.BRIDGE_ENABLES,true)); + dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.BRIDGE_ENABLES,false)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_FONT_ADJUSTABLE,true)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_ZOOM,true)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_VOICE_INPUT,true)); @@ -183,7 +182,7 @@ public class settingClearController extends AppCompatActivity { dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.SETTING_LANGUAGE_REGION,strings.SETTING_DEFAULT_LANGUAGE_REGION)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.SETTING_SEARCH_ENGINE,constants.CONST_BACKEND_GENESIS_URL)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_BRIDGE_1,strings.BRIDGE_CUSTOM_BRIDGE_OBFS4)); - dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_NOTIFICATION_STATUS,0)); + dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_NOTIFICATION_STATUS,1)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_RESTORE_TAB,false)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_CHARACTER_ENCODING,false)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_SHOW_IMAGES,0)); @@ -192,8 +191,10 @@ public class settingClearController extends AppCompatActivity { dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_FULL_SCREEN_BROWSIING,true)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_THEME, enums.Theme.THEME_DEFAULT)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_LIST_VIEW,true)); + dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SHOW_TAB_GRID,true)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_OPEN_URL_IN_NEW_TAB,true)); - + dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_POPUP,true)); + dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_TYPE,strings.BRIDGE_CUSTOM_BRIDGE_OBFS4)); } /* LOCAL OVERRIDES */ diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabAdapter.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabAdapter.java index a6699d2c..b6cd20fa 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabAdapter.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabAdapter.java @@ -1,23 +1,30 @@ package com.darkweb.genesissearchengine.appManager.tabManager; +import android.animation.Animator; +import android.animation.ObjectAnimator; +import android.animation.PropertyValuesHolder; import android.content.res.Resources; +import android.graphics.Bitmap; import android.graphics.Color; +import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; -import android.os.Handler; -import android.util.Log; +import android.graphics.drawable.TransitionDrawable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.view.animation.AlphaAnimation; +import android.view.animation.Animation; +import android.view.animation.AnimationSet; +import android.view.animation.ScaleAnimation; import android.widget.Button; import android.widget.FrameLayout; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; +import androidx.cardview.widget.CardView; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.core.content.ContextCompat; -import androidx.recyclerview.widget.GridLayoutManager; -import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.darkweb.genesissearchengine.appManager.activityContextManager; import com.darkweb.genesissearchengine.constants.enums; @@ -30,13 +37,13 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; - import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_DOMAIN_URL; import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_HELP_URL; import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_HELP_URL_CACHE; import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_HELP_URL_CACHE_DARK; import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_URL_CACHED; import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_URL_CACHED_DARK; +import static org.mozilla.gecko.util.ThreadUtils.runOnUiThread; public class tabAdapter extends RecyclerView.Adapter { @@ -46,15 +53,23 @@ public class tabAdapter extends RecyclerView.Adapter private eventObserver.eventListener mEvent; private ArrayList mSelectedList = new ArrayList<>(); private Boolean mLongPressMenuEnabled = false; + private boolean mViewLoaded = false; + private ObjectAnimator mFirstRow = null; tabAdapter(ArrayList pModelList, eventObserver.eventListener event) { + initialize(pModelList); + this.mEvent = event; + } + + private void initialize(ArrayList pModelList){ this.mModelList.clear(); this.mModelList.addAll(pModelList); mModelList.add(new tabRowModel(null, null,null)); - this.mEvent = event; + mViewLoaded = false; } + private void reInitData(ArrayList pModelList){ for(int mCounter=0;mCounter holder.itemView.setTag(position); holder.itemView.findViewById(R.id.pRemoveRow).setTag(position); holder.itemView.findViewById(R.id.pLoadSession).setTag(position); + if(position == 0 && status.sTabGridLayoutEnabled && !mViewLoaded){ + onExpandScale(holder.itemView); + mViewLoaded = true; + }else if(position != mModelList.size()-1){ + holder.itemView.setScaleY(1f); + holder.itemView.setScaleX(1f); + } + } + + private boolean mFirstRowAnimating = false; + public void onExpandScale(View v) { + if(mFirstRowAnimating){ + return; + } + mFirstRowAnimating = true; + v.bringToFront(); + if(mFirstRow!=null){ + mFirstRow.end(); + mFirstRow.cancel(); + } + v.setScaleY(0.85f); + v.setScaleX(0.85f); + mFirstRow = ObjectAnimator.ofPropertyValuesHolder(v, + PropertyValuesHolder.ofFloat("scaleX", 0.85f, 1), + PropertyValuesHolder.ofFloat("scaleY", 0.85f, 1)); + mFirstRow.setDuration(200); + mFirstRow.setStartDelay(150); + mFirstRow.start(); + mFirstRow.addListener(new Animator.AnimatorListener() { + @Override + public void onAnimationStart(Animator animation, boolean isReverse) { + + } + + @Override + public void onAnimationEnd(Animator animation, boolean isReverse) { + mFirstRowAnimating = false; + } + + @Override + public void onAnimationStart(Animator animation) { + + } + + @Override + public void onAnimationEnd(Animator animation) { + mFirstRowAnimating = false; + } + + @Override + public void onAnimationCancel(Animator animation) { + mFirstRowAnimating = false; + } + + @Override + public void onAnimationRepeat(Animator animation) { + + } + }); + } + + public void scaleView(View v) { + v.bringToFront(); + ObjectAnimator scaleDown = ObjectAnimator.ofPropertyValuesHolder(v, + PropertyValuesHolder.ofFloat("scaleX", 1, 0.85f), + PropertyValuesHolder.ofFloat("scaleY", 1, 0.85f)); + scaleDown.setDuration(200); + scaleDown.start(); } @Override @@ -114,8 +197,6 @@ public class tabAdapter extends RecyclerView.Adapter } } } - - mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_SHOW_UNDO_DIALOG); } } @@ -141,7 +222,6 @@ public class tabAdapter extends RecyclerView.Adapter mEvent.invokeObserver(Collections.singletonList(0), tabEnums.eTabAdapterCallback.ON_REMOVE_TAB_VIEW_RETAIN_BACKUP); } - mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_SHOW_UNDO_DIALOG); } private void onClearAllSelection(){ @@ -214,8 +294,8 @@ public class tabAdapter extends RecyclerView.Adapter notifyItemRangeChanged(mIndex, mModelList.size()); } + mEvent.invokeObserver(Collections.singletonList(mIndex), tabEnums.eTabAdapterCallback.M_CLEAR_BACKUP); mEvent.invokeObserver(Collections.singletonList(mIndex), tabEnums.eTabAdapterCallback.ON_REMOVE_TAB_VIEW); - mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_SHOW_UNDO_DIALOG); } /*View Holder Extensions*/ @@ -257,8 +337,15 @@ public class tabAdapter extends RecyclerView.Adapter mItemSelectionMenu.setVisibility(View.VISIBLE); mItemSelectionMenuButton.setOnClickListener(this); }else { + mLoadSession.setOnLongClickListener(this); + mRemoveRow.setOnClickListener(this); + mLoadSession.setOnClickListener(this); if(model.getSession().getTheme()==null){ - mBorder.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.c_ripple_v2)); + if(status.sTabGridLayoutEnabled){ + mBorder.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.c_view_divier_background_inner)); + }else { + mBorder.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.c_ripple)); + } }else { try{ mBorder.setBackgroundColor(Color.parseColor(model.getSession().getTheme())); @@ -281,15 +368,30 @@ public class tabAdapter extends RecyclerView.Adapter } if(status.sTabGridLayoutEnabled){ - mDescription.setText(helperMethod.getDomainName(mURL)); + mDescription.setText((model.getSession().getTitle())); }else { mDescription.setText(mURL); } mDate.setText(model.getDate()); - mWebThumbnail.setImageBitmap(model.getBitmap()); - if(getLayoutPosition()==0){ - // mEvent.invokeObserver(Arrays.asList(mWebThumbnail, mURL), enums.etype.fetch_thumbnail); + if(mURL.equals("about:blank")){ + mWebThumbnail.setAlpha(0f); + }else { + Thread timer = new Thread() + { + public void run() + { + runOnUiThread(() -> { + if(mWebThumbnail.getDrawable()==null){ + mWebThumbnail.setImageBitmap(model.getBitmap()); + }else { + Drawable mDrawable = new BitmapDrawable(itemView.getContext().getResources(), model.getBitmap()); + helperMethod.setImageDrawableWithAnimation(mWebThumbnail, mDrawable,250); + } + }); + } + }; + timer.start(); } if(mSelectedList.contains(model.getSession().getSessionID())){ @@ -298,11 +400,7 @@ public class tabAdapter extends RecyclerView.Adapter onSelectionClear(mSelectedView); } - if(model.getSession().equals(mModelList.get(0).getSession())){ - if(!status.sTabGridLayoutEnabled){ - itemView.setBackgroundColor(ContextCompat.getColor(activityContextManager.getInstance().getHomeController(), R.color.c_list_item_current)); - } - }else { + if(!model.getSession().equals(mModelList.get(0).getSession()) && !status.sTabGridLayoutEnabled){ Drawable mDrawable; Resources res = itemView.getContext().getResources(); try { @@ -311,9 +409,49 @@ public class tabAdapter extends RecyclerView.Adapter } catch (Exception ignored) { } } - mLoadSession.setOnLongClickListener(this); - mRemoveRow.setOnClickListener(this); - mLoadSession.setOnClickListener(this); + } + + itemView.setBackgroundColor(ContextCompat.getColor(activityContextManager.getInstance().getHomeController(), R.color.clear_alpha)); + if(!status.sTabGridLayoutEnabled){ + if(getLayoutPosition() == 0){ + itemView.setBackgroundColor(ContextCompat.getColor(activityContextManager.getInstance().getHomeController(), R.color.c_list_item_current)); + } + } + + if(status.sTabGridLayoutEnabled){ + CardView mLayout = itemView.findViewById(R.id.pRowContainerInner); + CardView mCardView = itemView.findViewById(R.id.pCardViewParent); + ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) mLayout.getLayoutParams(); + + if(getLayoutPosition() == 0){ + params.leftMargin = helperMethod.pxFromDp(2.5f); + params.rightMargin = helperMethod.pxFromDp(2.5f); + params.topMargin = helperMethod.pxFromDp(2.5f); + params.bottomMargin = helperMethod.pxFromDp(2.5f); + + if(status.sTheme == enums.Theme.THEME_DARK || status.sDefaultNightMode){ + mCardView.setCardBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.c_button_text_v1_inverted)); + }else { + mCardView.setCardBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.text_color_highlight_v3)); + } + }else { + + if(status.sTheme == enums.Theme.THEME_DARK || status.sDefaultNightMode){ + params.leftMargin = helperMethod.pxFromDp(2.5f); + params.rightMargin = helperMethod.pxFromDp(2.5f); + params.topMargin = helperMethod.pxFromDp(2.5f); + params.bottomMargin = helperMethod.pxFromDp(2.5f); + + mCardView.setCardBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.c_tab_background)); + }else { + params.leftMargin = helperMethod.pxFromDp(0f); + params.rightMargin = helperMethod.pxFromDp(0f); + params.topMargin = helperMethod.pxFromDp(0f); + params.bottomMargin = helperMethod.pxFromDp(0f); + + mCardView.setCardBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.c_view_divier_background)); + } + } } if(this.getLayoutPosition()==mModelList.size()-1){ @@ -327,9 +465,6 @@ public class tabAdapter extends RecyclerView.Adapter mItemSelectionMenuButton.animate().setDuration(250).alpha(1); } }else { - if(model.getmId()!=null){ - mItemSelectionMenuReference.animate().cancel(); - } itemView.setVisibility(View.VISIBLE); mLongPressMenuEnabled = false; mItemSelectionMenuButton.animate().setDuration(250).alpha(1); @@ -351,6 +486,9 @@ public class tabAdapter extends RecyclerView.Adapter }else { onTriggerURL(mModelList.get(this.getLayoutPosition())); + if(status.sTabGridLayoutEnabled){ + scaleView(itemView); + } } }else { for(int mCounter=0;mCounter onRemoveAll(); }else if(pCommands.equals(tabEnums.eTabAdapterCommands.REMOVE_ROW_CROSSED)){ onRemoveRowCross((int)pData.get(0)); + }else if(pCommands.equals(tabEnums.eTabAdapterCommands.M_INITIALIZE)){ + initialize((ArrayList) pData.get(0)); } return null; } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabController.java index 35b45bfd..6a03775d 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabController.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabController.java @@ -1,6 +1,7 @@ package com.darkweb.genesissearchengine.appManager.tabManager; import android.annotation.SuppressLint; +import android.content.res.Configuration; import android.graphics.Canvas; import android.os.Bundle; import android.os.Handler; @@ -27,6 +28,7 @@ import com.darkweb.genesissearchengine.appManager.homeManager.homeController.hom import com.darkweb.genesissearchengine.appManager.settingManager.advanceManager.settingAdvanceController; import com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingHomeController; import com.darkweb.genesissearchengine.constants.constants; +import com.darkweb.genesissearchengine.constants.enums; import com.darkweb.genesissearchengine.constants.status; import com.darkweb.genesissearchengine.dataManager.dataController; import com.darkweb.genesissearchengine.dataManager.dataEnums; @@ -62,14 +64,21 @@ public class tabController extends Fragment private tabAdapter mTabAdapter; private Handler mScrollHandler = null; private Runnable mScrollRunnable = null; - int minScroll = 0; - int maxScroll = 0; + private boolean mTabGridLayoutEnabled = status.sTabGridLayoutEnabled; + private float minScroll = 0; + private float maxScroll = 0; + private float mScreenHeight; + private float getmScreenWidth; + private boolean mClosed = false; + private boolean mClosedByNewTab = false; /*Initializations*/ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { @SuppressLint("InflateParams") View root = inflater.inflate(R.layout.tab_view, null); mRootView = root; + mScreenHeight = helperMethod.pxFromDp(helperMethod.getScreenHeight(activityContextManager.getInstance().getHomeController())); + getmScreenWidth = helperMethod.pxFromDp(helperMethod.getScreenWidth(activityContextManager.getInstance().getHomeController())); super.onCreate(savedInstanceState); return root; @@ -82,11 +91,36 @@ public class tabController extends Fragment } public void onInit(){ - initializeActivity(); - initializeViews(); - initializeLocalEventHandlers(); - initializeList(); - initSwipe(); + if(mTabAdapter==null || mTabGridLayoutEnabled!=status.sTabGridLayoutEnabled){ + initializeActivity(); + initializeViews(); + initializeLocalEventHandlers(); + initializeList(); + initSwipe(); + mTabGridLayoutEnabled = status.sTabGridLayoutEnabled; + }else { + initializeList(); + } + + + mClosed = false; + mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_RELEASE_BLOCKER, null); + mNestedScrollView.scrollTo(0,0); + mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_HIDE_UNDO_DIALOG_INIT, null); + mRecycleView.setAlpha(1); + mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.M_INITIALIZE, Collections.singletonList(mListModel.getList())); + mTabAdapter.notifyDataSetChanged(); + } + + public void onInitFirstElement(){ + if(mTabAdapter!=null){ + mHomeController.runOnUiThread(new Runnable() { + @Override + public void run() { + mTabAdapter.notifyItemChanged(0); + } + }); + } } public void initializeActivity(){ @@ -129,10 +163,16 @@ public class tabController extends Fragment }); mNestedScrollView.getViewTreeObserver().addOnScrollChangedListener(() -> { - int scrollY = mNestedScrollView.getScrollY(); + float scrollY = mNestedScrollView.getScrollY(); minScroll = scrollY; - maxScroll = mRecycleView.computeVerticalScrollRange() - helperMethod.pxFromDp(500); + int orientation = this.getResources().getConfiguration().orientation; + if (orientation == Configuration.ORIENTATION_PORTRAIT) { + maxScroll = mRecycleView.computeVerticalScrollRange() - mScreenHeight*0.350f; + } else { + maxScroll = mRecycleView.computeVerticalScrollRange() - getmScreenWidth*0.20f; + } + onSwipeBounce(300); }); @@ -147,18 +187,22 @@ public class tabController extends Fragment } public void onSwipeBounce(int mDuration){ - if(minScroll > maxScroll){ - if(mScrollHandler!=null){ + if(!mClosed){ + if(minScroll > maxScroll){ + if(mScrollHandler!=null){ + mScrollHandler.removeCallbacksAndMessages(null); + } + + mScrollHandler = new Handler(); + mScrollRunnable = () -> { + mNestedScrollView.clearFocus(); + mRecycleView.clearFocus(); + mNestedScrollView.smoothScrollTo(0, (int)maxScroll); + }; + mScrollHandler.postDelayed(mScrollRunnable, mDuration); + }else if(mScrollHandler!=null){ mScrollHandler.removeCallbacksAndMessages(null); } - - mScrollHandler = new Handler(); - mScrollRunnable = () -> { - mNestedScrollView.clearFocus(); - mRecycleView.clearFocus(); - mNestedScrollView.smoothScrollTo(0, maxScroll); - }; - mScrollHandler.postDelayed(mScrollRunnable, mDuration); } } @@ -217,11 +261,11 @@ public class tabController extends Fragment public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) { int position = viewHolder.getAdapterPosition(); + onExitAndClearBackup(); boolean mStatus = onInitRemoveView(position, true); if(mStatus){ mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.NOTIFY_SWIPE, Collections.singletonList(position)); } - onShowUndoDialog(); viewHolder.itemView.animate().alpha(0); } @@ -251,7 +295,7 @@ public class tabController extends Fragment public void onRemoveTab(int pIndex){ mListModel.onTrigger(tabEnums.eModelCallback.M_REMOVE_TAB,Collections.singletonList(pIndex)); if(mListModel.getList().size()<1){ - mRecycleView.animate().setDuration(350).alpha(0); + mRecycleView.animate().setDuration(200).alpha(0); } initTabCount(400); activityContextManager.getInstance().getHomeController().onLoadTabFromTabController(); @@ -263,14 +307,23 @@ public class tabController extends Fragment mListModel.onTrigger(tabEnums.eModelCallback.M_REMOVE_TAB,Collections.singletonList(pIndex)); mListModel.getList().remove(pIndex); if(mListModel.getList().size()<1){ - mRecycleView.animate().setDuration(350).alpha(0).withEndAction(() -> mTabAdapter.notifyDataSetChanged()); + mRecycleView.animate().setDuration(200).alpha(0).withEndAction(() -> { + onShowUndoDialog(); + mTabAdapter.notifyDataSetChanged(); + }); activityContextManager.getInstance().getHomeController().onLoadTabFromTabController(); - new Handler().postDelayed(() -> onSwipeBounce(0), 400); + new Handler().postDelayed(() -> { + onSwipeBounce(0); + }, 400); return false; }else{ + onShowUndoDialog(); mTabAdapter.notifyItemRangeChanged(pIndex, mTabAdapter.getItemCount() - pIndex); + mTabAdapter.notifyItemChanged(0); activityContextManager.getInstance().getHomeController().onLoadTabFromTabController(); - new Handler().postDelayed(() -> onSwipeBounce(0), 400); + new Handler().postDelayed(() -> { + onSwipeBounce(0); + }, 400); return true; } } @@ -285,11 +338,15 @@ public class tabController extends Fragment } public void onNewTabInvoked(){ - if(mListModel.getList().size()>=1){ + ArrayList mBackup = (ArrayList)mListModel.onTrigger(tabEnums.eModelCallback.M_GET_BACKUP,null); + if(mListModel.getList().size()>=1 && mBackup.size()!=1){ mHomeController.onNewTabBackground(true,false); } + + mClosedByNewTab = false; + onPostExit(); + onBackPressed(); onClose(); - mHomeController.onBackPressed(); } public void onRestoreTab(View view){ @@ -300,18 +357,21 @@ public class tabController extends Fragment handler.postDelayed(() -> { mPopupUndo.findViewById(R.id.pBlockerUndo).setVisibility(View.VISIBLE); - mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_HIDE_UNDO_DIALOG, null); if(mRecycleView.getAlpha()==0){ + mTabAdapter.notifyDataSetChanged(); initializeList(); mRecycleView.animate().cancel(); mRecycleView.setVisibility(View.VISIBLE); - mRecycleView.animate().setDuration(350).alpha(1); + mRecycleView.animate().setDuration(200).alpha(1).withEndAction(() -> mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_HIDE_UNDO_DIALOG, null)); + }else { + mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_HIDE_UNDO_DIALOG, null); + mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.REINIT_DATA, Collections.singletonList(mBackup)); } - mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.REINIT_DATA, Collections.singletonList(mBackup)); mListModel.onTrigger(tabEnums.eModelCallback.M_CLEAR_BACKUP_RETAIN_DATABASE,null); }, 100); + activityContextManager.getInstance().getHomeController().onLoadTabFromTabController(); } public void onShowUndoDialog(){ @@ -339,7 +399,7 @@ public class tabController extends Fragment /*UI Triggers*/ public void onPostExit() { - if(mtabViewController!=null){ + if(mtabViewController!=null && !mClosedByNewTab){ mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_EXIT, null); } } @@ -348,12 +408,16 @@ public class tabController extends Fragment mtabViewController.onTrigger(tabEnums.eTabViewCommands.M_SHOW_MENU, Collections.singletonList(view)); } + public int getSelectionCount(){ + return (int)mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.GET_SELECTION_SIZE,null); + } + public void onRemoveSelection(View view) { int mSelectionSize = (int)mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.GET_SELECTION_SIZE,null); if(mSelectionSize >= mListModel.getList().size()){ - mRecycleView.animate().setDuration(350).alpha(0).withEndAction(() -> { + mRecycleView.animate().setDuration(200).alpha(0).withEndAction(() -> { mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.M_REMOVE_ALL_SELECTION, null); - onShowUndoDialog(); + //onShowUndoDialog(); }); }else { mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.M_REMOVE_ALL_SELECTION, null); @@ -370,7 +434,9 @@ public class tabController extends Fragment public void onClearSelection(View view) { mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.M_CLEAR_ALL_SELECTION, null); - mNestedScrollView.smoothScrollTo(0,0); + if(!mClosed){ + mNestedScrollView.smoothScrollTo(0,0); + } } public void onTriggerSelected(View view){ @@ -384,18 +450,35 @@ public class tabController extends Fragment /*Tab Menu*/ + public void onCloseAllTabs(){ + if(mTabAdapter!=null){ + mTabAdapter.notifyDataSetChanged(); + } + } + public void onMenuTrigger(View pView){ if(pView.getId() == R.id.pNewTab){ - onNewTabInvoked(); + new Handler().postDelayed(this::onNewTabInvoked, 350); + mClosedByNewTab = true; + mHomeController.onBackPressed(); + } + if(pView.getId() == R.id.pNewTabMenu){ + new Handler().postDelayed(this::onNewTabInvoked, 350); + mClosedByNewTab = true; + mHomeController.onBackPressed(); } else if(pView.getId() == R.id.pCloseTab){ - mRecycleView.animate().setDuration(350).alpha(0).withEndAction(() -> { + mRecycleView.animate().setDuration(200).alpha(0).withEndAction(() -> { onClearTabBackup(); mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.REMOVE_ALL, null); }); } else if(pView.getId() == R.id.pOpenSetting){ - helperMethod.openActivity(settingAdvanceController.class, constants.CONST_LIST_HISTORY, activityContextManager.getInstance().getHomeController(),true); + activityContextManager.getInstance().getHomeController().onBackPressed(); + new Handler().postDelayed(() -> + { + helperMethod.openActivity(settingAdvanceController.class, constants.CONST_LIST_HISTORY, activityContextManager.getInstance().getHomeController(),true); + }, 300); } mtabViewController.onTrigger(tabEnums.eTabViewCommands.M_DISMISS_MENU, null); } @@ -421,7 +504,7 @@ public class tabController extends Fragment public void onBackPressed() { - if(mTabAdapter!=null){ + if(mTabAdapter!=null && !mClosedByNewTab){ boolean mStatus = (boolean) mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.M_SELECTION_MENU_SHOWING, null); onClearTabBackup(); onClearSelection(null); @@ -457,6 +540,8 @@ public class tabController extends Fragment onBackPressed(); } else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_LOAD_TAB)){ + mClosed = true; + mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_HOLD_BLOCKER, null); mHomeController.onLoadTab((geckoSession)data.get(0),(boolean)data.get(1),true); } else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_REMOVE_TAB_VIEW)){ @@ -466,13 +551,12 @@ public class tabController extends Fragment else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_REMOVE_TAB_VIEW_RETAIN_BACKUP)){ onInitRemoveView((Integer) data.get(0), false); } - else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_SHOW_UNDO_DIALOG)){ - mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_SHOW_UNDO_DIALOG, Collections.singletonList(mListModel.getList().size())); + else if(e_type.equals(tabEnums.eTabAdapterCallback.M_CLEAR_BACKUP)){ + onExitAndClearBackup(); } else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_SHOW_SELECTION_MENU)){ mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_SHOW_SELECTION_MENU, data); } - return null; } } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabEnums.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabEnums.java index 3bf65263..35feb57c 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabEnums.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabEnums.java @@ -4,15 +4,15 @@ public class tabEnums { /*Settings Manager*/ public enum eTabViewCommands { - M_DISMISS_MENU, M_SHOW_MENU, INIT_TAB_COUNT, ON_HIDE_SELECTION, ON_SHOW_SELECTION, ON_SHOW_SELECTION_MENU, ON_SHOW_UNDO_DIALOG, ON_HIDE_UNDO_DIALOG, ON_GENERATE_SWIPABLE_BACKGROUND, ON_EXIT + M_DISMISS_MENU, M_SHOW_MENU, INIT_TAB_COUNT, ON_HIDE_SELECTION, ON_SHOW_SELECTION, ON_SHOW_SELECTION_MENU, ON_SHOW_UNDO_DIALOG, ON_HIDE_UNDO_DIALOG, ON_GENERATE_SWIPABLE_BACKGROUND, ON_EXIT, ON_HIDE_UNDO_DIALOG_INIT, ON_HOLD_BLOCKER, ON_RELEASE_BLOCKER } public enum eTabAdapterCommands { - M_SELECTION_MENU_SHOWING, M_REMOVE_ALL_SELECTION, M_CLEAR_ALL_SELECTION, ENABLE_LONG_CLICK_MENU, INIT_FIRST_ROW, REINIT_DATA, NOTIFY_SWIPE, GET_SELECTION_SIZE, REMOVE_ALL, REMOVE_ROW_CROSSED + M_SELECTION_MENU_SHOWING, M_REMOVE_ALL_SELECTION, M_CLEAR_ALL_SELECTION, ENABLE_LONG_CLICK_MENU, INIT_FIRST_ROW, REINIT_DATA, NOTIFY_SWIPE, GET_SELECTION_SIZE, REMOVE_ALL, REMOVE_ROW_CROSSED, M_INITIALIZE } public enum eTabAdapterCallback { - ON_HIDE_SELECTION, ON_SHOW_SELECTION, ON_CLEAR_TAB_BACKUP, ON_REMOVE_TAB, ON_INIT_TAB_COUNT, ON_BACK_PRESSED, ON_LOAD_TAB, ON_REMOVE_TAB_VIEW,ON_REMOVE_TAB_VIEW_RETAIN_BACKUP, ON_SHOW_UNDO_DIALOG, ON_SHOW_SELECTION_MENU + ON_HIDE_SELECTION, ON_SHOW_SELECTION, ON_CLEAR_TAB_BACKUP, ON_REMOVE_TAB, ON_INIT_TAB_COUNT, ON_BACK_PRESSED, ON_LOAD_TAB, ON_REMOVE_TAB_VIEW,ON_REMOVE_TAB_VIEW_RETAIN_BACKUP, M_CLEAR_BACKUP, ON_SHOW_SELECTION_MENU } public enum eModelCallback { diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabViewController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabViewController.java index c237b77f..bdc654ff 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabViewController.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabViewController.java @@ -180,13 +180,20 @@ class tabViewController mUndoLayout.setVisibility(View.VISIBLE); mUndoLayout.animate().cancel(); - mUndoLayout.setTranslationY(60); + + int mDuration = 220; + if(mUndoLayout.getAlpha()>0){ + mUndoLayout.setTranslationY(360); + mDuration = 400; + }else { + mUndoLayout.setTranslationY(60); + } mUndoLayout.setAlpha(0); mUndoLayout.animate().withLayer() .translationY(0) .alpha(1f) - .setDuration(220).start(); + .setDuration(mDuration).start(); initTabCount(pTabCount); @@ -208,6 +215,13 @@ class tabViewController mUndoLayout.setVisibility(View.GONE); } + public void blockUI(boolean pStatus){ + if(pStatus){ + mBlocker.setVisibility(View.VISIBLE); + }else { + mBlocker.setVisibility(View.GONE); + } + } private void onDrawSwipableBackground(Canvas pCanvas, RecyclerView.ViewHolder pViewHolder, float pDX, int pActionState) { @@ -271,6 +285,15 @@ class tabViewController }else if(pCommands.equals(tabEnums.eTabViewCommands.ON_EXIT)){ initExitUI(); } + else if(pCommands.equals(tabEnums.eTabViewCommands.ON_HIDE_UNDO_DIALOG_INIT)){ + onHideUndoDialogInit(); + } + else if(pCommands.equals(tabEnums.eTabViewCommands.ON_HOLD_BLOCKER)){ + blockUI(true); + } + else if(pCommands.equals(tabEnums.eTabViewCommands.ON_RELEASE_BLOCKER)){ + blockUI(false); + } return null; } } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/constants/enums.java b/app/src/main/java/com/darkweb/genesissearchengine/constants/enums.java index a791ffb1..8d5a72a0 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/constants/enums.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/constants/enums.java @@ -4,9 +4,9 @@ public class enums { /*Settings Manager*/ public enum etype{ - on_update_favicon,ON_UPDATE_TAB_TITLE, ON_LOAD_REQUEST,GECKO_SCROLL_CHANGED,ON_UPDATE_SEARCH_BAR,M_ON_MAIL, - on_verify_selected_url_menu,FINDER_RESULT_CALLBACK,M_ADMOB_BANNER_RECHECK, - welcome, reload,download_folder, M_UPDATE_THEME,M_ON_BANNER_UPDATE, M_LOAD_HOMEPAGE_GENESIS,M_INIT_TAB_COUNT, + on_update_favicon,ON_UPDATE_TAB_TITLE, ON_OPEN_TAB_VIEW,ON_NEW_TAB_ANIMATION, ON_LOAD_REQUEST,GECKO_SCROLL_CHANGED,GECKO_SCROLL_FINISHED,ON_UPDATE_SEARCH_BAR,M_ON_MAIL,SESSION_ID,M_UPDATE_PIXEL_BACKGROUND,M_CACHE_UPDATE_TAB, + on_verify_selected_url_menu,FINDER_RESULT_CALLBACK,M_ADMOB_BANNER_RECHECK,M_OPEN_SESSION, + welcome, reload,download_folder, M_UPDATE_THEME,M_ON_BANNER_UPDATE, M_LOAD_HOMEPAGE_GENESIS,M_INIT_TAB_COUNT,M_INIT_TAB_COUNT_FORCED, url_triggered, url_triggered_new_tab,url_clear,fetch_favicon, fetch_thumbnail,url_clear_at,remove_from_database,is_empty,M_HOME_PAGE,M_PRELOAD_URL,ON_KEYBOARD_CLOSE,M_CLOSE_TAB, on_close_sesson,on_long_press, on_full_screen,on_handle_external_intent,on_update_suggestion_url,progress_update,progress_update_forced, ON_EXPAND_TOP_BAR,recheck_orbot,on_url_load,on_playstore_load,back_list_empty,start_proxy, ON_UPDATE_THEME, M_INITIALIZE_TAB_SINGLE, M_INITIALIZE_TAB_LINK,on_request_completed, on_update_history,on_update_suggestion,M_WELCOME_MESSAGE,ON_UPDATE_TITLE_BAR,ON_FIRST_PAINT, ON_LOAD_TAB_ON_RESUME, ON_SESSION_REINIT,on_page_loaded,on_load_error,download_file_popup,on_init_ads,search_update, open_new_tab } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/constants/keys.java b/app/src/main/java/com/darkweb/genesissearchengine/constants/keys.java index a22ee7da..387bd5df 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/constants/keys.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/constants/keys.java @@ -61,6 +61,7 @@ public class keys /*Bridge Settings*/ public static final String BRIDGE_CUSTOM_BRIDGE_1 = "CLEAR_PREFS"; + public static final String BRIDGE_CUSTOM_TYPE = "BRIDGE_CUSTOM_TYPE"; public static final String BRIDGE_NOTIFICATION = "BRIDGE_NOTIFICATION"; public static final String BRIDGE_ENABLES = "pref_bridges_enabled"; public static final String VPN_ENABLED = "pref_vpn"; diff --git a/app/src/main/java/com/darkweb/genesissearchengine/constants/status.java b/app/src/main/java/com/darkweb/genesissearchengine/constants/status.java index 55af2f81..d9f1a846 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/constants/status.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/constants/status.java @@ -25,6 +25,7 @@ public class status public static String sSettingLanguageRegion = "Us"; public static String mReferenceWebsites; public static String sBridgeCustomBridge = strings.GENERIC_EMPTY_STR; + public static String sBridgeCustomType = strings.GENERIC_EMPTY_STR; public static boolean sSettingEnableZoom = true; public static boolean sSettingEnableVoiceInput = true; @@ -92,7 +93,8 @@ public class status status.sSettingLanguageRegion = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.SETTING_LANGUAGE_REGION,strings.SETTING_DEFAULT_LANGUAGE_REGION)); status.sSettingSearchStatus = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.SETTING_SEARCH_ENGINE,constants.CONST_BACKEND_GENESIS_URL)); status.sBridgeCustomBridge = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_BRIDGE_1,strings.BRIDGE_CUSTOM_BRIDGE_OBFS4)); - status.sBridgeNotificationManual = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_NOTIFICATION_STATUS,0)); + status.sBridgeCustomType = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_TYPE,strings.GENERIC_EMPTY_SPACE)); + status.sBridgeNotificationManual = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_NOTIFICATION_STATUS,1)); status.sRestoreTabs = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_RESTORE_TAB,false)); status.sCharacterEncoding = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_CHARACTER_ENCODING,false)); status.sShowImages = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_SHOW_IMAGES,0)); diff --git a/app/src/main/java/com/darkweb/genesissearchengine/dataManager/dataController.java b/app/src/main/java/com/darkweb/genesissearchengine/dataManager/dataController.java index 834ccfff..0417ec47 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/dataManager/dataController.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/dataManager/dataController.java @@ -58,7 +58,7 @@ public class dataController } if(status.sRestoreTabs || mThemeApplying){ mTabModel.initializeTab(databaseController.getInstance().selectTabs()); - activityContextManager.getInstance().getHomeController().initTabCount(); + activityContextManager.getInstance().getHomeController().initTabCountForced(); }else{ invokeTab(dataEnums.eTabCommands.M_CLEAR_TAB, null); } @@ -102,7 +102,7 @@ public class dataController return mBookmarkDataModel.onTrigger(pCommands, pData); } - public Object invokeTab(dataEnums.eTabCommands pCommands, List pData){ + public Object invokeTab(dataEnums.eTabCommands pCommands, List pData){ return mTabModel.onTrigger(pCommands, pData); } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/dataManager/suggestionDataModel.java b/app/src/main/java/com/darkweb/genesissearchengine/dataManager/suggestionDataModel.java index 0891569d..585c55f1 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/dataManager/suggestionDataModel.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/dataManager/suggestionDataModel.java @@ -11,6 +11,7 @@ import android.view.textservice.TextServicesManager; import com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkRowModel; import com.darkweb.genesissearchengine.appManager.historyManager.historyRowModel; +import com.darkweb.genesissearchengine.constants.constants; import com.darkweb.genesissearchengine.constants.status; import com.darkweb.genesissearchengine.constants.strings; import java.util.ArrayList; @@ -135,8 +136,14 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess } if(pQuery.length()>0){ - mCurrentList.add( 0,new historyRowModel(pQuery, strings.GENERIC_EMPTY_STR,-1)); + if(!pQuery.equals("about:blank")){ + mCurrentList.add( 0,new historyRowModel(pQuery, strings.GENERIC_EMPTY_STR,-1)); + } } + if(mCurrentList.size()<=0) { + mCurrentList.add( 0,new historyRowModel("Genesis Search", "genesis.onion",-1)); + } + return mCurrentList; } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/dataManager/tabDataModel.java b/app/src/main/java/com/darkweb/genesissearchengine/dataManager/tabDataModel.java index a990c27e..1acaf2ef 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/dataManager/tabDataModel.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/dataManager/tabDataModel.java @@ -15,6 +15,7 @@ import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.Neste import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.geckoSession; import com.darkweb.genesissearchengine.appManager.tabManager.tabRowModel; import com.darkweb.genesissearchengine.constants.enums; +import com.darkweb.genesissearchengine.constants.status; import com.darkweb.genesissearchengine.constants.strings; import org.mozilla.geckoview.GeckoResult; import java.io.ByteArrayInputStream; @@ -163,7 +164,7 @@ class tabDataModel } tabRowModel getRecentTab(){ - if(mTabs.size()>0){ + if(mTabs.size()>1){ return mTabs.get(1); } else { @@ -221,22 +222,31 @@ class tabDataModel int finalCounter = counter; if (mTabs.get(counter).getSession().getSessionID().equals(pSessionID)) { GeckoResult mResult = pBitmapManager.withHandler(handler); - Bitmap mBitmap = pBitmapManager.poll(4000); + Bitmap mBitmap = pBitmapManager.poll(0); + ByteArrayOutputStream out = new ByteArrayOutputStream(); mBitmap.compress(Bitmap.CompressFormat.PNG, 20, out); Bitmap decoded = BitmapFactory.decodeStream(new ByteArrayInputStream(out.toByteArray())); - mTabs.get(finalCounter).setmBitmap(decoded); - if(pImageView!=null){ - activityContextManager.getInstance().getHomeController().runOnUiThread(() -> pImageView.setImageBitmap(mBitmap)); + + Bitmap emptyBitmap = Bitmap.createBitmap(decoded.getWidth(), decoded.getHeight(), decoded.getConfig()); + if (!decoded.sameAs(emptyBitmap)) { + + mTabs.get(finalCounter).setmBitmap(decoded); + + if(pImageView!=null){ + activityContextManager.getInstance().getHomeController().runOnUiThread(() -> { + pImageView.setImageBitmap(mBitmap); + }); + } + + byte[] mThumbnail = out.toByteArray(); + if(status.sRestoreTabs){ + ContentValues mContentValues = new ContentValues(); + mContentValues.put("mThumbnail", mThumbnail); + databaseController.getInstance().execTab("tab",mContentValues, mTabs.get(finalCounter).getmId()); + } } - - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - byte[] mThumbnail = bos.toByteArray(); - - ContentValues mContentValues = new ContentValues(); - mContentValues.put("mThumbnail", mThumbnail); - databaseController.getInstance().execTab("tab",mContentValues, mTabs.get(finalCounter).getmId()); } } @@ -244,7 +254,7 @@ class tabDataModel throwable.printStackTrace(); } if(pOpenTabView){ - activityContextManager.getInstance().getHomeController().onOpenTabReady(); + activityContextManager.getInstance().getHomeController().onLoadFirstElement(); } } @@ -287,15 +297,21 @@ class tabDataModel } else if(pCommands == dataEnums.eTabCommands.CLOSE_TAB){ closeTab((geckoSession)pData.get(0), pData.get(1)); + activityContextManager.getInstance().getHomeController().initTabCountForced(); } else if(pCommands == dataEnums.eTabCommands.M_CLEAR_TAB){ clearTab(); + activityContextManager.getInstance().getHomeController().initTabCountForced(); } else if(pCommands == dataEnums.eTabCommands.M_ADD_TAB){ - return addTabs((geckoSession)pData.get(0), (boolean)pData.get(1)); + int mTabs = addTabs((geckoSession)pData.get(0), (boolean)pData.get(1)); + activityContextManager.getInstance().getHomeController().initTabCountForced(); + + return mTabs; } else if(pCommands == dataEnums.eTabCommands.M_UPDATE_TAB){ updateTab((String) pData.get(1), (geckoSession) pData.get(5)); + activityContextManager.getInstance().getHomeController().initTabCountForced(); } else if(pCommands == dataEnums.eTabCommands.GET_TAB){ return getTab(); diff --git a/app/src/main/java/com/darkweb/genesissearchengine/helperManager/helperMethod.java b/app/src/main/java/com/darkweb/genesissearchengine/helperManager/helperMethod.java index 4d6d0a4e..afd5e608 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/helperManager/helperMethod.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/helperManager/helperMethod.java @@ -13,10 +13,14 @@ import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.res.Resources; +import android.graphics.Bitmap; +import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Point; +import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; +import android.graphics.drawable.TransitionDrawable; import android.net.Uri; import android.os.Vibrator; import android.text.SpannableString; @@ -29,10 +33,12 @@ import android.view.View; import android.view.ViewAnimationUtils; import android.view.ViewGroup; import android.view.animation.Animation; +import android.view.animation.AnimationUtils; import android.view.animation.RotateAnimation; import android.view.inputmethod.InputMethodManager; import android.webkit.MimeTypeMap; import android.widget.ActionMenuView; +import android.widget.ImageView; import android.widget.PopupWindow; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; @@ -217,10 +223,10 @@ public class helperMethod final Intent emailIntent = new Intent(Intent.ACTION_SEND); emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{mail}); - emailIntent.putExtra(Intent.EXTRA_SUBJECT, "get bridges"); - emailIntent.putExtra(Intent.EXTRA_TEXT, "get bridges"); + emailIntent.putExtra(Intent.EXTRA_SUBJECT, "get transport obfs4"); + emailIntent.putExtra(Intent.EXTRA_TEXT, "get transport obfs4"); emailIntent.setSelector( selectorIntent ); - context.startActivity(Intent.createChooser(emailIntent, "get transport")); + context.startActivity(Intent.createChooser(emailIntent, "get transport obfs4")); } public static void sendBridgeEmail(Context context){ @@ -229,10 +235,10 @@ public class helperMethod final Intent emailIntent = new Intent(Intent.ACTION_SEND); emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{"bridges@torproject.org"}); - emailIntent.putExtra(Intent.EXTRA_SUBJECT, "get bridges"); - emailIntent.putExtra(Intent.EXTRA_TEXT, "get bridges"); + emailIntent.putExtra(Intent.EXTRA_SUBJECT, "get transport obfs4"); + emailIntent.putExtra(Intent.EXTRA_TEXT, "get transport obfs4"); emailIntent.setSelector( selectorIntent ); - context.startActivity(Intent.createChooser(emailIntent, "get transport")); + context.startActivity(Intent.createChooser(emailIntent, "get transport obfs4")); } public static void onRevealView(View pView) { @@ -258,6 +264,31 @@ public class helperMethod anim.start(); } + public static Bitmap drawableToBitmap (Drawable drawable) { + Bitmap bitmap = null; + + if(drawable==null){ + return null; + } + if (drawable instanceof BitmapDrawable) { + BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable; + if(bitmapDrawable.getBitmap() != null) { + return bitmapDrawable.getBitmap(); + } + } + + if(drawable.getIntrinsicWidth() <= 0 || drawable.getIntrinsicHeight() <= 0) { + bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888); // Single color bitmap will be created of 1x1 pixel + } else { + bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888); + } + + Canvas canvas = new Canvas(bitmap); + drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); + drawable.draw(canvas); + return bitmap; + } + public static void hideKeyboard(AppCompatActivity context) { View view = context.findViewById(android.R.id.content); if (view != null) @@ -543,10 +574,25 @@ public class helperMethod return (int)(px / context.getResources().getDisplayMetrics().density); } - public static int pxFromDp(int dp){ + public static int pxFromDp(float dp){ return (int) (dp * Resources.getSystem().getDisplayMetrics().density); } + public static void setImageDrawableWithAnimation(ImageView imageView, Drawable drawable, int duration) { + Drawable currentDrawable = imageView.getDrawable(); + if (currentDrawable == null) { + imageView.setImageDrawable(drawable); + return; + } + + TransitionDrawable transitionDrawable = new TransitionDrawable(new Drawable[] { + currentDrawable, + drawable + }); + imageView.setImageDrawable(transitionDrawable); + transitionDrawable.startTransition(duration); + } + public static String getMimeType(String url) { String type = null; String extension = MimeTypeMap.getFileExtensionFromUrl(url); diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/messageManager.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/messageManager.java index 3f78ab4e..24c7897e 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/messageManager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/messageManager.java @@ -282,7 +282,9 @@ class messageManager mContext.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING); if(!status.sBridgeCustomBridge.equals("meek") && !status.sBridgeCustomBridge.equals("obfs4")){ ((EditText)mDialog.findViewById(R.id.pBridgeInput)).setText(status.sBridgeCustomBridge); + ((EditText)mDialog.findViewById(R.id.pBridgeType)).setText(status.sBridgeCustomType); } + mDialog.setOnShowListener(dialog -> mContext.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING)); mDialog.setOnDismissListener(dialog -> { final Handler handler = new Handler(); @@ -310,7 +312,7 @@ class messageManager mDialog.dismiss(); mContext.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); helperMethod.hideKeyboard(mContext); - mEvent.invokeObserver(Collections.singletonList(((EditText)mDialog.findViewById(R.id.pBridgeInput)).getText().toString()), M_SET_BRIDGES); + mEvent.invokeObserver(Arrays.asList(((EditText)mDialog.findViewById(R.id.pBridgeInput)).getText().toString(), ((EditText)mDialog.findViewById(R.id.pBridgeType)).getText().toString()), M_SET_BRIDGES); }); } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbotManager.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbotManager.java index bc69180b..435186ce 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbotManager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbotManager.java @@ -39,6 +39,7 @@ class orbotManager private void onStartOrbot(){ orbotLocalConstants.mBridges = status.sBridgeCustomBridge; orbotLocalConstants.mIsManualBridge = status.sBridgeGatewayManual; + orbotLocalConstants.mManualBridgeType = status.sBridgeCustomType; Prefs.putBridgesEnabled(status.sBridgeStatus); Intent mServiceIntent = new Intent(mAppContext.getApplicationContext(), OrbotService.class); mServiceIntent.setAction(ACTION_START); @@ -49,6 +50,7 @@ class orbotManager { mAppContext.startService(mServiceIntent); } + initializeProxy(); } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/pluginController.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/pluginController.java index 30e7ea00..1253eca3 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/pluginController.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/pluginController.java @@ -250,7 +250,7 @@ public class pluginController pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(constants.CONST_BACKEND_GOOGLE_URL, this), M_BRIDGE_MAIL); } else if(pEventType.equals(M_SET_BRIDGES)){ - activityContextManager.getInstance().getBridgeController().onUpdateBridges((String) pData.get(0)); + activityContextManager.getInstance().getBridgeController().onUpdateBridges((String) pData.get(0), (String) pData.get(1)); } return null; } diff --git a/app/src/main/res/custom-xml/generic/xml/gx_generic_tab_button.xml b/app/src/main/res/custom-xml/generic/xml/gx_generic_tab_button.xml index c30d7c4c..dd8c4855 100644 --- a/app/src/main/res/custom-xml/generic/xml/gx_generic_tab_button.xml +++ b/app/src/main/res/custom-xml/generic/xml/gx_generic_tab_button.xml @@ -31,6 +31,18 @@ + + + + + + + + diff --git a/app/src/main/res/custom-xml/images/xml/ic_baseline_badge.xml b/app/src/main/res/custom-xml/images/xml/ic_baseline_badge.xml new file mode 100644 index 00000000..7e480e24 --- /dev/null +++ b/app/src/main/res/custom-xml/images/xml/ic_baseline_badge.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/custom-xml/images/xml/ic_baseline_cancel.xml b/app/src/main/res/custom-xml/images/xml/ic_baseline_cancel.xml new file mode 100644 index 00000000..1ab7bacb --- /dev/null +++ b/app/src/main/res/custom-xml/images/xml/ic_baseline_cancel.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/custom-xml/tab/xml/tx_card_corner.xml b/app/src/main/res/custom-xml/tab/xml/tx_card_corner.xml new file mode 100644 index 00000000..d7e75114 --- /dev/null +++ b/app/src/main/res/custom-xml/tab/xml/tx_card_corner.xml @@ -0,0 +1,17 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-hdpi/tick_recycler_view.png b/app/src/main/res/drawable-hdpi/tick_recycler_view.png index 3526b49c..5a15d393 100644 Binary files a/app/src/main/res/drawable-hdpi/tick_recycler_view.png and b/app/src/main/res/drawable-hdpi/tick_recycler_view.png differ diff --git a/app/src/main/res/layouts/alert/layout/popup_data_cleared.xml b/app/src/main/res/layouts/alert/layout/popup_data_cleared.xml index 70b10830..888d2f95 100644 --- a/app/src/main/res/layouts/alert/layout/popup_data_cleared.xml +++ b/app/src/main/res/layouts/alert/layout/popup_data_cleared.xml @@ -7,83 +7,90 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - + android:layout_height="match_parent" + android:background="@xml/hox_rounded_corner"> - - - - - - -