diff --git a/CODING STRUCTURE b/CODING STRUCTURE new file mode 100644 index 00000000..e69de29b diff --git a/Release Checklist.xlsx b/Release Checklist.xlsx index a28794bb..76a0902c 100644 Binary files a/Release Checklist.xlsx and b/Release Checklist.xlsx differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 0a52050b..424d6aa2 100755 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -120,7 +120,11 @@ + { if(!hasFocus){ mBookmarkSettingViewController.onTrigger(bookmarkSettingEnums.eBookmarkSettingViewCommands.M_CLEAR_FORM_FOCUS); @@ -97,6 +93,7 @@ public class bookmarkSettingController extends AppCompatActivity { mBookmarkSettingViewController.onTrigger(bookmarkSettingEnums.eBookmarkSettingViewCommands.M_CLEAR_FORM_FOCUS); return false; }); + } private void initializeModels(){ @@ -106,7 +103,7 @@ public class bookmarkSettingController extends AppCompatActivity { mBookmarkSettingViewController = new bookmarkSettingViewController(this, new bookmarkSettingViewCallback(), mBookmarName, mBookmarURL); mBookmarkSettingViewController.onTrigger(bookmarkSettingEnums.eBookmarkSettingViewCommands.M_INITIALIZE, Arrays.asList(mBookmarkName,mBookmarkURL)); - mBookmarkSettingModel = new bookmarkSettingModel(this, new bookmarkSettingModelCallback(), mBookmarkID, mBookmarkURL); + mBookmarkSettingModel = new bookmarkSettingModelController(this, new bookmarkSettingModelCallback(), mBookmarkID, mBookmarkURL); } private void initCallableResponse(bookmarkSettingEnums.eActivityResponseCommands pResponse){ @@ -124,13 +121,9 @@ public class bookmarkSettingController extends AppCompatActivity { @Override public void onConfigurationChanged(@NonNull Configuration newConfig) { - pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED); - super.onConfigurationChanged(newConfig); + sharedUIMethod.onSharedConfigurationChanged(newConfig, this); - if(newConfig.uiMode != getResources().getConfiguration().uiMode){ - activityContextManager.getInstance().onResetTheme(); - activityThemeManager.getInstance().onConfigurationChanged(this); - } + super.onConfigurationChanged(newConfig); } @Override @@ -172,19 +165,20 @@ public class bookmarkSettingController extends AppCompatActivity { if(mBookmarkChanged){ initCallableResponse(bookmarkSettingEnums.eActivityResponseCommands.M_OPEN_UPDATE_ALERT); } + onCloseTrigger(null); }else { mBookmarkSettingViewController.onTrigger(bookmarkSettingEnums.eBookmarkSettingViewCommands.M_BOOKMARK_NAME_VALIDATION_RESPONSE, Collections.singletonList(false)); } - onCloseTrigger(null); } if(view.getId()==R.id.pRemoveBookmark){ + mBookmarkSettingViewController.onTrigger(bookmarkSettingEnums.eBookmarkSettingViewCommands.M_CLEAR_FORM_FOCUS); initCallableResponse(bookmarkSettingEnums.eActivityResponseCommands.M_OPEN_DELETE_ALERT); mBookmarkSettingModel.onTrigger(bookmarkSettingEnums.eBookmarkSettingModelCommands.M_DELETE_BOOKMARK); onCloseTrigger(null); } } - /* UI Callbacks */ + /* Callbacks */ private class bookmarkSettingViewCallback implements eventObserver.eventListener{ diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/bookmarkManager/BookmarkSettings/bookmarkSettingModel.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/bookmarkManager/BookmarkSettings/bookmarkSettingModelController.java similarity index 84% rename from app/src/main/java/com/darkweb/genesissearchengine/appManager/bookmarkManager/BookmarkSettings/bookmarkSettingModel.java rename to app/src/main/java/com/darkweb/genesissearchengine/appManager/bookmarkManager/BookmarkSettings/bookmarkSettingModelController.java index bbc9452e..8f0ced5f 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/bookmarkManager/BookmarkSettings/bookmarkSettingModel.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/bookmarkManager/BookmarkSettings/bookmarkSettingModelController.java @@ -1,90 +1,87 @@ -package com.darkweb.genesissearchengine.appManager.bookmarkManager.BookmarkSettings; - -import androidx.appcompat.app.AppCompatActivity; -import com.darkweb.genesissearchengine.appManager.activityContextManager; -import com.darkweb.genesissearchengine.constants.strings; -import com.darkweb.genesissearchengine.dataManager.dataController; -import com.darkweb.genesissearchengine.dataManager.dataEnums; -import com.darkweb.genesissearchengine.eventObserver; -import com.darkweb.genesissearchengine.helperManager.helperMethod; -import com.darkweb.genesissearchengine.pluginManager.pluginController; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import static com.darkweb.genesissearchengine.dataManager.dataEnums.eBookmarkCommands.M_DELETE_BOOKMARK_FROM_MENU; -import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.M_DELETE_BOOKMARK; - -class bookmarkSettingModel -{ - /* Local Variables Variables */ - - private boolean mBookmarkUpdateStatus = false; - private int mBookmarkID; - private String mBookmarkURL; - - /* Private Variables */ - - private AppCompatActivity mContext; - private eventObserver.eventListener mEvent; - - public bookmarkSettingModel(AppCompatActivity pContext, eventObserver.eventListener pEvent, int pBookmarkID, String pBookmarkURL){ - this.mContext = pContext; - this.mEvent = pEvent; - this.mBookmarkID = pBookmarkID; - this.mBookmarkURL = pBookmarkURL; - } - - /* Helper Methods */ - - private void onUpdateBookmark(String pBookmarkName){ - dataController.getInstance().invokeBookmark(dataEnums.eBookmarkCommands.M_UPDATE_BOOKMARK, Arrays.asList(pBookmarkName, mBookmarkURL, mBookmarkID)); - } - - private boolean validateForm(String pBookmarkName){ - if(pBookmarkName.equals(strings.GENERIC_EMPTY_STR)){ - return false; - }else { - return true; - } - } - - private boolean getBookmarkUpdateStatus(){ - return mBookmarkUpdateStatus; - } - - private void setBookmarkUpdateStatus(boolean pBookmarkUpdateStatus){ - mBookmarkUpdateStatus = pBookmarkUpdateStatus; - } - - private void onDeleteBookmark(){ - dataController.getInstance().invokeBookmark(M_DELETE_BOOKMARK_FROM_MENU, Collections.singletonList(mBookmarkURL)); - } - - /* Event Observer */ - - public Object onTrigger(bookmarkSettingEnums.eBookmarkSettingModelCommands pCommands, List pData){ - if(bookmarkSettingEnums.eBookmarkSettingModelCommands.M_UPDATE_BOOKMARK.equals(pCommands)){ - onUpdateBookmark((String) pData.get(0)); - } - if(bookmarkSettingEnums.eBookmarkSettingModelCommands.M_VALIDATE_FORM.equals(pCommands)){ - return validateForm((String) pData.get(0)); - } - if(bookmarkSettingEnums.eBookmarkSettingModelCommands.M_SET_BOOOKMARK_CHANGED_STATUS.equals(pCommands)){ - setBookmarkUpdateStatus((boolean)pData.get(0)); - } - if(bookmarkSettingEnums.eBookmarkSettingModelCommands.M_DELETE_BOOKMARK.equals(pCommands)){ - onDeleteBookmark(); - } - return null; - } - - public Object onTrigger(bookmarkSettingEnums.eBookmarkSettingModelCommands pCommands){ - if(bookmarkSettingEnums.eBookmarkSettingModelCommands.M_DELETE_BOOKMARK.equals(pCommands)){ - onDeleteBookmark(); - } - if(bookmarkSettingEnums.eBookmarkSettingModelCommands.M_GET_UPDATE_STATUS.equals(pCommands)){ - return getBookmarkUpdateStatus(); - } - return null; - } +package com.darkweb.genesissearchengine.appManager.bookmarkManager.BookmarkSettings; + +import androidx.appcompat.app.AppCompatActivity; +import com.darkweb.genesissearchengine.constants.strings; +import com.darkweb.genesissearchengine.dataManager.dataController; +import com.darkweb.genesissearchengine.dataManager.dataEnums; +import com.darkweb.genesissearchengine.eventObserver; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import static com.darkweb.genesissearchengine.dataManager.dataEnums.eBookmarkCommands.M_DELETE_BOOKMARK_FROM_MENU; + +class bookmarkSettingModelController +{ + /* Local Variables Variables */ + + private boolean mBookmarkUpdateStatus = false; + private int mBookmarkID; + private String mBookmarkURL; + + /* Private Variables */ + + private AppCompatActivity mContext; + private eventObserver.eventListener mEvent; + + public bookmarkSettingModelController(AppCompatActivity pContext, eventObserver.eventListener pEvent, int pBookmarkID, String pBookmarkURL){ + this.mContext = pContext; + this.mEvent = pEvent; + this.mBookmarkID = pBookmarkID; + this.mBookmarkURL = pBookmarkURL; + } + + /* Helper Methods */ + + private void onUpdateBookmark(String pBookmarkName){ + dataController.getInstance().invokeBookmark(dataEnums.eBookmarkCommands.M_UPDATE_BOOKMARK, Arrays.asList(pBookmarkName, mBookmarkURL, mBookmarkID)); + } + + private boolean validateForm(String pBookmarkName){ + if(pBookmarkName.equals(strings.GENERIC_EMPTY_STR)){ + return false; + }else { + return true; + } + } + + private boolean getBookmarkUpdateStatus(){ + return mBookmarkUpdateStatus; + } + + private void setBookmarkUpdateStatus(boolean pBookmarkUpdateStatus){ + mBookmarkUpdateStatus = pBookmarkUpdateStatus; + } + + private void onDeleteBookmark(){ + dataController.getInstance().invokeBookmark(M_DELETE_BOOKMARK_FROM_MENU, Collections.singletonList(mBookmarkURL)); + } + + /* Event Observer */ + + public Object onTrigger(bookmarkSettingEnums.eBookmarkSettingModelCommands pCommands, List pData){ + if(bookmarkSettingEnums.eBookmarkSettingModelCommands.M_UPDATE_BOOKMARK.equals(pCommands)){ + onUpdateBookmark((String) pData.get(0)); + } + if(bookmarkSettingEnums.eBookmarkSettingModelCommands.M_VALIDATE_FORM.equals(pCommands)){ + return validateForm((String) pData.get(0)); + } + if(bookmarkSettingEnums.eBookmarkSettingModelCommands.M_SET_BOOOKMARK_CHANGED_STATUS.equals(pCommands)){ + setBookmarkUpdateStatus((boolean)pData.get(0)); + } + if(bookmarkSettingEnums.eBookmarkSettingModelCommands.M_DELETE_BOOKMARK.equals(pCommands)){ + onDeleteBookmark(); + } + return null; + } + + public Object onTrigger(bookmarkSettingEnums.eBookmarkSettingModelCommands pCommands){ + if(bookmarkSettingEnums.eBookmarkSettingModelCommands.M_DELETE_BOOKMARK.equals(pCommands)){ + onDeleteBookmark(); + } + if(bookmarkSettingEnums.eBookmarkSettingModelCommands.M_GET_UPDATE_STATUS.equals(pCommands)){ + return getBookmarkUpdateStatus(); + } + return null; + } + } \ No newline at end of file diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeController.java index 8edc6f79..cf571ccf 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeController.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeController.java @@ -409,7 +409,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba } public void initLandingPage(){ - if(status.sSettingFirstStart){ + if(!status.sLandingPageStatus){ helperMethod.openActivity(landingController.class, constants.CONST_LIST_HISTORY, homeController.this,false); } } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/CustomSlideBigText.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/CustomSlideBigText.java deleted file mode 100755 index 4302362b..00000000 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/CustomSlideBigText.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.darkweb.genesissearchengine.appManager.landingManager; - -import android.os.Bundle; -import androidx.annotation.Nullable; -import androidx.fragment.app.Fragment; -import android.text.TextUtils; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.Button; -import android.widget.TextView; - -import com.example.myapplication.R; - - -public class CustomSlideBigText extends Fragment { - - private static final String ARG_LAYOUT_RES_ID = "layoutResId"; - private int layoutResId; - private String mTitle; - private String mButtonText; - private String mSubTitle; - private View.OnClickListener mButtonListener; - - public static CustomSlideBigText newInstance(int layoutResId) { - CustomSlideBigText sampleSlide = new CustomSlideBigText(); - - Bundle args = new Bundle(); - args.putInt(ARG_LAYOUT_RES_ID, layoutResId); - sampleSlide.setArguments(args); - - return sampleSlide; - } - - public void setTitle (String title) - { - mTitle = title; - } - - public void setSubTitle(String subTitle) { mSubTitle = subTitle; } - - public void showButton (String buttonText, View.OnClickListener buttonListener) - { - mButtonText = buttonText; - mButtonListener = buttonListener; - } - - @Override - public void onCreate(@Nullable Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - if (getArguments() != null && getArguments().containsKey(ARG_LAYOUT_RES_ID)) { - layoutResId = getArguments().getInt(ARG_LAYOUT_RES_ID); - } - } - - @Nullable - @Override - public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, - @Nullable Bundle savedInstanceState) { - View view = inflater.inflate(layoutResId, container, false); - ((TextView)view.findViewById(R.id.custom_slide_big_text)).setText(mTitle); - - if (!TextUtils.isEmpty(mSubTitle)) { - - TextView tv = - (TextView)view.findViewById(R.id.custom_slide_big_text_sub); - tv.setText(mSubTitle); - tv.setVisibility(View.VISIBLE); - } - - if (mButtonText != null) - { - Button button = (Button)view.findViewById(R.id.custom_slide_button); - button.setVisibility(View.VISIBLE); - button.setText(mButtonText); - button.setOnClickListener(mButtonListener); - } - return view; - - } -} diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/landingController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/landingController.java index 6b0fb61a..1065b0c0 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/landingController.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/landingController.java @@ -1,77 +1,116 @@ package com.darkweb.genesissearchengine.appManager.landingManager; import android.content.Intent; +import android.content.res.Resources; import android.os.Bundle; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; -import android.view.View; - +import com.darkweb.genesissearchengine.appManager.landingManager.langingPageManager.landingPageController; +import com.darkweb.genesissearchengine.appManager.landingManager.langingPageManager.landingPageDataModel; import com.darkweb.genesissearchengine.appManager.orbotManager.orbotController; -import com.darkweb.genesissearchengine.constants.keys; -import com.darkweb.genesissearchengine.constants.status; -import com.darkweb.genesissearchengine.dataManager.dataController; -import com.darkweb.genesissearchengine.dataManager.dataEnums; +import com.darkweb.genesissearchengine.constants.enums; +import com.darkweb.genesissearchengine.eventObserver; 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; +import java.util.List; + +import static com.darkweb.genesissearchengine.appManager.landingManager.landingEnums.eLandingPageControllerCallbackCommands.M_ON_LANDING_PAGE_FINISH_TRIGGERED; public class landingController extends AppIntro { + /* Private Variables */ + private landingViewController mLandingViewController; + private landingModelController mLandingModel; + + /* UI Variables */ + + private landingPageController mIntro_welcome; + private landingPageController mIntro_intro; + private landingPageController mIntro_start; + + /* Initializations */ @Override protected void onCreate(@Nullable Bundle savedInstanceState) { + pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED); super.onCreate(savedInstanceState); - CustomSlideBigText welcome = CustomSlideBigText.newInstance(R.layout.landing_view); - welcome.setTitle(getString(R.string.LANDING_HELLO)); - welcome.setSubTitle(getString(R.string.LANDING_WELCOME)); - addSlide(welcome); - - CustomSlideBigText intro2 = CustomSlideBigText.newInstance(R.layout.landing_view); - intro2.setTitle(getString(R.string.LANDING_BROWSE_INFO)); - intro2.setSubTitle(getString(R.string.LANDING_NO_TRACKING)); - addSlide(intro2); - - CustomSlideBigText cs2 = CustomSlideBigText.newInstance(R.layout.landing_view); - cs2.setTitle(getString(R.string.LANDING_BRIDGES_INFO)); - cs2.showButton(getString(R.string.LANDING_MORE), new View.OnClickListener() { - @Override - public void onClick(View v) { - startActivity(new Intent(landingController.this, orbotController.class)); - } - }); - addSlide(cs2); - - setBarColor(getResources().getColor(R.color.landing_ease_blue)); - setSeparatorColor(getResources().getColor(R.color.headerblack)); - - showSkipButton(false); - setProgressButtonEnabled(true); - initConnections(); + initializePages(); + initializeModels(); } - private void initConnections(){ - mLandingViewController = new landingViewController(this,null); + private void initializePages(){ + mIntro_welcome = new landingPageController(); + mIntro_intro = new landingPageController(); + mIntro_start = new landingPageController(); + + mIntro_welcome.onInitialize(new landingPageCallback(), new landingPageDataModel(getString(R.string.LANDING_HELLO), getString(R.string.LANDING_WELCOME),null, enums.LandingPageTypes.M_LANDING_WELCOME)); + mIntro_intro.onInitialize(new landingPageCallback(), new landingPageDataModel(getString(R.string.LANDING_BROWSE_INFO), getString(R.string.LANDING_NO_TRACKING),null, enums.LandingPageTypes.M_LANDING_INTRO)); + mIntro_start.onInitialize(new landingPageCallback(), new landingPageDataModel(getString(R.string.LANDING_BRIDGES_INFO),null,getString(R.string.LANDING_MORE), enums.LandingPageTypes.M_LANDING_START)); } + private void initializeModels(){ + mLandingViewController = new landingViewController(this,new landingViewCallback(), mIntro_welcome, mIntro_intro, mIntro_start); + mLandingModel = new landingModelController(this, new landingModelCallback()); + } + /* Local Override */ @Override public void onDonePressed(Fragment currentFragment) { super.onDonePressed(currentFragment); - status.sSettingFirstStart = false; - dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_FIRST_INSTALLED,false)); - finish(); + mLandingModel.onTrigger(landingEnums.eLandingModelCommands.M_UPDATE_LANDING_PAGE_SHOWN_STATUS); + onCloseTrigger(); } @Override protected void onResume() { - pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME); super.onResume(); } + + /* Helper Methods */ + + public void onCloseTrigger(){ + finish(); + } + + /* Callbacks */ + + private class landingViewCallback implements eventObserver.eventListener{ + + @Override + public Object invokeObserver(List pData, Object pType) + { + return null; + } + } + + private class landingModelCallback implements eventObserver.eventListener{ + + @Override + public Object invokeObserver(List pData, Object pType) + { + return null; + } + } + + private class landingPageCallback implements eventObserver.eventListener{ + + @Override + public Object invokeObserver(List pData, Object pType) + { + if(pType.equals(M_ON_LANDING_PAGE_FINISH_TRIGGERED)){ + if((int)pData.get(0) == enums.LandingPageTypes.M_LANDING_START){ + startActivity(new Intent(landingController.this, orbotController.class)); + } + } + return null; + } + } + } \ No newline at end of file diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/landingEnums.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/landingEnums.java new file mode 100644 index 00000000..a71183d3 --- /dev/null +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/landingEnums.java @@ -0,0 +1,20 @@ +package com.darkweb.genesissearchengine.appManager.landingManager; + +public class landingEnums +{ + + public enum eLandingViewCommands { + } + + public enum eLandingModelCommands { + M_UPDATE_LANDING_PAGE_SHOWN_STATUS + } + + public enum eLandingModelCallbackCommands { + } + + public enum eLandingPageControllerCallbackCommands { + M_ON_LANDING_PAGE_FINISH_TRIGGERED + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/landingModelController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/landingModelController.java new file mode 100644 index 00000000..45dc0d72 --- /dev/null +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/landingModelController.java @@ -0,0 +1,40 @@ +package com.darkweb.genesissearchengine.appManager.landingManager; + +import androidx.appcompat.app.AppCompatActivity; + +import com.darkweb.genesissearchengine.constants.keys; +import com.darkweb.genesissearchengine.constants.status; +import com.darkweb.genesissearchengine.dataManager.dataController; +import com.darkweb.genesissearchengine.dataManager.dataEnums; +import com.darkweb.genesissearchengine.eventObserver; + +import java.util.Arrays; + +public class landingModelController { + + /* Private Variables */ + + private AppCompatActivity mContext; + private eventObserver.eventListener mEvent; + + public landingModelController(AppCompatActivity pContext, eventObserver.eventListener pEvent){ + this.mContext = pContext; + this.mEvent = pEvent; + } + + private void onUpdateLandingPageStatus(){ + status.sLandingPageStatus = true; + dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.sLandingPageStatus,true)); + } + + + public Object onTrigger(landingEnums.eLandingModelCommands pCommands){ + + if(pCommands.equals(landingEnums.eLandingModelCommands.M_UPDATE_LANDING_PAGE_SHOWN_STATUS)){ + onUpdateLandingPageStatus(); + } + + return null; + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/landingViewController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/landingViewController.java index a6c94ff3..bb7bf260 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/landingViewController.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/landingViewController.java @@ -1,29 +1,54 @@ package com.darkweb.genesissearchengine.appManager.landingManager; -import android.os.Build; -import android.view.Window; -import android.view.WindowManager; -import androidx.appcompat.app.AppCompatActivity; import androidx.core.content.ContextCompat; +import com.darkweb.genesissearchengine.appManager.landingManager.langingPageManager.landingPageController; import com.darkweb.genesissearchengine.eventObserver; import com.example.myapplication.R; +import com.github.paolorotolo.appintro.AppIntro; class landingViewController { /*Private Variables*/ - private AppCompatActivity mContext; + private AppIntro mContext; + private eventObserver.eventListener mEvent; + + /*UI Variables*/ + + private landingPageController mIntroWelcome; + private landingPageController mIntroIntro; + private landingPageController mIntroStart; /*Initializations*/ - landingViewController(AppCompatActivity mContext, eventObserver.eventListener event){ - this.mContext = mContext; - + landingViewController(AppIntro pContext, eventObserver.eventListener pEvent, landingPageController pIntroWelcome, landingPageController pIntroIntro, landingPageController pIntroStart){ + this.mContext = pContext; + this.mEvent = pEvent; + this.mIntroWelcome = pIntroWelcome; + this.mIntroIntro = pIntroIntro; + this.mIntroStart = pIntroStart; + setUIData(); initPostUI(); } + private void setUIData(){ + mContext.addSlide(mIntroWelcome); + mContext.addSlide(mIntroIntro); + mContext.addSlide(mIntroStart); + + mContext.setBarColor(mContext.getResources().getColor(R.color.landing_ease_blue)); + mContext.setSeparatorColor(mContext.getResources().getColor(R.color.headerblack)); + + mContext.showSkipButton(false); + mContext.setProgressButtonEnabled(true); + } + private void initPostUI(){ mContext.getWindow().setStatusBarColor(ContextCompat.getColor(mContext, R.color.landing_ease_blue)); } + + public Object onTrigger(landingEnums.eLandingViewCommands pCommands){ + return null; + } } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/langingPageManager/landingPageController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/langingPageManager/landingPageController.java new file mode 100644 index 00000000..6773dabd --- /dev/null +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/langingPageManager/landingPageController.java @@ -0,0 +1,85 @@ +package com.darkweb.genesissearchengine.appManager.landingManager.langingPageManager; + +import android.os.Bundle; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; +import com.darkweb.genesissearchengine.eventObserver; +import com.example.myapplication.R; + +import java.util.Collections; +import java.util.List; + +import static com.darkweb.genesissearchengine.appManager.landingManager.landingEnums.eLandingPageControllerCallbackCommands.M_ON_LANDING_PAGE_FINISH_TRIGGERED; + + +public class landingPageController extends Fragment { + + /*UI Variables*/ + + private TextView mHeader; + private TextView mSubHeader; + private TextView mSubmit; + + /*Local Variables*/ + + private eventObserver.eventListener mEvent; + private landingPageDataModel mDataModel; + private landingPageViewController mLandingPageViewController; + + /*Initializations*/ + + @Override + public void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + + @Nullable + @Override + public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + + View view = inflater.inflate(R.layout.landing_view, container, false); + + initializeModels(view); + initializeLocalEventHandlers(); + return view; + + } + + private void initializeModels(View pView){ + mHeader = pView.findViewById(R.id.pHeader); + mSubHeader = pView.findViewById(R.id.pSubHeader); + mSubmit = pView.findViewById(R.id.pNextButton); + + mLandingPageViewController = new landingPageViewController(this,new landingPageViewCallback(), mHeader, mSubHeader, mSubmit, mDataModel); + } + + public landingPageController onInitialize(eventObserver.eventListener pEvent, landingPageDataModel pDataModel) { + landingPageController mSlidePage = new landingPageController(); + Bundle args = new Bundle(); + + mDataModel = pDataModel; + mEvent = pEvent; + + mSlidePage.setArguments(args); + return mSlidePage; + } + + + private void initializeLocalEventHandlers(){ + mSubmit.setOnClickListener(v -> mEvent.invokeObserver(Collections.singletonList(mDataModel.getPageType()), M_ON_LANDING_PAGE_FINISH_TRIGGERED)); + } + + private class landingPageViewCallback implements eventObserver.eventListener{ + + @Override + public Object invokeObserver(List pData, Object pType) + { + return null; + } + } + +} diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/langingPageManager/landingPageDataModel.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/langingPageManager/landingPageDataModel.java new file mode 100644 index 00000000..dee16cfd --- /dev/null +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/langingPageManager/landingPageDataModel.java @@ -0,0 +1,31 @@ +package com.darkweb.genesissearchengine.appManager.landingManager.langingPageManager; + + +public class landingPageDataModel { + + private String mHeader; + private String mSubHeader; + private String mNextButtonText; + private int mLandingPageType; + + public landingPageDataModel(String pHeader, String pSubHeader, String pNextButtonText, int pLandingPageType){ + this.mHeader = pHeader; + this.mSubHeader = pSubHeader; + this.mNextButtonText = pNextButtonText; + this.mLandingPageType = pLandingPageType; + } + + public String getHeader(){ + return mHeader; + } + public String getSubHeader(){ + return mSubHeader; + } + public String getNextButtonText(){ + return mNextButtonText; + } + public int getPageType(){ + return mLandingPageType; + } + +} diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/langingPageManager/landingPageViewController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/langingPageManager/landingPageViewController.java new file mode 100644 index 00000000..156f8540 --- /dev/null +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/langingPageManager/landingPageViewController.java @@ -0,0 +1,48 @@ +package com.darkweb.genesissearchengine.appManager.landingManager.langingPageManager; + +import android.view.View; +import android.widget.TextView; +import androidx.fragment.app.Fragment; + +import com.darkweb.genesissearchengine.constants.enums; +import com.darkweb.genesissearchengine.eventObserver; +import com.example.myapplication.R; + +public class landingPageViewController { + + private Fragment mContext; + private TextView mHeader; + private TextView mSubHeader; + private TextView mSubmit; + private landingPageDataModel mLandingModel; + + public landingPageViewController(Fragment pContext, eventObserver.eventListener pEvent, TextView pHeader, TextView pSubHeader, TextView pSubmit, landingPageDataModel pLandingModel){ + this.mHeader = pHeader; + this.mSubHeader = pSubHeader; + this.mSubmit = pSubmit; + this.mContext = pContext; + this.mLandingModel = pLandingModel; + + onInitializeView(); + } + + private void onInitializeView(){ + if(this.mLandingModel.getPageType() == enums.LandingPageTypes.M_LANDING_WELCOME){ + mHeader.setText(mLandingModel.getHeader()); + mSubHeader.setText(mLandingModel.getSubHeader()); + mSubHeader.setVisibility(View.VISIBLE); + } + else if(this.mLandingModel.getPageType() == enums.LandingPageTypes.M_LANDING_INTRO){ + mHeader.setText(mLandingModel.getHeader()); + mSubHeader.setText(mLandingModel.getSubHeader()); + mSubHeader.setVisibility(View.VISIBLE); + } + else if(this.mLandingModel.getPageType() == enums.LandingPageTypes.M_LANDING_START){ + mHeader.setText(mLandingModel.getHeader()); + mSubHeader.setText(mLandingModel.getSubHeader()); + mSubmit.setText(mLandingModel.getNextButtonText()); + mSubHeader.setVisibility(View.VISIBLE); + mSubmit.setVisibility(View.VISIBLE); + } + } +} diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/viewPagerModel.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/viewPagerModel.java deleted file mode 100755 index c606de2a..00000000 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/landingManager/viewPagerModel.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.darkweb.genesissearchengine.appManager.landingManager; - -public class viewPagerModel -{ - - private int image_drawable; - - public int getImage_drawable() { - return image_drawable; - } - - public void setImage_drawable(int image_drawable) { - this.image_drawable = image_drawable; - } -} \ No newline at end of file diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/languageManager/languageAdapter.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/languageManager/languageAdapter.java index fd9c1f7e..4f182bcc 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/languageManager/languageAdapter.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/languageManager/languageAdapter.java @@ -96,7 +96,7 @@ public class languageAdapter extends RecyclerView.Adapter if(model.getSession().getTheme()==null){ if(status.sTabGridLayoutEnabled){ - mBorder.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.c_ripple)); + mBorder.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.c_ripple_gray)); }else { - mBorder.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.c_ripple)); + mBorder.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.c_ripple_gray)); } }else { try{ diff --git a/app/src/main/java/com/darkweb/genesissearchengine/constants/enums.java b/app/src/main/java/com/darkweb/genesissearchengine/constants/enums.java index e2f0e3a7..0e6d43e0 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/constants/enums.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/constants/enums.java @@ -46,4 +46,11 @@ public class enums public static final String OPEN_VOICE = "mOpenVoice"; } + public static class LandingPageTypes { + public static final int M_LANDING_WELCOME = 0; + public static final int M_LANDING_INTRO = 1; + public static final int M_LANDING_START = 2; + } + + } \ No newline at end of file diff --git a/app/src/main/java/com/darkweb/genesissearchengine/constants/keys.java b/app/src/main/java/com/darkweb/genesissearchengine/constants/keys.java index 5ef305d9..d2910c16 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/constants/keys.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/constants/keys.java @@ -32,7 +32,7 @@ public class keys public static final String SETTING_LANGUAGE = "LANGUAGE_V1"; public static final String SETTING_LANGUAGE_REGION = "LANGUAGE_REGION_V1"; public static final String SETTING_SEARCH_ENGINE = "SEARCH_ENGINE_V1"; - public static final String SETTING_FIRST_INSTALLED = "FIRST_INSTALLED_V1"; + public static final String sLandingPageStatus = "FIRST_INSTALLED_V1"; public static final String SETTING_JAVA_SCRIPT = "JAVA_SCRIPT_V1"; public static final String SETTING_POPUP = "POPUP_V1"; public static final String SETTING_HISTORY_CLEAR = "HISTORY_CLEAR_V1"; @@ -76,4 +76,11 @@ public class keys public static final String BOOKMARK_SETTING_NAME = "BOOKMARK_SETTING_NAME"; public static final String BOOKMARK_SETTING_URL = "BOOKMARK_SETTING_URL"; public static final String BOOKMARK_SETTING_ID = "BOOKMARK_SETTING_ID"; + + /*Landing Settings*/ + public static final String LANDING_TITLE_KEY = "LANDING_TITLE_KEY"; + public static final String LANDING_SUB_TITLE_KEY = "LANDING_SUB_TITLE_KEY"; + public static final String LANDING_SUBMIT_KEY = "LANDING_SUBMIT_KEY"; + public static final String LANDING_LAYOUT_RESID = "LANDING_LAYOUT_RESID"; + } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/constants/status.java b/app/src/main/java/com/darkweb/genesissearchengine/constants/status.java index f5d2ad59..d242b188 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/constants/status.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/constants/status.java @@ -49,7 +49,7 @@ public class status public static boolean sSettingIsAppRestarting = false; public static boolean sSettingIsAppRated = false; public static boolean sSettingFontAdjustable = true; - public static boolean sSettingFirstStart = true; + public static boolean sLandingPageStatus = false; public static boolean mThemeApplying = false; public static boolean sTabGridLayoutEnabled = true; public static boolean sStatusDoNotTrack = true; @@ -107,7 +107,7 @@ public class status status.sVPNStatus = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.BRIDGE_VPN_ENABLED,false)); status.sBridgeStatus = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.BRIDGE_ENABLES,false)); status.sSettingFontAdjustable = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_FONT_ADJUSTABLE,true)); - status.sSettingFirstStart = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_FIRST_INSTALLED,true)); + status.sLandingPageStatus = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.sLandingPageStatus,false)); status.sSettingEnableZoom = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_ZOOM,true)); status.sSettingEnableVoiceInput = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_VOICE_INPUT,true)); status.sSettingTrackingProtection = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_TRACKING_PROTECTION, ContentBlocking.AntiTracking.DEFAULT)); diff --git a/app/src/main/java/com/darkweb/genesissearchengine/constants/strings.java b/app/src/main/java/com/darkweb/genesissearchengine/constants/strings.java index 480279dd..661e5e1a 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/constants/strings.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/constants/strings.java @@ -68,5 +68,10 @@ public class strings public static final String BOOKMARK_SETTING_VALIDATION_ERROR_2 = "bookmark url empty"; + /*Landing Manager*/ + + public static final String LANDING_LAYOUT_RESID = "layoutResId"; + + } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/helperManager/sharedUIMethod.java b/app/src/main/java/com/darkweb/genesissearchengine/helperManager/sharedUIMethod.java index 996d9e90..bbeaf5ba 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/helperManager/sharedUIMethod.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/helperManager/sharedUIMethod.java @@ -1,6 +1,7 @@ package com.darkweb.genesissearchengine.helperManager; +import android.content.res.Configuration; import android.os.Build; import android.view.View; import android.view.Window; @@ -8,7 +9,12 @@ import android.view.WindowManager; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatDelegate; import androidx.core.content.ContextCompat; +import com.darkweb.genesissearchengine.appManager.activityContextManager; +import com.darkweb.genesissearchengine.appManager.activityThemeManager; +import com.darkweb.genesissearchengine.pluginManager.pluginController; +import com.darkweb.genesissearchengine.pluginManager.pluginEnums; import com.example.myapplication.R; +import java.util.Collections; public class sharedUIMethod { @@ -31,4 +37,14 @@ public class sharedUIMethod } } } + + public static void onSharedConfigurationChanged(Configuration newConfig, AppCompatActivity pContext){ + pluginController.getInstance().onLanguageInvoke(Collections.singletonList(pContext), pluginEnums.eLangManager.M_ACTIVITY_CREATED); + + if(newConfig.uiMode != pContext.getResources().getConfiguration().uiMode){ + activityContextManager.getInstance().onResetTheme(); + activityThemeManager.getInstance().onConfigurationChanged(pContext); + } + } + } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/messagePluginManager/messageManager.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/messagePluginManager/messageManager.java index 55e46b1b..3bbf08cb 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/messagePluginManager/messageManager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/messagePluginManager/messageManager.java @@ -13,6 +13,7 @@ import android.view.Gravity; import android.view.View; import android.view.Window; import android.view.WindowManager; +import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.RatingBar; @@ -99,14 +100,14 @@ public class messageManager { 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()); + mDialog.findViewById(R.id.pTrigger).setOnClickListener(v -> mDialog.dismiss()); mDialog.setOnDismissListener(dialog -> onClearReference()); } private void rateFailure() { initializeDialog(R.layout.popup_rate_failure, Gravity.BOTTOM); - mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss()); + mDialog.findViewById(R.id.pTrigger).setOnClickListener(v -> mDialog.dismiss()); mDialog.findViewById(R.id.pNext).setOnClickListener(v -> { mDialog.dismiss(); final Handler handler = new Handler(); @@ -130,7 +131,7 @@ public class messageManager Runnable runnable = () -> mDialog.dismiss(); initializeDialog(R.layout.popup_new_circuit, Gravity.BOTTOM); - mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss()); + mDialog.findViewById(R.id.pTrigger).setOnClickListener(v -> mDialog.dismiss()); mDialog.setOnDismissListener(dialog -> { handler.removeCallbacks(runnable); @@ -154,7 +155,7 @@ public class messageManager mMessage = (String) mData.get(0); } ((TextView)mDialog.findViewById(R.id.pDescription)).setText(("Request denied Error " + mMessage)); - mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss()); + mDialog.findViewById(R.id.pTrigger).setOnClickListener(v -> mDialog.dismiss()); mDialog.setOnDismissListener(dialog -> { handler.removeCallbacks(runnable); @@ -228,46 +229,30 @@ public class messageManager handler.postDelayed(runnable, 1500); } - private void deleteBookmark() + private void onShowToast(int mLayout, int mDelay, String mInfo, String mTriggerText, pluginEnums.eMessageManagerCallbacks pCallback) { + initializeDialog(mLayout, Gravity.BOTTOM); + ((TextView)mDialog.findViewById(R.id.pDescription)).setText(mInfo); + ((Button)mDialog.findViewById(R.id.pTrigger)).setText(mTriggerText); + mDialog.getWindow().setDimAmount(0.3f); + final Handler handler = new Handler(); Runnable runnable = () -> mDialog.dismiss(); - initializeDialog(R.layout.popup_remove_bookmark, Gravity.BOTTOM); - mDialog.getWindow().setDimAmount(0.3f); - mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> { - mEvent.invokeObserver(null, M_UNDO_TAB); - mDialog.dismiss(); - handler.removeCallbacks(runnable); - }); - mDialog.setOnDismissListener(dialog -> { handler.removeCallbacks(runnable); onClearReference(); }); - handler.postDelayed(runnable, 1500); - } - - private void updateBookmark() - { - final Handler handler = new Handler(); - Runnable runnable = () -> mDialog.dismiss(); - - initializeDialog(R.layout.popup_update_bookmark, Gravity.BOTTOM); - mDialog.getWindow().setDimAmount(0.3f); - mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> { - mEvent.invokeObserver(null, M_UNDO_TAB); - mDialog.dismiss(); - handler.removeCallbacks(runnable); + mDialog.findViewById(R.id.pTrigger).setOnClickListener(v -> { + if(pCallback == null){ + mEvent.invokeObserver(null, M_UNDO_TAB); + mDialog.dismiss(); + handler.removeCallbacks(runnable); + } }); - mDialog.setOnDismissListener(dialog -> { - handler.removeCallbacks(runnable); - onClearReference(); - }); - - handler.postDelayed(runnable, 1500); + handler.postDelayed(runnable, mDelay); } private void maxTabReached() @@ -277,7 +262,7 @@ public class messageManager initializeDialog(R.layout.popup_max_tab, Gravity.BOTTOM); mDialog.getWindow().setDimAmount(0); - mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> { + mDialog.findViewById(R.id.pTrigger).setOnClickListener(v -> { mDialog.dismiss(); handler.removeCallbacks(runnable); }); @@ -294,7 +279,7 @@ public class messageManager private void notSupportMessage() { initializeDialog(R.layout.popup_not_supported, Gravity.BOTTOM); - mDialog.findViewById(R.id.pDismiss).setOnClickListener(view -> mDialog.dismiss()); + mDialog.findViewById(R.id.pTrigger).setOnClickListener(view -> mDialog.dismiss()); mDialog.setOnDismissListener(dialog -> onClearReference()); final Handler handler = new Handler(); @@ -309,7 +294,7 @@ public class messageManager private void onPanic(){ initializeDialog(R.layout.popup_panic, Gravity.BOTTOM); - mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss()); + mDialog.findViewById(R.id.pTrigger).setOnClickListener(v -> mDialog.dismiss()); mDialog.setOnDismissListener(dialog -> onClearReference()); mDialog.findViewById(R.id.pNext).setOnClickListener(v -> { mDialog.dismiss(); @@ -344,7 +329,7 @@ public class messageManager Runnable runnable = () -> mDialog.dismiss(); initializeDialog(R.layout.popup_data_cleared, Gravity.BOTTOM); - mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss()); + mDialog.findViewById(R.id.pTrigger).setOnClickListener(v -> mDialog.dismiss()); mDialog.setOnDismissListener(dialog -> { handler.removeCallbacks(runnable); @@ -357,7 +342,7 @@ public class messageManager private void applicationCrashed() { initializeDialog(R.layout.application_crash, Gravity.BOTTOM); - mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss()); + mDialog.findViewById(R.id.pTrigger).setOnClickListener(v -> mDialog.dismiss()); mDialog.setOnDismissListener(dialog -> onClearReference()); } @@ -372,7 +357,7 @@ public class messageManager mDialog.getWindow().setBackgroundDrawable(inset); mDialog.setCancelable(true); mDialog.setCanceledOnTouchOutside(true); - mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss()); + mDialog.findViewById(R.id.pTrigger).setOnClickListener(v -> mDialog.dismiss()); mDialog.findViewById(R.id.pNext).setOnClickListener(v -> mEvent.invokeObserver(null, M_SECURE_CONNECTION)); if((boolean) mData.get(1)){ @@ -414,7 +399,7 @@ public class messageManager String pURL = mData.get(0).toString().replace("genesis.onion","genesishiddentechnologies.com"); ((TextView)mDialog.findViewById(R.id.pURL)).setText(pURL); - mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> { + mDialog.findViewById(R.id.pTrigger).setOnClickListener(v -> { mDialog.dismiss(); helperMethod.hideKeyboard(mContext); }); @@ -534,7 +519,7 @@ public class messageManager ((TextView) mDialog.findViewById(R.id.pDescription)).setText(mData.get(0).toString()); ((TextView) mDialog.findViewById(R.id.pDescriptionLong)).setText(murl); - mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss()); + mDialog.findViewById(R.id.pTrigger).setOnClickListener(v -> mDialog.dismiss()); mDialog.findViewById(R.id.pNext).setOnClickListener(v -> { mDialog.dismiss(); final Handler handler = new Handler(); @@ -551,7 +536,7 @@ public class messageManager private void rateApp() { initializeDialog(R.layout.popup_rate_us, Gravity.CENTER); - mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss()); + mDialog.findViewById(R.id.pTrigger).setOnClickListener(v -> mDialog.dismiss()); mDialog.findViewById(R.id.pNext).setOnClickListener(v -> { RatingBar mRatingBar = mDialog.findViewById(R.id.pRating); if(mRatingBar.getRating()>=3){ @@ -589,7 +574,7 @@ public class messageManager initializeDialog(R.layout.popup_file_longpress, Gravity.CENTER); ((TextView) mDialog.findViewById(R.id.pDescription)).setText((title + mData.get(0).toString())); mEvent.invokeObserver(Arrays.asList(((ImageView) mDialog.findViewById(R.id.pFaviconLogo)), helperMethod.getDomainName(mData.get(0).toString())), enums.etype.fetch_favicon); - mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss()); + mDialog.findViewById(R.id.pTrigger).setOnClickListener(v -> mDialog.dismiss()); mDialog.findViewById(R.id.pOption1).setOnClickListener(v -> { if(mData!=null){ mEvent.invokeObserver(Collections.singletonList(mData.get(0)), M_DOWNLOAD_FILE_MANUAL); @@ -624,7 +609,7 @@ public class messageManager initializeDialog(R.layout.popup_url_longpress, Gravity.CENTER); ((TextView) mDialog.findViewById(R.id.pDescription)).setText((title + mData.get(0))); mEvent.invokeObserver(Arrays.asList(((ImageView) mDialog.findViewById(R.id.pFaviconLogo)), helperMethod.getDomainName(mData.get(0).toString())), enums.etype.fetch_favicon); - mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss()); + mDialog.findViewById(R.id.pTrigger).setOnClickListener(v -> mDialog.dismiss()); mDialog.findViewById(R.id.pOption1).setOnClickListener(v -> { if(mData!=null){ mEvent.invokeObserver(Collections.singletonList(mData.get(0)), M_OPEN_LINK_NEW_TAB); @@ -727,7 +712,7 @@ public class messageManager private void sendBridgeMail() { initializeDialog(R.layout.popup_bridge_mail, Gravity.BOTTOM); - mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss()); + mDialog.findViewById(R.id.pTrigger).setOnClickListener(v -> mDialog.dismiss()); mDialog.findViewById(R.id.pNext).setOnClickListener(v -> { mDialog.dismiss(); final Handler handler = new Handler(); @@ -888,12 +873,12 @@ public class messageManager case M_DELETE_BOOKMARK: /*VERIFIED*/ - deleteBookmark(); + onShowToast(R.layout.popup_toast_generic, 2000, mContext.getString(R.string.HOME_MENU__BOOKMARK_REMOVED), mContext.getString(R.string.ALERT_DISMISS), null); break; case M_UPDATE_BOOKMARK: /*VERIFIED*/ - updateBookmark(); + onShowToast(R.layout.popup_toast_generic, 2000, mContext.getString(R.string.HOME_MENU__BOOKMARK_UPDATE), mContext.getString(R.string.ALERT_DISMISS), null); break; } } diff --git a/app/src/main/res/custom-xml/alert/xml/ax_bottom_rounded_corner_right.xml b/app/src/main/res/custom-xml/alert/xml/ax_bottom_rounded_corner_right.xml index a3b942dd..e02b087e 100644 --- a/app/src/main/res/custom-xml/alert/xml/ax_bottom_rounded_corner_right.xml +++ b/app/src/main/res/custom-xml/alert/xml/ax_bottom_rounded_corner_right.xml @@ -1,5 +1,5 @@ + android:color="@color/c_ripple_gray"> diff --git a/app/src/main/res/custom-xml/alert/xml/ax_load_new_tab.xml b/app/src/main/res/custom-xml/alert/xml/ax_load_new_tab.xml index f5e22c10..d3a55636 100644 --- a/app/src/main/res/custom-xml/alert/xml/ax_load_new_tab.xml +++ b/app/src/main/res/custom-xml/alert/xml/ax_load_new_tab.xml @@ -1,9 +1,9 @@ + android:color="@color/c_holo_gray"> - + diff --git a/app/src/main/res/custom-xml/alert/xml/ax_ripple_default_round.xml b/app/src/main/res/custom-xml/alert/xml/ax_ripple_default_round.xml deleted file mode 100644 index e8eecf84..00000000 --- a/app/src/main/res/custom-xml/alert/xml/ax_ripple_default_round.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/custom-xml/alert/xml/ax_ripple_default_round_left.xml b/app/src/main/res/custom-xml/alert/xml/ax_ripple_default_round_left.xml index 210021b7..a1a71774 100644 --- a/app/src/main/res/custom-xml/alert/xml/ax_ripple_default_round_left.xml +++ b/app/src/main/res/custom-xml/alert/xml/ax_ripple_default_round_left.xml @@ -1,5 +1,5 @@ + android:color="@color/c_ripple_gray"> diff --git a/app/src/main/res/custom-xml/alert/xml/ax_ripple_default_round_right.xml b/app/src/main/res/custom-xml/alert/xml/ax_ripple_default_round_right.xml index efeff72c..5a8c4aed 100644 --- a/app/src/main/res/custom-xml/alert/xml/ax_ripple_default_round_right.xml +++ b/app/src/main/res/custom-xml/alert/xml/ax_ripple_default_round_right.xml @@ -1,8 +1,8 @@ + android:color="@color/c_ripple_gray"> - + diff --git a/app/src/main/res/custom-xml/alert/xml/ax_shadow.xml b/app/src/main/res/custom-xml/alert/xml/ax_shadow.xml index 0c4ba6ee..5ecad2d9 100644 --- a/app/src/main/res/custom-xml/alert/xml/ax_shadow.xml +++ b/app/src/main/res/custom-xml/alert/xml/ax_shadow.xml @@ -64,7 +64,7 @@ - + \ No newline at end of file diff --git a/app/src/main/res/custom-xml/alert/xml/ax_background_inverted.xml b/app/src/main/res/custom-xml/alert/xml/ax_toast_alert_background.xml similarity index 87% rename from app/src/main/res/custom-xml/alert/xml/ax_background_inverted.xml rename to app/src/main/res/custom-xml/alert/xml/ax_toast_alert_background.xml index f9a5fe5a..e480de64 100644 --- a/app/src/main/res/custom-xml/alert/xml/ax_background_inverted.xml +++ b/app/src/main/res/custom-xml/alert/xml/ax_toast_alert_background.xml @@ -1,25 +1,25 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/custom-xml/alert/xml/ax_toast_alert_button.xml b/app/src/main/res/custom-xml/alert/xml/ax_toast_alert_button.xml new file mode 100644 index 00000000..4ad77f0f --- /dev/null +++ b/app/src/main/res/custom-xml/alert/xml/ax_toast_alert_button.xml @@ -0,0 +1,13 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/custom-xml/bookmark/xml/bx_input_field.xml b/app/src/main/res/custom-xml/bookmark/xml/bx_input_field.xml index f48079be..473b2c42 100644 --- a/app/src/main/res/custom-xml/bookmark/xml/bx_input_field.xml +++ b/app/src/main/res/custom-xml/bookmark/xml/bx_input_field.xml @@ -6,7 +6,7 @@ - + @@ -15,7 +15,7 @@ - + diff --git a/app/src/main/res/custom-xml/bookmark/xml/bx_ripple_default_round.xml b/app/src/main/res/custom-xml/bookmark/xml/bx_ripple_default_round.xml index eceebbf4..8b9680ce 100644 --- a/app/src/main/res/custom-xml/bookmark/xml/bx_ripple_default_round.xml +++ b/app/src/main/res/custom-xml/bookmark/xml/bx_ripple_default_round.xml @@ -1,5 +1,5 @@ + android:color="@color/c_ripple_gray"> diff --git a/app/src/main/res/custom-xml/generic/xml/gx_generic_input_white.xml b/app/src/main/res/custom-xml/generic/xml/gx_generic_input_white.xml index e523c31d..06bc343c 100644 --- a/app/src/main/res/custom-xml/generic/xml/gx_generic_input_white.xml +++ b/app/src/main/res/custom-xml/generic/xml/gx_generic_input_white.xml @@ -5,7 +5,7 @@ android:top="113dp"> - + @@ -13,7 +13,7 @@ android:top="113dp"> - + diff --git a/app/src/main/res/custom-xml/generic/xml/gx_ripple_blue.xml b/app/src/main/res/custom-xml/generic/xml/gx_ripple_blue.xml index 85c3a380..dc9feb2f 100644 --- a/app/src/main/res/custom-xml/generic/xml/gx_ripple_blue.xml +++ b/app/src/main/res/custom-xml/generic/xml/gx_ripple_blue.xml @@ -1,8 +1,8 @@ + android:color="@color/c_ripple_gray"> - + diff --git a/app/src/main/res/custom-xml/generic/xml/gx_ripple_default_round.xml b/app/src/main/res/custom-xml/generic/xml/gx_ripple_default_round.xml index fbffa74a..ccecf4d1 100644 --- a/app/src/main/res/custom-xml/generic/xml/gx_ripple_default_round.xml +++ b/app/src/main/res/custom-xml/generic/xml/gx_ripple_default_round.xml @@ -1,5 +1,5 @@ + android:color="@color/c_ripple_gray"> diff --git a/app/src/main/res/custom-xml/generic/xml/gx_ripple_gray.xml b/app/src/main/res/custom-xml/generic/xml/gx_ripple_gray.xml index fc16c439..47c01814 100644 --- a/app/src/main/res/custom-xml/generic/xml/gx_ripple_gray.xml +++ b/app/src/main/res/custom-xml/generic/xml/gx_ripple_gray.xml @@ -1,5 +1,5 @@ + android:color="@color/c_ripple_gray"> diff --git a/app/src/main/res/custom-xml/generic/xml/gx_ripple_gray_round_left.xml b/app/src/main/res/custom-xml/generic/xml/gx_ripple_gray_round_left.xml index 52df40c9..c3c8a913 100644 --- a/app/src/main/res/custom-xml/generic/xml/gx_ripple_gray_round_left.xml +++ b/app/src/main/res/custom-xml/generic/xml/gx_ripple_gray_round_left.xml @@ -1,6 +1,6 @@ + android:color="@color/c_ripple_gray"> diff --git a/app/src/main/res/custom-xml/generic/xml/gx_rounded_corner_alert.xml b/app/src/main/res/custom-xml/generic/xml/gx_rounded_corner_alert.xml index 5498a02b..ae3c36f6 100644 --- a/app/src/main/res/custom-xml/generic/xml/gx_rounded_corner_alert.xml +++ b/app/src/main/res/custom-xml/generic/xml/gx_rounded_corner_alert.xml @@ -1,9 +1,9 @@ + android:color="@color/c_holo_gray"> - + diff --git a/app/src/main/res/custom-xml/generic/xml/gx_side_item_popup.xml b/app/src/main/res/custom-xml/generic/xml/gx_side_item_popup.xml index b7ddde6a..bab03ae9 100644 --- a/app/src/main/res/custom-xml/generic/xml/gx_side_item_popup.xml +++ b/app/src/main/res/custom-xml/generic/xml/gx_side_item_popup.xml @@ -1,6 +1,6 @@ + android:color="@color/c_white"> diff --git a/app/src/main/res/custom-xml/generic/xml/gx_side_item_suggestions.xml b/app/src/main/res/custom-xml/generic/xml/gx_side_item_suggestions.xml index c88416b0..c1da6764 100644 --- a/app/src/main/res/custom-xml/generic/xml/gx_side_item_suggestions.xml +++ b/app/src/main/res/custom-xml/generic/xml/gx_side_item_suggestions.xml @@ -1,9 +1,9 @@ + android:color="@color/c_holo_gray"> - + diff --git a/app/src/main/res/custom-xml/generic/xml/gx_side_menu.xml b/app/src/main/res/custom-xml/generic/xml/gx_side_menu.xml index 4b92902f..223e6e09 100644 --- a/app/src/main/res/custom-xml/generic/xml/gx_side_menu.xml +++ b/app/src/main/res/custom-xml/generic/xml/gx_side_menu.xml @@ -1,6 +1,6 @@ + android:color="@color/c_white"> diff --git a/app/src/main/res/custom-xml/history/xml/hx_menu_popup_container.xml b/app/src/main/res/custom-xml/history/xml/hx_menu_popup_container.xml index 1f1852ba..22ae4897 100644 --- a/app/src/main/res/custom-xml/history/xml/hx_menu_popup_container.xml +++ b/app/src/main/res/custom-xml/history/xml/hx_menu_popup_container.xml @@ -1,6 +1,6 @@ + android:color="@color/c_white"> diff --git a/app/src/main/res/custom-xml/home/xml/gx_ripple_gray_bottom.xml b/app/src/main/res/custom-xml/home/xml/gx_ripple_gray_bottom.xml index 9851a34c..d33ac0c9 100644 --- a/app/src/main/res/custom-xml/home/xml/gx_ripple_gray_bottom.xml +++ b/app/src/main/res/custom-xml/home/xml/gx_ripple_gray_bottom.xml @@ -1,5 +1,5 @@ + android:color="@color/c_ripple_gray"> diff --git a/app/src/main/res/custom-xml/home/xml/gx_ripple_gray_top_bar.xml b/app/src/main/res/custom-xml/home/xml/gx_ripple_gray_top_bar.xml index 554ee646..b07864a6 100644 --- a/app/src/main/res/custom-xml/home/xml/gx_ripple_gray_top_bar.xml +++ b/app/src/main/res/custom-xml/home/xml/gx_ripple_gray_top_bar.xml @@ -1,6 +1,6 @@ + android:color="@color/c_holo_gray"> + android:color="@color/c_ripple_gray"> diff --git a/app/src/main/res/custom-xml/home/xml/gx_ripple_gray_top_right.xml b/app/src/main/res/custom-xml/home/xml/gx_ripple_gray_top_right.xml index added5d1..e1653da2 100644 --- a/app/src/main/res/custom-xml/home/xml/gx_ripple_gray_top_right.xml +++ b/app/src/main/res/custom-xml/home/xml/gx_ripple_gray_top_right.xml @@ -1,5 +1,5 @@ + android:color="@color/c_ripple_gray"> diff --git a/app/src/main/res/custom-xml/home/xml/hox_rounded_corner.xml b/app/src/main/res/custom-xml/home/xml/hox_rounded_corner.xml index 57c11fdb..4a177359 100644 --- a/app/src/main/res/custom-xml/home/xml/hox_rounded_corner.xml +++ b/app/src/main/res/custom-xml/home/xml/hox_rounded_corner.xml @@ -1,9 +1,9 @@ + android:color="@color/c_holo_gray"> - + @@ -12,8 +12,8 @@ diff --git a/app/src/main/res/custom-xml/home/xml/hox_rounded_corner_bottom.xml b/app/src/main/res/custom-xml/home/xml/hox_rounded_corner_bottom.xml index 116df670..3af453c7 100644 --- a/app/src/main/res/custom-xml/home/xml/hox_rounded_corner_bottom.xml +++ b/app/src/main/res/custom-xml/home/xml/hox_rounded_corner_bottom.xml @@ -1,9 +1,9 @@ + android:color="@color/c_holo_gray"> - + diff --git a/app/src/main/res/custom-xml/home/xml/hox_rounded_corner_splash.xml b/app/src/main/res/custom-xml/home/xml/hox_rounded_corner_splash.xml index 06848c0e..7c636f6b 100644 --- a/app/src/main/res/custom-xml/home/xml/hox_rounded_corner_splash.xml +++ b/app/src/main/res/custom-xml/home/xml/hox_rounded_corner_splash.xml @@ -1,9 +1,9 @@ + android:color="@color/c_holo_gray"> - + diff --git a/app/src/main/res/custom-xml/home/xml/hox_rounded_corner_splash_right.xml b/app/src/main/res/custom-xml/home/xml/hox_rounded_corner_splash_right.xml index dca2ed44..7441a8d7 100644 --- a/app/src/main/res/custom-xml/home/xml/hox_rounded_corner_splash_right.xml +++ b/app/src/main/res/custom-xml/home/xml/hox_rounded_corner_splash_right.xml @@ -1,6 +1,6 @@ + android:color="@color/c_holo_gray"> @@ -16,7 +16,7 @@ - + + android:color="@color/c_ripple_gray"> diff --git a/app/src/main/res/custom-xml/landing/xml/lx_round_drawable.xml b/app/src/main/res/custom-xml/landing/xml/lx_round_drawable.xml index 25ce7d0d..e230b7b5 100644 --- a/app/src/main/res/custom-xml/landing/xml/lx_round_drawable.xml +++ b/app/src/main/res/custom-xml/landing/xml/lx_round_drawable.xml @@ -2,7 +2,7 @@ + android:color="@color/c_white" /> + android:color="@color/c_holo_gray"> diff --git a/app/src/main/res/custom-xml/setting/xml/sx_font_change_round_background.xml b/app/src/main/res/custom-xml/setting/xml/sx_font_change_round_background.xml index 950cbaba..2fbb1b47 100644 --- a/app/src/main/res/custom-xml/setting/xml/sx_font_change_round_background.xml +++ b/app/src/main/res/custom-xml/setting/xml/sx_font_change_round_background.xml @@ -1,6 +1,6 @@ + android:color="@color/c_holo_gray"> diff --git a/app/src/main/res/custom-xml/tab/xml/tx_border.xml b/app/src/main/res/custom-xml/tab/xml/tx_border.xml index 51c1f8ef..8b716bdc 100644 --- a/app/src/main/res/custom-xml/tab/xml/tx_border.xml +++ b/app/src/main/res/custom-xml/tab/xml/tx_border.xml @@ -3,7 +3,7 @@ + android:color="@color/c_ripple_gray"> diff --git a/app/src/main/res/layouts/alert/layout/application_crash.xml b/app/src/main/res/layouts/alert/layout/application_crash.xml index d0213aa7..06267966 100644 --- a/app/src/main/res/layouts/alert/layout/application_crash.xml +++ b/app/src/main/res/layouts/alert/layout/application_crash.xml @@ -35,7 +35,7 @@