Bug Fixes

Bug Fixes
master
msmannan00 2021-03-27 13:15:20 +05:00
parent fc79df39a9
commit 4438620783
29 changed files with 913 additions and 140 deletions

View File

@ -146,6 +146,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
private FragmentContainerView mTabFragment; private FragmentContainerView mTabFragment;
private LinearLayout mTopBarContainer; private LinearLayout mTopBarContainer;
private View mPopupLoadNewTab; private View mPopupLoadNewTab;
private ImageView mTopBarHider;
/*Redirection Objects*/ /*Redirection Objects*/
private GeckoResult<Bitmap> mRenderedBitmap = null; private GeckoResult<Bitmap> mRenderedBitmap = null;
@ -397,13 +398,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mProgressBarIndeterminate = findViewById(R.id.pProgressBarIndeterminate); mProgressBarIndeterminate = findViewById(R.id.pProgressBarIndeterminate);
mTabFragment = findViewById(R.id.mTabFragment); mTabFragment = findViewById(R.id.mTabFragment);
mPopupLoadNewTab = findViewById(R.id.pPopupLoadNewTab); mPopupLoadNewTab = findViewById(R.id.pPopupLoadNewTab);
mTopBarHider = findViewById(R.id.pTopBarHider);
mGeckoView.setSaveEnabled(false); mGeckoView.setSaveEnabled(false);
mGeckoView.setSaveFromParentEnabled(false); mGeckoView.setSaveFromParentEnabled(false);
mGeckoView.setAutofillEnabled(true); mGeckoView.setAutofillEnabled(true);
mGeckoClient = new geckoClients(); mGeckoClient = new geckoClients();
mHomeViewController.initialization(new homeViewCallback(),this,mNewTab, mWebViewContainer, mLoadingText, mProgressBar, mSearchbar, mSplashScreen, mLoadingIcon, mBannerAds, mGatewaySplash, mTopBar, mGeckoView, mBackSplash, mConnectButton, mFindBar, mFindText, mFindCount, mTopLayout, mVoiceInput, mMenu, mNestedScroll, mBlocker, mBlockerFullSceen, mSearchEngineBar, mCopyright, mHintListView, mAppBar, mOrbotLogManager, mInfoLandscape, mInfoPortrait, mProgressBarIndeterminate, mTabFragment, mTopBarContainer, mSearchLock, mPopupLoadNewTab); mHomeViewController.initialization(new homeViewCallback(),this,mNewTab, mWebViewContainer, mLoadingText, mProgressBar, mSearchbar, mSplashScreen, mLoadingIcon, mBannerAds, mGatewaySplash, mTopBar, mGeckoView, mBackSplash, mConnectButton, mFindBar, mFindText, mFindCount, mTopLayout, mVoiceInput, mMenu, mNestedScroll, mBlocker, mBlockerFullSceen, mSearchEngineBar, mCopyright, mHintListView, mAppBar, mOrbotLogManager, mInfoLandscape, mInfoPortrait, mProgressBarIndeterminate, mTabFragment, mTopBarContainer, mSearchLock, mPopupLoadNewTab, mTopBarHider);
mGeckoView.onSetHomeEvent(new nestedGeckoViewCallback()); mGeckoView.onSetHomeEvent(new nestedGeckoViewCallback());
mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,false); mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,false);
mGeckoClient.onValidateInitializeFromStartup(); mGeckoClient.onValidateInitializeFromStartup();
@ -498,7 +500,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
} }
public void initRuntimeSettings() public void initRuntimeSettings()
{ {
mGeckoClient.updateSetting(); mGeckoClient.updateSetting();
@ -510,6 +511,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
public void onLoadURL(String url){ public void onLoadURL(String url){
if(mGeckoView!=null && mGeckoView.getSession()!=null && !mGeckoView.getSession().isOpen()){
mGeckoView.getSession().open(mGeckoClient.getmRuntime());
}
mAppBar.animate().cancel(); mAppBar.animate().cancel();
mHomeViewController.onClearSelections(true); mHomeViewController.onClearSelections(true);
Objects.requireNonNull(mGeckoView.getSession()).stop(); Objects.requireNonNull(mGeckoView.getSession()).stop();
@ -646,7 +652,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
return false; return false;
}); });
mFindText.addTextChangedListener(new TextWatcher() { mFindText.addTextChangedListener(new TextWatcher() {
@Override @Override
@ -1005,6 +1010,13 @@ public class homeController extends AppCompatActivity implements ComponentCallba
helperMethod.hideKeyboard(this); helperMethod.hideKeyboard(this);
mHomeViewController.onOpenMenu(view,mGeckoClient.canGoForward(),!(mProgressBar.getAlpha()<=0 || mProgressBar.getVisibility() ==View.INVISIBLE),mGeckoClient.getUserAgent()); mHomeViewController.onOpenMenu(view,mGeckoClient.canGoForward(),!(mProgressBar.getAlpha()<=0 || mProgressBar.getVisibility() ==View.INVISIBLE),mGeckoClient.getUserAgent());
view.setClickable(false);
new Handler().postDelayed(() ->
{
view.setClickable(true);
}, 500);
} }
public void onFullScreenSettingChanged(){ public void onFullScreenSettingChanged(){
@ -1013,7 +1025,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
public void onDisableTabViewController(){ public void onDisableTabViewController(){
onResumeDump(); onResumeDump();
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), true);
mHomeViewController.onHideTabContainer(); mHomeViewController.onHideTabContainer();
activityContextManager.getInstance().getTabController().onExitAndClearBackup(); activityContextManager.getInstance().getTabController().onExitAndClearBackup();
activityContextManager.getInstance().getTabController().onPostExit(); activityContextManager.getInstance().getTabController().onPostExit();
@ -1023,7 +1034,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
public void onBackPressed(){ public void onBackPressed(){
if(mTabFragment.getVisibility()==View.VISIBLE){ if(mTabFragment.getVisibility()==View.VISIBLE){
onResumeDump(); onResumeDump();
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), false);
mHomeViewController.onHideTabContainer(); mHomeViewController.onHideTabContainer();
activityContextManager.getInstance().getTabController().onPostExit(); activityContextManager.getInstance().getTabController().onPostExit();
activityContextManager.getInstance().getTabController().onBackPressed(); activityContextManager.getInstance().getTabController().onBackPressed();
@ -1155,9 +1165,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if(mGeckoView!=null && mGeckoView.getSession()!=null && !mGeckoView.getSession().isOpen()){ if(mGeckoView!=null && mGeckoView.getSession()!=null && !mGeckoView.getSession().isOpen()){
onReDrawGeckoview(); onReDrawGeckoview();
onLoadURL(model.getSession().getCurrentURL()); onLoadURL(model.getSession().getCurrentURL());
}else if(mGeckoView != null){
mGeckoView.requestFocus();
mGeckoView.setSession(model.getSession());
} }
} }
} }
@ -1197,7 +1204,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
if(status.sSettingIsAppStarted && mAppRestarted) { if(status.sSettingIsAppStarted && mAppRestarted) {
onUpdateStatusBarTheme();
activityContextManager.getInstance().onClearStack(); activityContextManager.getInstance().onClearStack();
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null); tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
@ -1305,7 +1311,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
public void onSaveCurrentTab(geckoSession session,boolean isHardCopy){ public void onSaveCurrentTab(geckoSession session,boolean isHardCopy){
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_ADD_TAB, Arrays.asList(session,isHardCopy)); int mStatus = (Integer) dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_ADD_TAB, Arrays.asList(session,isHardCopy));
if(mStatus == enums.AddTabCallback.TAB_FULL){
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(this), M_MAX_TAB_REACHED);
}
} }
public boolean onCloseCurrentTab(geckoSession session){ public boolean onCloseCurrentTab(geckoSession session){
@ -1503,6 +1512,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
public void onReInitTheme(){ public void onReInitTheme(){
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), true);
} }
public void onOrbotLog(View view) { public void onOrbotLog(View view) {
@ -1537,7 +1547,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
else if(e_type.equals(enums.etype.M_UPDATE_THEME)) else if(e_type.equals(enums.etype.M_UPDATE_THEME))
{ {
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), false); mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), true);
} }
else if(e_type.equals(enums.etype.ON_UPDATE_THEME)){ else if(e_type.equals(enums.etype.ON_UPDATE_THEME)){
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(),false); mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(),false);

View File

