diff --git a/Release Checklist.xlsx b/Release Checklist.xlsx
index 0a63db35..a28794bb 100644
Binary files a/Release Checklist.xlsx and b/Release Checklist.xlsx differ
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index bc9f8b8d..24ba4b5a 100755
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -101,7 +101,7 @@
android:windowSoftInputMode="adjustPan" />
-
-
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/externalNavigationManager/externalNavigationController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/externalNavigationManager/externalNavigationController.java
new file mode 100644
index 00000000..17796412
--- /dev/null
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/externalNavigationManager/externalNavigationController.java
@@ -0,0 +1,77 @@
+package com.darkweb.genesissearchengine.appManager.externalNavigationManager;
+
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import androidx.appcompat.app.AppCompatActivity;
+import com.darkweb.genesissearchengine.appManager.activityContextManager;
+import com.darkweb.genesissearchengine.appManager.homeManager.homeController.homeController;
+import com.darkweb.genesissearchengine.constants.status;
+import com.darkweb.genesissearchengine.helperManager.helperMethod;
+import static com.darkweb.genesissearchengine.constants.constants.CONST_PACKAGE_NAME;
+
+public class externalNavigationController extends AppCompatActivity {
+ @Override
+
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ Uri data = externalNavigationController.this.getIntent().getData();
+ if(data == null || status.sSettingIsAppStarted){
+
+ /* Close Activity */
+
+ finish();
+ activityContextManager.getInstance().onClearStack();
+
+ /* Create Request Handler */
+
+ if(status.sSettingIsAppStarted && data!=null){
+ helperMethod.onDelayHandler(this, 3000, () -> {
+ activityContextManager.getInstance().getHomeController().onOpenLinkNewTab(activityContextManager.getInstance().getHomeController().completeURL(data.toString()));
+ activityContextManager.getInstance().getHomeController().onClearSelectionTab();
+ return null;
+ });
+ }
+
+ Intent bringToForegroundIntent = new Intent(activityContextManager.getInstance().getHomeController(), homeController.class);
+ bringToForegroundIntent.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | Intent.FLAG_ACTIVITY_NEW_TASK);
+ startActivity(bringToForegroundIntent);
+ }
+ else if(status.sSettingIsAppRunning){
+
+ /* Refresh Intent Data */
+
+ finish();
+ status.sExternalWebsite = data.toString();
+
+ }else {
+
+ /* Start Required Activity */
+
+ Intent intent = new Intent(this.getIntent());
+ intent.setClassName(this.getApplicationContext(), homeController.class.getName());
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
+
+ if(activityContextManager.getInstance().getHomeController()!=null){
+ activityContextManager.getInstance().getHomeController().onOpenLinkNewTab(data.toString());
+ }else {
+ status.sExternalWebsite = data.toString();
+ }
+
+ this.startActivity(intent);
+ this.overridePendingTransition(0, 0);
+
+ /* Bring Application To Front */
+
+ Intent launchIntent = getPackageManager().getLaunchIntentForPackage(CONST_PACKAGE_NAME);
+ startActivity(launchIntent);
+
+ /* Close Activity */
+
+ helperMethod.onDelayHandler(this, 1000, () -> {
+ finish();
+ return null;
+ });
+ }
+ }
+}
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/externalNavigationManager/externalShortcuts.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/externalNavigationManager/externalShortcuts.java
similarity index 76%
rename from app/src/main/java/com/darkweb/genesissearchengine/externalNavigationManager/externalShortcuts.java
rename to app/src/main/java/com/darkweb/genesissearchengine/appManager/externalNavigationManager/externalShortcuts.java
index cefbaa19..be006bf2 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/externalNavigationManager/externalShortcuts.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/externalNavigationManager/externalShortcuts.java
@@ -1,4 +1,4 @@
-package com.darkweb.genesissearchengine.externalNavigationManager;
+package com.darkweb.genesissearchengine.appManager.externalNavigationManager;
import android.content.Intent;
import android.net.Uri;
@@ -16,6 +16,7 @@ import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.databaseManager.databaseController;
+import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.example.myapplication.R;
import org.mozilla.geckoview.ContentBlocking;
import org.torproject.android.service.wrapper.orbotLocalConstants;
@@ -58,66 +59,15 @@ public class externalShortcuts extends AppCompatActivity {
new Handler().postDelayed(() ->
{
- Uri data = this.getIntent().getData();
- if(data == null){
- finish();
- activityContextManager.getInstance().onClearStack();
- Intent bringToForegroundIntent = new Intent(externalShortcuts.this, homeController.class);
- bringToForegroundIntent.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | Intent.FLAG_ACTIVITY_NEW_TASK);
- startActivity(bringToForegroundIntent);
- overridePendingTransition(R.anim.fade_in_instant, R.anim.fade_out_instant);
- return;
- }
-
- if(status.sSettingIsAppStarted){
- finish();
- activityContextManager.getInstance().onClearStack();
-
- new Handler().postDelayed(() ->
- {
- activityContextManager.getInstance().getHomeController().onOpenLinkNewTab(activityContextManager.getInstance().getHomeController().completeURL(data.toString()));
- activityContextManager.getInstance().getHomeController().onClearSelectionTab();
- }, 500);
-
- Intent bringToForegroundIntent = new Intent(activityContextManager.getInstance().getHomeController(), homeController.class);
- bringToForegroundIntent.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | Intent.FLAG_ACTIVITY_NEW_TASK);
- startActivity(bringToForegroundIntent);
- overridePendingTransition(R.anim.fade_in_instant, R.anim.fade_out_instant);
-
- return;
- }else if(status.sSettingIsAppRunning){
- finish();
- status.sExternalWebsite = data.toString();
- return;
- }
+ /* Start Required Activity */
Intent intent = new Intent(this.getIntent());
intent.setClassName(this.getApplicationContext(), homeController.class.getName());
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
- if(activityContextManager.getInstance().getHomeController()!=null){
- activityContextManager.getInstance().getHomeController().onOpenLinkNewTab(data.toString());
- }else {
- status.sExternalWebsite = data.toString();
- }
-
this.startActivity(intent);
overridePendingTransition(R.anim.fade_in_instant, R.anim.fade_out_instant);
- new Thread(){
- public void run(){
- try {
- sleep(1000);
- externalShortcuts.this.runOnUiThread(() -> finish());
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }.start();
-
- Intent launchIntent = getPackageManager().getLaunchIntentForPackage(CONST_PACKAGE_NAME);
- startActivity(launchIntent);
- overridePendingTransition(R.anim.fade_in_instant, R.anim.fade_out_instant);
}, 800);
}
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/orbotLogManager/orbotLogAdapter.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/orbotLogManager/orbotLogAdapter.java
index 28897e4c..1ee10d90 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/orbotLogManager/orbotLogAdapter.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/orbotLogManager/orbotLogAdapter.java
@@ -71,7 +71,7 @@ public class orbotLogAdapter extends RecyclerView.Adapter {
+ if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE || newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
+ if(!orbotLogStatus.sUIInteracted && ((int)mOrbotModel.onTrigger(M_GET_LIST_SIZE)>1)){
+ if(mNestedScrollView.canScrollVertically(enums.ScrollDirection.VERTICAL)){
+ onScrollBottom();
+ }
+ }else {
+ mNestedScrollView.scrollTo(0,0);
+ }
+ orbotLogStatus.sScrollPosition = -1;
+ }
+
+ return null;
+ });
+
super.onConfigurationChanged(newConfig);
}
- public void initializeViews() {
+
+ private void initializeViews() {
mLogRecycleView = findViewById(R.id.pLogRecycleView);
mLogs = findViewById(R.id.pLogs);
mNestedScrollView = findViewById(R.id.pNestedScrollView);
@@ -92,13 +115,13 @@ public class orbotLogController extends AppCompatActivity {
mOrbotModel = new orbotLogModel();
}
- public void initializeLogs(){
+ private void initializeLogs(){
mLogCounter = 0;
+ mOrbotModel.setList(orbotLocalConstants.mTorLogsHistory);
if(status.sLogThemeStyleAdvanced){
- mLogCounter = orbotLocalConstants.mTorLogsHistory.size();
- mOrbotModel.setList(orbotLocalConstants.mTorLogsHistory);
+ mLogCounter = (int)mOrbotModel.onTrigger(M_GET_LIST_SIZE);
LinearLayoutManager layoutManager = new LinearLayoutManager(orbotLogController.this);
- orbotLogAdapter adapter = new orbotLogAdapter(mOrbotModel.getList(),new orbotLogController.orbotModelCallback());
+ orbotLogAdapter adapter = new orbotLogAdapter(((ArrayList)mOrbotModel.onTrigger(M_GET_LIST)),new orbotLogController.orbotModelCallback());
mOrbotAdapter = adapter;
layoutManager.setReverseLayout(true);
@@ -114,12 +137,13 @@ public class orbotLogController extends AppCompatActivity {
logToString();
}
mOrbotLogViewController.onTrigger(orbotLogEnums.eOrbotLogViewCommands.M_INIT_VIEWS, Collections.singletonList(status.sLogThemeStyleAdvanced));
- mLogRecycleView.smoothScrollToPosition(mOrbotModel.getList().size());
+ mLogRecycleView.smoothScrollToPosition((int)mOrbotModel.onTrigger(M_GET_LIST_SIZE));
}
/* LISTENERS */
+ @RequiresApi(api = Build.VERSION_CODES.M)
@SuppressLint("ClickableViewAccessibility")
private void initListener(){
@@ -127,29 +151,27 @@ public class orbotLogController extends AppCompatActivity {
@SuppressLint("NewApi") @SuppressWarnings("deprecation")
@Override
public void onGlobalLayout() {
- if(orbotLogStatus.sScrollPosition!=-1){
+ if(orbotLogStatus.sScrollPosition!=-1 && orbotLogStatus.sUIInteracted){
mNestedScrollView.scrollTo(0, orbotLogStatus.sScrollPosition);
- }else if(mNestedScrollView.canScrollVertically(1)){
- onScrollBottom(null);
+ }else if(mNestedScrollView.canScrollVertically(enums.ScrollDirection.VERTICAL)){
+ onScrollBottom();
}
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
- mNestedScrollView.setOnScrollChangeListener((View.OnScrollChangeListener) (v, scrollX, scrollY, oldScrollX, oldScrollY) -> {
- orbotLogStatus.sScrollPosition = scrollY;
- });
+ mNestedScrollView.setOnScrollChangeListener((View.OnScrollChangeListener) (v, scrollX, scrollY, oldScrollX, oldScrollY) -> orbotLogStatus.sScrollPosition = scrollY);
}
- mOrbotLogViewController.onTrigger(M_SCROLL_THEME_UPDATE);
+ mOrbotLogViewController.onTrigger(M_FLOAT_BUTTON_UPDATE);
mLogRecycleView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
});
mNestedScrollView.setOnTouchListener((v, event) -> {
- if(mNestedScrollView.canScrollVertically(1)){
+ if(mNestedScrollView.canScrollVertically(enums.ScrollDirection.VERTICAL)){
orbotLogStatus.sUIInteracted = true;
}
if(event.getAction() == MotionEvent.ACTION_UP){
- mOrbotLogViewController.onTrigger(M_SCROLL_THEME_UPDATE);
+ mOrbotLogViewController.onTrigger(M_FLOAT_BUTTON_UPDATE);
}
if(event.getAction() == MotionEvent.ACTION_UP){
@@ -161,9 +183,23 @@ public class orbotLogController extends AppCompatActivity {
return false;
});
+ mLogRecycleView.addOnScrollListener(new RecyclerView.OnScrollListener() {
+ @Override
+ public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
+ super.onScrollStateChanged(recyclerView, newState);
+ if (!recyclerView.canScrollVertically(1) && newState==RecyclerView.SCROLL_STATE_IDLE) {
+ mOrbotLogViewController.onTrigger(M_FLOAT_BUTTON_UPDATE);
+ }
+ }
+ });
+
mNestedScrollView.getViewTreeObserver() .addOnScrollChangedListener(() -> {
- if (mNestedScrollView.getChildAt(0).getBottom() <= (mNestedScrollView.getHeight() + mNestedScrollView.getScrollY())) {
- mOrbotLogViewController.onTrigger(M_SCROLL_THEME_UPDATE);
+ if (mNestedScrollView.getScrollY() == 0)
+ {
+ mOrbotLogViewController.onTrigger(M_FLOAT_BUTTON_UPDATE);
+ }
+ else if (mNestedScrollView.getChildAt(0).getBottom() <= (mNestedScrollView.getHeight() + mNestedScrollView.getScrollY())) {
+ mOrbotLogViewController.onTrigger(M_FLOAT_BUTTON_UPDATE);
if(!mIsRecycleviewInteracting){
orbotLogStatus.sUIInteracted = false;
@@ -172,60 +208,73 @@ public class orbotLogController extends AppCompatActivity {
});
}
- public void logToString(){
- for(int mCounter=0;mCounter1){
+ for(int mCounter=0;mCounter<(int)mOrbotModel.onTrigger(M_GET_LIST_SIZE);mCounter++){
+ mOrbotLogViewController.onTrigger(orbotLogEnums.eOrbotLogViewCommands.M_UPDATE_LOGS, Collections.singletonList(((ArrayList)mOrbotModel.onTrigger(M_GET_LIST)).get(mCounter).getLog()));
+ mLogCounter+=1;
+ }
}
}
- public void updateLogs(){
+ private void updateLogs(){
new Thread(){
public void run(){
+ try {
+ sleep(1000);
while (!mActivityClosed){
- try {
if(status.sLogThemeStyleAdvanced){
sleep(800);
}else {
sleep(100);
}
- if(orbotLocalConstants.mTorLogsHistory.size()>0){
+ if(mLogCounter>0){
runOnUiThread(() -> {
if(orbotLocalConstants.mTorLogsHistory.size()>mLogCounter){
- mOrbotModel.getList().add(orbotLocalConstants.mTorLogsHistory.get(mLogCounter));
+ ((ArrayList)mOrbotModel.onTrigger(M_GET_LIST)).add(orbotLocalConstants.mTorLogsHistory.get(mLogCounter));
if(!status.sLogThemeStyleAdvanced){
- mOrbotLogViewController.onTrigger(orbotLogEnums.eOrbotLogViewCommands.M_UPDATE_LOGS, Collections.singletonList(orbotLocalConstants.mTorLogsHistory.get(mLogCounter).getLog()));
+ mOrbotLogViewController.onTrigger(orbotLogEnums.eOrbotLogViewCommands.M_UPDATE_LOGS, Collections.singletonList(((ArrayList)mOrbotModel.onTrigger(M_GET_LIST)).get(mLogCounter).getLog()));
}else {
if(mOrbotAdapter!=null){
- mOrbotAdapter.notifyItemInserted(mOrbotModel.getList().size()-1);
+ mOrbotAdapter.notifyItemInserted((int)mOrbotModel.onTrigger(M_GET_LIST_SIZE)-1);
}
}
+
+ if(!orbotLogStatus.sUIInteracted){
+ helperMethod.onDelayHandler(orbotLogController.this, 150, () -> {
+ if(!orbotLogStatus.sUIInteracted){
+ onScrollBottomAnimated(null);
+ }
+ return null;
+ });
+ }
mLogCounter+=1;
}
});
}
- sleep(100);
- if(!orbotLogStatus.sUIInteracted){
- runOnUiThread(() -> {
- if(orbotLocalConstants.mTorLogsHistory.size()>mLogCounter) {
- onScrollBottom(null);
- }
- });
- }
- } catch (InterruptedException e) {
- e.printStackTrace();
}
}
+ catch (InterruptedException e) {
+ e.printStackTrace();
+ }
}
}.start();
}
+ private void onScrollBottom() {
+ mNestedScrollView.scrollTo(0,helperMethod.pxFromDp((int)mOrbotModel.onTrigger(M_GET_LIST_SIZE)*100));
+ }
+
/* View Callback */
- public void onScrollBottom(View view) {
+ public void onScrollBottomAnimated(View view) {
mNestedScrollView.fullScroll(View.FOCUS_DOWN);
orbotLogStatus.sUIInteracted = false;
+
+ if(view!=null){
+ mOrbotLogViewController.onTrigger(M_FLOAT_BUTTON_UPDATE);
+ }
}
public void onOpenInfo(View view) {
@@ -287,8 +336,12 @@ public class orbotLogController extends AppCompatActivity {
/* External Calls */
public void onRefreshLayoutTheme(){
- orbotLogStatus.sScrollPosition = 0;
- orbotLogStatus.sUIInteracted = false;
+ if(!orbotLogStatus.sUIInteracted){
+ orbotLogStatus.sScrollPosition = -1;
+ }else {
+ orbotLogStatus.sScrollPosition = 0;
+ }
+
mIsRecycleviewInteracting = false;
recreate();
}
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/orbotLogManager/orbotLogEnums.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/orbotLogManager/orbotLogEnums.java
index 14ec6159..7a45a5e4 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/orbotLogManager/orbotLogEnums.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/orbotLogManager/orbotLogEnums.java
@@ -5,11 +5,12 @@ public class orbotLogEnums
/*Orbot Log View Manager*/
public enum eOrbotLogViewCommands {
- M_UPDATE_LOGS, M_INIT_VIEWS, M_SCROLL_THEME_UPDATE
+ M_UPDATE_LOGS, M_INIT_VIEWS, M_FLOAT_BUTTON_UPDATE
}
/*Orbot Log Model Manager*/
public enum eOrbotLogModelCommands {
+ M_GET_LIST, M_GET_LIST_SIZE
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/orbotLogManager/orbotLogModel.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/orbotLogManager/orbotLogModel.java
index 8ca2f481..bf9b10a3 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/orbotLogManager/orbotLogModel.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/orbotLogManager/orbotLogModel.java
@@ -4,6 +4,7 @@ import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import org.torproject.android.service.wrapper.logRowModel;
import java.util.ArrayList;
+import java.util.List;
class orbotLogModel
{
@@ -24,8 +25,29 @@ class orbotLogModel
}
}
- ArrayList getList()
+ private ArrayList getList()
{
return mModelList;
}
+
+ private int getListSize()
+ {
+ return mModelList.size();
+ }
+
+ /*Triggers*/
+
+ public void onTrigger(orbotLogEnums.eOrbotLogViewCommands pCommands, List