Bug Fixes

Bug Fixes
master
msmannan00 2021-04-13 13:20:07 +05:00
parent a928d311ca
commit d6c0708814
12 changed files with 140 additions and 67 deletions

View File

@ -15,6 +15,7 @@
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" /> <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
<application <application
android:requestLegacyExternalStorage="true"
android:allowBackup="true" android:allowBackup="true"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:fullBackupContent="false" android:fullBackupContent="false"

View File

@ -884,7 +884,6 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
try { try {
FinderResult mResult = mFinder.poll(1000); FinderResult mResult = mFinder.poll(1000);
Log.i("FUCK","FUCK : " + mResult.found + "----" + mResult.current + "-----" + mResult.total);
event.invokeObserver(Arrays.asList(mResult.total, mResult.current), enums.etype.FINDER_RESULT_CALLBACK); event.invokeObserver(Arrays.asList(mResult.total, mResult.current), enums.etype.FINDER_RESULT_CALLBACK);
} catch (Throwable throwable) { } catch (Throwable throwable) {
throwable.printStackTrace(); throwable.printStackTrace();

View File

@ -269,14 +269,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.splashScreenDisableInstant(); mHomeViewController.splashScreenDisableInstant();
onLoadTabOnResume(); onLoadTabOnResume();
mSearchLock.setColorFilter(ContextCompat.getColor(this, R.color.c_lock_tint)); mSearchLock.setColorFilter(ContextCompat.getColor(this, R.color.c_lock_tint));
}else {
new Handler().postDelayed(() ->
{
mTabFragment.setAlpha(1f);
mTabFragment.setVisibility(View.VISIBLE);
activityContextManager.getInstance().getTabController().onInit();
mTabFragment.setVisibility(View.GONE);
}, 500);
} }
initSuggestionView(new ArrayList<>(), strings.GENERIC_EMPTY_STR); initSuggestionView(new ArrayList<>(), strings.GENERIC_EMPTY_STR);
} }
@ -551,7 +543,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
mAppBar.animate().cancel(); mAppBar.animate().cancel();
mHomeViewController.onClearSelections(true);
Objects.requireNonNull(mGeckoView.getSession()).stop(); Objects.requireNonNull(mGeckoView.getSession()).stop();
mGeckoClient.loadURL(url.replace("genesis.onion","boogle.store"),mGeckoView, homeController.this); mGeckoClient.loadURL(url.replace("genesis.onion","boogle.store"),mGeckoView, homeController.this);
} }
@ -957,6 +948,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
pURL = mVal; pURL = mVal;
} }
mHomeViewController.onClearSelections(true);
onLoadURL(pURL); onLoadURL(pURL);
mHomeViewController.onUpdateSearchBar(pURL,false,true, false); mHomeViewController.onUpdateSearchBar(pURL,false,true, false);
} }
@ -1015,7 +1007,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
initializeGeckoView(true, true); initializeGeckoView(true, true);
if(status.sOpenURLInNewTab){ if(status.sOpenURLInNewTab){
if(mGeckoView.getSession()!=null && !mGeckoView.getSession().isOpen()){ if(mGeckoView.getSession()!=null && !mGeckoView.getSession().isOpen()){
mGeckoView.getSession().open(mGeckoClient.getmRuntime()); mGeckoView.getSession().open(mGeckoClient.getmRuntime());
} }
mHomeViewController. onUpdateSearchBar(helperMethod.getDomainName(status.sSettingSearchStatus),false,true, false); mHomeViewController. onUpdateSearchBar(helperMethod.getDomainName(status.sSettingSearchStatus),false,true, false);
@ -1562,9 +1554,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
else if (menuId == R.id.pMenuOpenRecentTab) else if (menuId == R.id.pMenuOpenRecentTab)
{ {
mHomeViewController.onShowTabContainer();
Log.i("I AM FUCKED,","I AM FUCKED : 1");
activityContextManager.getInstance().getTabController().onInit(); activityContextManager.getInstance().getTabController().onInit();
mHomeViewController.onShowTabContainer();
// overridePendingTransition(R.anim.popup_anim_in, R.anim.popup_anim_out); // overridePendingTransition(R.anim.popup_anim_in, R.anim.popup_anim_out);
} }
else if (menuId == R.id.pMenuOpenNewTab) else if (menuId == R.id.pMenuOpenNewTab)
@ -1688,6 +1679,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
{ {
if(e_type.equals(GECKO_SCROLL_CHANGED)){ if(e_type.equals(GECKO_SCROLL_CHANGED)){
mHomeViewController.onMoveTopBar((int)data.get(0)); mHomeViewController.onMoveTopBar((int)data.get(0));
onInvokePixelGenerator();
} }
return null; return null;
} }

View File

@ -790,9 +790,6 @@ class homeViewController
} }
} }
public void performDummyClick(){
}
void updateBannerAdvertStatus(boolean status, boolean pIsAdvertLoaded){ void updateBannerAdvertStatus(boolean status, boolean pIsAdvertLoaded){
if(status && pIsAdvertLoaded){ if(status && pIsAdvertLoaded){
if(mBannerAds.getAlpha()==0){ if(mBannerAds.getAlpha()==0){
@ -1064,6 +1061,10 @@ class homeViewController
mSearchbar.setSelection(mSearchbar.getText().length()); mSearchbar.setSelection(mSearchbar.getText().length());
mSearchbar.selectAll(); mSearchbar.selectAll();
} }
if(mSearchbar.getText().toString().equals("loading")){
mSearchbar.setText("about:blank");
}
} }
private String removeEndingSlash(String url){ private String removeEndingSlash(String url){
@ -1071,8 +1072,10 @@ class homeViewController
} }
void onNewTab(){ void onNewTab(){
mSearchbar.requestFocus(); if(!mSearchbar.isFocused()){
mSearchbar.selectAll(); mSearchbar.requestFocus();
mSearchbar.selectAll();
}
} }
void onUpdateLogs(String log){ void onUpdateLogs(String log){
@ -1119,18 +1122,23 @@ class homeViewController
public void onNewTabAnimation(List<Object> data, Object e_type){ public void onNewTabAnimation(List<Object> data, Object e_type){
mGeckoView.setPivotX(0); mGeckoView.setPivotX(0);
mGeckoView.setPivotY(0); mGeckoView.setPivotY(0);
mGeckoView.setClickable(false); //mGeckoView.setClickable(false);
mGeckoView.setFocusable(false); //mGeckoView.setFocusable(false);
mGeckoView.setEnabled(false); //mGeckoView.setEnabled(false);
ObjectAnimator scaleDown = ObjectAnimator.ofPropertyValuesHolder(mGeckoView, ObjectAnimator scaleDown = ObjectAnimator.ofPropertyValuesHolder(mGeckoView,
PropertyValuesHolder.ofFloat("scaleX", 1, 0.35f), PropertyValuesHolder.ofFloat("scaleX", 1, 0.8f),
PropertyValuesHolder.ofFloat("scaleY", 1, 0.35f)); PropertyValuesHolder.ofFloat("scaleY", 1, 0.8f));
scaleDown.setDuration(300);
mNewTabBlocker.setAlpha(0f);
mNewTabBlocker.setVisibility(View.VISIBLE); mNewTabBlocker.setVisibility(View.VISIBLE);
mNewTabBlocker.animate().setDuration(300).alpha(1); ObjectAnimator alpha = ObjectAnimator.ofPropertyValuesHolder(mNewTabBlocker,
mNewTabBlocker.setTranslationZ(100); PropertyValuesHolder.ofFloat("alpha", 0, 1f));
scaleDown.setDuration(150);
alpha.setDuration(150);
scaleDown.start(); scaleDown.start();
alpha.start();
scaleDown.addListener(new Animator.AnimatorListener() { scaleDown.addListener(new Animator.AnimatorListener() {
@Override @Override
@ -1141,18 +1149,18 @@ class homeViewController
public void onAnimationEnd(Animator animation, boolean isReverse) { public void onAnimationEnd(Animator animation, boolean isReverse) {
mEvent.invokeObserver(data, e_type); mEvent.invokeObserver(data, e_type);
ObjectAnimator scaleDown = ObjectAnimator.ofPropertyValuesHolder(mGeckoView, ObjectAnimator scaleDown = ObjectAnimator.ofPropertyValuesHolder(mGeckoView,
PropertyValuesHolder.ofFloat("scaleX", 0.35f, 1f), PropertyValuesHolder.ofFloat("scaleX", 0.8f, 1f),
PropertyValuesHolder.ofFloat("scaleY", 0.35f, 1f)); PropertyValuesHolder.ofFloat("scaleY", 0.8f, 1f));
scaleDown.setDuration(300);
scaleDown.setStartDelay(650); scaleDown.setDuration(150);
mNewTabBlocker.animate().setStartDelay(650).setDuration(300).alpha(0).withEndAction(() -> { scaleDown.setStartDelay(0);
mNewTabBlocker.setAlpha(0f); mNewTabBlocker.animate().setStartDelay(350).setDuration(150).alpha(0f).withEndAction(() -> {
mNewTabBlocker.setVisibility(View.GONE); mNewTabBlocker.setVisibility(View.GONE);
}); });
scaleDown.start(); scaleDown.start();
mGeckoView.setClickable(true); //mGeckoView.setClickable(true);
mGeckoView.setFocusable(true); //mGeckoView.setFocusable(true);
mGeckoView.setEnabled(true); //mGeckoView.setEnabled(true);
} }
@Override @Override

View File

@ -350,17 +350,25 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
} }
mItemSelectionMenu.setVisibility(View.GONE); mItemSelectionMenu.setVisibility(View.GONE);
if(model.getSession().getTitle().contains("TITLE") || model.getSession().getTitle().contains("title") || model.getSession().getTitle().toLowerCase().equals("loading")){
mHeader.setText(helperMethod.getDomainName(mURL));
}else {
mHeader.setText(model.getSession().getTitle());
}
if(status.sTabGridLayoutEnabled){ if(status.sTabGridLayoutEnabled){
mDescription.setText((model.getSession().getTitle())); mDescription.setText((model.getSession().getTitle()));
}else { }else {
mHeader.setText(model.getSession().getTitle());
mDescription.setText(mURL); mDescription.setText(mURL);
} }
String mHeadText = mHeader.getText().toString();
String mDescText = mDescription.getText().toString();
if(mHeadText.equals("$TITLE") || mDescText.startsWith("http://loading") || mDescText.startsWith("loading")){
mHeader.setText("about:blank");
}
if(mDescText.equals("$TITLE") || mDescText.startsWith("http://loading") || mDescText.startsWith("loading")){
mDescription.setText("about:blank");
}
mDate.setText(model.getDate()); mDate.setText(model.getDate());
if(mURL.equals("about:blank")){ if(mURL.equals("about:blank")){
@ -474,6 +482,8 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
}else { }else {
if(status.sTabGridLayoutEnabled){ if(status.sTabGridLayoutEnabled){
scaleView(itemView, mModelList.get(this.getLayoutPosition())); scaleView(itemView, mModelList.get(this.getLayoutPosition()));
}else {
onTriggerURL(mModelList.get(this.getLayoutPosition()));
} }
} }
}else { }else {

View File

@ -1,8 +1,9 @@
package com.darkweb.genesissearchengine.appManager.tabManager; package com.darkweb.genesissearchengine.appManager.tabManager;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
@ -47,6 +48,7 @@ public class tabController extends Fragment
private ImageView mRemoveSelection; private ImageView mRemoveSelection;
private ImageButton mMenuButton; private ImageButton mMenuButton;
private ImageButton mClearSelection; private ImageButton mClearSelection;
private TextView mEmptyView;
private View mPopupUndo; private View mPopupUndo;
private TextView mSelectionCount; private TextView mSelectionCount;
private ImageView mBlocker; private ImageView mBlocker;
@ -70,6 +72,7 @@ public class tabController extends Fragment
private float getmScreenWidth; private float getmScreenWidth;
private boolean mClosed = false; private boolean mClosed = false;
private boolean mClosedByNewTab = false; private boolean mClosedByNewTab = false;
private boolean mFirstLaunch = true;
boolean mScrolled = true; boolean mScrolled = true;
/*Initializations*/ /*Initializations*/
@ -95,6 +98,7 @@ public class tabController extends Fragment
mScrollHandler = null; mScrollHandler = null;
mScrollRunnable = null; mScrollRunnable = null;
mScrolled = false; mScrolled = false;
mFirstLaunch = false;
super.onDestroy(); super.onDestroy();
} }
@ -109,13 +113,14 @@ public class tabController extends Fragment
public void onInit(){ public void onInit(){
initializeActivity();
initializeViews(); initializeViews();
initializeActivity();
initializeLocalEventHandlers(); initializeLocalEventHandlers();
initializeList(); initializeList();
initSwipe(); initSwipe();
mClosed = false; mClosed = false;
mFirstLaunch = false;
mTabGridLayoutEnabled = status.sTabGridLayoutEnabled; mTabGridLayoutEnabled = status.sTabGridLayoutEnabled;
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_RELEASE_BLOCKER, null); mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_RELEASE_BLOCKER, null);
mNestedScrollView.scrollTo(0,0); mNestedScrollView.scrollTo(0,0);
@ -125,13 +130,30 @@ public class tabController extends Fragment
} }
public void onInitInvoked(){ public void onInitInvoked(){
if(mFirstLaunch){
mRecycleView.setAlpha(0);
mFirstLaunch = false;
ObjectAnimator alpha = ObjectAnimator.ofPropertyValuesHolder(mRecycleView, PropertyValuesHolder.ofFloat("alpha", 0, 1f));
alpha.setDuration(300);
alpha.setStartDelay(600);
alpha.start();
mEmptyView.setAlpha(0);
new Handler().postDelayed(() ->
{
mEmptyView.setAlpha(1);
}, 1000);
}else {
mRecycleView.setAlpha(1);
mEmptyView.setAlpha(1);
}
initializeList(); initializeList();
mClosed = false; mClosed = false;
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_RELEASE_BLOCKER, null); mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_RELEASE_BLOCKER, null);
mNestedScrollView.scrollTo(0,0); mNestedScrollView.scrollTo(0,0);
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_HIDE_UNDO_DIALOG_INIT, null); mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_HIDE_UNDO_DIALOG_INIT, null);
mRecycleView.setAlpha(1);
mTabAdapter.notifyDataSetChanged(); mTabAdapter.notifyDataSetChanged();
} }
@ -156,6 +178,7 @@ public class tabController extends Fragment
public void initializeViews(){ public void initializeViews(){
mRecycleView = mRootView.findViewById(R.id.pRecycleView); mRecycleView = mRootView.findViewById(R.id.pRecycleView);
mTabs = mRootView.findViewById(R.id.pTabs); mTabs = mRootView.findViewById(R.id.pTabs);
mEmptyView = mRootView.findViewById(R.id.pEmptyView);
mRemoveSelection = mRootView.findViewById(R.id.pRemoveSelection); mRemoveSelection = mRootView.findViewById(R.id.pRemoveSelection);
mMenuButton = mRootView.findViewById(R.id.pMenuButton); mMenuButton = mRootView.findViewById(R.id.pMenuButton);
mClearSelection = mRootView.findViewById(R.id.pClearSelection); mClearSelection = mRootView.findViewById(R.id.pClearSelection);
@ -164,7 +187,7 @@ public class tabController extends Fragment
mBlocker = mRootView.findViewById(R.id.pBlocker); mBlocker = mRootView.findViewById(R.id.pBlocker);
mNestedScrollView = mRootView.findViewById(R.id.pNestedScroll); mNestedScrollView = mRootView.findViewById(R.id.pNestedScroll);
mtabViewController = new tabViewController(this, mTabs, mRemoveSelection, mMenuButton, mClearSelection, mPopupUndo, mSelectionCount, mBlocker, mRecycleView, mNestedScrollView); mtabViewController = new tabViewController(this, mTabs, mRemoveSelection, mMenuButton, mClearSelection, mPopupUndo, mSelectionCount, mBlocker, mRecycleView, mNestedScrollView, mEmptyView);
} }
@SuppressLint("ClickableViewAccessibility") @SuppressLint("ClickableViewAccessibility")