@ -108,14 +108,17 @@ class homeViewController
private LinearLayout mTopBarContainer; private LinearLayout mTopBarContainer;
private ImageView mSearchLock; private ImageView mSearchLock;
private View mPopupLoadNewTab; private View mPopupLoadNewTab;
private ImageView mTopBarHider;
/*Local Variables*/ /*Local Variables*/
private Callable<String> mLogs = null; private Callable<String> mLogs = null;
private boolean isLandscape = false; private boolean isLandscape = false;
private boolean isFullScreen = false; private boolean isFullScreen = false;
private MovementMethod mSearchBarMovementMethod = null; private MovementMethod mSearchBarMovementMethod = null;
private Handler mTabDialogHandler = null;
private Runnable mTabDialogRunnable = null;
void initialization(eventObserver.eventListener event, AppCompatActivity context, Button mNewTab, ConstraintLayout webviewContainer, TextView loadingText, AnimatedProgressBar progressBar, editTextManager searchbar, ConstraintLayout splashScreen, ImageView loading, AdView banner_ads, ImageButton gateway_splash, LinearLayout top_bar, GeckoView gecko_view, ImageView backsplash, Button connect_button, View pFindBar, EditText pFindText, TextView pFindCount, androidx.constraintlayout.widget.ConstraintLayout pTopLayout, ImageButton pVoiceInput, ImageButton pMenu, androidx.core.widget.NestedScrollView pNestedScroll, ImageView pBlocker, ImageView pBlockerFullSceen, View mSearchEngineBar, TextView pCopyright, RecyclerView pHistListView, com.google.android.material.appbar.AppBarLayout pAppBar, ImageButton pOrbotLogManager, ConstraintLayout pInfoLandscape, ConstraintLayout pInfoPortrait, ProgressBar pProgressBarIndeterminate, FragmentContainerView pTabFragment, LinearLayout pTopBarContainer, ImageView pSearchLock, View pPopupLoadNewTab){ void initialization(eventObserver.eventListener event, AppCompatActivity context, Button mNewTab, ConstraintLayout webviewContainer, TextView loadingText, AnimatedProgressBar progressBar, editTextManager searchbar, ConstraintLayout splashScreen, ImageView loading, AdView banner_ads, ImageButton gateway_splash, LinearLayout top_bar, GeckoView gecko_view, ImageView backsplash, Button connect_button, View pFindBar, EditText pFindText, TextView pFindCount, androidx.constraintlayout.widget.ConstraintLayout pTopLayout, ImageButton pVoiceInput, ImageButton pMenu, androidx.core.widget.NestedScrollView pNestedScroll, ImageView pBlocker, ImageView pBlockerFullSceen, View mSearchEngineBar, TextView pCopyright, RecyclerView pHistListView, com.google.android.material.appbar.AppBarLayout pAppBar, ImageButton pOrbotLogManager, ConstraintLayout pInfoLandscape, ConstraintLayout pInfoPortrait, ProgressBar pProgressBarIndeterminate, FragmentContainerView pTabFragment, LinearLayout pTopBarContainer, ImageView pSearchLock, View pPopupLoadNewTab, ImageView pTopBarHider){
this.mContext = context; this.mContext = context;
this.mProgressBar = progressBar; this.mProgressBar = progressBar;
this.mSearchbar = searchbar; this.mSearchbar = searchbar;
@ -150,6 +153,7 @@ class homeViewController
this.mTopBarContainer = pTopBarContainer; this.mTopBarContainer = pTopBarContainer;
this.mSearchLock = pSearchLock; this.mSearchLock = pSearchLock;
this.mPopupLoadNewTab = pPopupLoadNewTab; this.mPopupLoadNewTab = pPopupLoadNewTab;
this.mTopBarHider = pTopBarHider;
initSplashScreen(); initSplashScreen();
createUpdateUiHandler(); createUpdateUiHandler();
@ -209,13 +213,19 @@ class homeViewController
mPopupLoadNewTab.setVisibility(View.VISIBLE); mPopupLoadNewTab.setVisibility(View.VISIBLE);
mPopupLoadNewTab.animate().setDuration(350).alpha(1); mPopupLoadNewTab.animate().setDuration(350).alpha(1);
final Handler handler = new Handler(); if(mTabDialogHandler!=null){
handler.postDelayed(this::onHideLoadTabDialog, 2500); mTabDialogHandler.removeCallbacksAndMessages(null);
}
mTabDialogHandler = new Handler();
mTabDialogRunnable = this::onHideLoadTabDialog;
mTabDialogHandler.postDelayed(mTabDialogRunnable, 7500);
} }
public void onHideLoadTabDialog() { public void onHideLoadTabDialog() {
mPopupLoadNewTab.findViewById(R.id.pBlockerUndo).setVisibility(View.VISIBLE); mPopupLoadNewTab.findViewById(R.id.pBlockerUndo).setVisibility(View.VISIBLE);
mPopupLoadNewTab.animate().cancel(); mPopupLoadNewTab.animate().cancel();
mPopupLoadNewTab.animate().setDuration(350).alpha(0).withEndAction(() -> { mPopupLoadNewTab.animate().setDuration(350).alpha(0).withEndAction(() -> {
mPopupLoadNewTab.setVisibility(View.GONE); mPopupLoadNewTab.setVisibility(View.GONE);
}); });
@ -225,10 +235,13 @@ class homeViewController
if(mTabFragment.getAlpha()==0 || mTabFragment.getAlpha()==1){ if(mTabFragment.getAlpha()==0 || mTabFragment.getAlpha()==1){
onUpdateStatusBarTheme(null, false); onUpdateStatusBarTheme(null, false);
mTabFragment.setAlpha(0); mTabFragment.setAlpha(0);
mTabFragment.setTranslationY(0); mTabFragment.setTranslationY(0);
mTabFragment.setVisibility(View.VISIBLE); mTabFragment.setVisibility(View.VISIBLE);
mTabFragment.setTranslationY(-1 * helperMethod.pxFromDp(15)); mTabFragment.setTranslationY(-1 * helperMethod.pxFromDp(15));
mTopBarHider.setVisibility(View.VISIBLE);
mTopBarHider.animate().alpha(1).setDuration(0);
new Handler().postDelayed(() -> new Handler().postDelayed(() ->
{ {
@ -248,12 +261,14 @@ class homeViewController
public void onHideTabContainer(){ public void onHideTabContainer(){
if(mTabFragment.getAlpha()==1){ if(mTabFragment.getAlpha()==1){
new Handler().postDelayed(() ->
{
mTopBarHider.animate().alpha(0).setDuration(0).setStartDelay(0).withEndAction(() -> mTopBarHider.setVisibility(View.GONE));
mEvent.invokeObserver(null, enums.etype.M_UPDATE_THEME); mEvent.invokeObserver(null, enums.etype.M_UPDATE_THEME);
mTabFragment.animate() }, 150);
.setDuration(150)
.alpha(0f).withEndAction(() -> mTabFragment.setVisibility(View.GONE)); mTabFragment.animate() .setDuration(150).alpha(0f).withEndAction(() -> mTabFragment.setVisibility(View.GONE));
mEvent.invokeObserver(Collections.singletonList(status.sSettingSearchStatus), enums.etype.M_INIT_TAB_COUNT); mEvent.invokeObserver(Collections.singletonList(status.sSettingSearchStatus), enums.etype.M_INIT_TAB_COUNT);
mEvent.invokeObserver(null, enums.etype.M_UPDATE_THEME);
} }
} }
@ -652,6 +667,7 @@ class homeViewController
ImageButton back = popupView.findViewById(R.id.menu22); ImageButton back = popupView.findViewById(R.id.menu22);
ImageButton close = popupView.findViewById(R.id.menu20); ImageButton close = popupView.findViewById(R.id.menu20);
CheckBox desktop = popupView.findViewById(R.id.menu27); CheckBox desktop = popupView.findViewById(R.id.menu27);
LinearLayout newTab = popupView.findViewById(R.id.menu11);
desktop.setChecked(userAgent==USER_AGENT_MODE_DESKTOP); desktop.setChecked(userAgent==USER_AGENT_MODE_DESKTOP);
if(!canGoForward){ if(!canGoForward){
@ -663,6 +679,14 @@ class homeViewController
close.setColorFilter(Color.argb(255, 191, 191, 191)); close.setColorFilter(Color.argb(255, 191, 191, 191));
} }
newTab.setClickable(false);
close.setClickable(false);
new Handler().postDelayed(() ->
{
newTab.setClickable(true);
close.setClickable(true);
}, 300);
} }
void downloadNotification(String message, enums.etype e_type){ void downloadNotification(String message, enums.etype e_type){
@ -804,7 +828,7 @@ class homeViewController
public void onUpdateStatusBarTheme(String pTheme, boolean mForced) public void onUpdateStatusBarTheme(String pTheme, boolean mForced)
{ {
if(mSplashScreen.getAlpha()<=0 && (status.sTheme != enums.Theme.THEME_DARK && !status.sDefaultNightMode) && mTabFragment.getAlpha()<=0 || mForced){ if(mSplashScreen.getAlpha()<=0 && (status.sTheme != enums.Theme.THEME_DARK && !status.sDefaultNightMode) && mTabFragment.getAlpha()<=0 || mForced){
int mColor = -1; int mColor;
try{ try{
mColor = Color.parseColor(pTheme); mColor = Color.parseColor(pTheme);
}catch (Exception ex){ }catch (Exception ex){
@ -822,9 +846,13 @@ class homeViewController
mGradientDrawable.setCornerRadius(helperMethod.pxFromDp(7)); mGradientDrawable.setCornerRadius(helperMethod.pxFromDp(7));
GradientDrawable gradientDrawable1 = new GradientDrawable(); GradientDrawable gradientDrawable1 = new GradientDrawable();
gradientDrawable1.setColor(ColorUtils.blendARGB(helperMethod.invertedShadeColor(mColor,0.90f), Color.BLACK, 0.2f)); gradientDrawable1.setColor(ColorUtils.blendARGB(helperMethod.invertedShadeColor(mColor,0.50f), Color.BLACK, 0.2f));
gradientDrawable1.setCornerRadius(helperMethod.pxFromDp(4)); gradientDrawable1.setCornerRadius(helperMethod.pxFromDp(4));
gradientDrawable1.setStroke(helperMethod.pxFromDp(2), mColor);
GradientDrawable gradientDrawable3 = new GradientDrawable();
gradientDrawable3.setColor(ColorUtils.blendARGB(helperMethod.invertedShadeColor(mColor,0.50f), Color.BLACK, 0.2f));
gradientDrawable3.setCornerRadius(helperMethod.pxFromDp(4));
gradientDrawable3.setStroke(helperMethod.pxFromDp(2), helperMethod.invertedGrayColor(mColor));
GradientDrawable gradientDrawable2 = new GradientDrawable(); GradientDrawable gradientDrawable2 = new GradientDrawable();
gradientDrawable2.setColor(ColorUtils.blendARGB(helperMethod.invertedShadeColor(mColor,0.90f), Color.BLACK, 0.2f)); gradientDrawable2.setColor(ColorUtils.blendARGB(helperMethod.invertedShadeColor(mColor,0.90f), Color.BLACK, 0.2f));
@ -832,7 +860,7 @@ class homeViewController
gradientDrawable2.setStroke(helperMethod.pxFromDp(2), helperMethod.invertedGrayColor(mColor)); gradientDrawable2.setStroke(helperMethod.pxFromDp(2), helperMethod.invertedGrayColor(mColor));
StateListDrawable states = new StateListDrawable(); StateListDrawable states = new StateListDrawable();
InsetDrawable mInsetDrawable1 = new InsetDrawable(gradientDrawable1, helperMethod.pxFromDp(8), helperMethod.pxFromDp(8), helperMethod.pxFromDp(8), helperMethod.pxFromDp(8)); InsetDrawable mInsetDrawable1 = new InsetDrawable(gradientDrawable3, helperMethod.pxFromDp(8), helperMethod.pxFromDp(8), helperMethod.pxFromDp(8), helperMethod.pxFromDp(8));
InsetDrawable mInsetDrawable2 = new InsetDrawable(gradientDrawable2, helperMethod.pxFromDp(8), helperMethod.pxFromDp(8), helperMethod.pxFromDp(8), helperMethod.pxFromDp(8)); InsetDrawable mInsetDrawable2 = new InsetDrawable(gradientDrawable2, helperMethod.pxFromDp(8), helperMethod.pxFromDp(8), helperMethod.pxFromDp(8), helperMethod.pxFromDp(8));
states.addState(new int[] {android.R.attr.state_pressed}, mInsetDrawable1); states.addState(new int[] {android.R.attr.state_pressed}, mInsetDrawable1);
@ -846,6 +874,8 @@ class homeViewController
mSearchLock.setColorFilter(helperMethod.invertedGrayColor(mColor)); mSearchLock.setColorFilter(helperMethod.invertedGrayColor(mColor));
mSearchLock.setTag(R.id.themed,true); mSearchLock.setTag(R.id.themed,true);
gradientDrawable1.setCornerRadius(helperMethod.pxFromDp(7)); gradientDrawable1.setCornerRadius(helperMethod.pxFromDp(7));
gradientDrawable1.setStroke(helperMethod.pxFromDp(2), mColor);
gradientDrawable1.setColor(ColorUtils.blendARGB(helperMethod.invertedShadeColor(mColor,0.90f), Color.BLACK, 0.2f));
mSearchbar.setBackground(gradientDrawable1); mSearchbar.setBackground(gradientDrawable1);
mSearchbar.setHintTextColor(ColorUtils.blendARGB(helperMethod.invertedShadeColor(mColor,0.10f), Color.BLACK, 0.2f)); mSearchbar.setHintTextColor(ColorUtils.blendARGB(helperMethod.invertedShadeColor(mColor,0.10f), Color.BLACK, 0.2f));
@ -895,7 +925,10 @@ class homeViewController
mVoiceInput.setColorFilter(ContextCompat.getColor(mContext, R.color.c_navigation_tint)); mVoiceInput.setColorFilter(ContextCompat.getColor(mContext, R.color.c_navigation_tint));
mSearchbar.setTextColor(ContextCompat.getColor(mContext, R.color.c_text_v1)); mSearchbar.setTextColor(ContextCompat.getColor(mContext, R.color.c_text_v1));
mSearchbar.setHintTextColor(ContextCompat.getColor(mContext, R.color.c_text_v2)); mSearchbar.setHintTextColor(ContextCompat.getColor(mContext, R.color.c_text_v2));
if(!mSearchbar.isFocused()){
onUpdateSearchIcon(1); onUpdateSearchIcon(1);
}
if(status.sTheme != enums.Theme.THEME_DARK && !status.sDefaultNightMode){ if(status.sTheme != enums.Theme.THEME_DARK && !status.sDefaultNightMode){
mContext.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); mContext.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);

View File

@ -35,7 +35,9 @@ public class settingAdvanceController extends AppCompatActivity {
private SwitchMaterial mRestoreTabs; private SwitchMaterial mRestoreTabs;
private SwitchMaterial mShowWebFonts; private SwitchMaterial mShowWebFonts;
private SwitchMaterial mToolbarTheme; private SwitchMaterial mToolbarTheme;
private ArrayList<RadioButton> mImageOption = new ArrayList<>(); private ArrayList<RadioButton> mImageOption = new ArrayList<>();
private ArrayList<RadioButton> mTabLayoutOption = new ArrayList<>();
private boolean mIsChanged = false; private boolean mIsChanged = false;
/* Initializations */ /* Initializations */
@ -64,9 +66,11 @@ public class settingAdvanceController extends AppCompatActivity {
mToolbarTheme = findViewById(R.id.pToolbarTheme); mToolbarTheme = findViewById(R.id.pToolbarTheme);
mImageOption.add(findViewById(R.id.pAdvanceImageOption1)); mImageOption.add(findViewById(R.id.pAdvanceImageOption1));
mImageOption.add(findViewById(R.id.pAdvanceImageOption2)); mImageOption.add(findViewById(R.id.pAdvanceImageOption2));
mTabLayoutOption.add(findViewById(R.id.pAdvanceGridOption1));
mTabLayoutOption.add(findViewById(R.id.pAdvanceGridOption2));
activityContextManager.getInstance().onStack(this); activityContextManager.getInstance().onStack(this);
mSettingAdvanceViewController = new settingAdvanceViewController(this, new settingAdvanceViewCallback(), mRestoreTabs, mShowWebFonts, mToolbarTheme, mImageOption); mSettingAdvanceViewController = new settingAdvanceViewController(this, new settingAdvanceViewCallback(), mRestoreTabs, mShowWebFonts, mToolbarTheme, mImageOption, mTabLayoutOption);
mSettingAdvanceModel = new settingAdvanceModel(new settingAdvanceModelCallback()); mSettingAdvanceModel = new settingAdvanceModel(new settingAdvanceModelCallback());
} }
@ -153,6 +157,13 @@ public class settingAdvanceController extends AppCompatActivity {
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_SHOW_IMAGES,status.sShowImages)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_SHOW_IMAGES,status.sShowImages));
} }
public void onGridView(View view) {
mSettingAdvanceViewController.onTrigger(settingAdvanceEnums.eAdvanceViewController.M_CLEAR_GRID, Collections.singletonList(null));
mSettingAdvanceModel.onTrigger(settingAdvanceEnums.eAdvanceModel.M_SHOW_TAB_GRID, Collections.singletonList(view));
mSettingAdvanceViewController.onTrigger(settingAdvanceEnums.eAdvanceViewController.M_SET_GRID, Collections.singletonList(view));
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SHOW_TAB_GRID,status.sTabGridLayoutEnabled));
}
public void onShowWebFonts(View view) { public void onShowWebFonts(View view) {
mIsChanged = true; mIsChanged = true;
mSettingAdvanceModel.onTrigger(settingAdvanceEnums.eAdvanceModel.M_SHOW_WEB_FONTS, Collections.singletonList(!mShowWebFonts.isChecked())); mSettingAdvanceModel.onTrigger(settingAdvanceEnums.eAdvanceModel.M_SHOW_WEB_FONTS, Collections.singletonList(!mShowWebFonts.isChecked()));

View File

@ -4,11 +4,11 @@ class settingAdvanceEnums
{ {
/*History Manager*/ /*History Manager*/
public enum eAdvanceModel { public enum eAdvanceModel {
M_RESTORE_TAB, M_SHOW_IMAGE, M_SHOW_WEB_FONTS, M_TOOLBAR_THEME M_RESTORE_TAB, M_SHOW_IMAGE, M_SHOW_TAB_GRID, M_SHOW_WEB_FONTS, M_TOOLBAR_THEME
} }
public enum eAdvanceViewController { public enum eAdvanceViewController {
M_CLEAR_IMAGE, M_SET_IMAGE M_CLEAR_IMAGE, M_SET_IMAGE, M_CLEAR_GRID, M_SET_GRID
} }
} }

View File

@ -36,6 +36,16 @@ class settingAdvanceModel
} }
} }
private void onShowTabGrid(View pView) {
if(pView.getId() == R.id.pGridOption1){
status.sTabGridLayoutEnabled = true;
}
else if(pView.getId() == R.id.pGridOption2){
status.sTabGridLayoutEnabled = false;
}
}
private void onShowWebFonts(boolean pStatus) { private void onShowWebFonts(boolean pStatus) {
status.sShowWebFonts = pStatus; status.sShowWebFonts = pStatus;
} }
@ -57,6 +67,9 @@ class settingAdvanceModel
else if(pCommands.equals(settingAdvanceEnums.eAdvanceModel.M_TOOLBAR_THEME)){ else if(pCommands.equals(settingAdvanceEnums.eAdvanceModel.M_TOOLBAR_THEME)){
onToolbarThemeChange((boolean)pData.get(0)); onToolbarThemeChange((boolean)pData.get(0));
} }
else if(pCommands.equals(settingAdvanceEnums.eAdvanceModel.M_SHOW_TAB_GRID)){
onShowTabGrid((View)pData.get(0));
}
return null; return null;
} }

View File

@ -27,10 +27,11 @@ class settingAdvanceViewController
private SwitchMaterial mShowWebFonts; private SwitchMaterial mShowWebFonts;
private SwitchMaterial mToolbarTheme; private SwitchMaterial mToolbarTheme;
private ArrayList<RadioButton> mImageOption; private ArrayList<RadioButton> mImageOption;
private ArrayList<RadioButton> mTabLayoutOption;
/*Initializations*/ /*Initializations*/
settingAdvanceViewController(settingAdvanceController pContext, eventObserver.eventListener pEvent, SwitchMaterial pRestoreTabs, SwitchMaterial pShowWebFonts, SwitchMaterial pToolbarTheme, ArrayList<RadioButton> pImageOption) settingAdvanceViewController(settingAdvanceController pContext, eventObserver.eventListener pEvent, SwitchMaterial pRestoreTabs, SwitchMaterial pShowWebFonts, SwitchMaterial pToolbarTheme, ArrayList<RadioButton> pImageOption, ArrayList<RadioButton> pTabLayoutOption)
{ {
this.mEvent = pEvent; this.mEvent = pEvent;
this.mContext = pContext; this.mContext = pContext;
@ -38,6 +39,7 @@ class settingAdvanceViewController
this.mShowWebFonts = pShowWebFonts; this.mShowWebFonts = pShowWebFonts;
this.mToolbarTheme = pToolbarTheme; this.mToolbarTheme = pToolbarTheme;
this.mImageOption = pImageOption; this.mImageOption = pImageOption;
this.mTabLayoutOption = pTabLayoutOption;
initViews(); initViews();
initPostUI(); initPostUI();
@ -72,6 +74,16 @@ class settingAdvanceViewController
mImageOption.get(1).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(mContext, R.color.c_radio_tint))); mImageOption.get(1).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(mContext, R.color.c_radio_tint)));
mImageOption.get(1).setChecked(true); mImageOption.get(1).setChecked(true);
} }
if(status.sTabGridLayoutEnabled){
mTabLayoutOption.get(0).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(mContext, R.color.c_radio_tint)));
mTabLayoutOption.get(0).setChecked(true);
}
else{
mTabLayoutOption.get(1).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(mContext, R.color.c_radio_tint)));
mTabLayoutOption.get(1).setChecked(true);
}
} }
private void initPostUI(){ private void initPostUI(){
@ -98,6 +110,13 @@ class settingAdvanceViewController
mImageOption.get(1).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(mContext, R.color.c_radio_tint_default))); mImageOption.get(1).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(mContext, R.color.c_radio_tint_default)));
} }
private void clearGridOptions(){
mTabLayoutOption.get(0).setChecked(false);
mTabLayoutOption.get(1).setChecked(false);
mTabLayoutOption.get(0).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(mContext, R.color.c_radio_tint_default)));
mTabLayoutOption.get(1).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(mContext, R.color.c_radio_tint_default)));
}
private void setImageOptions(View pView){ private void setImageOptions(View pView){
clearImageOptions(); clearImageOptions();
if(pView.getId() == R.id.pAdvanceOption1){ if(pView.getId() == R.id.pAdvanceOption1){
@ -110,13 +129,32 @@ class settingAdvanceViewController
} }
} }
private void setGridOptions(View pView){
clearGridOptions();
if(pView.getId() == R.id.pGridOption1){
mTabLayoutOption.get(0).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(mContext, R.color.c_radio_tint)));
mTabLayoutOption.get(0).setChecked(true);
}
else if(pView.getId() == R.id.pGridOption2){
mTabLayoutOption.get(1).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(mContext, R.color.c_radio_tint)));
mTabLayoutOption.get(1).setChecked(true);
}
}
public Object onTrigger(settingAdvanceEnums.eAdvanceViewController pCommands, List<Object> pData){ public Object onTrigger(settingAdvanceEnums.eAdvanceViewController pCommands, List<Object> pData){
if(pCommands.equals(settingAdvanceEnums.eAdvanceViewController.M_CLEAR_IMAGE)){ if(pCommands.equals(settingAdvanceEnums.eAdvanceViewController.M_CLEAR_IMAGE)){
clearImageOptions(); clearImageOptions();
} }
else if(pCommands.equals(settingAdvanceEnums.eAdvanceViewController.M_CLEAR_GRID)){
clearGridOptions();
}
else if(pCommands.equals(settingAdvanceEnums.eAdvanceViewController.M_SET_IMAGE)){ else if(pCommands.equals(settingAdvanceEnums.eAdvanceViewController.M_SET_IMAGE)){
setImageOptions((View) pData.get(0)); setImageOptions((View) pData.get(0));
} }
else if(pCommands.equals(settingAdvanceEnums.eAdvanceViewController.M_SET_GRID)){
setGridOptions((View) pData.get(0));
}
return null; return null;
} }

