|
@ -35,5 +35,17 @@
|
|||
<option name="m_ignoreAnnotatedVariables" value="false" />
|
||||
</inspection_tool>
|
||||
<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>
|
||||
</component>
|
|
@ -34,9 +34,10 @@
|
|||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"/>
|
||||
|
||||
<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:label="@string/SETTING_HEADER"
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name="com.darkweb.genesissearchengine.appManager.historyManager.historyController"
|
||||
|
@ -119,7 +120,7 @@
|
|||
android:name="com.darkweb.genesissearchengine.appManager.homeManager.homeController"
|
||||
android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize|locale|layoutDirection|smallestScreenSize|screenLayout"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:screenOrientation="unspecified"
|
||||
android:windowSoftInputMode="adjustPan">
|
||||
<intent-filter>
|
||||
<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.homeManager.homeController;
|
||||
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 java.util.ArrayList;
|
||||
|
||||
|
@ -25,7 +26,8 @@ public class activityContextManager
|
|||
private homeController pHomeController;
|
||||
private tabController pTabController;
|
||||
private android.app.Activity pCurrentActivity = null;
|
||||
private settingController pSettingController;
|
||||
private settingHomeController pSettingController;
|
||||
private settingGeneralController pSettingGeneralController;
|
||||
private orbotLogController pOrbotLogController;
|
||||
private ArrayList<AppCompatActivity> mStackList;
|
||||
|
||||
|
@ -72,10 +74,18 @@ public class activityContextManager
|
|||
this.pOrbotLogController = pOrbotLogController;
|
||||
}
|
||||
|
||||
public settingController getSettingController(){
|
||||
|
||||
public settingGeneralController getSettingGeneralController(){
|
||||
return pSettingGeneralController;
|
||||
}
|
||||
public void setSettingGeneralController(settingGeneralController pSettingGeneralController){
|
||||
this.pSettingGeneralController = pSettingGeneralController;
|
||||
}
|
||||
|
||||
public settingHomeController getSettingController(){
|
||||
return pSettingController;
|
||||
}
|
||||
public void setSettingController(settingController pSettingController){
|
||||
public void setSettingController(settingHomeController pSettingController){
|
||||
this.pSettingController = pSettingController;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
|
||||
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>
|
||||
{
|
||||
|
@ -67,14 +67,14 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
|
|||
|
||||
private void onLoading(){
|
||||
mContext.runOnUiThread(() -> {
|
||||
mCurrentList.add(new bookmarkRowModel(BOOKMARK_LOAD_MORE,null,-2));
|
||||
mCurrentList.add(new bookmarkRowModel(CONST_BOOKMARK_LOAD_MORE,null,-2));
|
||||
notifyItemInserted(mCurrentList.size());
|
||||
});
|
||||
}
|
||||
|
||||
private void onLoadingClear(){
|
||||
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;
|
||||
mContext.runOnUiThread(() -> {
|
||||
mCurrentList.remove(finalM_counter);
|
||||
|
|
|
@ -44,6 +44,8 @@ import java.util.List;
|
|||
import java.util.Objects;
|
||||
|
||||
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
|
||||
|
@ -72,7 +74,7 @@ public class bookmarkController extends AppCompatActivity
|
|||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState){
|
||||
pluginController.getInstance().onCreate(this);
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.bookmark_view);
|
||||
initializeListModel();
|
||||
|
@ -87,7 +89,6 @@ public class bookmarkController extends AppCompatActivity
|
|||
mContextManager = activityContextManager.getInstance();
|
||||
mHomeController = activityContextManager.getInstance().getHomeController();
|
||||
mContextManager.setBookmarkController(this);
|
||||
pluginController.getInstance().logEvent(strings.EVENT_BOOKMARK_OPENED);
|
||||
}
|
||||
public void initializeViews(){
|
||||
mEmptyListNotification = findViewById(R.id.pEmptyListNotification);
|
||||
|
@ -116,7 +117,6 @@ public class bookmarkController extends AppCompatActivity
|
|||
|
||||
public void initCustomListeners(){
|
||||
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) ->{
|
||||
if (actionId == EditorInfo.IME_ACTION_NEXT)
|
||||
|
@ -212,9 +212,9 @@ public class bookmarkController extends AppCompatActivity
|
|||
@Override
|
||||
public void onResume()
|
||||
{
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
activityContextManager.getInstance().setCurrentActivity(this);
|
||||
status.sSettingIsAppPaused = false;
|
||||
|
||||
activityContextManager.getInstance().onStack(this);
|
||||
super.onResume();
|
||||
}
|
||||
|
@ -300,13 +300,11 @@ public class bookmarkController extends AppCompatActivity
|
|||
{
|
||||
if(e_type.equals(enums.etype.url_triggered)){
|
||||
String url_temp = helperMethod.completeURL(data.get(0).toString());
|
||||
pluginController.getInstance().logEvent(strings.EVENT_BOOKMARK_TRIGGERED);
|
||||
mHomeController.onLoadURL(url_temp);
|
||||
finish();
|
||||
}
|
||||
else if(e_type.equals(enums.etype.url_triggered_new_tab)){
|
||||
String url_temp = helperMethod.completeURL(data.get(0).toString());
|
||||
pluginController.getInstance().logEvent(strings.EVENT_BOOKMARK_TRIGGERED);
|
||||
mHomeController.onOpenLinkNewTab(url_temp);
|
||||
finish();
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@ import java.util.Arrays;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.M_BRIDGE_MAIL;
|
||||
|
||||
public class bridgeController extends AppCompatActivity {
|
||||
|
||||
|
||||
|
@ -44,7 +46,7 @@ public class bridgeController extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
pluginController.getInstance().onCreate(this);
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.bridge_settings_view);
|
||||
|
||||
|
@ -129,6 +131,7 @@ public class bridgeController extends AppCompatActivity {
|
|||
@Override
|
||||
public void onResume()
|
||||
{
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
activityContextManager.getInstance().setCurrentActivity(this);
|
||||
super.onResume();
|
||||
}
|
||||
|
@ -152,7 +155,7 @@ public class bridgeController extends AppCompatActivity {
|
|||
|
||||
public void requestBridges(View view){
|
||||
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){
|
||||
|
|
|
@ -11,12 +11,13 @@ import com.darkweb.genesissearchengine.dataManager.dataController;
|
|||
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.M_BRIDGE_MAIL;
|
||||
|
||||
class bridgeModel
|
||||
{
|
||||
/*Variable Declaration*/
|
||||
|
@ -34,7 +35,7 @@ class bridgeModel
|
|||
/*Helper Methods*/
|
||||
|
||||
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(){
|
||||
|
|
|
@ -3,29 +3,27 @@ package com.darkweb.genesissearchengine.appManager.helpManager;
|
|||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.darkweb.genesissearchengine.constants.enums;
|
||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
|
||||
public class editTextManager extends androidx.appcompat.widget.AppCompatAutoCompleteTextView {
|
||||
public class editViewController extends androidx.appcompat.widget.AppCompatAutoCompleteTextView {
|
||||
|
||||
Context mContext;
|
||||
private eventObserver.eventListener mEvent = null;
|
||||
|
||||
public editTextManager(@NonNull Context context) {
|
||||
public editViewController(@NonNull Context context) {
|
||||
super(context);
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
public editTextManager(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
public editViewController(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
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);
|
||||
mContext = context;
|
||||
}
|
|
@ -7,14 +7,12 @@ import android.text.TextWatcher;
|
|||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ProgressBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.SimpleItemAnimator;
|
||||
|
||||
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
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.helperMethod;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
@ -38,7 +37,7 @@ public class helpController extends AppCompatActivity {
|
|||
private RecyclerView mRecycleView;
|
||||
private ConstraintLayout mRetryContainer;
|
||||
private Button mReloadButton;
|
||||
private editTextManager mSearchInput;
|
||||
private editViewController mSearchInput;
|
||||
|
||||
/*Private Variables*/
|
||||
private Handler mSearchInvokedHandler = new Handler();
|
||||
|
@ -46,7 +45,7 @@ public class helpController extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
pluginController.getInstance().onCreate(this);
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onCreate(savedInstanceState);
|
||||
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() {
|
||||
|
||||
|
@ -105,9 +104,7 @@ public class helpController extends AppCompatActivity {
|
|||
|
||||
mSearchInput.setEventHandler(new edittextManagerCallback());
|
||||
|
||||
postToServerRunnable = () -> {
|
||||
mHelpAdapter.onTrigger(helpEnums.eHelpAdapter.M_INIT_FILTER, Collections.singletonList(mSearchInput.getText().toString()));
|
||||
};
|
||||
postToServerRunnable = () -> mHelpAdapter.onTrigger(helpEnums.eHelpAdapter.M_INIT_FILTER, Collections.singletonList(mSearchInput.getText().toString()));
|
||||
|
||||
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)){
|
||||
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*/
|
||||
/*HELPER FUNCTIONS*/
|
||||
|
||||
private void onShowHelperManager(ArrayList<helpDataModel> pHelpListModel){
|
||||
mHelpAdapter = new helpAdapter(pHelpListModel, getApplicationContext());
|
||||
|
@ -168,7 +139,34 @@ public class helpController extends AppCompatActivity {
|
|||
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{
|
||||
|
||||
|
@ -198,14 +196,8 @@ public class helpController extends AppCompatActivity {
|
|||
mHelpModel.onTrigger(helpEnums.eHelpModel.M_LOAD_HELP_DATA,null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if(mSearchInput.hasFocus()){
|
||||
mSearchInput.clearFocus();
|
||||
}else {
|
||||
finish();
|
||||
}
|
||||
super.onBackPressed();
|
||||
public void onOpenHelp(View view) {
|
||||
helperMethod.sendIssueEmail(this);
|
||||
}
|
||||
|
||||
public void onOpenHelpExternal(View view) {
|
||||
|
@ -217,4 +209,23 @@ public class helpController extends AppCompatActivity {
|
|||
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.toolbox.StringRequest;
|
||||
import com.android.volley.toolbox.Volley;
|
||||
import com.darkweb.genesissearchengine.helperManager.ProxiedHurlStack;
|
||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import static com.darkweb.genesissearchengine.constants.constants.*;
|
||||
|
||||
class helpModel
|
||||
{
|
||||
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 ArrayList<helpDataModel> mHelpListModel;
|
||||
|
||||
|
@ -39,9 +38,9 @@ class helpModel
|
|||
JSONObject obj = jsonArray.getJSONObject(i);
|
||||
|
||||
helpDataModel hero = new helpDataModel(
|
||||
obj.getString("mHeader"),
|
||||
obj.getString("mDescription"),
|
||||
obj.getString("mIcon"));
|
||||
obj.getString(CONST_HELP_MODEL_HEADER),
|
||||
obj.getString(CONST_HELP_MODEL_DESCRIPTION),
|
||||
obj.getString(CONST_HELP_MODEL_ICON));
|
||||
mHelpListModel.add(hero);
|
||||
}
|
||||
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();
|
||||
mRetryContainer.animate().cancel();
|
||||
mRecyclerView.animate().cancel();
|
||||
|
@ -65,7 +65,7 @@ class helpViewController
|
|||
mProgressBar.animate().setDuration(300).alpha(0);
|
||||
}
|
||||
|
||||
public void onLoadError(){
|
||||
private void onLoadError(){
|
||||
mRecyclerView.animate().setDuration(300).alpha(0);
|
||||
mProgressBar.setVisibility(View.VISIBLE);
|
||||
mProgressBar.setAlpha(1);
|
||||
|
@ -78,7 +78,7 @@ class helpViewController
|
|||
});
|
||||
}
|
||||
|
||||
public void onReloadData(){
|
||||
private void onReloadData(){
|
||||
mRecyclerView.animate().setDuration(300).alpha(0);
|
||||
mReloadButton.setClickable(false);
|
||||
mRetryContainer.animate().cancel();
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.util.List;
|
|||
import systems.intelligo.slight.ImageLoader;
|
||||
|
||||
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>
|
||||
{
|
||||
|
@ -71,14 +71,14 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
|
|||
|
||||
private void onLoading(){
|
||||
mContext.runOnUiThread(() -> {
|
||||
mCurrentList.add(new historyRowModel(HISTORY_LOAD_MORE,null,-2));
|
||||
mCurrentList.add(new historyRowModel(CONST_HISTORY_LOAD_MORE,null,-2));
|
||||
notifyItemInserted(mCurrentList.size());
|
||||
});
|
||||
}
|
||||
|
||||
private void onLoadingClear(){
|
||||
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;
|
||||
mContext.runOnUiThread(() -> {
|
||||
mCurrentList.remove(finalM_counter);
|
||||
|
|
|
@ -42,6 +42,7 @@ import java.util.Arrays;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
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
|
||||
{
|
||||
|
@ -70,7 +71,7 @@ public class historyController extends AppCompatActivity
|
|||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState){
|
||||
pluginController.getInstance().onCreate(this);
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.history_view);
|
||||
initializeListModel();
|
||||
|
@ -86,7 +87,6 @@ public class historyController extends AppCompatActivity
|
|||
mHomeController = activityContextManager.getInstance().getHomeController();
|
||||
mContextManager.setHistoryController(this);
|
||||
activityContextManager.getInstance().setHistoryController(this);
|
||||
pluginController.getInstance().logEvent(strings.EVENT_HISTORY_OPENED);
|
||||
}
|
||||
public void initializeViews(){
|
||||
mEmptyListNotification = findViewById(R.id.pEmptyListNotification);
|
||||
|
@ -142,7 +142,7 @@ public class historyController extends AppCompatActivity
|
|||
|
||||
mClearButton.requestFocusFromTouch();
|
||||
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) ->{
|
||||
|
@ -241,6 +241,7 @@ public class historyController extends AppCompatActivity
|
|||
@Override
|
||||
public void onResume()
|
||||
{
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
activityContextManager.getInstance().setCurrentActivity(this);
|
||||
status.sSettingIsAppPaused = false;
|
||||
super.onResume();
|
||||
|
@ -358,13 +359,11 @@ public class historyController extends AppCompatActivity
|
|||
{
|
||||
if(e_type.equals(enums.etype.url_triggered)){
|
||||
String url_temp = helperMethod.completeURL(data.get(0).toString());
|
||||
pluginController.getInstance().logEvent(strings.EVENT_HISTORY_TRIGGERED);
|
||||
mHomeController.onLoadURL(url_temp);
|
||||
finish();
|
||||
}
|
||||
else if(e_type.equals(enums.etype.url_triggered_new_tab)){
|
||||
String url_temp = helperMethod.completeURL(data.get(0).toString());
|
||||
pluginController.getInstance().logEvent(strings.EVENT_HISTORY_TRIGGERED);
|
||||
mHomeController.onOpenLinkNewTab(url_temp);
|
||||
finish();
|
||||
}
|
||||
|
|
|
@ -2,12 +2,15 @@ package com.darkweb.genesissearchengine.appManager.homeManager;
|
|||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Handler;
|
||||
import android.widget.ImageView;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.darkweb.genesissearchengine.appManager.kotlinHelperLibraries.BrowserIconManager;
|
||||
import com.darkweb.genesissearchengine.constants.*;
|
||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||
import com.google.android.gms.ads.AdSize;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import static com.darkweb.genesissearchengine.constants.enums.etype.on_handle_external_intent;
|
||||
|
@ -103,11 +106,11 @@ class geckoClients
|
|||
if(mRuntime==null){
|
||||
mRuntime = GeckoRuntime.getDefault(context);
|
||||
mRuntime.getSettings().setAboutConfigEnabled(true);
|
||||
mRuntime.getSettings().setAutomaticFontSizeAdjustment(false);
|
||||
mRuntime.getSettings().setWebFontsEnabled(status.sShowWebFonts);
|
||||
mRuntime.getSettings().setRemoteDebuggingEnabled(false);
|
||||
mRuntime.getSettings().setForceUserScalableEnabled(status.sSettingEnableZoom);
|
||||
mRuntime.getSettings().getContentBlocking().setCookieBehavior(getCookiesBehaviour());
|
||||
mRuntime.getSettings().getContentBlocking().setSafeBrowsing(ContentBlocking.SafeBrowsing.DEFAULT);
|
||||
mRuntime.getSettings().setAutomaticFontSizeAdjustment(status.sSettingFontAdjustable);
|
||||
mIconManager = new BrowserIconManager();
|
||||
if(status.sSettingTrackingProtection){
|
||||
mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.AD);
|
||||
|
@ -136,10 +139,12 @@ class geckoClients
|
|||
mRuntime.getSettings().setRemoteDebuggingEnabled(false);
|
||||
mRuntime.getSettings().setWebFontsEnabled(status.sShowWebFonts);
|
||||
mRuntime.getSettings().getContentBlocking().setCookieBehavior(getCookiesBehaviour());
|
||||
mRuntime.getSettings().setAutomaticFontSizeAdjustment(status.sSettingFontAdjustable);
|
||||
mRuntime.getSettings().setAutomaticFontSizeAdjustment(false);
|
||||
mRuntime.getSettings().getContentBlocking().setSafeBrowsing(ContentBlocking.SafeBrowsing.DEFAULT);
|
||||
mRuntime.getSettings().setWebFontsEnabled(status.sShowWebFonts);
|
||||
mRuntime.getSettings().setForceUserScalableEnabled(status.sSettingEnableZoom);
|
||||
mIconManager = new BrowserIconManager();
|
||||
if(status.sSettingTrackingProtection){
|
||||
if(!status.sSettingTrackingProtection){
|
||||
mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.AD);
|
||||
mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.FINGERPRINTING);
|
||||
}else {
|
||||
|
@ -151,6 +156,7 @@ class geckoClients
|
|||
mSession.getSettings().setFullAccessibilityTree(true);
|
||||
mSession.getSettings().setUserAgentMode(USER_AGENT_MODE_MOBILE );
|
||||
mSession.getSettings().setAllowJavascript(status.sSettingJavaStatus);
|
||||
onUpdateFont();
|
||||
onReload();
|
||||
}
|
||||
|
||||
|
@ -260,7 +266,8 @@ class geckoClients
|
|||
}
|
||||
|
||||
void onReload(){
|
||||
mSession.reload();
|
||||
mSession.stop();
|
||||
mSession.loadUri(mSession.getCurrentURL());
|
||||
}
|
||||
|
||||
void onReloadStatic(){
|
||||
|
@ -290,11 +297,8 @@ class geckoClients
|
|||
|
||||
void onUpdateFont(){
|
||||
float font = (status.sSettingFontSize -100)/3+100;
|
||||
mRuntime.getSettings().setAutomaticFontSizeAdjustment(status.sSettingFontAdjustable);
|
||||
if(!mRuntime.getSettings().getAutomaticFontSizeAdjustment()){
|
||||
mRuntime.getSettings().setFontSizeFactor(font/100);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class geckoViewClientCallback implements eventObserver.eventListener{
|
||||
|
|
|
@ -54,6 +54,10 @@ import java.io.OutputStream;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
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_MOBILE;
|
||||
|
||||
|
@ -141,6 +145,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
|||
if(!url.equals("about:blank") && !url.equals("about:config"))
|
||||
{
|
||||
mProgress = 5;
|
||||
Log.i("FUCKSSS","FUCKSSS : " + mProgress);
|
||||
event.invokeObserver(Arrays.asList(5, mSessionID), enums.etype.progress_update);
|
||||
}
|
||||
m_current_url_id = -1;
|
||||
|
@ -216,6 +221,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
|||
|
||||
@Override
|
||||
public void onPageStart(@NonNull GeckoSession var1, @NonNull String var2) {
|
||||
event.invokeObserver(Arrays.asList(5, mSessionID), enums.etype.progress_update);
|
||||
if(mIsLoaded){
|
||||
if(!isPageLoading){
|
||||
mCurrentTitle = "loading";
|
||||
|
@ -251,10 +257,12 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
|||
if(progress==100){
|
||||
if(!mIsProgressBarChanging){
|
||||
mIsProgressBarChanging = true;
|
||||
Log.i("FUCKSSS","FUCKSSS1 : " + mProgress);
|
||||
mContext.runOnUiThread(() -> event.invokeObserver(Arrays.asList(mProgress,mSessionID), enums.etype.progress_update));
|
||||
}
|
||||
}else {
|
||||
mIsProgressBarChanging = false;
|
||||
Log.i("FUCKSSS","FUCKSSS2 : " + mProgress);
|
||||
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.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 {
|
||||
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{
|
||||
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(){
|
||||
if(mCurrentURL.equals("resource://android/assets/Homepage/homepage.html")){
|
||||
mCurrentURL = "https://boogle.store";
|
||||
}
|
||||
return mCurrentURL;
|
||||
}
|
||||
|
||||
|
@ -720,7 +736,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
|||
|
||||
private void checkApplicationRate(){
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ import android.content.Context;
|
|||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Color;
|
||||
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.orbotManager.orbotController;
|
||||
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.tabRowModel;
|
||||
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.helperMethod;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||
import com.darkweb.genesissearchengine.widget.progressBar.AnimatedProgressBar;
|
||||
import com.example.myapplication.R;
|
||||
import com.google.android.gms.ads.AdView;
|
||||
|
@ -78,6 +78,8 @@ import java.util.Locale;
|
|||
import java.util.Objects;
|
||||
import java.util.concurrent.Callable;
|
||||
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
|
||||
{
|
||||
|
@ -143,7 +145,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
dataController.getInstance().initialize(this);
|
||||
onChangeTheme();
|
||||
status.initStatus();
|
||||
pluginController.getInstance().onCreate(this);
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
onInitTheme();
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -261,18 +263,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
}
|
||||
|
||||
private void initLocalLanguage() {
|
||||
|
||||
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);
|
||||
}
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this),pluginEnums.eLangManager.M_SET_LANGUAGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -297,6 +288,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
}
|
||||
}
|
||||
|
||||
public void onRedrawXML(){
|
||||
setContentView(R.layout.home_view);
|
||||
}
|
||||
|
||||
public void initializeAppModel()
|
||||
{
|
||||
mHomeViewController = new homeViewController();
|
||||
|
@ -347,6 +342,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
dataController.getInstance().initializeListData();
|
||||
}
|
||||
|
||||
public void onUpdateStatusBarTheme(){
|
||||
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), false);
|
||||
}
|
||||
|
||||
public void onUpdateToolbarTheme(){
|
||||
mHomeViewController.onUpdateToolbarTheme();
|
||||
|
@ -416,7 +414,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
|
||||
public void onLoadProxy(View view){
|
||||
if(pluginController.getInstance().isInitialized() && !mPageClosed){
|
||||
pluginController.getInstance().logEvent(strings.EVENT_GATEWAY_OPENED);
|
||||
helperMethod.openActivity(orbotController.class, constants.CONST_LIST_HISTORY, homeController.this,true);
|
||||
}
|
||||
}
|
||||
|
@ -427,7 +424,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
mGeckoClient.updateSetting();
|
||||
}
|
||||
|
||||
public void onReDrawGeckoview(){
|
||||
mGeckoClient.getSession().closeSession();
|
||||
mGeckoClient.getSession().close();
|
||||
mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,false);
|
||||
}
|
||||
|
||||
public void onLoadURL(String url){
|
||||
mGeckoView.getSession().stop();
|
||||
mHomeViewController.onClearSelections(true);
|
||||
mGeckoClient.loadURL(url.replace("genesis.onion","boogle.store"));
|
||||
mAppBar.setExpanded(true,true);
|
||||
|
@ -506,6 +510,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start,int before, int count) {
|
||||
if(mSearchbar.isFocused()){
|
||||
if(mFindText.getText().length()==0 && mGeckoClient!=null){
|
||||
mGeckoClient.getSession().getFinder().clear();
|
||||
mHomeViewController.onUpdateFindBarCount(0,0);
|
||||
|
@ -514,6 +519,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
mGeckoClient.getSession().findInPage(mFindText.getText().toString(), GeckoSession.FINDER_FIND_MATCH_CASE & GeckoSession.FINDER_DISPLAY_HIGHLIGHT_ALL);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mSearchbar.setOnEditorActionListener((v, actionId, event) ->
|
||||
|
@ -527,7 +533,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
final Handler handler = new Handler();
|
||||
handler.postDelayed(() ->
|
||||
{
|
||||
pluginController.getInstance().logEvent(strings.EVENT_SEARCH_INVOKED);
|
||||
mHomeViewController.onClearSelections(false);
|
||||
}, 500);
|
||||
}
|
||||
|
@ -551,7 +556,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
mGeckoView.setOnFocusChangeListener((v, hasFocus) -> {
|
||||
if(hasFocus)
|
||||
{
|
||||
pluginController.getInstance().onResetMessage();
|
||||
pluginController.getInstance().onMessageManagerInvoke(null, M_RESET);
|
||||
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,true);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -658,14 +662,13 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
onUpdateSuggestionList(mSuggestions);
|
||||
};
|
||||
|
||||
void onSearchBarInvoked(View view){
|
||||
public void onSearchBarInvoked(View view){
|
||||
String url = ((EditText)view).getText().toString();
|
||||
String validated_url = mHomeModel.urlComplete(url, mHomeModel.getSearchEngine());
|
||||
if(validated_url!=null){
|
||||
url = validated_url;
|
||||
}
|
||||
mHomeViewController.onUpdateSearchBar(url,false,true);
|
||||
Log.i("FUCLSSS","FUCLSSS2");
|
||||
onLoadURL(url);
|
||||
}
|
||||
|
||||
|
@ -691,8 +694,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
}
|
||||
|
||||
public void onHomeButton(View view){
|
||||
pluginController.getInstance().logEvent(strings.EVENT_HOME_INVOKED);
|
||||
Log.i("FUCLSSS","FUCLSSS4");
|
||||
onLoadURL(helperMethod.getDomainName(mHomeModel.getSearchEngine()));
|
||||
mHomeViewController.onUpdateLogo();
|
||||
}
|
||||
|
@ -705,11 +706,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
mGeckoClient.onRedrawPixel();
|
||||
initializeGeckoView(true, true);
|
||||
if(status.sOpenURLInNewTab){
|
||||
Log.i("FUCLSSS","FUCLSSS5");
|
||||
onLoadURL(helperMethod.getDomainName(status.sSettingSearchStatus));
|
||||
mHomeViewController. onUpdateSearchBar(helperMethod.getDomainName(status.sSettingSearchStatus),false,true);
|
||||
}else {
|
||||
Log.i("FUCLSSS","FUCLSSS6");
|
||||
onLoadURL("about:blank");
|
||||
mHomeViewController. onUpdateSearchBar(strings.HOME_BLANK_PAGE,false,true);
|
||||
}
|
||||
|
@ -727,7 +726,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
}
|
||||
|
||||
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){
|
||||
|
@ -735,10 +734,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
}
|
||||
|
||||
public void onOpenMenuItem(View view){
|
||||
pluginController.getInstance().logEvent(strings.EVENT_MENU_INVOKED);
|
||||
pluginController.getInstance().onResetMessage();
|
||||
pluginController.getInstance().onMessageManagerInvoke(null, M_RESET);
|
||||
initLocalLanguage();
|
||||
pluginController.getInstance().onCreate(this);
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
|
||||
helperMethod.hideKeyboard(this);
|
||||
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
|
||||
public void onBackPressed(){
|
||||
|
||||
pluginController.getInstance().logEvent(strings.EVENT_ON_BACK);
|
||||
mSearchbar.clearFocus();
|
||||
if(mFindBar!=null && mFindBar.getVisibility() == View.VISIBLE){
|
||||
mHomeViewController.onUpdateFindBar(false);
|
||||
|
@ -778,6 +775,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
}
|
||||
|
||||
public void onClearSession(){
|
||||
onHomeButton(null);
|
||||
mGeckoClient.onClearSession();
|
||||
}
|
||||
|
||||
|
@ -799,7 +797,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
super.onConfigurationChanged(newConfig);
|
||||
|
||||
|
||||
pluginController.getInstance().onResetMessage();
|
||||
pluginController.getInstance().onMessageManagerInvoke(null, M_RESET);
|
||||
mHomeViewController.closeMenu();
|
||||
|
||||
final Handler handler = new Handler();
|
||||
|
@ -818,7 +816,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
mHomeViewController.setOrientation(false);
|
||||
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();
|
||||
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), true);
|
||||
pluginController.getInstance().onResetMessage();
|
||||
pluginController.getInstance().onScheduleUserEngagementNotification(1296000000 /* Every 15 Days */ );
|
||||
pluginController.getInstance().onMessageManagerInvoke(null, M_RESET);
|
||||
pluginController.getInstance().onNotificationInvoke(Collections.singletonList(1296000000) /* Every 15 Days */ , pluginEnums.eNotificationManager.M_CREATE_NOTIFICATION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume()
|
||||
{
|
||||
pluginController.getInstance().onResume(this);
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
activityContextManager.getInstance().setCurrentActivity(this);
|
||||
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);
|
||||
|
@ -867,10 +865,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
}
|
||||
if(mAppBar!=null){
|
||||
mAppBar.setExpanded(true,true);
|
||||
|
||||
mAppBar.refreshDrawableState();
|
||||
mAppBar.invalidate();
|
||||
}
|
||||
mAppRestarted = true;
|
||||
pluginController.getInstance().onClearUserEngagementNotification();
|
||||
|
||||
pluginController.getInstance().onNotificationInvoke(null, pluginEnums.eNotificationManager.M_CLEAR_NOTIFICATION );
|
||||
|
||||
super.onResume();
|
||||
}
|
||||
|
@ -883,15 +883,15 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
protected void onActivityResult(int requestCode, int resultCode, Intent data){
|
||||
if(requestCode==100){
|
||||
if(resultCode == RESULT_OK && null != data){
|
||||
onSearchBarInvoked(mSearchbar);
|
||||
mSearchbar.clearFocus();
|
||||
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);
|
||||
mGeckoClient.setLoading(true);
|
||||
onSearchBarInvoked(mSearchbar);
|
||||
final Handler handler = new Handler();
|
||||
handler.postDelayed(() ->
|
||||
{
|
||||
pluginController.getInstance().logEvent(strings.EVENT_SEARCH_INVOKED);
|
||||
mGeckoView.clearFocus();
|
||||
}, 500);
|
||||
}
|
||||
|
@ -905,21 +905,23 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
}
|
||||
|
||||
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) {
|
||||
if(status.sSettingEnableVoiceInput){
|
||||
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
|
||||
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
|
||||
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_PROMPT,
|
||||
"Voice2Text \n Say Something!!");
|
||||
intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Voice2Text \n Say Something!!");
|
||||
try {
|
||||
startActivityForResult(intent, 100);
|
||||
} catch (ActivityNotFoundException ignored) {
|
||||
|
||||
}
|
||||
}else {
|
||||
onSearchBarInvoked(mSearchbar);
|
||||
}
|
||||
}
|
||||
/*-------------------------------------------------------External Callback Methods-------------------------------------------------------*/
|
||||
|
||||
|
@ -928,7 +930,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
}
|
||||
|
||||
public void onStartApplication(View view){
|
||||
pluginController.getInstance().initializeOrbot();
|
||||
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_START_ORBOT);
|
||||
onInvokeProxyLoading();
|
||||
mHomeViewController.initHomePage();
|
||||
}
|
||||
|
@ -951,7 +953,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
public void onInvokeProxyLoading(){
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
|
@ -1007,7 +1010,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
}
|
||||
|
||||
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){
|
||||
|
@ -1063,11 +1066,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
else if (menuId == R.id.menu6)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
@ -1077,7 +1080,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
else if (menuId == R.id.pMenuOpenCurrentTab)
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
@ -1102,7 +1105,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
}
|
||||
if (menuId == R.id.menu23) {
|
||||
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) {
|
||||
helperMethod.hideKeyboard(this);
|
||||
|
@ -1121,6 +1124,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
mHomeViewController.closeMenu();
|
||||
}
|
||||
|
||||
public void onReInitTheme(){
|
||||
}
|
||||
|
||||
public void onOrbotLog(View view) {
|
||||
mHomeViewController.closeMenu();
|
||||
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))
|
||||
{
|
||||
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)){
|
||||
if(status.sSettingIsAppRedirected){
|
||||
|
@ -1182,13 +1198,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
}
|
||||
else if(status.sSettingIsAppStarted){
|
||||
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)){
|
||||
geckoSession mSession = (geckoSession)dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_HOME_PAGE, null);
|
||||
if(mSession!=null){
|
||||
|
@ -1292,7 +1307,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(),false);
|
||||
}
|
||||
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)){
|
||||
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()));
|
||||
}
|
||||
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));
|
||||
mHomeViewController.onPageFinished();
|
||||
if(status.sSettingIsWelcomeEnabled && !status.sSettingIsAppStarted){
|
||||
|
||||
final Handler handler = new Handler();
|
||||
Runnable runnable = () ->
|
||||
{
|
||||
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();
|
||||
Runnable runnable = () -> pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_INITIALIZE_BANNER_ADS);
|
||||
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){
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.PROXY_IS_APP_RATED,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)){
|
||||
pluginController.getInstance().setLanguage();
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(homeController.this), pluginEnums.eLangManager.M_SET_LANGUAGE);
|
||||
initLocalLanguage();
|
||||
mHomeViewController.onPageFinished();
|
||||
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);
|
||||
}
|
||||
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)){
|
||||
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)){
|
||||
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)){
|
||||
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);
|
||||
else if(e_type.equals(M_LONG_PRESS_WITH_LINK)){
|
||||
pluginController.getInstance().onMessageManagerInvoke(data, M_LONG_PRESS_WITH_LINK);
|
||||
}
|
||||
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().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);
|
||||
}
|
||||
else if(e_type.equals(enums.eMessageEnums.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);
|
||||
else if(e_type.equals(M_LONG_PRESS_URL)){
|
||||
pluginController.getInstance().onMessageManagerInvoke(data, M_LONG_PRESS_URL);
|
||||
}
|
||||
else if(e_type.equals(enums.etype.open_new_tab)){
|
||||
onOpenLinkNewTab(dataToStr(data.get(0)));
|
||||
|
|
|
@ -34,7 +34,8 @@ class homeModel
|
|||
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.mOrbotLogManager = pOrbotLogManager;
|
||||
|
||||
initializeViews();
|
||||
initSplashScreen();
|
||||
initializeSuggestionView(suggestions);
|
||||
createUpdateUiHandler();
|
||||
|
@ -131,6 +132,10 @@ class homeViewController
|
|||
initTopBarPadding();
|
||||
}
|
||||
|
||||
public void initializeViews(){
|
||||
mContext.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_USER);
|
||||
}
|
||||
|
||||
public void initTopBarPadding(){
|
||||
if(!status.sFullScreenBrowsing){
|
||||
int paddingDp = 60;
|
||||
|
@ -200,6 +205,8 @@ class homeViewController
|
|||
mContext.getWindow().setStatusBarColor(ContextCompat.getColor(mContext, R.color.landing_ease_blue));
|
||||
}
|
||||
}
|
||||
|
||||
//mContext.getWindow().getDecorView().setSystemUiVisibility(status.sTheme);
|
||||
}
|
||||
|
||||
public void initStatusBarColor(boolean mInstant) {
|
||||
|
@ -316,6 +323,7 @@ class homeViewController
|
|||
}
|
||||
if(!status.sSettingIsAppStarted){
|
||||
startPostTask(messages.MESSAGE_ON_URL_LOAD);
|
||||
mContext.runOnUiThread(() -> splashScreenDisable());
|
||||
}else {
|
||||
mContext.runOnUiThread(() -> mEvent.invokeObserver(null, enums.etype.ON_LOAD_TAB_ON_RESUME));
|
||||
}
|
||||
|
@ -332,13 +340,18 @@ class homeViewController
|
|||
mSplashScreen.bringToFront();
|
||||
splashScreenDisable();
|
||||
}
|
||||
private void splashScreenDisable(){
|
||||
public void splashScreenDisable(){
|
||||
mTopBar.setAlpha(1);
|
||||
|
||||
if(mSplashScreen.getAlpha()==1){
|
||||
triggerPostUI();
|
||||
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);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
initStatusBarColor(false);
|
||||
|
@ -352,7 +365,6 @@ class homeViewController
|
|||
}
|
||||
|
||||
private void triggerPostUI(){
|
||||
onUpdateToolbarTheme();
|
||||
mAppBar.setExpanded(true,true);
|
||||
if(mProgressBar.getProgress()>0 && mProgressBar.getProgress()<10000){
|
||||
mProgressBar.animate().setStartDelay(0).alpha(1);
|
||||
|
@ -487,6 +499,7 @@ class homeViewController
|
|||
private Handler searchBarUpdateHandler = new Handler();
|
||||
private String handlerLocalUrl = "";
|
||||
void onUpdateSearchBar(String url,boolean showProtocol, boolean pClearText){
|
||||
if(!mSearchbar.hasFocus() || pClearText){
|
||||
int delay = 0;
|
||||
handlerLocalUrl = url;
|
||||
|
||||
|
@ -502,6 +515,7 @@ class homeViewController
|
|||
|
||||
}, delay);
|
||||
}
|
||||
}
|
||||
|
||||
public void onUpdateFindBarCount(int index, int total)
|
||||
{
|
||||
|
@ -705,10 +719,10 @@ class homeViewController
|
|||
}
|
||||
|
||||
void onProgressBarUpdate(int value){
|
||||
if(mProgressBar.getVisibility()==View.GONE){
|
||||
mProgressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else if(value != mProgressBar.getProgress()){
|
||||
mProgressBar.animate().cancel();
|
||||
|
||||
if(value != mProgressBar.getProgress()){
|
||||
if(value<=5 && value>0){
|
||||
mProgressBar.setProgress(5);
|
||||
}else {
|
||||
|
|
|
@ -13,10 +13,12 @@ import com.darkweb.genesissearchengine.constants.status;
|
|||
import com.darkweb.genesissearchengine.dataManager.dataController;
|
||||
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.github.paolorotolo.appintro.AppIntro;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
public class landingController extends AppIntro {
|
||||
|
||||
|
@ -24,7 +26,6 @@ public class landingController extends AppIntro {
|
|||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
pluginController.getInstance().onCreate(this);
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// Instead of fragments, you can also use our default slide
|
||||
|
@ -65,6 +66,8 @@ public class landingController extends AppIntro {
|
|||
mLauncherViewController = new landingViewController(this,null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onDonePressed(Fragment currentFragment) {
|
||||
super.onDonePressed(currentFragment);
|
||||
|
@ -73,4 +76,9 @@ public class landingController extends AppIntro {
|
|||
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;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
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.helpManager.helpController;
|
||||
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.helperMethod;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
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 {
|
||||
|
||||
/*Initializations*/
|
||||
/*Private Variables*/
|
||||
|
||||
private languageViewController mLanguageViewController;
|
||||
private languageModel mLanguageModel;
|
||||
private ImageView mBlocker;
|
||||
|
||||
private RecyclerView mRecycleView;
|
||||
private languageAdapter mLanguageAdapter;
|
||||
|
||||
/*Initializations*/
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
pluginController.getInstance().onCreate(this);
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.language_view);
|
||||
|
||||
initializeAppModel();
|
||||
initializeConnections();
|
||||
initializeAdapter();
|
||||
onInitScroll();
|
||||
}
|
||||
|
||||
public void initializeAppModel()
|
||||
private void initializeAppModel()
|
||||
{
|
||||
mLanguageViewController = new languageViewController();
|
||||
mLanguageModel = new languageModel();
|
||||
}
|
||||
|
||||
public void initializeConnections()
|
||||
private void initializeConnections()
|
||||
{
|
||||
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) {
|
||||
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
|
||||
public Object invokeObserver(List<Object> data, Object e_type)
|
||||
{
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void changeLanguage(Locale language){
|
||||
status.sSettingLanguage = language.getLanguage();
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.SETTING_LANGUAGE,language.getLanguage()));
|
||||
pluginController.getInstance().setLanguage();
|
||||
/*Adapter Callbacks*/
|
||||
|
||||
private class languageAdapterCallback implements eventObserver.eventListener {
|
||||
|
||||
@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) {
|
||||
activityContextManager.getInstance().onRemoveStack(this);
|
||||
finish();
|
||||
@Override
|
||||
protected void onResume() {
|
||||
if(mLanguageAdapter!=null){
|
||||
mLanguageAdapter.notifyDataSetChanged();
|
||||
}
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -80,41 +189,4 @@ public class languageController extends AppCompatActivity {
|
|||
onClose(null);
|
||||
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;
|
||||
|
||||
import com.darkweb.genesissearchengine.constants.status;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
import com.example.myapplication.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
class languageViewController
|
||||
{
|
||||
/*ViewControllers*/
|
||||
/*Private Variables*/
|
||||
|
||||
private AppCompatActivity mContext;
|
||||
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.mBlocker = pBlocker;
|
||||
this.mEvent = pEvent;
|
||||
|
||||
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.eventObserver;
|
||||
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.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import org.torproject.android.service.wrapper.orbotLocalConstants;
|
||||
|
@ -46,6 +48,7 @@ public class orbotLogController extends AppCompatActivity {
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
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);
|
||||
setContentView(R.layout.orbot_log_view);
|
||||
|
||||
|
@ -198,6 +201,7 @@ public class orbotLogController extends AppCompatActivity {
|
|||
@Override
|
||||
public void onResume()
|
||||
{
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
activityContextManager.getInstance().setCurrentActivity(this);
|
||||
super.onResume();
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ class orbotLogModel
|
|||
Collections.reverse(mModelList);
|
||||
}
|
||||
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.helperMethod;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
import java.util.Arrays;
|
||||
|
@ -41,7 +42,7 @@ public class orbotController extends AppCompatActivity {
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
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);
|
||||
setContentView(R.layout.orbot_settings_view);
|
||||
|
||||
|
@ -113,6 +114,7 @@ public class orbotController extends AppCompatActivity {
|
|||
@Override
|
||||
public void onResume()
|
||||
{
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
activityContextManager.getInstance().setCurrentActivity(this);
|
||||
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.helperManager.eventObserver;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
class orbotModel
|
||||
|
@ -21,12 +24,12 @@ class orbotModel
|
|||
|
||||
public void onBridgeSwitch(boolean 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){
|
||||
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.helperMethod;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class proxyStatusController extends AppCompatActivity {
|
||||
|
@ -35,7 +37,7 @@ public class proxyStatusController extends AppCompatActivity {
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
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);
|
||||
setContentView(R.layout.proxy_status_view);
|
||||
|
||||
|
@ -49,7 +51,7 @@ public class proxyStatusController extends AppCompatActivity {
|
|||
|
||||
activityContextManager.getInstance().onStack(this);
|
||||
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());
|
||||
}
|
||||
|
||||
|
@ -57,6 +59,10 @@ public class proxyStatusController extends AppCompatActivity {
|
|||
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 */
|
||||
|
||||
public class proxyStatusModelCallback implements eventObserver.eventListener{
|
||||
|
@ -78,6 +84,7 @@ public class proxyStatusController extends AppCompatActivity {
|
|||
@Override
|
||||
public void onResume()
|
||||
{
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
|||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
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.google.android.material.switchmaterial.SwitchMaterial;
|
||||
import java.util.Arrays;
|
||||
|
@ -24,6 +25,7 @@ import java.util.List;
|
|||
public class settingAccessibilityController extends AppCompatActivity {
|
||||
|
||||
/* PRIVATE VARIABLES */
|
||||
|
||||
private settingAccessibilityModel mSettingAccessibilityModel;
|
||||
private settingAccessibilityViewController mSettingAccessibilityViewController;
|
||||
private SwitchMaterial mZoom;
|
||||
|
@ -32,17 +34,25 @@ public class settingAccessibilityController extends AppCompatActivity {
|
|||
private TextView mSeekBarSample;
|
||||
private TextView mScalePercentage;
|
||||
|
||||
/* PRIVATE LOCAL VARIABLES */
|
||||
|
||||
private boolean mIsSettingChanged = false;
|
||||
private float mDefaultFontSize = status.sSettingFontSize;
|
||||
|
||||
/* Initializations */
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
pluginController.getInstance().onCreate(this);
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.setting_accessibility_view);
|
||||
|
||||
viewsInitializations();
|
||||
initializeListeners();
|
||||
}
|
||||
|
||||
public void viewsInitializations() {
|
||||
private void viewsInitializations() {
|
||||
mZoom = findViewById(R.id.pZoom);
|
||||
mVoiceInput = findViewById(R.id.pVoiceInput);
|
||||
mSeekBar = findViewById(R.id.pSeekBar);
|
||||
|
@ -54,27 +64,7 @@ public class settingAccessibilityController extends AppCompatActivity {
|
|||
mSettingAccessibilityModel = new settingAccessibilityModel(new settingAccessibilityController.settingAccessibilityModelCallback());
|
||||
}
|
||||
|
||||
/* LISTENERS */
|
||||
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(){
|
||||
private void initializeListeners(){
|
||||
mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
|
||||
@Override
|
||||
|
@ -87,6 +77,7 @@ public class settingAccessibilityController extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress,boolean fromUser) {
|
||||
mIsSettingChanged = true;
|
||||
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_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 */
|
||||
|
||||
@Override
|
||||
public void onResume()
|
||||
{
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
activityContextManager.getInstance().setCurrentActivity(this);
|
||||
super.onResume();
|
||||
}
|
||||
|
@ -118,7 +132,6 @@ public class settingAccessibilityController extends AppCompatActivity {
|
|||
onClose(null);
|
||||
}
|
||||
|
||||
|
||||
/*UI Redirection*/
|
||||
|
||||
public void onOpenInfo(View view) {
|
||||
|
@ -128,6 +141,10 @@ public class settingAccessibilityController extends AppCompatActivity {
|
|||
public void onClose(View view){
|
||||
activityContextManager.getInstance().onRemoveStack(this);
|
||||
finish();
|
||||
|
||||
if(mIsSettingChanged && mDefaultFontSize!=status.sSettingFontSize){
|
||||
activityContextManager.getInstance().getHomeController().initRuntimeSettings();
|
||||
}
|
||||
}
|
||||
|
||||
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.helperMethod;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
import java.util.ArrayList;
|
||||
|
@ -23,7 +24,8 @@ import java.util.List;
|
|||
|
||||
public class settingAdvanceController extends AppCompatActivity {
|
||||
|
||||
/* PRIVATE VARIABLES */
|
||||
/* Private Variables */
|
||||
|
||||
private settingAdvanceModel mSettingAdvanceModel;
|
||||
private settingAdvanceViewController mSettingAdvanceViewController;
|
||||
private SwitchMaterial mRestoreTabs;
|
||||
|
@ -32,10 +34,13 @@ public class settingAdvanceController extends AppCompatActivity {
|
|||
private ArrayList<RadioButton> mImageOption = new ArrayList<>();
|
||||
private boolean mIsChanged = false;
|
||||
|
||||
/* Initializations */
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
pluginController.getInstance().onCreate(this);
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.setting_advance_view);
|
||||
|
||||
viewsInitializations();
|
||||
|
@ -57,7 +62,8 @@ public class settingAdvanceController extends AppCompatActivity {
|
|||
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
||||
}
|
||||
|
||||
/* LISTENERS */
|
||||
/*View Callbacks*/
|
||||
|
||||
public class settingAdvanceViewCallback implements eventObserver.eventListener{
|
||||
|
||||
@Override
|
||||
|
@ -67,6 +73,7 @@ public class settingAdvanceController extends AppCompatActivity {
|
|||
}
|
||||
}
|
||||
|
||||
/*Model Callbacks*/
|
||||
|
||||
public class settingAdvanceModelCallback implements eventObserver.eventListener{
|
||||
|
||||
|
@ -82,14 +89,15 @@ public class settingAdvanceController extends AppCompatActivity {
|
|||
@Override
|
||||
public void onResume()
|
||||
{
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
activityContextManager.getInstance().setCurrentActivity(this);
|
||||
super.onResume();
|
||||
|
||||
int notificationStatus = pluginController.getInstance().getNotificationStatus();
|
||||
int notificationStatus = (int)pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_GET_NOTIFICATION_STATUS);
|
||||
if(notificationStatus==0){
|
||||
pluginController.getInstance().disableTorNotification();
|
||||
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION);
|
||||
} 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
|
||||
public void onBackPressed() {
|
||||
if(mIsChanged){
|
||||
pluginController.getInstance().updatePrivacy();
|
||||
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_UPDATE_PRIVACY);
|
||||
activityContextManager.getInstance().getHomeController().initRuntimeSettings();
|
||||
}
|
||||
activityContextManager.getInstance().onRemoveStack(this);
|
||||
|
@ -113,7 +121,7 @@ public class settingAdvanceController extends AppCompatActivity {
|
|||
|
||||
public void onClose(View view){
|
||||
if(mIsChanged){
|
||||
pluginController.getInstance().updatePrivacy();
|
||||
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_UPDATE_PRIVACY);
|
||||
activityContextManager.getInstance().getHomeController().initRuntimeSettings();
|
||||
}
|
||||
finish();
|
||||
|
@ -144,6 +152,6 @@ public class settingAdvanceController extends AppCompatActivity {
|
|||
mSettingAdvanceModel.onTrigger(settingAdvanceEnums.eAdvanceModel.M_TOOLBAR_THEME, Collections.singletonList(!mToolbarTheme.isChecked()));
|
||||
mToolbarTheme.toggle();
|
||||
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.os.Bundle;
|
||||
import android.os.Debug;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.CheckBox;
|
||||
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.constants.constants;
|
||||
import com.darkweb.genesissearchengine.constants.enums;
|
||||
import com.darkweb.genesissearchengine.constants.keys;
|
||||
import com.darkweb.genesissearchengine.constants.sql;
|
||||
import com.darkweb.genesissearchengine.constants.status;
|
||||
import com.darkweb.genesissearchengine.constants.strings;
|
||||
import com.darkweb.genesissearchengine.dataManager.dataController;
|
||||
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
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 {
|
||||
|
||||
/* PRIVATE VARIABLES */
|
||||
|
||||
private settingClearModel mSettingClearModel;
|
||||
private settingClearViewController mSettingClearViewController;
|
||||
private ArrayList<CheckBox> mCheckBoxList = new ArrayList<>();
|
||||
|
@ -35,9 +44,9 @@ public class settingClearController extends AppCompatActivity {
|
|||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.setting_clear_view);
|
||||
|
||||
pluginController.getInstance().onCreate(this);
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
|
||||
viewsInitializations();
|
||||
initializeListeners();
|
||||
}
|
||||
|
||||
public void viewsInitializations() {
|
||||
|
@ -55,12 +64,9 @@ public class settingClearController extends AppCompatActivity {
|
|||
mSettingClearModel = new settingClearModel(new settingClearController.settingClearModelCallback());
|
||||
}
|
||||
|
||||
public void onOpenInfo(View view) {
|
||||
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
||||
}
|
||||
/*View Callbacks*/
|
||||
|
||||
/* LISTENERS */
|
||||
public class settingClearViewCallback implements eventObserver.eventListener{
|
||||
private class settingClearViewCallback implements eventObserver.eventListener{
|
||||
|
||||
@Override
|
||||
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
|
||||
public Object invokeObserver(List<Object> data, Object e_type)
|
||||
|
@ -79,21 +86,13 @@ 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){
|
||||
try{
|
||||
boolean mHomeInvoked = false;
|
||||
if(mCheckBoxList.get(0).isChecked()){
|
||||
mCheckBoxList.get(0).setChecked(false);
|
||||
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);
|
||||
activityContextManager.getInstance().getHomeController().initTab(false);
|
||||
mHomeInvoked = true;
|
||||
}
|
||||
if(mCheckBoxList.get(1).isChecked()){
|
||||
mCheckBoxList.get(1).setChecked(false);
|
||||
|
@ -114,37 +113,81 @@ public class settingClearController extends AppCompatActivity {
|
|||
}
|
||||
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)));
|
||||
dataController.getInstance().invokeSuggestion(dataEnums.eSuggestionCommands.M_CLEAR_SUGGESTION ,null);
|
||||
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().onClearSiteData();
|
||||
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().onClearSession();
|
||||
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)));
|
||||
activityContextManager.getInstance().getHomeController().onClearCookies();
|
||||
onClearSettings();
|
||||
status.initStatus();
|
||||
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLEAR_TAB, null);
|
||||
mHomeInvoked = true;
|
||||
}
|
||||
|
||||
activityContextManager.getInstance().getHomeController().initRuntimeSettings();
|
||||
pluginController.getInstance().MessageManagerHandler(this, null, enums.eMessageEnums.M_DATA_CLEARED);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
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 */
|
||||
|
||||
@Override
|
||||
public void onResume()
|
||||
{
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
activityContextManager.getInstance().setCurrentActivity(this);
|
||||
super.onResume();
|
||||
}
|
||||
|
@ -161,6 +204,17 @@ public class settingClearController extends AppCompatActivity {
|
|||
}
|
||||
|
||||
/*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){
|
||||
activityContextManager.getInstance().onRemoveStack(this);
|
||||
finish();
|
||||
|
|
|
@ -30,7 +30,6 @@ class settingClearViewController
|
|||
this.mContext = pContext;
|
||||
this.mCheckBoxList = pCheckBoxList;
|
||||
|
||||
initViews();
|
||||
initPostUI();
|
||||
}
|
||||
|
||||
|
@ -51,10 +50,6 @@ class settingClearViewController
|
|||
}
|
||||
}
|
||||
|
||||
private void initViews()
|
||||
{
|
||||
}
|
||||
|
||||
private void onClearCheckbox(int pIndex, boolean pStatus){
|
||||
mCheckBoxList.get(pIndex).setChecked(pStatus);
|
||||
if(pStatus){
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.darkweb.genesissearchengine.appManager.settingManager.generalManager;
|
||||
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.View;
|
||||
|
@ -7,9 +8,12 @@ import android.widget.RadioButton;
|
|||
import android.widget.TextView;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
||||
import com.darkweb.genesissearchengine.appManager.helpManager.helpController;
|
||||
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.enums;
|
||||
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.helperMethod;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class settingGeneralController extends AppCompatActivity {
|
||||
|
||||
/* PRIVATE VARIABLES */
|
||||
|
||||
private settingGeneralModel mSettingGeneralModel;
|
||||
private settingGeneralViewController mSettingGeneralViewController;
|
||||
private SwitchMaterial mFullScreenMode;
|
||||
|
@ -40,16 +46,15 @@ public class settingGeneralController extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
pluginController.getInstance().onCreate(this);
|
||||
onInitTheme();
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.setting_general_view);
|
||||
|
||||
setContentView(R.layout.setting_general_view);
|
||||
activityContextManager.getInstance().setSettingGeneralController(this);
|
||||
viewsInitializations();
|
||||
initializeListeners();
|
||||
}
|
||||
|
||||
public void viewsInitializations() {
|
||||
private void viewsInitializations() {
|
||||
|
||||
mFullScreenMode = findViewById(R.id.pJSStatus);
|
||||
mThemeLight = findViewById(R.id.pThemeLight);
|
||||
|
@ -63,44 +68,65 @@ public class settingGeneralController extends AppCompatActivity {
|
|||
mSettingGeneralModel = new settingGeneralModel(new settingGeneralModelCallback());
|
||||
}
|
||||
|
||||
public void onInitTheme(){
|
||||
private void onInitTheme(){
|
||||
|
||||
if(status.sTheme == enums.Theme.THEME_DARK){
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||
activityContextManager.getInstance().getHomeController().recreate();
|
||||
}else if(status.sTheme == enums.Theme.THEME_LIGHT){
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
||||
activityContextManager.getInstance().getHomeController().recreate();
|
||||
}else {
|
||||
if(!status.sDefaultNightMode){
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
||||
activityContextManager.getInstance().getHomeController().recreate();
|
||||
}else {
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||
activityContextManager.getInstance().getHomeController().recreate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onOpenInfo(View view) {
|
||||
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
||||
}
|
||||
/*View Callbacks*/
|
||||
|
||||
/* LISTENERS */
|
||||
public class settingGeneralViewCallback implements eventObserver.eventListener{
|
||||
private class settingGeneralViewCallback implements eventObserver.eventListener{
|
||||
|
||||
@Override
|
||||
public Object invokeObserver(List<Object> data, Object e_type)
|
||||
{
|
||||
if(settingGeneralEnums.eGeneralViewCallback.M_RESET_THEME_INVOKED_BACK.equals(e_type))
|
||||
{
|
||||
helperMethod.restartActivity(getIntent(), settingGeneralController.this);
|
||||
new Handler().postDelayed(() -> {
|
||||
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
|
||||
activityContextManager.getInstance().getSettingController().applyTheme();
|
||||
}, 100);
|
||||
boolean mIsThemeChangable = false;
|
||||
if(status.sTheme == enums.Theme.THEME_DARK){
|
||||
if(AppCompatDelegate.getDefaultNightMode() != AppCompatDelegate.MODE_NIGHT_YES){
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
public class settingGeneralModelCallback implements eventObserver.eventListener{
|
||||
/*Model Callbacks*/
|
||||
|
||||
private class settingGeneralModelCallback implements eventObserver.eventListener{
|
||||
|
||||
@Override
|
||||
public Object invokeObserver(List<Object> data, Object e_type)
|
||||
|
@ -109,14 +135,12 @@ public class settingGeneralController extends AppCompatActivity {
|
|||
}
|
||||
}
|
||||
|
||||
public void initializeListeners(){
|
||||
}
|
||||
|
||||
/* LOCAL OVERRIDES */
|
||||
|
||||
@Override
|
||||
public void onResume()
|
||||
{
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
activityContextManager.getInstance().setCurrentActivity(this);
|
||||
super.onResume();
|
||||
}
|
||||
|
@ -133,7 +157,14 @@ public class settingGeneralController extends AppCompatActivity {
|
|||
finish();
|
||||
}
|
||||
|
||||
/*External Redirection*/
|
||||
|
||||
public void onLanguageChanged(){
|
||||
setContentView(R.layout.setting_general_view);
|
||||
}
|
||||
|
||||
/*UI Redirection*/
|
||||
|
||||
public void onClose(View view){
|
||||
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) {
|
||||
mSettingGeneralModel.onTrigger(settingGeneralEnums.eGeneralModel.M_URL_NEW_TAB, Collections.singletonList(!mOpenURLInNewTab.isChecked()));
|
||||
mOpenURLInNewTab.toggle();
|
||||
|
|
|
@ -13,6 +13,7 @@ import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
|||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
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.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
|
@ -29,14 +30,14 @@ public class settingLogController extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
pluginController.getInstance().onCreate(this);
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.setting_log_view);
|
||||
|
||||
viewsInitializations();
|
||||
}
|
||||
|
||||
public void viewsInitializations() {
|
||||
private void viewsInitializations() {
|
||||
mListView = findViewById(R.id.pListView);
|
||||
activityContextManager.getInstance().onStack(this);
|
||||
mSettingLogViewController = new settingLogViewController(this, new settingLogViewCallback(), mListView);
|
||||
|
@ -44,12 +45,9 @@ public class settingLogController extends AppCompatActivity {
|
|||
mSettingLogModel = new settingLogModel(new settingLogModelCallback());
|
||||
}
|
||||
|
||||
public void onOpenInfo(View view) {
|
||||
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
||||
}
|
||||
/*View Callbacks*/
|
||||
|
||||
/* LISTENERS */
|
||||
public class settingLogViewCallback implements eventObserver.eventListener{
|
||||
private class settingLogViewCallback implements eventObserver.eventListener{
|
||||
|
||||
@Override
|
||||
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
|
||||
public Object invokeObserver(List<Object> data, Object e_type)
|
||||
|
@ -73,6 +72,7 @@ public class settingLogController extends AppCompatActivity {
|
|||
@Override
|
||||
public void onResume()
|
||||
{
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
activityContextManager.getInstance().setCurrentActivity(this);
|
||||
super.onResume();
|
||||
}
|
||||
|
@ -101,4 +101,9 @@ public class settingLogController extends AppCompatActivity {
|
|||
activityContextManager.getInstance().getOrbotLogController().initializeLogs();
|
||||
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.helperMethod;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
|
@ -23,20 +24,21 @@ import java.util.List;
|
|||
public class settingNotificationController extends AppCompatActivity {
|
||||
|
||||
/* PRIVATE VARIABLES */
|
||||
|
||||
private SwitchMaterial mNotificationManual;
|
||||
private settingNotificationModel mSettingNotificationModel;
|
||||
private settingNotificationViewController mSettingNotificationViewController;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
pluginController.getInstance().onCreate(this);
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.setting_notification_view);
|
||||
|
||||
viewsInitializations();
|
||||
}
|
||||
|
||||
public void viewsInitializations() {
|
||||
private void viewsInitializations() {
|
||||
activityContextManager.getInstance().onStack(this);
|
||||
mNotificationManual = findViewById(R.id.pNotificationManual);
|
||||
mSettingNotificationViewController = new settingNotificationViewController(this, new settingNotificationViewCallback(), mNotificationManual);
|
||||
|
@ -44,8 +46,9 @@ public class settingNotificationController extends AppCompatActivity {
|
|||
mSettingNotificationModel = new settingNotificationModel(new settingNotificationModelCallback());
|
||||
}
|
||||
|
||||
/* LISTENERS */
|
||||
public class settingNotificationViewCallback implements eventObserver.eventListener{
|
||||
/*View Callbacks*/
|
||||
|
||||
private class settingNotificationViewCallback implements eventObserver.eventListener{
|
||||
|
||||
@Override
|
||||
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
|
||||
public Object invokeObserver(List<Object> data, Object e_type)
|
||||
|
@ -69,14 +73,15 @@ public class settingNotificationController extends AppCompatActivity {
|
|||
@Override
|
||||
public void onResume()
|
||||
{
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
activityContextManager.getInstance().setCurrentActivity(this);
|
||||
super.onResume();
|
||||
|
||||
int notificationStatus = pluginController.getInstance().getNotificationStatus();
|
||||
int notificationStatus = status.sBridgeNotificationManual;
|
||||
if(notificationStatus==0){
|
||||
pluginController.getInstance().disableTorNotification();
|
||||
} else if(notificationStatus==1){
|
||||
pluginController.getInstance().enableTorNotification();
|
||||
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION);
|
||||
} else{
|
||||
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.helperManager.eventObserver;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
class settingNotificationModel
|
||||
|
@ -27,14 +30,10 @@ class settingNotificationModel
|
|||
|
||||
int mStatus = pStatus ? 1 : 0;
|
||||
status.sBridgeNotificationManual = mStatus;
|
||||
pluginController.getInstance().setNotificationStatus(mStatus);
|
||||
int notificationStatus = pluginController.getInstance().getNotificationStatus();
|
||||
if(notificationStatus==0){
|
||||
pluginController.getInstance().disableTorNotification();
|
||||
} else if(notificationStatus==1){
|
||||
pluginController.getInstance().enableTorNotification();
|
||||
}else {
|
||||
pluginController.getInstance().enableTorNotificationNoBandwidth();
|
||||
if(!pStatus){
|
||||
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION);
|
||||
} else{
|
||||
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_ENABLE_NOTIFICATION);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
|||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
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.google.android.material.switchmaterial.SwitchMaterial;
|
||||
import java.util.ArrayList;
|
||||
|
@ -35,15 +36,15 @@ public class settingPrivacyController extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
pluginController.getInstance().onCreate(this);
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.setting_privacy_view);
|
||||
|
||||
viewsInitializations();
|
||||
initializeListeners();
|
||||
}
|
||||
|
||||
public void viewsInitializations() {
|
||||
private void viewsInitializations() {
|
||||
mJavaScript = findViewById(R.id.pJavascript);
|
||||
mDoNotTrack = findViewById(R.id.pDoNotTrack);
|
||||
mTrackingProtection = findViewById(R.id.pTrackingProtection);
|
||||
|
@ -58,12 +59,9 @@ public class settingPrivacyController extends AppCompatActivity {
|
|||
mSettingPrivacyModel = new settingPrivacyModel(new settingPrivacyController.settingAccessibilityModelCallback());
|
||||
}
|
||||
|
||||
public void onOpenInfo(View view) {
|
||||
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
|
||||
}
|
||||
/*View Callbacks*/
|
||||
|
||||
/* LISTENERS */
|
||||
public class settingAccessibilityViewCallback implements eventObserver.eventListener{
|
||||
private class settingAccessibilityViewCallback implements eventObserver.eventListener{
|
||||
|
||||
@Override
|
||||
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
|
||||
public Object invokeObserver(List<Object> data, Object e_type)
|
||||
|
@ -82,9 +81,6 @@ public class settingPrivacyController extends AppCompatActivity {
|
|||
}
|
||||
}
|
||||
|
||||
public void initializeListeners(){
|
||||
}
|
||||
|
||||
/* LOCAL OVERRIDES */
|
||||
|
||||
@Override
|
||||
|
@ -93,6 +89,7 @@ public class settingPrivacyController extends AppCompatActivity {
|
|||
if(mSettingChanged){
|
||||
activityContextManager.getInstance().setCurrentActivity(this);
|
||||
}
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
|
@ -106,12 +103,14 @@ public class settingPrivacyController extends AppCompatActivity {
|
|||
public void onBackPressed() {
|
||||
if(mSettingChanged){
|
||||
activityContextManager.getInstance().setCurrentActivity(this);
|
||||
activityContextManager.getInstance().getHomeController().initRuntimeSettings();
|
||||
}
|
||||
activityContextManager.getInstance().onRemoveStack(this);
|
||||
finish();
|
||||
}
|
||||
|
||||
/*UI Redirection*/
|
||||
|
||||
public void onClose(View view){
|
||||
onBackPressed();
|
||||
}
|
||||
|
@ -127,7 +126,7 @@ public class settingPrivacyController extends AppCompatActivity {
|
|||
mSettingChanged = true;
|
||||
mSettingPrivacyModel.onTrigger(settingPrivacyEnums.ePrivacyModel.M_SET_DONOT_TRACK, Collections.singletonList(!status.sStatusDoNotTrack));
|
||||
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){
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
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.helperMethod;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
import java.util.ArrayList;
|
||||
|
@ -32,14 +33,14 @@ public class settingSearchController extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
pluginController.getInstance().onCreate(this);
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.setting_search_view);
|
||||
|
||||
viewsInitializations();
|
||||
}
|
||||
|
||||
public void viewsInitializations() {
|
||||
private void viewsInitializations() {
|
||||
mSearchEngines.add(findViewById(R.id.mRadioSearch_1));
|
||||
mSearchEngines.add(findViewById(R.id.mRadioSearch_2));
|
||||
mSearchEngines.add(findViewById(R.id.mRadioSearch_3));
|
||||
|
@ -53,6 +54,57 @@ public class settingSearchController extends AppCompatActivity {
|
|||
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) {
|
||||
if(view.getId() == R.id.pOption1){
|
||||
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);
|
||||
}
|
||||
|
||||
/* 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;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
||||
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.settingManager.accessibilityManager.settingAccessibilityController;
|
||||
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.searchEngineManager.settingSearchController;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.constants.enums;
|
||||
import com.darkweb.genesissearchengine.constants.keys;
|
||||
import com.darkweb.genesissearchengine.constants.status;
|
||||
import com.darkweb.genesissearchengine.constants.strings;
|
||||
import com.darkweb.genesissearchengine.dataManager.dataController;
|
||||
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
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 settingController extends AppCompatActivity
|
||||
public class settingHomeController extends AppCompatActivity
|
||||
{
|
||||
/*Private Observer Classes*/
|
||||
|
||||
private settingViewController mSettingViewController;
|
||||
private settingModel mSettingModel;
|
||||
private settingHomeViewController mSettingViewController;
|
||||
private settingHomeModel mSettingModel;
|
||||
|
||||
/*Initializations*/
|
||||
|
||||
public settingController(){
|
||||
mSettingModel = new settingModel(new settingModelCallback());
|
||||
public settingHomeController(){
|
||||
mSettingModel = new settingHomeModel(new settingModelCallback());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
onInitTheme();
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.setting);
|
||||
|
||||
pluginController.getInstance().onCreate(this);
|
||||
viewsInitializations();
|
||||
listenersInitializations();
|
||||
}
|
||||
|
||||
public void onInitTheme(){
|
||||
|
||||
status.mThemeApplying = true;
|
||||
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);
|
||||
}else {
|
||||
if((getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_NO){
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
||||
}else {
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void applyTheme(){
|
||||
recreate();
|
||||
}
|
||||
|
||||
public void viewsInitializations()
|
||||
private void viewsInitializations()
|
||||
{
|
||||
activityContextManager.getInstance().setSettingController(this);
|
||||
mSettingViewController = new settingViewController(this, new settingModelCallback());
|
||||
mSettingViewController = new settingHomeViewController(this, new settingViewCallback());
|
||||
}
|
||||
|
||||
public void listenersInitializations()
|
||||
private void listenersInitializations()
|
||||
{
|
||||
pluginController.getInstance().logEvent(strings.EVENT_SETTINGS_OPENED);
|
||||
}
|
||||
|
||||
/*View Callbacks*/
|
||||
|
||||
private class settingViewCallback implements eventObserver.eventListener{
|
||||
|
||||
@Override
|
||||
public Object invokeObserver(List<Object> data, Object e_type)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*Model Callbacks*/
|
||||
|
||||
private class settingModelCallback implements eventObserver.eventListener{
|
||||
|
||||
@Override
|
||||
public Object invokeObserver(List<Object> data, Object e_type)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*Local Overrides*/
|
||||
|
@ -106,11 +101,10 @@ public class settingController extends AppCompatActivity
|
|||
@Override
|
||||
public void onResume()
|
||||
{
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
activityContextManager.getInstance().setCurrentActivity(this);
|
||||
status.sSettingIsAppPaused = false;
|
||||
onInitTheme();
|
||||
activityContextManager.getInstance().onStack(this);
|
||||
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
|
@ -127,6 +121,16 @@ public class settingController extends AppCompatActivity
|
|||
finish();
|
||||
}
|
||||
|
||||
/*External Redirection*/
|
||||
|
||||
public void onRedrawXML(){
|
||||
setContentView(R.layout.setting);
|
||||
}
|
||||
|
||||
public void onReInitTheme(){
|
||||
recreate();
|
||||
}
|
||||
|
||||
/*UI Redirection*/
|
||||
|
||||
public void onNavigationBackPressed(View view){
|
||||
|
@ -137,7 +141,7 @@ public class settingController extends AppCompatActivity
|
|||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
startActivity(new Intent(android.provider.Settings.ACTION_MANAGE_DEFAULT_APPS_SETTINGS));
|
||||
}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) {
|
||||
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) {
|
||||
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;
|
||||
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);
|
||||
}
|
||||
|
||||
/*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 {
|
||||
M_INIT
|
||||
}
|
||||
|
||||
}
|
|
@ -2,7 +2,7 @@ package com.darkweb.genesissearchengine.appManager.settingManager.settingHomePag
|
|||
|
||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
|
||||
class settingModel
|
||||
class settingHomeModel
|
||||
{
|
||||
/*Variable Declaration*/
|
||||
|
||||
|
@ -10,7 +10,7 @@ class settingModel
|
|||
|
||||
/*Initializations*/
|
||||
|
||||
settingModel(eventObserver.eventListener mEvent){
|
||||
settingHomeModel(eventObserver.eventListener mEvent){
|
||||
this.mEvent = mEvent;
|
||||
}
|
||||
|
|
@ -9,8 +9,9 @@ import androidx.appcompat.app.AppCompatDelegate;
|
|||
import androidx.core.content.ContextCompat;
|
||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
import com.example.myapplication.R;
|
||||
import java.util.List;
|
||||
|
||||
class settingViewController
|
||||
class settingHomeViewController
|
||||
{
|
||||
/*Private Variables*/
|
||||
|
||||
|
@ -19,7 +20,7 @@ class settingViewController
|
|||
|
||||
/*Initializations*/
|
||||
|
||||
settingViewController(settingController mContext, eventObserver.eventListener mEvent)
|
||||
settingHomeViewController(settingHomeController mContext, eventObserver.eventListener mEvent)
|
||||
{
|
||||
this.mEvent = mEvent;
|
||||
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.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
|
@ -19,18 +17,17 @@ import androidx.recyclerview.widget.SimpleItemAnimator;
|
|||
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
||||
import com.darkweb.genesissearchengine.appManager.homeManager.geckoSession;
|
||||
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.keys;
|
||||
import com.darkweb.genesissearchengine.constants.status;
|
||||
import com.darkweb.genesissearchengine.constants.strings;
|
||||
import com.darkweb.genesissearchengine.dataManager.dataController;
|
||||
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.google.android.gms.ads.AdSize;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -63,7 +60,7 @@ public class tabController extends AppCompatActivity
|
|||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState){
|
||||
pluginController.getInstance().onCreate(this);
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.tab_view);
|
||||
}
|
||||
|
@ -83,7 +80,6 @@ public class tabController extends AppCompatActivity
|
|||
mContextManager = activityContextManager.getInstance();
|
||||
mHomeController = activityContextManager.getInstance().getHomeController();
|
||||
mContextManager.setTabController(this);
|
||||
pluginController.getInstance().logEvent(strings.EVENT_TAB_OPENED);
|
||||
}
|
||||
|
||||
public void initializeViews(){
|
||||
|
@ -247,14 +243,15 @@ public class tabController extends AppCompatActivity
|
|||
}
|
||||
else if(pView.getId() == R.id.pCloseTab){
|
||||
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);
|
||||
mCounter-=1;
|
||||
mCounterActual -= 1;
|
||||
}
|
||||
}
|
||||
else if(pView.getId() == R.id.pOpenSetting){
|
||||
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
|
||||
public void onResume()
|
||||
{
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
activityContextManager.getInstance().setCurrentActivity(this);
|
||||
status.sSettingIsAppPaused = false;
|
||||
activityContextManager.getInstance().onStack(this);
|
||||
|
|
|
@ -108,7 +108,7 @@ class tabViewController
|
|||
}
|
||||
}
|
||||
|
||||
private void onOpenTabMenu(View view) {
|
||||
public void onOpenTabMenu(View view) {
|
||||
onCloseTabMenu();
|
||||
LayoutInflater layoutInflater = (LayoutInflater) view.getContext().getSystemService(LAYOUT_INFLATER_SERVICE);
|
||||
@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_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_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*/
|
||||
|
||||
|
@ -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 = "https://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_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_WIKI_URL = "https://en.wikipedia.org/wiki/$s";
|
||||
|
||||
|
@ -39,15 +40,15 @@ public class 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*/
|
||||
|
||||
public static final String HISTORY_LOAD_MORE = "loading_more";
|
||||
public static final String CONST_HISTORY_LOAD_MORE = "loading_more";
|
||||
|
||||
/*BOOKMARK CONSTANTS*/
|
||||
|
||||
public static final String BOOKMARK_LOAD_MORE = "loading_more";
|
||||
public static final String CONST_BOOKMARK_LOAD_MORE = "loading_more";
|
||||
|
||||
/*MENU CONSTANTS*/
|
||||
|
||||
|
@ -61,14 +62,27 @@ public class constants
|
|||
public static final int CONST_MAX_BOOKMARK_SIZE =500;
|
||||
public static final String CONST_DATABASE_NAME ="genesis_dbase";
|
||||
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*/
|
||||
|
||||
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,
|
||||
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,
|
||||
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*/
|
||||
|
@ -24,8 +24,4 @@ public class enums
|
|||
public static final int M_IMAGE_LOADED_SUCCESSFULLY = 1;
|
||||
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*/
|
||||
|
||||
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_FIRST_INSTALLED = "FIRST_INSTALLED";
|
||||
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 sSettingRedirectStatus = strings.GENERIC_EMPTY_STR;
|
||||
public static String sSettingLanguage = "en";
|
||||
public static String sSettingLanguageRegion = "Us";
|
||||
|
||||
public static boolean sSettingEnableZoom = 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.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.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));
|
||||
|
|
|
@ -22,6 +22,7 @@ public class strings
|
|||
/*Bookmark Manager*/
|
||||
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_DEFAULT_TITLE = "New Bookmark";
|
||||
|
||||
/*Bridge Manager*/
|
||||
|
||||
|
@ -34,21 +35,25 @@ public class strings
|
|||
public static final String GENERIC_EMPTY_STR = "";
|
||||
public static final String GENERIC_EMPTY_SPACE = " ";
|
||||
|
||||
/*Language Manager*/
|
||||
public static final String LANGUAGE_NOT_SUPPORTED = "not supported";
|
||||
|
||||
/*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_NEW_TAB_URL = "about:blank";
|
||||
public static final String SETTING_DEFAULT_LANGUAGE_REGION = "Us";
|
||||
|
||||
/*Home Manager*/
|
||||
|
||||
public static final String HOME_BLANK_PAGE = "about:blank";
|
||||
|
||||
/*Message Manager*/
|
||||
|
||||
public static final String MESSAGE_PLAYSTORE_NOT_FOUND = "Playstore Not Found";
|
||||
|
||||
/*Events*/
|
||||
|
||||
public static final String EVENT_APP_STARTED = "APP_STARTED";
|
||||
public static final String EVENT_SEARCH_SWITCH = "SEARCH_SWITCH";
|
||||
/* public static final String EVENT_APP_STARTED = "APP_STARTED";
|
||||
public static final String EVENT_SETTINGS_OPENED = "SETTINGS_OPENED";
|
||||
public static final String EVENT_URL_BOOKMARKED = "URL_BOOKMARKED";
|
||||
public static final String EVENT_BOOKMARK_OPENED = "BOOKMARK_OPENED";
|
||||
|
@ -57,11 +62,10 @@ public class strings
|
|||
public static final String EVENT_HISTORY_OPENED = "HISTORY_OPENED";
|
||||
public static final String EVENT_HISTORY_TRIGGERED = "HISTORY_TRIGGERED";
|
||||
public static final String EVENT_BOOKMARK_TRIGGERED = "BOOKMARK_TRIGGERED";
|
||||
public static final String EVENT_TAB_TRIGGERED = "TAB_TRIGGERED";
|
||||
public static final String EVENT_PAGE_OPENED_SUCCESS = "PAGE_OPENED_SUCCESS";
|
||||
public static final String EVENT_HOME_INVOKED = "HOME_INVOKED";
|
||||
public static final String EVENT_SEARCH_INVOKED = "SEARCH_INVOKED";
|
||||
public static final String EVENT_MENU_INVOKED = "MENU_INVOKED";
|
||||
public static final String EVENT_ON_BACK = "ON_BACK";
|
||||
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.historyManager.historyRowModel;
|
||||
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.List;
|
||||
|
@ -43,7 +45,7 @@ public class bookmarkDataModel {
|
|||
|
||||
if(pTitle.equals(""))
|
||||
{
|
||||
pTitle = "New_Bookmark"+autoval;
|
||||
pTitle = strings.BOOKMARK_DEFAULT_TITLE+autoval;
|
||||
}
|
||||
|
||||
String[] params = new String[2];
|
||||
|
@ -73,11 +75,13 @@ public class bookmarkDataModel {
|
|||
pQuery = pQuery.toLowerCase();
|
||||
ArrayList<historyRowModel> mModel = new ArrayList<>();
|
||||
|
||||
for(int count = 0; count<= mBookmarks.size()-1 && mBookmarks.size()<500; count++){
|
||||
if(mBookmarks.get(count).getHeader().toLowerCase().contains(pQuery)){
|
||||
mModel.add(0, 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));
|
||||
if(status.sSettingSearchHistory) {
|
||||
for (int count = 0; count <= mBookmarks.size() - 1 && mBookmarks.size() < 500; count++) {
|
||||
if (mBookmarks.get(count).getHeader().toLowerCase().contains(pQuery)) {
|
||||
mModel.add(0, 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;
|
||||
|
|
|
@ -150,7 +150,9 @@ public class historyDataModel {
|
|||
}
|
||||
|
||||
public ArrayList<historyRowModel> getSuggestions(String pQuery, ArrayList<historyRowModel> pList){
|
||||
|
||||
String mQueryOriginal = pQuery;
|
||||
if(status.sSettingSearchHistory){
|
||||
pQuery = pQuery.toLowerCase();
|
||||
for(int count = 0; count<= mHistory.size()-1 && mHistory.size()<500; count++){
|
||||
historyRowModel mTempModel = null;
|
||||
|
@ -166,6 +168,7 @@ public class historyDataModel {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ArrayList<historyRowModel> mDefaultSuggestions = initSuggestions();
|
||||
for(int count = 0; count<= mDefaultSuggestions.size()-1 && mDefaultSuggestions.size()<500; count++){
|
||||
|
@ -180,10 +183,8 @@ public class historyDataModel {
|
|||
}
|
||||
}
|
||||
|
||||
ArrayList<String> mDuplicateHandler = new ArrayList<>();
|
||||
|
||||
|
||||
/*Duplicate handler*/
|
||||
ArrayList<String> mDuplicateHandler = new ArrayList<>();
|
||||
for(int mCounter=0;mCounter<pList.size();mCounter++){
|
||||
if(mDuplicateHandler.contains(pList.get(mCounter).getDescription())){
|
||||
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){
|
||||
int sepPos = pQuery.indexOf(".");
|
||||
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));
|
||||
|
||||
}
|
||||
|
||||
return pList;
|
||||
|
|
|
@ -59,10 +59,12 @@ class tabDataModel
|
|||
void clearTab() {
|
||||
int size = mTabs.size();
|
||||
for(int counter = 0; counter< size; counter++){
|
||||
if(mTabs.size()>0){
|
||||
mTabs.get(0).getSession().stop();
|
||||
mTabs.get(0).getSession().closeSession();
|
||||
mTabs.remove(0);
|
||||
}
|
||||
}
|
||||
if(mTabs.size()>0){
|
||||
mTabs.get(0).getSession().closeSession();
|
||||
}
|
||||
|
|
|
@ -21,19 +21,6 @@ public class LocaleManager {
|
|||
}
|
||||
|
||||
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) {
|
||||
|
|
|
@ -54,6 +54,7 @@ import javax.net.ssl.HttpsURLConnection;
|
|||
import static android.content.Context.LAYOUT_INFLATER_SERVICE;
|
||||
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
|
||||
import static android.content.Intent.FLAG_ACTIVITY_NO_ANIMATION;
|
||||
import static com.darkweb.genesissearchengine.constants.constants.CONST_PLAYSTORE_URL;
|
||||
|
||||
public class helperMethod
|
||||
{
|
||||
|
@ -189,7 +190,7 @@ public class helperMethod
|
|||
.setType("text/plain")
|
||||
.setChooserTitle("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();
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
char[] chars = string.toLowerCase().toCharArray();
|
||||
boolean found = false;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.darkweb.genesissearchengine.pluginManager;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
import com.google.android.gms.ads.*;
|
||||
|
||||
import java.util.List;
|
||||
import static com.darkweb.genesissearchengine.constants.status.sPaidStatus;
|
||||
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eAdManagerCallbacks.M_SHOW_LOADED_ADS;
|
||||
|
||||
class adManager
|
||||
{
|
||||
|
@ -21,30 +21,40 @@ class adManager
|
|||
|
||||
/*Initializations*/
|
||||
|
||||
adManager(AppCompatActivity app_context, eventObserver.eventListener event, AdView banner_ads) {
|
||||
this.mAppContext = app_context;
|
||||
this.mEvent = event;
|
||||
mBannerAds = banner_ads;
|
||||
adManager(AppCompatActivity pAppContext, eventObserver.eventListener pEvent, AdView pBannerAds) {
|
||||
this.mAppContext = pAppContext;
|
||||
this.mEvent = pEvent;
|
||||
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 (!bannerAdsLoading)
|
||||
{
|
||||
bannerAdsLoading = true;
|
||||
MobileAds.initialize(mAppContext, constants.CONST_ADMOB_KEY);
|
||||
MobileAds.initialize(mAppContext, initializationStatus -> { });
|
||||
mBannerAds.setAlpha(0f);
|
||||
initializeBannerAds();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean isAdvertLoaded(){
|
||||
private boolean isAdvertLoaded(){
|
||||
return bannerAdsLoaded;
|
||||
}
|
||||
|
||||
/*Local Helper Methods*/
|
||||
/*Local Listeners*/
|
||||
|
||||
private void admobListeners(){
|
||||
if(!sPaidStatus){
|
||||
|
@ -52,11 +62,7 @@ class adManager
|
|||
@Override
|
||||
public void onAdLoaded() {
|
||||
bannerAdsLoaded = true;
|
||||
mEvent.invokeObserver(null,null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAdFailedToLoad(int errorCode) {
|
||||
mEvent.invokeObserver(null,M_SHOW_LOADED_ADS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -78,13 +84,17 @@ class adManager
|
|||
}
|
||||
}
|
||||
|
||||
/*External Helper Methods*/
|
||||
/*External Triggers*/
|
||||
|
||||
private void initializeBannerAds(){
|
||||
if(!sPaidStatus){
|
||||
AdRequest request = new AdRequest.Builder().build();
|
||||
mBannerAds.loadAd(request);
|
||||
admobListeners();
|
||||
Object onTrigger(List<Object> pData, pluginEnums.eAdManager pEventType) {
|
||||
if(pEventType.equals(pluginEnums.eAdManager.M_INITIALIZE_BANNER_ADS))
|
||||
{
|
||||
loadAds();
|
||||
}
|
||||
else if(pEventType.equals(pluginEnums.eAdManager.M_IS_ADVERT_LOADED))
|
||||
{
|
||||
return isAdvertLoaded();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,57 +1,43 @@
|
|||
package com.darkweb.genesissearchengine.pluginManager;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
|
||||
import java.util.UUID;
|
||||
import com.flurry.android.FlurryAgent;
|
||||
import java.util.List;
|
||||
|
||||
class analyticManager
|
||||
{
|
||||
/*Private Variables */
|
||||
/*Private Variables*/
|
||||
|
||||
private AppCompatActivity mAppContext;
|
||||
private String mUniqueID = null;
|
||||
|
||||
/*Initializations*/
|
||||
|
||||
analyticManager(AppCompatActivity app_context, eventObserver.eventListener event){
|
||||
this.mAppContext = app_context;
|
||||
analyticManager(AppCompatActivity pAppContext, eventObserver.eventListener pEvent){
|
||||
this.mAppContext = pAppContext;
|
||||
initialize();
|
||||
}
|
||||
|
||||
private void initialize(){
|
||||
final String PREF_UNIQUE_ID = constants.CONST_UNIQUE_KEY_ID;
|
||||
|
||||
if (mUniqueID == null)
|
||||
private void initialize()
|
||||
{
|
||||
SharedPreferences sharedPrefs = mAppContext.getSharedPreferences(
|
||||
PREF_UNIQUE_ID, Context.MODE_PRIVATE);
|
||||
mUniqueID = sharedPrefs.getString(PREF_UNIQUE_ID, null);
|
||||
if (mUniqueID == null) {
|
||||
|
||||
new Thread(){
|
||||
public void run(){
|
||||
try{
|
||||
mUniqueID = UUID.randomUUID().toString();
|
||||
}catch (Exception ex){
|
||||
mUniqueID = UUID.randomUUID().toString();
|
||||
new FlurryAgent.Builder()
|
||||
.withLogEnabled(true)
|
||||
.build(mAppContext, "BKFSCH4CRS6RB9HSCM9H");
|
||||
}
|
||||
|
||||
SharedPreferences.Editor editor = sharedPrefs.edit();
|
||||
editor.putString(PREF_UNIQUE_ID, mUniqueID);
|
||||
editor.apply();
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
/*External Triggers*/
|
||||
|
||||
private void logEvent(String pValue)
|
||||
{
|
||||
if(FlurryAgent.isSessionActive()){
|
||||
FlurryAgent.logEvent(pValue);
|
||||
}
|
||||
}
|
||||
|
||||
/*Helper Methods*/
|
||||
|
||||
void logUser(){
|
||||
void onTrigger(List<Object> pData, pluginEnums.eAnalyticManager pEventType) {
|
||||
if(pEventType.equals(pluginEnums.eAnalyticManager.M_LOG_EVENT))
|
||||
{
|
||||
//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.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.darkweb.genesissearchengine.helperManager.LocaleManager;
|
||||
import com.darkweb.genesissearchengine.constants.status;
|
||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
class langManager
|
||||
{
|
||||
class langManager {
|
||||
|
||||
/*Private Variables*/
|
||||
|
||||
private AppCompatActivity mAppContext;
|
||||
private eventObserver.eventListener mEvent;
|
||||
private Locale language;
|
||||
private LocaleManager mLocaleManguage;
|
||||
private Locale mLanguage;
|
||||
|
||||
/*Initializations*/
|
||||
|
||||
langManager(AppCompatActivity mAppContext, eventObserver.eventListener mEvent){
|
||||
this.mAppContext = mAppContext;
|
||||
this.mEvent = mEvent;
|
||||
initialize();
|
||||
langManager(AppCompatActivity pAppContext, eventObserver.eventListener pEvent, Locale pLanguage) {
|
||||
this.mAppContext = pAppContext;
|
||||
this.mEvent = pEvent;
|
||||
this.mLanguage = pLanguage;
|
||||
|
||||
onInitLanguage(pAppContext);
|
||||
}
|
||||
|
||||
private void initialize(){
|
||||
mLocaleManguage = new LocaleManager();
|
||||
private void onInitLanguage(AppCompatActivity pAppContext) {
|
||||
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);
|
||||
}
|
||||
|
||||
void setDefaultLanguage(Locale language){
|
||||
this.language = language;
|
||||
onSaveLanguage();
|
||||
Locale.setDefault(mLanguage);
|
||||
Resources resources = pAppContext.getResources();
|
||||
Configuration config = resources.getConfiguration();
|
||||
config.setLocale(mLanguage);
|
||||
resources.updateConfiguration(config, resources.getDisplayMetrics());
|
||||
}
|
||||
|
||||
private void onSaveLanguage(){
|
||||
Configuration configuration = mAppContext.getResources().getConfiguration();
|
||||
configuration.locale = this.language;
|
||||
mAppContext.getResources().updateConfiguration(
|
||||
configuration,
|
||||
mAppContext.getResources().getDisplayMetrics()
|
||||
);
|
||||
/*Helper Methods*/
|
||||
|
||||
private void onCreate(AppCompatActivity pActivity) {
|
||||
onInitLanguage(pActivity);
|
||||
}
|
||||
|
||||
/*External Locale Requrest Manager*/
|
||||
|
||||
public void onCreate(Activity activity) {
|
||||
mLocaleManguage.onCreate(activity);
|
||||
private void onResume(AppCompatActivity pActivity) {
|
||||
onInitLanguage(pActivity);
|
||||
}
|
||||
|
||||
public void onResume(Activity activity) {
|
||||
mLocaleManguage.onResume(activity);
|
||||
private String getSupportedSystemLanguageInfo() {
|
||||
if(status.sSettingLanguage.equals("default")){
|
||||
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")){
|
||||
return "Default | " + mSystemLocale.getDisplayName();
|
||||
}else {
|
||||
return mSystemLocale.getDisplayName() + " | is unsupported";
|
||||
}
|
||||
}else {
|
||||
return mLanguage.getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
/*External Triggers*/
|
||||
|
||||
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;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
|
@ -13,142 +11,128 @@ import android.net.Uri;
|
|||
import android.os.Handler;
|
||||
import android.view.Gravity;
|
||||
import android.view.Window;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.RatingBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
||||
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.helperManager.eventObserver;
|
||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||
import com.example.myapplication.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
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
|
||||
{
|
||||
/*Private Variables*/
|
||||
|
||||
private List<Object> data;
|
||||
|
||||
private List<Object> mData;
|
||||
private AppCompatActivity mContext;
|
||||
private eventObserver.eventListener event;
|
||||
|
||||
|
||||
Dialog dialog = null;
|
||||
private eventObserver.eventListener mEvent;
|
||||
private Dialog mDialog = null;
|
||||
|
||||
/*Initializations*/
|
||||
|
||||
private void initializeDialog(int pLayout, int pGravity){
|
||||
if(dialog!=null && dialog.isShowing()){
|
||||
dialog.dismiss();
|
||||
if(mDialog !=null && mDialog.isShowing()){
|
||||
mDialog.dismiss();
|
||||
}
|
||||
|
||||
dialog = new Dialog(mContext);
|
||||
dialog.getWindow().setGravity(pGravity);
|
||||
dialog.getWindow().getAttributes().windowAnimations = R.style.dialiog_animation;
|
||||
mDialog = new Dialog(mContext);
|
||||
mDialog.getWindow().setGravity(pGravity);
|
||||
mDialog.getWindow().getAttributes().windowAnimations = R.style.dialiog_animation;
|
||||
|
||||
Drawable myDrawable;
|
||||
Resources res = mContext.getResources();
|
||||
try {
|
||||
myDrawable = Drawable.createFromXml(res, res.getXml(R.xml.hox_rounded_corner));
|
||||
dialog.getWindow().setBackgroundDrawable(myDrawable);
|
||||
mDialog.getWindow().setBackgroundDrawable(myDrawable);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
dialog.setCancelable(true);
|
||||
dialog.setContentView(pLayout);
|
||||
dialog.show();
|
||||
mDialog.setCancelable(true);
|
||||
mDialog.setContentView(pLayout);
|
||||
|
||||
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)
|
||||
{
|
||||
this.event = event;
|
||||
this.mEvent = event;
|
||||
}
|
||||
|
||||
/*Helper Methods*/
|
||||
private void welcomeMessage()
|
||||
{
|
||||
initializeDialog(R.layout.popup_welcome, Gravity.CENTER);
|
||||
dialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(constants.CONST_BLACK_MARKET_URL), enums.eMessageEnums.M_WELCOME);
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(constants.CONST_BLACK_MARKET_URL), M_OPEN_LINK_CURRENT_TAB);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
dialog.findViewById(R.id.pOption2).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(constants.CONST_LEAKED_DOCUMENT_URL), enums.eMessageEnums.M_WELCOME);
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pOption2).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(constants.CONST_LEAKED_DOCUMENT_URL), M_OPEN_LINK_CURRENT_TAB);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
dialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(constants.CONST_NEWS_URL), enums.eMessageEnums.M_WELCOME);
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(constants.CONST_NEWS_URL), M_OPEN_LINK_CURRENT_TAB);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
dialog.findViewById(R.id.pOption4).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(constants.CONST_SOFTWARE_URL), enums.eMessageEnums.M_WELCOME);
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pOption4).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(constants.CONST_SOFTWARE_URL), M_OPEN_LINK_CURRENT_TAB);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
dialog.findViewById(R.id.pOption5).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(constants.CONST_SOFTWARE_FINANCE), enums.eMessageEnums.M_WELCOME);
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pOption5).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(constants.CONST_SOFTWARE_FINANCE), M_OPEN_LINK_CURRENT_TAB);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
dialog.findViewById(R.id.pOption6).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(constants.CONST_COMMUNITIES), enums.eMessageEnums.M_WELCOME);
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pOption6).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(constants.CONST_COMMUNITIES), M_OPEN_LINK_CURRENT_TAB);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
dialog.findViewById(R.id.pDontShowAgain).setOnClickListener(v -> {
|
||||
event.invokeObserver(null, enums.eMessageEnums.M_CANCEL_WELCOME);
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pDontShowAgain).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(null, M_CANCEL_WELCOME);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint("QueryPermissionsNeeded")
|
||||
private void abiError()
|
||||
private void languageSupportFailure()
|
||||
{
|
||||
initializeDialog(R.layout.popup_abi_error, Gravity.CENTER);
|
||||
dialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
|
||||
dialog.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);
|
||||
}
|
||||
});
|
||||
initializeDialog(R.layout.popup_language_support, Gravity.CENTER);
|
||||
((TextView) mDialog.findViewById(R.id.pLanguage)).setText((mData.get(0).toString()));
|
||||
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||
}
|
||||
|
||||
private void rateFailure()
|
||||
{
|
||||
initializeDialog(R.layout.popup_rate_failure, Gravity.CENTER);
|
||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||
mDialog.dismiss();
|
||||
final Handler handler = new Handler();
|
||||
Runnable runnable = () -> {
|
||||
try{
|
||||
helperMethod.sendIssueEmail(mContext);
|
||||
}
|
||||
catch (Exception ex){
|
||||
createMessage(mContext,Collections.singletonList(mContext.getString(R.string.ALERT_NOT_SUPPORTED_MESSAGE)),enums.eMessageEnums.M_NOT_SUPPORTED);
|
||||
catch (Exception ex)
|
||||
{
|
||||
onTrigger(Arrays.asList(mContext, mContext.getString(R.string.ALERT_NOT_SUPPORTED_MESSAGE)),M_NOT_SUPPORTED);
|
||||
}
|
||||
};
|
||||
handler.postDelayed(runnable, 1000);
|
||||
|
@ -157,303 +141,258 @@ class messageManager
|
|||
|
||||
private void reportedSuccessfully()
|
||||
{
|
||||
initializeDialog(R.layout.popup_reported_successfully, Gravity.CENTER);
|
||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> dialog.dismiss());
|
||||
initializeDialog(R.layout.popup_reported_successfully, Gravity.BOTTOM);
|
||||
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> mDialog.dismiss());
|
||||
}
|
||||
|
||||
private void notSupportMessage()
|
||||
{
|
||||
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()
|
||||
{
|
||||
initializeDialog(R.layout.popup_data_cleared, Gravity.BOTTOM);
|
||||
|
||||
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());
|
||||
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||
}
|
||||
|
||||
|
||||
private void openSecureConnectionPopup()
|
||||
{
|
||||
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);
|
||||
|
||||
ColorDrawable back = new ColorDrawable(Color.TRANSPARENT);
|
||||
InsetDrawable inset = new InsetDrawable(back, 0,0,0,0);
|
||||
dialog.getWindow().setBackgroundDrawable(inset);
|
||||
dialog.setCancelable(true);
|
||||
dialog.setCanceledOnTouchOutside(true);
|
||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> { event.invokeObserver(null, enums.eMessageEnums.M_SECURE_CONNECTION); });
|
||||
mDialog.getWindow().setBackgroundDrawable(inset);
|
||||
mDialog.setCancelable(true);
|
||||
mDialog.setCanceledOnTouchOutside(true);
|
||||
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> mEvent.invokeObserver(null, M_SECURE_CONNECTION));
|
||||
|
||||
String mJavascript = "| Disabled";
|
||||
String mDoNotTrack = "| Disabled";
|
||||
String mTrackingProtection = "| Disabled";
|
||||
|
||||
if((boolean)data.get(1)){
|
||||
((SwitchMaterial)dialog.findViewById(R.id.pJSStatus)).setChecked(true);
|
||||
if((boolean) mData.get(1)){
|
||||
((SwitchMaterial) mDialog.findViewById(R.id.pJSStatus)).setChecked(true);
|
||||
}else {
|
||||
((SwitchMaterial)dialog.findViewById(R.id.pJSStatus)).setChecked(false);
|
||||
((SwitchMaterial) mDialog.findViewById(R.id.pJSStatus)).setChecked(false);
|
||||
}
|
||||
if((boolean)data.get(2)){
|
||||
((SwitchMaterial)dialog.findViewById(R.id.pDTStatus)).setChecked(true);
|
||||
if((boolean) mData.get(2)){
|
||||
((SwitchMaterial) mDialog.findViewById(R.id.pDTStatus)).setChecked(true);
|
||||
}else {
|
||||
((SwitchMaterial)dialog.findViewById(R.id.pDTStatus)).setChecked(false);
|
||||
((SwitchMaterial) mDialog.findViewById(R.id.pDTStatus)).setChecked(false);
|
||||
}
|
||||
if((boolean)data.get(3)){
|
||||
((SwitchMaterial)dialog.findViewById(R.id.pTPStatus)).setChecked(true);
|
||||
if((boolean) mData.get(3)){
|
||||
((SwitchMaterial) mDialog.findViewById(R.id.pTPStatus)).setChecked(true);
|
||||
}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)dialog.findViewById(R.id.pJSStatus)).setText(mJavascript);
|
||||
//((TextView)dialog.findViewById(R.id.pDTStatus)).setText(mDoNotTrack);
|
||||
//((TextView)dialog.findViewById(R.id.pTPStatus)).setText(mTrackingProtection);
|
||||
((TextView) mDialog.findViewById(R.id.pHeaderSubpart)).setText(helperMethod.getDomainName(mData.get(0).toString()));
|
||||
}
|
||||
|
||||
@SuppressLint("ResourceType")
|
||||
private void bookmark()
|
||||
{
|
||||
initializeDialog(R.layout.popup_create_bookmark, Gravity.CENTER);
|
||||
EditText mBoomMarkTitle = dialog.findViewById(R.id.pBookmark);
|
||||
dialog.setOnDismissListener(dialog -> {
|
||||
mContext.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
|
||||
|
||||
mDialog.setOnShowListener(dialog -> mContext.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING));
|
||||
mDialog.setOnDismissListener(dialog -> {
|
||||
final Handler handler = new Handler();
|
||||
Runnable runnable = () -> {
|
||||
helperMethod.hideKeyboard(activityContextManager.getInstance().getHomeController());
|
||||
dialog.dismiss();
|
||||
mContext.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||
};
|
||||
handler.postDelayed(runnable, 50);
|
||||
});
|
||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> {
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> {
|
||||
mDialog.dismiss();
|
||||
mContext.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||
helperMethod.hideKeyboard(activityContextManager.getInstance().getHomeController());
|
||||
});
|
||||
|
||||
mBoomMarkTitle.requestFocus();
|
||||
InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
|
||||
|
||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||
mDialog.dismiss();
|
||||
mContext.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||
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()
|
||||
{
|
||||
initializeDialog(R.layout.popup_clear_history, Gravity.CENTER);
|
||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||
dialog.dismiss();
|
||||
event.invokeObserver(null, enums.eMessageEnums.M_CLEAR_HISTORY);
|
||||
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||
mDialog.dismiss();
|
||||
mEvent.invokeObserver(null, M_CLEAR_HISTORY);
|
||||
});
|
||||
}
|
||||
|
||||
private void clearBookmark()
|
||||
{
|
||||
initializeDialog(R.layout.popup_clear_bookmark, Gravity.CENTER);
|
||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||
dialog.dismiss();
|
||||
event.invokeObserver(null, enums.eMessageEnums.M_CLEAR_BOOKMARK);
|
||||
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||
mDialog.dismiss();
|
||||
mEvent.invokeObserver(null, M_CLEAR_BOOKMARK);
|
||||
});
|
||||
}
|
||||
|
||||
private void reportURL()
|
||||
{
|
||||
initializeDialog(R.layout.popup_report_url, Gravity.CENTER);
|
||||
((TextView)dialog.findViewById(R.id.pHeader)).setText(data.get(0).toString());
|
||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||
dialog.dismiss();
|
||||
((TextView) mDialog.findViewById(R.id.pHeader)).setText(mData.get(0).toString());
|
||||
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||
mDialog.dismiss();
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint("QueryPermissionsNeeded")
|
||||
private void rateApp()
|
||||
{
|
||||
initializeDialog(R.layout.popup_rate_us, Gravity.CENTER);
|
||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||
RatingBar mRatingBar = dialog.findViewById(R.id.pRating);
|
||||
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||
RatingBar mRatingBar = mDialog.findViewById(R.id.pRating);
|
||||
if(mRatingBar.getRating()>=3){
|
||||
event.invokeObserver(null, enums.eMessageEnums.M_APP_RATED);
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.darkweb.genesissearchengine"));
|
||||
if(intent.resolveActivity(mContext.getPackageManager()) != null)
|
||||
{
|
||||
mEvent.invokeObserver(null, M_APP_RATED);
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(CONST_PLAYSTORE_URL));
|
||||
try {
|
||||
mContext.startActivity(intent);
|
||||
}else {
|
||||
helperMethod.showToastMessage("Playstore Not Found", mContext);
|
||||
} catch (Exception ignored) {
|
||||
helperMethod.showToastMessage(MESSAGE_PLAYSTORE_NOT_FOUND, mContext);
|
||||
}
|
||||
dialog.dismiss();
|
||||
|
||||
mDialog.dismiss();
|
||||
}else if(mRatingBar.getRating()>0) {
|
||||
event.invokeObserver(null, enums.eMessageEnums.M_APP_RATED);
|
||||
mEvent.invokeObserver(null, M_APP_RATED);
|
||||
final Handler handler = new Handler();
|
||||
handler.postDelayed(() -> createMessage(mContext,Collections.singletonList(strings.GENERIC_EMPTY_STR), enums.eMessageEnums.M_RATE_FAILURE), 1000);
|
||||
dialog.dismiss();
|
||||
handler.postDelayed(() -> onTrigger(Arrays.asList(strings.GENERIC_EMPTY_STR, mContext),M_RATE_FAILURE), 1000);
|
||||
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()
|
||||
{
|
||||
File f = new File(data.get(0).toString());
|
||||
String name = f.getName();
|
||||
String title = data.get(1).toString();
|
||||
String title = mData.get(2).toString();
|
||||
|
||||
int size = name.length();
|
||||
if(size>235){
|
||||
size = 235;
|
||||
if(title.length()>0){
|
||||
title = title + " | ";
|
||||
}
|
||||
|
||||
initializeDialog(R.layout.popup_file_longpress, Gravity.CENTER);
|
||||
((TextView)dialog.findViewById(R.id.pDescription)).setText((title + " | " + data.get(0).toString().substring(0,size)+"..."));
|
||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
||||
dialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_DOWNLOAD_FILE_MANUAL);
|
||||
dialog.dismiss();
|
||||
((TextView) mDialog.findViewById(R.id.pDescription)).setText((title + mData.get(0).toString()));
|
||||
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||
mDialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(mData.get(0)), M_DOWNLOAD_FILE_MANUAL);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
dialog.findViewById(R.id.pOption2).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_OPEN_LINK_CURRENT_TAB);
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pOption2).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(mData.get(0)), M_OPEN_LINK_CURRENT_TAB);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
dialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_COPY_LINK);
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(mData.get(0)), M_COPY_LINK);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
dialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_COPY_LINK);
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(mData.get(0)), M_COPY_LINK);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
private void openURLLongPress()
|
||||
{
|
||||
int size = data.get(0).toString().length()-1;
|
||||
String title = data.get(1).toString();
|
||||
|
||||
if(size>235){
|
||||
size = 235;
|
||||
}
|
||||
String title = mData.get(2).toString();
|
||||
|
||||
initializeDialog(R.layout.popup_url_longpress, Gravity.CENTER);
|
||||
((TextView)dialog.findViewById(R.id.pDescription)).setText((title + data.get(0).toString().substring(0,size)+"..."));
|
||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
||||
dialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_OPEN_LINK_NEW_TAB);
|
||||
dialog.dismiss();
|
||||
((TextView) mDialog.findViewById(R.id.pDescription)).setText((title + mData.get(0)));
|
||||
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||
mDialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(mData.get(0)), M_OPEN_LINK_NEW_TAB);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
dialog.findViewById(R.id.pOption2).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_OPEN_LINK_CURRENT_TAB);
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pOption2).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(mData.get(0)), M_OPEN_LINK_CURRENT_TAB);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
dialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_COPY_LINK);
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(mData.get(0)), M_COPY_LINK);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
private void popupDownloadFull(){
|
||||
String url = data.get(0).toString();
|
||||
String file = data.get(1).toString();
|
||||
String title = data.get(2).toString();
|
||||
String url = mData.get(0).toString();
|
||||
String file = mData.get(2).toString();
|
||||
String title = mData.get(3).toString();
|
||||
|
||||
String data_local = mContext.getString(R.string.ALERT_LONG_URL_MESSAGE);
|
||||
|
||||
int size = url.length();
|
||||
if(size>235){
|
||||
size = 235;
|
||||
if(!url.equals(strings.GENERIC_EMPTY_STR)){
|
||||
data_local = title + url;
|
||||
}
|
||||
|
||||
int size1 = file.length();
|
||||
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)+"...";
|
||||
else if(!file.equals(strings.GENERIC_EMPTY_STR)){
|
||||
data_local = file;
|
||||
}
|
||||
String mTitle = title;
|
||||
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);
|
||||
((TextView)dialog.findViewById(R.id.pHeader)).setText(mTitle);
|
||||
((TextView)dialog.findViewById(R.id.pDescription)).setText((data_local));
|
||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
||||
dialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_OPEN_LINK_NEW_TAB);
|
||||
dialog.dismiss();
|
||||
((TextView) mDialog.findViewById(R.id.pHeader)).setText(mTitle);
|
||||
((TextView) mDialog.findViewById(R.id.pDescription)).setText((data_local));
|
||||
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||
mDialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(url), M_OPEN_LINK_NEW_TAB);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
dialog.findViewById(R.id.pOption2).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_OPEN_LINK_CURRENT_TAB);
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pOption2).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(url), M_OPEN_LINK_CURRENT_TAB);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
dialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_COPY_LINK);
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(url), M_COPY_LINK);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
dialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_COPY_LINK);
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pOption4).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(file), M_OPEN_LINK_NEW_TAB);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
dialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_COPY_LINK);
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pOption5).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(file), M_OPEN_LINK_CURRENT_TAB);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
dialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_COPY_LINK);
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pOption6).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(file), M_COPY_LINK);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
dialog.findViewById(R.id.pOption3).setOnClickListener(v -> {
|
||||
event.invokeObserver(Collections.singletonList(data.get(0)), enums.eMessageEnums.M_COPY_LINK);
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pOption7).setOnClickListener(v -> {
|
||||
mEvent.invokeObserver(Collections.singletonList(file), M_DOWNLOAD_FILE_MANUAL);
|
||||
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()
|
||||
{
|
||||
initializeDialog(R.layout.popup_bridge_mail, Gravity.CENTER);
|
||||
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
|
||||
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||
dialog.dismiss();
|
||||
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||
mDialog.dismiss();
|
||||
final Handler handler = new Handler();
|
||||
Runnable runnable = () -> {
|
||||
try{
|
||||
helperMethod.sendBridgeEmail(mContext);
|
||||
}
|
||||
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);
|
||||
|
@ -461,91 +400,103 @@ class messageManager
|
|||
}
|
||||
|
||||
void onReset(){
|
||||
if(dialog!=null){
|
||||
dialog.dismiss();
|
||||
if(mDialog !=null){
|
||||
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;
|
||||
this.data = data;
|
||||
if(pEventType.equals(pluginEnums.eMessageManager.M_RESET)){
|
||||
onReset();
|
||||
}
|
||||
else {
|
||||
this.mContext = (AppCompatActivity) pData.get(pData.size()-1);
|
||||
this.mData = pData;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
switch (pEventType) {
|
||||
case M_WELCOME:
|
||||
/*VERIFIED*/
|
||||
welcomeMessage();
|
||||
break;
|
||||
|
||||
case M_ABI_ERROR:
|
||||
abiError();
|
||||
break;
|
||||
|
||||
case M_RATE_FAILURE:
|
||||
/*VERIFIED*/
|
||||
rateFailure();
|
||||
break;
|
||||
|
||||
case M_LANGUAGE_SUPPORT_FAILURE:
|
||||
/*VERIFIED*/
|
||||
languageSupportFailure();
|
||||
break;
|
||||
|
||||
case M_RATE_SUCCESS:
|
||||
/*VERIFIED*/
|
||||
reportedSuccessfully();
|
||||
break;
|
||||
|
||||
case M_BOOKMARK:
|
||||
/*VERIFIED*/
|
||||
bookmark();
|
||||
break;
|
||||
|
||||
case M_CLEAR_HISTORY:
|
||||
/*VERIFIED*/
|
||||
clearHistory();
|
||||
break;
|
||||
|
||||
case M_CLEAR_BOOKMARK:
|
||||
/*VERIFIED*/
|
||||
clearBookmark();
|
||||
break;
|
||||
|
||||
case M_REPORT_URL:
|
||||
/*VERIFIED*/
|
||||
reportURL();
|
||||
break;
|
||||
|
||||
case M_RATE_APP:
|
||||
/*VERIFIED*/
|
||||
rateApp();
|
||||
break;
|
||||
|
||||
case M_DOWNLOAD_FILE:
|
||||
downloadFile();
|
||||
break;
|
||||
|
||||
case M_START_ORBOT:
|
||||
startingOrbotInfo();
|
||||
break;
|
||||
|
||||
case M_LONG_PRESS_DOWNLOAD:
|
||||
/*VERIFIED*/
|
||||
downloadFileLongPress();
|
||||
break;
|
||||
|
||||
case M_LONG_PRESS_URL:
|
||||
/*VERIFIED*/
|
||||
openURLLongPress();
|
||||
break;
|
||||
|
||||
case M_LONG_PRESS_WITH_LINK:
|
||||
/*VERIFIED*/
|
||||
popupDownloadFull();
|
||||
break;
|
||||
|
||||
case M_BRIDGE_MAIL:
|
||||
/*VERIFIED*/
|
||||
sendBridgeMail();
|
||||
break;
|
||||
|
||||
case M_NOT_SUPPORTED:
|
||||
/*VERIFIED*/
|
||||
notSupportMessage();
|
||||
break;
|
||||
|
||||
case M_DATA_CLEARED:
|
||||
/*VERIFIED*/
|
||||
dataClearedSuccessfully();
|
||||
break;
|
||||
|
||||
case M_SECURE_CONNECTION:
|
||||
/*VERIFIED*/
|
||||
openSecureConnectionPopup();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,52 +9,67 @@ import android.content.Intent;
|
|||
import android.os.SystemClock;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
|
||||
import com.darkweb.genesissearchengine.constants.status;
|
||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
import com.darkweb.genesissearchengine.helperManager.userEngagementNotification;
|
||||
import com.example.myapplication.R;
|
||||
import java.util.List;
|
||||
import static com.darkweb.genesissearchengine.constants.constants.*;
|
||||
|
||||
class notifictionManager
|
||||
{
|
||||
/*Private Variables*/
|
||||
|
||||
private AppCompatActivity mAppContext;
|
||||
private NotificationManager mNotifManager;
|
||||
|
||||
/*Initializations*/
|
||||
|
||||
notifictionManager(AppCompatActivity app_context, eventObserver.eventListener event){
|
||||
this.mAppContext = app_context;
|
||||
notifictionManager(AppCompatActivity pAppContext, eventObserver.eventListener pEvent){
|
||||
this.mAppContext = pAppContext;
|
||||
onNotificationClear();
|
||||
}
|
||||
|
||||
public void onNotificationClear(){
|
||||
private void onNotificationClear(){
|
||||
NotificationManager notificationManager = (NotificationManager) mAppContext.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
notificationManager.cancel(status.mNotificationID);
|
||||
}
|
||||
|
||||
public void onCreateUserEngagementNotification(int pDelay){
|
||||
private void onCreateUserEngagementNotification(int 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) ;
|
||||
notificationIntent.putExtra("NOTIFICATION:INDENTIFIER:1001" , 1 ) ;
|
||||
notificationIntent.putExtra("NOTIFICATION:INDENTIFIER:1001" , notification) ;
|
||||
PendingIntent pendingIntent = PendingIntent. getBroadcast ( mAppContext, 0 , notificationIntent , PendingIntent. FLAG_UPDATE_CURRENT ) ;
|
||||
long futureInMillis = SystemClock. elapsedRealtime () + delay ;
|
||||
notificationIntent.putExtra(CONST_NOTIFICATION_ID_NAME, CONST_NOTIFICATION_ID_VALUE) ;
|
||||
notificationIntent.putExtra(CONST_NOTIFICATION_ID_NAME, pNotification) ;
|
||||
PendingIntent pendingIntent = PendingIntent. getBroadcast ( mAppContext, CONST_NOTIFICATION_REQUEST_CODE, notificationIntent , PendingIntent. FLAG_UPDATE_CURRENT ) ;
|
||||
long futureInMillis = SystemClock. elapsedRealtime () + pDelay ;
|
||||
AlarmManager alarmManager = (AlarmManager) mAppContext.getSystemService(Context. ALARM_SERVICE ) ;
|
||||
assert alarmManager != null;
|
||||
alarmManager.set(AlarmManager. ELAPSED_REALTIME_WAKEUP , futureInMillis , pendingIntent) ;
|
||||
}
|
||||
|
||||
private Notification getNotification () {
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(mAppContext, "NOTIFICATION:INDENTIFIER:1001") ;
|
||||
builder.setContentTitle("Scheduled Notification") ;
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(mAppContext, CONST_NOTIFICATION_ID_NAME) ;
|
||||
builder.setContentTitle(CONST_NOTIFICATION_TITLE) ;
|
||||
builder.setSmallIcon(R.drawable.notification_logo);
|
||||
builder.setAutoCancel(true) ;
|
||||
builder.setChannelId("NOTIFICATION:INDENTIFIER:1001") ;
|
||||
builder.setChannelId(CONST_NOTIFICATION_ID_NAME) ;
|
||||
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.util.Prefs;
|
||||
import org.torproject.android.service.wrapper.orbotLocalConstants;
|
||||
import java.util.Arrays;
|
||||
|
||||
import java.util.List;
|
||||
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.helperMethod;
|
||||
|
||||
import static org.torproject.android.service.TorServiceConstants.ACTION_START;
|
||||
|
||||
class orbotManager
|
||||
|
@ -34,57 +29,58 @@ class orbotManager
|
|||
return sOurInstance;
|
||||
}
|
||||
|
||||
public void initialize(AppCompatActivity app_context, eventObserver.eventListener event){
|
||||
initNotification((Integer) dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_NOTIFICATION_STATUS,1)));
|
||||
public void initialize(AppCompatActivity pAppContext, eventObserver.eventListener pEvent, int pNotificationStatus){
|
||||
this.mAppContext = pAppContext;
|
||||
onInitNotificationStatus(pNotificationStatus);
|
||||
}
|
||||
|
||||
void startOrbot(Context context){
|
||||
private void onStartOrbot(){
|
||||
orbotLocalConstants.mBridges = status.sBridgeCustomBridge;
|
||||
orbotLocalConstants.mIsManualBridge = status.sBridgeGatewayManual;
|
||||
this.mAppContext = context;
|
||||
Prefs.putBridgesEnabled(status.sBridgeGatewayManual |status.sBridgeGatewayAuto);
|
||||
Intent mServiceIntent = new Intent(context, OrbotService.class);
|
||||
Intent mServiceIntent = new Intent(mAppContext, OrbotService.class);
|
||||
mServiceIntent.setAction(ACTION_START);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
context.startForegroundService(mServiceIntent);
|
||||
mAppContext.startForegroundService(mServiceIntent);
|
||||
}
|
||||
else
|
||||
{
|
||||
context.startService(mServiceIntent);
|
||||
mAppContext.startService(mServiceIntent);
|
||||
}
|
||||
initializeProxy();
|
||||
}
|
||||
|
||||
int getNotificationStatus(){
|
||||
/*Helper Methods*/
|
||||
|
||||
private int onGetNotificationStatus(){
|
||||
return orbotLocalConstants.mNotificationStatus;
|
||||
}
|
||||
void initNotification(int status){
|
||||
private void onInitNotificationStatus(int status){
|
||||
orbotLocalConstants.mNotificationStatus = status;
|
||||
}
|
||||
void enableTorNotification(){
|
||||
private void onEnableTorNotification(){
|
||||
OrbotService.getServiceObject().enableNotification();
|
||||
}
|
||||
void disableTorNotification(){
|
||||
private void onDisableTorNotification(){
|
||||
OrbotService.getServiceObject().disableNotification();
|
||||
}
|
||||
|
||||
void enableTorNotificationNoBandwidth(){
|
||||
private void onEnableTorNotificationNoBandwidth(){
|
||||
OrbotService service = OrbotService.getServiceObject();
|
||||
if(service!=null){
|
||||
OrbotService.getServiceObject().enableTorNotificationNoBandwidth();
|
||||
}
|
||||
}
|
||||
|
||||
public void updateBridges(boolean p_status){
|
||||
private void onUpdateBridges(boolean p_status){
|
||||
Prefs.putBridgesEnabled(p_status);
|
||||
}
|
||||
public void updateVPN(boolean p_status){
|
||||
private void onUpdateVPN(boolean 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")){
|
||||
PrefsHelper.setPref(keys.PROXY_TYPE, 0);
|
||||
PrefsHelper.setPref(keys.PROXY_SOCKS,null);
|
||||
|
@ -124,10 +120,10 @@ class orbotManager
|
|||
PrefsHelper.setPref("browser.cache.memory.enable",true);
|
||||
PrefsHelper.setPref("browser.cache.disk.capacity",1000);
|
||||
|
||||
setPrivacyPrefs();
|
||||
onUpdatePrivacyPreferences();
|
||||
}
|
||||
|
||||
public void setPrivacyPrefs ()
|
||||
private void onUpdatePrivacyPreferences()
|
||||
{
|
||||
PrefsHelper.setPref(keys.PROXY_IMAGE, status.sShowImages);
|
||||
PrefsHelper.setPref("browser.display.show_image_placeholders",true);
|
||||
|
@ -152,8 +148,9 @@ class orbotManager
|
|||
PrefsHelper.setPref("media.peerconnection.enabled",false); //webrtc disabled
|
||||
}
|
||||
|
||||
/*Log Manager*/
|
||||
|
||||
String getLogs()
|
||||
private String getLogs()
|
||||
{
|
||||
String logs = orbotLocalConstants.mTorLogsStatus;
|
||||
|
||||
|
@ -161,12 +158,6 @@ class orbotManager
|
|||
logs = "Initializing Bootstrap";
|
||||
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))
|
||||
{
|
||||
|
@ -177,11 +168,74 @@ class orbotManager
|
|||
return "Loading Please Wait";
|
||||
}
|
||||
|
||||
boolean isOrbotRunning(){
|
||||
private boolean isOrbotRunning(){
|
||||
return orbotLocalConstants.mIsTorInitialized;
|
||||
}
|
||||
|
||||
String getOrbotStatus(){
|
||||
return orbotLocalConstants.mCurrentStatus;
|
||||
private String getOrbotStatus(){
|
||||
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;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
||||
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.keys;
|
||||
import com.darkweb.genesissearchengine.constants.status;
|
||||
import com.darkweb.genesissearchengine.constants.strings;
|
||||
import com.darkweb.genesissearchengine.dataManager.dataController;
|
||||
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
|
@ -19,24 +16,27 @@ import java.util.Arrays;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
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
|
||||
{
|
||||
/*Plugin Instance*/
|
||||
|
||||
private adManager mAdManager;
|
||||
private analyticManager mAnalyticManager;
|
||||
private firebaseManager mFirebaseManager;
|
||||
private com.darkweb.genesissearchengine.pluginManager.analyticManager mAnalyticsManager;
|
||||
private messageManager mMessageManager;
|
||||
private notifictionManager mNotificationManager;
|
||||
private activityContextManager mContextManager;
|
||||
private langManager mLangManager;
|
||||
private boolean mIsInitialized = false;
|
||||
private orbotManager mOrbotManager;
|
||||
|
||||
/*Private Variables*/
|
||||
|
||||
private static pluginController ourInstance = new pluginController();
|
||||
private homeController mHomeController;
|
||||
private boolean mIsInitialized = false;
|
||||
|
||||
/*Initializations*/
|
||||
|
||||
|
@ -45,122 +45,36 @@ public class pluginController
|
|||
return ourInstance;
|
||||
}
|
||||
|
||||
public void preInitialize(homeController context){
|
||||
mLangManager = new langManager(context,new langCallback(), new Locale(status.sSettingLanguage));
|
||||
}
|
||||
|
||||
public void initialize(){
|
||||
instanceObjectInitialization();
|
||||
mIsInitialized = true;
|
||||
}
|
||||
|
||||
public void preInitialize(homeController context){
|
||||
mLangManager = new langManager(context,new langCallback());
|
||||
mLangManager.setDefaultLanguage(new Locale(status.sSettingLanguage));
|
||||
}
|
||||
|
||||
private void instanceObjectInitialization()
|
||||
{
|
||||
mHomeController = activityContextManager.getInstance().getHomeController();
|
||||
mContextManager = activityContextManager.getInstance();
|
||||
|
||||
mNotificationManager = new notifictionManager(getAppContext(),new notificationCallback());
|
||||
mAdManager = new adManager(getAppContext(),new admobCallback(), mHomeController.getBannerAd());
|
||||
mAnalyticManager = new analyticManager(getAppContext(),new analyticCallback());
|
||||
mFirebaseManager = new firebaseManager(getAppContext(),new firebaseCallback());
|
||||
mNotificationManager = new notifictionManager(mHomeController,new notificationCallback());
|
||||
mAdManager = new adManager(mHomeController,new admobCallback(), mHomeController.getBannerAd());
|
||||
mAnalyticsManager = new com.darkweb.genesissearchengine.pluginManager.analyticManager(mHomeController,new analyticManager());
|
||||
mMessageManager = new messageManager(new messageCallback());
|
||||
}
|
||||
|
||||
public void initializeAllServices(AppCompatActivity context){
|
||||
orbotManager.getInstance().initialize(context,new orbotCallback());
|
||||
mOrbotManager = orbotManager.getInstance();
|
||||
}
|
||||
|
||||
/*Helper Methods*/
|
||||
|
||||
private AppCompatActivity getAppContext()
|
||||
{
|
||||
return mHomeController;
|
||||
}
|
||||
|
||||
public boolean isInitialized(){
|
||||
return mIsInitialized;
|
||||
}
|
||||
|
||||
/*---------------------------------------------- EXTERNAL REQUEST LISTENER-------------------------------------------------------*/
|
||||
|
||||
/*Message Manager*/
|
||||
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);
|
||||
public void initializeAllServices(AppCompatActivity context){
|
||||
int mNotificationStatus = (Integer) dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_NOTIFICATION_STATUS,1));
|
||||
orbotManager.getInstance().initialize(context,new orbotCallback(), mNotificationStatus);
|
||||
}
|
||||
|
||||
/*------------------------------------------------ CALLBACK LISTENERS------------------------------------------------------------*/
|
||||
|
@ -170,29 +84,32 @@ public class pluginController
|
|||
@Override
|
||||
public Object invokeObserver(List<Object> data, Object event_type)
|
||||
{
|
||||
if(event_type.equals(M_SHOW_LOADED_ADS))
|
||||
mHomeController.onSetBannerAdMargin();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*Analytics Manager*/
|
||||
private class analyticCallback implements eventObserver.eventListener{
|
||||
@Override
|
||||
public Object invokeObserver(List<Object> data, Object event_type)
|
||||
{
|
||||
mAnalyticManager.logUser();
|
||||
public Object onAdsInvoke(List<Object> pData, pluginEnums.eAdManager pEventType){
|
||||
if(mAdManager !=null){
|
||||
return mAdManager.onTrigger(pData, pEventType);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/*Analytics Manager*/
|
||||
private class analyticManager implements eventObserver.eventListener{
|
||||
@Override
|
||||
public Object invokeObserver(List<Object> data, Object event_type) { 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*/
|
||||
private class notificationCallback implements eventObserver.eventListener{
|
||||
|
@ -203,13 +120,11 @@ public class pluginController
|
|||
}
|
||||
}
|
||||
|
||||
/*Lang Manager*/
|
||||
private class langCallback implements eventObserver.eventListener{
|
||||
@Override
|
||||
public Object invokeObserver(List<Object> data, Object event_type)
|
||||
{
|
||||
return null;
|
||||
public Object onNotificationInvoke(List<Object> pData, pluginEnums.eNotificationManager pEventType){
|
||||
if(mNotificationManager!=null){
|
||||
return mNotificationManager.onTrigger(pData, pEventType);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/*Onion Proxy Manager*/
|
||||
|
@ -221,82 +136,93 @@ public class pluginController
|
|||
}
|
||||
}
|
||||
|
||||
/*Lang Manager*/
|
||||
public void setLanguage(){
|
||||
mLangManager.setDefaultLanguage(new Locale(status.sSettingLanguage));
|
||||
public Object onOrbotInvoke(List<Object> pData, pluginEnums.eOrbotManager pEventType){
|
||||
if(mOrbotManager !=null){
|
||||
return mOrbotManager.onTrigger(pData, pEventType);
|
||||
}
|
||||
public void onCreate(Activity activity) {
|
||||
if(activity==null && mLangManager!=null){
|
||||
mLangManager.onCreate(activity);
|
||||
}
|
||||
}
|
||||
public void onResume(Activity activity) {
|
||||
mLangManager.onResume(activity);
|
||||
return null;
|
||||
}
|
||||
|
||||
/*Message Manager*/
|
||||
private class messageCallback implements eventObserver.eventListener{
|
||||
/*Lang Manager*/
|
||||
public Object onLanguageInvoke(List<Object> pData, pluginEnums.eLangManager pEventType){
|
||||
return mLangManager.onTrigger(pData, pEventType);
|
||||
}
|
||||
|
||||
private class langCallback implements eventObserver.eventListener{
|
||||
@Override
|
||||
public Object invokeObserver(List<Object> data, Object event_type)
|
||||
{
|
||||
if(event_type.equals(enums.etype.welcome))
|
||||
{
|
||||
mHomeController.onLoadURL(data.get(0).toString());
|
||||
return null;
|
||||
}
|
||||
else if(event_type.equals(enums.eMessageEnums.M_SECURE_CONNECTION)){
|
||||
}
|
||||
|
||||
/*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(pData.get(0).toString());
|
||||
}
|
||||
else if(pEventType.equals(M_SECURE_CONNECTION)){
|
||||
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));
|
||||
}
|
||||
else if(event_type.equals(enums.etype.reload)){
|
||||
if(orbotManager.getInstance().isOrbotRunning())
|
||||
else if(pEventType.equals(enums.etype.reload)){
|
||||
if((Boolean) mOrbotManager.onTrigger(null, pluginEnums.eOrbotManager.M_IS_ORBOT_RUNNING))
|
||||
{
|
||||
mHomeController.onReload(null);
|
||||
}
|
||||
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);
|
||||
mContextManager.getHistoryController().onclearData();
|
||||
mHomeController.onClearSession();
|
||||
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLEAR_TAB, null);
|
||||
mHomeController.initTab(false);
|
||||
}
|
||||
else if(event_type.equals(enums.eMessageEnums.M_CLEAR_BOOKMARK)){
|
||||
dataController.getInstance().invokeBookmark(dataEnums.eBookmarkCommands.M_CLEAR_BOOKMARK ,data);
|
||||
else if(pEventType.equals(M_CLEAR_BOOKMARK)){
|
||||
dataController.getInstance().invokeBookmark(dataEnums.eBookmarkCommands.M_CLEAR_BOOKMARK ,pData);
|
||||
mContextManager.getBookmarkController().onclearData();
|
||||
}
|
||||
else if(event_type.equals(enums.eMessageEnums.M_BOOKMARK)){
|
||||
String [] dataParser = data.get(0).toString().split("split");
|
||||
else if(pEventType.equals(M_BOOKMARK)){
|
||||
String [] dataParser = pData.get(0).toString().split("split");
|
||||
if(dataParser.length>1){
|
||||
logEvent(strings.EVENT_URL_BOOKMARKED);
|
||||
dataController.getInstance().invokeBookmark(dataEnums.eBookmarkCommands.M_ADD_BOOKMARK ,Arrays.asList(dataParser[0],dataParser[1]));
|
||||
}else {
|
||||
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));
|
||||
}
|
||||
else if(event_type.equals(enums.eMessageEnums.M_DOWNLOAD_FILE)){
|
||||
else if(pEventType.equals(M_DOWNLOAD_FILE)){
|
||||
mHomeController.onDownloadFile();
|
||||
}
|
||||
else if(event_type.equals(enums.eMessageEnums.M_DOWNLOAD_FILE_MANUAL)){
|
||||
mHomeController.onManualDownload(data.get(0).toString());
|
||||
else if(pEventType.equals(M_DOWNLOAD_FILE_MANUAL)){
|
||||
mHomeController.onManualDownload(pData.get(0).toString());
|
||||
}
|
||||
else if(event_type.equals(enums.eMessageEnums.M_OPEN_LINK_NEW_TAB)){
|
||||
mHomeController.onOpenLinkNewTab(data.get(0).toString());
|
||||
else if(pEventType.equals(M_OPEN_LINK_NEW_TAB)){
|
||||
mHomeController.onOpenLinkNewTab(pData.get(0).toString());
|
||||
}
|
||||
else if(event_type.equals(enums.eMessageEnums.M_OPEN_LINK_CURRENT_TAB)){
|
||||
mHomeController.onLoadURL(data.get(0).toString());
|
||||
else if(pEventType.equals(M_OPEN_LINK_CURRENT_TAB)){
|
||||
mHomeController.onLoadURL(pData.get(0).toString());
|
||||
}
|
||||
else if(event_type.equals(enums.eMessageEnums.M_COPY_LINK)){
|
||||
helperMethod.copyURL(data.get(0).toString(),mContextManager.getHomeController());
|
||||
else if(pEventType.equals(M_COPY_LINK)){
|
||||
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);
|
||||
mHomeController.initTab(true);
|
||||
activityContextManager.getInstance().getTabController().finish();
|
||||
|
|
|
@ -2,4 +2,45 @@ package com.darkweb.genesissearchengine.pluginManager;
|
|||
|
||||
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"
|
||||
android:layout_width="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>
|
|
@ -7,7 +7,7 @@ android:layout_width="match_parent"
|
|||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="330dp"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/pMainLayout"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@xml/hox_rounded_corner"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="300dp"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/pMainLayout"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@xml/hox_rounded_corner"
|
||||
|
@ -52,7 +52,7 @@
|
|||
android:id="@+id/pDivider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginTop="35dp"
|
||||
android:background="@color/c_view_divier_background"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -72,7 +72,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="0dp"
|
||||
android:background="@xml/ax_ripple_default_round_right"
|
||||
android:background="@xml/ax_ripple_default_round_left"
|
||||
android:textSize="15sp"
|
||||
android:textAllCaps="false"
|
||||
android:layout_weight="1"
|
||||
|
@ -93,7 +93,7 @@
|
|||
android:textColor="@color/c_button_warning"
|
||||
android:layout_width="wrap_content"
|
||||
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:textSize="15sp"
|
||||
android:textAllCaps="false"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="300dp"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/pMainLayout"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@xml/gx_rounded_corner_alert"
|
||||
|
@ -52,7 +52,7 @@
|
|||
android:id="@+id/pDivider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginTop="35dp"
|
||||
android:background="@color/c_view_divier_background"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/pMainLayout"
|
||||
android:layout_width="300dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@xml/hox_rounded_corner"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
@ -73,9 +73,9 @@
|
|||
android:padding="7dp"
|
||||
android:paddingStart="11dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:textColor="@color/text_color_v2"
|
||||
android:textColorHint="@color/text_color_v2"
|
||||
android:textColorHighlight="@color/text_color_highlight_v1"
|
||||
android:textColor="@color/c_text_v1"
|
||||
android:textColorHighlight="@color/text_color_highlight_v3"
|
||||
android:textColorHint="@color/c_text_v2"
|
||||
android:textCursorDrawable="@xml/gx_search_cursor_state"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/pDivider"
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/pMainLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@xml/hox_rounded_corner"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
@ -36,13 +36,13 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:alpha="0.6"
|
||||
android:paddingStart="15dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:text="@string/ALERT_DATA_CLEARED_INFO"
|
||||
android:textAlignment="textStart"
|
||||
android:paddingStart="15dp"
|
||||
android:textColor="@color/c_alert_text"
|
||||
android:textSize="13sp"
|
||||
android:alpha="0.6"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pHeader"
|
||||
|
@ -59,25 +59,27 @@
|
|||
app:layout_constraintTop_toBottomOf="@+id/pDescription" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
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_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pDivider"
|
||||
android:orientation="horizontal">
|
||||
app:layout_constraintTop_toBottomOf="@+id/pDescription">
|
||||
|
||||
<Button
|
||||
android:id="@+id/pDismiss"
|
||||
android:textColor="@color/c_button_text_v1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="0dp"
|
||||
android:background="@xml/ax_ripple_default_round_bottom"
|
||||
android:textSize="15sp"
|
||||
android:padding="0dp"
|
||||
android:text="@string/ALERT_DISMISS"
|
||||
android:textAllCaps="false"
|
||||
android:layout_weight="1"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/ALERT_DISMISS" />
|
||||
android:textColor="@color/c_button_text_v1"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -5,82 +5,4 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="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>
|
|
@ -23,7 +23,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:paddingStart="15dp"
|
||||
android:layout_marginRight="30dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:singleLine="true"
|
||||
android:text="@string/ALERT_DOWNLOAD"
|
||||
android:textAlignment="textStart"
|
||||
|
@ -31,7 +31,8 @@
|
|||
android:textSize="17sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="RtlSymmetry" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pDescription"
|
||||
|
@ -41,9 +42,9 @@
|
|||
android:alpha="0.6"
|
||||
android:gravity="start"
|
||||
android:paddingStart="15dp"
|
||||
android:singleLine="true"
|
||||
android:lines="2"
|
||||
android:paddingEnd="15dp"
|
||||
android:layout_marginRight="30dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:textColor="@color/c_alert_text"
|
||||
android:textSize="13sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -103,7 +104,8 @@
|
|||
android:scaleX="0.5"
|
||||
app:tint="@color/c_navigation_tint"
|
||||
android:scaleY="0.5"
|
||||
app:srcCompat="@xml/ic_arrow_right" />
|
||||
app:srcCompat="@xml/ic_arrow_right"
|
||||
android:contentDescription="@string/GENERAL_TODO" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -149,7 +151,8 @@
|
|||
android:scaleX="0.5"
|
||||
app:tint="@color/c_navigation_tint"
|
||||
android:scaleY="0.5"
|
||||
app:srcCompat="@xml/ic_arrow_right" />
|
||||
app:srcCompat="@xml/ic_arrow_right"
|
||||
android:contentDescription="@string/GENERAL_TODO" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -195,7 +198,8 @@
|
|||
android:background="@android:color/transparent"
|
||||
android:scaleX="0.5"
|
||||
android:scaleY="0.5"
|
||||
app:srcCompat="@xml/ic_arrow_right" />
|
||||
app:srcCompat="@xml/ic_arrow_right"
|
||||
android:contentDescription="@string/GENERAL_TODO" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -243,7 +247,8 @@
|
|||
app:tint="@color/c_navigation_tint"
|
||||
android:scaleX="0.5"
|
||||
android:scaleY="0.5"
|
||||
app:srcCompat="@xml/ic_arrow_right" />
|
||||
app:srcCompat="@xml/ic_arrow_right"
|
||||
android:contentDescription="@string/GENERAL_TODO" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -291,7 +296,8 @@
|
|||
app:tint="@color/c_navigation_tint"
|
||||
android:scaleX="0.5"
|
||||
android:scaleY="0.5"
|
||||
app:srcCompat="@xml/ic_arrow_right" />
|
||||
app:srcCompat="@xml/ic_arrow_right"
|
||||
android:contentDescription="@string/GENERAL_TODO" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -339,7 +345,8 @@
|
|||
app:tint="@color/c_navigation_tint"
|
||||
android:scaleX="0.5"
|
||||
android:scaleY="0.5"
|
||||
app:srcCompat="@xml/ic_arrow_right" />
|
||||
app:srcCompat="@xml/ic_arrow_right"
|
||||
android:contentDescription="@string/GENERAL_TODO" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -387,7 +394,8 @@
|
|||
android:scaleX="0.5"
|
||||
app:tint="@color/c_navigation_tint"
|
||||
android:scaleY="0.5"
|
||||
app:srcCompat="@xml/ic_arrow_right" />
|
||||
app:srcCompat="@xml/ic_arrow_right"
|
||||
android:contentDescription="@string/GENERAL_TODO" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -414,7 +422,7 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@xml/ax_bottom_rounded_corner_right"
|
||||
android:background="@xml/ax_ripple_default_round_bottom"
|
||||
android:padding="0dp"
|
||||
android:text="@string/ALERT_WELCOME_MESSAGE_BT_5"
|
||||
android:textAlignment="center"
|
||||
|
|
|
@ -39,7 +39,9 @@
|
|||
android:justificationMode="inter_word"
|
||||
android:paddingStart="15dp"
|
||||
android:textColor="@color/c_alert_text"
|
||||
android:ellipsize="start"
|
||||
android:alpha="0.6"
|
||||
android:lines="2"
|
||||
android:paddingEnd="15dp"
|
||||
android:textAlignment="textStart"
|
||||
android:textSize="13sp"
|
||||
|
@ -197,14 +199,6 @@
|
|||
|
||||
</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
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
|
@ -228,7 +222,7 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@xml/ax_bottom_rounded_corner_right"
|
||||
android:background="@xml/ax_ripple_default_round_bottom"
|
||||
android:padding="0dp"
|
||||
android:text="@string/ALERT_DISMISS"
|
||||
android:textAlignment="center"
|
||||
|
|