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 pData){ + } + + public Object onTrigger(orbotLogEnums.eOrbotLogModelCommands pCommands){ + if(pCommands.equals(orbotLogEnums.eOrbotLogModelCommands.M_GET_LIST)){ + return getList(); + } + else if(pCommands.equals(orbotLogEnums.eOrbotLogModelCommands.M_GET_LIST_SIZE)){ + return getListSize(); + } + return null; + } + } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/orbotLogManager/orbotLogViewController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/orbotLogManager/orbotLogViewController.java index de5931e1..f13f6691 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/orbotLogManager/orbotLogViewController.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/orbotLogManager/orbotLogViewController.java @@ -6,6 +6,7 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.core.widget.NestedScrollView; import androidx.recyclerview.widget.RecyclerView; +import com.darkweb.genesissearchengine.constants.enums; import com.darkweb.genesissearchengine.eventObserver; import com.darkweb.genesissearchengine.helperManager.sharedUIMethod; import com.google.android.material.floatingactionbutton.FloatingActionButton; @@ -56,19 +57,17 @@ class orbotLogViewController private void onUpdateLogs(String pLogs){ pLogs = "~ " + pLogs; - mLogs.setText(String.format("%s%s",mLogs.getText() ,pLogs + "\n\n")); + mLogs.setText(String.format("%s%s",mLogs.getText() , "\n\n" + pLogs )); } - private void onScrollThemeUpdate(){ - if(mNestedScrollView.canScrollVertically(1)){ - if(mFloatingScroller.getAlpha()==0){ - mFloatingScroller.setVisibility(View.VISIBLE); - mFloatingScroller.animate().cancel(); - mFloatingScroller.animate().alpha(1); - } + private void onFloatButtonUpdate(){ + if(mNestedScrollView.canScrollVertically(enums.ScrollDirection.VERTICAL)){ + mFloatingScroller.setVisibility(View.VISIBLE); + mFloatingScroller.animate().cancel(); + mFloatingScroller.animate().setDuration(250).alpha(1); }else { mFloatingScroller.animate().cancel(); - mFloatingScroller.animate().alpha(0).withEndAction(() -> mFloatingScroller.setVisibility(View.GONE)); + mFloatingScroller.animate().setDuration(250).alpha(0).withEndAction(() -> mFloatingScroller.setVisibility(View.GONE)); } } @@ -82,8 +81,8 @@ class orbotLogViewController else if(pCommands.equals(orbotLogEnums.eOrbotLogViewCommands.M_INIT_VIEWS)){ initViews((boolean)pData.get(0)); } - else if(pCommands.equals(orbotLogEnums.eOrbotLogViewCommands.M_SCROLL_THEME_UPDATE)){ - onScrollThemeUpdate(); + else if(pCommands.equals(orbotLogEnums.eOrbotLogViewCommands.M_FLOAT_BUTTON_UPDATE)){ + onFloatButtonUpdate(); } } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/constants/constants.java b/app/src/main/java/com/darkweb/genesissearchengine/constants/constants.java index 2eae1493..5d0060e3 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/constants/constants.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/constants/constants.java @@ -14,7 +14,7 @@ public class constants public static final String CONST_PRIVACY_POLICY_URL = "https://genesishiddentechnologies.com/privacy"; public static final String CONST_REPORT_URL = "https://genesishiddentechnologies.com/reportus?url="; public static final String CONST_SITEMAP = "https://genesishiddentechnologies.com/create"; - public static final String CONST_PACKAGE_NAME = "com.darkweb.genesissearchengine"; + public static final String CONST_PACKAGE_NAME = "com.darkweb.genesissearchengine.dev"; /*DRIVE URL DEV*/ @@ -47,7 +47,7 @@ public class constants public static final String CONST_BACKEND_DUCK_DUCK_GO_URL = "https://duckduckgo.com?q=$s&ia=web"; public static final String CONST_BACKEND_BING_URL = "https://bing.com/search?q=$s"; public static final String CONST_BACKEND_WIKI_URL = "https://en.wikipedia.org/wiki/$s"; - public static final String CONST_LOG_DUCKDUCK = "https://duckduckgo.com/?q=tor logs"; + public static final String CONST_LOG_DUCKDUCK = "https://duckduckgo.com/?q=tor "; /*PROXY CONSTANTS*/ 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 94034c05..f5e3a1c5 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/constants/enums.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/constants/enums.java @@ -35,4 +35,10 @@ public class enums public static final int M_IMAGE_LOADED_SUCCESSFULLY = 1; public static final int M_IMAGE_LOADING_FAILED = 2; } + + public static class ScrollDirection { + public static final int HORIZONTAL = 0; + public static final int VERTICAL = 1; + } + } \ No newline at end of file diff --git a/app/src/main/java/com/darkweb/genesissearchengine/externalNavigationManager/externalNavigationController.java b/app/src/main/java/com/darkweb/genesissearchengine/externalNavigationManager/externalNavigationController.java deleted file mode 100644 index 66dc8c3a..00000000 --- a/app/src/main/java/com/darkweb/genesissearchengine/externalNavigationManager/externalNavigationController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.darkweb.genesissearchengine.externalNavigationManager; - -import android.content.Intent; -import android.net.Uri; -import android.os.Bundle; -import android.os.Handler; -import android.os.Looper; -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 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){ - finish(); - activityContextManager.getInstance().onClearStack(); - 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); - return; - } - - if(status.sSettingIsAppStarted){ - finish(); - activityContextManager.getInstance().onClearStack(); - - new Handler(Looper.getMainLooper()).postDelayed(() -> { - activityContextManager.getInstance().getHomeController().onOpenLinkNewTab(activityContextManager.getInstance().getHomeController().completeURL(data.toString())); - activityContextManager.getInstance().getHomeController().onClearSelectionTab(); - }, 3000); - - 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); - - return; - }else if(status.sSettingIsAppRunning){ - finish(); - status.sExternalWebsite = data.toString(); - return; - } - - 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); - - new Thread(){ - public void run(){ - try { - sleep(1000); - externalNavigationController.this.runOnUiThread(() -> finish()); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - }.start(); - - Intent launchIntent = getPackageManager().getLaunchIntentForPackage(CONST_PACKAGE_NAME); - startActivity(launchIntent); - - } - - @Override - protected void onNewIntent(Intent intent) - { - super.onNewIntent(intent); - Uri data = intent.getData(); - if(data!=null){ - activityContextManager.getInstance().getHomeController().onOpenLinkNewTab(data.toString()); - Intent launchIntent = getPackageManager().getLaunchIntentForPackage(CONST_PACKAGE_NAME); - startActivity(launchIntent); - } - } -} diff --git a/app/src/main/res/custom-xml/generic/xml/ic_baseline_shortcut_erase_back.xml b/app/src/main/res/custom-xml/generic/xml/ic_baseline_shortcut_erase_back.xml new file mode 100644 index 00000000..0a96d2fc --- /dev/null +++ b/app/src/main/res/custom-xml/generic/xml/ic_baseline_shortcut_erase_back.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/custom-xml/generic/xml/shortcuts.xml b/app/src/main/res/custom-xml/generic/xml/shortcuts.xml index 0633ade9..2dce1ea5 100644 --- a/app/src/main/res/custom-xml/generic/xml/shortcuts.xml +++ b/app/src/main/res/custom-xml/generic/xml/shortcuts.xml @@ -4,39 +4,39 @@ + android:targetPackage="com.darkweb.genesissearchengine.dev" + android:targetClass="com.darkweb.genesissearchengine.appManager.externalNavigationManager.externalShortcuts"> + android:targetPackage="com.darkweb.genesissearchengine.dev" + android:targetClass="com.darkweb.genesissearchengine.appManager.externalNavigationManager.externalShortcuts"> + android:targetPackage="com.darkweb.genesissearchengine.dev" + android:targetClass="com.darkweb.genesissearchengine.appManager.externalNavigationManager.externalShortcuts"> diff --git a/app/src/main/res/custom-xml/images/xml/ic_baseline_shortcut_erase.xml b/app/src/main/res/custom-xml/images/xml/ic_baseline_shortcut_erase.xml index fbaff4f7..f446b31d 100644 --- a/app/src/main/res/custom-xml/images/xml/ic_baseline_shortcut_erase.xml +++ b/app/src/main/res/custom-xml/images/xml/ic_baseline_shortcut_erase.xml @@ -1,5 +1,6 @@ - - + android:width="48dp" xmlns:android="http://schemas.android.com/apk/res/android"> + + diff --git a/app/src/main/res/layouts/alert/layout/popup_data_cleared_shortcut.xml b/app/src/main/res/layouts/alert/layout/popup_data_cleared_shortcut.xml index d7bbffe7..43ef7bdb 100644 --- a/app/src/main/res/layouts/alert/layout/popup_data_cleared_shortcut.xml +++ b/app/src/main/res/layouts/alert/layout/popup_data_cleared_shortcut.xml @@ -82,9 +82,9 @@ android:layout_height="match_parent" android:background="@xml/ax_ripple_default_round_bottom" android:padding="0dp" - android:textAlignment="textStart" - android:paddingStart="28.5dp" + android:paddingStart="38dp" android:text="@string/ALERT_DATA_CLEARED_BUTTON" + android:textAlignment="textStart" android:textAllCaps="false" android:textColor="@color/holo_gray" android:textSize="14sp" diff --git a/app/src/main/res/layouts/history/xml/ic_baseline_shortcut_add_new_back.xml b/app/src/main/res/layouts/history/xml/ic_baseline_shortcut_add_new_back.xml new file mode 100644 index 00000000..c20e9ecf --- /dev/null +++ b/app/src/main/res/layouts/history/xml/ic_baseline_shortcut_add_new_back.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layouts/history/xml/ic_baseline_shortcut_cross_back.xml b/app/src/main/res/layouts/history/xml/ic_baseline_shortcut_cross_back.xml new file mode 100644 index 00000000..d398a0b8 --- /dev/null +++ b/app/src/main/res/layouts/history/xml/ic_baseline_shortcut_cross_back.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layouts/orbotLog/layout/orbot_log_view.xml b/app/src/main/res/layouts/orbotLog/layout/orbot_log_view.xml index 4eb45204..1127d845 100644 --- a/app/src/main/res/layouts/orbotLog/layout/orbot_log_view.xml +++ b/app/src/main/res/layouts/orbotLog/layout/orbot_log_view.xml @@ -126,14 +126,13 @@ android:id="@+id/pLogs" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginEnd="12dp" android:background="@xml/sx_border_left" android:layout_marginStart="10dp" android:paddingStart="15dp" - android:paddingEnd="10dp" - android:paddingTop="25dp" - android:paddingBottom="5dp" - android:layout_marginBottom="190dp" + android:paddingEnd="15dp" + android:paddingTop="20dp" + android:paddingBottom="20dp" + android:layout_marginBottom="150dp" android:layout_marginTop="20dp" android:textColor="@color/c_text_v4" android:textSize="14sp" @@ -160,7 +159,7 @@ android:visibility="gone" android:layout_marginEnd="16dp" android:layout_marginBottom="16dp" - android:onClick="onScrollBottom" + android:onClick="onScrollBottomAnimated" android:clickable="true" android:tint="@color/white" app:layout_constraintBottom_toBottomOf="parent" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e31beafd..b1517969 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -23,7 +23,7 @@ Erase browsing history Erase & open Erase and open - Restart + Restart or Open Restart Application diff --git a/progress.txt b/progress.txt index 73bdc06d..aa29bdb5 100644 --- a/progress.txt +++ b/progress.txt @@ -7,4 +7,9 @@ settingLogModel settingLogViewController /* In Progress */ -OrbotLogs \ No newline at end of file +orbotLogAdapter +orbotLogController +orbotLogEnums +orbotLogModel +orbotLogStatus +orbotLogViewController