View File

@ -138,7 +138,6 @@ public class settingGeneralController extends AppCompatActivity {
onBackPressed(); onBackPressed();
overridePendingTransition(R.anim.fade_in_lang, R.anim.fade_out_lang); overridePendingTransition(R.anim.fade_in_lang, R.anim.fade_out_lang);
activityContextManager.getInstance().getSettingController().onReInitTheme(); activityContextManager.getInstance().getSettingController().onReInitTheme();
activityContextManager.getInstance().getHomeController().onReInitTheme();
helperMethod.openActivity(settingGeneralController.class, constants.CONST_LIST_HISTORY, settingGeneralController.this,true); helperMethod.openActivity(settingGeneralController.class, constants.CONST_LIST_HISTORY, settingGeneralController.this,true);
} }
} }

View File

@ -16,9 +16,12 @@ import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.activityContextManager; import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.constants.enums; import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.helperManager.TopCropImageView; import com.darkweb.genesissearchengine.helperManager.TopCropImageView;
import com.darkweb.genesissearchengine.helperManager.eventObserver; import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod; import com.darkweb.genesissearchengine.helperManager.helperMethod;
@ -68,9 +71,14 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
@NonNull @Override @NonNull @Override
public listViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public listViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
if(status.sTabGridLayoutEnabled){
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.tab_grid_view, parent, false);
return new listViewHolder(view);
}else {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.tab_row_view, parent, false); View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.tab_row_view, parent, false);
return new listViewHolder(view); return new listViewHolder(view);
} }
}
@Override @Override
public void onBindViewHolder(@NonNull tabAdapter.listViewHolder holder, int position) public void onBindViewHolder(@NonNull tabAdapter.listViewHolder holder, int position)
{ {
@ -250,7 +258,7 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
mItemSelectionMenuButton.setOnClickListener(this); mItemSelectionMenuButton.setOnClickListener(this);
}else { }else {
if(model.getSession().getTheme()==null){ if(model.getSession().getTheme()==null){
mBorder.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.c_border_background_divider)); mBorder.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.c_ripple_v2));
}else { }else {
try{ try{
mBorder.setBackgroundColor(Color.parseColor(model.getSession().getTheme())); mBorder.setBackgroundColor(Color.parseColor(model.getSession().getTheme()));
@ -271,12 +279,17 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
}else { }else {
mHeader.setText(model.getSession().getTitle()); mHeader.setText(model.getSession().getTitle());
} }
if(status.sTabGridLayoutEnabled){
mDescription.setText(helperMethod.getDomainName(mURL));
}else {
mDescription.setText(mURL); mDescription.setText(mURL);
}
mDate.setText(model.getDate()); mDate.setText(model.getDate());
mWebThumbnail.setImageBitmap(model.getBitmap()); mWebThumbnail.setImageBitmap(model.getBitmap());
if(getLayoutPosition()==0){ if(getLayoutPosition()==0){
mEvent.invokeObserver(Arrays.asList(mWebThumbnail, mURL), enums.etype.fetch_thumbnail); // mEvent.invokeObserver(Arrays.asList(mWebThumbnail, mURL), enums.etype.fetch_thumbnail);
} }
if(mSelectedList.contains(model.getSession().getSessionID())){ if(mSelectedList.contains(model.getSession().getSessionID())){
@ -286,7 +299,9 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
} }
if(model.getSession().equals(mModelList.get(0).getSession())){ if(model.getSession().equals(mModelList.get(0).getSession())){
if(!status.sTabGridLayoutEnabled){
itemView.setBackgroundColor(ContextCompat.getColor(activityContextManager.getInstance().getHomeController(), R.color.c_list_item_current)); itemView.setBackgroundColor(ContextCompat.getColor(activityContextManager.getInstance().getHomeController(), R.color.c_list_item_current));
}
}else { }else {
Drawable mDrawable; Drawable mDrawable;
Resources res = itemView.getContext().getResources(); Resources res = itemView.getContext().getResources();
@ -319,6 +334,7 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
mLongPressMenuEnabled = false; mLongPressMenuEnabled = false;
mItemSelectionMenuButton.animate().setDuration(250).alpha(1); mItemSelectionMenuButton.animate().setDuration(250).alpha(1);
} }
mRemoveRow.bringToFront();
} }