View File

@ -4,6 +4,7 @@ import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.geckoSession; import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.geckoSession;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.helperManager.helperMethod; import com.darkweb.genesissearchengine.helperManager.helperMethod;
public class tabRowModel public class tabRowModel
@ -44,6 +45,13 @@ public class tabRowModel
mSession.setTitle(pTitle); mSession.setTitle(pTitle);
mSession.setURL(pURL); mSession.setURL(pURL);
mSession.setTheme(pTheme); mSession.setTheme(pTheme);
if(!status.sSettingIsAppStarted){
if(pTitle.equals("$TITLE") || pTitle.startsWith("http://loading") || pTitle.startsWith("loading") || pURL.equals("$TITLE") || pURL.startsWith("http://loading") || pURL.startsWith("loading")){
mSession.setTitle("about:blank");
mSession.setURL("about:blank");
}
}
} }
public String getmId() { public String getmId() {

View File

@ -51,6 +51,7 @@ class tabViewController
private ImageView mBlocker; private ImageView mBlocker;
private RecyclerView mRecycleView; private RecyclerView mRecycleView;
private NestedScrollView mNestedScrollView; private NestedScrollView mNestedScrollView;
private TextView mEmptyView;
/*Private Local Variables*/ /*Private Local Variables*/
private Handler mDelayHandler = new Handler(); private Handler mDelayHandler = new Handler();
@ -58,7 +59,7 @@ class tabViewController
/*Initializations*/ /*Initializations*/
tabViewController(Fragment mContext, Button pTabs, ImageView pRemoveSelection, ImageButton pMenuButton, ImageButton pClearSelection, View pToastLayoutRoot, TextView pSelectionCount, ImageView pBlocker, RecyclerView pRecycleView, NestedScrollView pNestedScrollView) tabViewController(Fragment mContext, Button pTabs, ImageView pRemoveSelection, ImageButton pMenuButton, ImageButton pClearSelection, View pToastLayoutRoot, TextView pSelectionCount, ImageView pBlocker, RecyclerView pRecycleView, NestedScrollView pNestedScrollView, TextView pEmptyView)
{ {
this.mContext = mContext; this.mContext = mContext;
this.mTabs = pTabs; this.mTabs = pTabs;
@ -70,6 +71,7 @@ class tabViewController
this.mBlocker = pBlocker; this.mBlocker = pBlocker;
this.mRecycleView = pRecycleView; this.mRecycleView = pRecycleView;
this.mNestedScrollView = pNestedScrollView; this.mNestedScrollView = pNestedScrollView;
this.mEmptyView = pEmptyView;
initUI(); initUI();
initPostUI(); initPostUI();

View File

@ -66,6 +66,14 @@ class tabDataModel
params[2] = mTabModel.getSession().getTheme(); params[2] = mTabModel.getSession().getTheme();
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());
if(mTabModel.getSession().getTitle().equals("$TITLE") || mTabModel.getSession().getTitle().startsWith("http://loading") || mTabModel.getSession().getTitle().startsWith("loading")){
return enums.AddTabCallback.TAB_ADDED;
}
if(mTabModel.getSession().getCurrentURL().equals("$TITLE") || mTabModel.getSession().getCurrentURL().startsWith("http://loading") || mTabModel.getSession().getCurrentURL().startsWith("loading")){
return enums.AddTabCallback.TAB_ADDED;
}
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; return enums.AddTabCallback.TAB_ADDED;

View File

@ -7,6 +7,8 @@ import android.app.NotificationChannel;
import android.app.NotificationManager; import android.app.NotificationManager;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
@ -15,6 +17,8 @@ import android.os.AsyncTask;
import android.os.Build; import android.os.Build;
import android.os.Environment; import android.os.Environment;
import android.os.StrictMode; import android.os.StrictMode;
import android.provider.MediaStore;
import androidx.core.app.NotificationCompat; import androidx.core.app.NotificationCompat;
import androidx.core.content.FileProvider; import androidx.core.content.FileProvider;
@ -194,8 +198,23 @@ public class localFileDownloader extends AsyncTask<String, Integer, String> {
File mFile = new File(mPath); File mFile = new File(mPath);
Uri uri = FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName() + ".provider", mFile); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
dm.addCompletedDownload(mFileName, mURL, false, helperMethod.getMimeType(uri.toString()), mFile.getAbsolutePath(), mFile.length(), false); Uri uri = FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName() + ".provider", mFile);
ContentValues contentValues = new ContentValues();
contentValues.put(MediaStore.Downloads.TITLE, mFileName);
contentValues.put(MediaStore.Downloads.DISPLAY_NAME, mFileName);
contentValues.put(MediaStore.Downloads.SIZE, mDownloadByte);
contentValues.put(MediaStore.Downloads.MIME_TYPE, helperMethod.getMimeType(uri.toString()));
contentValues.put(MediaStore.Downloads.RELATIVE_PATH, Environment.DIRECTORY_DOWNLOADS + File.separator + "Temp");
ContentResolver database = context.getContentResolver();
database.insert(MediaStore.Downloads.EXTERNAL_CONTENT_URI, contentValues);
} else {
Uri uri = FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName() + ".provider", mFile);
dm.addCompletedDownload(mFileName, mURL, false, helperMethod.getMimeType(uri.toString()), mFile.getAbsolutePath(), mFile.length(), false);
}
} }

