|
@ -35,5 +35,17 @@
|
||||||
<option name="m_ignoreAnnotatedVariables" value="false" />
|
<option name="m_ignoreAnnotatedVariables" value="false" />
|
||||||
</inspection_tool>
|
</inspection_tool>
|
||||||
<inspection_tool class="UnusedReturnValue" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="UnusedReturnValue" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
|
<inspection_tool class="unused" enabled="true" level="WARNING" enabled_by_default="true" parameter="packageLocal">
|
||||||
|
<option name="LOCAL_VARIABLE" value="true" />
|
||||||
|
<option name="FIELD" value="true" />
|
||||||
|
<option name="METHOD" value="true" />
|
||||||
|
<option name="CLASS" value="true" />
|
||||||
|
<option name="PARAMETER" value="true" />
|
||||||
|
<option name="REPORT_PARAMETER_FOR_PUBLIC_METHODS" value="false" />
|
||||||
|
<option name="ADD_MAINS_TO_ENTRIES" value="true" />
|
||||||
|
<option name="ADD_APPLET_TO_ENTRIES" value="true" />
|
||||||
|
<option name="ADD_SERVLET_TO_ENTRIES" value="true" />
|
||||||
|
<option name="ADD_NONJAVA_TO_ENTRIES" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
</profile>
|
</profile>
|
||||||
</component>
|
</component>
|
|
@ -34,9 +34,10 @@
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"/>
|
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"/>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingController"
|
android:name="com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingHomeController"
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
|
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
|
||||||
android:label="@string/SETTING_HEADER"
|
android:label="@string/SETTING_HEADER"
|
||||||
|
android:launchMode="singleTop"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.darkweb.genesissearchengine.appManager.historyManager.historyController"
|
android:name="com.darkweb.genesissearchengine.appManager.historyManager.historyController"
|
||||||
|
@ -119,7 +120,7 @@
|
||||||
android:name="com.darkweb.genesissearchengine.appManager.homeManager.homeController"
|
android:name="com.darkweb.genesissearchengine.appManager.homeManager.homeController"
|
||||||
android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize|locale|layoutDirection|smallestScreenSize|screenLayout"
|
android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize|locale|layoutDirection|smallestScreenSize|screenLayout"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="unspecified"
|
||||||
android:windowSoftInputMode="adjustPan">
|
android:windowSoftInputMode="adjustPan">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
|
Before Width: | Height: | Size: 170 KiB |
|
@ -5,7 +5,8 @@ import com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkContro
|
||||||
import com.darkweb.genesissearchengine.appManager.historyManager.historyController;
|
import com.darkweb.genesissearchengine.appManager.historyManager.historyController;
|
||||||
import com.darkweb.genesissearchengine.appManager.homeManager.homeController;
|
import com.darkweb.genesissearchengine.appManager.homeManager.homeController;
|
||||||
import com.darkweb.genesissearchengine.appManager.orbotLogManager.orbotLogController;
|
import com.darkweb.genesissearchengine.appManager.orbotLogManager.orbotLogController;
|
||||||
import com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingController;
|
import com.darkweb.genesissearchengine.appManager.settingManager.generalManager.settingGeneralController;
|
||||||
|
import com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingHomeController;
|
||||||
import com.darkweb.genesissearchengine.appManager.tabManager.tabController;
|
import com.darkweb.genesissearchengine.appManager.tabManager.tabController;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
@ -25,7 +26,8 @@ public class activityContextManager
|
||||||
private homeController pHomeController;
|
private homeController pHomeController;
|
||||||
private tabController pTabController;
|
private tabController pTabController;
|
||||||
private android.app.Activity pCurrentActivity = null;
|
private android.app.Activity pCurrentActivity = null;
|
||||||
private settingController pSettingController;
|
private settingHomeController pSettingController;
|
||||||
|
private settingGeneralController pSettingGeneralController;
|
||||||
private orbotLogController pOrbotLogController;
|
private orbotLogController pOrbotLogController;
|
||||||
private ArrayList<AppCompatActivity> mStackList;
|
private ArrayList<AppCompatActivity> mStackList;
|
||||||
|
|
||||||
|
@ -72,10 +74,18 @@ public class activityContextManager
|
||||||
this.pOrbotLogController = pOrbotLogController;
|
this.pOrbotLogController = pOrbotLogController;
|
||||||
}
|
}
|
||||||
|
|
||||||
public settingController getSettingController(){
|
|
||||||
|
public settingGeneralController getSettingGeneralController(){
|
||||||
|
return pSettingGeneralController;
|
||||||
|
}
|
||||||
|
public void setSettingGeneralController(settingGeneralController pSettingGeneralController){
|
||||||
|
this.pSettingGeneralController = pSettingGeneralController;
|
||||||
|
}
|
||||||
|
|
||||||
|
public settingHomeController getSettingController(){
|
||||||
return pSettingController;
|
return pSettingController;
|
||||||
}
|
}
|
||||||
public void setSettingController(settingController pSettingController){
|
public void setSettingController(settingHomeController pSettingController){
|
||||||
this.pSettingController = pSettingController;
|
this.pSettingController = pSettingController;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static android.content.Context.LAYOUT_INFLATER_SERVICE;
|
import static android.content.Context.LAYOUT_INFLATER_SERVICE;
|
||||||
import static com.darkweb.genesissearchengine.constants.constants.BOOKMARK_LOAD_MORE;
|
import static com.darkweb.genesissearchengine.constants.constants.CONST_BOOKMARK_LOAD_MORE;
|
||||||
|
|
||||||
public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listViewHolder>
|
public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listViewHolder>
|
||||||
{
|
{
|
||||||
|
@ -67,14 +67,14 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
|
||||||
|
|
||||||
private void onLoading(){
|
private void onLoading(){
|
||||||
mContext.runOnUiThread(() -> {
|
mContext.runOnUiThread(() -> {
|
||||||
mCurrentList.add(new bookmarkRowModel(BOOKMARK_LOAD_MORE,null,-2));
|
mCurrentList.add(new bookmarkRowModel(CONST_BOOKMARK_LOAD_MORE,null,-2));
|
||||||
notifyItemInserted(mCurrentList.size());
|
notifyItemInserted(mCurrentList.size());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onLoadingClear(){
|
private void onLoadingClear(){
|
||||||
for(int mCounter = 0; mCounter< mCurrentList.size(); mCounter++){
|
for(int mCounter = 0; mCounter< mCurrentList.size(); mCounter++){
|
||||||
if(mCurrentList.get(mCounter).getHeader().equals(BOOKMARK_LOAD_MORE)){
|
if(mCurrentList.get(mCounter).getHeader().equals(CONST_BOOKMARK_LOAD_MORE)){
|
||||||
int finalM_counter = mCounter;
|
int finalM_counter = mCounter;
|
||||||
mContext.runOnUiThread(() -> {
|
mContext.runOnUiThread(() -> {
|
||||||
mCurrentList.remove(finalM_counter);
|
mCurrentList.remove(finalM_counter);
|
||||||
|
|
|
@ -44,6 +44,8 @@ import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import static com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkEnums.eBookmarkViewCommands.M_VERTIFY_SELECTION_MENU;
|
import static com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkEnums.eBookmarkViewCommands.M_VERTIFY_SELECTION_MENU;
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.M_CLEAR_BOOKMARK;
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.M_NOT_SUPPORTED;
|
||||||
|
|
||||||
|
|
||||||
public class bookmarkController extends AppCompatActivity
|
public class bookmarkController extends AppCompatActivity
|
||||||
|
@ -72,7 +74,7 @@ public class bookmarkController extends AppCompatActivity
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState){
|
protected void onCreate(Bundle savedInstanceState){
|
||||||
pluginController.getInstance().onCreate(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.bookmark_view);
|
setContentView(R.layout.bookmark_view);
|
||||||
initializeListModel();
|
initializeListModel();
|
||||||
|
@ -87,7 +89,6 @@ public class bookmarkController extends AppCompatActivity
|
||||||
mContextManager = activityContextManager.getInstance();
|
mContextManager = activityContextManager.getInstance();
|
||||||
mHomeController = activityContextManager.getInstance().getHomeController();
|
mHomeController = activityContextManager.getInstance().getHomeController();
|
||||||
mContextManager.setBookmarkController(this);
|
mContextManager.setBookmarkController(this);
|
||||||
pluginController.getInstance().logEvent(strings.EVENT_BOOKMARK_OPENED);
|
|
||||||
}
|
}
|
||||||
public void initializeViews(){
|
public void initializeViews(){
|
||||||
mEmptyListNotification = findViewById(R.id.pEmptyListNotification);
|
mEmptyListNotification = findViewById(R.id.pEmptyListNotification);
|
||||||
|
@ -116,7 +117,6 @@ public class bookmarkController extends AppCompatActivity
|
||||||
|
|
||||||
public void initCustomListeners(){
|
public void initCustomListeners(){
|
||||||
mClearButton.requestFocusFromTouch();
|
mClearButton.requestFocusFromTouch();
|
||||||
mClearButton.setOnClickListener(v -> pluginController.getInstance().MessageManagerHandler(activityContextManager.getInstance().getBookmarkController(), Collections.singletonList(strings.GENERIC_EMPTY_STR), enums.eMessageEnums.M_CLEAR_BOOKMARK));
|
|
||||||
|
|
||||||
mSearchInput.setOnEditorActionListener((v, actionId, event) ->{
|
mSearchInput.setOnEditorActionListener((v, actionId, event) ->{
|
||||||
if (actionId == EditorInfo.IME_ACTION_NEXT)
|
if (actionId == EditorInfo.IME_ACTION_NEXT)
|
||||||
|
@ -212,9 +212,9 @@ public class bookmarkController extends AppCompatActivity
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume()
|
||||||
{
|
{
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
activityContextManager.getInstance().setCurrentActivity(this);
|
activityContextManager.getInstance().setCurrentActivity(this);
|
||||||
status.sSettingIsAppPaused = false;
|
status.sSettingIsAppPaused = false;
|
||||||
|
|
||||||
activityContextManager.getInstance().onStack(this);
|
activityContextManager.getInstance().onStack(this);
|
||||||
super.onResume();
|
super.onResume();
|
||||||
}
|
}
|
||||||
|
@ -300,13 +300,11 @@ public class bookmarkController extends AppCompatActivity
|
||||||
{
|
{
|
||||||
if(e_type.equals(enums.etype.url_triggered)){
|
if(e_type.equals(enums.etype.url_triggered)){
|
||||||
String url_temp = helperMethod.completeURL(data.get(0).toString());
|
String url_temp = helperMethod.completeURL(data.get(0).toString());
|
||||||
pluginController.getInstance().logEvent(strings.EVENT_BOOKMARK_TRIGGERED);
|
|
||||||
mHomeController.onLoadURL(url_temp);
|
mHomeController.onLoadURL(url_temp);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
else if(e_type.equals(enums.etype.url_triggered_new_tab)){
|
else if(e_type.equals(enums.etype.url_triggered_new_tab)){
|
||||||
String url_temp = helperMethod.completeURL(data.get(0).toString());
|
String url_temp = helperMethod.completeURL(data.get(0).toString());
|
||||||
pluginController.getInstance().logEvent(strings.EVENT_BOOKMARK_TRIGGERED);
|
|
||||||
mHomeController.onOpenLinkNewTab(url_temp);
|
mHomeController.onOpenLinkNewTab(url_temp);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,8 @@ import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.M_BRIDGE_MAIL;
|
||||||
|
|
||||||
public class bridgeController extends AppCompatActivity {
|
public class bridgeController extends AppCompatActivity {
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,7 +46,7 @@ public class bridgeController extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
pluginController.getInstance().onCreate(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.bridge_settings_view);
|
setContentView(R.layout.bridge_settings_view);
|
||||||
|
|
||||||
|
@ -129,6 +131,7 @@ public class bridgeController extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume()
|
||||||
{
|
{
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
activityContextManager.getInstance().setCurrentActivity(this);
|
activityContextManager.getInstance().setCurrentActivity(this);
|
||||||
super.onResume();
|
super.onResume();
|
||||||
}
|
}
|
||||||
|
@ -152,7 +155,7 @@ public class bridgeController extends AppCompatActivity {
|
||||||
|
|
||||||
public void requestBridges(View view){
|
public void requestBridges(View view){
|
||||||
mBridgeModel.onTrigger(bridgeEnums.eBridgeModelCommands.M_REQUEST_BRIDGE, null);
|
mBridgeModel.onTrigger(bridgeEnums.eBridgeModelCommands.M_REQUEST_BRIDGE, null);
|
||||||
pluginController.getInstance().MessageManagerHandler(this, Collections.singletonList(constants.CONST_BACKEND_GOOGLE_URL), enums.eMessageEnums.M_BRIDGE_MAIL);
|
pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(constants.CONST_BACKEND_GOOGLE_URL, this), M_BRIDGE_MAIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCustomChecked(View view){
|
public void onCustomChecked(View view){
|
||||||
|
|
|
@ -11,12 +11,13 @@ import com.darkweb.genesissearchengine.dataManager.dataController;
|
||||||
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.M_BRIDGE_MAIL;
|
||||||
|
|
||||||
class bridgeModel
|
class bridgeModel
|
||||||
{
|
{
|
||||||
/*Variable Declaration*/
|
/*Variable Declaration*/
|
||||||
|
@ -34,7 +35,7 @@ class bridgeModel
|
||||||
/*Helper Methods*/
|
/*Helper Methods*/
|
||||||
|
|
||||||
public void requestBridges(){
|
public void requestBridges(){
|
||||||
pluginController.getInstance().MessageManagerHandler(mContext, Collections.singletonList(constants.CONST_BACKEND_GOOGLE_URL), enums.eMessageEnums.M_BRIDGE_MAIL);
|
pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(constants.CONST_BACKEND_GOOGLE_URL, mContext), M_BRIDGE_MAIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCustomChecked(){
|
public void onCustomChecked(){
|
||||||
|
|
|
@ -3,29 +3,27 @@ package com.darkweb.genesissearchengine.appManager.helpManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.darkweb.genesissearchengine.constants.enums;
|
import com.darkweb.genesissearchengine.constants.enums;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
|
|
||||||
public class editTextManager extends androidx.appcompat.widget.AppCompatAutoCompleteTextView {
|
public class editViewController extends androidx.appcompat.widget.AppCompatAutoCompleteTextView {
|
||||||
|
|
||||||
Context mContext;
|
Context mContext;
|
||||||
private eventObserver.eventListener mEvent = null;
|
private eventObserver.eventListener mEvent = null;
|
||||||
|
|
||||||
public editTextManager(@NonNull Context context) {
|
public editViewController(@NonNull Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
mContext = context;
|
mContext = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
public editTextManager(@NonNull Context context, @Nullable AttributeSet attrs) {
|
public editViewController(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
mContext = context;
|
mContext = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
public editTextManager(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
public editViewController(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||||
super(context, attrs, defStyleAttr);
|
super(context, attrs, defStyleAttr);
|
||||||
mContext = context;
|
mContext = context;
|
||||||
}
|
}
|
|
@ -7,14 +7,12 @@ import android.text.TextWatcher;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import androidx.recyclerview.widget.SimpleItemAnimator;
|
import androidx.recyclerview.widget.SimpleItemAnimator;
|
||||||
|
|
||||||
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
||||||
import com.darkweb.genesissearchengine.constants.constants;
|
import com.darkweb.genesissearchengine.constants.constants;
|
||||||
import com.darkweb.genesissearchengine.constants.enums;
|
import com.darkweb.genesissearchengine.constants.enums;
|
||||||
|
@ -22,6 +20,7 @@ import com.darkweb.genesissearchengine.constants.status;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -38,7 +37,7 @@ public class helpController extends AppCompatActivity {
|
||||||
private RecyclerView mRecycleView;
|
private RecyclerView mRecycleView;
|
||||||
private ConstraintLayout mRetryContainer;
|
private ConstraintLayout mRetryContainer;
|
||||||
private Button mReloadButton;
|
private Button mReloadButton;
|
||||||
private editTextManager mSearchInput;
|
private editViewController mSearchInput;
|
||||||
|
|
||||||
/*Private Variables*/
|
/*Private Variables*/
|
||||||
private Handler mSearchInvokedHandler = new Handler();
|
private Handler mSearchInvokedHandler = new Handler();
|
||||||
|
@ -46,7 +45,7 @@ public class helpController extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
pluginController.getInstance().onCreate(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.help_view);
|
setContentView(R.layout.help_view);
|
||||||
|
|
||||||
|
@ -74,7 +73,7 @@ public class helpController extends AppCompatActivity {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initializeLocalEventHandlers(){
|
private void initializeLocalEventHandlers(){
|
||||||
|
|
||||||
mRecycleView.addOnItemTouchListener(new RecyclerView.OnItemTouchListener() {
|
mRecycleView.addOnItemTouchListener(new RecyclerView.OnItemTouchListener() {
|
||||||
|
|
||||||
|
@ -105,9 +104,7 @@ public class helpController extends AppCompatActivity {
|
||||||
|
|
||||||
mSearchInput.setEventHandler(new edittextManagerCallback());
|
mSearchInput.setEventHandler(new edittextManagerCallback());
|
||||||
|
|
||||||
postToServerRunnable = () -> {
|
postToServerRunnable = () -> mHelpAdapter.onTrigger(helpEnums.eHelpAdapter.M_INIT_FILTER, Collections.singletonList(mSearchInput.getText().toString()));
|
||||||
mHelpAdapter.onTrigger(helpEnums.eHelpAdapter.M_INIT_FILTER, Collections.singletonList(mSearchInput.getText().toString()));
|
|
||||||
};
|
|
||||||
|
|
||||||
mSearchInput.addTextChangedListener(new TextWatcher() {
|
mSearchInput.addTextChangedListener(new TextWatcher() {
|
||||||
|
|
||||||
|
@ -127,35 +124,9 @@ public class helpController extends AppCompatActivity {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public class edittextManagerCallback implements eventObserver.eventListener {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object invokeObserver(List<Object> data, Object e_type) {
|
|
||||||
|
|
||||||
if(e_type.equals(enums.etype.ON_KEYBOARD_CLOSE)){
|
/*HELPER FUNCTIONS*/
|
||||||
mSearchInput.clearFocus();
|
|
||||||
//helperMethod.hideKeyboard(helpController.this);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onOpenHelp(View view) {
|
|
||||||
helperMethod.sendIssueEmail(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*LISTENERS CALLBACKS*/
|
|
||||||
|
|
||||||
private class helpViewCallback implements eventObserver.eventListener{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*CALLBACKS HELPER FUNCTIONS*/
|
|
||||||
|
|
||||||
private void onShowHelperManager(ArrayList<helpDataModel> pHelpListModel){
|
private void onShowHelperManager(ArrayList<helpDataModel> pHelpListModel){
|
||||||
mHelpAdapter = new helpAdapter(pHelpListModel, getApplicationContext());
|
mHelpAdapter = new helpAdapter(pHelpListModel, getApplicationContext());
|
||||||
|
@ -168,7 +139,34 @@ public class helpController extends AppCompatActivity {
|
||||||
mSearchInput.animate().setDuration(300).alpha(1);
|
mSearchInput.animate().setDuration(300).alpha(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*LISTENERS*/
|
/*Ediitext Callback*/
|
||||||
|
|
||||||
|
private class edittextManagerCallback implements eventObserver.eventListener {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object invokeObserver(List<Object> data, Object e_type) {
|
||||||
|
|
||||||
|
if(e_type.equals(enums.etype.ON_KEYBOARD_CLOSE)){
|
||||||
|
mSearchInput.clearFocus();
|
||||||
|
//helperMethod.hideKeyboard(helpController.this);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Helper View Callback*/
|
||||||
|
|
||||||
|
private class helpViewCallback implements eventObserver.eventListener{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*Adapter Callbacks*/
|
||||||
|
|
||||||
private class helpAdapterCallback implements eventObserver.eventListener{
|
private class helpAdapterCallback implements eventObserver.eventListener{
|
||||||
|
|
||||||
|
@ -198,14 +196,8 @@ public class helpController extends AppCompatActivity {
|
||||||
mHelpModel.onTrigger(helpEnums.eHelpModel.M_LOAD_HELP_DATA,null);
|
mHelpModel.onTrigger(helpEnums.eHelpModel.M_LOAD_HELP_DATA,null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void onOpenHelp(View view) {
|
||||||
public void onBackPressed() {
|
helperMethod.sendIssueEmail(this);
|
||||||
if(mSearchInput.hasFocus()){
|
|
||||||
mSearchInput.clearFocus();
|
|
||||||
}else {
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
super.onBackPressed();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onOpenHelpExternal(View view) {
|
public void onOpenHelpExternal(View view) {
|
||||||
|
@ -217,4 +209,23 @@ public class helpController extends AppCompatActivity {
|
||||||
activityContextManager.getInstance().onClearStack();
|
activityContextManager.getInstance().onClearStack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Local Overrides*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
|
super.onResume();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
if(mSearchInput.hasFocus()){
|
||||||
|
mSearchInput.clearFocus();
|
||||||
|
}else {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
super.onBackPressed();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,20 +5,19 @@ import com.android.volley.Request;
|
||||||
import com.android.volley.RequestQueue;
|
import com.android.volley.RequestQueue;
|
||||||
import com.android.volley.toolbox.StringRequest;
|
import com.android.volley.toolbox.StringRequest;
|
||||||
import com.android.volley.toolbox.Volley;
|
import com.android.volley.toolbox.Volley;
|
||||||
import com.darkweb.genesissearchengine.helperManager.ProxiedHurlStack;
|
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import static com.darkweb.genesissearchengine.constants.constants.*;
|
||||||
|
|
||||||
class helpModel
|
class helpModel
|
||||||
{
|
{
|
||||||
private eventObserver.eventListener mEvent;
|
private eventObserver.eventListener mEvent;
|
||||||
private String mJsonPath = "https://drive.google.com/uc?export=download&id=1es7XOAWCktGGfSnJu_o8W4_LZuudjR-T";
|
private String mJsonPath = CONST_SERVER;
|
||||||
private AppCompatActivity mContext;
|
private AppCompatActivity mContext;
|
||||||
private ArrayList<helpDataModel> mHelpListModel;
|
private ArrayList<helpDataModel> mHelpListModel;
|
||||||
|
|
||||||
|
@ -39,9 +38,9 @@ class helpModel
|
||||||
JSONObject obj = jsonArray.getJSONObject(i);
|
JSONObject obj = jsonArray.getJSONObject(i);
|
||||||
|
|
||||||
helpDataModel hero = new helpDataModel(
|
helpDataModel hero = new helpDataModel(
|
||||||
obj.getString("mHeader"),
|
obj.getString(CONST_HELP_MODEL_HEADER),
|
||||||
obj.getString("mDescription"),
|
obj.getString(CONST_HELP_MODEL_DESCRIPTION),
|
||||||
obj.getString("mIcon"));
|
obj.getString(CONST_HELP_MODEL_ICON));
|
||||||
mHelpListModel.add(hero);
|
mHelpListModel.add(hero);
|
||||||
}
|
}
|
||||||
mEvent.invokeObserver(Collections.singletonList(mHelpListModel),helpEnums.eHelpModelCallback.M_LOAD_JSON_RESPONSE_SUCCESS);
|
mEvent.invokeObserver(Collections.singletonList(mHelpListModel),helpEnums.eHelpModelCallback.M_LOAD_JSON_RESPONSE_SUCCESS);
|
||||||
|
|
|
@ -56,7 +56,7 @@ class helpViewController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onDataLoaded(){
|
private void onDataLoaded(){
|
||||||
mProgressBar.animate().cancel();
|
mProgressBar.animate().cancel();
|
||||||
mRetryContainer.animate().cancel();
|
mRetryContainer.animate().cancel();
|
||||||
mRecyclerView.animate().cancel();
|
mRecyclerView.animate().cancel();
|
||||||
|
@ -65,7 +65,7 @@ class helpViewController
|
||||||
mProgressBar.animate().setDuration(300).alpha(0);
|
mProgressBar.animate().setDuration(300).alpha(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onLoadError(){
|
private void onLoadError(){
|
||||||
mRecyclerView.animate().setDuration(300).alpha(0);
|
mRecyclerView.animate().setDuration(300).alpha(0);
|
||||||
mProgressBar.setVisibility(View.VISIBLE);
|
mProgressBar.setVisibility(View.VISIBLE);
|
||||||
mProgressBar.setAlpha(1);
|
mProgressBar.setAlpha(1);
|
||||||
|
@ -78,7 +78,7 @@ class helpViewController
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onReloadData(){
|
private void onReloadData(){
|
||||||
mRecyclerView.animate().setDuration(300).alpha(0);
|
mRecyclerView.animate().setDuration(300).alpha(0);
|
||||||
mReloadButton.setClickable(false);
|
mReloadButton.setClickable(false);
|
||||||
mRetryContainer.animate().cancel();
|
mRetryContainer.animate().cancel();
|
||||||
|
|
|
@ -28,7 +28,7 @@ import java.util.List;
|
||||||
import systems.intelligo.slight.ImageLoader;
|
import systems.intelligo.slight.ImageLoader;
|
||||||
|
|
||||||
import static android.content.Context.LAYOUT_INFLATER_SERVICE;
|
import static android.content.Context.LAYOUT_INFLATER_SERVICE;
|
||||||
import static com.darkweb.genesissearchengine.constants.constants.HISTORY_LOAD_MORE;
|
import static com.darkweb.genesissearchengine.constants.constants.CONST_HISTORY_LOAD_MORE;
|
||||||
|
|
||||||
public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listViewHolder>
|
public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listViewHolder>
|
||||||
{
|
{
|
||||||
|
@ -71,14 +71,14 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
|
||||||
|
|
||||||
private void onLoading(){
|
private void onLoading(){
|
||||||
mContext.runOnUiThread(() -> {
|
mContext.runOnUiThread(() -> {
|
||||||
mCurrentList.add(new historyRowModel(HISTORY_LOAD_MORE,null,-2));
|
mCurrentList.add(new historyRowModel(CONST_HISTORY_LOAD_MORE,null,-2));
|
||||||
notifyItemInserted(mCurrentList.size());
|
notifyItemInserted(mCurrentList.size());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onLoadingClear(){
|
private void onLoadingClear(){
|
||||||
for(int mCounter = 0; mCounter< mCurrentList.size(); mCounter++){
|
for(int mCounter = 0; mCounter< mCurrentList.size(); mCounter++){
|
||||||
if(mCurrentList.get(mCounter).getHeader().equals(HISTORY_LOAD_MORE)){
|
if(mCurrentList.get(mCounter).getHeader().equals(CONST_HISTORY_LOAD_MORE)){
|
||||||
int finalM_counter = mCounter;
|
int finalM_counter = mCounter;
|
||||||
mContext.runOnUiThread(() -> {
|
mContext.runOnUiThread(() -> {
|
||||||
mCurrentList.remove(finalM_counter);
|
mCurrentList.remove(finalM_counter);
|
||||||
|
|
|
@ -42,6 +42,7 @@ import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import static com.darkweb.genesissearchengine.appManager.historyManager.historyEnums.eHistoryViewCommands.M_VERTIFY_SELECTION_MENU;
|
import static com.darkweb.genesissearchengine.appManager.historyManager.historyEnums.eHistoryViewCommands.M_VERTIFY_SELECTION_MENU;
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.M_CLEAR_HISTORY;
|
||||||
|
|
||||||
public class historyController extends AppCompatActivity
|
public class historyController extends AppCompatActivity
|
||||||
{
|
{
|
||||||
|
@ -70,7 +71,7 @@ public class historyController extends AppCompatActivity
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState){
|
protected void onCreate(Bundle savedInstanceState){
|
||||||
pluginController.getInstance().onCreate(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.history_view);
|
setContentView(R.layout.history_view);
|
||||||
initializeListModel();
|
initializeListModel();
|
||||||
|
@ -86,7 +87,6 @@ public class historyController extends AppCompatActivity
|
||||||
mHomeController = activityContextManager.getInstance().getHomeController();
|
mHomeController = activityContextManager.getInstance().getHomeController();
|
||||||
mContextManager.setHistoryController(this);
|
mContextManager.setHistoryController(this);
|
||||||
activityContextManager.getInstance().setHistoryController(this);
|
activityContextManager.getInstance().setHistoryController(this);
|
||||||
pluginController.getInstance().logEvent(strings.EVENT_HISTORY_OPENED);
|
|
||||||
}
|
}
|
||||||
public void initializeViews(){
|
public void initializeViews(){
|
||||||
mEmptyListNotification = findViewById(R.id.pEmptyListNotification);
|
mEmptyListNotification = findViewById(R.id.pEmptyListNotification);
|
||||||
|
@ -142,7 +142,7 @@ public class historyController extends AppCompatActivity
|
||||||
|
|
||||||
mClearButton.requestFocusFromTouch();
|
mClearButton.requestFocusFromTouch();
|
||||||
mClearButton.setOnClickListener(v -> {
|
mClearButton.setOnClickListener(v -> {
|
||||||
pluginController.getInstance().MessageManagerHandler(activityContextManager.getInstance().getHistoryController(), Collections.singletonList(strings.GENERIC_EMPTY_STR), enums.eMessageEnums.M_CLEAR_HISTORY);
|
pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(strings.GENERIC_EMPTY_STR, this), M_CLEAR_HISTORY);
|
||||||
});
|
});
|
||||||
|
|
||||||
mSearchInput.setOnEditorActionListener((v, actionId, event) ->{
|
mSearchInput.setOnEditorActionListener((v, actionId, event) ->{
|
||||||
|
@ -241,6 +241,7 @@ public class historyController extends AppCompatActivity
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume()
|
||||||
{
|
{
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
activityContextManager.getInstance().setCurrentActivity(this);
|
activityContextManager.getInstance().setCurrentActivity(this);
|
||||||
status.sSettingIsAppPaused = false;
|
status.sSettingIsAppPaused = false;
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
@ -358,13 +359,11 @@ public class historyController extends AppCompatActivity
|
||||||
{
|
{
|
||||||
if(e_type.equals(enums.etype.url_triggered)){
|
if(e_type.equals(enums.etype.url_triggered)){
|
||||||
String url_temp = helperMethod.completeURL(data.get(0).toString());
|
String url_temp = helperMethod.completeURL(data.get(0).toString());
|
||||||
pluginController.getInstance().logEvent(strings.EVENT_HISTORY_TRIGGERED);
|
|
||||||
mHomeController.onLoadURL(url_temp);
|
mHomeController.onLoadURL(url_temp);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
else if(e_type.equals(enums.etype.url_triggered_new_tab)){
|
else if(e_type.equals(enums.etype.url_triggered_new_tab)){
|
||||||
String url_temp = helperMethod.completeURL(data.get(0).toString());
|
String url_temp = helperMethod.completeURL(data.get(0).toString());
|
||||||
pluginController.getInstance().logEvent(strings.EVENT_HISTORY_TRIGGERED);
|
|
||||||
mHomeController.onOpenLinkNewTab(url_temp);
|
mHomeController.onOpenLinkNewTab(url_temp);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,12 +2,15 @@ package com.darkweb.genesissearchengine.appManager.homeManager;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
import android.os.Handler;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import com.darkweb.genesissearchengine.appManager.kotlinHelperLibraries.BrowserIconManager;
|
import com.darkweb.genesissearchengine.appManager.kotlinHelperLibraries.BrowserIconManager;
|
||||||
import com.darkweb.genesissearchengine.constants.*;
|
import com.darkweb.genesissearchengine.constants.*;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
|
import com.google.android.gms.ads.AdSize;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import static com.darkweb.genesissearchengine.constants.enums.etype.on_handle_external_intent;
|
import static com.darkweb.genesissearchengine.constants.enums.etype.on_handle_external_intent;
|
||||||
|
@ -103,11 +106,11 @@ class geckoClients
|
||||||
if(mRuntime==null){
|
if(mRuntime==null){
|
||||||
mRuntime = GeckoRuntime.getDefault(context);
|
mRuntime = GeckoRuntime.getDefault(context);
|
||||||
mRuntime.getSettings().setAboutConfigEnabled(true);
|
mRuntime.getSettings().setAboutConfigEnabled(true);
|
||||||
|
mRuntime.getSettings().setAutomaticFontSizeAdjustment(false);
|
||||||
mRuntime.getSettings().setWebFontsEnabled(status.sShowWebFonts);
|
mRuntime.getSettings().setWebFontsEnabled(status.sShowWebFonts);
|
||||||
mRuntime.getSettings().setRemoteDebuggingEnabled(false);
|
mRuntime.getSettings().setForceUserScalableEnabled(status.sSettingEnableZoom);
|
||||||
mRuntime.getSettings().getContentBlocking().setCookieBehavior(getCookiesBehaviour());
|
mRuntime.getSettings().getContentBlocking().setCookieBehavior(getCookiesBehaviour());
|
||||||
mRuntime.getSettings().getContentBlocking().setSafeBrowsing(ContentBlocking.SafeBrowsing.DEFAULT);
|
mRuntime.getSettings().getContentBlocking().setSafeBrowsing(ContentBlocking.SafeBrowsing.DEFAULT);
|
||||||
mRuntime.getSettings().setAutomaticFontSizeAdjustment(status.sSettingFontAdjustable);
|
|
||||||
mIconManager = new BrowserIconManager();
|
mIconManager = new BrowserIconManager();
|
||||||
if(status.sSettingTrackingProtection){
|
if(status.sSettingTrackingProtection){
|
||||||
mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.AD);
|
mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.AD);
|
||||||
|
@ -136,10 +139,12 @@ class geckoClients
|
||||||
mRuntime.getSettings().setRemoteDebuggingEnabled(false);
|
mRuntime.getSettings().setRemoteDebuggingEnabled(false);
|
||||||
mRuntime.getSettings().setWebFontsEnabled(status.sShowWebFonts);
|
mRuntime.getSettings().setWebFontsEnabled(status.sShowWebFonts);
|
||||||
mRuntime.getSettings().getContentBlocking().setCookieBehavior(getCookiesBehaviour());
|
mRuntime.getSettings().getContentBlocking().setCookieBehavior(getCookiesBehaviour());
|
||||||
mRuntime.getSettings().setAutomaticFontSizeAdjustment(status.sSettingFontAdjustable);
|
mRuntime.getSettings().setAutomaticFontSizeAdjustment(false);
|
||||||
mRuntime.getSettings().getContentBlocking().setSafeBrowsing(ContentBlocking.SafeBrowsing.DEFAULT);
|
mRuntime.getSettings().getContentBlocking().setSafeBrowsing(ContentBlocking.SafeBrowsing.DEFAULT);
|
||||||
|
mRuntime.getSettings().setWebFontsEnabled(status.sShowWebFonts);
|
||||||
|
mRuntime.getSettings().setForceUserScalableEnabled(status.sSettingEnableZoom);
|
||||||
mIconManager = new BrowserIconManager();
|
mIconManager = new BrowserIconManager();
|
||||||
if(status.sSettingTrackingProtection){
|
if(!status.sSettingTrackingProtection){
|
||||||
mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.AD);
|
mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.AD);
|
||||||
mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.FINGERPRINTING);
|
mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.FINGERPRINTING);
|
||||||
}else {
|
}else {
|
||||||
|
@ -151,6 +156,7 @@ class geckoClients
|
||||||
mSession.getSettings().setFullAccessibilityTree(true);
|
mSession.getSettings().setFullAccessibilityTree(true);
|
||||||
mSession.getSettings().setUserAgentMode(USER_AGENT_MODE_MOBILE );
|
mSession.getSettings().setUserAgentMode(USER_AGENT_MODE_MOBILE );
|
||||||
mSession.getSettings().setAllowJavascript(status.sSettingJavaStatus);
|
mSession.getSettings().setAllowJavascript(status.sSettingJavaStatus);
|
||||||
|
onUpdateFont();
|
||||||
onReload();
|
onReload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,7 +266,8 @@ class geckoClients
|
||||||
}
|
}
|
||||||
|
|
||||||
void onReload(){
|
void onReload(){
|
||||||
mSession.reload();
|
mSession.stop();
|
||||||
|
mSession.loadUri(mSession.getCurrentURL());
|
||||||
}
|
}
|
||||||
|
|
||||||
void onReloadStatic(){
|
void onReloadStatic(){
|
||||||
|
@ -290,10 +297,7 @@ class geckoClients
|
||||||
|
|
||||||
void onUpdateFont(){
|
void onUpdateFont(){
|
||||||
float font = (status.sSettingFontSize -100)/3+100;
|
float font = (status.sSettingFontSize -100)/3+100;
|
||||||
mRuntime.getSettings().setAutomaticFontSizeAdjustment(status.sSettingFontAdjustable);
|
mRuntime.getSettings().setFontSizeFactor(font/100);
|
||||||
if(!mRuntime.getSettings().getAutomaticFontSizeAdjustment()){
|
|
||||||
mRuntime.getSettings().setFontSizeFactor(font/100);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,10 @@ import java.io.OutputStream;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.M_LONG_PRESS_URL;
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.M_LONG_PRESS_WITH_LINK;
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManagerCallbacks.M_RATE_APPLICATION;
|
||||||
import static org.mozilla.geckoview.GeckoSessionSettings.USER_AGENT_MODE_DESKTOP;
|
import static org.mozilla.geckoview.GeckoSessionSettings.USER_AGENT_MODE_DESKTOP;
|
||||||
import static org.mozilla.geckoview.GeckoSessionSettings.USER_AGENT_MODE_MOBILE;
|
import static org.mozilla.geckoview.GeckoSessionSettings.USER_AGENT_MODE_MOBILE;
|
||||||
|
|
||||||
|
@ -141,6 +145,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
||||||
if(!url.equals("about:blank") && !url.equals("about:config"))
|
if(!url.equals("about:blank") && !url.equals("about:config"))
|
||||||
{
|
{
|
||||||
mProgress = 5;
|
mProgress = 5;
|
||||||
|
Log.i("FUCKSSS","FUCKSSS : " + mProgress);
|
||||||
event.invokeObserver(Arrays.asList(5, mSessionID), enums.etype.progress_update);
|
event.invokeObserver(Arrays.asList(5, mSessionID), enums.etype.progress_update);
|
||||||
}
|
}
|
||||||
m_current_url_id = -1;
|
m_current_url_id = -1;
|
||||||
|
@ -216,6 +221,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPageStart(@NonNull GeckoSession var1, @NonNull String var2) {
|
public void onPageStart(@NonNull GeckoSession var1, @NonNull String var2) {
|
||||||
|
event.invokeObserver(Arrays.asList(5, mSessionID), enums.etype.progress_update);
|
||||||
if(mIsLoaded){
|
if(mIsLoaded){
|
||||||
if(!isPageLoading){
|
if(!isPageLoading){
|
||||||
mCurrentTitle = "loading";
|
mCurrentTitle = "loading";
|
||||||
|
@ -251,10 +257,12 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
||||||
if(progress==100){
|
if(progress==100){
|
||||||
if(!mIsProgressBarChanging){
|
if(!mIsProgressBarChanging){
|
||||||
mIsProgressBarChanging = true;
|
mIsProgressBarChanging = true;
|
||||||
|
Log.i("FUCKSSS","FUCKSSS1 : " + mProgress);
|
||||||
mContext.runOnUiThread(() -> event.invokeObserver(Arrays.asList(mProgress,mSessionID), enums.etype.progress_update));
|
mContext.runOnUiThread(() -> event.invokeObserver(Arrays.asList(mProgress,mSessionID), enums.etype.progress_update));
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
mIsProgressBarChanging = false;
|
mIsProgressBarChanging = false;
|
||||||
|
Log.i("FUCKSSS","FUCKSSS2 : " + mProgress);
|
||||||
mContext.runOnUiThread(() -> event.invokeObserver(Arrays.asList(mProgress,mSessionID), enums.etype.progress_update));
|
mContext.runOnUiThread(() -> event.invokeObserver(Arrays.asList(mProgress,mSessionID), enums.etype.progress_update));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -434,14 +442,19 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
||||||
}
|
}
|
||||||
if(var4.type!=0){
|
if(var4.type!=0){
|
||||||
if(var4.linkUri!=null){
|
if(var4.linkUri!=null){
|
||||||
event.invokeObserver(Arrays.asList(var4.linkUri,mSessionID,var4.srcUri,title, mTheme), enums.eMessageEnums.M_LONG_PRESS_WITH_LINK);
|
event.invokeObserver(Arrays.asList(var4.linkUri,mSessionID,var4.srcUri,title, mTheme, mContext), M_LONG_PRESS_WITH_LINK);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
event.invokeObserver(Arrays.asList(var4.srcUri,mSessionID,title, mTheme), enums.etype.on_long_press);
|
try{
|
||||||
|
event.invokeObserver(Arrays.asList(var4.srcUri,mSessionID,title, mTheme, mContext), enums.etype.on_long_press);
|
||||||
|
}catch (Exception ex){
|
||||||
|
ex.printStackTrace();
|
||||||
|
Log.i("","");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
event.invokeObserver(Arrays.asList(var4.linkUri,mSessionID,title, mTheme), enums.eMessageEnums.M_LONG_PRESS_URL);
|
event.invokeObserver(Arrays.asList(var4.linkUri,mSessionID,title, mTheme, mContext), M_LONG_PRESS_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -606,6 +619,9 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCurrentURL(){
|
public String getCurrentURL(){
|
||||||
|
if(mCurrentURL.equals("resource://android/assets/Homepage/homepage.html")){
|
||||||
|
mCurrentURL = "https://boogle.store";
|
||||||
|
}
|
||||||
return mCurrentURL;
|
return mCurrentURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -720,7 +736,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
||||||
|
|
||||||
private void checkApplicationRate(){
|
private void checkApplicationRate(){
|
||||||
if(rateCount==7){
|
if(rateCount==7){
|
||||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.eMessageEnums.M_RATE_APPLICATION);
|
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), M_RATE_APPLICATION);
|
||||||
}
|
}
|
||||||
rateCount+=1;
|
rateCount+=1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
@ -45,7 +44,7 @@ import com.darkweb.genesissearchengine.appManager.languageManager.languageContro
|
||||||
import com.darkweb.genesissearchengine.appManager.orbotLogManager.orbotLogController;
|
import com.darkweb.genesissearchengine.appManager.orbotLogManager.orbotLogController;
|
||||||
import com.darkweb.genesissearchengine.appManager.orbotManager.orbotController;
|
import com.darkweb.genesissearchengine.appManager.orbotManager.orbotController;
|
||||||
import com.darkweb.genesissearchengine.appManager.settingManager.searchEngineManager.settingSearchController;
|
import com.darkweb.genesissearchengine.appManager.settingManager.searchEngineManager.settingSearchController;
|
||||||
import com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingController;
|
import com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingHomeController;
|
||||||
import com.darkweb.genesissearchengine.appManager.tabManager.tabController;
|
import com.darkweb.genesissearchengine.appManager.tabManager.tabController;
|
||||||
import com.darkweb.genesissearchengine.appManager.tabManager.tabRowModel;
|
import com.darkweb.genesissearchengine.appManager.tabManager.tabRowModel;
|
||||||
import com.darkweb.genesissearchengine.constants.constants;
|
import com.darkweb.genesissearchengine.constants.constants;
|
||||||
|
@ -60,6 +59,7 @@ import com.darkweb.genesissearchengine.helperManager.SimpleGestureFilter;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
import com.darkweb.genesissearchengine.widget.progressBar.AnimatedProgressBar;
|
import com.darkweb.genesissearchengine.widget.progressBar.AnimatedProgressBar;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import com.google.android.gms.ads.AdView;
|
import com.google.android.gms.ads.AdView;
|
||||||
|
@ -78,6 +78,8 @@ import java.util.Locale;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_CHANGED;
|
import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_CHANGED;
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.*;
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManagerCallbacks.M_RATE_APPLICATION;
|
||||||
|
|
||||||
public class homeController extends AppCompatActivity implements ComponentCallbacks2
|
public class homeController extends AppCompatActivity implements ComponentCallbacks2
|
||||||
{
|
{
|
||||||
|
@ -143,7 +145,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
dataController.getInstance().initialize(this);
|
dataController.getInstance().initialize(this);
|
||||||
onChangeTheme();
|
onChangeTheme();
|
||||||
status.initStatus();
|
status.initStatus();
|
||||||
pluginController.getInstance().onCreate(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
onInitTheme();
|
onInitTheme();
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -261,18 +263,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initLocalLanguage() {
|
private void initLocalLanguage() {
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this),pluginEnums.eLangManager.M_SET_LANGUAGE);
|
||||||
String lang = Resources.getSystem().getConfiguration().locale.getLanguage();
|
|
||||||
Locale locale = new Locale(lang);
|
|
||||||
Locale.setDefault(locale);
|
|
||||||
Configuration config = new Configuration();
|
|
||||||
if (Build.VERSION.SDK_INT >= 24) {
|
|
||||||
config.setLocale(locale);
|
|
||||||
getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());
|
|
||||||
} else {
|
|
||||||
config.locale = locale;
|
|
||||||
getBaseContext().getApplicationContext().createConfigurationContext(config);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -297,6 +288,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onRedrawXML(){
|
||||||
|
setContentView(R.layout.home_view);
|
||||||
|
}
|
||||||
|
|
||||||
public void initializeAppModel()
|
public void initializeAppModel()
|
||||||
{
|
{
|
||||||
mHomeViewController = new homeViewController();
|
mHomeViewController = new homeViewController();
|
||||||
|
@ -347,6 +342,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
dataController.getInstance().initializeListData();
|
dataController.getInstance().initializeListData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onUpdateStatusBarTheme(){
|
||||||
|
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), false);
|
||||||
|
}
|
||||||
|
|
||||||
public void onUpdateToolbarTheme(){
|
public void onUpdateToolbarTheme(){
|
||||||
mHomeViewController.onUpdateToolbarTheme();
|
mHomeViewController.onUpdateToolbarTheme();
|
||||||
|
@ -416,7 +414,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
|
|
||||||
public void onLoadProxy(View view){
|
public void onLoadProxy(View view){
|
||||||
if(pluginController.getInstance().isInitialized() && !mPageClosed){
|
if(pluginController.getInstance().isInitialized() && !mPageClosed){
|
||||||
pluginController.getInstance().logEvent(strings.EVENT_GATEWAY_OPENED);
|
|
||||||
helperMethod.openActivity(orbotController.class, constants.CONST_LIST_HISTORY, homeController.this,true);
|
helperMethod.openActivity(orbotController.class, constants.CONST_LIST_HISTORY, homeController.this,true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -427,7 +424,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
mGeckoClient.updateSetting();
|
mGeckoClient.updateSetting();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onReDrawGeckoview(){
|
||||||
|
mGeckoClient.getSession().closeSession();
|
||||||
|
mGeckoClient.getSession().close();
|
||||||
|
mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,false);
|
||||||
|
}
|
||||||
|
|
||||||
public void onLoadURL(String url){
|
public void onLoadURL(String url){
|
||||||
|
mGeckoView.getSession().stop();
|
||||||
mHomeViewController.onClearSelections(true);
|
mHomeViewController.onClearSelections(true);
|
||||||
mGeckoClient.loadURL(url.replace("genesis.onion","boogle.store"));
|
mGeckoClient.loadURL(url.replace("genesis.onion","boogle.store"));
|
||||||
mAppBar.setExpanded(true,true);
|
mAppBar.setExpanded(true,true);
|
||||||
|
@ -506,12 +510,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTextChanged(CharSequence s, int start,int before, int count) {
|
public void onTextChanged(CharSequence s, int start,int before, int count) {
|
||||||
if(mFindText.getText().length()==0 && mGeckoClient!=null){
|
if(mSearchbar.isFocused()){
|
||||||
mGeckoClient.getSession().getFinder().clear();
|
if(mFindText.getText().length()==0 && mGeckoClient!=null){
|
||||||
mHomeViewController.onUpdateFindBarCount(0,0);
|
mGeckoClient.getSession().getFinder().clear();
|
||||||
}else {
|
mHomeViewController.onUpdateFindBarCount(0,0);
|
||||||
assert mGeckoClient != null;
|
}else {
|
||||||
mGeckoClient.getSession().findInPage(mFindText.getText().toString(), GeckoSession.FINDER_FIND_MATCH_CASE & GeckoSession.FINDER_DISPLAY_HIGHLIGHT_ALL);
|
assert mGeckoClient != null;
|
||||||
|
mGeckoClient.getSession().findInPage(mFindText.getText().toString(), GeckoSession.FINDER_FIND_MATCH_CASE & GeckoSession.FINDER_DISPLAY_HIGHLIGHT_ALL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -527,7 +533,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
final Handler handler = new Handler();
|
final Handler handler = new Handler();
|
||||||
handler.postDelayed(() ->
|
handler.postDelayed(() ->
|
||||||
{
|
{
|
||||||
pluginController.getInstance().logEvent(strings.EVENT_SEARCH_INVOKED);
|
|
||||||
mHomeViewController.onClearSelections(false);
|
mHomeViewController.onClearSelections(false);
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
@ -551,7 +556,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
mGeckoView.setOnFocusChangeListener((v, hasFocus) -> {
|
mGeckoView.setOnFocusChangeListener((v, hasFocus) -> {
|
||||||
if(hasFocus)
|
if(hasFocus)
|
||||||
{
|
{
|
||||||
pluginController.getInstance().onResetMessage();
|
pluginController.getInstance().onMessageManagerInvoke(null, M_RESET);
|
||||||
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,true);
|
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,true);
|
||||||
|
|
||||||
final Handler handler = new Handler();
|
final Handler handler = new Handler();
|
||||||
|
@ -648,7 +653,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
pluginController.getInstance().logEvent(strings.EVENT_APP_STARTED);
|
|
||||||
KeyboardUtils.addKeyboardToggleListener(this, isVisible -> isKeyboardOpened = isVisible);
|
KeyboardUtils.addKeyboardToggleListener(this, isVisible -> isKeyboardOpened = isVisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -658,14 +662,13 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
onUpdateSuggestionList(mSuggestions);
|
onUpdateSuggestionList(mSuggestions);
|
||||||
};
|
};
|
||||||
|
|
||||||
void onSearchBarInvoked(View view){
|
public void onSearchBarInvoked(View view){
|
||||||
String url = ((EditText)view).getText().toString();
|
String url = ((EditText)view).getText().toString();
|
||||||
String validated_url = mHomeModel.urlComplete(url, mHomeModel.getSearchEngine());
|
String validated_url = mHomeModel.urlComplete(url, mHomeModel.getSearchEngine());
|
||||||
if(validated_url!=null){
|
if(validated_url!=null){
|
||||||
url = validated_url;
|
url = validated_url;
|
||||||
}
|
}
|
||||||
mHomeViewController.onUpdateSearchBar(url,false,true);
|
mHomeViewController.onUpdateSearchBar(url,false,true);
|
||||||
Log.i("FUCLSSS","FUCLSSS2");
|
|
||||||
onLoadURL(url);
|
onLoadURL(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -691,8 +694,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onHomeButton(View view){
|
public void onHomeButton(View view){
|
||||||
pluginController.getInstance().logEvent(strings.EVENT_HOME_INVOKED);
|
|
||||||
Log.i("FUCLSSS","FUCLSSS4");
|
|
||||||
onLoadURL(helperMethod.getDomainName(mHomeModel.getSearchEngine()));
|
onLoadURL(helperMethod.getDomainName(mHomeModel.getSearchEngine()));
|
||||||
mHomeViewController.onUpdateLogo();
|
mHomeViewController.onUpdateLogo();
|
||||||
}
|
}
|
||||||
|
@ -705,11 +706,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
mGeckoClient.onRedrawPixel();
|
mGeckoClient.onRedrawPixel();
|
||||||
initializeGeckoView(true, true);
|
initializeGeckoView(true, true);
|
||||||
if(status.sOpenURLInNewTab){
|
if(status.sOpenURLInNewTab){
|
||||||
Log.i("FUCLSSS","FUCLSSS5");
|
|
||||||
onLoadURL(helperMethod.getDomainName(status.sSettingSearchStatus));
|
onLoadURL(helperMethod.getDomainName(status.sSettingSearchStatus));
|
||||||
mHomeViewController. onUpdateSearchBar(helperMethod.getDomainName(status.sSettingSearchStatus),false,true);
|
mHomeViewController. onUpdateSearchBar(helperMethod.getDomainName(status.sSettingSearchStatus),false,true);
|
||||||
}else {
|
}else {
|
||||||
Log.i("FUCLSSS","FUCLSSS6");
|
|
||||||
onLoadURL("about:blank");
|
onLoadURL("about:blank");
|
||||||
mHomeViewController. onUpdateSearchBar(strings.HOME_BLANK_PAGE,false,true);
|
mHomeViewController. onUpdateSearchBar(strings.HOME_BLANK_PAGE,false,true);
|
||||||
}
|
}
|
||||||
|
@ -727,7 +726,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onLockSecure(View view){
|
public void onLockSecure(View view){
|
||||||
pluginController.getInstance().MessageManagerHandler(homeController.this, Arrays.asList(mGeckoClient.getSession().getCurrentURL(), status.sSettingJavaStatus, status.sStatusDoNotTrack, status.sSettingTrackingProtection, status.sSettingCookieStatus), enums.eMessageEnums.M_SECURE_CONNECTION);
|
pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(mGeckoClient.getSession().getCurrentURL(), status.sSettingJavaStatus, status.sStatusDoNotTrack, status.sSettingTrackingProtection, status.sSettingCookieStatus, this), M_SECURE_CONNECTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onNotificationInvoked(String message,enums.etype e_type){
|
public void onNotificationInvoked(String message,enums.etype e_type){
|
||||||
|
@ -735,10 +734,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onOpenMenuItem(View view){
|
public void onOpenMenuItem(View view){
|
||||||
pluginController.getInstance().logEvent(strings.EVENT_MENU_INVOKED);
|
pluginController.getInstance().onMessageManagerInvoke(null, M_RESET);
|
||||||
pluginController.getInstance().onResetMessage();
|
|
||||||
initLocalLanguage();
|
initLocalLanguage();
|
||||||
pluginController.getInstance().onCreate(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
|
|
||||||
helperMethod.hideKeyboard(this);
|
helperMethod.hideKeyboard(this);
|
||||||
mHomeViewController.onOpenMenu(view,mGeckoClient.canGoBack(),!(mProgressBar.getAlpha()<=0 || mProgressBar.getVisibility() ==View.INVISIBLE),mGeckoClient.getUserAgent());
|
mHomeViewController.onOpenMenu(view,mGeckoClient.canGoBack(),!(mProgressBar.getAlpha()<=0 || mProgressBar.getVisibility() ==View.INVISIBLE),mGeckoClient.getUserAgent());
|
||||||
|
@ -751,7 +749,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed(){
|
public void onBackPressed(){
|
||||||
|
|
||||||
pluginController.getInstance().logEvent(strings.EVENT_ON_BACK);
|
|
||||||
mSearchbar.clearFocus();
|
mSearchbar.clearFocus();
|
||||||
if(mFindBar!=null && mFindBar.getVisibility() == View.VISIBLE){
|
if(mFindBar!=null && mFindBar.getVisibility() == View.VISIBLE){
|
||||||
mHomeViewController.onUpdateFindBar(false);
|
mHomeViewController.onUpdateFindBar(false);
|
||||||
|
@ -778,6 +775,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClearSession(){
|
public void onClearSession(){
|
||||||
|
onHomeButton(null);
|
||||||
mGeckoClient.onClearSession();
|
mGeckoClient.onClearSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -799,7 +797,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
super.onConfigurationChanged(newConfig);
|
super.onConfigurationChanged(newConfig);
|
||||||
|
|
||||||
|
|
||||||
pluginController.getInstance().onResetMessage();
|
pluginController.getInstance().onMessageManagerInvoke(null, M_RESET);
|
||||||
mHomeViewController.closeMenu();
|
mHomeViewController.closeMenu();
|
||||||
|
|
||||||
final Handler handler = new Handler();
|
final Handler handler = new Handler();
|
||||||
|
@ -818,7 +816,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
mHomeViewController.setOrientation(false);
|
mHomeViewController.setOrientation(false);
|
||||||
if(mGeckoClient.getFullScreenStatus())
|
if(mGeckoClient.getFullScreenStatus())
|
||||||
{
|
{
|
||||||
mHomeViewController.onSetBannerAdMargin(true,pluginController.getInstance().isAdvertLoaded());
|
mHomeViewController.onSetBannerAdMargin(true,(boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -833,14 +831,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
|
|
||||||
mGeckoClient.onExitFullScreen();
|
mGeckoClient.onExitFullScreen();
|
||||||
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), true);
|
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), true);
|
||||||
pluginController.getInstance().onResetMessage();
|
pluginController.getInstance().onMessageManagerInvoke(null, M_RESET);
|
||||||
pluginController.getInstance().onScheduleUserEngagementNotification(1296000000 /* Every 15 Days */ );
|
pluginController.getInstance().onNotificationInvoke(Collections.singletonList(1296000000) /* Every 15 Days */ , pluginEnums.eNotificationManager.M_CREATE_NOTIFICATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume()
|
||||||
{
|
{
|
||||||
pluginController.getInstance().onResume(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
activityContextManager.getInstance().setCurrentActivity(this);
|
activityContextManager.getInstance().setCurrentActivity(this);
|
||||||
if (mGeckoClient.getSession()!=null && mGeckoClient!=null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && mGeckoClient.getUriPermission()!=null) {
|
if (mGeckoClient.getSession()!=null && mGeckoClient!=null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && mGeckoClient.getUriPermission()!=null) {
|
||||||
this.revokeUriPermission(mGeckoClient.getUriPermission(), Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
this.revokeUriPermission(mGeckoClient.getUriPermission(), Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
|
@ -867,10 +865,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
}
|
}
|
||||||
if(mAppBar!=null){
|
if(mAppBar!=null){
|
||||||
mAppBar.setExpanded(true,true);
|
mAppBar.setExpanded(true,true);
|
||||||
|
|
||||||
|
mAppBar.refreshDrawableState();
|
||||||
|
mAppBar.invalidate();
|
||||||
}
|
}
|
||||||
mAppRestarted = true;
|
mAppRestarted = true;
|
||||||
pluginController.getInstance().onClearUserEngagementNotification();
|
pluginController.getInstance().onNotificationInvoke(null, pluginEnums.eNotificationManager.M_CLEAR_NOTIFICATION );
|
||||||
|
|
||||||
|
|
||||||
super.onResume();
|
super.onResume();
|
||||||
}
|
}
|
||||||
|
@ -883,15 +883,15 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data){
|
protected void onActivityResult(int requestCode, int resultCode, Intent data){
|
||||||
if(requestCode==100){
|
if(requestCode==100){
|
||||||
if(resultCode == RESULT_OK && null != data){
|
if(resultCode == RESULT_OK && null != data){
|
||||||
onSearchBarInvoked(mSearchbar);
|
mSearchbar.clearFocus();
|
||||||
ArrayList<String> result = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
|
ArrayList<String> result = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
|
||||||
mHomeViewController.onUpdateSearchBar(result.get(0),false,true);
|
mSearchbar.setText(result.get(0).toLowerCase());
|
||||||
helperMethod.hideKeyboard(homeController.this);
|
helperMethod.hideKeyboard(homeController.this);
|
||||||
mGeckoClient.setLoading(true);
|
mGeckoClient.setLoading(true);
|
||||||
|
onSearchBarInvoked(mSearchbar);
|
||||||
final Handler handler = new Handler();
|
final Handler handler = new Handler();
|
||||||
handler.postDelayed(() ->
|
handler.postDelayed(() ->
|
||||||
{
|
{
|
||||||
pluginController.getInstance().logEvent(strings.EVENT_SEARCH_INVOKED);
|
|
||||||
mGeckoView.clearFocus();
|
mGeckoView.clearFocus();
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
@ -905,20 +905,22 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSetBannerAdMargin(){
|
public void onSetBannerAdMargin(){
|
||||||
mHomeViewController.onSetBannerAdMargin(true,pluginController.getInstance().isAdvertLoaded());
|
mHomeViewController.onSetBannerAdMargin(true,(boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onVoiceClick(View view) {
|
public void onVoiceClick(View view) {
|
||||||
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
|
if(status.sSettingEnableVoiceInput){
|
||||||
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
|
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
|
||||||
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
|
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
|
||||||
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());
|
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());
|
||||||
intent.putExtra(RecognizerIntent.EXTRA_PROMPT,
|
intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Voice2Text \n Say Something!!");
|
||||||
"Voice2Text \n Say Something!!");
|
try {
|
||||||
try {
|
startActivityForResult(intent, 100);
|
||||||
startActivityForResult(intent, 100);
|
} catch (ActivityNotFoundException ignored) {
|
||||||
} catch (ActivityNotFoundException ignored) {
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
onSearchBarInvoked(mSearchbar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*-------------------------------------------------------External Callback Methods-------------------------------------------------------*/
|
/*-------------------------------------------------------External Callback Methods-------------------------------------------------------*/
|
||||||
|
@ -928,7 +930,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onStartApplication(View view){
|
public void onStartApplication(View view){
|
||||||
pluginController.getInstance().initializeOrbot();
|
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_START_ORBOT);
|
||||||
onInvokeProxyLoading();
|
onInvokeProxyLoading();
|
||||||
mHomeViewController.initHomePage();
|
mHomeViewController.initHomePage();
|
||||||
}
|
}
|
||||||
|
@ -951,7 +953,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
public void onInvokeProxyLoading(){
|
public void onInvokeProxyLoading(){
|
||||||
|
|
||||||
Callable<String> callable = () -> {
|
Callable<String> callable = () -> {
|
||||||
mHomeViewController.onUpdateLogs(pluginController.getInstance().orbotLogs());
|
String mLog = (String) pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_GET_LOGS);
|
||||||
|
mHomeViewController.onUpdateLogs(mLog);
|
||||||
return strings.GENERIC_EMPTY_STR;
|
return strings.GENERIC_EMPTY_STR;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1007,7 +1010,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClearSearchBar(View view){
|
public void onClearSearchBar(View view){
|
||||||
mHomeViewController.onUpdateSearchBar(strings.GENERIC_EMPTY_STR, false, false);
|
mHomeViewController.onUpdateSearchBar(strings.GENERIC_EMPTY_STR, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onFindNext(View view){
|
public void onFindNext(View view){
|
||||||
|
@ -1063,11 +1066,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
else if (menuId == R.id.menu6)
|
else if (menuId == R.id.menu6)
|
||||||
{
|
{
|
||||||
helperMethod.hideKeyboard(this);
|
helperMethod.hideKeyboard(this);
|
||||||
helperMethod.openActivity(settingController.class,constants.CONST_LIST_HISTORY, homeController.this,true);
|
helperMethod.openActivity(settingHomeController.class,constants.CONST_LIST_HISTORY, homeController.this,true);
|
||||||
}
|
}
|
||||||
else if (menuId == R.id.pMenuDelete)
|
else if (menuId == R.id.pMenuDelete)
|
||||||
{
|
{
|
||||||
pluginController.getInstance().MessageManagerHandler(homeController.this, Collections.singletonList(mGeckoClient.getSession().getCurrentURL()), enums.eMessageEnums.M_BOOKMARK);
|
pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(this, mGeckoClient.getSession().getCurrentURL()), M_BOOKMARK);
|
||||||
}
|
}
|
||||||
else if (menuId == R.id.pMenuOpenNewTab)
|
else if (menuId == R.id.pMenuOpenNewTab)
|
||||||
{
|
{
|
||||||
|
@ -1077,7 +1080,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
else if (menuId == R.id.pMenuOpenCurrentTab)
|
else if (menuId == R.id.pMenuOpenCurrentTab)
|
||||||
{
|
{
|
||||||
helperMethod.hideKeyboard(this);
|
helperMethod.hideKeyboard(this);
|
||||||
pluginController.getInstance().MessageManagerHandler(homeController.this,null,enums.eMessageEnums.M_REPORT_URL);
|
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(this), M_REPORT_URL);
|
||||||
}
|
}
|
||||||
else if (menuId == R.id.pMenuQuit)
|
else if (menuId == R.id.pMenuQuit)
|
||||||
{
|
{
|
||||||
|
@ -1102,7 +1105,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
}
|
}
|
||||||
if (menuId == R.id.menu23) {
|
if (menuId == R.id.menu23) {
|
||||||
helperMethod.hideKeyboard(this);
|
helperMethod.hideKeyboard(this);
|
||||||
pluginController.getInstance().MessageManagerHandler(homeController.this, Collections.singletonList(mGeckoClient.getSession().getCurrentURL()),enums.eMessageEnums.M_BOOKMARK);
|
pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(mGeckoClient.getSession().getCurrentURL(), this), M_BOOKMARK);
|
||||||
}
|
}
|
||||||
if (menuId == R.id.menu24) {
|
if (menuId == R.id.menu24) {
|
||||||
helperMethod.hideKeyboard(this);
|
helperMethod.hideKeyboard(this);
|
||||||
|
@ -1121,6 +1124,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
mHomeViewController.closeMenu();
|
mHomeViewController.closeMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onReInitTheme(){
|
||||||
|
}
|
||||||
|
|
||||||
public void onOrbotLog(View view) {
|
public void onOrbotLog(View view) {
|
||||||
mHomeViewController.closeMenu();
|
mHomeViewController.closeMenu();
|
||||||
helperMethod.openActivity(orbotLogController.class, constants.CONST_LIST_HISTORY, homeController.this,true);
|
helperMethod.openActivity(orbotLogController.class, constants.CONST_LIST_HISTORY, homeController.this,true);
|
||||||
|
@ -1152,7 +1158,17 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
}
|
}
|
||||||
else if(e_type.equals(enums.etype.on_init_ads))
|
else if(e_type.equals(enums.etype.on_init_ads))
|
||||||
{
|
{
|
||||||
mHomeViewController.onSetBannerAdMargin((boolean)data.get(0),pluginController.getInstance().isAdvertLoaded());
|
mHomeViewController.onSetBannerAdMargin((boolean)data.get(0),(boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
|
||||||
|
}
|
||||||
|
else if(e_type.equals(enums.etype.M_WELCOME_MESSAGE)){
|
||||||
|
if(status.sSettingIsWelcomeEnabled){
|
||||||
|
final Handler handler = new Handler();
|
||||||
|
Runnable runnable = () ->
|
||||||
|
{
|
||||||
|
pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(strings.GENERIC_EMPTY_STR, homeController.this), M_WELCOME);
|
||||||
|
};
|
||||||
|
handler.postDelayed(runnable, 1300);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(e_type.equals(enums.etype.on_url_load)){
|
else if(e_type.equals(enums.etype.on_url_load)){
|
||||||
if(status.sSettingIsAppRedirected){
|
if(status.sSettingIsAppRedirected){
|
||||||
|
@ -1182,13 +1198,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
}
|
}
|
||||||
else if(status.sSettingIsAppStarted){
|
else if(status.sSettingIsAppStarted){
|
||||||
mHomeViewController.onPageFinished();
|
mHomeViewController.onPageFinished();
|
||||||
onOpenLinkNewTab(helperMethod.getDomainName(mHomeModel.getSearchEngine()));
|
mHomeViewController.onProgressBarUpdate(5);
|
||||||
|
onLoadTabOnResume();
|
||||||
|
//onOpenLinkNewTab(helperMethod.getDomainName(mHomeModel.getSearchEngine()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(e_type.equals(enums.etype.recheck_orbot)){
|
|
||||||
pluginController.getInstance().isOrbotRunning();
|
|
||||||
}
|
|
||||||
else if(e_type.equals(enums.etype.M_HOME_PAGE)){
|
else if(e_type.equals(enums.etype.M_HOME_PAGE)){
|
||||||
geckoSession mSession = (geckoSession)dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_HOME_PAGE, null);
|
geckoSession mSession = (geckoSession)dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_HOME_PAGE, null);
|
||||||
if(mSession!=null){
|
if(mSession!=null){
|
||||||
|
@ -1292,7 +1307,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(),false);
|
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(),false);
|
||||||
}
|
}
|
||||||
else if(e_type.equals(enums.etype.start_proxy)){
|
else if(e_type.equals(enums.etype.start_proxy)){
|
||||||
pluginController.getInstance().setProxy(dataToStr(data.get(0)));
|
pluginController.getInstance().onOrbotInvoke(data, pluginEnums.eOrbotManager.M_SET_PROXY);
|
||||||
}
|
}
|
||||||
else if(e_type.equals(enums.etype.on_update_history)){
|
else if(e_type.equals(enums.etype.on_update_history)){
|
||||||
if(activityContextManager.getInstance().getTabController()!=null && !activityContextManager.getInstance().getTabController().isDestroyed() && !activityContextManager.getInstance().getTabController().isFinishing()){
|
if(activityContextManager.getInstance().getTabController()!=null && !activityContextManager.getInstance().getTabController().isDestroyed() && !activityContextManager.getInstance().getTabController().isFinishing()){
|
||||||
|
@ -1304,33 +1319,22 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
dataController.getInstance().invokeSuggestion(dataEnums.eSuggestionCommands.M_ADD_SUGGESTION, Arrays.asList(data.get(0).toString(),data.get(2).toString()));
|
dataController.getInstance().invokeSuggestion(dataEnums.eSuggestionCommands.M_ADD_SUGGESTION, Arrays.asList(data.get(0).toString(),data.get(2).toString()));
|
||||||
}
|
}
|
||||||
else if(e_type.equals(enums.etype.on_page_loaded)){
|
else if(e_type.equals(enums.etype.on_page_loaded)){
|
||||||
pluginController.getInstance().logEvent(strings.EVENT_PAGE_OPENED_SUCCESS);
|
|
||||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_IS_BOOTSTRAPPED,true));
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_IS_BOOTSTRAPPED,true));
|
||||||
mHomeViewController.onPageFinished();
|
mHomeViewController.onPageFinished();
|
||||||
if(status.sSettingIsWelcomeEnabled && !status.sSettingIsAppStarted){
|
|
||||||
final Handler handler = new Handler();
|
final Handler handler = new Handler();
|
||||||
Runnable runnable = () ->
|
Runnable runnable = () -> pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_INITIALIZE_BANNER_ADS);
|
||||||
{
|
handler.postDelayed(runnable, 2000);
|
||||||
if(!status.sSettingIsAppStarted){
|
|
||||||
pluginController.getInstance().MessageManagerHandler(activityContextManager.getInstance().getHomeController(), Collections.singletonList(strings.GENERIC_EMPTY_STR), enums.eMessageEnums.M_WELCOME);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
handler.postDelayed(runnable, 1300);
|
|
||||||
}else {
|
|
||||||
final Handler handler = new Handler();
|
|
||||||
Runnable runnable = () -> pluginController.getInstance().initializeBannerAds();
|
|
||||||
handler.postDelayed(runnable, 2000);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if(e_type.equals(enums.eMessageEnums.M_RATE_APPLICATION)){
|
else if(e_type.equals(M_RATE_APPLICATION)){
|
||||||
if(!status.sSettingIsAppRated){
|
if(!status.sSettingIsAppRated){
|
||||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.PROXY_IS_APP_RATED,true));
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.PROXY_IS_APP_RATED,true));
|
||||||
status.sSettingIsAppRated = true;
|
status.sSettingIsAppRated = true;
|
||||||
pluginController.getInstance().MessageManagerHandler(activityContextManager.getInstance().getHomeController(), Collections.singletonList(strings.GENERIC_EMPTY_STR), enums.eMessageEnums.M_RATE_APP);
|
pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(strings.GENERIC_EMPTY_STR, homeController.this), M_RATE_APP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(e_type.equals(enums.etype.on_load_error)){
|
else if(e_type.equals(enums.etype.on_load_error)){
|
||||||
pluginController.getInstance().setLanguage();
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(homeController.this), pluginEnums.eLangManager.M_SET_LANGUAGE);
|
||||||
initLocalLanguage();
|
initLocalLanguage();
|
||||||
mHomeViewController.onPageFinished();
|
mHomeViewController.onPageFinished();
|
||||||
mHomeViewController.onUpdateSearchBar(dataToStr(data.get(0),mGeckoClient.getSession().getCurrentURL()),false,true);
|
mHomeViewController.onUpdateSearchBar(dataToStr(data.get(0),mGeckoClient.getSession().getCurrentURL()),false,true);
|
||||||
|
@ -1339,7 +1343,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
mHomeViewController.onUpdateSearchBar(dataToStr(data.get(0),mGeckoClient.getSession().getCurrentURL()),false, true);
|
mHomeViewController.onUpdateSearchBar(dataToStr(data.get(0),mGeckoClient.getSession().getCurrentURL()),false, true);
|
||||||
}
|
}
|
||||||
else if(e_type.equals(enums.etype.download_file_popup)){
|
else if(e_type.equals(enums.etype.download_file_popup)){
|
||||||
pluginController.getInstance().MessageManagerHandler(homeController.this,Collections.singletonList(dataToStr(data.get(0))),enums.eMessageEnums.M_DOWNLOAD_FILE);
|
pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(dataToStr(data.get(0)), homeController.this), M_DOWNLOAD_FILE);
|
||||||
}
|
}
|
||||||
else if(e_type.equals(enums.etype.on_full_screen)){
|
else if(e_type.equals(enums.etype.on_full_screen)){
|
||||||
boolean status = (Boolean)data.get(0);
|
boolean status = (Boolean)data.get(0);
|
||||||
|
@ -1349,15 +1353,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
else if(e_type.equals(enums.etype.on_update_favicon)){
|
else if(e_type.equals(enums.etype.on_update_favicon)){
|
||||||
dataController.getInstance().invokeImage(dataEnums.eImageCommands.M_REQUEST_IMAGE_URL,Collections.singletonList((String)data.get(0)));
|
dataController.getInstance().invokeImage(dataEnums.eImageCommands.M_REQUEST_IMAGE_URL,Collections.singletonList((String)data.get(0)));
|
||||||
}
|
}
|
||||||
else if(e_type.equals(enums.eMessageEnums.M_LONG_PRESS_WITH_LINK)){
|
else if(e_type.equals(M_LONG_PRESS_WITH_LINK)){
|
||||||
pluginController.getInstance().MessageManagerHandler(homeController.this, Arrays.asList(dataToStr(data.get(0)),dataToStr(data.get(2)),dataToStr(data.get(3))),enums.eMessageEnums.M_LONG_PRESS_WITH_LINK);
|
pluginController.getInstance().onMessageManagerInvoke(data, M_LONG_PRESS_WITH_LINK);
|
||||||
}
|
}
|
||||||
else if(e_type.equals(enums.etype.on_long_press)){
|
else if(e_type.equals(enums.etype.on_long_press)){
|
||||||
pluginController.getInstance().MessageManagerHandler(homeController.this,Arrays.asList(dataToStr(data.get(0)),dataToStr(data.get(2))),enums.eMessageEnums.M_LONG_PRESS_DOWNLOAD);
|
pluginController.getInstance().onMessageManagerInvoke(data, M_LONG_PRESS_DOWNLOAD);
|
||||||
pluginController.getInstance().MessageManagerHandler(homeController.this,Arrays.asList(dataToStr(data.get(0)),dataToStr(data.get(2))),enums.eMessageEnums.M_LONG_PRESS_DOWNLOAD);
|
|
||||||
}
|
}
|
||||||
else if(e_type.equals(enums.eMessageEnums.M_LONG_PRESS_URL)){
|
else if(e_type.equals(M_LONG_PRESS_URL)){
|
||||||
pluginController.getInstance().MessageManagerHandler(homeController.this,Arrays.asList(dataToStr(data.get(0)),dataToStr(data.get(2))),enums.eMessageEnums.M_LONG_PRESS_URL);
|
pluginController.getInstance().onMessageManagerInvoke(data, M_LONG_PRESS_URL);
|
||||||
}
|
}
|
||||||
else if(e_type.equals(enums.etype.open_new_tab)){
|
else if(e_type.equals(enums.etype.open_new_tab)){
|
||||||
onOpenLinkNewTab(dataToStr(data.get(0)));
|
onOpenLinkNewTab(dataToStr(data.get(0)));
|
||||||
|
|
|
@ -34,7 +34,8 @@ class homeModel
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
return pSearchEngine.replace("$s",pURL.replaceAll(" ","+"));
|
String mURL = pSearchEngine.replace("$s",pURL.replaceAll(" ","+"));
|
||||||
|
return mURL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,6 +124,7 @@ class homeViewController
|
||||||
this.mAppBar = pAppBar;
|
this.mAppBar = pAppBar;
|
||||||
this.mOrbotLogManager = pOrbotLogManager;
|
this.mOrbotLogManager = pOrbotLogManager;
|
||||||
|
|
||||||
|
initializeViews();
|
||||||
initSplashScreen();
|
initSplashScreen();
|
||||||
initializeSuggestionView(suggestions);
|
initializeSuggestionView(suggestions);
|
||||||
createUpdateUiHandler();
|
createUpdateUiHandler();
|
||||||
|
@ -131,6 +132,10 @@ class homeViewController
|
||||||
initTopBarPadding();
|
initTopBarPadding();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void initializeViews(){
|
||||||
|
mContext.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_USER);
|
||||||
|
}
|
||||||
|
|
||||||
public void initTopBarPadding(){
|
public void initTopBarPadding(){
|
||||||
if(!status.sFullScreenBrowsing){
|
if(!status.sFullScreenBrowsing){
|
||||||
int paddingDp = 60;
|
int paddingDp = 60;
|
||||||
|
@ -200,6 +205,8 @@ class homeViewController
|
||||||
mContext.getWindow().setStatusBarColor(ContextCompat.getColor(mContext, R.color.landing_ease_blue));
|
mContext.getWindow().setStatusBarColor(ContextCompat.getColor(mContext, R.color.landing_ease_blue));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//mContext.getWindow().getDecorView().setSystemUiVisibility(status.sTheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initStatusBarColor(boolean mInstant) {
|
public void initStatusBarColor(boolean mInstant) {
|
||||||
|
@ -316,6 +323,7 @@ class homeViewController
|
||||||
}
|
}
|
||||||
if(!status.sSettingIsAppStarted){
|
if(!status.sSettingIsAppStarted){
|
||||||
startPostTask(messages.MESSAGE_ON_URL_LOAD);
|
startPostTask(messages.MESSAGE_ON_URL_LOAD);
|
||||||
|
mContext.runOnUiThread(() -> splashScreenDisable());
|
||||||
}else {
|
}else {
|
||||||
mContext.runOnUiThread(() -> mEvent.invokeObserver(null, enums.etype.ON_LOAD_TAB_ON_RESUME));
|
mContext.runOnUiThread(() -> mEvent.invokeObserver(null, enums.etype.ON_LOAD_TAB_ON_RESUME));
|
||||||
}
|
}
|
||||||
|
@ -332,13 +340,18 @@ class homeViewController
|
||||||
mSplashScreen.bringToFront();
|
mSplashScreen.bringToFront();
|
||||||
splashScreenDisable();
|
splashScreenDisable();
|
||||||
}
|
}
|
||||||
private void splashScreenDisable(){
|
public void splashScreenDisable(){
|
||||||
mTopBar.setAlpha(1);
|
mTopBar.setAlpha(1);
|
||||||
|
|
||||||
if(mSplashScreen.getAlpha()==1){
|
if(mSplashScreen.getAlpha()==1){
|
||||||
triggerPostUI();
|
triggerPostUI();
|
||||||
mProgressBar.setVisibility(View.GONE);
|
mProgressBar.setVisibility(View.GONE);
|
||||||
mSplashScreen.animate().setStartDelay(0).alpha(0);
|
mSplashScreen.animate().setStartDelay(0).alpha(0).withEndAction(() -> {
|
||||||
|
mSplashScreen.setClickable(false);
|
||||||
|
mSplashScreen.setFocusable(false);
|
||||||
|
mSearchbar.setEnabled(true);
|
||||||
|
});
|
||||||
|
mEvent.invokeObserver(null, enums.etype.M_WELCOME_MESSAGE);
|
||||||
mOrbotLogManager.setClickable(false);
|
mOrbotLogManager.setClickable(false);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
initStatusBarColor(false);
|
initStatusBarColor(false);
|
||||||
|
@ -352,7 +365,6 @@ class homeViewController
|
||||||
}
|
}
|
||||||
|
|
||||||
private void triggerPostUI(){
|
private void triggerPostUI(){
|
||||||
onUpdateToolbarTheme();
|
|
||||||
mAppBar.setExpanded(true,true);
|
mAppBar.setExpanded(true,true);
|
||||||
if(mProgressBar.getProgress()>0 && mProgressBar.getProgress()<10000){
|
if(mProgressBar.getProgress()>0 && mProgressBar.getProgress()<10000){
|
||||||
mProgressBar.animate().setStartDelay(0).alpha(1);
|
mProgressBar.animate().setStartDelay(0).alpha(1);
|
||||||
|
@ -487,20 +499,22 @@ class homeViewController
|
||||||
private Handler searchBarUpdateHandler = new Handler();
|
private Handler searchBarUpdateHandler = new Handler();
|
||||||
private String handlerLocalUrl = "";
|
private String handlerLocalUrl = "";
|
||||||
void onUpdateSearchBar(String url,boolean showProtocol, boolean pClearText){
|
void onUpdateSearchBar(String url,boolean showProtocol, boolean pClearText){
|
||||||
int delay = 0;
|
if(!mSearchbar.hasFocus() || pClearText){
|
||||||
handlerLocalUrl = url;
|
int delay = 0;
|
||||||
|
handlerLocalUrl = url;
|
||||||
|
|
||||||
if(searchBarUpdateHandler.hasMessages(100)){
|
if(searchBarUpdateHandler.hasMessages(100)){
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
searchBarUpdateHandler.sendEmptyMessage(100);
|
||||||
|
searchBarUpdateHandler.postDelayed(() ->
|
||||||
|
{
|
||||||
|
searchBarUpdateHandler.removeMessages(100);
|
||||||
|
triggerUpdateSearchBar(handlerLocalUrl,showProtocol, pClearText);
|
||||||
|
|
||||||
|
}, delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
searchBarUpdateHandler.sendEmptyMessage(100);
|
|
||||||
searchBarUpdateHandler.postDelayed(() ->
|
|
||||||
{
|
|
||||||
searchBarUpdateHandler.removeMessages(100);
|
|
||||||
triggerUpdateSearchBar(handlerLocalUrl,showProtocol, pClearText);
|
|
||||||
|
|
||||||
}, delay);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUpdateFindBarCount(int index, int total)
|
public void onUpdateFindBarCount(int index, int total)
|
||||||
|
@ -705,10 +719,10 @@ class homeViewController
|
||||||
}
|
}
|
||||||
|
|
||||||
void onProgressBarUpdate(int value){
|
void onProgressBarUpdate(int value){
|
||||||
if(mProgressBar.getVisibility()==View.GONE){
|
mProgressBar.setVisibility(View.VISIBLE);
|
||||||
mProgressBar.setVisibility(View.VISIBLE);
|
mProgressBar.animate().cancel();
|
||||||
}
|
|
||||||
else if(value != mProgressBar.getProgress()){
|
if(value != mProgressBar.getProgress()){
|
||||||
if(value<=5 && value>0){
|
if(value<=5 && value>0){
|
||||||
mProgressBar.setProgress(5);
|
mProgressBar.setProgress(5);
|
||||||
}else {
|
}else {
|
||||||
|
|
|
@ -13,10 +13,12 @@ import com.darkweb.genesissearchengine.constants.status;
|
||||||
import com.darkweb.genesissearchengine.dataManager.dataController;
|
import com.darkweb.genesissearchengine.dataManager.dataController;
|
||||||
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import com.github.paolorotolo.appintro.AppIntro;
|
import com.github.paolorotolo.appintro.AppIntro;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
public class landingController extends AppIntro {
|
public class landingController extends AppIntro {
|
||||||
|
|
||||||
|
@ -24,7 +26,6 @@ public class landingController extends AppIntro {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
pluginController.getInstance().onCreate(this);
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
// Instead of fragments, you can also use our default slide
|
// Instead of fragments, you can also use our default slide
|
||||||
|
@ -65,6 +66,8 @@ public class landingController extends AppIntro {
|
||||||
mLauncherViewController = new landingViewController(this,null);
|
mLauncherViewController = new landingViewController(this,null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDonePressed(Fragment currentFragment) {
|
public void onDonePressed(Fragment currentFragment) {
|
||||||
super.onDonePressed(currentFragment);
|
super.onDonePressed(currentFragment);
|
||||||
|
@ -73,4 +76,9 @@ public class landingController extends AppIntro {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
|
super.onResume();
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,151 @@
|
||||||
|
package com.darkweb.genesissearchengine.appManager.languageManager;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
|
import com.example.myapplication.R;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import static com.darkweb.genesissearchengine.appManager.languageManager.languageEnums.eLanguageAdapterCallback.*;
|
||||||
|
import static com.darkweb.genesissearchengine.constants.constants.CONST_LANGUAGE_DEFAULT_LANG;
|
||||||
|
import static com.darkweb.genesissearchengine.constants.strings.LANGUAGE_NOT_SUPPORTED;
|
||||||
|
|
||||||
|
public class languageAdapter extends RecyclerView.Adapter<languageAdapter.helpViewHolder>{
|
||||||
|
|
||||||
|
/*Private Variables*/
|
||||||
|
|
||||||
|
private ArrayList<languageDataModel> mModelList;
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
/*Private Local Variables*/
|
||||||
|
|
||||||
|
private String mCurrentLanguage;
|
||||||
|
private eventObserver.eventListener mEvent;
|
||||||
|
private int mCurrentIndex = 0;
|
||||||
|
private boolean mClickable = false;
|
||||||
|
|
||||||
|
public languageAdapter(ArrayList<languageDataModel> pModelList, Context pContext, String pCurrentLanguage, eventObserver.eventListener pEvent) {
|
||||||
|
this.mModelList = pModelList;
|
||||||
|
this.mContext = pContext;
|
||||||
|
this.mEvent = pEvent;
|
||||||
|
this.mCurrentLanguage = pCurrentLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public helpViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.lang_row_view, parent, false);
|
||||||
|
return new helpViewHolder(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull helpViewHolder holder, int position) {
|
||||||
|
holder.bindListView(mModelList.get(position));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return mModelList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
class helpViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||||
|
TextView mHeader;
|
||||||
|
TextView mDescription;
|
||||||
|
LinearLayout mContainer;
|
||||||
|
ImageView mMarker;
|
||||||
|
|
||||||
|
helpViewHolder(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bindListView(languageDataModel model) {
|
||||||
|
boolean mIsDefaultSupported = true;
|
||||||
|
mHeader = itemView.findViewById(R.id.pHeader);
|
||||||
|
mDescription = itemView.findViewById(R.id.pDescription);
|
||||||
|
mContainer = itemView.findViewById(R.id.pContainer);
|
||||||
|
mMarker = itemView.findViewById(R.id.pMarker);
|
||||||
|
|
||||||
|
mHeader.setText(model.getHeader());
|
||||||
|
mContainer.setTag(R.id.LaguageID,model.getTag());
|
||||||
|
mContainer.setTag(R.id.LaguageRegion,model.getCountry());
|
||||||
|
|
||||||
|
if(model.getTag().equals(CONST_LANGUAGE_DEFAULT_LANG) && status.sSettingLanguage.equals(CONST_LANGUAGE_DEFAULT_LANG)){
|
||||||
|
mDescription.setText((String)mEvent.invokeObserver(null, M_SYSTEM_LANGUAGE_SUPPORT_INFO));
|
||||||
|
if(mDescription.getText().toString().endsWith(LANGUAGE_NOT_SUPPORTED)){
|
||||||
|
mIsDefaultSupported = false;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
mDescription.setText(model.getDescription());
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mContainer.getTag(R.id.LaguageID).toString().equals(mCurrentLanguage)){
|
||||||
|
Drawable mDrawable;
|
||||||
|
Resources res = mContext.getResources();
|
||||||
|
try {
|
||||||
|
mDrawable = Drawable.createFromXml(res, res.getXml(R.xml.gx_border_left));
|
||||||
|
mContainer.setBackground(mDrawable);
|
||||||
|
mHeader.setTextColor(ContextCompat.getColor(mContext, R.color.white));
|
||||||
|
mDescription.setTextColor(ContextCompat.getColor(mContext, R.color.white_darker));
|
||||||
|
mMarker.setVisibility(View.VISIBLE);
|
||||||
|
mCurrentIndex = getLayoutPosition();
|
||||||
|
if(!mIsDefaultSupported){
|
||||||
|
mDrawable = Drawable.createFromXml(res, res.getXml(R.xml.ic_baseline_cross));
|
||||||
|
mMarker.setImageDrawable(mDrawable);
|
||||||
|
}else {
|
||||||
|
mDrawable = Drawable.createFromXml(res, res.getXml(R.xml.ic_baseline_done));
|
||||||
|
mMarker.setImageDrawable(mDrawable);
|
||||||
|
}
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
Drawable mDrawable;
|
||||||
|
Resources res = mContext.getResources();
|
||||||
|
try {
|
||||||
|
mDrawable = Drawable.createFromXml(res, res.getXml(R.xml.gx_ripple_gray));
|
||||||
|
mContainer.setBackground(mDrawable);
|
||||||
|
mHeader.setTextColor(ContextCompat.getColor(mContext, R.color.c_text_v1));
|
||||||
|
mDescription.setTextColor(ContextCompat.getColor(mContext, R.color.c_text_v6));
|
||||||
|
mMarker.setVisibility(View.GONE);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mContainer.setOnClickListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if(v.getId() == R.id.pContainer){
|
||||||
|
boolean mSupportedStatus = (boolean)mEvent.invokeObserver(Arrays.asList(v.getTag(R.id.LaguageID).toString(), v.getTag(R.id.LaguageRegion).toString()),M_UPDATE_LANGUAGE);
|
||||||
|
if(mCurrentIndex!=getLayoutPosition() && mSupportedStatus){
|
||||||
|
if(!mClickable){
|
||||||
|
mClickable = true;
|
||||||
|
mEvent.invokeObserver(null,M_ENABLE_VIEW_CLICK);
|
||||||
|
// notifyItemChanged(mCurrentIndex);
|
||||||
|
mCurrentLanguage = v.getTag(R.id.LaguageID).toString();
|
||||||
|
mCurrentIndex = getLayoutPosition();
|
||||||
|
// notifyItemChanged(mCurrentIndex);
|
||||||
|
|
||||||
|
final Handler handler = new Handler();
|
||||||
|
handler.postDelayed(() -> {
|
||||||
|
mClickable = false;
|
||||||
|
mEvent.invokeObserver(null,M_DISABLE_VIEW_CLICK);
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,9 +1,12 @@
|
||||||
package com.darkweb.genesissearchengine.appManager.languageManager;
|
package com.darkweb.genesissearchengine.appManager.languageManager;
|
||||||
|
|
||||||
|
import android.content.res.Resources;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
||||||
import com.darkweb.genesissearchengine.appManager.helpManager.helpController;
|
import com.darkweb.genesissearchengine.appManager.helpManager.helpController;
|
||||||
import com.darkweb.genesissearchengine.constants.constants;
|
import com.darkweb.genesissearchengine.constants.constants;
|
||||||
|
@ -14,65 +17,171 @@ import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import static com.darkweb.genesissearchengine.appManager.languageManager.languageEnums.eLanguageModel.M_ACTIVE_LANGUAGE;
|
||||||
|
import static com.darkweb.genesissearchengine.constants.constants.CONST_LANGUAGE_DEFAULT_LANG;
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eLangManager.M_SUPPORTED_SYSTEM_LANGUAGE_INFO;
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.M_LANGUAGE_SUPPORT_FAILURE;
|
||||||
|
|
||||||
@SuppressWarnings("FieldCanBeLocal")
|
|
||||||
public class languageController extends AppCompatActivity {
|
public class languageController extends AppCompatActivity {
|
||||||
|
|
||||||
/*Initializations*/
|
/*Private Variables*/
|
||||||
|
|
||||||
private languageViewController mLanguageViewController;
|
private languageViewController mLanguageViewController;
|
||||||
private languageModel mLanguageModel;
|
private languageModel mLanguageModel;
|
||||||
|
private ImageView mBlocker;
|
||||||
|
|
||||||
|
private RecyclerView mRecycleView;
|
||||||
|
private languageAdapter mLanguageAdapter;
|
||||||
|
|
||||||
|
/*Initializations*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
pluginController.getInstance().onCreate(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.language_view);
|
setContentView(R.layout.language_view);
|
||||||
|
|
||||||
initializeAppModel();
|
initializeAppModel();
|
||||||
initializeConnections();
|
initializeConnections();
|
||||||
|
initializeAdapter();
|
||||||
|
onInitScroll();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initializeAppModel()
|
private void initializeAppModel()
|
||||||
{
|
{
|
||||||
mLanguageViewController = new languageViewController();
|
mLanguageViewController = new languageViewController();
|
||||||
mLanguageModel = new languageModel();
|
mLanguageModel = new languageModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initializeConnections()
|
private void initializeConnections()
|
||||||
{
|
{
|
||||||
activityContextManager.getInstance().onStack(this);
|
activityContextManager.getInstance().onStack(this);
|
||||||
mLanguageViewController.initialization(new languageViewCallback(),this);
|
mRecycleView = findViewById(R.id.pRecycleView);
|
||||||
|
mBlocker = findViewById(R.id.pBlocker);
|
||||||
|
|
||||||
|
mLanguageViewController.initialization(new languageViewCallback(),this, mBlocker);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initializeAdapter(){
|
||||||
|
mLanguageAdapter = new languageAdapter((ArrayList<languageDataModel>)mLanguageModel.onTrigger(languageEnums.eLanguageModel.M_SUPPORTED_LANGUAGE,null), this, status.sSettingLanguage, new languageAdapterCallback());
|
||||||
|
mRecycleView.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
|
||||||
|
mRecycleView.setAdapter(mLanguageAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onInitScroll(){
|
||||||
|
int mPosition = (int)mLanguageModel.onTrigger(M_ACTIVE_LANGUAGE,null);
|
||||||
|
if(!getIntent().getExtras().containsKey("activity_restarted")){
|
||||||
|
if(mPosition>0){
|
||||||
|
mPosition -= 1;
|
||||||
|
}
|
||||||
|
mRecycleView.scrollToPosition(mPosition);
|
||||||
|
}else {
|
||||||
|
int mPositionOffset = getIntent().getExtras().getInt("activity_restarted");
|
||||||
|
Objects.requireNonNull(mRecycleView.getLayoutManager()).scrollToPosition(mPositionOffset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*UI Redirections*/
|
||||||
|
|
||||||
public void onOpenInfo(View view) {
|
public void onOpenInfo(View view) {
|
||||||
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class languageViewCallback implements eventObserver.eventListener{
|
public void onClose(View view) {
|
||||||
|
activityContextManager.getInstance().onRemoveStack(this);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Helper Methods*/
|
||||||
|
|
||||||
|
private boolean changeLanguage(String pLanguageCode, String pLanguageRegion){
|
||||||
|
boolean mDefaultLanguageNotSupported = false;
|
||||||
|
if(pLanguageCode.equals(CONST_LANGUAGE_DEFAULT_LANG)){
|
||||||
|
Locale mSystemLocale = Resources.getSystem().getConfiguration().locale;
|
||||||
|
String mSystemLangugage = mSystemLocale.toString();
|
||||||
|
status.sSettingLanguage = CONST_LANGUAGE_DEFAULT_LANG;
|
||||||
|
status.sSettingLanguageRegion = CONST_LANGUAGE_DEFAULT_LANG;
|
||||||
|
if(!mSystemLangugage.equals("en_US") && !mSystemLangugage.equals("de_DE") && !mSystemLangugage.equals("ca_ES") && !mSystemLangugage.equals("zh_CN") && !mSystemLangugage.equals("ch_CZ") && !mSystemLangugage.equals("nl_NL") && !mSystemLangugage.equals("fr_FR") && !mSystemLangugage.equals("el_GR") && !mSystemLangugage.equals("hu_HU") && !mSystemLangugage.equals("in_ID") && !mSystemLangugage.equals("it_IT") && !mSystemLangugage.equals("ja_JP") && !mSystemLangugage.equals("ko_KR") && !mSystemLangugage.equals("pt_PT") && !mSystemLangugage.equals("ro_RO") && !mSystemLangugage.equals("ru_RU") && !mSystemLangugage.equals("th_TH") && !mSystemLangugage.equals("tr_TR") && !mSystemLangugage.equals("uk_UA") && !mSystemLangugage.equals("vi_VN")){
|
||||||
|
mDefaultLanguageNotSupported = true;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
status.sSettingLanguage = pLanguageCode;
|
||||||
|
status.sSettingLanguageRegion = pLanguageRegion;
|
||||||
|
}
|
||||||
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.SETTING_LANGUAGE,status.sSettingLanguage));
|
||||||
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.SETTING_LANGUAGE_REGION,status.sSettingLanguageRegion));
|
||||||
|
finish();
|
||||||
|
|
||||||
|
getIntent().putExtra("activity_restarted",((LinearLayoutManager) Objects.requireNonNull(mRecycleView.getLayoutManager())).findFirstCompletelyVisibleItemPosition());
|
||||||
|
helperMethod.restartActivity(getIntent(), this);
|
||||||
|
overridePendingTransition(R.anim.fade_in_lang, R.anim.fade_out_lang);
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_SET_LANGUAGE);
|
||||||
|
|
||||||
|
if(activityContextManager.getInstance().getSettingController()!=null && !activityContextManager.getInstance().getSettingController().isDestroyed()){
|
||||||
|
activityContextManager.getInstance().getSettingController().onRedrawXML();
|
||||||
|
}
|
||||||
|
if(activityContextManager.getInstance().getSettingGeneralController()!=null && !activityContextManager.getInstance().getSettingGeneralController().isDestroyed()){
|
||||||
|
activityContextManager.getInstance().getSettingGeneralController().onLanguageChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mDefaultLanguageNotSupported){
|
||||||
|
pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(Resources.getSystem().getConfiguration().locale.getDisplayName(), this),M_LANGUAGE_SUPPORT_FAILURE);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*View Callbacks*/
|
||||||
|
|
||||||
|
private class languageViewCallback implements eventObserver.eventListener{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
{
|
{
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void changeLanguage(Locale language){
|
/*Adapter Callbacks*/
|
||||||
status.sSettingLanguage = language.getLanguage();
|
|
||||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.SETTING_LANGUAGE,language.getLanguage()));
|
private class languageAdapterCallback implements eventObserver.eventListener {
|
||||||
pluginController.getInstance().setLanguage();
|
|
||||||
|
@Override
|
||||||
|
public Object invokeObserver(List<Object> data, Object e_type) {
|
||||||
|
if(e_type.equals(languageEnums.eLanguageAdapterCallback.M_UPDATE_LANGUAGE)){
|
||||||
|
return changeLanguage((String)data.get(0), (String)data.get(1));
|
||||||
|
}
|
||||||
|
else if(e_type.equals(languageEnums.eLanguageAdapterCallback.M_DISABLE_VIEW_CLICK)){
|
||||||
|
mLanguageViewController.onTrigger(languageEnums.eLanguagevViewController.M_UPDATE_BLOCKER, Collections.singletonList(false));
|
||||||
|
}
|
||||||
|
else if(e_type.equals(languageEnums.eLanguageAdapterCallback.M_ENABLE_VIEW_CLICK)){
|
||||||
|
mLanguageViewController.onTrigger(languageEnums.eLanguagevViewController.M_UPDATE_BLOCKER, Collections.singletonList(true));
|
||||||
|
}
|
||||||
|
else if(e_type.equals(languageEnums.eLanguageAdapterCallback.M_SYSTEM_LANGUAGE_SUPPORT_INFO)){
|
||||||
|
return pluginController.getInstance().onLanguageInvoke(null, M_SUPPORTED_SYSTEM_LANGUAGE_INFO);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-------------------------------------------------------CALLBACKS-------------------------------------------------------*/
|
/*Override Methods*/
|
||||||
|
|
||||||
public void onClose(View view) {
|
@Override
|
||||||
activityContextManager.getInstance().onRemoveStack(this);
|
protected void onResume() {
|
||||||
finish();
|
if(mLanguageAdapter!=null){
|
||||||
|
mLanguageAdapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
|
super.onResume();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -80,41 +189,4 @@ public class languageController extends AppCompatActivity {
|
||||||
onClose(null);
|
onClose(null);
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onStop() {
|
|
||||||
super.onStop();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onMenuItemInvoked(View view) {
|
|
||||||
int menuId = view.getId();
|
|
||||||
if (menuId == R.id.langEnglish) {
|
|
||||||
changeLanguage(Locale.ENGLISH);
|
|
||||||
}
|
|
||||||
else if (menuId == R.id.pLangGerman) {
|
|
||||||
changeLanguage(new Locale("de"));
|
|
||||||
}
|
|
||||||
else if (menuId == R.id.pLangItalian) {
|
|
||||||
changeLanguage(new Locale("it"));
|
|
||||||
}
|
|
||||||
else if (menuId == R.id.pLangPorteguse) {
|
|
||||||
changeLanguage(new Locale("pt"));
|
|
||||||
}
|
|
||||||
else if (menuId == R.id.pLangRussian) {
|
|
||||||
changeLanguage(new Locale("ru"));
|
|
||||||
}
|
|
||||||
else if (menuId == R.id.pLangUkarian) {
|
|
||||||
changeLanguage(new Locale("uk"));
|
|
||||||
}
|
|
||||||
else if (menuId == R.id.pLangChinese) {
|
|
||||||
changeLanguage(new Locale("zh"));
|
|
||||||
}
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.darkweb.genesissearchengine.appManager.languageManager;
|
||||||
|
|
||||||
|
public class languageDataModel {
|
||||||
|
|
||||||
|
private String mHeader;
|
||||||
|
private String mDescription;
|
||||||
|
private String mTag;
|
||||||
|
private String mCountry;
|
||||||
|
|
||||||
|
protected languageDataModel(String pHeader, String pDescription, String pTag, String pCountry) {
|
||||||
|
this.mHeader = pHeader;
|
||||||
|
this.mDescription = pDescription;
|
||||||
|
this.mTag = pTag;
|
||||||
|
this.mCountry = pCountry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHeader() {
|
||||||
|
return mHeader;
|
||||||
|
}
|
||||||
|
public String getDescription() {
|
||||||
|
return mDescription;
|
||||||
|
}
|
||||||
|
public String getTag() {
|
||||||
|
return mTag;
|
||||||
|
}
|
||||||
|
public String getCountry() {
|
||||||
|
return mCountry;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.darkweb.genesissearchengine.appManager.languageManager;
|
||||||
|
|
||||||
|
class languageEnums
|
||||||
|
{
|
||||||
|
/*History Manager*/
|
||||||
|
public enum eLanguageModel {
|
||||||
|
M_SUPPORTED_LANGUAGE, M_ACTIVE_LANGUAGE
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum eLanguagevViewController {
|
||||||
|
M_UPDATE_BLOCKER
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum eLanguageAdapterCallback {
|
||||||
|
M_UPDATE_LANGUAGE, M_DISABLE_VIEW_CLICK, M_ENABLE_VIEW_CLICK, M_SYSTEM_LANGUAGE_SUPPORT_INFO
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,59 @@
|
||||||
package com.darkweb.genesissearchengine.appManager.languageManager;
|
package com.darkweb.genesissearchengine.appManager.languageManager;
|
||||||
|
|
||||||
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
class languageModel
|
class languageModel
|
||||||
{
|
{
|
||||||
|
private ArrayList<languageDataModel> mSupportedLanaguage;
|
||||||
|
|
||||||
|
public languageModel(){
|
||||||
|
mSupportedLanaguage = new ArrayList<>();
|
||||||
|
onInitLanguage();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onInitLanguage(){
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("Follow Device Language","Default Language", "default","default"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("English (United States)","United States", "en","Us"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("Deutsche","German", "de","De"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("Català","Catalan", "ca","Es"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("中文(中国)","Chinese (China)", "zh","Cn"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("čeština","Czech", "ch","Cz"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("Dutch (Netherland)","Dutch (Netherland)", "nl","Nl"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("France (francaise)","French (France)", "fr","Fr"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("Ελληνικά","Greek", "el","Gr"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("Magyar","Hungarian", "hu","Hu"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("bahasa Indonesia","Indonesian", "in","Id"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("Italiana","Italian", "it","It"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("日本人","Japanese", "ja","Jp"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("韓国語","Korean", "ko","Kr"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("Português","Portuguese (Portugal)", "pt","Pt"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("Română","Romanian", "ro","Ro"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("русский","Russian", "ru","Ru"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("ไทย","Thai", "th","Th"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("Türk","Turkish", "tr","Tr"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("Український","Ukrainian", "uk","Ua"));
|
||||||
|
mSupportedLanaguage.add(new languageDataModel("Tiếng Việt","Vietnamese", "vi","Vn"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getActiveLanguageIndex(){
|
||||||
|
for(int mCounter=0;mCounter<mSupportedLanaguage.size();mCounter++){
|
||||||
|
if(mSupportedLanaguage.get(mCounter).getTag().equals(status.sSettingLanguage)){
|
||||||
|
return mCounter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object onTrigger(languageEnums.eLanguageModel pCommands, List<Object> pData){
|
||||||
|
if(pCommands.equals(languageEnums.eLanguageModel.M_SUPPORTED_LANGUAGE)){
|
||||||
|
return mSupportedLanaguage;
|
||||||
|
}
|
||||||
|
else if(pCommands.equals(languageEnums.eLanguageModel.M_ACTIVE_LANGUAGE)){
|
||||||
|
return getActiveLanguageIndex();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,20 +4,32 @@ import android.os.Build;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.ImageView;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.app.AppCompatDelegate;
|
import androidx.appcompat.app.AppCompatDelegate;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
class languageViewController
|
class languageViewController
|
||||||
{
|
{
|
||||||
/*ViewControllers*/
|
/*Private Variables*/
|
||||||
|
|
||||||
private AppCompatActivity mContext;
|
private AppCompatActivity mContext;
|
||||||
private eventObserver.eventListener mEvent;
|
private eventObserver.eventListener mEvent;
|
||||||
|
private ImageView mBlocker;
|
||||||
|
|
||||||
void initialization(eventObserver.eventListener event, AppCompatActivity context){
|
/*Initializations*/
|
||||||
|
|
||||||
|
protected void initialization(eventObserver.eventListener pEvent, AppCompatActivity context, ImageView pBlocker){
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
|
this.mBlocker = pBlocker;
|
||||||
|
this.mEvent = pEvent;
|
||||||
|
|
||||||
initPostUI();
|
initPostUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,4 +49,20 @@ class languageViewController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initBlocker(boolean pStatus){
|
||||||
|
if(pStatus){
|
||||||
|
mBlocker.setVisibility(View.VISIBLE);
|
||||||
|
}else {
|
||||||
|
mBlocker.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object onTrigger(languageEnums.eLanguagevViewController pCommands, List<Object> pData){
|
||||||
|
if(languageEnums.eLanguagevViewController.M_UPDATE_BLOCKER.equals(pCommands)){
|
||||||
|
initBlocker((boolean)pData.get(0));
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,8 @@ import com.darkweb.genesissearchengine.constants.status;
|
||||||
import com.darkweb.genesissearchengine.helperManager.SimpleGestureFilter;
|
import com.darkweb.genesissearchengine.helperManager.SimpleGestureFilter;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
import org.torproject.android.service.wrapper.orbotLocalConstants;
|
import org.torproject.android.service.wrapper.orbotLocalConstants;
|
||||||
|
@ -46,6 +48,7 @@ public class orbotLogController extends AppCompatActivity {
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
overridePendingTransition(R.anim.push_anim_out_reverse, R.anim.push_anim_in_reverse);
|
overridePendingTransition(R.anim.push_anim_out_reverse, R.anim.push_anim_in_reverse);
|
||||||
|
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.orbot_log_view);
|
setContentView(R.layout.orbot_log_view);
|
||||||
|
|
||||||
|
@ -198,6 +201,7 @@ public class orbotLogController extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume()
|
||||||
{
|
{
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
activityContextManager.getInstance().setCurrentActivity(this);
|
activityContextManager.getInstance().setCurrentActivity(this);
|
||||||
super.onResume();
|
super.onResume();
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ class orbotLogModel
|
||||||
Collections.reverse(mModelList);
|
Collections.reverse(mModelList);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mModelList.add(0, new logRowModel(constants.LOGS_DEFAULT_MESSAGE, helperMethod.getCurrentTime()));
|
mModelList.add(0, new logRowModel(constants.CONST_LOGS_DEFAULT_MESSAGE, helperMethod.getCurrentTime()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ import com.darkweb.genesissearchengine.helperManager.SimpleGestureFilter;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -41,7 +42,7 @@ public class orbotController extends AppCompatActivity {
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
overridePendingTransition(R.anim.push_anim_in, R.anim.push_anim_out);
|
overridePendingTransition(R.anim.push_anim_in, R.anim.push_anim_out);
|
||||||
|
|
||||||
pluginController.getInstance().onCreate(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.orbot_settings_view);
|
setContentView(R.layout.orbot_settings_view);
|
||||||
|
|
||||||
|
@ -113,6 +114,7 @@ public class orbotController extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume()
|
||||||
{
|
{
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
activityContextManager.getInstance().setCurrentActivity(this);
|
activityContextManager.getInstance().setCurrentActivity(this);
|
||||||
mOrbotViewController.onTrigger(orbotEnums.eOrbotViewCommands.M_INIT_POST_UI,null);
|
mOrbotViewController.onTrigger(orbotEnums.eOrbotViewCommands.M_INIT_POST_UI,null);
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,9 @@ package com.darkweb.genesissearchengine.appManager.orbotManager;
|
||||||
import com.darkweb.genesissearchengine.constants.status;
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
class orbotModel
|
class orbotModel
|
||||||
|
@ -21,12 +24,12 @@ class orbotModel
|
||||||
|
|
||||||
public void onBridgeSwitch(boolean pStatus){
|
public void onBridgeSwitch(boolean pStatus){
|
||||||
status.sBridgeStatus = pStatus;
|
status.sBridgeStatus = pStatus;
|
||||||
pluginController.getInstance().updateBridges(status.sBridgeStatus);
|
pluginController.getInstance().onOrbotInvoke(Collections.singletonList(status.sBridgeStatus), pluginEnums.eOrbotManager.M_UPDATE_BRIDGES);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onVPNSwitch(boolean pStatus){
|
public void onVPNSwitch(boolean pStatus){
|
||||||
status.sBridgeVPNStatus = pStatus;
|
status.sBridgeVPNStatus = pStatus;
|
||||||
pluginController.getInstance().updateVPN(status.sBridgeVPNStatus);
|
pluginController.getInstance().onOrbotInvoke(Collections.singletonList(status.sBridgeStatus), pluginEnums.eOrbotManager.M_UPDATE_VPN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,12 @@ import com.darkweb.genesissearchengine.constants.status;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class proxyStatusController extends AppCompatActivity {
|
public class proxyStatusController extends AppCompatActivity {
|
||||||
|
@ -35,7 +37,7 @@ public class proxyStatusController extends AppCompatActivity {
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
overridePendingTransition(R.anim.push_anim_in, R.anim.push_anim_out);
|
overridePendingTransition(R.anim.push_anim_in, R.anim.push_anim_out);
|
||||||
|
|
||||||
pluginController.getInstance().onCreate(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.proxy_status_view);
|
setContentView(R.layout.proxy_status_view);
|
||||||
|
|
||||||
|
@ -49,7 +51,7 @@ public class proxyStatusController extends AppCompatActivity {
|
||||||
|
|
||||||
activityContextManager.getInstance().onStack(this);
|
activityContextManager.getInstance().onStack(this);
|
||||||
mProxyStatusViewController = new proxyStatusViewController(this, mOrbotStatus, mVpnStatus, mBridgeStatus);
|
mProxyStatusViewController = new proxyStatusViewController(this, mOrbotStatus, mVpnStatus, mBridgeStatus);
|
||||||
mProxyStatusViewController.onTrigger(proxyStatusEnums.eProxyStatusViewCommands.M_INIT_VIEWS, Arrays.asList(pluginController.getInstance().getOrbotStatus(), status.sBridgeVPNStatus,status.sBridgeStatus));
|
mProxyStatusViewController.onTrigger(proxyStatusEnums.eProxyStatusViewCommands.M_INIT_VIEWS, Arrays.asList(pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_GET_ORBOT_STATUS), status.sBridgeVPNStatus,status.sBridgeStatus));
|
||||||
mProxyStatusModel = new proxyStatusModel(new proxyStatusModelCallback());
|
mProxyStatusModel = new proxyStatusModel(new proxyStatusModelCallback());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,6 +59,10 @@ public class proxyStatusController extends AppCompatActivity {
|
||||||
helperMethod.openActivity(orbotLogController.class, constants.CONST_LIST_HISTORY, this,true);
|
helperMethod.openActivity(orbotLogController.class, constants.CONST_LIST_HISTORY, this,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void refreshOrbotStatus(View view) {
|
||||||
|
mProxyStatusViewController.onTrigger(proxyStatusEnums.eProxyStatusViewCommands.M_INIT_VIEWS, Arrays.asList(pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_GET_ORBOT_STATUS), status.sBridgeVPNStatus,status.sBridgeStatus));
|
||||||
|
}
|
||||||
|
|
||||||
/* LISTENERS */
|
/* LISTENERS */
|
||||||
|
|
||||||
public class proxyStatusModelCallback implements eventObserver.eventListener{
|
public class proxyStatusModelCallback implements eventObserver.eventListener{
|
||||||
|
@ -78,6 +84,7 @@ public class proxyStatusController extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume()
|
||||||
{
|
{
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
super.onResume();
|
super.onResume();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -24,6 +25,7 @@ import java.util.List;
|
||||||
public class settingAccessibilityController extends AppCompatActivity {
|
public class settingAccessibilityController extends AppCompatActivity {
|
||||||
|
|
||||||
/* PRIVATE VARIABLES */
|
/* PRIVATE VARIABLES */
|
||||||
|
|
||||||
private settingAccessibilityModel mSettingAccessibilityModel;
|
private settingAccessibilityModel mSettingAccessibilityModel;
|
||||||
private settingAccessibilityViewController mSettingAccessibilityViewController;
|
private settingAccessibilityViewController mSettingAccessibilityViewController;
|
||||||
private SwitchMaterial mZoom;
|
private SwitchMaterial mZoom;
|
||||||
|
@ -32,17 +34,25 @@ public class settingAccessibilityController extends AppCompatActivity {
|
||||||
private TextView mSeekBarSample;
|
private TextView mSeekBarSample;
|
||||||
private TextView mScalePercentage;
|
private TextView mScalePercentage;
|
||||||
|
|
||||||
|
/* PRIVATE LOCAL VARIABLES */
|
||||||
|
|
||||||
|
private boolean mIsSettingChanged = false;
|
||||||
|
private float mDefaultFontSize = status.sSettingFontSize;
|
||||||
|
|
||||||
|
/* Initializations */
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
pluginController.getInstance().onCreate(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
setContentView(R.layout.setting_accessibility_view);
|
setContentView(R.layout.setting_accessibility_view);
|
||||||
|
|
||||||
viewsInitializations();
|
viewsInitializations();
|
||||||
initializeListeners();
|
initializeListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void viewsInitializations() {
|
private void viewsInitializations() {
|
||||||
mZoom = findViewById(R.id.pZoom);
|
mZoom = findViewById(R.id.pZoom);
|
||||||
mVoiceInput = findViewById(R.id.pVoiceInput);
|
mVoiceInput = findViewById(R.id.pVoiceInput);
|
||||||
mSeekBar = findViewById(R.id.pSeekBar);
|
mSeekBar = findViewById(R.id.pSeekBar);
|
||||||
|
@ -54,27 +64,7 @@ public class settingAccessibilityController extends AppCompatActivity {
|
||||||
mSettingAccessibilityModel = new settingAccessibilityModel(new settingAccessibilityController.settingAccessibilityModelCallback());
|
mSettingAccessibilityModel = new settingAccessibilityModel(new settingAccessibilityController.settingAccessibilityModelCallback());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LISTENERS */
|
private void initializeListeners(){
|
||||||
public class settingAccessibilityViewCallback implements eventObserver.eventListener{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class settingAccessibilityModelCallback implements eventObserver.eventListener{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void initializeListeners(){
|
|
||||||
mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -87,6 +77,7 @@ public class settingAccessibilityController extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onProgressChanged(SeekBar seekBar, int progress,boolean fromUser) {
|
public void onProgressChanged(SeekBar seekBar, int progress,boolean fromUser) {
|
||||||
|
mIsSettingChanged = true;
|
||||||
int percentage = ((progress+5)*10);
|
int percentage = ((progress+5)*10);
|
||||||
mSettingAccessibilityViewController.onTrigger(settingAccessibilityEnums.eAccessibilityModel.M_UPDATE_SAMPLE_TEXT, Collections.singletonList((int)((12.0*percentage)/100)));
|
mSettingAccessibilityViewController.onTrigger(settingAccessibilityEnums.eAccessibilityModel.M_UPDATE_SAMPLE_TEXT, Collections.singletonList((int)((12.0*percentage)/100)));
|
||||||
mSettingAccessibilityViewController.onTrigger(settingAccessibilityEnums.eAccessibilityModel.M_UPDATE_PERCENTAGE, Collections.singletonList((percentage+ constants.CONST_PERCENTAGE_SIGN)));
|
mSettingAccessibilityViewController.onTrigger(settingAccessibilityEnums.eAccessibilityModel.M_UPDATE_PERCENTAGE, Collections.singletonList((percentage+ constants.CONST_PERCENTAGE_SIGN)));
|
||||||
|
@ -98,11 +89,34 @@ public class settingAccessibilityController extends AppCompatActivity {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*View Callbacks*/
|
||||||
|
|
||||||
|
private class settingAccessibilityViewCallback implements eventObserver.eventListener{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Model Callbacks*/
|
||||||
|
|
||||||
|
private class settingAccessibilityModelCallback implements eventObserver.eventListener{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* LOCAL OVERRIDES */
|
/* LOCAL OVERRIDES */
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume()
|
||||||
{
|
{
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
activityContextManager.getInstance().setCurrentActivity(this);
|
activityContextManager.getInstance().setCurrentActivity(this);
|
||||||
super.onResume();
|
super.onResume();
|
||||||
}
|
}
|
||||||
|
@ -118,7 +132,6 @@ public class settingAccessibilityController extends AppCompatActivity {
|
||||||
onClose(null);
|
onClose(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*UI Redirection*/
|
/*UI Redirection*/
|
||||||
|
|
||||||
public void onOpenInfo(View view) {
|
public void onOpenInfo(View view) {
|
||||||
|
@ -128,6 +141,10 @@ public class settingAccessibilityController extends AppCompatActivity {
|
||||||
public void onClose(View view){
|
public void onClose(View view){
|
||||||
activityContextManager.getInstance().onRemoveStack(this);
|
activityContextManager.getInstance().onRemoveStack(this);
|
||||||
finish();
|
finish();
|
||||||
|
|
||||||
|
if(mIsSettingChanged && mDefaultFontSize!=status.sSettingFontSize){
|
||||||
|
activityContextManager.getInstance().getHomeController().initRuntimeSettings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onZoomSettingUpdate(View view){
|
public void onZoomSettingUpdate(View view){
|
||||||
|
|
|
@ -14,6 +14,7 @@ import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -23,7 +24,8 @@ import java.util.List;
|
||||||
|
|
||||||
public class settingAdvanceController extends AppCompatActivity {
|
public class settingAdvanceController extends AppCompatActivity {
|
||||||
|
|
||||||
/* PRIVATE VARIABLES */
|
/* Private Variables */
|
||||||
|
|
||||||
private settingAdvanceModel mSettingAdvanceModel;
|
private settingAdvanceModel mSettingAdvanceModel;
|
||||||
private settingAdvanceViewController mSettingAdvanceViewController;
|
private settingAdvanceViewController mSettingAdvanceViewController;
|
||||||
private SwitchMaterial mRestoreTabs;
|
private SwitchMaterial mRestoreTabs;
|
||||||
|
@ -32,10 +34,13 @@ public class settingAdvanceController extends AppCompatActivity {
|
||||||
private ArrayList<RadioButton> mImageOption = new ArrayList<>();
|
private ArrayList<RadioButton> mImageOption = new ArrayList<>();
|
||||||
private boolean mIsChanged = false;
|
private boolean mIsChanged = false;
|
||||||
|
|
||||||
|
/* Initializations */
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
pluginController.getInstance().onCreate(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
setContentView(R.layout.setting_advance_view);
|
setContentView(R.layout.setting_advance_view);
|
||||||
|
|
||||||
viewsInitializations();
|
viewsInitializations();
|
||||||
|
@ -57,7 +62,8 @@ public class settingAdvanceController extends AppCompatActivity {
|
||||||
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LISTENERS */
|
/*View Callbacks*/
|
||||||
|
|
||||||
public class settingAdvanceViewCallback implements eventObserver.eventListener{
|
public class settingAdvanceViewCallback implements eventObserver.eventListener{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -67,6 +73,7 @@ public class settingAdvanceController extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Model Callbacks*/
|
||||||
|
|
||||||
public class settingAdvanceModelCallback implements eventObserver.eventListener{
|
public class settingAdvanceModelCallback implements eventObserver.eventListener{
|
||||||
|
|
||||||
|
@ -82,14 +89,15 @@ public class settingAdvanceController extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume()
|
||||||
{
|
{
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
activityContextManager.getInstance().setCurrentActivity(this);
|
activityContextManager.getInstance().setCurrentActivity(this);
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
int notificationStatus = pluginController.getInstance().getNotificationStatus();
|
int notificationStatus = (int)pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_GET_NOTIFICATION_STATUS);
|
||||||
if(notificationStatus==0){
|
if(notificationStatus==0){
|
||||||
pluginController.getInstance().disableTorNotification();
|
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION);
|
||||||
} else if(notificationStatus==1){
|
} else if(notificationStatus==1){
|
||||||
pluginController.getInstance().enableTorNotification();
|
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_ENABLE_NOTIFICATION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +110,7 @@ public class settingAdvanceController extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
if(mIsChanged){
|
if(mIsChanged){
|
||||||
pluginController.getInstance().updatePrivacy();
|
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_UPDATE_PRIVACY);
|
||||||
activityContextManager.getInstance().getHomeController().initRuntimeSettings();
|
activityContextManager.getInstance().getHomeController().initRuntimeSettings();
|
||||||
}
|
}
|
||||||
activityContextManager.getInstance().onRemoveStack(this);
|
activityContextManager.getInstance().onRemoveStack(this);
|
||||||
|
@ -113,7 +121,7 @@ public class settingAdvanceController extends AppCompatActivity {
|
||||||
|
|
||||||
public void onClose(View view){
|
public void onClose(View view){
|
||||||
if(mIsChanged){
|
if(mIsChanged){
|
||||||
pluginController.getInstance().updatePrivacy();
|
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_UPDATE_PRIVACY);
|
||||||
activityContextManager.getInstance().getHomeController().initRuntimeSettings();
|
activityContextManager.getInstance().getHomeController().initRuntimeSettings();
|
||||||
}
|
}
|
||||||
finish();
|
finish();
|
||||||
|
@ -144,6 +152,6 @@ public class settingAdvanceController extends AppCompatActivity {
|
||||||
mSettingAdvanceModel.onTrigger(settingAdvanceEnums.eAdvanceModel.M_TOOLBAR_THEME, Collections.singletonList(!mToolbarTheme.isChecked()));
|
mSettingAdvanceModel.onTrigger(settingAdvanceEnums.eAdvanceModel.M_TOOLBAR_THEME, Collections.singletonList(!mToolbarTheme.isChecked()));
|
||||||
mToolbarTheme.toggle();
|
mToolbarTheme.toggle();
|
||||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_TOOLBAR_THEME,status.sToolbarTheme));
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_TOOLBAR_THEME,status.sToolbarTheme));
|
||||||
activityContextManager.getInstance().getHomeController().onUpdateToolbarTheme();
|
activityContextManager.getInstance().getHomeController().onUpdateStatusBarTheme();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,6 +2,8 @@ package com.darkweb.genesissearchengine.appManager.settingManager.clearManager;
|
||||||
|
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Debug;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
@ -11,21 +13,28 @@ import com.darkweb.genesissearchengine.appManager.databaseManager.databaseContro
|
||||||
import com.darkweb.genesissearchengine.appManager.helpManager.helpController;
|
import com.darkweb.genesissearchengine.appManager.helpManager.helpController;
|
||||||
import com.darkweb.genesissearchengine.constants.constants;
|
import com.darkweb.genesissearchengine.constants.constants;
|
||||||
import com.darkweb.genesissearchengine.constants.enums;
|
import com.darkweb.genesissearchengine.constants.enums;
|
||||||
|
import com.darkweb.genesissearchengine.constants.keys;
|
||||||
import com.darkweb.genesissearchengine.constants.sql;
|
import com.darkweb.genesissearchengine.constants.sql;
|
||||||
import com.darkweb.genesissearchengine.constants.status;
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
|
import com.darkweb.genesissearchengine.constants.strings;
|
||||||
import com.darkweb.genesissearchengine.dataManager.dataController;
|
import com.darkweb.genesissearchengine.dataManager.dataController;
|
||||||
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.M_DATA_CLEARED;
|
||||||
|
import static org.mozilla.geckoview.ContentBlocking.CookieBehavior.ACCEPT_FIRST_PARTY;
|
||||||
|
|
||||||
public class settingClearController extends AppCompatActivity {
|
public class settingClearController extends AppCompatActivity {
|
||||||
|
|
||||||
/* PRIVATE VARIABLES */
|
/* PRIVATE VARIABLES */
|
||||||
|
|
||||||
private settingClearModel mSettingClearModel;
|
private settingClearModel mSettingClearModel;
|
||||||
private settingClearViewController mSettingClearViewController;
|
private settingClearViewController mSettingClearViewController;
|
||||||
private ArrayList<CheckBox> mCheckBoxList = new ArrayList<>();
|
private ArrayList<CheckBox> mCheckBoxList = new ArrayList<>();
|
||||||
|
@ -35,9 +44,9 @@ public class settingClearController extends AppCompatActivity {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.setting_clear_view);
|
setContentView(R.layout.setting_clear_view);
|
||||||
|
|
||||||
pluginController.getInstance().onCreate(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
|
|
||||||
viewsInitializations();
|
viewsInitializations();
|
||||||
initializeListeners();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void viewsInitializations() {
|
public void viewsInitializations() {
|
||||||
|
@ -55,12 +64,9 @@ public class settingClearController extends AppCompatActivity {
|
||||||
mSettingClearModel = new settingClearModel(new settingClearController.settingClearModelCallback());
|
mSettingClearModel = new settingClearModel(new settingClearController.settingClearModelCallback());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onOpenInfo(View view) {
|
/*View Callbacks*/
|
||||||
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* LISTENERS */
|
private class settingClearViewCallback implements eventObserver.eventListener{
|
||||||
public class settingClearViewCallback implements eventObserver.eventListener{
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
|
@ -69,8 +75,9 @@ public class settingClearController extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Model Callbacks*/
|
||||||
|
|
||||||
public class settingClearModelCallback implements eventObserver.eventListener{
|
private class settingClearModelCallback implements eventObserver.eventListener{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
|
@ -79,65 +86,100 @@ public class settingClearController extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initializeListeners(){
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onCheckBoxTriggered(View view){
|
|
||||||
mSettingClearViewController.onTrigger(settingClearEnums.eClearViewController.M_CHECK_INVOKE, Arrays.asList(view.getTag(),!mCheckBoxList.get(Integer.parseInt(view.getTag().toString())).isChecked()));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onClearData(View view){
|
public void onClearData(View view){
|
||||||
try{
|
boolean mHomeInvoked = false;
|
||||||
if(mCheckBoxList.get(0).isChecked()){
|
if(mCheckBoxList.get(0).isChecked()){
|
||||||
mCheckBoxList.get(0).setChecked(false);
|
mCheckBoxList.get(0).setChecked(false);
|
||||||
mCheckBoxList.get(0).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.c_checkbox_tint_default)));
|
mCheckBoxList.get(0).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.c_checkbox_tint_default)));
|
||||||
activityContextManager.getInstance().getHomeController().onClearSession();
|
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLEAR_TAB, null);
|
||||||
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLEAR_TAB, null);
|
mHomeInvoked = true;
|
||||||
activityContextManager.getInstance().getHomeController().initTab(false);
|
|
||||||
}
|
|
||||||
if(mCheckBoxList.get(1).isChecked()){
|
|
||||||
mCheckBoxList.get(1).setChecked(false);
|
|
||||||
mCheckBoxList.get(1).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.c_checkbox_tint_default)));
|
|
||||||
databaseController.getInstance().execSQL(sql.SQL_CLEAR_HISTORY,null);
|
|
||||||
dataController.getInstance().invokeHistory(dataEnums.eHistoryCommands.M_CLEAR_HISTORY ,null);
|
|
||||||
}
|
|
||||||
if(mCheckBoxList.get(2).isChecked()){
|
|
||||||
mCheckBoxList.get(2).setChecked(false);
|
|
||||||
mCheckBoxList.get(2).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.c_checkbox_tint_default)));
|
|
||||||
databaseController.getInstance().execSQL(sql.SQL_CLEAR_BOOKMARK,null);
|
|
||||||
dataController.getInstance().invokeBookmark(dataEnums.eBookmarkCommands.M_CLEAR_BOOKMARK ,null);
|
|
||||||
}
|
|
||||||
if(mCheckBoxList.get(3).isChecked()){
|
|
||||||
mCheckBoxList.get(3).setChecked(false);
|
|
||||||
mCheckBoxList.get(3).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.c_checkbox_tint_default)));
|
|
||||||
activityContextManager.getInstance().getHomeController().onClearCache();
|
|
||||||
}
|
|
||||||
if(mCheckBoxList.get(4).isChecked()){
|
|
||||||
mCheckBoxList.get(4).setChecked(false);
|
|
||||||
mCheckBoxList.get(4).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.c_checkbox_tint_default)));
|
|
||||||
dataController.getInstance().invokeSuggestion(dataEnums.eSuggestionCommands.M_CLEAR_SUGGESTION ,null);
|
|
||||||
}
|
|
||||||
if(mCheckBoxList.get(5).isChecked()){
|
|
||||||
mCheckBoxList.get(5).setChecked(false);
|
|
||||||
mCheckBoxList.get(5).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.c_checkbox_tint_default)));
|
|
||||||
activityContextManager.getInstance().getHomeController().onClearSiteData();
|
|
||||||
}
|
|
||||||
if(mCheckBoxList.get(6).isChecked()){
|
|
||||||
mCheckBoxList.get(6).setChecked(false);
|
|
||||||
mCheckBoxList.get(6).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.c_checkbox_tint_default)));
|
|
||||||
activityContextManager.getInstance().getHomeController().onClearSession();
|
|
||||||
}
|
|
||||||
if(mCheckBoxList.get(7).isChecked()){
|
|
||||||
mCheckBoxList.get(7).setChecked(false);
|
|
||||||
mCheckBoxList.get(7).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.c_checkbox_tint_default)));
|
|
||||||
activityContextManager.getInstance().getHomeController().onClearCookies();
|
|
||||||
}
|
|
||||||
|
|
||||||
activityContextManager.getInstance().getHomeController().initRuntimeSettings();
|
|
||||||
pluginController.getInstance().MessageManagerHandler(this, null, enums.eMessageEnums.M_DATA_CLEARED);
|
|
||||||
}catch (Exception ex){
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
if(mCheckBoxList.get(1).isChecked()){
|
||||||
|
mCheckBoxList.get(1).setChecked(false);
|
||||||
|
mCheckBoxList.get(1).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.c_checkbox_tint_default)));
|
||||||
|
databaseController.getInstance().execSQL(sql.SQL_CLEAR_HISTORY,null);
|
||||||
|
dataController.getInstance().invokeHistory(dataEnums.eHistoryCommands.M_CLEAR_HISTORY ,null);
|
||||||
|
}
|
||||||
|
if(mCheckBoxList.get(2).isChecked()){
|
||||||
|
mCheckBoxList.get(2).setChecked(false);
|
||||||
|
mCheckBoxList.get(2).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.c_checkbox_tint_default)));
|
||||||
|
databaseController.getInstance().execSQL(sql.SQL_CLEAR_BOOKMARK,null);
|
||||||
|
dataController.getInstance().invokeBookmark(dataEnums.eBookmarkCommands.M_CLEAR_BOOKMARK ,null);
|
||||||
|
}
|
||||||
|
if(mCheckBoxList.get(3).isChecked()){
|
||||||
|
mCheckBoxList.get(3).setChecked(false);
|
||||||
|
mCheckBoxList.get(3).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.c_checkbox_tint_default)));
|
||||||
|
activityContextManager.getInstance().getHomeController().onClearCache();
|
||||||
|
}
|
||||||
|
if(mCheckBoxList.get(4).isChecked()){
|
||||||
|
mCheckBoxList.get(4).setChecked(false);
|
||||||
|
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLEAR_TAB, null);
|
||||||
|
mCheckBoxList.get(4).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.c_checkbox_tint_default)));
|
||||||
|
activityContextManager.getInstance().getHomeController().onClearSiteData();
|
||||||
|
mHomeInvoked = true;
|
||||||
|
}
|
||||||
|
if(mCheckBoxList.get(5).isChecked()){
|
||||||
|
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLEAR_TAB, null);
|
||||||
|
mCheckBoxList.get(5).setChecked(false);
|
||||||
|
mCheckBoxList.get(5).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.c_checkbox_tint_default)));
|
||||||
|
activityContextManager.getInstance().getHomeController().onClearSession();
|
||||||
|
mHomeInvoked = true;
|
||||||
|
}
|
||||||
|
if(mCheckBoxList.get(6).isChecked()){
|
||||||
|
mCheckBoxList.get(6).setChecked(false);
|
||||||
|
mCheckBoxList.get(6).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.c_checkbox_tint_default)));
|
||||||
|
activityContextManager.getInstance().getHomeController().onClearCookies();
|
||||||
|
}
|
||||||
|
if(mCheckBoxList.get(7).isChecked()){
|
||||||
|
mCheckBoxList.get(7).setChecked(false);
|
||||||
|
mCheckBoxList.get(7).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.c_checkbox_tint_default)));
|
||||||
|
onClearSettings();
|
||||||
|
status.initStatus();
|
||||||
|
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLEAR_TAB, null);
|
||||||
|
mHomeInvoked = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
activityContextManager.getInstance().getHomeController().initRuntimeSettings();
|
||||||
|
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(this), M_DATA_CLEARED);
|
||||||
|
|
||||||
|
if(mHomeInvoked){
|
||||||
|
activityContextManager.getInstance().getHomeController().onReDrawGeckoview();
|
||||||
|
activityContextManager.getInstance().getHomeController().onHomeButton(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onClearSettings(){
|
||||||
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SEARCH_HISTORY,true));
|
||||||
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SEARCH_SUGGESTION,true));
|
||||||
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_JAVA_SCRIPT,true));
|
||||||
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_HISTORY_CLEAR,true));
|
||||||
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_GATEWAY_AUTO,true));
|
||||||
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_GATEWAY_MANUAL,false));
|
||||||
|
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.BRIDGE_VPN_ENABLED,false));
|
||||||
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.BRIDGE_BRIDGE_ENABLES,true));
|
||||||
|
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));
|
||||||
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_TRACKING_PROTECTION,true));
|
||||||
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_DONOT_TRACK,true));
|
||||||
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_COOKIE_ADJUSTABLE,ACCEPT_FIRST_PARTY));
|
||||||
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_FLOAT, Arrays.asList(keys.SETTING_FONT_SIZE,100));
|
||||||
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.SETTING_LANGUAGE, strings.SETTING_DEFAULT_LANGUAGE));
|
||||||
|
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_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));
|
||||||
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SHOW_FONTS,true));
|
||||||
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_TOOLBAR_THEME,true));
|
||||||
|
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_OPEN_URL_IN_NEW_TAB,false));
|
||||||
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_LIST_VIEW,true));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LOCAL OVERRIDES */
|
/* LOCAL OVERRIDES */
|
||||||
|
@ -145,6 +187,7 @@ public class settingClearController extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume()
|
||||||
{
|
{
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
activityContextManager.getInstance().setCurrentActivity(this);
|
activityContextManager.getInstance().setCurrentActivity(this);
|
||||||
super.onResume();
|
super.onResume();
|
||||||
}
|
}
|
||||||
|
@ -161,6 +204,17 @@ public class settingClearController extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*UI Redirection*/
|
/*UI Redirection*/
|
||||||
|
|
||||||
|
public void onOpenInfo(View view) {
|
||||||
|
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onCheckBoxTriggered(View view){
|
||||||
|
if(view!=null && view.getTag()!=null){
|
||||||
|
mSettingClearViewController.onTrigger(settingClearEnums.eClearViewController.M_CHECK_INVOKE, Arrays.asList(view.getTag(),!mCheckBoxList.get(Integer.parseInt(view.getTag().toString())).isChecked()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void onClose(View view){
|
public void onClose(View view){
|
||||||
activityContextManager.getInstance().onRemoveStack(this);
|
activityContextManager.getInstance().onRemoveStack(this);
|
||||||
finish();
|
finish();
|
||||||
|
|
|
@ -30,7 +30,6 @@ class settingClearViewController
|
||||||
this.mContext = pContext;
|
this.mContext = pContext;
|
||||||
this.mCheckBoxList = pCheckBoxList;
|
this.mCheckBoxList = pCheckBoxList;
|
||||||
|
|
||||||
initViews();
|
|
||||||
initPostUI();
|
initPostUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,10 +50,6 @@ class settingClearViewController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initViews()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onClearCheckbox(int pIndex, boolean pStatus){
|
private void onClearCheckbox(int pIndex, boolean pStatus){
|
||||||
mCheckBoxList.get(pIndex).setChecked(pStatus);
|
mCheckBoxList.get(pIndex).setChecked(pStatus);
|
||||||
if(pStatus){
|
if(pStatus){
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.darkweb.genesissearchengine.appManager.settingManager.generalManager;
|
package com.darkweb.genesissearchengine.appManager.settingManager.generalManager;
|
||||||
|
|
||||||
|
import android.content.res.Configuration;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -7,9 +8,12 @@ import android.widget.RadioButton;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.app.AppCompatDelegate;
|
import androidx.appcompat.app.AppCompatDelegate;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
||||||
import com.darkweb.genesissearchengine.appManager.helpManager.helpController;
|
import com.darkweb.genesissearchengine.appManager.helpManager.helpController;
|
||||||
import com.darkweb.genesissearchengine.appManager.languageManager.languageController;
|
import com.darkweb.genesissearchengine.appManager.languageManager.languageController;
|
||||||
|
import com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingHomeController;
|
||||||
import com.darkweb.genesissearchengine.constants.constants;
|
import com.darkweb.genesissearchengine.constants.constants;
|
||||||
import com.darkweb.genesissearchengine.constants.enums;
|
import com.darkweb.genesissearchengine.constants.enums;
|
||||||
import com.darkweb.genesissearchengine.constants.keys;
|
import com.darkweb.genesissearchengine.constants.keys;
|
||||||
|
@ -19,16 +23,18 @@ import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class settingGeneralController extends AppCompatActivity {
|
public class settingGeneralController extends AppCompatActivity {
|
||||||
|
|
||||||
/* PRIVATE VARIABLES */
|
/* PRIVATE VARIABLES */
|
||||||
|
|
||||||
private settingGeneralModel mSettingGeneralModel;
|
private settingGeneralModel mSettingGeneralModel;
|
||||||
private settingGeneralViewController mSettingGeneralViewController;
|
private settingGeneralViewController mSettingGeneralViewController;
|
||||||
private SwitchMaterial mFullScreenMode;
|
private SwitchMaterial mFullScreenMode;
|
||||||
|
@ -40,16 +46,15 @@ public class settingGeneralController extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
pluginController.getInstance().onCreate(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
onInitTheme();
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.setting_general_view);
|
|
||||||
|
|
||||||
|
setContentView(R.layout.setting_general_view);
|
||||||
|
activityContextManager.getInstance().setSettingGeneralController(this);
|
||||||
viewsInitializations();
|
viewsInitializations();
|
||||||
initializeListeners();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void viewsInitializations() {
|
private void viewsInitializations() {
|
||||||
|
|
||||||
mFullScreenMode = findViewById(R.id.pJSStatus);
|
mFullScreenMode = findViewById(R.id.pJSStatus);
|
||||||
mThemeLight = findViewById(R.id.pThemeLight);
|
mThemeLight = findViewById(R.id.pThemeLight);
|
||||||
|
@ -63,44 +68,65 @@ public class settingGeneralController extends AppCompatActivity {
|
||||||
mSettingGeneralModel = new settingGeneralModel(new settingGeneralModelCallback());
|
mSettingGeneralModel = new settingGeneralModel(new settingGeneralModelCallback());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onInitTheme(){
|
private void onInitTheme(){
|
||||||
|
|
||||||
if(status.sTheme == enums.Theme.THEME_DARK){
|
if(status.sTheme == enums.Theme.THEME_DARK){
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||||
|
activityContextManager.getInstance().getHomeController().recreate();
|
||||||
}else if(status.sTheme == enums.Theme.THEME_LIGHT){
|
}else if(status.sTheme == enums.Theme.THEME_LIGHT){
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
||||||
|
activityContextManager.getInstance().getHomeController().recreate();
|
||||||
}else {
|
}else {
|
||||||
if(!status.sDefaultNightMode){
|
if(!status.sDefaultNightMode){
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
||||||
|
activityContextManager.getInstance().getHomeController().recreate();
|
||||||
}else {
|
}else {
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||||
|
activityContextManager.getInstance().getHomeController().recreate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onOpenInfo(View view) {
|
/*View Callbacks*/
|
||||||
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* LISTENERS */
|
private class settingGeneralViewCallback implements eventObserver.eventListener{
|
||||||
public class settingGeneralViewCallback implements eventObserver.eventListener{
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
{
|
{
|
||||||
if(settingGeneralEnums.eGeneralViewCallback.M_RESET_THEME_INVOKED_BACK.equals(e_type))
|
if(settingGeneralEnums.eGeneralViewCallback.M_RESET_THEME_INVOKED_BACK.equals(e_type))
|
||||||
{
|
{
|
||||||
helperMethod.restartActivity(getIntent(), settingGeneralController.this);
|
boolean mIsThemeChangable = false;
|
||||||
new Handler().postDelayed(() -> {
|
if(status.sTheme == enums.Theme.THEME_DARK){
|
||||||
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
|
if(AppCompatDelegate.getDefaultNightMode() != AppCompatDelegate.MODE_NIGHT_YES){
|
||||||
activityContextManager.getInstance().getSettingController().applyTheme();
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||||
}, 100);
|
mIsThemeChangable = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(status.sTheme == enums.Theme.THEME_LIGHT){
|
||||||
|
if(AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_YES){
|
||||||
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||||
|
mIsThemeChangable = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mIsThemeChangable){
|
||||||
|
status.mThemeApplying = true;
|
||||||
|
onInitTheme();
|
||||||
|
onBackPressed();
|
||||||
|
overridePendingTransition(R.anim.fade_in_lang, R.anim.fade_out_lang);
|
||||||
|
activityContextManager.getInstance().getSettingController().onReInitTheme();
|
||||||
|
activityContextManager.getInstance().getHomeController().onReInitTheme();
|
||||||
|
helperMethod.openActivity(settingGeneralController.class, constants.CONST_LIST_HISTORY, settingGeneralController.this,true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class settingGeneralModelCallback implements eventObserver.eventListener{
|
/*Model Callbacks*/
|
||||||
|
|
||||||
|
private class settingGeneralModelCallback implements eventObserver.eventListener{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
|
@ -109,14 +135,12 @@ public class settingGeneralController extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initializeListeners(){
|
|
||||||
}
|
|
||||||
|
|
||||||
/* LOCAL OVERRIDES */
|
/* LOCAL OVERRIDES */
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume()
|
||||||
{
|
{
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
activityContextManager.getInstance().setCurrentActivity(this);
|
activityContextManager.getInstance().setCurrentActivity(this);
|
||||||
super.onResume();
|
super.onResume();
|
||||||
}
|
}
|
||||||
|
@ -133,7 +157,14 @@ public class settingGeneralController extends AppCompatActivity {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*External Redirection*/
|
||||||
|
|
||||||
|
public void onLanguageChanged(){
|
||||||
|
setContentView(R.layout.setting_general_view);
|
||||||
|
}
|
||||||
|
|
||||||
/*UI Redirection*/
|
/*UI Redirection*/
|
||||||
|
|
||||||
public void onClose(View view){
|
public void onClose(View view){
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
@ -177,6 +208,10 @@ public class settingGeneralController extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onOpenInfo(View view) {
|
||||||
|
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
||||||
|
}
|
||||||
|
|
||||||
public void onURLInNewTab(View view) {
|
public void onURLInNewTab(View view) {
|
||||||
mSettingGeneralModel.onTrigger(settingGeneralEnums.eGeneralModel.M_URL_NEW_TAB, Collections.singletonList(!mOpenURLInNewTab.isChecked()));
|
mSettingGeneralModel.onTrigger(settingGeneralEnums.eGeneralModel.M_URL_NEW_TAB, Collections.singletonList(!mOpenURLInNewTab.isChecked()));
|
||||||
mOpenURLInNewTab.toggle();
|
mOpenURLInNewTab.toggle();
|
||||||
|
|
|
@ -13,6 +13,7 @@ import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||||
|
|
||||||
|
@ -29,14 +30,14 @@ public class settingLogController extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
pluginController.getInstance().onCreate(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.setting_log_view);
|
setContentView(R.layout.setting_log_view);
|
||||||
|
|
||||||
viewsInitializations();
|
viewsInitializations();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void viewsInitializations() {
|
private void viewsInitializations() {
|
||||||
mListView = findViewById(R.id.pListView);
|
mListView = findViewById(R.id.pListView);
|
||||||
activityContextManager.getInstance().onStack(this);
|
activityContextManager.getInstance().onStack(this);
|
||||||
mSettingLogViewController = new settingLogViewController(this, new settingLogViewCallback(), mListView);
|
mSettingLogViewController = new settingLogViewController(this, new settingLogViewCallback(), mListView);
|
||||||
|
@ -44,12 +45,9 @@ public class settingLogController extends AppCompatActivity {
|
||||||
mSettingLogModel = new settingLogModel(new settingLogModelCallback());
|
mSettingLogModel = new settingLogModel(new settingLogModelCallback());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onOpenInfo(View view) {
|
/*View Callbacks*/
|
||||||
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* LISTENERS */
|
private class settingLogViewCallback implements eventObserver.eventListener{
|
||||||
public class settingLogViewCallback implements eventObserver.eventListener{
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
|
@ -58,8 +56,9 @@ public class settingLogController extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Model Callbacks*/
|
||||||
|
|
||||||
public class settingLogModelCallback implements eventObserver.eventListener{
|
private class settingLogModelCallback implements eventObserver.eventListener{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
|
@ -73,6 +72,7 @@ public class settingLogController extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume()
|
||||||
{
|
{
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
activityContextManager.getInstance().setCurrentActivity(this);
|
activityContextManager.getInstance().setCurrentActivity(this);
|
||||||
super.onResume();
|
super.onResume();
|
||||||
}
|
}
|
||||||
|
@ -101,4 +101,9 @@ public class settingLogController extends AppCompatActivity {
|
||||||
activityContextManager.getInstance().getOrbotLogController().initializeLogs();
|
activityContextManager.getInstance().getOrbotLogController().initializeLogs();
|
||||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_LIST_VIEW, status.sLogListView));
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_LIST_VIEW, status.sLogListView));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onOpenInfo(View view) {
|
||||||
|
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -13,6 +13,7 @@ import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||||
|
|
||||||
|
@ -23,20 +24,21 @@ import java.util.List;
|
||||||
public class settingNotificationController extends AppCompatActivity {
|
public class settingNotificationController extends AppCompatActivity {
|
||||||
|
|
||||||
/* PRIVATE VARIABLES */
|
/* PRIVATE VARIABLES */
|
||||||
|
|
||||||
private SwitchMaterial mNotificationManual;
|
private SwitchMaterial mNotificationManual;
|
||||||
private settingNotificationModel mSettingNotificationModel;
|
private settingNotificationModel mSettingNotificationModel;
|
||||||
private settingNotificationViewController mSettingNotificationViewController;
|
private settingNotificationViewController mSettingNotificationViewController;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
pluginController.getInstance().onCreate(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.setting_notification_view);
|
setContentView(R.layout.setting_notification_view);
|
||||||
|
|
||||||
viewsInitializations();
|
viewsInitializations();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void viewsInitializations() {
|
private void viewsInitializations() {
|
||||||
activityContextManager.getInstance().onStack(this);
|
activityContextManager.getInstance().onStack(this);
|
||||||
mNotificationManual = findViewById(R.id.pNotificationManual);
|
mNotificationManual = findViewById(R.id.pNotificationManual);
|
||||||
mSettingNotificationViewController = new settingNotificationViewController(this, new settingNotificationViewCallback(), mNotificationManual);
|
mSettingNotificationViewController = new settingNotificationViewController(this, new settingNotificationViewCallback(), mNotificationManual);
|
||||||
|
@ -44,8 +46,9 @@ public class settingNotificationController extends AppCompatActivity {
|
||||||
mSettingNotificationModel = new settingNotificationModel(new settingNotificationModelCallback());
|
mSettingNotificationModel = new settingNotificationModel(new settingNotificationModelCallback());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LISTENERS */
|
/*View Callbacks*/
|
||||||
public class settingNotificationViewCallback implements eventObserver.eventListener{
|
|
||||||
|
private class settingNotificationViewCallback implements eventObserver.eventListener{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
|
@ -54,8 +57,9 @@ public class settingNotificationController extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Model Callbacks*/
|
||||||
|
|
||||||
public class settingNotificationModelCallback implements eventObserver.eventListener{
|
private class settingNotificationModelCallback implements eventObserver.eventListener{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
|
@ -69,14 +73,15 @@ public class settingNotificationController extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume()
|
||||||
{
|
{
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
activityContextManager.getInstance().setCurrentActivity(this);
|
activityContextManager.getInstance().setCurrentActivity(this);
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
int notificationStatus = pluginController.getInstance().getNotificationStatus();
|
int notificationStatus = status.sBridgeNotificationManual;
|
||||||
if(notificationStatus==0){
|
if(notificationStatus==0){
|
||||||
pluginController.getInstance().disableTorNotification();
|
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION);
|
||||||
} else if(notificationStatus==1){
|
} else{
|
||||||
pluginController.getInstance().enableTorNotification();
|
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_ENABLE_NOTIFICATION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,10 @@ import com.darkweb.genesissearchengine.constants.status;
|
||||||
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
class settingNotificationModel
|
class settingNotificationModel
|
||||||
|
@ -27,14 +30,10 @@ class settingNotificationModel
|
||||||
|
|
||||||
int mStatus = pStatus ? 1 : 0;
|
int mStatus = pStatus ? 1 : 0;
|
||||||
status.sBridgeNotificationManual = mStatus;
|
status.sBridgeNotificationManual = mStatus;
|
||||||
pluginController.getInstance().setNotificationStatus(mStatus);
|
if(!pStatus){
|
||||||
int notificationStatus = pluginController.getInstance().getNotificationStatus();
|
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION);
|
||||||
if(notificationStatus==0){
|
} else{
|
||||||
pluginController.getInstance().disableTorNotification();
|
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_ENABLE_NOTIFICATION);
|
||||||
} else if(notificationStatus==1){
|
|
||||||
pluginController.getInstance().enableTorNotification();
|
|
||||||
}else {
|
|
||||||
pluginController.getInstance().enableTorNotificationNoBandwidth();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -35,15 +36,15 @@ public class settingPrivacyController extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
pluginController.getInstance().onCreate(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
setContentView(R.layout.setting_privacy_view);
|
setContentView(R.layout.setting_privacy_view);
|
||||||
|
|
||||||
viewsInitializations();
|
viewsInitializations();
|
||||||
initializeListeners();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void viewsInitializations() {
|
private void viewsInitializations() {
|
||||||
mJavaScript = findViewById(R.id.pJavascript);
|
mJavaScript = findViewById(R.id.pJavascript);
|
||||||
mDoNotTrack = findViewById(R.id.pDoNotTrack);
|
mDoNotTrack = findViewById(R.id.pDoNotTrack);
|
||||||
mTrackingProtection = findViewById(R.id.pTrackingProtection);
|
mTrackingProtection = findViewById(R.id.pTrackingProtection);
|
||||||
|
@ -58,12 +59,9 @@ public class settingPrivacyController extends AppCompatActivity {
|
||||||
mSettingPrivacyModel = new settingPrivacyModel(new settingPrivacyController.settingAccessibilityModelCallback());
|
mSettingPrivacyModel = new settingPrivacyModel(new settingPrivacyController.settingAccessibilityModelCallback());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onOpenInfo(View view) {
|
/*View Callbacks*/
|
||||||
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* LISTENERS */
|
private class settingAccessibilityViewCallback implements eventObserver.eventListener{
|
||||||
public class settingAccessibilityViewCallback implements eventObserver.eventListener{
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
|
@ -72,8 +70,9 @@ public class settingPrivacyController extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Model Callbacks*/
|
||||||
|
|
||||||
public class settingAccessibilityModelCallback implements eventObserver.eventListener{
|
private class settingAccessibilityModelCallback implements eventObserver.eventListener{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
|
@ -82,9 +81,6 @@ public class settingPrivacyController extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initializeListeners(){
|
|
||||||
}
|
|
||||||
|
|
||||||
/* LOCAL OVERRIDES */
|
/* LOCAL OVERRIDES */
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -93,6 +89,7 @@ public class settingPrivacyController extends AppCompatActivity {
|
||||||
if(mSettingChanged){
|
if(mSettingChanged){
|
||||||
activityContextManager.getInstance().setCurrentActivity(this);
|
activityContextManager.getInstance().setCurrentActivity(this);
|
||||||
}
|
}
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
super.onResume();
|
super.onResume();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,12 +103,14 @@ public class settingPrivacyController extends AppCompatActivity {
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
if(mSettingChanged){
|
if(mSettingChanged){
|
||||||
activityContextManager.getInstance().setCurrentActivity(this);
|
activityContextManager.getInstance().setCurrentActivity(this);
|
||||||
|
activityContextManager.getInstance().getHomeController().initRuntimeSettings();
|
||||||
}
|
}
|
||||||
activityContextManager.getInstance().onRemoveStack(this);
|
activityContextManager.getInstance().onRemoveStack(this);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*UI Redirection*/
|
/*UI Redirection*/
|
||||||
|
|
||||||
public void onClose(View view){
|
public void onClose(View view){
|
||||||
onBackPressed();
|
onBackPressed();
|
||||||
}
|
}
|
||||||
|
@ -127,7 +126,7 @@ public class settingPrivacyController extends AppCompatActivity {
|
||||||
mSettingChanged = true;
|
mSettingChanged = true;
|
||||||
mSettingPrivacyModel.onTrigger(settingPrivacyEnums.ePrivacyModel.M_SET_DONOT_TRACK, Collections.singletonList(!status.sStatusDoNotTrack));
|
mSettingPrivacyModel.onTrigger(settingPrivacyEnums.ePrivacyModel.M_SET_DONOT_TRACK, Collections.singletonList(!status.sStatusDoNotTrack));
|
||||||
mDoNotTrack.toggle();
|
mDoNotTrack.toggle();
|
||||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_DONOT_TRACK,status.sSettingTrackingProtection));
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_DONOT_TRACK,status.sStatusDoNotTrack));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onTrackingProtection(View view){
|
public void onTrackingProtection(View view){
|
||||||
|
@ -151,4 +150,8 @@ public class settingPrivacyController extends AppCompatActivity {
|
||||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_HISTORY_CLEAR,status.sClearOnExit));
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_HISTORY_CLEAR,status.sClearOnExit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onOpenInfo(View view) {
|
||||||
|
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -32,14 +33,14 @@ public class settingSearchController extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
pluginController.getInstance().onCreate(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.setting_search_view);
|
setContentView(R.layout.setting_search_view);
|
||||||
|
|
||||||
viewsInitializations();
|
viewsInitializations();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void viewsInitializations() {
|
private void viewsInitializations() {
|
||||||
mSearchEngines.add(findViewById(R.id.mRadioSearch_1));
|
mSearchEngines.add(findViewById(R.id.mRadioSearch_1));
|
||||||
mSearchEngines.add(findViewById(R.id.mRadioSearch_2));
|
mSearchEngines.add(findViewById(R.id.mRadioSearch_2));
|
||||||
mSearchEngines.add(findViewById(R.id.mRadioSearch_3));
|
mSearchEngines.add(findViewById(R.id.mRadioSearch_3));
|
||||||
|
@ -53,6 +54,57 @@ public class settingSearchController extends AppCompatActivity {
|
||||||
mSettingSearchModel = new settingSearchModel(new settingSearchModelCallback());
|
mSettingSearchModel = new settingSearchModel(new settingSearchModelCallback());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*View Callbacks*/
|
||||||
|
|
||||||
|
private class settingSearchViewCallback implements eventObserver.eventListener{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Model Callbacks*/
|
||||||
|
|
||||||
|
private class settingSearchModelCallback implements eventObserver.eventListener{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* LOCAL OVERRIDES */
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume()
|
||||||
|
{
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
|
activityContextManager.getInstance().setCurrentActivity(this);
|
||||||
|
super.onResume();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause()
|
||||||
|
{
|
||||||
|
super.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
activityContextManager.getInstance().onRemoveStack(this);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*UI Redirection*/
|
||||||
|
|
||||||
|
public void onClose(View view){
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
public void onSelectSearchEngine(View view) {
|
public void onSelectSearchEngine(View view) {
|
||||||
if(view.getId() == R.id.pOption1){
|
if(view.getId() == R.id.pOption1){
|
||||||
mSettingSearchModel.onTrigger(settingSearchEnums.eSearchModel.M_SET_SEARCH_ENGINE, Collections.singletonList(constants.CONST_BACKEND_GENESIS_URL));
|
mSettingSearchModel.onTrigger(settingSearchEnums.eSearchModel.M_SET_SEARCH_ENGINE, Collections.singletonList(constants.CONST_BACKEND_GENESIS_URL));
|
||||||
|
@ -95,52 +147,4 @@ public class settingSearchController extends AppCompatActivity {
|
||||||
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LISTENERS */
|
|
||||||
public class settingSearchViewCallback implements eventObserver.eventListener{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class settingSearchModelCallback implements eventObserver.eventListener{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* LOCAL OVERRIDES */
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResume()
|
|
||||||
{
|
|
||||||
activityContextManager.getInstance().setCurrentActivity(this);
|
|
||||||
super.onResume();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPause()
|
|
||||||
{
|
|
||||||
super.onPause();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBackPressed() {
|
|
||||||
activityContextManager.getInstance().onRemoveStack(this);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*UI Redirection*/
|
|
||||||
|
|
||||||
public void onClose(View view){
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,15 +1,12 @@
|
||||||
package com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage;
|
package com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Configuration;
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.app.AppCompatDelegate;
|
|
||||||
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
||||||
import com.darkweb.genesissearchengine.appManager.helpManager.helpController;
|
import com.darkweb.genesissearchengine.appManager.helpManager.helpController;
|
||||||
import com.darkweb.genesissearchengine.appManager.homeManager.homeController;
|
|
||||||
import com.darkweb.genesissearchengine.appManager.proxyStatusManager.proxyStatusController;
|
import com.darkweb.genesissearchengine.appManager.proxyStatusManager.proxyStatusController;
|
||||||
import com.darkweb.genesissearchengine.appManager.settingManager.accessibilityManager.settingAccessibilityController;
|
import com.darkweb.genesissearchengine.appManager.settingManager.accessibilityManager.settingAccessibilityController;
|
||||||
import com.darkweb.genesissearchengine.appManager.settingManager.advanceManager.settingAdvanceController;
|
import com.darkweb.genesissearchengine.appManager.settingManager.advanceManager.settingAdvanceController;
|
||||||
|
@ -19,76 +16,74 @@ import com.darkweb.genesissearchengine.appManager.settingManager.notificationMan
|
||||||
import com.darkweb.genesissearchengine.appManager.settingManager.privacyManager.settingPrivacyController;
|
import com.darkweb.genesissearchengine.appManager.settingManager.privacyManager.settingPrivacyController;
|
||||||
import com.darkweb.genesissearchengine.appManager.settingManager.searchEngineManager.settingSearchController;
|
import com.darkweb.genesissearchengine.appManager.settingManager.searchEngineManager.settingSearchController;
|
||||||
import com.darkweb.genesissearchengine.constants.constants;
|
import com.darkweb.genesissearchengine.constants.constants;
|
||||||
import com.darkweb.genesissearchengine.constants.enums;
|
|
||||||
import com.darkweb.genesissearchengine.constants.keys;
|
import com.darkweb.genesissearchengine.constants.keys;
|
||||||
import com.darkweb.genesissearchengine.constants.status;
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
import com.darkweb.genesissearchengine.constants.strings;
|
|
||||||
import com.darkweb.genesissearchengine.dataManager.dataController;
|
import com.darkweb.genesissearchengine.dataManager.dataController;
|
||||||
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.*;
|
||||||
|
|
||||||
import static com.darkweb.genesissearchengine.constants.enums.eMessageEnums.M_NOT_SUPPORTED;
|
public class settingHomeController extends AppCompatActivity
|
||||||
|
|
||||||
public class settingController extends AppCompatActivity
|
|
||||||
{
|
{
|
||||||
/*Private Observer Classes*/
|
/*Private Observer Classes*/
|
||||||
|
|
||||||
private settingViewController mSettingViewController;
|
private settingHomeViewController mSettingViewController;
|
||||||
private settingModel mSettingModel;
|
private settingHomeModel mSettingModel;
|
||||||
|
|
||||||
/*Initializations*/
|
/*Initializations*/
|
||||||
|
|
||||||
public settingController(){
|
public settingHomeController(){
|
||||||
mSettingModel = new settingModel(new settingModelCallback());
|
mSettingModel = new settingHomeModel(new settingModelCallback());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState)
|
protected void onCreate(Bundle savedInstanceState)
|
||||||
{
|
{
|
||||||
onInitTheme();
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.setting);
|
setContentView(R.layout.setting);
|
||||||
|
|
||||||
pluginController.getInstance().onCreate(this);
|
|
||||||
viewsInitializations();
|
viewsInitializations();
|
||||||
listenersInitializations();
|
listenersInitializations();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onInitTheme(){
|
private void viewsInitializations()
|
||||||
|
{
|
||||||
|
activityContextManager.getInstance().setSettingController(this);
|
||||||
|
mSettingViewController = new settingHomeViewController(this, new settingViewCallback());
|
||||||
|
}
|
||||||
|
|
||||||
status.mThemeApplying = true;
|
private void listenersInitializations()
|
||||||
if(status.sTheme == enums.Theme.THEME_DARK){
|
{
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
}
|
||||||
}else if(status.sTheme == enums.Theme.THEME_LIGHT){
|
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
/*View Callbacks*/
|
||||||
}else {
|
|
||||||
if((getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_NO){
|
private class settingViewCallback implements eventObserver.eventListener{
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
|
||||||
}else {
|
@Override
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
}
|
{
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void applyTheme(){
|
/*Model Callbacks*/
|
||||||
recreate();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void viewsInitializations()
|
private class settingModelCallback implements eventObserver.eventListener{
|
||||||
{
|
|
||||||
activityContextManager.getInstance().setSettingController(this);
|
|
||||||
mSettingViewController = new settingViewController(this, new settingModelCallback());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void listenersInitializations()
|
@Override
|
||||||
{
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
pluginController.getInstance().logEvent(strings.EVENT_SETTINGS_OPENED);
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Local Overrides*/
|
/*Local Overrides*/
|
||||||
|
@ -106,11 +101,10 @@ public class settingController extends AppCompatActivity
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume()
|
||||||
{
|
{
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
activityContextManager.getInstance().setCurrentActivity(this);
|
activityContextManager.getInstance().setCurrentActivity(this);
|
||||||
status.sSettingIsAppPaused = false;
|
status.sSettingIsAppPaused = false;
|
||||||
onInitTheme();
|
|
||||||
activityContextManager.getInstance().onStack(this);
|
activityContextManager.getInstance().onStack(this);
|
||||||
|
|
||||||
super.onResume();
|
super.onResume();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,6 +121,16 @@ public class settingController extends AppCompatActivity
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*External Redirection*/
|
||||||
|
|
||||||
|
public void onRedrawXML(){
|
||||||
|
setContentView(R.layout.setting);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onReInitTheme(){
|
||||||
|
recreate();
|
||||||
|
}
|
||||||
|
|
||||||
/*UI Redirection*/
|
/*UI Redirection*/
|
||||||
|
|
||||||
public void onNavigationBackPressed(View view){
|
public void onNavigationBackPressed(View view){
|
||||||
|
@ -137,7 +141,7 @@ public class settingController extends AppCompatActivity
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
startActivity(new Intent(android.provider.Settings.ACTION_MANAGE_DEFAULT_APPS_SETTINGS));
|
startActivity(new Intent(android.provider.Settings.ACTION_MANAGE_DEFAULT_APPS_SETTINGS));
|
||||||
}else{
|
}else{
|
||||||
pluginController.getInstance().MessageManagerHandler(this, null, M_NOT_SUPPORTED);
|
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(this), M_NOT_SUPPORTED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,11 +178,11 @@ public class settingController extends AppCompatActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onReportWebsite(View view) {
|
public void onReportWebsite(View view) {
|
||||||
pluginController.getInstance().MessageManagerHandler(this, Collections.singletonList(activityContextManager.getInstance().getHomeController().onGetCurrentURL()),enums.eMessageEnums.M_REPORT_URL);
|
pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(activityContextManager.getInstance().getHomeController().onGetCurrentURL(), this), M_REPORT_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onRateApplication(View view) {
|
public void onRateApplication(View view) {
|
||||||
pluginController.getInstance().MessageManagerHandler(this, Collections.singletonList(activityContextManager.getInstance().getHomeController().onGetCurrentURL()),enums.eMessageEnums.M_RATE_APP);
|
pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(activityContextManager.getInstance().getHomeController().onGetCurrentURL(), this), M_RATE_APP);
|
||||||
status.sSettingIsAppRated = true;
|
status.sSettingIsAppRated = true;
|
||||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.PROXY_IS_APP_RATED,true));
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.PROXY_IS_APP_RATED,true));
|
||||||
}
|
}
|
||||||
|
@ -191,24 +195,4 @@ public class settingController extends AppCompatActivity
|
||||||
helperMethod.openActivity(proxyStatusController.class, constants.CONST_LIST_HISTORY, this,true);
|
helperMethod.openActivity(proxyStatusController.class, constants.CONST_LIST_HISTORY, this,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Event Observer*/
|
|
||||||
|
|
||||||
public class settingViewCallback implements eventObserver.eventListener{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class settingModelCallback implements eventObserver.eventListener{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -7,6 +7,7 @@ public class settingHomeEnums
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum eHomeViewController {
|
public enum eHomeViewController {
|
||||||
|
M_INIT
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -2,7 +2,7 @@ package com.darkweb.genesissearchengine.appManager.settingManager.settingHomePag
|
||||||
|
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
|
|
||||||
class settingModel
|
class settingHomeModel
|
||||||
{
|
{
|
||||||
/*Variable Declaration*/
|
/*Variable Declaration*/
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ class settingModel
|
||||||
|
|
||||||
/*Initializations*/
|
/*Initializations*/
|
||||||
|
|
||||||
settingModel(eventObserver.eventListener mEvent){
|
settingHomeModel(eventObserver.eventListener mEvent){
|
||||||
this.mEvent = mEvent;
|
this.mEvent = mEvent;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,9 @@ import androidx.appcompat.app.AppCompatDelegate;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
class settingViewController
|
class settingHomeViewController
|
||||||
{
|
{
|
||||||
/*Private Variables*/
|
/*Private Variables*/
|
||||||
|
|
||||||
|
@ -19,7 +20,7 @@ class settingViewController
|
||||||
|
|
||||||
/*Initializations*/
|
/*Initializations*/
|
||||||
|
|
||||||
settingViewController(settingController mContext, eventObserver.eventListener mEvent)
|
settingHomeViewController(settingHomeController mContext, eventObserver.eventListener mEvent)
|
||||||
{
|
{
|
||||||
this.mEvent = mEvent;
|
this.mEvent = mEvent;
|
||||||
this.mContext = mContext;
|
this.mContext = mContext;
|
||||||
|
@ -43,4 +44,12 @@ class settingViewController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Object onTrigger(settingHomeEnums.eHomeViewController pCommands, List<Object> pData){
|
||||||
|
if(pCommands.equals(settingHomeEnums.eHomeViewController.M_INIT)){
|
||||||
|
initPostUI();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -2,9 +2,7 @@ package com.darkweb.genesissearchengine.appManager.tabManager;
|
||||||
|
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.WindowManager;
|
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
@ -19,18 +17,17 @@ import androidx.recyclerview.widget.SimpleItemAnimator;
|
||||||
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
||||||
import com.darkweb.genesissearchengine.appManager.homeManager.geckoSession;
|
import com.darkweb.genesissearchengine.appManager.homeManager.geckoSession;
|
||||||
import com.darkweb.genesissearchengine.appManager.homeManager.homeController;
|
import com.darkweb.genesissearchengine.appManager.homeManager.homeController;
|
||||||
import com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingController;
|
import com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingHomeController;
|
||||||
import com.darkweb.genesissearchengine.constants.constants;
|
import com.darkweb.genesissearchengine.constants.constants;
|
||||||
import com.darkweb.genesissearchengine.constants.keys;
|
import com.darkweb.genesissearchengine.constants.keys;
|
||||||
import com.darkweb.genesissearchengine.constants.status;
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
import com.darkweb.genesissearchengine.constants.strings;
|
|
||||||
import com.darkweb.genesissearchengine.dataManager.dataController;
|
import com.darkweb.genesissearchengine.dataManager.dataController;
|
||||||
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import com.google.android.gms.ads.AdSize;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -63,7 +60,7 @@ public class tabController extends AppCompatActivity
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState){
|
protected void onCreate(Bundle savedInstanceState){
|
||||||
pluginController.getInstance().onCreate(this);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.tab_view);
|
setContentView(R.layout.tab_view);
|
||||||
}
|
}
|
||||||
|
@ -83,7 +80,6 @@ public class tabController extends AppCompatActivity
|
||||||
mContextManager = activityContextManager.getInstance();
|
mContextManager = activityContextManager.getInstance();
|
||||||
mHomeController = activityContextManager.getInstance().getHomeController();
|
mHomeController = activityContextManager.getInstance().getHomeController();
|
||||||
mContextManager.setTabController(this);
|
mContextManager.setTabController(this);
|
||||||
pluginController.getInstance().logEvent(strings.EVENT_TAB_OPENED);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initializeViews(){
|
public void initializeViews(){
|
||||||
|
@ -247,14 +243,15 @@ public class tabController extends AppCompatActivity
|
||||||
}
|
}
|
||||||
else if(pView.getId() == R.id.pCloseTab){
|
else if(pView.getId() == R.id.pCloseTab){
|
||||||
mtabViewController.onTrigger(tabEnums.eTabViewCommands.M_DISMISS_MENU, null);
|
mtabViewController.onTrigger(tabEnums.eTabViewCommands.M_DISMISS_MENU, null);
|
||||||
for(int mCounter=0;mCounter<mListModel.getList().size();mCounter++){
|
int mCounterActual = mListModel.getList().size();
|
||||||
|
for(int mCounter=0;mCounterActual>0;mCounter++){
|
||||||
onInitRemoveView(mCounter, true);
|
onInitRemoveView(mCounter, true);
|
||||||
mCounter-=1;
|
mCounterActual -= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(pView.getId() == R.id.pOpenSetting){
|
else if(pView.getId() == R.id.pOpenSetting){
|
||||||
mtabViewController.onTrigger(tabEnums.eTabViewCommands.M_DISMISS_MENU, null);
|
mtabViewController.onTrigger(tabEnums.eTabViewCommands.M_DISMISS_MENU, null);
|
||||||
helperMethod.openActivity(settingController.class, constants.CONST_LIST_HISTORY, this,true);
|
helperMethod.openActivity(settingHomeController.class, constants.CONST_LIST_HISTORY, this,true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,6 +268,7 @@ public class tabController extends AppCompatActivity
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume()
|
||||||
{
|
{
|
||||||
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||||
activityContextManager.getInstance().setCurrentActivity(this);
|
activityContextManager.getInstance().setCurrentActivity(this);
|
||||||
status.sSettingIsAppPaused = false;
|
status.sSettingIsAppPaused = false;
|
||||||
activityContextManager.getInstance().onStack(this);
|
activityContextManager.getInstance().onStack(this);
|
||||||
|
|
|
@ -108,7 +108,7 @@ class tabViewController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onOpenTabMenu(View view) {
|
public void onOpenTabMenu(View view) {
|
||||||
onCloseTabMenu();
|
onCloseTabMenu();
|
||||||
LayoutInflater layoutInflater = (LayoutInflater) view.getContext().getSystemService(LAYOUT_INFLATER_SERVICE);
|
LayoutInflater layoutInflater = (LayoutInflater) view.getContext().getSystemService(LAYOUT_INFLATER_SERVICE);
|
||||||
@SuppressLint("InflateParams") final View mPopupView = layoutInflater.inflate(R.layout.tab_menu, null);
|
@SuppressLint("InflateParams") final View mPopupView = layoutInflater.inflate(R.layout.tab_menu, null);
|
||||||
|
|
|
@ -10,6 +10,9 @@ public class constants
|
||||||
public static final String CONST_SOFTWARE_URL = "https://boogle.store/search?q=softwares+tools&p_num=1&s_type=all&p_num=1&s_type=all";
|
public static final String CONST_SOFTWARE_URL = "https://boogle.store/search?q=softwares+tools&p_num=1&s_type=all&p_num=1&s_type=all";
|
||||||
public static final String CONST_SOFTWARE_FINANCE = "https://boogle.store/search?q=finance&p_num=1&s_type=all&p_num=1&s_type=all";
|
public static final String CONST_SOFTWARE_FINANCE = "https://boogle.store/search?q=finance&p_num=1&s_type=all&p_num=1&s_type=all";
|
||||||
public static final String CONST_COMMUNITIES = "https://boogle.store/search?q=news&p_num=1&s_type=all&p_num=1&s_type=all";
|
public static final String CONST_COMMUNITIES = "https://boogle.store/search?q=news&p_num=1&s_type=all&p_num=1&s_type=all";
|
||||||
|
public static final String CONST_MARKET_URL = "https://boogle.store/search?q=news&p_num=1&s_type=all&p_num=1&s_type=all";
|
||||||
|
public static final String CONST_SERVER = "https://drive.google.com/uc?export=download&id=1es7XOAWCktGGfSnJu_o8W4_LZuudjR-T";
|
||||||
|
public static final String CONST_PLAYSTORE_URL = "http://play.google.com/store/apps/details?id=com.darkweb.genesissearchengine";
|
||||||
|
|
||||||
/*URL CONSTANTS*/
|
/*URL CONSTANTS*/
|
||||||
|
|
||||||
|
@ -19,11 +22,9 @@ public class constants
|
||||||
public static final String CONST_GENESIS_HELP_URL_CACHE = "resource://android/assets/help/help.html";
|
public static final String CONST_GENESIS_HELP_URL_CACHE = "resource://android/assets/help/help.html";
|
||||||
public static final String CONST_GENESIS_HELP_URL = "https://boogle.store/help";
|
public static final String CONST_GENESIS_HELP_URL = "https://boogle.store/help";
|
||||||
public static final String CONST_GENESIS_HELP_URL_SUB = "boogle.store/help";
|
public static final String CONST_GENESIS_HELP_URL_SUB = "boogle.store/help";
|
||||||
public static final String CONST_GENESIS_UPDATE_URL = "https://boogle.store/manual?abi=";
|
|
||||||
public static final String CONST_PLAYSTORE_URL = "https://play.google.com/store/apps/details?id=com.darkweb.genesissearchengine";
|
|
||||||
public static final String CONST_BACKEND_GENESIS_URL = "https://boogle.store/search?q=$s&p_num=1&s_type=all";
|
public static final String CONST_BACKEND_GENESIS_URL = "https://boogle.store/search?q=$s&p_num=1&s_type=all";
|
||||||
public static final String CONST_BACKEND_GOOGLE_URL = "https://www.google.com/search?q=$s";
|
public static final String CONST_BACKEND_GOOGLE_URL = "https://www.google.com/search?q=$s";
|
||||||
public static final String CONST_BACKEND_DUCK_DUCK_GO_URL = "https://duckduckgo.com/q=$s";
|
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_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_BACKEND_WIKI_URL = "https://en.wikipedia.org/wiki/$s";
|
||||||
|
|
||||||
|
@ -39,15 +40,15 @@ public class constants
|
||||||
|
|
||||||
/*LOG CONSTANTS*/
|
/*LOG CONSTANTS*/
|
||||||
|
|
||||||
public static final String LOGS_DEFAULT_MESSAGE = "Genesis on standby at the moment";
|
public static final String CONST_LOGS_DEFAULT_MESSAGE = "Genesis on standby at the moment";
|
||||||
|
|
||||||
/*HISTORY CONSTANTS*/
|
/*HISTORY CONSTANTS*/
|
||||||
|
|
||||||
public static final String HISTORY_LOAD_MORE = "loading_more";
|
public static final String CONST_HISTORY_LOAD_MORE = "loading_more";
|
||||||
|
|
||||||
/*BOOKMARK CONSTANTS*/
|
/*BOOKMARK CONSTANTS*/
|
||||||
|
|
||||||
public static final String BOOKMARK_LOAD_MORE = "loading_more";
|
public static final String CONST_BOOKMARK_LOAD_MORE = "loading_more";
|
||||||
|
|
||||||
/*MENU CONSTANTS*/
|
/*MENU CONSTANTS*/
|
||||||
|
|
||||||
|
@ -61,14 +62,27 @@ public class constants
|
||||||
public static final int CONST_MAX_BOOKMARK_SIZE =500;
|
public static final int CONST_MAX_BOOKMARK_SIZE =500;
|
||||||
public static final String CONST_DATABASE_NAME ="genesis_dbase";
|
public static final String CONST_DATABASE_NAME ="genesis_dbase";
|
||||||
public static final String CONST_PERCENTAGE_SIGN ="%";
|
public static final String CONST_PERCENTAGE_SIGN ="%";
|
||||||
public static final String CONST_PERCENTAGE_SIGN_100 ="100%";
|
|
||||||
|
|
||||||
/*ADMOB CONSTANTS*/
|
|
||||||
|
|
||||||
public static final String CONST_ADMOB_KEY = "ca-app-pub-5074525529134731~2926711128";
|
|
||||||
|
|
||||||
/*ANALYTICS CONSTANTS*/
|
/*ANALYTICS CONSTANTS*/
|
||||||
|
|
||||||
public static final String CONST_UNIQUE_KEY_ID = "*PREF_UNIQUE_ID";
|
public static final String CONST_UNIQUE_KEY_ID = "*PREF_UNIQUE_ID";
|
||||||
|
|
||||||
|
/*Notification Manager*/
|
||||||
|
|
||||||
|
public static final String CONST_NOTIFICATION_ID_NAME = "NOTIFICATION:INDENTIFIER:1001";
|
||||||
|
public static final String CONST_NOTIFICATION_TITLE = "Genesis Browser";
|
||||||
|
public static final int CONST_NOTIFICATION_ID_VALUE = 1;
|
||||||
|
public static final int CONST_NOTIFICATION_REQUEST_CODE = 0;
|
||||||
|
|
||||||
|
/*Language CONSTANTS*/
|
||||||
|
|
||||||
|
public static final String CONST_LANGUAGE_DEFAULT_LANG = "default";
|
||||||
|
|
||||||
|
/*Helper CONSTANTS*/
|
||||||
|
|
||||||
|
public static final String CONST_HELP_MODEL_HEADER = "mHeader";
|
||||||
|
public static final String CONST_HELP_MODEL_DESCRIPTION = "mDescription";
|
||||||
|
public static final String CONST_HELP_MODEL_ICON = "mIcon";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ public class enums
|
||||||
on_verify_selected_url_menu,FINDER_RESULT_CALLBACK,
|
on_verify_selected_url_menu,FINDER_RESULT_CALLBACK,
|
||||||
welcome, reload,download_folder,
|
welcome, reload,download_folder,
|
||||||
url_triggered, url_triggered_new_tab,url_clear,fetch_favicon,url_clear_at,remove_from_database,is_empty,M_HOME_PAGE,M_PRELOAD_URL,ON_KEYBOARD_CLOSE,
|
url_triggered, url_triggered_new_tab,url_clear,fetch_favicon,url_clear_at,remove_from_database,is_empty,M_HOME_PAGE,M_PRELOAD_URL,ON_KEYBOARD_CLOSE,
|
||||||
on_close_sesson,on_long_press, on_full_screen,on_handle_external_intent,on_update_suggestion_url,progress_update,recheck_orbot,on_url_load,on_playstore_load,back_list_empty,start_proxy, ON_UPDATE_THEME,on_request_completed, on_update_history,on_update_suggestion,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
|
on_close_sesson,on_long_press, on_full_screen,on_handle_external_intent,on_update_suggestion_url,progress_update,recheck_orbot,on_url_load,on_playstore_load,back_list_empty,start_proxy, ON_UPDATE_THEME,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
|
||||||
}
|
}
|
||||||
|
|
||||||
/*General Enums*/
|
/*General Enums*/
|
||||||
|
@ -24,8 +24,4 @@ public class enums
|
||||||
public static final int M_IMAGE_LOADED_SUCCESSFULLY = 1;
|
public static final int M_IMAGE_LOADED_SUCCESSFULLY = 1;
|
||||||
public static final int M_IMAGE_LOADING_FAILED = 2;
|
public static final int M_IMAGE_LOADING_FAILED = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum eMessageEnums {
|
|
||||||
M_DATA_CLEARED, M_SECURE_CONNECTION, M_NOT_SUPPORTED, M_BRIDGE_MAIL, M_LONG_PRESS_WITH_LINK, M_LONG_PRESS_URL, M_LONG_PRESS_DOWNLOAD, M_START_ORBOT, M_DOWNLOAD_FILE, M_RATE_APP, M_REPORT_URL, M_CLEAR_BOOKMARK, M_CLEAR_HISTORY, M_BOOKMARK, M_RATE_SUCCESS, M_RATE_FAILURE, M_ABI_ERROR, M_WELCOME, M_CANCEL_WELCOME, M_APP_RATED, M_DOWNLOAD_FILE_MANUAL, M_OPEN_LINK_CURRENT_TAB, M_COPY_LINK, M_OPEN_LINK_NEW_TAB, M_CLEAR_TAB, M_CONNECT_VPN, M_IGNORE_ABI, M_RATE_APPLICATION
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -24,6 +24,7 @@ public class keys
|
||||||
/*Settings*/
|
/*Settings*/
|
||||||
|
|
||||||
public static final String SETTING_LANGUAGE = "LANGUAGE";
|
public static final String SETTING_LANGUAGE = "LANGUAGE";
|
||||||
|
public static final String SETTING_LANGUAGE_REGION = "LANGUAGE_REGION";
|
||||||
public static final String SETTING_SEARCH_ENGINE = "SEARCH_ENGINE";
|
public static final String SETTING_SEARCH_ENGINE = "SEARCH_ENGINE";
|
||||||
public static final String SETTING_FIRST_INSTALLED = "FIRST_INSTALLED";
|
public static final String SETTING_FIRST_INSTALLED = "FIRST_INSTALLED";
|
||||||
public static final String SETTING_JAVA_SCRIPT = "JAVA_SCRIPT";
|
public static final String SETTING_JAVA_SCRIPT = "JAVA_SCRIPT";
|
||||||
|
|
|
@ -21,6 +21,7 @@ public class status
|
||||||
public static String sSettingSearchStatus = constants.CONST_BACKEND_GENESIS_URL;
|
public static String sSettingSearchStatus = constants.CONST_BACKEND_GENESIS_URL;
|
||||||
public static String sSettingRedirectStatus = strings.GENERIC_EMPTY_STR;
|
public static String sSettingRedirectStatus = strings.GENERIC_EMPTY_STR;
|
||||||
public static String sSettingLanguage = "en";
|
public static String sSettingLanguage = "en";
|
||||||
|
public static String sSettingLanguageRegion = "Us";
|
||||||
|
|
||||||
public static boolean sSettingEnableZoom = true;
|
public static boolean sSettingEnableZoom = true;
|
||||||
public static boolean sSettingEnableVoiceInput = true;
|
public static boolean sSettingEnableVoiceInput = true;
|
||||||
|
@ -87,6 +88,7 @@ public class status
|
||||||
status.sSettingFontSize = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_FLOAT, Arrays.asList(keys.SETTING_FONT_SIZE,100));
|
status.sSettingFontSize = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_FLOAT, Arrays.asList(keys.SETTING_FONT_SIZE,100));
|
||||||
|
|
||||||
status.sSettingLanguage = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.SETTING_LANGUAGE,strings.SETTING_DEFAULT_LANGUAGE));
|
status.sSettingLanguage = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.SETTING_LANGUAGE,strings.SETTING_DEFAULT_LANGUAGE));
|
||||||
|
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.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.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.sBridgeNotificationManual = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_NOTIFICATION_STATUS,0));
|
||||||
|
|
|
@ -22,6 +22,7 @@ public class strings
|
||||||
/*Bookmark Manager*/
|
/*Bookmark Manager*/
|
||||||
public static final String BOOKMARK_CLEAR_BOOKMARK = "Clear Bookmark";
|
public static final String BOOKMARK_CLEAR_BOOKMARK = "Clear Bookmark";
|
||||||
public static final String BOOKMARK_NO_BOOKMARK_FOUND = "No Bookmark Found";
|
public static final String BOOKMARK_NO_BOOKMARK_FOUND = "No Bookmark Found";
|
||||||
|
public static final String BOOKMARK_DEFAULT_TITLE = "New Bookmark";
|
||||||
|
|
||||||
/*Bridge Manager*/
|
/*Bridge Manager*/
|
||||||
|
|
||||||
|
@ -34,34 +35,37 @@ public class strings
|
||||||
public static final String GENERIC_EMPTY_STR = "";
|
public static final String GENERIC_EMPTY_STR = "";
|
||||||
public static final String GENERIC_EMPTY_SPACE = " ";
|
public static final String GENERIC_EMPTY_SPACE = " ";
|
||||||
|
|
||||||
|
/*Language Manager*/
|
||||||
|
public static final String LANGUAGE_NOT_SUPPORTED = "not supported";
|
||||||
|
|
||||||
/*Settings Manager*/
|
/*Settings Manager*/
|
||||||
|
|
||||||
public static final String SETTING_CUSTOM_FONTS = "Custom Font";
|
|
||||||
public static final String SETTING_PERCENT_SIGN = "%";
|
|
||||||
public static final String SETTING_DEFAULT_LANGUAGE = "en";
|
public static final String SETTING_DEFAULT_LANGUAGE = "en";
|
||||||
public static final String SETTING_DEFAULT_NEW_TAB_URL = "about:blank";
|
public static final String SETTING_DEFAULT_LANGUAGE_REGION = "Us";
|
||||||
|
|
||||||
/*Home Manager*/
|
/*Home Manager*/
|
||||||
|
|
||||||
public static final String HOME_BLANK_PAGE = "about:blank";
|
public static final String HOME_BLANK_PAGE = "about:blank";
|
||||||
|
|
||||||
|
/*Message Manager*/
|
||||||
|
|
||||||
|
public static final String MESSAGE_PLAYSTORE_NOT_FOUND = "Playstore Not Found";
|
||||||
|
|
||||||
/*Events*/
|
/*Events*/
|
||||||
|
|
||||||
public static final String EVENT_APP_STARTED = "APP_STARTED";
|
/* public static final String EVENT_APP_STARTED = "APP_STARTED";
|
||||||
public static final String EVENT_SEARCH_SWITCH = "SEARCH_SWITCH";
|
public static final String EVENT_SETTINGS_OPENED = "SETTINGS_OPENED";
|
||||||
public static final String EVENT_SETTINGS_OPENED = "SETTINGS_OPENED";
|
public static final String EVENT_URL_BOOKMARKED = "URL_BOOKMARKED";
|
||||||
public static final String EVENT_URL_BOOKMARKED = "URL_BOOKMARKED";
|
public static final String EVENT_BOOKMARK_OPENED = "BOOKMARK_OPENED";
|
||||||
public static final String EVENT_BOOKMARK_OPENED = "BOOKMARK_OPENED";
|
public static final String EVENT_TAB_OPENED = "TAB_OPENED";
|
||||||
public static final String EVENT_TAB_OPENED = "TAB_OPENED";
|
public static final String EVENT_GATEWAY_OPENED = "GATEWAY_OPENED";
|
||||||
public static final String EVENT_GATEWAY_OPENED = "GATEWAY_OPENED";
|
public static final String EVENT_HISTORY_OPENED = "HISTORY_OPENED";
|
||||||
public static final String EVENT_HISTORY_OPENED = "HISTORY_OPENED";
|
public static final String EVENT_HISTORY_TRIGGERED = "HISTORY_TRIGGERED";
|
||||||
public static final String EVENT_HISTORY_TRIGGERED = "HISTORY_TRIGGERED";
|
public static final String EVENT_BOOKMARK_TRIGGERED = "BOOKMARK_TRIGGERED";
|
||||||
public static final String EVENT_BOOKMARK_TRIGGERED = "BOOKMARK_TRIGGERED";
|
public static final String EVENT_PAGE_OPENED_SUCCESS = "PAGE_OPENED_SUCCESS";
|
||||||
public static final String EVENT_TAB_TRIGGERED = "TAB_TRIGGERED";
|
public static final String EVENT_HOME_INVOKED = "HOME_INVOKED";
|
||||||
public static final String EVENT_PAGE_OPENED_SUCCESS = "PAGE_OPENED_SUCCESS";
|
public static final String EVENT_SEARCH_INVOKED = "SEARCH_INVOKED";
|
||||||
public static final String EVENT_HOME_INVOKED = "HOME_INVOKED";
|
public static final String EVENT_MENU_INVOKED = "MENU_INVOKED";
|
||||||
public static final String EVENT_SEARCH_INVOKED = "SEARCH_INVOKED";
|
public static final String EVENT_ON_BACK = "ON_BACK"; */
|
||||||
public static final String EVENT_MENU_INVOKED = "MENU_INVOKED";
|
|
||||||
public static final String EVENT_ON_BACK = "ON_BACK";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@ import com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkRowMod
|
||||||
import com.darkweb.genesissearchengine.appManager.databaseManager.databaseController;
|
import com.darkweb.genesissearchengine.appManager.databaseManager.databaseController;
|
||||||
import com.darkweb.genesissearchengine.appManager.historyManager.historyRowModel;
|
import com.darkweb.genesissearchengine.appManager.historyManager.historyRowModel;
|
||||||
import com.darkweb.genesissearchengine.constants.constants;
|
import com.darkweb.genesissearchengine.constants.constants;
|
||||||
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
|
import com.darkweb.genesissearchengine.constants.strings;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -43,7 +45,7 @@ public class bookmarkDataModel {
|
||||||
|
|
||||||
if(pTitle.equals(""))
|
if(pTitle.equals(""))
|
||||||
{
|
{
|
||||||
pTitle = "New_Bookmark"+autoval;
|
pTitle = strings.BOOKMARK_DEFAULT_TITLE+autoval;
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] params = new String[2];
|
String[] params = new String[2];
|
||||||
|
@ -73,11 +75,13 @@ public class bookmarkDataModel {
|
||||||
pQuery = pQuery.toLowerCase();
|
pQuery = pQuery.toLowerCase();
|
||||||
ArrayList<historyRowModel> mModel = new ArrayList<>();
|
ArrayList<historyRowModel> mModel = new ArrayList<>();
|
||||||
|
|
||||||
for(int count = 0; count<= mBookmarks.size()-1 && mBookmarks.size()<500; count++){
|
if(status.sSettingSearchHistory) {
|
||||||
if(mBookmarks.get(count).getHeader().toLowerCase().contains(pQuery)){
|
for (int count = 0; count <= mBookmarks.size() - 1 && mBookmarks.size() < 500; count++) {
|
||||||
mModel.add(0, new historyRowModel(mBookmarks.get(count).getHeader(),mBookmarks.get(count).getDescription(),-1));
|
if (mBookmarks.get(count).getHeader().toLowerCase().contains(pQuery)) {
|
||||||
}else if(mModel.size()>0 && mBookmarks.get(count).getDescription().toLowerCase().contains(pQuery)){
|
mModel.add(0, new historyRowModel(mBookmarks.get(count).getHeader(), mBookmarks.get(count).getDescription(), -1));
|
||||||
mModel.add(mModel.size()-1, new historyRowModel(mBookmarks.get(count).getHeader(),mBookmarks.get(count).getDescription(),-1));
|
} else if (mModel.size() > 0 && mBookmarks.get(count).getDescription().toLowerCase().contains(pQuery)) {
|
||||||
|
mModel.add(mModel.size() - 1, new historyRowModel(mBookmarks.get(count).getHeader(), mBookmarks.get(count).getDescription(), -1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mModel;
|
return mModel;
|
||||||
|
|
|
@ -150,19 +150,22 @@ public class historyDataModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<historyRowModel> getSuggestions(String pQuery, ArrayList<historyRowModel> pList){
|
public ArrayList<historyRowModel> getSuggestions(String pQuery, ArrayList<historyRowModel> pList){
|
||||||
|
|
||||||
String mQueryOriginal = pQuery;
|
String mQueryOriginal = pQuery;
|
||||||
pQuery = pQuery.toLowerCase();
|
if(status.sSettingSearchHistory){
|
||||||
for(int count = 0; count<= mHistory.size()-1 && mHistory.size()<500; count++){
|
pQuery = pQuery.toLowerCase();
|
||||||
historyRowModel mTempModel = null;
|
for(int count = 0; count<= mHistory.size()-1 && mHistory.size()<500; count++){
|
||||||
if(mHistory.get(count).getHeader().toLowerCase().contains(pQuery)){
|
historyRowModel mTempModel = null;
|
||||||
mTempModel = new historyRowModel(mHistory.get(count).getHeader(),mHistory.get(count).getDescription(),-1);
|
if(mHistory.get(count).getHeader().toLowerCase().contains(pQuery)){
|
||||||
if(!pList.contains(mTempModel)){
|
mTempModel = new historyRowModel(mHistory.get(count).getHeader(),mHistory.get(count).getDescription(),-1);
|
||||||
pList.add(mTempModel);
|
if(!pList.contains(mTempModel)){
|
||||||
}
|
pList.add(mTempModel);
|
||||||
}else if(mHistory.get(count).getDescription().toLowerCase().contains(pQuery)){
|
}
|
||||||
mTempModel = new historyRowModel(mHistory.get(count).getHeader(),mHistory.get(count).getDescription(),-1);
|
}else if(mHistory.get(count).getDescription().toLowerCase().contains(pQuery)){
|
||||||
if(!pList.contains(mTempModel)){
|
mTempModel = new historyRowModel(mHistory.get(count).getHeader(),mHistory.get(count).getDescription(),-1);
|
||||||
pList.add(mTempModel);
|
if(!pList.contains(mTempModel)){
|
||||||
|
pList.add(mTempModel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -180,10 +183,8 @@ public class historyDataModel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<String> mDuplicateHandler = new ArrayList<>();
|
|
||||||
|
|
||||||
|
|
||||||
/*Duplicate handler*/
|
/*Duplicate handler*/
|
||||||
|
ArrayList<String> mDuplicateHandler = new ArrayList<>();
|
||||||
for(int mCounter=0;mCounter<pList.size();mCounter++){
|
for(int mCounter=0;mCounter<pList.size();mCounter++){
|
||||||
if(mDuplicateHandler.contains(pList.get(mCounter).getDescription())){
|
if(mDuplicateHandler.contains(pList.get(mCounter).getDescription())){
|
||||||
pList.remove(mCounter);
|
pList.remove(mCounter);
|
||||||
|
@ -193,12 +194,24 @@ public class historyDataModel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!pQuery.equals(strings.GENERIC_EMPTY_STR) && !pQuery.equals("about:blank")){
|
if(!pQuery.equals(strings.GENERIC_EMPTY_STR) && !pQuery.equals("about:blank") && !pQuery.contains("?") && !pQuery.contains("/") && !pQuery.contains(" ") && !pQuery.contains(" ") && !pQuery.contains("\n")){
|
||||||
if(pList.size()<3){
|
if(pList.size()<3){
|
||||||
pList.add( 0,new historyRowModel(mQueryOriginal+".com", strings.GENERIC_EMPTY_STR,-1));
|
int sepPos = pQuery.indexOf(".");
|
||||||
pList.add( 0,new historyRowModel(mQueryOriginal+".onion", strings.GENERIC_EMPTY_STR,-1));
|
if (sepPos == -1) {
|
||||||
|
pList.add( 0,new historyRowModel(mQueryOriginal+".com", strings.GENERIC_EMPTY_STR,-1));
|
||||||
|
pList.add( 0,new historyRowModel(mQueryOriginal+".onion", strings.GENERIC_EMPTY_STR,-1));
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
if(!pQuery.equals(pQuery.substring(0,sepPos)+".com")){
|
||||||
|
pList.add( 0,new historyRowModel(pQuery.substring(0,sepPos)+".com", strings.GENERIC_EMPTY_STR,-1));
|
||||||
|
}
|
||||||
|
if(!pQuery.equals(pQuery.substring(0,sepPos)+".onion")){
|
||||||
|
pList.add( 0,new historyRowModel(pQuery.substring(0,sepPos)+".onion", strings.GENERIC_EMPTY_STR,-1));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pList.add( 0,new historyRowModel(mQueryOriginal, strings.GENERIC_EMPTY_STR,-1));
|
pList.add( 0,new historyRowModel(mQueryOriginal, strings.GENERIC_EMPTY_STR,-1));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return pList;
|
return pList;
|
||||||
|
|
|
@ -59,9 +59,11 @@ class tabDataModel
|
||||||
void clearTab() {
|
void clearTab() {
|
||||||
int size = mTabs.size();
|
int size = mTabs.size();
|
||||||
for(int counter = 0; counter< size; counter++){
|
for(int counter = 0; counter< size; counter++){
|
||||||
mTabs.get(0).getSession().stop();
|
if(mTabs.size()>0){
|
||||||
mTabs.get(0).getSession().closeSession();
|
mTabs.get(0).getSession().stop();
|
||||||
mTabs.remove(0);
|
mTabs.get(0).getSession().closeSession();
|
||||||
|
mTabs.remove(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(mTabs.size()>0){
|
if(mTabs.size()>0){
|
||||||
mTabs.get(0).getSession().closeSession();
|
mTabs.get(0).getSession().closeSession();
|
||||||
|
|
|
@ -21,19 +21,6 @@ public class LocaleManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onResume(Activity activity) {
|
public void onResume(Activity activity) {
|
||||||
// If the activity has the incorrect locale, restart it
|
|
||||||
//if (!currentLocale.equals(getSelectedLocale(activity))) {
|
|
||||||
//Intent intent = activity.getIntent();
|
|
||||||
//activity.finish();
|
|
||||||
//activity.overridePendingTransition(0, 0);
|
|
||||||
//activity.startActivity(intent);
|
|
||||||
//activity.overridePendingTransition(0, 0);
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateServiceLocale(Service service) {
|
|
||||||
currentLocale = getSelectedLocale(service);
|
|
||||||
setContextLocale(service, currentLocale);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Locale getSelectedLocale(Context context) {
|
private static Locale getSelectedLocale(Context context) {
|
||||||
|
|
|
@ -54,6 +54,7 @@ import javax.net.ssl.HttpsURLConnection;
|
||||||
import static android.content.Context.LAYOUT_INFLATER_SERVICE;
|
import static android.content.Context.LAYOUT_INFLATER_SERVICE;
|
||||||
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
|
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
|
||||||
import static android.content.Intent.FLAG_ACTIVITY_NO_ANIMATION;
|
import static android.content.Intent.FLAG_ACTIVITY_NO_ANIMATION;
|
||||||
|
import static com.darkweb.genesissearchengine.constants.constants.CONST_PLAYSTORE_URL;
|
||||||
|
|
||||||
public class helperMethod
|
public class helperMethod
|
||||||
{
|
{
|
||||||
|
@ -189,7 +190,7 @@ public class helperMethod
|
||||||
.setType("text/plain")
|
.setType("text/plain")
|
||||||
.setChooserTitle("Hi! Check out this Awesome App")
|
.setChooserTitle("Hi! Check out this Awesome App")
|
||||||
.setSubject("Hi! Check out this Awesome App")
|
.setSubject("Hi! Check out this Awesome App")
|
||||||
.setText("Genesis | Onion Search | http://play.google.com/store/apps/details?id=" + context.getPackageName())
|
.setText("Genesis | Onion Search | " + CONST_PLAYSTORE_URL)
|
||||||
.startChooser();
|
.startChooser();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,6 +286,53 @@ public class helperMethod
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String langaugeWithoutTranslation(String pLangauge) {
|
||||||
|
switch (pLangauge) {
|
||||||
|
case "en_US":
|
||||||
|
return "English (United States)";
|
||||||
|
case "de_DE":
|
||||||
|
return "German (Deutsche)";
|
||||||
|
case "ca_ES":
|
||||||
|
return "Catalan (Català)";
|
||||||
|
case "zh_CN":
|
||||||
|
return "Chinese (中文-中国)";
|
||||||
|
case "ch_CZ":
|
||||||
|
return "Czech (čeština)";
|
||||||
|
case "nl_NL":
|
||||||
|
return "Dutch (Netherland)";
|
||||||
|
case "fr_FR":
|
||||||
|
return "French (francaise)";
|
||||||
|
case "el_GR":
|
||||||
|
return "Greek (Ελληνικά)";
|
||||||
|
case "hu_HU":
|
||||||
|
return "Hungarian (Magyar)";
|
||||||
|
case "in_ID":
|
||||||
|
return "Indonesian (bahasa)";
|
||||||
|
case "it_IT":
|
||||||
|
return "Italian (Italiana)";
|
||||||
|
case "ja_JP":
|
||||||
|
return "Japanese (日本人)";
|
||||||
|
case "ko_KR":
|
||||||
|
return "Korean (韓国語)";
|
||||||
|
case "pt_PT":
|
||||||
|
return "Portuguese (Português)";
|
||||||
|
case "ro_RO":
|
||||||
|
return "Romanian (Română)";
|
||||||
|
case "ru_RU":
|
||||||
|
return "Russian (русский)";
|
||||||
|
case "th_TH":
|
||||||
|
return "Thai (ไทย)";
|
||||||
|
case "tr_TR":
|
||||||
|
return "Turkish (Türk)";
|
||||||
|
case "uk_UA":
|
||||||
|
return "Ukrainian (Український)";
|
||||||
|
case "vi_VN":
|
||||||
|
return "Vietnamese (Tiếng Việt)";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "Not Defined";
|
||||||
|
}
|
||||||
|
|
||||||
public static String capitalizeString(String string) {
|
public static String capitalizeString(String string) {
|
||||||
char[] chars = string.toLowerCase().toCharArray();
|
char[] chars = string.toLowerCase().toCharArray();
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package com.darkweb.genesissearchengine.pluginManager;
|
package com.darkweb.genesissearchengine.pluginManager;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import com.darkweb.genesissearchengine.constants.constants;
|
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.google.android.gms.ads.*;
|
import com.google.android.gms.ads.*;
|
||||||
|
import java.util.List;
|
||||||
import static com.darkweb.genesissearchengine.constants.status.sPaidStatus;
|
import static com.darkweb.genesissearchengine.constants.status.sPaidStatus;
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eAdManagerCallbacks.M_SHOW_LOADED_ADS;
|
||||||
|
|
||||||
class adManager
|
class adManager
|
||||||
{
|
{
|
||||||
|
@ -21,30 +21,40 @@ class adManager
|
||||||
|
|
||||||
/*Initializations*/
|
/*Initializations*/
|
||||||
|
|
||||||
adManager(AppCompatActivity app_context, eventObserver.eventListener event, AdView banner_ads) {
|
adManager(AppCompatActivity pAppContext, eventObserver.eventListener pEvent, AdView pBannerAds) {
|
||||||
this.mAppContext = app_context;
|
this.mAppContext = pAppContext;
|
||||||
this.mEvent = event;
|
this.mEvent = pEvent;
|
||||||
mBannerAds = banner_ads;
|
mBannerAds = pBannerAds;
|
||||||
}
|
}
|
||||||
|
|
||||||
void loadAds(){
|
private void initializeBannerAds(){
|
||||||
|
if(!sPaidStatus){
|
||||||
|
AdRequest request = new AdRequest.Builder().build();
|
||||||
|
mBannerAds.loadAd(request);
|
||||||
|
admobListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Local Helper Methods*/
|
||||||
|
|
||||||
|
private void loadAds(){
|
||||||
if(!sPaidStatus)
|
if(!sPaidStatus)
|
||||||
{
|
{
|
||||||
if (!bannerAdsLoading)
|
if (!bannerAdsLoading)
|
||||||
{
|
{
|
||||||
bannerAdsLoading = true;
|
bannerAdsLoading = true;
|
||||||
MobileAds.initialize(mAppContext, constants.CONST_ADMOB_KEY);
|
MobileAds.initialize(mAppContext, initializationStatus -> { });
|
||||||
mBannerAds.setAlpha(0f);
|
mBannerAds.setAlpha(0f);
|
||||||
initializeBannerAds();
|
initializeBannerAds();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isAdvertLoaded(){
|
private boolean isAdvertLoaded(){
|
||||||
return bannerAdsLoaded;
|
return bannerAdsLoaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Local Helper Methods*/
|
/*Local Listeners*/
|
||||||
|
|
||||||
private void admobListeners(){
|
private void admobListeners(){
|
||||||
if(!sPaidStatus){
|
if(!sPaidStatus){
|
||||||
|
@ -52,11 +62,7 @@ class adManager
|
||||||
@Override
|
@Override
|
||||||
public void onAdLoaded() {
|
public void onAdLoaded() {
|
||||||
bannerAdsLoaded = true;
|
bannerAdsLoaded = true;
|
||||||
mEvent.invokeObserver(null,null);
|
mEvent.invokeObserver(null,M_SHOW_LOADED_ADS);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAdFailedToLoad(int errorCode) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -78,13 +84,17 @@ class adManager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*External Helper Methods*/
|
/*External Triggers*/
|
||||||
|
|
||||||
private void initializeBannerAds(){
|
Object onTrigger(List<Object> pData, pluginEnums.eAdManager pEventType) {
|
||||||
if(!sPaidStatus){
|
if(pEventType.equals(pluginEnums.eAdManager.M_INITIALIZE_BANNER_ADS))
|
||||||
AdRequest request = new AdRequest.Builder().build();
|
{
|
||||||
mBannerAds.loadAd(request);
|
loadAds();
|
||||||
admobListeners();
|
|
||||||
}
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eAdManager.M_IS_ADVERT_LOADED))
|
||||||
|
{
|
||||||
|
return isAdvertLoaded();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,57 +1,43 @@
|
||||||
package com.darkweb.genesissearchengine.pluginManager;
|
package com.darkweb.genesissearchengine.pluginManager;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import com.darkweb.genesissearchengine.constants.constants;
|
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
|
import com.flurry.android.FlurryAgent;
|
||||||
import java.util.UUID;
|
import java.util.List;
|
||||||
|
|
||||||
class analyticManager
|
class analyticManager
|
||||||
{
|
{
|
||||||
/*Private Variables */
|
/*Private Variables*/
|
||||||
|
|
||||||
private AppCompatActivity mAppContext;
|
private AppCompatActivity mAppContext;
|
||||||
private String mUniqueID = null;
|
|
||||||
|
|
||||||
/*Initializations*/
|
/*Initializations*/
|
||||||
|
|
||||||
analyticManager(AppCompatActivity app_context, eventObserver.eventListener event){
|
analyticManager(AppCompatActivity pAppContext, eventObserver.eventListener pEvent){
|
||||||
this.mAppContext = app_context;
|
this.mAppContext = pAppContext;
|
||||||
initialize();
|
initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initialize(){
|
private void initialize()
|
||||||
final String PREF_UNIQUE_ID = constants.CONST_UNIQUE_KEY_ID;
|
{
|
||||||
|
new FlurryAgent.Builder()
|
||||||
|
.withLogEnabled(true)
|
||||||
|
.build(mAppContext, "BKFSCH4CRS6RB9HSCM9H");
|
||||||
|
}
|
||||||
|
|
||||||
if (mUniqueID == null)
|
/*External Triggers*/
|
||||||
{
|
|
||||||
SharedPreferences sharedPrefs = mAppContext.getSharedPreferences(
|
|
||||||
PREF_UNIQUE_ID, Context.MODE_PRIVATE);
|
|
||||||
mUniqueID = sharedPrefs.getString(PREF_UNIQUE_ID, null);
|
|
||||||
if (mUniqueID == null) {
|
|
||||||
|
|
||||||
new Thread(){
|
private void logEvent(String pValue)
|
||||||
public void run(){
|
{
|
||||||
try{
|
if(FlurryAgent.isSessionActive()){
|
||||||
mUniqueID = UUID.randomUUID().toString();
|
FlurryAgent.logEvent(pValue);
|
||||||
}catch (Exception ex){
|
|
||||||
mUniqueID = UUID.randomUUID().toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
SharedPreferences.Editor editor = sharedPrefs.edit();
|
|
||||||
editor.putString(PREF_UNIQUE_ID, mUniqueID);
|
|
||||||
editor.apply();
|
|
||||||
}
|
|
||||||
}.start();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Helper Methods*/
|
void onTrigger(List<Object> pData, pluginEnums.eAnalyticManager pEventType) {
|
||||||
|
if(pEventType.equals(pluginEnums.eAnalyticManager.M_LOG_EVENT))
|
||||||
void logUser(){
|
{
|
||||||
|
//logEvent((String) pData.get(0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
package com.darkweb.genesissearchengine.pluginManager;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
|
||||||
|
|
||||||
class fabricManager
|
|
||||||
{
|
|
||||||
/*Private Variables*/
|
|
||||||
|
|
||||||
private AppCompatActivity mAppContext;
|
|
||||||
private eventObserver.eventListener mEvent;
|
|
||||||
|
|
||||||
/*Initializations*/
|
|
||||||
|
|
||||||
fabricManager(AppCompatActivity mAppContext, eventObserver.eventListener mEvent){
|
|
||||||
this.mAppContext = mAppContext;
|
|
||||||
this.mEvent = mEvent;
|
|
||||||
initialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initialize(){
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
package com.darkweb.genesissearchengine.pluginManager;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
|
||||||
import com.flurry.android.FlurryAgent;
|
|
||||||
|
|
||||||
class firebaseManager
|
|
||||||
{
|
|
||||||
/*Private Variables*/
|
|
||||||
|
|
||||||
private AppCompatActivity mAppContext;
|
|
||||||
|
|
||||||
/*Initializations*/
|
|
||||||
|
|
||||||
firebaseManager(AppCompatActivity app_context, eventObserver.eventListener event){
|
|
||||||
this.mAppContext = app_context;
|
|
||||||
initialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void initialize()
|
|
||||||
{
|
|
||||||
new FlurryAgent.Builder()
|
|
||||||
.withLogEnabled(true)
|
|
||||||
.build(mAppContext, "BKFSCH4CRS6RB9HSCM9H");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*Helper Methods*/
|
|
||||||
|
|
||||||
void logEvent(String value)
|
|
||||||
{
|
|
||||||
if(FlurryAgent.isSessionActive()){
|
|
||||||
FlurryAgent.logEvent(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
package com.darkweb.genesissearchengine.pluginManager;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
|
||||||
|
|
||||||
class helpManager
|
|
||||||
{
|
|
||||||
|
|
||||||
/*Private Variables */
|
|
||||||
|
|
||||||
private AppCompatActivity mAppContext;
|
|
||||||
private eventObserver.eventListener mEvent;
|
|
||||||
|
|
||||||
helpManager(AppCompatActivity app_context, eventObserver.eventListener event) {
|
|
||||||
this.mAppContext = app_context;
|
|
||||||
this.mEvent = event;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -2,54 +2,100 @@ package com.darkweb.genesissearchengine.pluginManager;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
|
import android.content.res.Resources;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import com.darkweb.genesissearchengine.helperManager.LocaleManager;
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
class langManager
|
class langManager {
|
||||||
{
|
|
||||||
/*Private Variables*/
|
/*Private Variables*/
|
||||||
|
|
||||||
private AppCompatActivity mAppContext;
|
private AppCompatActivity mAppContext;
|
||||||
private eventObserver.eventListener mEvent;
|
private eventObserver.eventListener mEvent;
|
||||||
private Locale language;
|
private Locale mLanguage;
|
||||||
private LocaleManager mLocaleManguage;
|
|
||||||
|
|
||||||
/*Initializations*/
|
/*Initializations*/
|
||||||
|
|
||||||
langManager(AppCompatActivity mAppContext, eventObserver.eventListener mEvent){
|
langManager(AppCompatActivity pAppContext, eventObserver.eventListener pEvent, Locale pLanguage) {
|
||||||
this.mAppContext = mAppContext;
|
this.mAppContext = pAppContext;
|
||||||
this.mEvent = mEvent;
|
this.mEvent = pEvent;
|
||||||
initialize();
|
this.mLanguage = pLanguage;
|
||||||
|
|
||||||
|
onInitLanguage(pAppContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initialize(){
|
private void onInitLanguage(AppCompatActivity pAppContext) {
|
||||||
mLocaleManguage = new LocaleManager();
|
if(status.sSettingLanguage.equals("default")){
|
||||||
|
if(mLanguage==null || !mLanguage.getLanguage().equals(Resources.getSystem().getConfiguration().locale.getLanguage()) || !mLanguage.getCountry().equals(Resources.getSystem().getConfiguration().locale.getCountry()))
|
||||||
|
{
|
||||||
|
Locale mSystemLocale = Resources.getSystem().getConfiguration().locale;
|
||||||
|
String mSystemLangugage = mSystemLocale.toString();
|
||||||
|
if(mSystemLangugage.equals("en_US") || mSystemLangugage.equals("de_DE") || mSystemLangugage.equals("ca_ES") || mSystemLangugage.equals("zh_CN") || mSystemLangugage.equals("ch_CZ") || mSystemLangugage.equals("nl_NL") || mSystemLangugage.equals("fr_FR") || mSystemLangugage.equals("el_GR") || mSystemLangugage.equals("hu_HU") || mSystemLangugage.equals("in_ID") || mSystemLangugage.equals("it_IT") || mSystemLangugage.equals("ja_JP") || mSystemLangugage.equals("ko_KR") || mSystemLangugage.equals("pt_PT") || mSystemLangugage.equals("ro_RO") || mSystemLangugage.equals("ru_RU") || mSystemLangugage.equals("th_TH") || mSystemLangugage.equals("tr_TR") || mSystemLangugage.equals("uk_UA") || mSystemLangugage.equals("vi_VN")){
|
||||||
|
mLanguage = new Locale(mSystemLocale.getLanguage(), mSystemLocale.getCountry());
|
||||||
|
}else {
|
||||||
|
mLanguage = new Locale("en", "Us");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
mLanguage = new Locale(status.sSettingLanguage, status.sSettingLanguageRegion);
|
||||||
|
}
|
||||||
|
|
||||||
|
Locale.setDefault(mLanguage);
|
||||||
|
Resources resources = pAppContext.getResources();
|
||||||
|
Configuration config = resources.getConfiguration();
|
||||||
|
config.setLocale(mLanguage);
|
||||||
|
resources.updateConfiguration(config, resources.getDisplayMetrics());
|
||||||
}
|
}
|
||||||
|
|
||||||
void setDefaultLanguage(Locale language){
|
/*Helper Methods*/
|
||||||
this.language = language;
|
|
||||||
onSaveLanguage();
|
private void onCreate(AppCompatActivity pActivity) {
|
||||||
|
onInitLanguage(pActivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onSaveLanguage(){
|
private void onResume(AppCompatActivity pActivity) {
|
||||||
Configuration configuration = mAppContext.getResources().getConfiguration();
|
onInitLanguage(pActivity);
|
||||||
configuration.locale = this.language;
|
|
||||||
mAppContext.getResources().updateConfiguration(
|
|
||||||
configuration,
|
|
||||||
mAppContext.getResources().getDisplayMetrics()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*External Locale Requrest Manager*/
|
private String getSupportedSystemLanguageInfo() {
|
||||||
|
if(status.sSettingLanguage.equals("default")){
|
||||||
public void onCreate(Activity activity) {
|
Locale mSystemLocale = Resources.getSystem().getConfiguration().locale;
|
||||||
mLocaleManguage.onCreate(activity);
|
String mSystemLangugage = mSystemLocale.toString();
|
||||||
|
if(mSystemLangugage.equals("en_US") || mSystemLangugage.equals("de_DE") || mSystemLangugage.equals("ca_ES") || mSystemLangugage.equals("zh_CN") || mSystemLangugage.equals("ch_CZ") || mSystemLangugage.equals("nl_NL") || mSystemLangugage.equals("fr_FR") || mSystemLangugage.equals("el_GR") || mSystemLangugage.equals("hu_HU") || mSystemLangugage.equals("in_ID") || mSystemLangugage.equals("it_IT") || mSystemLangugage.equals("ja_JP") || mSystemLangugage.equals("ko_KR") || mSystemLangugage.equals("pt_PT") || mSystemLangugage.equals("ro_RO") || mSystemLangugage.equals("ru_RU") || mSystemLangugage.equals("th_TH") || mSystemLangugage.equals("tr_TR") || mSystemLangugage.equals("uk_UA") || mSystemLangugage.equals("vi_VN")){
|
||||||
|
return "Default | " + mSystemLocale.getDisplayName();
|
||||||
|
}else {
|
||||||
|
return mSystemLocale.getDisplayName() + " | is unsupported";
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return mLanguage.getDisplayName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onResume(Activity activity) {
|
/*External Triggers*/
|
||||||
mLocaleManguage.onResume(activity);
|
|
||||||
|
Object onTrigger(List<Object> pData, pluginEnums.eLangManager pEventType) {
|
||||||
|
if(pEventType.equals(pluginEnums.eLangManager.M_ACTIVITY_CREATED))
|
||||||
|
{
|
||||||
|
onCreate((AppCompatActivity) pData.get(0));
|
||||||
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eLangManager.M_RESUME))
|
||||||
|
{
|
||||||
|
onResume((AppCompatActivity) pData.get(0));
|
||||||
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eLangManager.M_SET_LANGUAGE))
|
||||||
|
{
|
||||||
|
onInitLanguage((AppCompatActivity) pData.get(0));
|
||||||
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eLangManager.M_SUPPORTED_SYSTEM_LANGUAGE_INFO))
|
||||||
|
{
|
||||||
|
return getSupportedSystemLanguageInfo();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,8 +1,6 @@
|
||||||
package com.darkweb.genesissearchengine.pluginManager;
|
package com.darkweb.genesissearchengine.pluginManager;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
@ -13,142 +11,128 @@ import android.net.Uri;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.RatingBar;
|
import android.widget.RatingBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
|
|
||||||
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
||||||
import com.darkweb.genesissearchengine.constants.constants;
|
import com.darkweb.genesissearchengine.constants.constants;
|
||||||
import com.darkweb.genesissearchengine.constants.enums;
|
|
||||||
import com.darkweb.genesissearchengine.constants.status;
|
|
||||||
import com.darkweb.genesissearchengine.constants.strings;
|
import com.darkweb.genesissearchengine.constants.strings;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||||
|
|
||||||
import java.io.File;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.darkweb.genesissearchengine.constants.constants.*;
|
||||||
|
import static com.darkweb.genesissearchengine.constants.strings.MESSAGE_PLAYSTORE_NOT_FOUND;
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.*;
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManagerCallbacks.*;
|
||||||
|
|
||||||
class messageManager
|
class messageManager
|
||||||
{
|
{
|
||||||
/*Private Variables*/
|
/*Private Variables*/
|
||||||
|
|
||||||
private List<Object> data;
|
private List<Object> mData;
|
||||||
|
|
||||||
private AppCompatActivity mContext;
|
private AppCompatActivity mContext;
|
||||||
private eventObserver.eventListener event;
|
private eventObserver.eventListener mEvent;
|
||||||
|
private Dialog mDialog = null;
|
||||||
|
|
||||||
Dialog dialog = null;
|
|
||||||
|
|
||||||
/*Initializations*/
|
/*Initializations*/
|
||||||
|
|
||||||
private void initializeDialog(int pLayout, int pGravity){
|
private void initializeDialog(int pLayout, int pGravity){
|
||||||
if(dialog!=null && dialog.isShowing()){
|
if(mDialog !=null && mDialog.isShowing()){
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog = new Dialog(mContext);
|
mDialog = new Dialog(mContext);
|
||||||
dialog.getWindow().setGravity(pGravity);
|
mDialog.getWindow().setGravity(pGravity);
|
||||||
dialog.getWindow().getAttributes().windowAnimations = R.style.dialiog_animation;
|
mDialog.getWindow().getAttributes().windowAnimations = R.style.dialiog_animation;
|
||||||
|
|
||||||
Drawable myDrawable;
|
Drawable myDrawable;
|
||||||
Resources res = mContext.getResources();
|
Resources res = mContext.getResources();
|
||||||
try {
|
try {
|
||||||
myDrawable = Drawable.createFromXml(res, res.getXml(R.xml.hox_rounded_corner));
|
myDrawable = Drawable.createFromXml(res, res.getXml(R.xml.hox_rounded_corner));
|
||||||
dialog.getWindow().setBackgroundDrawable(myDrawable);
|
mDialog.getWindow().setBackgroundDrawable(myDrawable);
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.setCancelable(true);
|
mDialog.setCancelable(true);
|
||||||
dialog.setContentView(pLayout);
|
mDialog.setContentView(pLayout);
|
||||||
dialog.show();
|
|
||||||
|
ColorDrawable back = new ColorDrawable(Color.TRANSPARENT);
|
||||||
|
InsetDrawable inset = new InsetDrawable(back, helperMethod.pxFromDp(15),0,helperMethod.pxFromDp(15),0);
|
||||||
|
mDialog.getWindow().setBackgroundDrawable(inset);
|
||||||
|
mDialog.getWindow().setLayout(helperMethod.pxFromDp(350), -1);
|
||||||
|
mDialog.getWindow().setLayout(ConstraintLayout.LayoutParams.MATCH_PARENT, ConstraintLayout.LayoutParams.WRAP_CONTENT);
|
||||||
|
mDialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
messageManager(eventObserver.eventListener event)
|
messageManager(eventObserver.eventListener event)
|
||||||
{
|
{
|
||||||
this.event = event;
|
this.mEvent = event;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Helper Methods*/
|
/*Helper Methods*/
|
||||||
private void welcomeMessage()
|
private void welcomeMessage()
|
||||||
{
|
{
|
||||||
initializeDialog(R.layout.popup_welcome, Gravity.CENTER);
|
initializeDialog(R.layout.popup_welcome, Gravity.CENTER);
|
||||||
dialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(constants.CONST_BLACK_MARKET_URL), enums.eMessageEnums.M_WELCOME);
|
mEvent.invokeObserver(Collections.singletonList(constants.CONST_BLACK_MARKET_URL), M_OPEN_LINK_CURRENT_TAB);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
dialog.findViewById(R.id.pOption2).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption2).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(constants.CONST_LEAKED_DOCUMENT_URL), enums.eMessageEnums.M_WELCOME);
|
mEvent.invokeObserver(Collections.singletonList(constants.CONST_LEAKED_DOCUMENT_URL), M_OPEN_LINK_CURRENT_TAB);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
dialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(constants.CONST_NEWS_URL), enums.eMessageEnums.M_WELCOME);
|
mEvent.invokeObserver(Collections.singletonList(constants.CONST_NEWS_URL), M_OPEN_LINK_CURRENT_TAB);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
dialog.findViewById(R.id.pOption4).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption4).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(constants.CONST_SOFTWARE_URL), enums.eMessageEnums.M_WELCOME);
|
mEvent.invokeObserver(Collections.singletonList(constants.CONST_SOFTWARE_URL), M_OPEN_LINK_CURRENT_TAB);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
dialog.findViewById(R.id.pOption5).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption5).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(constants.CONST_SOFTWARE_FINANCE), enums.eMessageEnums.M_WELCOME);
|
mEvent.invokeObserver(Collections.singletonList(constants.CONST_SOFTWARE_FINANCE), M_OPEN_LINK_CURRENT_TAB);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
dialog.findViewById(R.id.pOption6).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption6).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(constants.CONST_COMMUNITIES), enums.eMessageEnums.M_WELCOME);
|
mEvent.invokeObserver(Collections.singletonList(constants.CONST_COMMUNITIES), M_OPEN_LINK_CURRENT_TAB);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
dialog.findViewById(R.id.pDontShowAgain).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pDontShowAgain).setOnClickListener(v -> {
|
||||||
event.invokeObserver(null, enums.eMessageEnums.M_CANCEL_WELCOME);
|
mEvent.invokeObserver(null, M_CANCEL_WELCOME);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("QueryPermissionsNeeded")
|
private void languageSupportFailure()
|
||||||
private void abiError()
|
|
||||||
{
|
{
|
||||||
initializeDialog(R.layout.popup_abi_error, Gravity.CENTER);
|
initializeDialog(R.layout.popup_language_support, Gravity.CENTER);
|
||||||
dialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
|
((TextView) mDialog.findViewById(R.id.pLanguage)).setText((mData.get(0).toString()));
|
||||||
dialog.dismiss();
|
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(constants.CONST_GENESIS_UPDATE_URL + status.sAppCurrentABI));
|
|
||||||
if(browserIntent.resolveActivity(mContext.getPackageManager()) != null)
|
|
||||||
{
|
|
||||||
mContext.startActivity(browserIntent);
|
|
||||||
}else {
|
|
||||||
helperMethod.showToastMessage("Not Supported", mContext);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
dialog.findViewById(R.id.pOption2).setOnClickListener(v -> {
|
|
||||||
dialog.dismiss();
|
|
||||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(constants.CONST_PLAYSTORE_URL));
|
|
||||||
if(browserIntent.resolveActivity(mContext.getPackageManager()) != null)
|
|
||||||
{
|
|
||||||
mContext.startActivity(browserIntent);
|
|
||||||
}else {
|
|
||||||
helperMethod.showToastMessage("Playstore Not Found", mContext);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void rateFailure()
|
private void rateFailure()
|
||||||
{
|
{
|
||||||
initializeDialog(R.layout.popup_rate_failure, Gravity.CENTER);
|
initializeDialog(R.layout.popup_rate_failure, Gravity.CENTER);
|
||||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
final Handler handler = new Handler();
|
final Handler handler = new Handler();
|
||||||
Runnable runnable = () -> {
|
Runnable runnable = () -> {
|
||||||
try{
|
try{
|
||||||
helperMethod.sendIssueEmail(mContext);
|
helperMethod.sendIssueEmail(mContext);
|
||||||
}
|
}
|
||||||
catch (Exception ex){
|
catch (Exception ex)
|
||||||
createMessage(mContext,Collections.singletonList(mContext.getString(R.string.ALERT_NOT_SUPPORTED_MESSAGE)),enums.eMessageEnums.M_NOT_SUPPORTED);
|
{
|
||||||
|
onTrigger(Arrays.asList(mContext, mContext.getString(R.string.ALERT_NOT_SUPPORTED_MESSAGE)),M_NOT_SUPPORTED);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
handler.postDelayed(runnable, 1000);
|
handler.postDelayed(runnable, 1000);
|
||||||
|
@ -157,303 +141,258 @@ class messageManager
|
||||||
|
|
||||||
private void reportedSuccessfully()
|
private void reportedSuccessfully()
|
||||||
{
|
{
|
||||||
initializeDialog(R.layout.popup_reported_successfully, Gravity.CENTER);
|
initializeDialog(R.layout.popup_reported_successfully, Gravity.BOTTOM);
|
||||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> dialog.dismiss());
|
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> mDialog.dismiss());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void notSupportMessage()
|
private void notSupportMessage()
|
||||||
{
|
{
|
||||||
initializeDialog(R.layout.popup_not_supported, Gravity.BOTTOM);
|
initializeDialog(R.layout.popup_not_supported, Gravity.BOTTOM);
|
||||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dataClearedSuccessfully()
|
private void dataClearedSuccessfully()
|
||||||
{
|
{
|
||||||
initializeDialog(R.layout.popup_data_cleared, Gravity.BOTTOM);
|
initializeDialog(R.layout.popup_data_cleared, Gravity.BOTTOM);
|
||||||
|
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||||
ColorDrawable back = new ColorDrawable(Color.TRANSPARENT);
|
|
||||||
InsetDrawable inset = new InsetDrawable(back, 0,0,0,helperMethod.pxFromDp(25));
|
|
||||||
dialog.getWindow().setBackgroundDrawable(inset);
|
|
||||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> dialog.dismiss());
|
|
||||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void openSecureConnectionPopup()
|
private void openSecureConnectionPopup()
|
||||||
{
|
{
|
||||||
initializeDialog(R.layout.secure_connection_popup, Gravity.TOP);
|
initializeDialog(R.layout.secure_connection_popup, Gravity.TOP);
|
||||||
Window window = dialog.getWindow();
|
Window window = mDialog.getWindow();
|
||||||
window.setLayout(ConstraintLayout.LayoutParams.MATCH_PARENT, ConstraintLayout.LayoutParams.WRAP_CONTENT);
|
window.setLayout(ConstraintLayout.LayoutParams.MATCH_PARENT, ConstraintLayout.LayoutParams.WRAP_CONTENT);
|
||||||
|
|
||||||
ColorDrawable back = new ColorDrawable(Color.TRANSPARENT);
|
ColorDrawable back = new ColorDrawable(Color.TRANSPARENT);
|
||||||
InsetDrawable inset = new InsetDrawable(back, 0,0,0,0);
|
InsetDrawable inset = new InsetDrawable(back, 0,0,0,0);
|
||||||
dialog.getWindow().setBackgroundDrawable(inset);
|
mDialog.getWindow().setBackgroundDrawable(inset);
|
||||||
dialog.setCancelable(true);
|
mDialog.setCancelable(true);
|
||||||
dialog.setCanceledOnTouchOutside(true);
|
mDialog.setCanceledOnTouchOutside(true);
|
||||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> { event.invokeObserver(null, enums.eMessageEnums.M_SECURE_CONNECTION); });
|
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> mEvent.invokeObserver(null, M_SECURE_CONNECTION));
|
||||||
|
|
||||||
String mJavascript = "| Disabled";
|
if((boolean) mData.get(1)){
|
||||||
String mDoNotTrack = "| Disabled";
|
((SwitchMaterial) mDialog.findViewById(R.id.pJSStatus)).setChecked(true);
|
||||||
String mTrackingProtection = "| Disabled";
|
|
||||||
|
|
||||||
if((boolean)data.get(1)){
|
|
||||||
((SwitchMaterial)dialog.findViewById(R.id.pJSStatus)).setChecked(true);
|
|
||||||
}else {
|
}else {
|
||||||
((SwitchMaterial)dialog.findViewById(R.id.pJSStatus)).setChecked(false);
|
((SwitchMaterial) mDialog.findViewById(R.id.pJSStatus)).setChecked(false);
|
||||||
}
|
}
|
||||||
if((boolean)data.get(2)){
|
if((boolean) mData.get(2)){
|
||||||
((SwitchMaterial)dialog.findViewById(R.id.pDTStatus)).setChecked(true);
|
((SwitchMaterial) mDialog.findViewById(R.id.pDTStatus)).setChecked(true);
|
||||||
}else {
|
}else {
|
||||||
((SwitchMaterial)dialog.findViewById(R.id.pDTStatus)).setChecked(false);
|
((SwitchMaterial) mDialog.findViewById(R.id.pDTStatus)).setChecked(false);
|
||||||
}
|
}
|
||||||
if((boolean)data.get(3)){
|
if((boolean) mData.get(3)){
|
||||||
((SwitchMaterial)dialog.findViewById(R.id.pTPStatus)).setChecked(true);
|
((SwitchMaterial) mDialog.findViewById(R.id.pTPStatus)).setChecked(true);
|
||||||
}else {
|
}else {
|
||||||
((SwitchMaterial)dialog.findViewById(R.id.pTPStatus)).setChecked(false);
|
((SwitchMaterial) mDialog.findViewById(R.id.pTPStatus)).setChecked(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
((TextView)dialog.findViewById(R.id.pHeaderSubpart)).setText(helperMethod.getDomainName(data.get(0).toString()));
|
((TextView) mDialog.findViewById(R.id.pHeaderSubpart)).setText(helperMethod.getDomainName(mData.get(0).toString()));
|
||||||
//((TextView)dialog.findViewById(R.id.pJSStatus)).setText(mJavascript);
|
|
||||||
//((TextView)dialog.findViewById(R.id.pDTStatus)).setText(mDoNotTrack);
|
|
||||||
//((TextView)dialog.findViewById(R.id.pTPStatus)).setText(mTrackingProtection);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("ResourceType")
|
|
||||||
private void bookmark()
|
private void bookmark()
|
||||||
{
|
{
|
||||||
initializeDialog(R.layout.popup_create_bookmark, Gravity.CENTER);
|
initializeDialog(R.layout.popup_create_bookmark, Gravity.CENTER);
|
||||||
EditText mBoomMarkTitle = dialog.findViewById(R.id.pBookmark);
|
mContext.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
|
||||||
dialog.setOnDismissListener(dialog -> {
|
|
||||||
|
mDialog.setOnShowListener(dialog -> mContext.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING));
|
||||||
|
mDialog.setOnDismissListener(dialog -> {
|
||||||
final Handler handler = new Handler();
|
final Handler handler = new Handler();
|
||||||
Runnable runnable = () -> {
|
Runnable runnable = () -> {
|
||||||
helperMethod.hideKeyboard(activityContextManager.getInstance().getHomeController());
|
helperMethod.hideKeyboard(activityContextManager.getInstance().getHomeController());
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
|
mContext.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||||
};
|
};
|
||||||
handler.postDelayed(runnable, 50);
|
handler.postDelayed(runnable, 50);
|
||||||
});
|
});
|
||||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> {
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
|
mContext.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||||
helperMethod.hideKeyboard(activityContextManager.getInstance().getHomeController());
|
helperMethod.hideKeyboard(activityContextManager.getInstance().getHomeController());
|
||||||
});
|
});
|
||||||
|
|
||||||
mBoomMarkTitle.requestFocus();
|
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||||
InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
|
mDialog.dismiss();
|
||||||
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
|
mContext.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||||
|
|
||||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
|
||||||
dialog.dismiss();
|
|
||||||
helperMethod.hideKeyboard(mContext);
|
helperMethod.hideKeyboard(mContext);
|
||||||
event.invokeObserver(Collections.singletonList(data.get(0).toString().replace("genesis.onion","boogle.store")+"split"+((EditText)dialog.findViewById(R.id.pBookmark)).getText().toString()), enums.eMessageEnums.M_BOOKMARK);
|
mEvent.invokeObserver(Collections.singletonList(mData.get(0).toString().replace("genesis.onion","boogle.store")+"split"+((EditText) mDialog.findViewById(R.id.pBookmark)).getText().toString()), M_BOOKMARK);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearHistory()
|
private void clearHistory()
|
||||||
{
|
{
|
||||||
initializeDialog(R.layout.popup_clear_history, Gravity.CENTER);
|
initializeDialog(R.layout.popup_clear_history, Gravity.CENTER);
|
||||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
event.invokeObserver(null, enums.eMessageEnums.M_CLEAR_HISTORY);
|
mEvent.invokeObserver(null, M_CLEAR_HISTORY);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearBookmark()
|
private void clearBookmark()
|
||||||
{
|
{
|
||||||
initializeDialog(R.layout.popup_clear_bookmark, Gravity.CENTER);
|
initializeDialog(R.layout.popup_clear_bookmark, Gravity.CENTER);
|
||||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
event.invokeObserver(null, enums.eMessageEnums.M_CLEAR_BOOKMARK);
|
mEvent.invokeObserver(null, M_CLEAR_BOOKMARK);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void reportURL()
|
private void reportURL()
|
||||||
{
|
{
|
||||||
initializeDialog(R.layout.popup_report_url, Gravity.CENTER);
|
initializeDialog(R.layout.popup_report_url, Gravity.CENTER);
|
||||||
((TextView)dialog.findViewById(R.id.pHeader)).setText(data.get(0).toString());
|
((TextView) mDialog.findViewById(R.id.pHeader)).setText(mData.get(0).toString());
|
||||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
final Handler handler = new Handler();
|
final Handler handler = new Handler();
|
||||||
Runnable runnable = () -> createMessage(mContext,Collections.singletonList(strings.GENERIC_EMPTY_STR), enums.eMessageEnums.M_RATE_SUCCESS);
|
Runnable runnable = () -> onTrigger(Arrays.asList(strings.GENERIC_EMPTY_STR, mContext),M_RATE_SUCCESS);
|
||||||
handler.postDelayed(runnable, 1000);
|
handler.postDelayed(runnable, 1000);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("QueryPermissionsNeeded")
|
|
||||||
private void rateApp()
|
private void rateApp()
|
||||||
{
|
{
|
||||||
initializeDialog(R.layout.popup_rate_us, Gravity.CENTER);
|
initializeDialog(R.layout.popup_rate_us, Gravity.CENTER);
|
||||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||||
RatingBar mRatingBar = dialog.findViewById(R.id.pRating);
|
RatingBar mRatingBar = mDialog.findViewById(R.id.pRating);
|
||||||
if(mRatingBar.getRating()>=3){
|
if(mRatingBar.getRating()>=3){
|
||||||
event.invokeObserver(null, enums.eMessageEnums.M_APP_RATED);
|
mEvent.invokeObserver(null, M_APP_RATED);
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.darkweb.genesissearchengine"));
|
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(CONST_PLAYSTORE_URL));
|
||||||
if(intent.resolveActivity(mContext.getPackageManager()) != null)
|
try {
|
||||||
{
|
|
||||||
mContext.startActivity(intent);
|
mContext.startActivity(intent);
|
||||||
}else {
|
} catch (Exception ignored) {
|
||||||
helperMethod.showToastMessage("Playstore Not Found", mContext);
|
helperMethod.showToastMessage(MESSAGE_PLAYSTORE_NOT_FOUND, mContext);
|
||||||
}
|
}
|
||||||
dialog.dismiss();
|
|
||||||
|
mDialog.dismiss();
|
||||||
}else if(mRatingBar.getRating()>0) {
|
}else if(mRatingBar.getRating()>0) {
|
||||||
event.invokeObserver(null, enums.eMessageEnums.M_APP_RATED);
|
mEvent.invokeObserver(null, M_APP_RATED);
|
||||||
final Handler handler = new Handler();
|
final Handler handler = new Handler();
|
||||||
handler.postDelayed(() -> createMessage(mContext,Collections.singletonList(strings.GENERIC_EMPTY_STR), enums.eMessageEnums.M_RATE_FAILURE), 1000);
|
handler.postDelayed(() -> onTrigger(Arrays.asList(strings.GENERIC_EMPTY_STR, mContext),M_RATE_FAILURE), 1000);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void downloadFile()
|
|
||||||
{
|
|
||||||
initializeDialog(R.layout.popup_download_file, Gravity.BOTTOM);
|
|
||||||
((TextView)dialog.findViewById(R.id.pDescription)).setText((mContext.getString(R.string.ALERT_DOWNLOAD_MESSAGE) + data.get(0)));
|
|
||||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint("ResourceAsColor")
|
|
||||||
private void downloadFileLongPress()
|
private void downloadFileLongPress()
|
||||||
{
|
{
|
||||||
File f = new File(data.get(0).toString());
|
String title = mData.get(2).toString();
|
||||||
String name = f.getName();
|
|
||||||
String title = data.get(1).toString();
|
|
||||||
|
|
||||||
int size = name.length();
|
if(title.length()>0){
|
||||||
if(size>235){
|
title = title + " | ";
|
||||||
size = 235;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initializeDialog(R.layout.popup_file_longpress, Gravity.CENTER);
|
initializeDialog(R.layout.popup_file_longpress, Gravity.CENTER);
|
||||||
((TextView)dialog.findViewById(R.id.pDescription)).setText((title + " | " + data.get(0).toString().substring(0,size)+"..."));
|
((TextView) mDialog.findViewById(R.id.pDescription)).setText((title + mData.get(0).toString()));
|
||||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||||
dialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_DOWNLOAD_FILE_MANUAL);
|
mEvent.invokeObserver(Collections.singletonList(mData.get(0)), M_DOWNLOAD_FILE_MANUAL);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
dialog.findViewById(R.id.pOption2).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption2).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_OPEN_LINK_CURRENT_TAB);
|
mEvent.invokeObserver(Collections.singletonList(mData.get(0)), M_OPEN_LINK_CURRENT_TAB);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
dialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_COPY_LINK);
|
mEvent.invokeObserver(Collections.singletonList(mData.get(0)), M_COPY_LINK);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
dialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_COPY_LINK);
|
mEvent.invokeObserver(Collections.singletonList(mData.get(0)), M_COPY_LINK);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openURLLongPress()
|
private void openURLLongPress()
|
||||||
{
|
{
|
||||||
int size = data.get(0).toString().length()-1;
|
String title = mData.get(2).toString();
|
||||||
String title = data.get(1).toString();
|
|
||||||
|
|
||||||
if(size>235){
|
|
||||||
size = 235;
|
|
||||||
}
|
|
||||||
|
|
||||||
initializeDialog(R.layout.popup_url_longpress, Gravity.CENTER);
|
initializeDialog(R.layout.popup_url_longpress, Gravity.CENTER);
|
||||||
((TextView)dialog.findViewById(R.id.pDescription)).setText((title + data.get(0).toString().substring(0,size)+"..."));
|
((TextView) mDialog.findViewById(R.id.pDescription)).setText((title + mData.get(0)));
|
||||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||||
dialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_OPEN_LINK_NEW_TAB);
|
mEvent.invokeObserver(Collections.singletonList(mData.get(0)), M_OPEN_LINK_NEW_TAB);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
dialog.findViewById(R.id.pOption2).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption2).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_OPEN_LINK_CURRENT_TAB);
|
mEvent.invokeObserver(Collections.singletonList(mData.get(0)), M_OPEN_LINK_CURRENT_TAB);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
dialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_COPY_LINK);
|
mEvent.invokeObserver(Collections.singletonList(mData.get(0)), M_COPY_LINK);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void popupDownloadFull(){
|
private void popupDownloadFull(){
|
||||||
String url = data.get(0).toString();
|
String url = mData.get(0).toString();
|
||||||
String file = data.get(1).toString();
|
String file = mData.get(2).toString();
|
||||||
String title = data.get(2).toString();
|
String title = mData.get(3).toString();
|
||||||
|
|
||||||
String data_local = mContext.getString(R.string.ALERT_LONG_URL_MESSAGE);
|
String data_local = mContext.getString(R.string.ALERT_LONG_URL_MESSAGE);
|
||||||
|
|
||||||
int size = url.length();
|
if(!url.equals(strings.GENERIC_EMPTY_STR)){
|
||||||
if(size>235){
|
data_local = title + url;
|
||||||
size = 235;
|
|
||||||
}
|
}
|
||||||
|
else if(!file.equals(strings.GENERIC_EMPTY_STR)){
|
||||||
int size1 = file.length();
|
data_local = file;
|
||||||
if(size1>235){
|
|
||||||
size1 = 235;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!url.equals("")){
|
|
||||||
data_local = title + url.substring(0,size)+"...";
|
|
||||||
}
|
|
||||||
else if(!file.equals("")){
|
|
||||||
data_local = file.substring(0,size1)+"...";
|
|
||||||
}
|
}
|
||||||
String mTitle = title;
|
String mTitle = title;
|
||||||
if(mTitle.length()<=1){
|
if(mTitle.length()<=1){
|
||||||
mTitle = data.get(0).toString().substring(0,size)+"...";
|
mTitle = mData.get(0).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
initializeDialog(R.layout.popup_download_full, Gravity.CENTER);
|
initializeDialog(R.layout.popup_download_full, Gravity.CENTER);
|
||||||
((TextView)dialog.findViewById(R.id.pHeader)).setText(mTitle);
|
((TextView) mDialog.findViewById(R.id.pHeader)).setText(mTitle);
|
||||||
((TextView)dialog.findViewById(R.id.pDescription)).setText((data_local));
|
((TextView) mDialog.findViewById(R.id.pDescription)).setText((data_local));
|
||||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||||
dialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_OPEN_LINK_NEW_TAB);
|
mEvent.invokeObserver(Collections.singletonList(url), M_OPEN_LINK_NEW_TAB);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
dialog.findViewById(R.id.pOption2).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption2).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_OPEN_LINK_CURRENT_TAB);
|
mEvent.invokeObserver(Collections.singletonList(url), M_OPEN_LINK_CURRENT_TAB);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
dialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_COPY_LINK);
|
mEvent.invokeObserver(Collections.singletonList(url), M_COPY_LINK);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
dialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption4).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_COPY_LINK);
|
mEvent.invokeObserver(Collections.singletonList(file), M_OPEN_LINK_NEW_TAB);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
dialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption5).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_COPY_LINK);
|
mEvent.invokeObserver(Collections.singletonList(file), M_OPEN_LINK_CURRENT_TAB);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
dialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption6).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_COPY_LINK);
|
mEvent.invokeObserver(Collections.singletonList(file), M_COPY_LINK);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
dialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pOption7).setOnClickListener(v -> {
|
||||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_COPY_LINK);
|
mEvent.invokeObserver(Collections.singletonList(file), M_DOWNLOAD_FILE_MANUAL);
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startingOrbotInfo()
|
|
||||||
{
|
|
||||||
initializeDialog(R.layout.popup_starting_orbot_info, Gravity.BOTTOM);
|
|
||||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void sendBridgeMail()
|
private void sendBridgeMail()
|
||||||
{
|
{
|
||||||
initializeDialog(R.layout.popup_bridge_mail, Gravity.CENTER);
|
initializeDialog(R.layout.popup_bridge_mail, Gravity.CENTER);
|
||||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
final Handler handler = new Handler();
|
final Handler handler = new Handler();
|
||||||
Runnable runnable = () -> {
|
Runnable runnable = () -> {
|
||||||
try{
|
try{
|
||||||
helperMethod.sendBridgeEmail(mContext);
|
helperMethod.sendBridgeEmail(mContext);
|
||||||
}
|
}
|
||||||
catch (Exception ex){
|
catch (Exception ex){
|
||||||
createMessage(mContext,Collections.singletonList(mContext.getString(R.string.ALERT_NOT_SUPPORTED_MESSAGE)),enums.eMessageEnums.M_NOT_SUPPORTED);
|
onTrigger(Arrays.asList(mContext, mContext.getString(R.string.ALERT_NOT_SUPPORTED_MESSAGE)),M_NOT_SUPPORTED);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
handler.postDelayed(runnable, 1000);
|
handler.postDelayed(runnable, 1000);
|
||||||
|
@ -461,91 +400,103 @@ class messageManager
|
||||||
}
|
}
|
||||||
|
|
||||||
void onReset(){
|
void onReset(){
|
||||||
if(dialog!=null){
|
if(mDialog !=null){
|
||||||
dialog.dismiss();
|
mDialog.dismiss();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*External Helper Methods*/
|
/*External Triggers*/
|
||||||
|
|
||||||
void createMessage(AppCompatActivity app_context, List<Object> data, enums.eMessageEnums type)
|
void onTrigger(List<Object> pData, pluginEnums.eMessageManager pEventType)
|
||||||
{
|
{
|
||||||
this.mContext = app_context;
|
if(pEventType.equals(pluginEnums.eMessageManager.M_RESET)){
|
||||||
this.data = data;
|
onReset();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.mContext = (AppCompatActivity) pData.get(pData.size()-1);
|
||||||
|
this.mData = pData;
|
||||||
|
|
||||||
switch (type)
|
switch (pEventType) {
|
||||||
{
|
case M_WELCOME:
|
||||||
case M_WELCOME:
|
/*VERIFIED*/
|
||||||
welcomeMessage();
|
welcomeMessage();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case M_ABI_ERROR:
|
case M_RATE_FAILURE:
|
||||||
abiError();
|
/*VERIFIED*/
|
||||||
break;
|
rateFailure();
|
||||||
|
break;
|
||||||
|
|
||||||
case M_RATE_FAILURE:
|
case M_LANGUAGE_SUPPORT_FAILURE:
|
||||||
rateFailure();
|
/*VERIFIED*/
|
||||||
break;
|
languageSupportFailure();
|
||||||
|
break;
|
||||||
|
|
||||||
case M_RATE_SUCCESS:
|
case M_RATE_SUCCESS:
|
||||||
reportedSuccessfully();
|
/*VERIFIED*/
|
||||||
break;
|
reportedSuccessfully();
|
||||||
|
break;
|
||||||
|
|
||||||
case M_BOOKMARK:
|
case M_BOOKMARK:
|
||||||
bookmark();
|
/*VERIFIED*/
|
||||||
break;
|
bookmark();
|
||||||
|
break;
|
||||||
|
|
||||||
case M_CLEAR_HISTORY:
|
case M_CLEAR_HISTORY:
|
||||||
clearHistory();
|
/*VERIFIED*/
|
||||||
break;
|
clearHistory();
|
||||||
|
break;
|
||||||
|
|
||||||
case M_CLEAR_BOOKMARK:
|
case M_CLEAR_BOOKMARK:
|
||||||
clearBookmark();
|
/*VERIFIED*/
|
||||||
break;
|
clearBookmark();
|
||||||
|
break;
|
||||||
|
|
||||||
case M_REPORT_URL:
|
case M_REPORT_URL:
|
||||||
reportURL();
|
/*VERIFIED*/
|
||||||
break;
|
reportURL();
|
||||||
|
break;
|
||||||
|
|
||||||
case M_RATE_APP:
|
case M_RATE_APP:
|
||||||
rateApp();
|
/*VERIFIED*/
|
||||||
break;
|
rateApp();
|
||||||
|
break;
|
||||||
|
|
||||||
case M_DOWNLOAD_FILE:
|
case M_LONG_PRESS_DOWNLOAD:
|
||||||
downloadFile();
|
/*VERIFIED*/
|
||||||
break;
|
downloadFileLongPress();
|
||||||
|
break;
|
||||||
|
|
||||||
case M_START_ORBOT:
|
case M_LONG_PRESS_URL:
|
||||||
startingOrbotInfo();
|
/*VERIFIED*/
|
||||||
break;
|
openURLLongPress();
|
||||||
|
break;
|
||||||
|
|
||||||
case M_LONG_PRESS_DOWNLOAD:
|
case M_LONG_PRESS_WITH_LINK:
|
||||||
downloadFileLongPress();
|
/*VERIFIED*/
|
||||||
break;
|
popupDownloadFull();
|
||||||
|
break;
|
||||||
|
|
||||||
case M_LONG_PRESS_URL:
|
case M_BRIDGE_MAIL:
|
||||||
openURLLongPress();
|
/*VERIFIED*/
|
||||||
break;
|
sendBridgeMail();
|
||||||
|
break;
|
||||||
|
|
||||||
case M_LONG_PRESS_WITH_LINK:
|
case M_NOT_SUPPORTED:
|
||||||
popupDownloadFull();
|
/*VERIFIED*/
|
||||||
break;
|
notSupportMessage();
|
||||||
|
break;
|
||||||
|
|
||||||
case M_BRIDGE_MAIL:
|
case M_DATA_CLEARED:
|
||||||
sendBridgeMail();
|
/*VERIFIED*/
|
||||||
break;
|
dataClearedSuccessfully();
|
||||||
|
break;
|
||||||
|
|
||||||
case M_NOT_SUPPORTED:
|
case M_SECURE_CONNECTION:
|
||||||
notSupportMessage();
|
/*VERIFIED*/
|
||||||
break;
|
openSecureConnectionPopup();
|
||||||
|
break;
|
||||||
case M_DATA_CLEARED:
|
}
|
||||||
dataClearedSuccessfully();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case M_SECURE_CONNECTION:
|
|
||||||
openSecureConnectionPopup();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,52 +9,67 @@ import android.content.Intent;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.core.app.NotificationCompat;
|
import androidx.core.app.NotificationCompat;
|
||||||
|
|
||||||
import com.darkweb.genesissearchengine.constants.status;
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.userEngagementNotification;
|
import com.darkweb.genesissearchengine.helperManager.userEngagementNotification;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
|
import java.util.List;
|
||||||
|
import static com.darkweb.genesissearchengine.constants.constants.*;
|
||||||
|
|
||||||
class notifictionManager
|
class notifictionManager
|
||||||
{
|
{
|
||||||
/*Private Variables*/
|
/*Private Variables*/
|
||||||
|
|
||||||
private AppCompatActivity mAppContext;
|
private AppCompatActivity mAppContext;
|
||||||
private NotificationManager mNotifManager;
|
|
||||||
|
|
||||||
/*Initializations*/
|
/*Initializations*/
|
||||||
|
|
||||||
notifictionManager(AppCompatActivity app_context, eventObserver.eventListener event){
|
notifictionManager(AppCompatActivity pAppContext, eventObserver.eventListener pEvent){
|
||||||
this.mAppContext = app_context;
|
this.mAppContext = pAppContext;
|
||||||
onNotificationClear();
|
onNotificationClear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onNotificationClear(){
|
private void onNotificationClear(){
|
||||||
NotificationManager notificationManager = (NotificationManager) mAppContext.getSystemService(Context.NOTIFICATION_SERVICE);
|
NotificationManager notificationManager = (NotificationManager) mAppContext.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
notificationManager.cancel(status.mNotificationID);
|
notificationManager.cancel(status.mNotificationID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCreateUserEngagementNotification(int pDelay){
|
private void onCreateUserEngagementNotification(int pDelay){
|
||||||
onSchedule(getNotification() , pDelay ) ;
|
onSchedule(getNotification() , pDelay ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSchedule(Notification notification , int delay){
|
private void onSchedule(Notification pNotification , int pDelay){
|
||||||
Intent notificationIntent = new Intent( mAppContext, userEngagementNotification.class) ;
|
Intent notificationIntent = new Intent( mAppContext, userEngagementNotification.class) ;
|
||||||
notificationIntent.putExtra("NOTIFICATION:INDENTIFIER:1001" , 1 ) ;
|
notificationIntent.putExtra(CONST_NOTIFICATION_ID_NAME, CONST_NOTIFICATION_ID_VALUE) ;
|
||||||
notificationIntent.putExtra("NOTIFICATION:INDENTIFIER:1001" , notification) ;
|
notificationIntent.putExtra(CONST_NOTIFICATION_ID_NAME, pNotification) ;
|
||||||
PendingIntent pendingIntent = PendingIntent. getBroadcast ( mAppContext, 0 , notificationIntent , PendingIntent. FLAG_UPDATE_CURRENT ) ;
|
PendingIntent pendingIntent = PendingIntent. getBroadcast ( mAppContext, CONST_NOTIFICATION_REQUEST_CODE, notificationIntent , PendingIntent. FLAG_UPDATE_CURRENT ) ;
|
||||||
long futureInMillis = SystemClock. elapsedRealtime () + delay ;
|
long futureInMillis = SystemClock. elapsedRealtime () + pDelay ;
|
||||||
AlarmManager alarmManager = (AlarmManager) mAppContext.getSystemService(Context. ALARM_SERVICE ) ;
|
AlarmManager alarmManager = (AlarmManager) mAppContext.getSystemService(Context. ALARM_SERVICE ) ;
|
||||||
assert alarmManager != null;
|
assert alarmManager != null;
|
||||||
alarmManager.set(AlarmManager. ELAPSED_REALTIME_WAKEUP , futureInMillis , pendingIntent) ;
|
alarmManager.set(AlarmManager. ELAPSED_REALTIME_WAKEUP , futureInMillis , pendingIntent) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Notification getNotification () {
|
private Notification getNotification () {
|
||||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(mAppContext, "NOTIFICATION:INDENTIFIER:1001") ;
|
NotificationCompat.Builder builder = new NotificationCompat.Builder(mAppContext, CONST_NOTIFICATION_ID_NAME) ;
|
||||||
builder.setContentTitle("Scheduled Notification") ;
|
builder.setContentTitle(CONST_NOTIFICATION_TITLE) ;
|
||||||
builder.setSmallIcon(R.drawable.notification_logo);
|
builder.setSmallIcon(R.drawable.notification_logo);
|
||||||
builder.setAutoCancel(true) ;
|
builder.setAutoCancel(true) ;
|
||||||
builder.setChannelId("NOTIFICATION:INDENTIFIER:1001") ;
|
builder.setChannelId(CONST_NOTIFICATION_ID_NAME) ;
|
||||||
return builder.build() ;
|
return builder.build() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*External Triggers*/
|
||||||
|
|
||||||
|
Object onTrigger(List<Object> pData, pluginEnums.eNotificationManager pEventType) {
|
||||||
|
if(pEventType.equals(pluginEnums.eNotificationManager.M_CREATE_NOTIFICATION))
|
||||||
|
{
|
||||||
|
onCreateUserEngagementNotification((int)pData.get(0));
|
||||||
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eNotificationManager.M_CLEAR_NOTIFICATION))
|
||||||
|
{
|
||||||
|
onNotificationClear();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,14 +8,9 @@ import org.mozilla.gecko.PrefsHelper;
|
||||||
import org.torproject.android.service.OrbotService;
|
import org.torproject.android.service.OrbotService;
|
||||||
import org.torproject.android.service.util.Prefs;
|
import org.torproject.android.service.util.Prefs;
|
||||||
import org.torproject.android.service.wrapper.orbotLocalConstants;
|
import org.torproject.android.service.wrapper.orbotLocalConstants;
|
||||||
import java.util.Arrays;
|
import java.util.List;
|
||||||
|
|
||||||
import com.darkweb.genesissearchengine.constants.*;
|
import com.darkweb.genesissearchengine.constants.*;
|
||||||
import com.darkweb.genesissearchengine.dataManager.dataController;
|
|
||||||
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
|
||||||
|
|
||||||
import static org.torproject.android.service.TorServiceConstants.ACTION_START;
|
import static org.torproject.android.service.TorServiceConstants.ACTION_START;
|
||||||
|
|
||||||
class orbotManager
|
class orbotManager
|
||||||
|
@ -34,57 +29,58 @@ class orbotManager
|
||||||
return sOurInstance;
|
return sOurInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initialize(AppCompatActivity app_context, eventObserver.eventListener event){
|
public void initialize(AppCompatActivity pAppContext, eventObserver.eventListener pEvent, int pNotificationStatus){
|
||||||
initNotification((Integer) dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_NOTIFICATION_STATUS,1)));
|
this.mAppContext = pAppContext;
|
||||||
|
onInitNotificationStatus(pNotificationStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
void startOrbot(Context context){
|
private void onStartOrbot(){
|
||||||
orbotLocalConstants.mBridges = status.sBridgeCustomBridge;
|
orbotLocalConstants.mBridges = status.sBridgeCustomBridge;
|
||||||
orbotLocalConstants.mIsManualBridge = status.sBridgeGatewayManual;
|
orbotLocalConstants.mIsManualBridge = status.sBridgeGatewayManual;
|
||||||
this.mAppContext = context;
|
|
||||||
Prefs.putBridgesEnabled(status.sBridgeGatewayManual |status.sBridgeGatewayAuto);
|
Prefs.putBridgesEnabled(status.sBridgeGatewayManual |status.sBridgeGatewayAuto);
|
||||||
Intent mServiceIntent = new Intent(context, OrbotService.class);
|
Intent mServiceIntent = new Intent(mAppContext, OrbotService.class);
|
||||||
mServiceIntent.setAction(ACTION_START);
|
mServiceIntent.setAction(ACTION_START);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
context.startForegroundService(mServiceIntent);
|
mAppContext.startForegroundService(mServiceIntent);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
context.startService(mServiceIntent);
|
mAppContext.startService(mServiceIntent);
|
||||||
}
|
}
|
||||||
initializeProxy();
|
initializeProxy();
|
||||||
}
|
}
|
||||||
|
|
||||||
int getNotificationStatus(){
|
/*Helper Methods*/
|
||||||
|
|
||||||
|
private int onGetNotificationStatus(){
|
||||||
return orbotLocalConstants.mNotificationStatus;
|
return orbotLocalConstants.mNotificationStatus;
|
||||||
}
|
}
|
||||||
void initNotification(int status){
|
private void onInitNotificationStatus(int status){
|
||||||
orbotLocalConstants.mNotificationStatus = status;
|
orbotLocalConstants.mNotificationStatus = status;
|
||||||
}
|
}
|
||||||
void enableTorNotification(){
|
private void onEnableTorNotification(){
|
||||||
OrbotService.getServiceObject().enableNotification();
|
OrbotService.getServiceObject().enableNotification();
|
||||||
}
|
}
|
||||||
void disableTorNotification(){
|
private void onDisableTorNotification(){
|
||||||
OrbotService.getServiceObject().disableNotification();
|
OrbotService.getServiceObject().disableNotification();
|
||||||
}
|
}
|
||||||
|
private void onEnableTorNotificationNoBandwidth(){
|
||||||
void enableTorNotificationNoBandwidth(){
|
|
||||||
OrbotService service = OrbotService.getServiceObject();
|
OrbotService service = OrbotService.getServiceObject();
|
||||||
if(service!=null){
|
if(service!=null){
|
||||||
OrbotService.getServiceObject().enableTorNotificationNoBandwidth();
|
OrbotService.getServiceObject().enableTorNotificationNoBandwidth();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateBridges(boolean p_status){
|
private void onUpdateBridges(boolean p_status){
|
||||||
Prefs.putBridgesEnabled(p_status);
|
Prefs.putBridgesEnabled(p_status);
|
||||||
}
|
}
|
||||||
public void updateVPN(boolean p_status){
|
private void onUpdateVPN(boolean p_status){
|
||||||
Prefs.putUseVpn(p_status);
|
Prefs.putUseVpn(p_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*------------------------------------------------------- POST TASK HANDLER -------------------------------------------------------*/
|
/*Proxy Manager*/
|
||||||
|
|
||||||
void setProxy(String url){
|
private void onSetProxy(String url){
|
||||||
if(url.contains("boogle.store")){
|
if(url.contains("boogle.store")){
|
||||||
PrefsHelper.setPref(keys.PROXY_TYPE, 0);
|
PrefsHelper.setPref(keys.PROXY_TYPE, 0);
|
||||||
PrefsHelper.setPref(keys.PROXY_SOCKS,null);
|
PrefsHelper.setPref(keys.PROXY_SOCKS,null);
|
||||||
|
@ -124,10 +120,10 @@ class orbotManager
|
||||||
PrefsHelper.setPref("browser.cache.memory.enable",true);
|
PrefsHelper.setPref("browser.cache.memory.enable",true);
|
||||||
PrefsHelper.setPref("browser.cache.disk.capacity",1000);
|
PrefsHelper.setPref("browser.cache.disk.capacity",1000);
|
||||||
|
|
||||||
setPrivacyPrefs();
|
onUpdatePrivacyPreferences();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPrivacyPrefs ()
|
private void onUpdatePrivacyPreferences()
|
||||||
{
|
{
|
||||||
PrefsHelper.setPref(keys.PROXY_IMAGE, status.sShowImages);
|
PrefsHelper.setPref(keys.PROXY_IMAGE, status.sShowImages);
|
||||||
PrefsHelper.setPref("browser.display.show_image_placeholders",true);
|
PrefsHelper.setPref("browser.display.show_image_placeholders",true);
|
||||||
|
@ -152,8 +148,9 @@ class orbotManager
|
||||||
PrefsHelper.setPref("media.peerconnection.enabled",false); //webrtc disabled
|
PrefsHelper.setPref("media.peerconnection.enabled",false); //webrtc disabled
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Log Manager*/
|
||||||
|
|
||||||
String getLogs()
|
private String getLogs()
|
||||||
{
|
{
|
||||||
String logs = orbotLocalConstants.mTorLogsStatus;
|
String logs = orbotLocalConstants.mTorLogsStatus;
|
||||||
|
|
||||||
|
@ -161,12 +158,6 @@ class orbotManager
|
||||||
logs = "Initializing Bootstrap";
|
logs = "Initializing Bootstrap";
|
||||||
mLogsStarted = true;
|
mLogsStarted = true;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
// logs = logs.replaceAll("[^a-zA-Z0-9%\\s+]", "");
|
|
||||||
// logs = helperMethod.capitalizeString(logs);
|
|
||||||
// logs = logs.replace("(","").replace(":","_FERROR_").replace("NOTICE","").replace(")","").replace("_FERROR_","");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(!logs.equals(strings.GENERIC_EMPTY_STR))
|
if(!logs.equals(strings.GENERIC_EMPTY_STR))
|
||||||
{
|
{
|
||||||
|
@ -177,11 +168,74 @@ class orbotManager
|
||||||
return "Loading Please Wait";
|
return "Loading Please Wait";
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isOrbotRunning(){
|
private boolean isOrbotRunning(){
|
||||||
return orbotLocalConstants.mIsTorInitialized;
|
return orbotLocalConstants.mIsTorInitialized;
|
||||||
}
|
}
|
||||||
|
|
||||||
String getOrbotStatus(){
|
private String getOrbotStatus(){
|
||||||
return orbotLocalConstants.mCurrentStatus;
|
return OrbotService.getServiceObject().getProxyStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*External Triggers*/
|
||||||
|
|
||||||
|
Object onTrigger(List<Object> pData, pluginEnums.eOrbotManager pEventType) {
|
||||||
|
if(pEventType.equals(pluginEnums.eOrbotManager.M_GET_NOTIFICATION_STATUS))
|
||||||
|
{
|
||||||
|
return onGetNotificationStatus();
|
||||||
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eOrbotManager.M_ENABLE_NOTIFICATION))
|
||||||
|
{
|
||||||
|
onEnableTorNotification();
|
||||||
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION))
|
||||||
|
{
|
||||||
|
onDisableTorNotification();
|
||||||
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION_NO_BANDWIDTH))
|
||||||
|
{
|
||||||
|
onEnableTorNotificationNoBandwidth();
|
||||||
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eOrbotManager.M_GET_LOGS))
|
||||||
|
{
|
||||||
|
return getLogs();
|
||||||
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eOrbotManager.M_UPDATE_PRIVACY))
|
||||||
|
{
|
||||||
|
onUpdatePrivacyPreferences();
|
||||||
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eOrbotManager.M_START_ORBOT))
|
||||||
|
{
|
||||||
|
onStartOrbot();
|
||||||
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eOrbotManager.M_IS_ORBOT_RUNNING))
|
||||||
|
{
|
||||||
|
isOrbotRunning();
|
||||||
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eOrbotManager.M_GET_ORBOT_STATUS))
|
||||||
|
{
|
||||||
|
return getOrbotStatus();
|
||||||
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eOrbotManager.M_UPDATE_VPN))
|
||||||
|
{
|
||||||
|
onUpdateVPN((boolean)pData.get(0));
|
||||||
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eOrbotManager.M_UPDATE_BRIDGES))
|
||||||
|
{
|
||||||
|
onUpdateBridges((boolean)pData.get(0));
|
||||||
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eOrbotManager.M_SET_PROXY))
|
||||||
|
{
|
||||||
|
onSetProxy((String)pData.get(0));
|
||||||
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eOrbotManager.M_SHOW_NOTIFICATION_STATUS))
|
||||||
|
{
|
||||||
|
onInitNotificationStatus((int)pData.get(0));
|
||||||
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eOrbotManager.M_ORBOT_RUNNING))
|
||||||
|
{
|
||||||
|
return isOrbotRunning();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package com.darkweb.genesissearchengine.pluginManager;
|
package com.darkweb.genesissearchengine.pluginManager;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
||||||
import com.darkweb.genesissearchengine.appManager.homeManager.homeController;
|
import com.darkweb.genesissearchengine.appManager.homeManager.homeController;
|
||||||
|
@ -10,7 +8,6 @@ import com.darkweb.genesissearchengine.constants.constants;
|
||||||
import com.darkweb.genesissearchengine.constants.enums;
|
import com.darkweb.genesissearchengine.constants.enums;
|
||||||
import com.darkweb.genesissearchengine.constants.keys;
|
import com.darkweb.genesissearchengine.constants.keys;
|
||||||
import com.darkweb.genesissearchengine.constants.status;
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
import com.darkweb.genesissearchengine.constants.strings;
|
|
||||||
import com.darkweb.genesissearchengine.dataManager.dataController;
|
import com.darkweb.genesissearchengine.dataManager.dataController;
|
||||||
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
|
@ -19,24 +16,27 @@ import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eAdManagerCallbacks.M_SHOW_LOADED_ADS;
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.*;
|
||||||
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManagerCallbacks.*;
|
||||||
|
|
||||||
public class pluginController
|
public class pluginController
|
||||||
{
|
{
|
||||||
/*Plugin Instance*/
|
/*Plugin Instance*/
|
||||||
|
|
||||||
private adManager mAdManager;
|
private adManager mAdManager;
|
||||||
private analyticManager mAnalyticManager;
|
private com.darkweb.genesissearchengine.pluginManager.analyticManager mAnalyticsManager;
|
||||||
private firebaseManager mFirebaseManager;
|
|
||||||
private messageManager mMessageManager;
|
private messageManager mMessageManager;
|
||||||
private notifictionManager mNotificationManager;
|
private notifictionManager mNotificationManager;
|
||||||
private activityContextManager mContextManager;
|
private activityContextManager mContextManager;
|
||||||
private langManager mLangManager;
|
private langManager mLangManager;
|
||||||
private boolean mIsInitialized = false;
|
private orbotManager mOrbotManager;
|
||||||
|
|
||||||
/*Private Variables*/
|
/*Private Variables*/
|
||||||
|
|
||||||
private static pluginController ourInstance = new pluginController();
|
private static pluginController ourInstance = new pluginController();
|
||||||
private homeController mHomeController;
|
private homeController mHomeController;
|
||||||
|
private boolean mIsInitialized = false;
|
||||||
|
|
||||||
/*Initializations*/
|
/*Initializations*/
|
||||||
|
|
||||||
|
@ -45,122 +45,36 @@ public class pluginController
|
||||||
return ourInstance;
|
return ourInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void preInitialize(homeController context){
|
||||||
|
mLangManager = new langManager(context,new langCallback(), new Locale(status.sSettingLanguage));
|
||||||
|
}
|
||||||
|
|
||||||
public void initialize(){
|
public void initialize(){
|
||||||
instanceObjectInitialization();
|
instanceObjectInitialization();
|
||||||
mIsInitialized = true;
|
mIsInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void preInitialize(homeController context){
|
|
||||||
mLangManager = new langManager(context,new langCallback());
|
|
||||||
mLangManager.setDefaultLanguage(new Locale(status.sSettingLanguage));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void instanceObjectInitialization()
|
private void instanceObjectInitialization()
|
||||||
{
|
{
|
||||||
mHomeController = activityContextManager.getInstance().getHomeController();
|
mHomeController = activityContextManager.getInstance().getHomeController();
|
||||||
mContextManager = activityContextManager.getInstance();
|
mContextManager = activityContextManager.getInstance();
|
||||||
|
|
||||||
mNotificationManager = new notifictionManager(getAppContext(),new notificationCallback());
|
mNotificationManager = new notifictionManager(mHomeController,new notificationCallback());
|
||||||
mAdManager = new adManager(getAppContext(),new admobCallback(), mHomeController.getBannerAd());
|
mAdManager = new adManager(mHomeController,new admobCallback(), mHomeController.getBannerAd());
|
||||||
mAnalyticManager = new analyticManager(getAppContext(),new analyticCallback());
|
mAnalyticsManager = new com.darkweb.genesissearchengine.pluginManager.analyticManager(mHomeController,new analyticManager());
|
||||||
mFirebaseManager = new firebaseManager(getAppContext(),new firebaseCallback());
|
|
||||||
mMessageManager = new messageManager(new messageCallback());
|
mMessageManager = new messageManager(new messageCallback());
|
||||||
}
|
mOrbotManager = orbotManager.getInstance();
|
||||||
|
|
||||||
public void initializeAllServices(AppCompatActivity context){
|
|
||||||
orbotManager.getInstance().initialize(context,new orbotCallback());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Helper Methods*/
|
/*Helper Methods*/
|
||||||
|
|
||||||
private AppCompatActivity getAppContext()
|
|
||||||
{
|
|
||||||
return mHomeController;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isInitialized(){
|
public boolean isInitialized(){
|
||||||
return mIsInitialized;
|
return mIsInitialized;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------- EXTERNAL REQUEST LISTENER-------------------------------------------------------*/
|
public void initializeAllServices(AppCompatActivity context){
|
||||||
|
int mNotificationStatus = (Integer) dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_NOTIFICATION_STATUS,1));
|
||||||
/*Message Manager*/
|
orbotManager.getInstance().initialize(context,new orbotCallback(), mNotificationStatus);
|
||||||
public void MessageManagerHandler(AppCompatActivity app_context,List<Object> data,enums.eMessageEnums type){
|
|
||||||
mMessageManager.createMessage(app_context,data,type);
|
|
||||||
}
|
|
||||||
public void onResetMessage(){
|
|
||||||
if(mMessageManager!=null){
|
|
||||||
mMessageManager.onReset();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*Notification Manager*/
|
|
||||||
public void onScheduleUserEngagementNotification(int pDelay){
|
|
||||||
if(mNotificationManager!=null){
|
|
||||||
mNotificationManager.onCreateUserEngagementNotification(pDelay);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void onClearUserEngagementNotification(){
|
|
||||||
if(mNotificationManager!=null){
|
|
||||||
mNotificationManager.onNotificationClear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*Firebase Manager*/
|
|
||||||
public void logEvent(String value){
|
|
||||||
if(mFirebaseManager!=null){
|
|
||||||
mFirebaseManager.logEvent(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*Ad Manager*/
|
|
||||||
public void initializeBannerAds(){
|
|
||||||
mAdManager.loadAds();
|
|
||||||
}
|
|
||||||
public boolean isAdvertLoaded(){
|
|
||||||
return mAdManager.isAdvertLoaded();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*Onion Proxy Manager*/
|
|
||||||
public void initializeOrbot(){
|
|
||||||
orbotManager.getInstance().startOrbot(getAppContext());
|
|
||||||
}
|
|
||||||
public boolean isOrbotRunning(){
|
|
||||||
return orbotManager.getInstance().isOrbotRunning();
|
|
||||||
}
|
|
||||||
public String getOrbotStatus(){
|
|
||||||
return orbotManager.getInstance().getOrbotStatus();
|
|
||||||
}
|
|
||||||
public void setProxy(String url){
|
|
||||||
orbotManager.getInstance().setProxy(url);
|
|
||||||
}
|
|
||||||
public void updatePrivacy(){
|
|
||||||
orbotManager.getInstance().setPrivacyPrefs();
|
|
||||||
}
|
|
||||||
public String orbotLogs(){
|
|
||||||
return orbotManager.getInstance().getLogs();
|
|
||||||
}
|
|
||||||
public void enableTorNotification(){
|
|
||||||
orbotManager.getInstance().enableTorNotification();
|
|
||||||
}
|
|
||||||
public void disableTorNotification(){
|
|
||||||
orbotManager.getInstance().disableTorNotification();
|
|
||||||
}
|
|
||||||
public void enableTorNotificationNoBandwidth(){
|
|
||||||
orbotManager.getInstance().enableTorNotificationNoBandwidth();
|
|
||||||
}
|
|
||||||
public void setNotificationStatus(int status){
|
|
||||||
orbotManager.getInstance().initNotification(status);
|
|
||||||
}
|
|
||||||
public int getNotificationStatus(){
|
|
||||||
return orbotManager.getInstance().getNotificationStatus();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateBridges(boolean p_status){
|
|
||||||
orbotManager.getInstance().updateBridges(p_status);
|
|
||||||
}
|
|
||||||
public void updateVPN(boolean p_status){
|
|
||||||
orbotManager.getInstance().updateVPN(p_status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*------------------------------------------------ CALLBACK LISTENERS------------------------------------------------------------*/
|
/*------------------------------------------------ CALLBACK LISTENERS------------------------------------------------------------*/
|
||||||
|
@ -170,29 +84,32 @@ public class pluginController
|
||||||
@Override
|
@Override
|
||||||
public Object invokeObserver(List<Object> data, Object event_type)
|
public Object invokeObserver(List<Object> data, Object event_type)
|
||||||
{
|
{
|
||||||
|
if(event_type.equals(M_SHOW_LOADED_ADS))
|
||||||
mHomeController.onSetBannerAdMargin();
|
mHomeController.onSetBannerAdMargin();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Object onAdsInvoke(List<Object> pData, pluginEnums.eAdManager pEventType){
|
||||||
|
if(mAdManager !=null){
|
||||||
|
return mAdManager.onTrigger(pData, pEventType);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*Analytics Manager*/
|
/*Analytics Manager*/
|
||||||
private class analyticCallback implements eventObserver.eventListener{
|
private class analyticManager implements eventObserver.eventListener{
|
||||||
@Override
|
@Override
|
||||||
public Object invokeObserver(List<Object> data, Object event_type)
|
public Object invokeObserver(List<Object> data, Object event_type) { return null; }
|
||||||
{
|
}
|
||||||
mAnalyticManager.logUser();
|
|
||||||
return null;
|
public void onAnalyticsInvoke(List<Object> pData, pluginEnums.eAnalyticManager pEventType){
|
||||||
|
if(mAnalyticsManager !=null){
|
||||||
|
mAnalyticsManager.onTrigger(pData, pEventType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Firebase Manager*/
|
|
||||||
private class firebaseCallback implements eventObserver.eventListener{
|
|
||||||
@Override
|
|
||||||
public Object invokeObserver(List<Object> data, Object event_type)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*Notification Manager*/
|
/*Notification Manager*/
|
||||||
private class notificationCallback implements eventObserver.eventListener{
|
private class notificationCallback implements eventObserver.eventListener{
|
||||||
|
@ -203,13 +120,11 @@ public class pluginController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Lang Manager*/
|
public Object onNotificationInvoke(List<Object> pData, pluginEnums.eNotificationManager pEventType){
|
||||||
private class langCallback implements eventObserver.eventListener{
|
if(mNotificationManager!=null){
|
||||||
@Override
|
return mNotificationManager.onTrigger(pData, pEventType);
|
||||||
public Object invokeObserver(List<Object> data, Object event_type)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Onion Proxy Manager*/
|
/*Onion Proxy Manager*/
|
||||||
|
@ -221,82 +136,93 @@ public class pluginController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Lang Manager*/
|
public Object onOrbotInvoke(List<Object> pData, pluginEnums.eOrbotManager pEventType){
|
||||||
public void setLanguage(){
|
if(mOrbotManager !=null){
|
||||||
mLangManager.setDefaultLanguage(new Locale(status.sSettingLanguage));
|
return mOrbotManager.onTrigger(pData, pEventType);
|
||||||
}
|
|
||||||
public void onCreate(Activity activity) {
|
|
||||||
if(activity==null && mLangManager!=null){
|
|
||||||
mLangManager.onCreate(activity);
|
|
||||||
}
|
}
|
||||||
}
|
return null;
|
||||||
public void onResume(Activity activity) {
|
|
||||||
mLangManager.onResume(activity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Message Manager*/
|
/*Lang Manager*/
|
||||||
private class messageCallback implements eventObserver.eventListener{
|
public Object onLanguageInvoke(List<Object> pData, pluginEnums.eLangManager pEventType){
|
||||||
|
return mLangManager.onTrigger(pData, pEventType);
|
||||||
|
}
|
||||||
|
|
||||||
|
private class langCallback implements eventObserver.eventListener{
|
||||||
@Override
|
@Override
|
||||||
public Object invokeObserver(List<Object> data, Object event_type)
|
public Object invokeObserver(List<Object> data, Object event_type)
|
||||||
{
|
{
|
||||||
if(event_type.equals(enums.etype.welcome))
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Message Manager*/
|
||||||
|
public void onMessageManagerInvoke(List<Object> pData, pluginEnums.eMessageManager pEventType){
|
||||||
|
mMessageManager.onTrigger(pData,pEventType);
|
||||||
|
}
|
||||||
|
|
||||||
|
private class messageCallback implements eventObserver.eventListener{
|
||||||
|
@Override
|
||||||
|
public Object invokeObserver(List<Object> pData, Object pEventType)
|
||||||
|
{
|
||||||
|
if(pEventType.equals(enums.etype.welcome))
|
||||||
{
|
{
|
||||||
mHomeController.onLoadURL(data.get(0).toString());
|
mHomeController.onLoadURL(pData.get(0).toString());
|
||||||
}
|
}
|
||||||
else if(event_type.equals(enums.eMessageEnums.M_SECURE_CONNECTION)){
|
else if(pEventType.equals(M_SECURE_CONNECTION)){
|
||||||
helperMethod.openActivity(settingPrivacyController.class, constants.CONST_LIST_HISTORY, mHomeController,true);
|
helperMethod.openActivity(settingPrivacyController.class, constants.CONST_LIST_HISTORY, mHomeController,true);
|
||||||
}
|
}
|
||||||
else if(event_type.equals(enums.eMessageEnums.M_CANCEL_WELCOME)){
|
else if(pEventType.equals(M_CANCEL_WELCOME)){
|
||||||
|
status.sSettingIsWelcomeEnabled = false;
|
||||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_IS_WELCOME_ENABLED,false));
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_IS_WELCOME_ENABLED,false));
|
||||||
}
|
}
|
||||||
else if(event_type.equals(enums.etype.reload)){
|
else if(pEventType.equals(enums.etype.reload)){
|
||||||
if(orbotManager.getInstance().isOrbotRunning())
|
if((Boolean) mOrbotManager.onTrigger(null, pluginEnums.eOrbotManager.M_IS_ORBOT_RUNNING))
|
||||||
{
|
{
|
||||||
mHomeController.onReload(null);
|
mHomeController.onReload(null);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mMessageManager.createMessage(mHomeController, Collections.singletonList(data.get(0).toString()),enums.eMessageEnums.M_START_ORBOT);
|
mMessageManager.onTrigger(Arrays.asList(mHomeController, Collections.singletonList(pData.get(0).toString())),M_START_ORBOT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(event_type.equals(enums.eMessageEnums.M_CLEAR_HISTORY)){
|
else if(pEventType.equals(M_CLEAR_HISTORY)){
|
||||||
dataController.getInstance().invokeHistory(dataEnums.eHistoryCommands.M_CLEAR_HISTORY ,null);
|
dataController.getInstance().invokeHistory(dataEnums.eHistoryCommands.M_CLEAR_HISTORY ,null);
|
||||||
mContextManager.getHistoryController().onclearData();
|
mContextManager.getHistoryController().onclearData();
|
||||||
mHomeController.onClearSession();
|
mHomeController.onClearSession();
|
||||||
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLEAR_TAB, null);
|
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLEAR_TAB, null);
|
||||||
mHomeController.initTab(false);
|
mHomeController.initTab(false);
|
||||||
}
|
}
|
||||||
else if(event_type.equals(enums.eMessageEnums.M_CLEAR_BOOKMARK)){
|
else if(pEventType.equals(M_CLEAR_BOOKMARK)){
|
||||||
dataController.getInstance().invokeBookmark(dataEnums.eBookmarkCommands.M_CLEAR_BOOKMARK ,data);
|
dataController.getInstance().invokeBookmark(dataEnums.eBookmarkCommands.M_CLEAR_BOOKMARK ,pData);
|
||||||
mContextManager.getBookmarkController().onclearData();
|
mContextManager.getBookmarkController().onclearData();
|
||||||
}
|
}
|
||||||
else if(event_type.equals(enums.eMessageEnums.M_BOOKMARK)){
|
else if(pEventType.equals(M_BOOKMARK)){
|
||||||
String [] dataParser = data.get(0).toString().split("split");
|
String [] dataParser = pData.get(0).toString().split("split");
|
||||||
if(dataParser.length>1){
|
if(dataParser.length>1){
|
||||||
logEvent(strings.EVENT_URL_BOOKMARKED);
|
|
||||||
dataController.getInstance().invokeBookmark(dataEnums.eBookmarkCommands.M_ADD_BOOKMARK ,Arrays.asList(dataParser[0],dataParser[1]));
|
dataController.getInstance().invokeBookmark(dataEnums.eBookmarkCommands.M_ADD_BOOKMARK ,Arrays.asList(dataParser[0],dataParser[1]));
|
||||||
}else {
|
}else {
|
||||||
dataController.getInstance().invokeBookmark(dataEnums.eBookmarkCommands.M_ADD_BOOKMARK ,Arrays.asList(dataParser[0],""));
|
dataController.getInstance().invokeBookmark(dataEnums.eBookmarkCommands.M_ADD_BOOKMARK ,Arrays.asList(dataParser[0],""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(event_type.equals(enums.eMessageEnums.M_APP_RATED)){
|
else if(pEventType.equals(M_APP_RATED)){
|
||||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.PROXY_IS_APP_RATED,true));
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.PROXY_IS_APP_RATED,true));
|
||||||
}
|
}
|
||||||
else if(event_type.equals(enums.eMessageEnums.M_DOWNLOAD_FILE)){
|
else if(pEventType.equals(M_DOWNLOAD_FILE)){
|
||||||
mHomeController.onDownloadFile();
|
mHomeController.onDownloadFile();
|
||||||
}
|
}
|
||||||
else if(event_type.equals(enums.eMessageEnums.M_DOWNLOAD_FILE_MANUAL)){
|
else if(pEventType.equals(M_DOWNLOAD_FILE_MANUAL)){
|
||||||
mHomeController.onManualDownload(data.get(0).toString());
|
mHomeController.onManualDownload(pData.get(0).toString());
|
||||||
}
|
}
|
||||||
else if(event_type.equals(enums.eMessageEnums.M_OPEN_LINK_NEW_TAB)){
|
else if(pEventType.equals(M_OPEN_LINK_NEW_TAB)){
|
||||||
mHomeController.onOpenLinkNewTab(data.get(0).toString());
|
mHomeController.onOpenLinkNewTab(pData.get(0).toString());
|
||||||
}
|
}
|
||||||
else if(event_type.equals(enums.eMessageEnums.M_OPEN_LINK_CURRENT_TAB)){
|
else if(pEventType.equals(M_OPEN_LINK_CURRENT_TAB)){
|
||||||
mHomeController.onLoadURL(data.get(0).toString());
|
mHomeController.onLoadURL(pData.get(0).toString());
|
||||||
}
|
}
|
||||||
else if(event_type.equals(enums.eMessageEnums.M_COPY_LINK)){
|
else if(pEventType.equals(M_COPY_LINK)){
|
||||||
helperMethod.copyURL(data.get(0).toString(),mContextManager.getHomeController());
|
helperMethod.copyURL(pData.get(0).toString(),mContextManager.getHomeController());
|
||||||
}
|
}
|
||||||
else if(event_type.equals(enums.eMessageEnums.M_CLEAR_TAB)){
|
else if(pEventType.equals(M_CLEAR_TAB)){
|
||||||
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLEAR_TAB, null);
|
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLEAR_TAB, null);
|
||||||
mHomeController.initTab(true);
|
mHomeController.initTab(true);
|
||||||
activityContextManager.getInstance().getTabController().finish();
|
activityContextManager.getInstance().getTabController().finish();
|
||||||
|
|
|
@ -2,4 +2,45 @@ package com.darkweb.genesissearchengine.pluginManager;
|
||||||
|
|
||||||
public class pluginEnums
|
public class pluginEnums
|
||||||
{
|
{
|
||||||
|
/*Advert Manager*/
|
||||||
|
public enum eAdManager {
|
||||||
|
M_INITIALIZE_BANNER_ADS, M_IS_ADVERT_LOADED
|
||||||
|
}
|
||||||
|
public enum eAdManagerCallbacks {
|
||||||
|
M_SHOW_LOADED_ADS
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*Analytics Manager*/
|
||||||
|
public enum eAnalyticManager {
|
||||||
|
M_LOG_EVENT
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*Lanuage Manager*/
|
||||||
|
public enum eLangManager{
|
||||||
|
M_SET_LANGUAGE, M_ACTIVITY_CREATED, M_RESUME, M_SUPPORTED_SYSTEM_LANGUAGE_INFO
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum eLangManagerCallbacks{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Message Manager*/
|
||||||
|
public enum eMessageManager{
|
||||||
|
M_RESET, M_DATA_CLEARED, M_SECURE_CONNECTION, M_NOT_SUPPORTED, M_BRIDGE_MAIL, M_LONG_PRESS_WITH_LINK, M_LONG_PRESS_URL, M_LONG_PRESS_DOWNLOAD, M_START_ORBOT, M_DOWNLOAD_FILE, M_RATE_APP, M_REPORT_URL, M_CLEAR_BOOKMARK, M_CLEAR_HISTORY, M_BOOKMARK, M_RATE_SUCCESS, M_RATE_FAILURE, M_LANGUAGE_SUPPORT_FAILURE, M_WELCOME
|
||||||
|
}
|
||||||
|
public enum eMessageManagerCallbacks{
|
||||||
|
M_CANCEL_WELCOME, M_APP_RATED, M_DOWNLOAD_FILE_MANUAL, M_OPEN_LINK_CURRENT_TAB, M_COPY_LINK, M_OPEN_LINK_NEW_TAB, M_CLEAR_TAB, M_RATE_APPLICATION
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Notification Manager*/
|
||||||
|
public enum eNotificationManager{
|
||||||
|
M_CREATE_NOTIFICATION, M_CLEAR_NOTIFICATION
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Orbot Manager*/
|
||||||
|
public enum eOrbotManager{
|
||||||
|
M_GET_NOTIFICATION_STATUS, M_ENABLE_NOTIFICATION, M_DISABLE_NOTIFICATION, M_DISABLE_NOTIFICATION_NO_BANDWIDTH, M_GET_LOGS, M_UPDATE_PRIVACY,M_START_ORBOT,M_IS_ORBOT_RUNNING, M_GET_ORBOT_STATUS, M_UPDATE_BRIDGES, M_UPDATE_VPN, M_SET_PROXY, M_SHOW_NOTIFICATION_STATUS, M_ORBOT_RUNNING
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:startOffset="200">
|
||||||
|
<alpha
|
||||||
|
android:duration="200"
|
||||||
|
android:fromAlpha="0.0"
|
||||||
|
android:interpolator="@android:anim/linear_interpolator"
|
||||||
|
android:toAlpha="1.0" />
|
||||||
|
</set>
|
|
@ -0,0 +1,7 @@
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<alpha
|
||||||
|
android:duration="200"
|
||||||
|
android:fromAlpha="1.0"
|
||||||
|
android:interpolator="@android:anim/linear_interpolator"
|
||||||
|
android:toAlpha="0.0" />
|
||||||
|
</set>
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@color/c_lang_row_border" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item android:left="5dp" >
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@color/c_lang_row" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="@color/c_ripple">
|
||||||
|
|
||||||
|
<!-- mask here... -->
|
||||||
|
<item android:id="@android:id/mask">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@color/button_gray" />
|
||||||
|
<corners android:radius="50dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<selector>
|
||||||
|
<item android:state_pressed="true"
|
||||||
|
android:top="113dp">
|
||||||
|
<shape
|
||||||
|
android:shape="rectangle" android:padding="10dp" >
|
||||||
|
<solid android:color="@color/c_edittext_background"/>
|
||||||
|
<corners android:radius="7dp"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item android:state_pressed="false"
|
||||||
|
android:top="113dp">
|
||||||
|
<shape
|
||||||
|
android:shape="rectangle" android:padding="10dp">
|
||||||
|
<solid android:color="@color/c_edittext_background"/>
|
||||||
|
<corners android:radius="7dp"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M9,16.2L4.8,12l-1.4,1.4L9,19 21,7l-1.4,-1.4L9,16.2z"/>
|
||||||
|
</vector>
|
|
@ -0,0 +1,10 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M17.65,6.35C16.2,4.9 14.21,4 12,4c-4.42,0 -7.99,3.58 -7.99,8s3.57,8 7.99,8c3.73,0 6.84,-2.55 7.73,-6h-2.08c-0.82,2.33 -3.04,4 -5.65,4 -3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6c1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z"/>
|
||||||
|
</vector>
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 723 B |
Before Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 109 KiB |
Before Width: | Height: | Size: 127 KiB |
Before Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 489 B |
After Width: | Height: | Size: 958 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.9 KiB |
|
@ -5,105 +5,4 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="330dp"
|
|
||||||
android:id="@+id/pMainLayout"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@xml/hox_rounded_corner"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="0.5"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/pHeader"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:paddingStart="15dp"
|
|
||||||
android:text="@string/ALERT_ABI_ERROR"
|
|
||||||
android:textAlignment="textStart"
|
|
||||||
android:textColor="@color/c_text_setting_heading_v2"
|
|
||||||
android:textSize="17sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/pDescription"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:justificationMode="inter_word"
|
|
||||||
android:alpha="0.6"
|
|
||||||
android:paddingEnd="15dp"
|
|
||||||
android:text="@string/ALERT_ABI_ERROR_INFO"
|
|
||||||
android:textAlignment="textStart"
|
|
||||||
android:paddingStart="15dp"
|
|
||||||
android:textSize="13sp"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
android:textColor="@color/c_text_v1"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/pHeader"
|
|
||||||
tools:ignore="SmallSp" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/pDivider"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginTop="35dp"
|
|
||||||
android:background="@color/c_view_divier_background"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/pDescription" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
android:weightSum="2"
|
|
||||||
android:id="@+id/pNavigationContainer"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/pDivider"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
<Button
|
|
||||||
android:id="@+id/pOption1"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@xml/ax_ripple_default_round_left"
|
|
||||||
android:padding="0dp"
|
|
||||||
android:text="@string/ALERT_LOCAL_UPGRADE"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="@color/c_button_text_v1"
|
|
||||||
android:textSize="15sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/pDividerHorizontal"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@color/c_view_divier_background"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/pRating" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/pOption2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@xml/ax_ripple_default_round_right"
|
|
||||||
android:padding="0dp"
|
|
||||||
android:text="@string/ALERT_PLAYSTORE_UPGRADE"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="@color/c_button_text_v1"
|
|
||||||
android:textSize="15sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -7,7 +7,7 @@ android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="330dp"
|
android:layout_width="match_parent"
|
||||||
android:id="@+id/pMainLayout"
|
android:id="@+id/pMainLayout"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@xml/hox_rounded_corner"
|
android:background="@xml/hox_rounded_corner"
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="300dp"
|
android:layout_width="match_parent"
|
||||||
android:id="@+id/pMainLayout"
|
android:id="@+id/pMainLayout"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@xml/hox_rounded_corner"
|
android:background="@xml/hox_rounded_corner"
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
android:id="@+id/pDivider"
|
android:id="@+id/pDivider"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:layout_marginTop="25dp"
|
android:layout_marginTop="35dp"
|
||||||
android:background="@color/c_view_divier_background"
|
android:background="@color/c_view_divier_background"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:padding="0dp"
|
android:padding="0dp"
|
||||||
android:background="@xml/ax_ripple_default_round_right"
|
android:background="@xml/ax_ripple_default_round_left"
|
||||||
android:textSize="15sp"
|
android:textSize="15sp"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
@ -93,7 +93,7 @@
|
||||||
android:textColor="@color/c_button_warning"
|
android:textColor="@color/c_button_warning"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@xml/ax_ripple_default_round_left"
|
android:background="@xml/ax_ripple_default_round_right"
|
||||||
android:padding="0dp"
|
android:padding="0dp"
|
||||||
android:textSize="15sp"
|
android:textSize="15sp"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="300dp"
|
android:layout_width="match_parent"
|
||||||
android:id="@+id/pMainLayout"
|
android:id="@+id/pMainLayout"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@xml/gx_rounded_corner_alert"
|
android:background="@xml/gx_rounded_corner_alert"
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
android:id="@+id/pDivider"
|
android:id="@+id/pDivider"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:layout_marginTop="25dp"
|
android:layout_marginTop="35dp"
|
||||||
android:background="@color/c_view_divier_background"
|
android:background="@color/c_view_divier_background"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/pMainLayout"
|
android:id="@+id/pMainLayout"
|
||||||
android:layout_width="300dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@xml/hox_rounded_corner"
|
android:background="@xml/hox_rounded_corner"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
@ -73,9 +73,9 @@
|
||||||
android:padding="7dp"
|
android:padding="7dp"
|
||||||
android:paddingStart="11dp"
|
android:paddingStart="11dp"
|
||||||
android:paddingEnd="8dp"
|
android:paddingEnd="8dp"
|
||||||
android:textColor="@color/text_color_v2"
|
android:textColor="@color/c_text_v1"
|
||||||
android:textColorHint="@color/text_color_v2"
|
android:textColorHighlight="@color/text_color_highlight_v3"
|
||||||
android:textColorHighlight="@color/text_color_highlight_v1"
|
android:textColorHint="@color/c_text_v2"
|
||||||
android:textCursorDrawable="@xml/gx_search_cursor_state"
|
android:textCursorDrawable="@xml/gx_search_cursor_state"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/pDivider"
|
app:layout_constraintEnd_toEndOf="@+id/pDivider"
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:id="@+id/pMainLayout"
|
android:id="@+id/pMainLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@xml/hox_rounded_corner"
|
android:background="@xml/hox_rounded_corner"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
@ -36,13 +36,13 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:alpha="0.6"
|
||||||
|
android:paddingStart="15dp"
|
||||||
android:paddingEnd="10dp"
|
android:paddingEnd="10dp"
|
||||||
android:text="@string/ALERT_DATA_CLEARED_INFO"
|
android:text="@string/ALERT_DATA_CLEARED_INFO"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:paddingStart="15dp"
|
|
||||||
android:textColor="@color/c_alert_text"
|
android:textColor="@color/c_alert_text"
|
||||||
android:textSize="13sp"
|
android:textSize="13sp"
|
||||||
android:alpha="0.6"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/pHeader"
|
app:layout_constraintTop_toBottomOf="@+id/pHeader"
|
||||||
|
@ -59,25 +59,27 @@
|
||||||
app:layout_constraintTop_toBottomOf="@+id/pDescription" />
|
app:layout_constraintTop_toBottomOf="@+id/pDescription" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
android:id="@+id/pNavigationContainer"
|
android:id="@+id/pNavigationContainer"
|
||||||
|
android:layout_width="409dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginTop="25dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/pDivider"
|
app:layout_constraintTop_toBottomOf="@+id/pDescription">
|
||||||
android:orientation="horizontal">
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/pDismiss"
|
android:id="@+id/pDismiss"
|
||||||
android:textColor="@color/c_button_text_v1"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:padding="0dp"
|
|
||||||
android:background="@xml/ax_ripple_default_round_bottom"
|
android:background="@xml/ax_ripple_default_round_bottom"
|
||||||
android:textSize="15sp"
|
android:padding="0dp"
|
||||||
|
android:text="@string/ALERT_DISMISS"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:layout_weight="1"
|
android:textColor="@color/c_button_text_v1"
|
||||||
android:textStyle="bold"
|
android:textSize="15sp"
|
||||||
android:text="@string/ALERT_DISMISS" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -5,82 +5,4 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/pMainLayout"
|
|
||||||
android:layout_width="360dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="25dp"
|
|
||||||
android:background="@xml/hox_rounded_corner"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/pHeader"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:paddingStart="15dp"
|
|
||||||
android:text="@string/ALERT_DOWNLOAD_NOTIFICATION"
|
|
||||||
android:textAlignment="textStart"
|
|
||||||
android:textColor="@color/c_text_setting_heading_v2"
|
|
||||||
android:textSize="17sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/pDescription"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
android:alpha="0.6"
|
|
||||||
android:paddingEnd="15dp"
|
|
||||||
android:text="@string/ALERT_ORBOT_INIT_INFO"
|
|
||||||
android:textAlignment="textStart"
|
|
||||||
android:paddingStart="15dp"
|
|
||||||
android:textColor="@color/c_alert_text"
|
|
||||||
android:textSize="13sp"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/pHeader"
|
|
||||||
tools:ignore="SmallSp" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/pDivider"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginTop="30dp"
|
|
||||||
android:background="@color/c_view_divier_background"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/pDescription" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/pNavigationContainer"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/pDivider">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/pDismiss"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@xml/ax_ripple_default_round_right"
|
|
||||||
android:padding="0dp"
|
|
||||||
android:text="@string/ALERT_DISMISS"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="@color/c_button_text_v1"
|
|
||||||
android:textSize="15sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -23,7 +23,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:paddingStart="15dp"
|
android:paddingStart="15dp"
|
||||||
android:layout_marginRight="30dp"
|
android:layout_marginEnd="30dp"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="@string/ALERT_DOWNLOAD"
|
android:text="@string/ALERT_DOWNLOAD"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
|
@ -31,7 +31,8 @@
|
||||||
android:textSize="17sp"
|
android:textSize="17sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:ignore="RtlSymmetry" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/pDescription"
|
android:id="@+id/pDescription"
|
||||||
|
@ -41,9 +42,9 @@
|
||||||
android:alpha="0.6"
|
android:alpha="0.6"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
android:paddingStart="15dp"
|
android:paddingStart="15dp"
|
||||||
android:singleLine="true"
|
android:lines="2"
|
||||||
android:paddingEnd="15dp"
|
android:paddingEnd="15dp"
|
||||||
android:layout_marginRight="30dp"
|
android:layout_marginEnd="30dp"
|
||||||
android:textColor="@color/c_alert_text"
|
android:textColor="@color/c_alert_text"
|
||||||
android:textSize="13sp"
|
android:textSize="13sp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
@ -103,7 +104,8 @@
|
||||||
android:scaleX="0.5"
|
android:scaleX="0.5"
|
||||||
app:tint="@color/c_navigation_tint"
|
app:tint="@color/c_navigation_tint"
|
||||||
android:scaleY="0.5"
|
android:scaleY="0.5"
|
||||||
app:srcCompat="@xml/ic_arrow_right" />
|
app:srcCompat="@xml/ic_arrow_right"
|
||||||
|
android:contentDescription="@string/GENERAL_TODO" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -149,7 +151,8 @@
|
||||||
android:scaleX="0.5"
|
android:scaleX="0.5"
|
||||||
app:tint="@color/c_navigation_tint"
|
app:tint="@color/c_navigation_tint"
|
||||||
android:scaleY="0.5"
|
android:scaleY="0.5"
|
||||||
app:srcCompat="@xml/ic_arrow_right" />
|
app:srcCompat="@xml/ic_arrow_right"
|
||||||
|
android:contentDescription="@string/GENERAL_TODO" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -195,7 +198,8 @@
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
android:scaleX="0.5"
|
android:scaleX="0.5"
|
||||||
android:scaleY="0.5"
|
android:scaleY="0.5"
|
||||||
app:srcCompat="@xml/ic_arrow_right" />
|
app:srcCompat="@xml/ic_arrow_right"
|
||||||
|
android:contentDescription="@string/GENERAL_TODO" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -243,7 +247,8 @@
|
||||||
app:tint="@color/c_navigation_tint"
|
app:tint="@color/c_navigation_tint"
|
||||||
android:scaleX="0.5"
|
android:scaleX="0.5"
|
||||||
android:scaleY="0.5"
|
android:scaleY="0.5"
|
||||||
app:srcCompat="@xml/ic_arrow_right" />
|
app:srcCompat="@xml/ic_arrow_right"
|
||||||
|
android:contentDescription="@string/GENERAL_TODO" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -291,7 +296,8 @@
|
||||||
app:tint="@color/c_navigation_tint"
|
app:tint="@color/c_navigation_tint"
|
||||||
android:scaleX="0.5"
|
android:scaleX="0.5"
|
||||||
android:scaleY="0.5"
|
android:scaleY="0.5"
|
||||||
app:srcCompat="@xml/ic_arrow_right" />
|
app:srcCompat="@xml/ic_arrow_right"
|
||||||
|
android:contentDescription="@string/GENERAL_TODO" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -339,7 +345,8 @@
|
||||||
app:tint="@color/c_navigation_tint"
|
app:tint="@color/c_navigation_tint"
|
||||||
android:scaleX="0.5"
|
android:scaleX="0.5"
|
||||||
android:scaleY="0.5"
|
android:scaleY="0.5"
|
||||||
app:srcCompat="@xml/ic_arrow_right" />
|
app:srcCompat="@xml/ic_arrow_right"
|
||||||
|
android:contentDescription="@string/GENERAL_TODO" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -387,7 +394,8 @@
|
||||||
android:scaleX="0.5"
|
android:scaleX="0.5"
|
||||||
app:tint="@color/c_navigation_tint"
|
app:tint="@color/c_navigation_tint"
|
||||||
android:scaleY="0.5"
|
android:scaleY="0.5"
|
||||||
app:srcCompat="@xml/ic_arrow_right" />
|
app:srcCompat="@xml/ic_arrow_right"
|
||||||
|
android:contentDescription="@string/GENERAL_TODO" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -414,7 +422,7 @@
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="45dp"
|
android:layout_height="45dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@xml/ax_bottom_rounded_corner_right"
|
android:background="@xml/ax_ripple_default_round_bottom"
|
||||||
android:padding="0dp"
|
android:padding="0dp"
|
||||||
android:text="@string/ALERT_WELCOME_MESSAGE_BT_5"
|
android:text="@string/ALERT_WELCOME_MESSAGE_BT_5"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
|
|
|
@ -39,7 +39,9 @@
|
||||||
android:justificationMode="inter_word"
|
android:justificationMode="inter_word"
|
||||||
android:paddingStart="15dp"
|
android:paddingStart="15dp"
|
||||||
android:textColor="@color/c_alert_text"
|
android:textColor="@color/c_alert_text"
|
||||||
|
android:ellipsize="start"
|
||||||
android:alpha="0.6"
|
android:alpha="0.6"
|
||||||
|
android:lines="2"
|
||||||
android:paddingEnd="15dp"
|
android:paddingEnd="15dp"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:textSize="13sp"
|
android:textSize="13sp"
|
||||||
|
@ -197,14 +199,6 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:background="@color/c_view_divier_background"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/pDescription" />
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
|
@ -228,7 +222,7 @@
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="45dp"
|
android:layout_height="45dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@xml/ax_bottom_rounded_corner_right"
|
android:background="@xml/ax_ripple_default_round_bottom"
|
||||||
android:padding="0dp"
|
android:padding="0dp"
|
||||||
android:text="@string/ALERT_DISMISS"
|
android:text="@string/ALERT_DISMISS"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
|
|