View File

@ -1,22 +1,22 @@
package com.darkweb.genesissearchengine.appManager.tabManager; package com.darkweb.genesissearchengine.appManager.tabManager;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.core.widget.NestedScrollView;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.ItemTouchHelper; import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
@ -24,6 +24,7 @@ import androidx.recyclerview.widget.SimpleItemAnimator;
import com.darkweb.genesissearchengine.appManager.activityContextManager; import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.geckoSession; import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.geckoSession;
import com.darkweb.genesissearchengine.appManager.homeManager.homeController.homeController; import com.darkweb.genesissearchengine.appManager.homeManager.homeController.homeController;
import com.darkweb.genesissearchengine.appManager.settingManager.advanceManager.settingAdvanceController;
import com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingHomeController; import com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingHomeController;
import com.darkweb.genesissearchengine.constants.constants; import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.status; import com.darkweb.genesissearchengine.constants.status;
@ -49,6 +50,7 @@ public class tabController extends Fragment
private TextView mSelectionCount; private TextView mSelectionCount;
private ImageView mBlocker; private ImageView mBlocker;
private View mRootView; private View mRootView;
private NestedScrollView mNestedScrollView;
/*Private Variables*/ /*Private Variables*/
@ -58,6 +60,10 @@ public class tabController extends Fragment
private tabViewController mtabViewController; private tabViewController mtabViewController;
private RecyclerView mRecycleView; private RecyclerView mRecycleView;
private tabAdapter mTabAdapter; private tabAdapter mTabAdapter;
private Handler mScrollHandler = null;
private Runnable mScrollRunnable = null;
int minScroll = 0;
int maxScroll = 0;
/*Initializations*/ /*Initializations*/
@ -100,8 +106,9 @@ public class tabController extends Fragment
mPopupUndo = mRootView.findViewById(R.id.pPopupUndo); mPopupUndo = mRootView.findViewById(R.id.pPopupUndo);
mSelectionCount = mRootView.findViewById(R.id.pSelectionCount); mSelectionCount = mRootView.findViewById(R.id.pSelectionCount);
mBlocker = mRootView.findViewById(R.id.pBlocker); mBlocker = mRootView.findViewById(R.id.pBlocker);
mNestedScrollView = mRootView.findViewById(R.id.pNestedScroll);
mtabViewController = new tabViewController(this, mTabs, mRemoveSelection, mMenuButton, mClearSelection, mPopupUndo, mSelectionCount, mBlocker, mRecycleView); mtabViewController = new tabViewController(this, mTabs, mRemoveSelection, mMenuButton, mClearSelection, mPopupUndo, mSelectionCount, mBlocker, mRecycleView, mNestedScrollView);
} }
@SuppressLint("ClickableViewAccessibility") @SuppressLint("ClickableViewAccessibility")
@ -112,24 +119,65 @@ public class tabController extends Fragment
} }
return false; return false;
}); });
mNestedScrollView.setOnTouchListener((v, event) -> {
if (event.getAction() == MotionEvent.ACTION_UP) {
onSwipeBounce(0);
}
return false;
});
mNestedScrollView.getViewTreeObserver().addOnScrollChangedListener(() -> {
int scrollY = mNestedScrollView.getScrollY();
minScroll = scrollY;
maxScroll = mRecycleView.computeVerticalScrollRange() - helperMethod.pxFromDp(500);
onSwipeBounce(300);
});
mNestedScrollView.setOnScrollChangeListener((NestedScrollView.OnScrollChangeListener) (v, scrollX, scrollY, oldScrollX, oldScrollY) -> {
if (mRecycleView.getChildAt(mRecycleView.getChildCount() - 1) != null) {
if ((scrollY >= (mRecycleView.getChildAt(mRecycleView.getChildCount() - 1).getMeasuredHeight() - mRecycleView.getMeasuredHeight())) && scrollY > oldScrollY) {
Log.i("FUCK2:::::::",scrollY+"");
onSwipeBounce(0);
}
}
});
}
public void onSwipeBounce(int mDuration){
if(minScroll > maxScroll){
if(mScrollHandler!=null){
mScrollHandler.removeCallbacksAndMessages(null);
}
mScrollHandler = new Handler();
mScrollRunnable = () -> {
mNestedScrollView.clearFocus();
mRecycleView.clearFocus();
mNestedScrollView.smoothScrollTo(0, maxScroll);
};
mScrollHandler.postDelayed(mScrollRunnable, mDuration);
}
} }
public void initializeList(){ public void initializeList(){
LinearLayoutManager layoutManager = new LinearLayoutManager(this.getContext());
tabAdapter adapter = new tabAdapter(mListModel.getList(),new adapterCallback()); tabAdapter adapter = new tabAdapter(mListModel.getList(),new adapterCallback());
mTabAdapter = adapter; mTabAdapter = adapter;
layoutManager.setReverseLayout(true);
((SimpleItemAnimator) Objects.requireNonNull(mRecycleView.getItemAnimator())).setSupportsChangeAnimations(false); ((SimpleItemAnimator) Objects.requireNonNull(mRecycleView.getItemAnimator())).setSupportsChangeAnimations(false);
mRecycleView.setAdapter(adapter); mRecycleView.setAdapter(adapter);
mRecycleView.setItemViewCacheSize(100);
mRecycleView.setNestedScrollingEnabled(false); mRecycleView.setNestedScrollingEnabled(false);
mRecycleView.setHasFixedSize(true); mRecycleView.setHasFixedSize(false);
mRecycleView.setItemViewCacheSize(100);
mRecycleView.setDrawingCacheEnabled(true); if(status.sTabGridLayoutEnabled){
mRecycleView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH); mRecycleView.setLayoutManager(new GridLayoutManager(this.getContext(), 2));
}else {
mRecycleView.setLayoutManager(new LinearLayoutManager(this.getContext())); mRecycleView.setLayoutManager(new LinearLayoutManager(this.getContext()));
}
initTabCount(0); initTabCount(0);
} }
@ -174,20 +222,18 @@ public class tabController extends Fragment
mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.NOTIFY_SWIPE, Collections.singletonList(position)); mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.NOTIFY_SWIPE, Collections.singletonList(position));
} }
onShowUndoDialog(); onShowUndoDialog();
viewHolder.itemView.animate().alpha(0);
final Handler handler = new Handler();
handler.postDelayed(() ->
{
ViewGroup.LayoutParams params = mRecycleView.getLayoutParams();
params.height = helperMethod.pxFromDp((mTabAdapter.getItemCount()) * 90);
mRecycleView.setLayoutParams(params);
}, 400);
} }
@Override @Override
public void onChildDraw(@NonNull Canvas c, @NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) { public void onChildDraw(@NonNull Canvas c, @NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {
if (actionState == ItemTouchHelper.ACTION_STATE_SWIPE) { if (actionState == ItemTouchHelper.ACTION_STATE_SWIPE) {
float alpha = 1 - (Math.abs(dX) / recyclerView.getWidth())*1.75f;
if(alpha <0.35){
alpha = 0.35f;
}
viewHolder.itemView.setAlpha(alpha);
Canvas mCanvas = (Canvas) mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_GENERATE_SWIPABLE_BACKGROUND, Arrays.asList(c, viewHolder, dX, actionState)); Canvas mCanvas = (Canvas) mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_GENERATE_SWIPABLE_BACKGROUND, Arrays.asList(c, viewHolder, dX, actionState));
super.onChildDraw(mCanvas, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive); super.onChildDraw(mCanvas, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);
} }
@ -210,35 +256,27 @@ public class tabController extends Fragment
initTabCount(400); initTabCount(400);
activityContextManager.getInstance().getHomeController().onLoadTabFromTabController(); activityContextManager.getInstance().getHomeController().onLoadTabFromTabController();
mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.INIT_FIRST_ROW, null); mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.INIT_FIRST_ROW, null);
onSwipeBounce(0);
} }
public boolean onInitRemoveView(int pIndex, boolean pCreateBackup){ public boolean onInitRemoveView(int pIndex, boolean pCreateBackup){
mListModel.onTrigger(tabEnums.eModelCallback.M_REMOVE_TAB,Collections.singletonList(pIndex)); mListModel.onTrigger(tabEnums.eModelCallback.M_REMOVE_TAB,Collections.singletonList(pIndex));
mListModel.getList().remove(pIndex); mListModel.getList().remove(pIndex);
if(mListModel.getList().size()<1){ if(mListModel.getList().size()<1){
mRecycleView.animate().setDuration(350).alpha(0).withEndAction(() -> { mRecycleView.animate().setDuration(350).alpha(0).withEndAction(() -> mTabAdapter.notifyDataSetChanged());
mTabAdapter.notifyDataSetChanged();
});
activityContextManager.getInstance().getHomeController().onLoadTabFromTabController(); activityContextManager.getInstance().getHomeController().onLoadTabFromTabController();
new Handler().postDelayed(() -> onSwipeBounce(0), 400);
return false; return false;
}else{ }else{
mTabAdapter.notifyItemRangeChanged(pIndex, mTabAdapter.getItemCount() - pIndex); mTabAdapter.notifyItemRangeChanged(pIndex, mTabAdapter.getItemCount() - pIndex);
activityContextManager.getInstance().getHomeController().onLoadTabFromTabController(); activityContextManager.getInstance().getHomeController().onLoadTabFromTabController();
new Handler().postDelayed(() -> onSwipeBounce(0), 400);
return true; return true;
} }
} }
public void initTabCount(int pDelay) public void initTabCount(int pDelay)
{ {
final Handler handler = new Handler();
handler.postDelayed(() ->
{
if(mListModel.getList().size()>0){
ViewGroup.LayoutParams params = mRecycleView.getLayoutParams();
params.height = helperMethod.pxFromDp((mTabAdapter.getItemCount()) * 90);
mRecycleView.setLayoutParams(params);
}
}, pDelay);
activityContextManager.getInstance().getHomeController().initTabCountForced(); activityContextManager.getInstance().getHomeController().initTabCountForced();
} }
@ -247,8 +285,7 @@ public class tabController extends Fragment
} }
public void onNewTabInvoked(){ public void onNewTabInvoked(){
int mBackupList = ((ArrayList<tabRowModel>)mListModel.onTrigger(tabEnums.eModelCallback.M_GET_BACKUP,null)).size(); if(mListModel.getList().size()>=1){
if(mListModel.getList().size()-mBackupList>=1){
mHomeController.onNewTabBackground(true,false); mHomeController.onNewTabBackground(true,false);
} }
onClose(); onClose();
@ -258,9 +295,6 @@ public class tabController extends Fragment
public void onRestoreTab(View view){ public void onRestoreTab(View view){
ArrayList<tabRowModel> mBackup = (ArrayList<tabRowModel>)mListModel.onTrigger(tabEnums.eModelCallback.M_LOAD_BACKUP,null); ArrayList<tabRowModel> mBackup = (ArrayList<tabRowModel>)mListModel.onTrigger(tabEnums.eModelCallback.M_LOAD_BACKUP,null);
ViewGroup.LayoutParams params = mRecycleView.getLayoutParams();
params.height = helperMethod.pxFromDp((mTabAdapter.getItemCount()+mBackup.size()) * 90);
mRecycleView.setLayoutParams(params);
final Handler handler = new Handler(); final Handler handler = new Handler();
handler.postDelayed(() -> handler.postDelayed(() ->
@ -328,10 +362,15 @@ public class tabController extends Fragment
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_SHOW_SELECTION_MENU, Arrays.asList(false,0)); mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_SHOW_SELECTION_MENU, Arrays.asList(false,0));
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_HIDE_SELECTION, null); mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_HIDE_SELECTION, null);
activityContextManager.getInstance().getHomeController().onLoadTabFromTabController(); activityContextManager.getInstance().getHomeController().onLoadTabFromTabController();
// mTabAdapter.notifyDataSetChanged();
initTabCount(400);
} }
public void onClearSelection(View view) { public void onClearSelection(View view) {
mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.M_CLEAR_ALL_SELECTION, null); mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.M_CLEAR_ALL_SELECTION, null);
mNestedScrollView.smoothScrollTo(0,0);
} }
public void onTriggerSelected(View view){ public void onTriggerSelected(View view){
@ -353,11 +392,10 @@ public class tabController extends Fragment
mRecycleView.animate().setDuration(350).alpha(0).withEndAction(() -> { mRecycleView.animate().setDuration(350).alpha(0).withEndAction(() -> {
onClearTabBackup(); onClearTabBackup();
mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.REMOVE_ALL, null); mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.REMOVE_ALL, null);
initTabCount(400);
}); });
} }
else if(pView.getId() == R.id.pOpenSetting){ else if(pView.getId() == R.id.pOpenSetting){
helperMethod.openActivity(settingHomeController.class, constants.CONST_LIST_HISTORY, activityContextManager.getInstance().getHomeController(),true); helperMethod.openActivity(settingAdvanceController.class, constants.CONST_LIST_HISTORY, activityContextManager.getInstance().getHomeController(),true);
} }
mtabViewController.onTrigger(tabEnums.eTabViewCommands.M_DISMISS_MENU, null); mtabViewController.onTrigger(tabEnums.eTabViewCommands.M_DISMISS_MENU, null);
} }
@ -371,7 +409,6 @@ public class tabController extends Fragment
@Override @Override
public void onStop() { public void onStop() {
// onBackPressed();
super.onStop(); super.onStop();
} }
@ -379,7 +416,6 @@ public class tabController extends Fragment
public void onPause() public void onPause()
{ {
status.sSettingIsAppPaused = true; status.sSettingIsAppPaused = true;
// onBackPressed();
super.onPause(); super.onPause();
} }