View File

@ -29,6 +29,7 @@ import com.google.android.material.switchmaterial.SwitchMaterial;
import org.mozilla.geckoview.ContentBlocking; import org.mozilla.geckoview.ContentBlocking;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -384,12 +385,15 @@ class messageManager
((TextView) mDialog.findViewById(R.id.pDescription)).setText(mData.get(0).toString()); ((TextView) mDialog.findViewById(R.id.pDescription)).setText(mData.get(0).toString());
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss()); mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> { mDialog.findViewById(R.id.pNext).setOnClickListener(v -> {
ArrayList<Object> tempData = new ArrayList<>();
tempData.addAll(mData);
mDialog.dismiss(); mDialog.dismiss();
final Handler handler = new Handler(); final Handler handler = new Handler();
Runnable runnable = () -> { Runnable runnable = () -> {
mEvent.invokeObserver(mData, M_DOWNLOAD_SINGLE); mEvent.invokeObserver(tempData, M_DOWNLOAD_SINGLE);
}; };
handler.postDelayed(runnable, 1000); handler.postDelayed(runnable, 1000);
onClearReference();
}); });
mDialog.setOnDismissListener(dialog -> onClearReference()); mDialog.setOnDismissListener(dialog -> onClearReference());
} }

View File

@ -257,24 +257,6 @@
app:shiftDuration="@integer/progress_shift_duration" app:shiftDuration="@integer/progress_shift_duration"
app:wrapShiftDrawable="true" app:wrapShiftDrawable="true"
tools:progress="0" /> tools:progress="0" />
<ImageView
android:id="@+id/pNewTabBlocker"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0"
android:background="@color/c_background"
android:contentDescription="@string/GENERAL_TODO"
android:focusable="false"
android:translationZ="15dp"
android:visibility="gone"
android:elevation="100dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="MissingConstraints" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>
@ -814,4 +796,21 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/pNewTabBlocker"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="60dp"
android:clickable="true"
android:alpha="0"
android:background="@color/c_background"
android:contentDescription="@string/GENERAL_TODO"
android:focusable="true"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="MissingConstraints" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>