diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
index 0d156937..7643783a 100644
--- a/.idea/codeStyles/Project.xml
+++ b/.idea/codeStyles/Project.xml
@@ -1,24 +1,10 @@
-
-
+
+
@@ -130,5 +116,8 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 00000000..79ee123c
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 61a9130c..fb7f4a8a 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 5e39aaa4..001d9548 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -27,8 +27,8 @@
-
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index 6bb12ae8..7422f17c 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -6,7 +6,7 @@
-
+
@@ -32,6 +32,9 @@
+
+
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
index e9a01197..89bf3bae 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -43,5 +43,5 @@
-
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 00000000..797acea5
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/aarch64/release/app-aarch64-arm64-v8a-release.apk b/app/aarch64/release/app-aarch64-arm64-v8a-release.apk
index 31e24494..8ca283be 100644
Binary files a/app/aarch64/release/app-aarch64-arm64-v8a-release.apk and b/app/aarch64/release/app-aarch64-arm64-v8a-release.apk differ
diff --git a/app/aarch64/release/app-aarch64-armeabi-v7a-release.apk b/app/aarch64/release/app-aarch64-armeabi-v7a-release.apk
index bbc866c4..95bb9d3e 100644
Binary files a/app/aarch64/release/app-aarch64-armeabi-v7a-release.apk and b/app/aarch64/release/app-aarch64-armeabi-v7a-release.apk differ
diff --git a/app/aarch64/release/app-aarch64-x86-release.apk b/app/aarch64/release/app-aarch64-x86-release.apk
index b32a98bb..7b26c9b3 100644
Binary files a/app/aarch64/release/app-aarch64-x86-release.apk and b/app/aarch64/release/app-aarch64-x86-release.apk differ
diff --git a/app/aarch64/release/app-aarch64-x86_64-release.apk b/app/aarch64/release/app-aarch64-x86_64-release.apk
index b6dee8c8..d2d3d8b4 100644
Binary files a/app/aarch64/release/app-aarch64-x86_64-release.apk and b/app/aarch64/release/app-aarch64-x86_64-release.apk differ
diff --git a/app/aarch64/release/output-metadata.json b/app/aarch64/release/output-metadata.json
index 43490854..a935360f 100644
--- a/app/aarch64/release/output-metadata.json
+++ b/app/aarch64/release/output-metadata.json
@@ -31,18 +31,6 @@
"versionName": "Build | Dark-Origin 1.1",
"outputFile": "app-aarch64-x86-release.apk"
},
- {
- "type": "ONE_OF_MANY",
- "filters": [
- {
- "filterType": "ABI",
- "value": "arm64-v8a"
- }
- ],
- "versionCode": 1001,
- "versionName": "Build | Dark-Origin 1.1",
- "outputFile": "app-aarch64-arm64-v8a-release.apk"
- },
{
"type": "ONE_OF_MANY",
"filters": [
@@ -54,6 +42,18 @@
"versionCode": 1001,
"versionName": "Build | Dark-Origin 1.1",
"outputFile": "app-aarch64-armeabi-v7a-release.apk"
+ },
+ {
+ "type": "ONE_OF_MANY",
+ "filters": [
+ {
+ "filterType": "ABI",
+ "value": "arm64-v8a"
+ }
+ ],
+ "versionCode": 1001,
+ "versionName": "Build | Dark-Origin 1.1",
+ "outputFile": "app-aarch64-arm64-v8a-release.apk"
}
]
}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index e2e3d053..490f09aa 100755
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -143,7 +143,9 @@
-
+
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 c0fd4296..b34a4d04 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
@@ -76,7 +76,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter p_model_list = mPassedList;
for(int counter = 0; counter< p_model_list.size(); counter++){
@@ -88,7 +88,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter0){
mEvent.invokeObserver(Collections.singletonList(false),enums.etype.on_verify_selected_url_menu);
}else {
+ if(!pIsComputing){
+ notifyDataSetChanged();
+ }
mEvent.invokeObserver(Collections.singletonList(true),enums.etype.on_verify_selected_url_menu);
}
}
@@ -217,12 +231,19 @@ public class bookmarkAdapter extends RecyclerView.Adapter0){
+ initializeModelWithDate(true);
+ notifyDataSetChanged();
+ }
+ }
+
@SuppressLint("ClickableViewAccessibility")
public void onSwipe(View pItemView, String pUrl, View pMenuItem, ImageView pLogoImage, int pId, Date pDate){
@@ -241,6 +262,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter {
@@ -257,12 +279,14 @@ public class bookmarkAdapter extends RecyclerView.Adapter0){
+ initializeModelWithDate(true);
+ notifyDataSetChanged();
+ }
}
public void setPopupWindowEvents(View pView, String pUrl, int pPosition, String pTitle){
@@ -333,29 +366,19 @@ public class bookmarkAdapter extends RecyclerView.Adapter0){
- if(mCurrentList.size()>0 && (mCurrentList.size()>pIndex+1 || mCurrentList.size()==pIndex+1)){
- mDateVerify = true;
- }
- }else {
+
+ if(mPassedList.size()<=0){
mCurrentList.clear();
return;
}
- int size = mCurrentList.size();
- if(mDateVerify){
- mCurrentList.remove(pIndex);
- notifyItemRemoved(pIndex);
- notifyItemRangeChanged(pIndex, mCurrentList.size());
- }else {
- mCurrentList.remove(pIndex);
- notifyItemRemoved(pIndex);
- notifyItemChanged(mCurrentList.size()-1);
- }
- initializeModelWithDate(false);
+ mCurrentList.remove(mRealIndex.get(pIndex));
+ notifyItemRemoved(mRealIndex.get(pIndex));
+ notifyItemRangeChanged(0, mCurrentList.size());
+ clearLongSelectedURL();
}
+
/*View Holder Extensions*/
class listViewHolder extends RecyclerView.ViewHolder
{
@@ -411,8 +434,13 @@ public class bookmarkAdapter extends RecyclerView.Adapter0){
+ mRowMenu.setVisibility(View.INVISIBLE);
+ mRowMenu.setClickable(false);
+ }else {
+ mRowMenu.setVisibility(View.VISIBLE);
+ mRowMenu.setClickable(true);
+ }
mWebLogo.setVisibility(View.VISIBLE);
mHeader.setText(model.getHeader());
mWebLogo.setText((helperMethod.getDomainName(model.getHeader()).toUpperCase().charAt(0)+""));
@@ -443,7 +471,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter {
if (!hasFocus) {
- mSearchInput.clearFocus();
+ // mSearchInput.clearFocus();
}else {
- ((bookmarkAdapter) Objects.requireNonNull(mRecycleView.getAdapter())).setFilter(mSearchInput.getText().toString());
- ((bookmarkAdapter) mRecycleView.getAdapter()).invokeFilter(true);
+ mbookmarkAdapter.setFilter(mSearchInput.getText().toString());
+ mbookmarkAdapter.invokeFilter(true);
+ mbookmarkAdapter.notifyDataSetChanged();
}
});
@@ -167,10 +169,12 @@ public class bookmarkController extends AppCompatActivity
@Override
public void afterTextChanged(Editable editable)
{
- ((bookmarkAdapter) Objects.requireNonNull(mRecycleView.getAdapter())).setFilter(mSearchInput.getText().toString());
- ((bookmarkAdapter) mRecycleView.getAdapter()).invokeFilter(true);
+ mbookmarkAdapter.setFilter(mSearchInput.getText().toString());
+ mbookmarkAdapter.invokeFilter(true);
+ mbookmarkAdapter.notifyDataSetChanged();
}
});
+
}
@Override
@@ -189,31 +193,14 @@ public class bookmarkController extends AppCompatActivity
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
int position = viewHolder.getAdapterPosition();
- mbookmarkAdapter.onTrigger(bookmarkEnums.eBookmarkAdapterCommands.ON_CLOSE,Collections.singletonList(position));
+ mbookmarkAdapter.invokeSwipeClose(position);
}
@Override
public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
- boolean mStatus = (boolean) mbookmarkAdapter.onTrigger(bookmarkEnums.eBookmarkAdapterCommands.GET_LONG_SELECTED_STATUS, null);
- if (recyclerView.getLayoutManager() instanceof LinearLayoutManager) {
- if(mStatus){
- return 0;
- }
- else {
- final int dragFlags = ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT;
- final int swipeFlags = 0;
- return makeMovementFlags(swipeFlags, dragFlags);
- }
- } else {
- if(mStatus){
- return 0;
- }
- else {
- final int dragFlags = ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT;
- final int swipeFlags = 0;
- return makeMovementFlags(swipeFlags, dragFlags);
- }
- }
+ final int dragFlags = ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT;
+ final int swipeFlags = 0;
+ return makeMovementFlags(swipeFlags, dragFlags);
}
@Override
@@ -371,9 +358,6 @@ public class bookmarkController extends AppCompatActivity
else if(e_type.equals(enums.etype.url_clear)){
mbookmarkModel.onManualClear((int)data.get(0));
- if(mbookmarkModel.getList().size()==0){
- mRecycleView.setAlpha(0);
- }
}
else if(e_type.equals(enums.etype.url_clear_at)){
dataController.getInstance().invokeBookmark(dataEnums.eBookmarkCommands.M_DELETE_BOOKMARK ,data);
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/bookmarkManager/bookmarkViewController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/bookmarkManager/bookmarkViewController.java
index 6858eadb..a1c451c0 100755
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/bookmarkManager/bookmarkViewController.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/bookmarkManager/bookmarkViewController.java
@@ -100,6 +100,7 @@ class bookmarkViewController
mEmptyListNotification.animate().setDuration(pDuration).alpha(0f);
mClearButton.setText(strings.HISTORY_CLEAR_HISTORY);
mClearButton.setClickable(true);
+ mRecycleView.setVisibility(View.VISIBLE);
}
else {
mClearButton.setTextColor(ContextCompat.getColor(mContext, R.color.c_text_v3));
@@ -120,6 +121,7 @@ class bookmarkViewController
mClearButton.getLayoutParams().height = 0;
mClearButton.requestLayout();
+ mRecycleView.setVisibility(View.GONE);
}
}
@@ -178,16 +180,13 @@ class bookmarkViewController
mSearchInput.setVisibility(View.GONE);
mSearchInput.setText(strings.GENERIC_EMPTY_STR);
- new Handler().postDelayed(() ->
- {
- mTitle.setAlpha(0f);
- mTitle.setVisibility(View.VISIBLE);
- mTitle.animate().setDuration(150).alpha(1);
+ mTitle.setAlpha(0f);
+ mTitle.setVisibility(View.VISIBLE);
+ mTitle.animate().setDuration(150).alpha(1);
- mSearchButton.setAlpha(0f);
- mSearchButton.setVisibility(View.VISIBLE);
- mSearchButton.animate().setDuration(150).alpha(1);
- }, 500);
+ mSearchButton.setAlpha(0f);
+ mSearchButton.setVisibility(View.VISIBLE);
+ mSearchButton.animate().setDuration(150).alpha(1);
mSearchInput.setText(strings.GENERIC_EMPTY_STR);
mSearchInput.setClickable(false);
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 32fb7d07..535a9df7 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
@@ -91,7 +91,7 @@ public class historyAdapter extends RecyclerView.Adapter p_model_list = mPassedList;
int m_date_state = -1;
@@ -117,7 +117,7 @@ public class historyAdapter extends RecyclerView.Adapter=1){
@@ -126,20 +126,20 @@ public class historyAdapter extends RecyclerView.Adapter0){
mEvent.invokeObserver(Collections.singletonList(false),enums.etype.on_verify_selected_url_menu);
}else {
+ if(!pIsComputing){
+ notifyDataSetChanged();
+ }
mEvent.invokeObserver(Collections.singletonList(true),enums.etype.on_verify_selected_url_menu);
}
}
@@ -272,7 +289,7 @@ public class historyAdapter extends RecyclerView.Adapter0){
+ initializeModelWithDate(true);
+ notifyDataSetChanged();
+ }
+ }
+
@SuppressLint("ClickableViewAccessibility")
public void onSwipe(View pItemView, String pUrl, View pMenuItem, ImageView pLogoImage, int pId, Date pDate){
@@ -300,6 +324,11 @@ public class historyAdapter extends RecyclerView.Adapter0){
+ initializeModelWithDate(true);
+ notifyDataSetChanged();
+ }
};
pItemView.setOnTouchListener((v, event) -> {
@@ -316,12 +345,15 @@ public class historyAdapter extends RecyclerView.Adapter0){
+ initializeModelWithDate(true);
+ notifyDataSetChanged();
+ }
+ }
+
+ public void invokeSwipeClose(int pPosition){
+ onClose(pPosition);
+ invokeFilter(true);
+
+ if(mPopupWindow!=null){
+ mPopupWindow.dismiss();
+ }
}
public void setPopupWindowEvents(View pView, String pUrl, int pPosition, String pTitle){
@@ -393,27 +443,16 @@ public class historyAdapter extends RecyclerView.Adapter0){
- if(mCurrentList.size()>0 && (mCurrentList.size()>pIndex+1 || mCurrentList.size()==pIndex+1)){
- mDateVerify = true;
- }
- }else {
+
+ if(mPassedList.size()<=0){
mCurrentList.clear();
return;
}
- int size = mCurrentList.size();
- if(mDateVerify){
- mCurrentList.remove(pIndex);
- notifyItemRemoved(pIndex);
- notifyItemRangeChanged(pIndex, mCurrentList.size());
- }else {
- mCurrentList.remove(pIndex);
- notifyItemRemoved(pIndex);
- notifyItemChanged(mCurrentList.size()-1);
- }
- initializeModelWithDate(false);
+ mCurrentList.remove(pIndex);
+ notifyItemRemoved(pIndex);
+ notifyItemRangeChanged(0, mCurrentList.size());
+ clearLongSelectedURL();
}
/*View Holder Extensions*/
@@ -472,8 +511,14 @@ public class historyAdapter extends RecyclerView.Adapter0){
+ mRowMenu.setVisibility(View.INVISIBLE);
+ mRowMenu.setClickable(false);
+ }else {
+ mRowMenu.setVisibility(View.VISIBLE);
+ mRowMenu.setClickable(true);
+ }
+
mWebLogo.setVisibility(View.VISIBLE);
mHeader.setText(model.getHeader());
mWebLogo.setText((helperMethod.getDomainName(model.getHeader()).toUpperCase().charAt(0)+""));
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyController.java
index bf2a5e63..01ce7c5d 100755
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyController.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyController.java
@@ -164,6 +164,9 @@ public class historyController extends AppCompatActivity
mSearchInput.setOnEditorActionListener((v, actionId, event) ->{
if (actionId == EditorInfo.IME_ACTION_NEXT)
{
+ mHistoryAdapter.setFilter(mSearchInput.getText().toString());
+ mHistoryAdapter.invokeFilter(true);
+ mHistoryAdapter.notifyDataSetChanged();
helperMethod.hideKeyboard(this);
return true;
}
@@ -172,14 +175,15 @@ public class historyController extends AppCompatActivity
mSearchInput.setOnFocusChangeListener((v, hasFocus) -> {
if (!hasFocus) {
- //mSearchInput.clearFocus();
- //onHideSearch(null);
+ // mSearchInput.clearFocus();
}else {
- //mHistoryAdapter.setFilter(mSearchInput.getText().toString());
- //mHistoryAdapter.invokeFilter(true);
+ mHistoryAdapter.setFilter(mSearchInput.getText().toString());
+ mHistoryAdapter.invokeFilter(true);
+ mHistoryAdapter.notifyDataSetChanged();
}
});
+
mSearchInput.addTextChangedListener(new TextWatcher() {
@Override
@@ -197,6 +201,7 @@ public class historyController extends AppCompatActivity
{
mHistoryAdapter.setFilter(mSearchInput.getText().toString());
mHistoryAdapter.invokeFilter(true);
+ mHistoryAdapter.notifyDataSetChanged();
}
});
}
@@ -212,30 +217,18 @@ public class historyController extends AppCompatActivity
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
int position = viewHolder.getAdapterPosition();
- mHistoryAdapter.onTrigger(historyEnums.eHistoryAdapterCommands.ON_CLOSE,Collections.singletonList(position));
+ mHistoryAdapter.invokeSwipeClose(position);
}
@Override
public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
- boolean mStatus = (boolean) mHistoryAdapter.onTrigger(historyEnums.eHistoryAdapterCommands.GET_LONG_SELECTED_STATUS, null);
- if (recyclerView.getLayoutManager() instanceof LinearLayoutManager) {
- if(mStatus){
- return 0;
- }
- else {
- final int dragFlags = ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT;
- final int swipeFlags = 0;
- return makeMovementFlags(swipeFlags, dragFlags);
- }
- } else {
- if(mStatus){
- return 0;
- }
- else {
- final int dragFlags = ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT;
- final int swipeFlags = 0;
- return makeMovementFlags(swipeFlags, dragFlags);
- }
+ int position = viewHolder.getAdapterPosition();
+ if(mHistoryAdapter.isSwipable(position)){
+ final int dragFlags = ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT;
+ final int swipeFlags = 0;
+ return makeMovementFlags(swipeFlags, dragFlags);
+ }else {
+ return 0;
}
}
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyViewController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyViewController.java
index 0ce2acfb..25cec772 100755
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyViewController.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyViewController.java
@@ -91,6 +91,7 @@ class historyViewController
mEmptyListNotification.animate().setDuration(pDuration).alpha(0f);
mClearButton.setText(strings.HISTORY_CLEAR_HISTORY);
mClearButton.setClickable(true);
+ mRecycleView.setVisibility(View.VISIBLE);
}
else {
mClearButton.setTextColor(ContextCompat.getColor(mContext, R.color.c_text_v3));
@@ -111,6 +112,7 @@ class historyViewController
mClearButton.getLayoutParams().height = 0;
mClearButton.requestLayout();
+ mRecycleView.setVisibility(View.GONE);
}
}
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 e5b5f38b..75146e2d 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
@@ -4,24 +4,24 @@ import android.content.Context;
import androidx.core.view.NestedScrollingChildHelper;
import androidx.core.view.ViewCompat;
import android.util.AttributeSet;
+import android.util.Log;
import android.view.MotionEvent;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import org.mozilla.geckoview.GeckoView;
-import org.mozilla.geckoview.PanZoomController;
-
import java.util.Collections;
-import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_CHANGED;
+
+import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_DOWN;
+import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_UP_ALWAYS;
public class NestedGeckoView extends GeckoView {
- private int mLastY = 0;
- private int deltaY = 0;
+ private int mLastY;
private final int[] mScrollOffset = new int[2];
private final int[] mScrollConsumed = new int[2];
private int mNestedOffsetY;
private NestedScrollingChildHelper mChildHelper;
private eventObserver.eventListener mEvent;
- private int mInputResult = PanZoomController.INPUT_RESULT_UNHANDLED;
+
public void onSetHomeEvent(eventObserver.eventListener pEvent){
mEvent = pEvent;
@@ -32,71 +32,76 @@ public class NestedGeckoView extends GeckoView {
mChildHelper = null;
}
- public NestedGeckoView(final Context context) {
- this(context, null);
- }
+ public NestedGeckoView(Context context, AttributeSet attrs) {
+ super(context.getApplicationContext(), attrs);
- public NestedGeckoView(final Context context, final AttributeSet attrs) {
- super(context, attrs);
mChildHelper = new NestedScrollingChildHelper(this);
setNestedScrollingEnabled(true);
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
- MotionEvent event = MotionEvent.obtain(ev);
- final int action = event.getActionMasked();
- int eventY = (int) event.getY();
+ final MotionEvent event = MotionEvent.obtain(ev);
+ final int action = ev.getActionMasked();
+
+ if (action == MotionEvent.ACTION_DOWN) {
+ mNestedOffsetY = 0;
+ }
+
+ final int eventY = (int) event.getY();
+ event.offsetLocation(0, mNestedOffsetY);
+
+ if(event.getPointerCount() > 1 && !status.sSettingEnableZoom) {
+ return true;
+ }
switch (action) {
case MotionEvent.ACTION_MOVE:
- final boolean allowScroll = !shouldPinOnScreen() &&
- mInputResult == PanZoomController.INPUT_RESULT_HANDLED;
-
- if(!status.sSettingEnableZoom){
- mInputResult = PanZoomController.INPUT_RESULT_UNHANDLED;
- }
+ // mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_FINISHED);
+ final boolean allowScroll = status.sFullScreenBrowsing;
int deltaY = mLastY - eventY;
+
if (allowScroll && dispatchNestedPreScroll(0, deltaY, mScrollConsumed, mScrollOffset)) {
deltaY -= mScrollConsumed[1];
- event.offsetLocation(0f, -mScrollOffset[1]);
+ event.offsetLocation(0, -mScrollOffset[1]);
mNestedOffsetY += mScrollOffset[1];
}
+
mLastY = eventY - mScrollOffset[1];
if (allowScroll && dispatchNestedScroll(0, mScrollOffset[1], 0, deltaY, mScrollOffset)) {
mLastY -= mScrollOffset[1];
- event.offsetLocation(0f, mScrollOffset[1]);
+ event.offsetLocation(0, mScrollOffset[1]);
mNestedOffsetY += mScrollOffset[1];
}
+
+ if(status.sFullScreenBrowsing){
+ Log.i("wow1", eventY + "");
+ }
+
break;
case MotionEvent.ACTION_DOWN:
- // A new gesture started. Reset handled status and ask GV if it can handle this.
- mInputResult = PanZoomController.INPUT_RESULT_UNHANDLED;
-
- updateInputResult(event);
-
- mNestedOffsetY = 0;
mLastY = eventY;
+ startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL);
+ mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_DOWN);
+ break;
- // The event should be handled either by onTouchEvent,
- // either by onTouchEventForResult, never by both.
- // Early return if we sent it to updateInputResult(..) which calls onTouchEventForResult.
- event.recycle();
- return true;
-
- // We don't care about other touch events
case MotionEvent.ACTION_UP:
+ mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_UP_ALWAYS);
case MotionEvent.ACTION_CANCEL:
+ // mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_FINISHED);
stopNestedScroll();
break;
+
+ default:
+ // mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_FINISHED);
}
// Execute event handler from parent class in all cases
- final boolean eventHandled = callSuperOnTouchEvent(event);
+ boolean eventHandled = super.onTouchEvent(event);
// Recycle previously obtained event
event.recycle();
@@ -104,25 +109,6 @@ public class NestedGeckoView extends GeckoView {
return eventHandled;
}
- private boolean callSuperOnTouchEvent(MotionEvent event) {
- return super.onTouchEvent(event);
- }
-
- private void updateInputResult(MotionEvent event) {
- if(status.sSettingEnableZoom){
- super.onTouchEventForResult(event).accept(inputResult -> {
- mInputResult = inputResult;
- mInputResult = PanZoomController.INPUT_RESULT_UNHANDLED;
-
- startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL);
- });
- }
- }
-
- public int getInputResult() {
- return mInputResult;
- }
-
@Override
public void setNestedScrollingEnabled(boolean enabled) {
mChildHelper.setNestedScrollingEnabled(enabled);
@@ -149,11 +135,7 @@ public class NestedGeckoView extends GeckoView {
}
@Override
- public boolean dispatchNestedScroll(int dxConsumed,
- int dyConsumed,
- int dxUnconsumed,
- int dyUnconsumed,
- int[] offsetInWindow) {
+ public boolean dispatchNestedScroll(int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int[] offsetInWindow) {
return mChildHelper.dispatchNestedScroll(dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, offsetInWindow);
}
@@ -167,8 +149,8 @@ public class NestedGeckoView extends GeckoView {
return mChildHelper.dispatchNestedFling(velocityX, velocityY, consumed);
}
- @Override
- public boolean dispatchNestedPreFling(float velocityX, float velocityY) {
- return mChildHelper.dispatchNestedPreFling(velocityX, velocityY);
+ public int getMaxY(){
+ return 1;
}
+
}
\ No newline at end of file
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 f368eb99..6713da70 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
@@ -3,6 +3,7 @@ package com.darkweb.genesissearchengine.appManager.homeManager.geckoManager;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.net.Uri;
+import android.os.Handler;
import android.util.Log;
import android.widget.ImageView;
import androidx.appcompat.app.AppCompatActivity;
@@ -13,8 +14,12 @@ import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
+
import java.io.File;
import java.util.List;
+
+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 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;
@@ -71,15 +76,28 @@ public class geckoClients
public void onValidateInitializeFromStartup(NestedGeckoView mNestedGeckoView, AppCompatActivity pcontext){
boolean mStatus = mSession.onValidateInitializeFromStartup();
if(mStatus){
- // loadURL(mSession.getCurrentURL(), mNestedGeckoView, pcontext);
- mSession.onRestoreState();
- mSession.reload();
+ boolean mState = mSession.onRestoreState();
+ if(!mState){
+ new Handler().postDelayed(() ->
+ {
+ mSession.stop();
+ mSession.loadUri(mSession.getCurrentURL());
+ }, 500);
+ }else {
+ String mURL = mSession.getCurrentURL();
+ if(mURL.equals("https://boogle.store") || mURL.startsWith(CONST_GENESIS_URL_CACHED) || mURL.startsWith(CONST_GENESIS_URL_CACHED_DARK)){
+ if(!mSession.canGoBack()){
+ mNestedGeckoView.releaseSession();
+ mSession.close();
+ mSession.open(mRuntime);
+ mNestedGeckoView.setSession(mSession);
+ }else {
+ mSession.goBack();
+ }
+ loadURL("boogle.store", mNestedGeckoView, pcontext);
+ }
+ }
}
-
- }
-
- public boolean onGetInitializeFromStartup(){
- return mSession.onGetInitializeFromStartup();
}
public geckoSession initFreeSession(GeckoView pGeckoView, AppCompatActivity pcontext, eventObserver.eventListener event){
@@ -223,6 +241,7 @@ public class geckoClients
if(status.sTheme == enums.Theme.THEME_LIGHT || helperMethod.isDayMode(pcontext)){
String mURL = constants.CONST_GENESIS_URL_CACHED + "?pData="+ dataController.getInstance().invokeReferenceWebsite(dataEnums.eReferenceWebsiteCommands.M_FETCH,null);
mSession.getSettings().setAllowJavascript(true);
+ mSession.initURL(mURL);
mSession.loadUri(mURL);
}else {
String mURL = constants.CONST_GENESIS_URL_CACHED_DARK + "?pData="+ dataController.getInstance().invokeReferenceWebsite(dataEnums.eReferenceWebsiteCommands.M_FETCH,null);
@@ -258,6 +277,10 @@ public class geckoClients
onLoadFavIcon(pcontext);
}
+ public boolean isLoaded(){
+ return mSession.isLoaded();
+ }
+
public void onClearSiteData(){
mRuntime.getStorageController().clearData(SITE_SETTINGS);
mRuntime.getStorageController().clearData(SITE_DATA);
@@ -278,9 +301,10 @@ public class geckoClients
mRuntime.getStorageController().clearData(COOKIES);
}
- public void onBackPressed(boolean isFinishAllowed, int mTabSize){
+ public void onBackPressed(boolean isFinishAllowed, int mTabSize, NestedGeckoView mNestedGeckoView, AppCompatActivity pcontext){
if(mSession.canGoBack()){
mSession.goBackSession();
+ mSession.onUpdateBannerAdvert();
}
else if(isFinishAllowed){
if(mSession.getRemovableFromBackPressed() && mTabSize>1){
@@ -321,6 +345,10 @@ public class geckoClients
}
}
+ public void onClose(){
+ mSession.onClose();
+ }
+
public void setRemovableFromBackPressed(boolean pStatus){
mSession.setRemovableFromBackPressed(pStatus);
}
@@ -331,9 +359,18 @@ public class geckoClients
}
public void onReload(NestedGeckoView mNestedGeckoView, AppCompatActivity pcontext){
+ mSession.stop();
+ String url = mSession.getCurrentURL();
+ if(url.startsWith("https://boogle.store/?pG") || url.startsWith("https://boogle.store?pG") || url.endsWith("boogle.store") || url.contains(constants.CONST_GENESIS_HELP_URL_SUB) || url.contains(constants.CONST_GENESIS_HELP_URL_CACHE) || url.contains(constants.CONST_GENESIS_HELP_URL_CACHE_DARK)){
+ loadURL(mSession.getCurrentURL(), mNestedGeckoView, pcontext);
+ }else{
+ mSession.reload();
+ }
+ }
+
+ public void onReloadStatic(NestedGeckoView mNestedGeckoView, AppCompatActivity pcontext){
///mSession.stop();
- mSession.reload();
- //loadURL(mSession.getCurrentURL(), mNestedGeckoView, pcontext);
+ loadURL(mSession.getCurrentURL(), mNestedGeckoView, pcontext);
}
public void manual_download(String url, AppCompatActivity context){
@@ -377,12 +414,53 @@ public class geckoClients
mRuntime.getSettings().setFontSizeFactor(font/100);
}
+ public void reinitHomeTheme(){
+ String mURLFinal;
+ mSession.initURL(constants.CONST_GENESIS_DOMAIN_URL);
+ if(status.sTheme == enums.Theme.THEME_LIGHT || helperMethod.isDayMode(activityContextManager.getInstance().getHomeController())){
+ String mURL = constants.CONST_GENESIS_URL_CACHED + "?pData="+ dataController.getInstance().invokeReferenceWebsite(dataEnums.eReferenceWebsiteCommands.M_FETCH,null);
+ mSession.getSettings().setAllowJavascript(true);
+ mSession.initURL(mURL);
+ mURLFinal = mURL;
+ }else {
+ String mURL = constants.CONST_GENESIS_URL_CACHED_DARK + "?pData="+ dataController.getInstance().invokeReferenceWebsite(dataEnums.eReferenceWebsiteCommands.M_FETCH,null);
+ mSession.getSettings().setAllowJavascript(true);
+ mSession.initURL(mURL);
+ mURLFinal = mURL;
+ }
+
+ if(!mSession.canGoBack()){
+ activityContextManager.getInstance().getHomeController().getGeckoView().releaseSession();
+ mSession.close();
+ mSession.open(mRuntime);
+ activityContextManager.getInstance().getHomeController().getGeckoView().setSession(mSession);
+ }else {
+ mSession.goBack();
+ }
+
+ new Handler().postDelayed(() ->
+ {
+ if(!mSession.canGoBack()){
+ mSession.close();
+ activityContextManager.getInstance().getHomeController().getGeckoView().releaseSession();
+ mSession.open(mRuntime);
+ activityContextManager.getInstance().getHomeController().getGeckoView().setSession(mSession);
+ }
+
+ mSession.loadUri(mURLFinal);
+
+ }, 10);
+
+ }
public class geckoViewClientCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List