View File

@ -12,6 +12,7 @@ import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.ActionMenuView; import android.widget.ActionMenuView;
@ -19,10 +20,12 @@ import android.widget.Button;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.PopupWindow; import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.core.widget.NestedScrollView;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.ItemTouchHelper; import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
@ -47,6 +50,7 @@ class tabViewController
private TextView mSelectionCount; private TextView mSelectionCount;
private ImageView mBlocker; private ImageView mBlocker;
private RecyclerView mRecycleView; private RecyclerView mRecycleView;
private NestedScrollView mNestedScrollView;
/*Private Local Variables*/ /*Private Local Variables*/
private Handler mDelayHandler = new Handler(); private Handler mDelayHandler = new Handler();
@ -54,7 +58,7 @@ class tabViewController
/*Initializations*/ /*Initializations*/
tabViewController(Fragment mContext, Button pTabs, ImageView pRemoveSelection, ImageButton pMenuButton, ImageButton pClearSelection, View pToastLayoutRoot, TextView pSelectionCount, ImageView pBlocker, RecyclerView pRecycleView) tabViewController(Fragment mContext, Button pTabs, ImageView pRemoveSelection, ImageButton pMenuButton, ImageButton pClearSelection, View pToastLayoutRoot, TextView pSelectionCount, ImageView pBlocker, RecyclerView pRecycleView, NestedScrollView pNestedScrollView)
{ {
this.mContext = mContext; this.mContext = mContext;
this.mTabs = pTabs; this.mTabs = pTabs;
@ -65,6 +69,7 @@ class tabViewController
this.mSelectionCount = pSelectionCount; this.mSelectionCount = pSelectionCount;
this.mBlocker = pBlocker; this.mBlocker = pBlocker;
this.mRecycleView = pRecycleView; this.mRecycleView = pRecycleView;
this.mNestedScrollView = pNestedScrollView;
initUI(); initUI();
initPostUI(); initPostUI();
@ -86,6 +91,10 @@ class tabViewController
mMenuButton.animate().setStartDelay(200).setDuration(350).alpha(1); mMenuButton.animate().setStartDelay(200).setDuration(350).alpha(1);
mMenuButton.setVisibility(View.VISIBLE); mMenuButton.setVisibility(View.VISIBLE);
if(!status.sTabGridLayoutEnabled){
mNestedScrollView.setPadding(0,0,0,0);
}
onHideUndoDialogInit(); onHideUndoDialogInit();
} }
@ -214,25 +223,29 @@ class tabViewController
if(pDX > 0){ if(pDX > 0){
if(status.sTheme == enums.Theme.THEME_DARK){ if(status.sTheme == enums.Theme.THEME_DARK){
pCanvas.drawARGB(150, 59, 57, 70); pCanvas.drawARGB(255,28, 27, 33);
}else { }else {
pCanvas.drawARGB(150, 230, 230, 230); pCanvas.drawARGB(255, 255, 255, 255);
} }
if(!status.sTabGridLayoutEnabled){
icon = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.dustbin); icon = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.dustbin);
RectF icon_dest = new RectF((float) itemView.getLeft() + width ,(float) itemView.getTop() + width,(float) itemView.getLeft()+ 2*width,(float)itemView.getBottom() - width); RectF icon_dest = new RectF((float) itemView.getLeft() + width ,(float) itemView.getTop() + width,(float) itemView.getLeft()+ 2*width,(float)itemView.getBottom() - width);
pCanvas.drawBitmap(icon,null,icon_dest, mPainter); pCanvas.drawBitmap(icon,null,icon_dest, mPainter);
}
} else { } else {
if(status.sTheme == enums.Theme.THEME_DARK){ if(status.sTheme == enums.Theme.THEME_DARK){
pCanvas.drawARGB(150, 59, 57, 70); pCanvas.drawARGB(255,28, 27, 33);
}else { }else {
pCanvas.drawARGB(150, 230, 230, 230); pCanvas.drawARGB(255, 255, 255, 255);
} }
if(!status.sTabGridLayoutEnabled){
icon = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.dustbin); icon = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.dustbin);
RectF icon_dest = new RectF((float) itemView.getRight() - 2*width ,(float) itemView.getTop() + width,(float) itemView.getRight() - width,(float)itemView.getBottom() - width); RectF icon_dest = new RectF((float) itemView.getRight() - 2*width ,(float) itemView.getTop() + width,(float) itemView.getRight() - width,(float)itemView.getBottom() - width);
pCanvas.drawBitmap(icon,null,icon_dest, mPainter); pCanvas.drawBitmap(icon,null,icon_dest, mPainter);
} }
} }
} }
}
public Object onTrigger(tabEnums.eTabViewCommands pCommands, List<Object> pData){ public Object onTrigger(tabEnums.eTabViewCommands pCommands, List<Object> pData){
if(pCommands.equals(tabEnums.eTabViewCommands.M_SHOW_MENU)){ if(pCommands.equals(tabEnums.eTabViewCommands.M_SHOW_MENU)){

View File

@ -13,6 +13,11 @@ public class enums
/*General Enums*/ /*General Enums*/
public static class AddTabCallback {
public static final int TAB_ADDED = 0;
public static final int TAB_FULL = 1;
}
public static class Theme { public static class Theme {
public static final int THEME_LIGHT = 0; public static final int THEME_LIGHT = 0;
public static final int THEME_DARK = 1; public static final int THEME_DARK = 1;

View File

@ -49,12 +49,14 @@ public class keys
public static final String SETTING_RESTORE_TAB = "SETTING_RESTORE_TAB"; public static final String SETTING_RESTORE_TAB = "SETTING_RESTORE_TAB";
public static final String SETTING_CHARACTER_ENCODING = "SETTING_CHARACTER_ENCODING"; public static final String SETTING_CHARACTER_ENCODING = "SETTING_CHARACTER_ENCODING";
public static final String SETTING_SHOW_IMAGES = "SETTING_SHOW_IMAGES"; public static final String SETTING_SHOW_IMAGES = "SETTING_SHOW_IMAGES";
public static final String SETTING_SHOW_TAB_GRID = "SETTING_SHOW_TAB_GRID";
public static final String SETTING_SHOW_FONTS = "SETTING_SHOW_FONTS"; public static final String SETTING_SHOW_FONTS = "SETTING_SHOW_FONTS";
public static final String SETTING_TOOLBAR_THEME = "SETTING_TOOLBAR_THEME"; public static final String SETTING_TOOLBAR_THEME = "SETTING_TOOLBAR_THEME";
public static final String SETTING_THEME = "SETTING_THEME_LIGHT"; public static final String SETTING_THEME = "SETTING_THEME_LIGHT";
public static final String SETTING_FULL_SCREEN_BROWSIING = "SETTING_FULL_SCREEN_BROWSIING"; public static final String SETTING_FULL_SCREEN_BROWSIING = "SETTING_FULL_SCREEN_BROWSIING";
public static final String SETTING_OPEN_URL_IN_NEW_TAB = "SETTING_OPEN_URL_IN_NEW_TAB"; public static final String SETTING_OPEN_URL_IN_NEW_TAB = "SETTING_OPEN_URL_IN_NEW_TAB";
public static final String SETTING_LIST_VIEW = "SETTING_LIST_VIEW"; public static final String SETTING_LIST_VIEW = "SETTING_LIST_VIEW";
public static final String SETTING_TOOLBAR_THEME_ALLOWED = "SETTING_TOOLBAR_THEME_ALLOWED";
/*Bridge Settings*/ /*Bridge Settings*/

View File

@ -24,6 +24,7 @@ public class status
public static String sSettingLanguage = "en"; public static String sSettingLanguage = "en";
public static String sSettingLanguageRegion = "Us"; public static String sSettingLanguageRegion = "Us";
public static String mReferenceWebsites; public static String mReferenceWebsites;
public static String sBridgeCustomBridge = strings.GENERIC_EMPTY_STR;
public static boolean sSettingEnableZoom = true; public static boolean sSettingEnableZoom = true;
public static boolean sSettingEnableVoiceInput = true; public static boolean sSettingEnableVoiceInput = true;
@ -40,9 +41,8 @@ public class status
public static boolean sSettingIsAppRated = false; public static boolean sSettingIsAppRated = false;
public static boolean sSettingFontAdjustable = true; public static boolean sSettingFontAdjustable = true;
public static boolean sSettingFirstStart = true; public static boolean sSettingFirstStart = true;
public static int sSettingTrackingProtection = 0;
public static boolean mThemeApplying = false; public static boolean mThemeApplying = false;
public static boolean sTabGridLayoutEnabled = true;
public static boolean sStatusDoNotTrack = true; public static boolean sStatusDoNotTrack = true;
public static boolean sRestoreTabs = false; public static boolean sRestoreTabs = false;
public static boolean sCharacterEncoding = false; public static boolean sCharacterEncoding = false;
@ -52,23 +52,19 @@ public class status
public static boolean sOpenURLInNewTab = true; public static boolean sOpenURLInNewTab = true;
public static boolean sDefaultNightMode; public static boolean sDefaultNightMode;
public static boolean sLogListView; public static boolean sLogListView;
public static boolean sBridgeGatewayAuto = false;
public static float sSettingFontSize = 1; public static boolean sBridgeGatewayManual = false;
public static boolean sVPNStatus = false;
public static boolean sBridgeStatus = false;
public static int sTheme = enums.Theme.THEME_DEFAULT; public static int sTheme = enums.Theme.THEME_DEFAULT;
public static int sSettingCookieStatus = ContentBlocking.AntiTracking.DEFAULT; public static int sSettingCookieStatus = ContentBlocking.AntiTracking.DEFAULT;
public static int sShowImages = -1; public static int sShowImages = -1;
public static int sWidgetResponse = enums.WidgetResponse.NONE; public static int sWidgetResponse = enums.WidgetResponse.NONE;
/*Bridge Status*/
public static String sBridgeCustomBridge = strings.GENERIC_EMPTY_STR;
public static boolean sBridgeGatewayAuto = false;
public static boolean sBridgeGatewayManual = false;
public static boolean sVPNStatus = false;
public static boolean sBridgeStatus = false;
public static int sBridgeNotificationManual = 0; public static int sBridgeNotificationManual = 0;
public static int sSettingTrackingProtection = 0;
public static float sSettingFontSize = 1;
public static void initStatus() public static void initStatus()
{ {
@ -92,13 +88,11 @@ public class status
status.sSettingCookieStatus = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_COOKIE_ADJUSTABLE,ACCEPT_FIRST_PARTY)); status.sSettingCookieStatus = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_COOKIE_ADJUSTABLE,ACCEPT_FIRST_PARTY));
status.sSettingFontSize = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_FLOAT, Arrays.asList(keys.SETTING_FONT_SIZE,100)); status.sSettingFontSize = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_FLOAT, Arrays.asList(keys.SETTING_FONT_SIZE,100));
status.sSettingLanguage = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.SETTING_LANGUAGE,strings.SETTING_DEFAULT_LANGUAGE)); status.sSettingLanguage = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.SETTING_LANGUAGE,strings.SETTING_DEFAULT_LANGUAGE));
status.mReferenceWebsites = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.HOME_REFERENCE_WEBSITES,strings.HOME_REFERENCE_WEBSITES_DEFAULT)); status.mReferenceWebsites = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.HOME_REFERENCE_WEBSITES,strings.HOME_REFERENCE_WEBSITES_DEFAULT));
status.sSettingLanguageRegion = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.SETTING_LANGUAGE_REGION,strings.SETTING_DEFAULT_LANGUAGE_REGION)); status.sSettingLanguageRegion = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.SETTING_LANGUAGE_REGION,strings.SETTING_DEFAULT_LANGUAGE_REGION));
status.sSettingSearchStatus = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.SETTING_SEARCH_ENGINE,constants.CONST_BACKEND_GENESIS_URL)); status.sSettingSearchStatus = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.SETTING_SEARCH_ENGINE,constants.CONST_BACKEND_GENESIS_URL));
status.sBridgeCustomBridge = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_BRIDGE_1,strings.BRIDGE_CUSTOM_BRIDGE_OBFS4)); status.sBridgeCustomBridge = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_BRIDGE_1,strings.BRIDGE_CUSTOM_BRIDGE_OBFS4));
status.sBridgeNotificationManual = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_NOTIFICATION_STATUS,0)); status.sBridgeNotificationManual = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_NOTIFICATION_STATUS,0));
status.sRestoreTabs = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_RESTORE_TAB,false)); status.sRestoreTabs = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_RESTORE_TAB,false));
status.sCharacterEncoding = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_CHARACTER_ENCODING,false)); status.sCharacterEncoding = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_CHARACTER_ENCODING,false));
status.sShowImages = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_SHOW_IMAGES,0)); status.sShowImages = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_SHOW_IMAGES,0));
@ -108,6 +102,7 @@ public class status
status.sTheme = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_THEME,enums.Theme.THEME_DEFAULT)); status.sTheme = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_THEME,enums.Theme.THEME_DEFAULT));
status.sOpenURLInNewTab = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_OPEN_URL_IN_NEW_TAB,true)); status.sOpenURLInNewTab = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_OPEN_URL_IN_NEW_TAB,true));
status.sLogListView = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_LIST_VIEW,true)); status.sLogListView = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_LIST_VIEW,true));
status.sTabGridLayoutEnabled = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_SHOW_TAB_GRID,true));
} }
} }

View File

@ -2,32 +2,26 @@ package com.darkweb.genesissearchengine.dataManager;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.ContentValues; import android.content.ContentValues;
import android.content.pm.ActivityInfo;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
import android.util.Log; import android.util.Log;
import android.widget.ImageView; import android.widget.ImageView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.darkweb.genesissearchengine.appManager.activityContextManager; import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.databaseManager.databaseController; import com.darkweb.genesissearchengine.appManager.databaseManager.databaseController;
import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.NestedGeckoView; import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.NestedGeckoView;
import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.geckoSession; import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.geckoSession;
import com.darkweb.genesissearchengine.appManager.tabManager.tabRowModel; import com.darkweb.genesissearchengine.appManager.tabManager.tabRowModel;
import com.darkweb.genesissearchengine.constants.enums; import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.messages;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.constants.strings; import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import org.mozilla.geckoview.GeckoResult; import org.mozilla.geckoview.GeckoResult;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
@ -53,12 +47,13 @@ class tabDataModel
} }
} }
void addTabs(geckoSession mSession,boolean pIsDataSavable){ int addTabs(geckoSession mSession,boolean pIsDataSavable){
tabRowModel mTabModel = new tabRowModel(mSession); tabRowModel mTabModel = new tabRowModel(mSession);
mTabs.add(0,mTabModel); mTabs.add(0,mTabModel);
if(mTabs.size()>20){ if(mTabs.size()>20){
closeTab(mTabs.get(mTabs.size()-1).getSession(), mTabs.get(mTabs.size()-1).getmId()); closeTab(mTabs.get(mTabs.size()-1).getSession(), mTabs.get(mTabs.size()-1).getmId());
return enums.AddTabCallback.TAB_FULL;
} }
if(pIsDataSavable){ if(pIsDataSavable){
@ -70,6 +65,7 @@ class tabDataModel
databaseController.getInstance().execSQL("REPLACE INTO tab(mid,date,title,url,theme) VALUES('"+ mTabModel.getmId() +"','" + m_date + "',?,?,?);",params); databaseController.getInstance().execSQL("REPLACE INTO tab(mid,date,title,url,theme) VALUES('"+ mTabModel.getmId() +"','" + m_date + "',?,?,?);",params);
} }
return enums.AddTabCallback.TAB_ADDED;
} }
void clearTab() { void clearTab() {
@ -139,7 +135,6 @@ class tabDataModel
boolean updateTab(String mSessionID, geckoSession pSession) { boolean updateTab(String mSessionID, geckoSession pSession) {
boolean mSessionUpdated = false;
for(int counter = 0; counter< mTabs.size(); counter++){ for(int counter = 0; counter< mTabs.size(); counter++){
if(mTabs.get(counter).getSession().getSessionID().equals(mSessionID)) if(mTabs.get(counter).getSession().getSessionID().equals(mSessionID))
@ -148,16 +143,12 @@ class tabDataModel
params[0] = mTabs.get(counter).getSession().getTitle(); params[0] = mTabs.get(counter).getSession().getTitle();
params[1] = mTabs.get(counter).getSession().getCurrentURL(); params[1] = mTabs.get(counter).getSession().getCurrentURL();
params[2] = mTabs.get(counter).getSession().getTheme(); params[2] = mTabs.get(counter).getSession().getTheme();
mSessionUpdated = true;
String m_date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.ENGLISH).format(Calendar.getInstance().getTime()); String m_date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.ENGLISH).format(Calendar.getInstance().getTime());
databaseController.getInstance().execSQL("UPDATE tab SET date = '" + m_date + "' , url = ? , title = ?, theme = ? WHERE mid='"+mTabs.get(counter).getmId() + "'",params); databaseController.getInstance().execSQL("UPDATE tab SET date = '" + m_date + "' , url = ? , title = ?, theme = ? WHERE mid='"+mTabs.get(counter).getmId() + "'",params);
return true; return true;
} }
} }
if(!mSessionUpdated){
addTabs(pSession, true); addTabs(pSession, true);
}
return false; return false;
} }
@ -231,8 +222,11 @@ class tabDataModel
if (mTabs.get(counter).getSession().getSessionID().equals(pSessionID)) { if (mTabs.get(counter).getSession().getSessionID().equals(pSessionID)) {
GeckoResult<Bitmap> mResult = pBitmapManager.withHandler(handler); GeckoResult<Bitmap> mResult = pBitmapManager.withHandler(handler);
Bitmap mBitmap = pBitmapManager.poll(4000); Bitmap mBitmap = pBitmapManager.poll(4000);
ByteArrayOutputStream out = new ByteArrayOutputStream();
mBitmap.compress(Bitmap.CompressFormat.PNG, 20, out);
Bitmap decoded = BitmapFactory.decodeStream(new ByteArrayInputStream(out.toByteArray()));
mTabs.get(finalCounter).setmBitmap(mBitmap); mTabs.get(finalCounter).setmBitmap(decoded);
if(pImageView!=null){ if(pImageView!=null){
activityContextManager.getInstance().getHomeController().runOnUiThread(() -> pImageView.setImageBitmap(mBitmap)); activityContextManager.getInstance().getHomeController().runOnUiThread(() -> pImageView.setImageBitmap(mBitmap));
} }
@ -298,7 +292,7 @@ class tabDataModel
clearTab(); clearTab();
} }
else if(pCommands == dataEnums.eTabCommands.M_ADD_TAB){ else if(pCommands == dataEnums.eTabCommands.M_ADD_TAB){
addTabs((geckoSession)pData.get(0), (boolean)pData.get(1)); return addTabs((geckoSession)pData.get(0), (boolean)pData.get(1));
} }
else if(pCommands == dataEnums.eTabCommands.M_UPDATE_TAB){ else if(pCommands == dataEnums.eTabCommands.M_UPDATE_TAB){
updateTab((String) pData.get(1), (geckoSession) pData.get(5)); updateTab((String) pData.get(1), (geckoSession) pData.get(5));

View File

@ -1,7 +1,6 @@
package com.darkweb.genesissearchengine.pluginManager; package com.darkweb.genesissearchengine.pluginManager;
import android.app.Dialog; import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.Color; import android.graphics.Color;
@ -10,7 +9,6 @@ import android.graphics.drawable.Drawable;
import android.graphics.drawable.InsetDrawable; import android.graphics.drawable.InsetDrawable;
import android.net.Uri; import android.net.Uri;
import android.os.Handler; import android.os.Handler;
import android.util.Log;
import android.view.Gravity; import android.view.Gravity;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
@ -152,15 +150,15 @@ class messageManager
private void newIdentityCreated() private void newIdentityCreated()
{ {
final Handler handler = new Handler();
Runnable runnable = () -> mDialog.dismiss();
initializeDialog(R.layout.popup_new_circuit, Gravity.BOTTOM); initializeDialog(R.layout.popup_new_circuit, Gravity.BOTTOM);
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss()); mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
final Handler handler = new Handler(); mDialog.setOnDismissListener(dialog -> handler.removeCallbacks(runnable));
Runnable runnable = () -> {
mDialog.dismiss();
};
handler.postDelayed(runnable, 1500);
handler.postDelayed(runnable, 1500);
} }
private void popupBlocked() private void popupBlocked()
@ -183,6 +181,26 @@ class messageManager
} }
private void maxTabReached()
{
final Handler handler = new Handler();
Runnable runnable = () -> {
mDialog.dismiss();
};
initializeDialog(R.layout.popup_max_tab, Gravity.BOTTOM);
mDialog.getWindow().setDimAmount(0);
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> {
mDialog.dismiss();
handler.removeCallbacks(runnable);
});
mDialog.setOnDismissListener(dialog -> handler.removeCallbacks(runnable));
handler.postDelayed(runnable, 1500);
}
private void notSupportMessage() private void notSupportMessage()
{ {
initializeDialog(R.layout.popup_not_supported, Gravity.BOTTOM); initializeDialog(R.layout.popup_not_supported, Gravity.BOTTOM);
@ -611,6 +629,11 @@ class messageManager
/*VERIFIED*/ /*VERIFIED*/
popupBlocked(); popupBlocked();
break; break;
case M_MAX_TAB_REACHED:
/*VERIFIED*/
maxTabReached();
break;
} }
} }
} }

View File

@ -28,7 +28,7 @@ public class pluginEnums
/*Message Manager*/ /*Message Manager*/
public enum eMessageManager{ public enum eMessageManager{
M_RESET, M_DATA_CLEARED, M_SECURE_CONNECTION, M_POPUP_BLOCKED,M_DOWNLOAD_SINGLE, M_UPDATE_BRIDGES, M_NEW_IDENTITY, 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 M_RESET, M_DATA_CLEARED, M_SECURE_CONNECTION, M_POPUP_BLOCKED, M_MAX_TAB_REACHED,M_DOWNLOAD_SINGLE, M_UPDATE_BRIDGES, M_NEW_IDENTITY, 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{ public enum eMessageManagerCallbacks{
M_CANCEL_WELCOME, M_APP_RATED, M_DOWNLOAD_FILE_MANUAL, M_OPEN_LINK_CURRENT_TAB, M_COPY_LINK, M_REQUEST_BRIDGES, M_SET_BRIDGES, M_OPEN_LINK_NEW_TAB, M_CLEAR_TAB, M_RATE_APPLICATION, M_OPEN_PRIVACY M_CANCEL_WELCOME, M_APP_RATED, M_DOWNLOAD_FILE_MANUAL, M_OPEN_LINK_CURRENT_TAB, M_COPY_LINK, M_REQUEST_BRIDGES, M_SET_BRIDGES, M_OPEN_LINK_NEW_TAB, M_CLEAR_TAB, M_RATE_APPLICATION, M_OPEN_PRIVACY

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ffffffff"/>
<stroke android:width="3dp"
android:color="@color/c_button_text_v2"
/>
<padding android:left="1dp"
android:top="1dp"
android:right="1dp"
android:bottom="1dp"
/>
<corners android:bottomRightRadius="27dp" android:bottomLeftRadius="27dp"
android:topLeftRadius="27dp" android:topRightRadius="27dp"/>
</shape>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/c_background_alpha"/>
<stroke android:width="0dp"
android:color="@color/c_background_alpha"/>
<corners android:radius="0dp" />
</shape>

View File

@ -0,0 +1,13 @@
<ripple
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/c_ripple">
<item>
<color android:color="@color/clear_alpha" />
</item>
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="?android:colorAccent" />
</shape>
</item>
</ripple>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/pToastLayoutRoot"
android:translationZ="5dp"
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="match_parent"
android:layout_height="60dp"
android:layout_marginBottom="15dp"
android:background="@xml/ax_background_inverted"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:id="@+id/pDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:alpha="0.8"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:text="@string/SETTING_MAX_TAB_POPUP_INFO_ALERT"
android:textAlignment="textStart"
android:textColor="@color/c_alert_text_inverted"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/pMainLayout"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="SmallSp" />
<Button
android:id="@+id/pDismiss"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="10dp"
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_inverted"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/view6"
android:layout_width="1dp"
android:layout_height="30dp"
android:layout_marginEnd="18dp"
android:background="@color/c_border_background_divider"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/pOpenPrivacy"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -171,6 +171,21 @@
</LinearLayout> </LinearLayout>
<ImageView
android:id="@+id/pTopBarHider"
android:layout_width="match_parent"
android:layout_height="60dp"
android:translationZ="4dp"
android:alpha="0"
android:visibility="gone"
android:clickable="false"
android:focusable="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@color/c_background"
android:contentDescription="@string/GENERAL_TODO" />
<com.google.android.gms.ads.AdView <com.google.android.gms.ads.AdView
android:id="@+id/pAdView" android:id="@+id/pAdView"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -238,6 +238,162 @@
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_marginTop="15dp"
android:layout_marginBottom="10dp"
android:orientation="vertical"
android:layout_height="wrap_content">
<TextView
android:textColor="@color/c_text_setting_heading"
android:textSize="15sp"
android:layout_width="match_parent"
android:textStyle="bold"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:layout_height="wrap_content"
android:layout_weight="40"
android:layout_marginTop="00dp"
android:text="@string/SETTING_ADVANCE_GRID_LAYOUT"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:alpha="1"
android:background="@android:color/transparent"
android:clickable="false"
android:padding="0dp"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:text="@string/SETTING_ADVANCE_GRID_LAYOUT_INFO"
android:textAlignment="textStart"
android:textAllCaps="false"
android:textColor="@color/c_text_v6"
android:textSize="13.5sp"
tools:ignore="RtlSymmetry" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_marginTop="10dp"
android:background="@xml/sx_border_left"
android:orientation="vertical"
android:layout_height="wrap_content" >
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="-1dp"
android:elevation="2dp"
android:background="@color/white"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="55dp"
android:background="@xml/gx_ripple_gray"
android:clickable="false"
android:id="@+id/pGridOption1"
android:layoutDirection="ltr"
android:onClick="onGridView"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="1"
android:background="@android:color/transparent"
android:layout_marginStart="15dp"
android:clickable="false"
android:padding="0dp"
android:paddingStart="5dp"
android:text="@string/SETTING_ADVANCE_GRID_OPTION_1"
android:textAlignment="textStart"
android:textAllCaps="false"
android:textColor="@color/c_text_v1"
android:textSize="15sp"
tools:ignore="RtlSymmetry" />
</LinearLayout>
<RadioButton
android:id="@+id/pAdvanceGridOption1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:clickable="false"
android:background="@android:color/transparent"
android:layout_marginStart="20dp"
android:layout_marginEnd="7dp"
android:buttonTint="@color/c_radio_tint"
android:src="@xml/ic_arrow_right"
android:contentDescription="@string/GENERAL_TODO" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/c_view_divier_background_inner" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="55dp"
android:background="@xml/gx_ripple_gray"
android:id="@+id/pGridOption2"
android:onClick="onGridView"
android:clickable="false"
android:layoutDirection="ltr"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:layout_marginStart="15dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="1"
android:background="@android:color/transparent"
android:clickable="false"
android:padding="0dp"
android:paddingStart="5dp"
android:text="@string/SETTING_ADVANCE_GRID_OPTION_2"
android:textColor="@color/c_text_v1"
android:textAlignment="textStart"
android:textAllCaps="false"
android:textSize="15sp"
tools:ignore="RtlSymmetry" />
</LinearLayout>
<RadioButton
android:id="@+id/pAdvanceGridOption2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:clickable="false"
android:background="@android:color/transparent"
android:buttonTint="@color/c_radio_tint"
android:layout_marginStart="20dp"
android:layout_marginEnd="7dp"
android:src="@xml/ic_arrow_right"
android:contentDescription="@string/GENERAL_TODO" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:elevation="4dp"
android:background="@color/c_view_divier_background_inner"/>
</LinearLayout>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
@ -313,6 +469,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:alpha="1" android:alpha="1"
android:layout_marginStart="15dp"
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:clickable="false" android:clickable="false"
android:padding="0dp" android:padding="0dp"

View File

@ -0,0 +1,277 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/pRowContainer"
android:layout_width="match_parent"
android:layout_height="220dp"
android:layout_marginTop="0dp"
android:layout_marginStart="0dp"
android:clickable="true"
android:background="@color/clear_alpha"
android:focusable="true"
android:orientation="horizontal"
tools:ignore="RtlSymmetry">
<androidx.cardview.widget.CardView
android:id="@+id/pCardViewParent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="0dp"
android:layout_marginStart="0dp"
app:cardElevation="5dp"
app:cardUseCompatPadding="true"
android:background="@color/clear_alpha"
app:cardCornerRadius="4dp"
android:clipChildren="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/pRowContainerInner"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:focusable="true"
android:longClickable="true"
android:orientation="horizontal"
android:paddingEnd="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlSymmetry">
<androidx.cardview.widget.CardView
android:id="@+id/cardView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="38dp"
android:background="@xml/tx_border"
android:clipChildren="true"
android:elevation="0dp"
app:cardCornerRadius="0dp"
app:cardElevation="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view7">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
app:cardCornerRadius="0dp"
app:cardElevation="0dp"
app:contentPadding="0dp">
<com.darkweb.genesissearchengine.helperManager.TopCropImageView
android:id="@+id/pWebThumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="-2dp"
android:adjustViewBounds="true"
android:contentDescription="@string/GENERAL_TODO"
android:elevation="10dp"
android:scaleType="fitCenter" />
</androidx.cardview.widget.CardView>
<FrameLayout
android:id="@+id/pSelectedView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0"
android:background="@xml/tx_border_image_dark_no_corner"
android:translationZ="15dp"
android:visibility="visible">
<ImageView
android:id="@+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/GENERAL_TODO"
android:padding="65dp"
android:src="@drawable/tick_recycler_view" />
</FrameLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginStart="30dp"
android:layout_marginTop="3dp"
android:layout_weight="6"
android:background="@color/c_background"
android:clickable="false"
android:focusable="false"
android:orientation="vertical"
android:paddingEnd="8dp"
android:visibility="visible"
app:layout_constraintEnd_toStartOf="@+id/pRemoveRow"
app:layout_constraintStart_toEndOf="@+id/cardView"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="NestedWeights,RtlSymmetry">
<TextView
android:id="@+id/pDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="0dp"
android:clickable="false"
android:ellipsize="end"
android:maxLines="1"
android:paddingTop="5dp"
android:singleLine="true"
android:text="@string/SETTING_ACCESSIBILITY_FONT_CUSTOM_SAMPLE"
android:textColor="@color/c_text_v1"
android:textSize="13sp" />
<TextView
android:id="@+id/pHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginTop="1dp"
android:clickable="false"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/c_text_v2"
android:textSize="13sp"
android:visibility="gone" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:clickable="false"
android:focusable="false"
android:orientation="horizontal"
android:paddingEnd="8dp"
android:visibility="gone"
tools:ignore="NestedWeights,RtlSymmetry"
tools:layout_editor_absoluteX="114dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="18dp"
android:layout_marginStart="-5dp"
android:layout_marginTop="0dp"
android:clickable="false"
android:contentDescription="@string/GENERAL_TODO"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:src="@xml/ic_baseline_clock"
android:textColor="@color/c_text_v1"
app:tint="@color/c_text_v3" />
<TextView
android:id="@+id/pDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="3dp"
android:layout_marginTop="0dp"
android:clickable="false"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/c_text_v3"
android:textSize="13sp" />
</LinearLayout>
</LinearLayout>
<View
android:id="@+id/view7"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="5dp"
android:background="@color/c_view_divier_background"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout" />
<ImageView
android:id="@+id/pLoadSession"
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="@xml/gx_ripple_light"
android:clickable="true"
android:contentDescription="@string/GENERAL_TODO"
android:focusable="true"
android:longClickable="true"
android:translationZ="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/cardView"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/pBorder"
android:layout_width="match_parent"
android:layout_height="6dp"
android:background="@color/c_ripple_v2"
android:contentDescription="@string/GENERAL_TODO"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/pRemoveRow"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="3dp"
android:background="@xml/tx_ripple_light"
android:contentDescription="@string/GENERAL_TODO"
android:elevation="11dp"
android:longClickable="true"
android:outlineProvider="none"
android:padding="8dp"
android:paddingTop="22dp"
android:paddingBottom="22dp"
android:scaleType="fitCenter"
android:src="@xml/ic_baseline_cross"
android:tint="@color/c_navigation_tint"
android:visibility="visible"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlSymmetry" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<FrameLayout
android:visibility="gone"
android:translationZ="100dp"
android:id="@+id/pItemSelectionMenu"
android:layout_width="match_parent"
android:background="@color/c_background"
android:layout_height="match_parent">
<Button
android:id="@+id/pItemSelectionMenuButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:textSize="16sp"
android:textAllCaps="false"
android:background="@xml/hox_rounded_corner_suggestion_settings"
android:elevation="7dp"
android:text="@string/TAB_LIST_SELECT"
android:textColor="@color/white"
android:visibility="visible" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -77,7 +77,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@string/GENERAL_TODO" android:contentDescription="@string/GENERAL_TODO"
android:padding="15dp" android:padding="19dp"
android:src="@drawable/tick_recycler_view" /> android:src="@drawable/tick_recycler_view" />
</FrameLayout> </FrameLayout>

View File

@ -147,17 +147,26 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="fill_vertical" android:layout_gravity="fill_vertical"
android:layout_marginTop="60dp"
android:paddingEnd="10dp"
android:paddingStart="10dp"
android:background="@color/clear_alpha" android:background="@color/clear_alpha"
android:fillViewport="true" android:fillViewport="true"
android:translationZ="2dp" android:translationZ="2dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior"> app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/c_background" android:background="@color/c_background"
android:elevation="8dp"
android:clickable="true" android:clickable="true"
android:clipToPadding="false"
android:elevation="8dp"
android:paddingTop="5dp"
android:focusable="true" android:focusable="true"
android:onClick="onClearSelection" android:onClick="onClearSelection"
android:orientation="vertical" android:orientation="vertical"
@ -169,26 +178,32 @@
android:id="@+id/pEmptyView" android:id="@+id/pEmptyView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="150dp" android:layout_height="150dp"
android:layout_marginTop="65dp"
android:gravity="center" android:gravity="center"
android:text="@string/HOME_TAB_EMPTY" android:text="@string/HOME_TAB_EMPTY"
android:textColor="@color/c_text_v2" android:textColor="@color/c_text_v2"
android:textSize="15sp" android:textSize="15sp"
android:textStyle="bold"/> android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/pRecycleView" android:id="@+id/pRecycleView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:background="@color/c_background" android:background="@color/c_background"
android:layout_marginTop="-150dp" android:clickable="true"
android:clipToPadding="false"
android:focusable="true"
android:onClick="onClearSelection"
android:paddingBottom="300dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent">
app:layout_constraintTop_toBottomOf="@+id/pHeaderContainer">
</androidx.recyclerview.widget.RecyclerView> </androidx.recyclerview.widget.RecyclerView>
</LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

View File

@ -1,6 +1,6 @@
<resources> <resources>
<color name="c_background">#1c1b21</color> <color name="c_background">#1c1b21</color>
<color name="c_background_alpha">#50ffffff</color> <color name="c_background_alpha">#60ffffff</color>
<color name="c_background_keyboard">#091a2a</color> <color name="c_background_keyboard">#091a2a</color>
<color name="c_background_inverted">#ffffff</color> <color name="c_background_inverted">#ffffff</color>
<color name="c_view_divier_background_inner">#0f0f0f</color> <color name="c_view_divier_background_inner">#0f0f0f</color>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="c_background">#ffffff</color> <color name="c_background">#ffffff</color>
<color name="c_background_alpha">#501c1b21</color> <color name="c_background_alpha">#601c1b21</color>
<color name="c_background_keyboard">#999999</color> <color name="c_background_keyboard">#999999</color>
<color name="c_background_inverted">#302e38</color> <color name="c_background_inverted">#302e38</color>
<color name="c_view_divier_background_inner">#ebebeb</color> <color name="c_view_divier_background_inner">#ebebeb</color>
@ -111,6 +111,7 @@
<color name="holo_gray">#b3b3b3</color> <color name="holo_gray">#b3b3b3</color>
<color name="float_white">#bfbfbf</color> <color name="float_white">#bfbfbf</color>
<color name="button_gray">#d9d9d9</color> <color name="button_gray">#d9d9d9</color>
<color name="button_gray_alpha">#AAffffff</color>
<color name="button_light">#e3e3e3</color> <color name="button_light">#e3e3e3</color>
<color name="holo_gray_light">#f2f2f2</color> <color name="holo_gray_light">#f2f2f2</color>
<color name="holo_gray_light_row">#f2f2f2</color> <color name="holo_gray_light_row">#f2f2f2</color>

View File

@ -123,11 +123,14 @@
<string name="SETTING_PRIVACY_POPUP" translatable="true">Block Popup | Toggle to Disable Popup Advert</string> <string name="SETTING_PRIVACY_POPUP" translatable="true">Block Popup | Toggle to Disable Popup Advert</string>
<string name="SETTING_PRIVACY_POPUP_INFO" translatable="true">Remove popup advertizement. Might break functionaly of some websites</string> <string name="SETTING_PRIVACY_POPUP_INFO" translatable="true">Remove popup advertizement. Might break functionaly of some websites</string>
<string name="SETTING_PRIVACY_POPUP_INFO_ALERT" translatable="true">Popup blocked</string> <string name="SETTING_PRIVACY_POPUP_INFO_ALERT" translatable="true">Popup blocked</string>
<string name="SETTING_MAX_TAB_POPUP_INFO_ALERT" translatable="true">Memory full &#160;&#160; Clearing tab</string>
<string name="SETTING_ADVANCE_HEADER" translatable="true">Settings | Advance</string> <string name="SETTING_ADVANCE_HEADER" translatable="true">Settings | Advance</string>
<string name="SETTING_ADVANCE_RESTORE_TAB" translatable="true">Restore tabs</string> <string name="SETTING_ADVANCE_RESTORE_TAB" translatable="true">Restore tabs</string>
<string name="SETTING_ADVANCE_RESTORE_TAB_INFO" translatable="true">Don\'t restore after quitting browser</string> <string name="SETTING_ADVANCE_RESTORE_TAB_INFO" translatable="true">Don\'t restore after quitting browser</string>
<string name="SETTING_ADVANCE_TITILE_THEME" translatable="true">Toolbar Theme</string> <string name="SETTING_ADVANCE_TITILE_THEME" translatable="true">Toolbar Theme</string>
<string name="SETTING_ADVANCE_TITILE_THEME_INFO" translatable="true">Set toolbar theme as defined in website</string> <string name="SETTING_ADVANCE_TITILE_THEME_INFO" translatable="true">Set toolbar theme as defined in website</string>
<string name="SETTING_ADVANCE_GRID_LAYOUT" translatable="true">Tab view</string>
<string name="SETTING_ADVANCE_GRID_LAYOUT_INFO" translatable="true">Switch between Tab manager Grid Layout and List Layout</string>
<string name="SETTING_ADVANCE_SHOW_IMAGES" translatable="true">Show Images</string> <string name="SETTING_ADVANCE_SHOW_IMAGES" translatable="true">Show Images</string>
<string name="SETTING_ADVANCE_SHOW_IMAGES_INFO" translatable="true">Always load website images</string> <string name="SETTING_ADVANCE_SHOW_IMAGES_INFO" translatable="true">Always load website images</string>
<string name="SETTING_ADVANCE_WEB_FONTS" translatable="true">Show web fonts</string> <string name="SETTING_ADVANCE_WEB_FONTS" translatable="true">Show web fonts</string>
@ -140,6 +143,8 @@
<string name="SETTING_ADVANCE_MEDIA_SUB_HEADER" translatable="true">Media</string> <string name="SETTING_ADVANCE_MEDIA_SUB_HEADER" translatable="true">Media</string>
<string name="SETTING_ADVANCE_DATA_SAVER_INFO" translatable="true">Change default data saver settings</string> <string name="SETTING_ADVANCE_DATA_SAVER_INFO" translatable="true">Change default data saver settings</string>
<string name="SETTING_ADVANCE_MEDIA_SUB_HEADER_INFO" translatable="true">Change default media settings</string> <string name="SETTING_ADVANCE_MEDIA_SUB_HEADER_INFO" translatable="true">Change default media settings</string>
<string name="SETTING_ADVANCE_GRID_OPTION_1" translatable="true">Grid Design</string>
<string name="SETTING_ADVANCE_GRID_OPTION_2" translatable="true">List Design</string>
<string name="SETTING_ADVANCE_IMAGE_OPTION_1" translatable="true">Always show images</string> <string name="SETTING_ADVANCE_IMAGE_OPTION_1" translatable="true">Always show images</string>
<string name="SETTING_ADVANCE_IMAGE_OPTION_2" translatable="true">Only show images over WI-FI</string> <string name="SETTING_ADVANCE_IMAGE_OPTION_2" translatable="true">Only show images over WI-FI</string>
<string name="SETTING_ADVANCE_IMAGE_OPTION_3" translatable="true">Block all images</string> <string name="SETTING_ADVANCE_IMAGE_OPTION_3" translatable="true">Block all images</string>
@ -164,6 +169,8 @@
<string name="SETTING_GENERAL_INFO" translatable="true">Home, language</string> <string name="SETTING_GENERAL_INFO" translatable="true">Home, language</string>
<string name="SETTING_GENERAL_FULLSCREEN_BROWSING" translatable="true">Full-screen browsing</string> <string name="SETTING_GENERAL_FULLSCREEN_BROWSING" translatable="true">Full-screen browsing</string>
<string name="SETTING_GENERAL_FULLSCREEN_BROWSING_INFO" translatable="true">Hide the browser toolbar when scrolling down a page</string> <string name="SETTING_GENERAL_FULLSCREEN_BROWSING_INFO" translatable="true">Hide the browser toolbar when scrolling down a page</string>
<string name="SETTING_GENERAL_TOOLBAR_THEME" translatable="true">Searchbar theme</string>
<string name="SETTING_GENERAL_TOOLBAR_THEME_INFO" translatable="true">Automatically change search bar theme according to website</string>
<string name="SETTING_GENERAL_LANGUAGE" translatable="true">Language</string> <string name="SETTING_GENERAL_LANGUAGE" translatable="true">Language</string>
<string name="SETTING_GENERAL_LANGUAGE_INFO" translatable="true">Change the language of your browser</string> <string name="SETTING_GENERAL_LANGUAGE_INFO" translatable="true">Change the language of your browser</string>
<string name="SETTING_GENERAL_THEME" translatable="true">Theme</string> <string name="SETTING_GENERAL_THEME" translatable="true">Theme</string>