Bug fixes

master
msmannan00 2020-11-27 16:40:46 +05:00
parent 19f96483f2
commit 8f0465b0f6
256 changed files with 3968 additions and 25812 deletions

View File

@ -5,6 +5,10 @@
<inspection_tool class="AndroidLintSuspiciousImport" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="BooleanMethodIsAlwaysInverted" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="BusyWait" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="ConstantConditions" enabled="true" level="WARNING" enabled_by_default="true">
<option name="SUGGEST_NULLABLE_ANNOTATIONS" value="false" />
<option name="DONT_REPORT_TRUE_ASSERT_STATEMENTS" value="false" />
</inspection_tool>
<inspection_tool class="EmptyStatementBody" enabled="false" level="WARNING" enabled_by_default="false">
<option name="m_reportEmptyBlocks" value="true" />
</inspection_tool>
@ -17,6 +21,7 @@
</inspection_tool>
<inspection_tool class="InfiniteLoopStatement" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="InnerClassMayBeStatic" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="LambdaParameterTypeCanBeSpecified" enabled="false" level="INFORMATION" enabled_by_default="false" />
<inspection_tool class="SameParameterValue" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" />
@ -26,6 +31,10 @@
<inspection_tool class="SuspiciousListRemoveInLoop" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="TrivialIf" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UNCHECKED_WARNING" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UnnecessaryLocalVariable" enabled="false" level="WARNING" enabled_by_default="false">
<option name="m_ignoreImmediatelyReturnedVariables" value="false" />
<option name="m_ignoreAnnotatedVariables" value="false" />
</inspection_tool>
<inspection_tool class="UnusedReturnValue" enabled="false" level="WARNING" enabled_by_default="false" />
</profile>
</component>

View File

@ -51,5 +51,10 @@
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven5" />
<option name="name" value="maven5" />
<option name="url" value="https://oss.sonatype.org/content/repositories/snapshots/" />
</remote-repository>
</component>
</project>

View File

@ -1,4 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="org.jetbrains.annotations.Nullable" />
<option name="myDefaultNotNull" value="androidx.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="14">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="2" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="3" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
<item index="5" class="java.lang.String" itemvalue="com.android.annotations.Nullable" />
<item index="6" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="7" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
<item index="10" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
<item index="11" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.Nullable" />
<item index="12" class="java.lang.String" itemvalue="io.reactivex.annotations.Nullable" />
<item index="13" class="java.lang.String" itemvalue="io.reactivex.rxjava3.annotations.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="13">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="2" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
<item index="3" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
<item index="5" class="java.lang.String" itemvalue="com.android.annotations.NonNull" />
<item index="6" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
<item index="10" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.NonNull" />
<item index="11" class="java.lang.String" itemvalue="io.reactivex.annotations.NonNull" />
<item index="12" class="java.lang.String" itemvalue="io.reactivex.rxjava3.annotations.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
</project>

View File

@ -11,6 +11,7 @@ ext {
repositories {
maven {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
url "https://maven.mozilla.org/maven2/"
mavenLocal()
mavenCentral()
@ -81,6 +82,7 @@ android {
'src/main/res/layouts/orbotLog',
'src/main/res/layouts/setting',
'src/main/res/layouts/bridge',
'src/main/res/layouts/log',
'src/main/res/layouts/alert',
'src/main/res/layouts/bookmark',
'src/main/res/layouts/shared',
@ -130,6 +132,7 @@ dependencies {
implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
// Testing-only dependencies
androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0') {
@ -174,6 +177,8 @@ dependencies {
/*Helper Libraries*/
implementation 'com.chauthai.overscroll:overscroll-bouncy:0.1.1'
androidTestImplementation "junit:junit:4.13.1"
implementation 'jp.wasabeef:recyclerview-animators:2.2.7'
compile 'com.android.support:design:24.0.0'
}
apply plugin: 'com.android.application'

View File

@ -76,6 +76,12 @@
android:launchMode="singleTop"
android:windowSoftInputMode="adjustResize" />
<activity
android:name="com.darkweb.genesissearchengine.appManager.settingManager.logManager.settingLogController"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustResize" />
<activity
android:name="com.darkweb.genesissearchengine.appManager.settingManager.advanceManager.settingAdvanceController"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"

View File

@ -3,7 +3,6 @@ package com.darkweb.genesissearchengine.appManager.bookmarkManager;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Handler;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
@ -14,6 +13,7 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.historyManager.historyEnums;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
@ -27,7 +27,7 @@ import java.util.Date;
import java.util.List;
import static android.content.Context.LAYOUT_INFLATER_SERVICE;
import static com.darkweb.genesissearchengine.constants.constants.HISTORY_LOAD_MORE;
import static com.darkweb.genesissearchengine.constants.constants.BOOKMARK_LOAD_MORE;
public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listViewHolder>
{
@ -43,7 +43,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
private ArrayList<Integer> mLongSelectedID = new ArrayList<>();
private AppCompatActivity mContext;
private bookmarkAdapterView mHistroyAdapterView;
private bookmarkAdapterView mBookmarkAdapterView;
private Context mListHolderContext;
private PopupWindow mPopupWindow = null;
private eventObserver.eventListener mEvent;
@ -52,7 +52,6 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
/*Local Variables*/
private float mRecyclerPositionX1, mRecyclerPositionX2;
private boolean mDisableCallable = false;
private boolean mSearchEnabled = false;
@ -61,7 +60,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
this.mCurrentList = new ArrayList<>();
this.mPassedList = pModelList;
this.mContext = pMainContext;
this.mHistroyAdapterView = new bookmarkAdapterView(mContext);
this.mBookmarkAdapterView = new bookmarkAdapterView(mContext);
initializeModelWithDate(false);
}
@ -69,14 +68,14 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
private void onLoading(){
mContext.runOnUiThread(() -> {
mCurrentList.add(new bookmarkRowModel(HISTORY_LOAD_MORE,null,-2));
mCurrentList.add(new bookmarkRowModel(BOOKMARK_LOAD_MORE,null,-2));
notifyItemInserted(mCurrentList.size());
});
}
private void onLoadingClear(){
for(int mCounter = 0; mCounter< mCurrentList.size(); mCounter++){
if(mCurrentList.get(mCounter).getHeader().equals(HISTORY_LOAD_MORE)){
if(mCurrentList.get(mCounter).getHeader().equals(BOOKMARK_LOAD_MORE)){
int finalM_counter = mCounter;
mContext.runOnUiThread(() -> {
mCurrentList.remove(finalM_counter);
@ -159,7 +158,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
public void onDeleteSelected(){
for(int m_counter = 0; m_counter< mLongSelectedIndex.size(); m_counter++){
for(int m_counter_inner = 0; m_counter_inner< mCurrentList.size(); m_counter_inner++){
if(mCurrentList.get(m_counter_inner).getDate() == mLongSelectedDate.get(m_counter) && mLongSelectedIndex.get(m_counter).equals("https://"+ mCurrentList.get(m_counter_inner).getDescription())){
if(mCurrentList.get(m_counter_inner).getDate() == mLongSelectedDate.get(m_counter) && mLongSelectedIndex.get(m_counter).equals(mCurrentList.get(m_counter_inner).getDescription())){
mEvent.invokeObserver(Collections.singletonList(mRealIndex.get(m_counter_inner)),enums.etype.url_clear);
mEvent.invokeObserver(Collections.singletonList(mLongSelectedID.get(m_counter)),enums.etype.url_clear_at);
invokeFilter(false);
@ -217,8 +216,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
}
@Override
public void onBindViewHolder(@NonNull bookmarkAdapter.listViewHolder holder, int position)
{
public void onBindViewHolder(@NonNull listViewHolder holder, int position) {
holder.bindListView(mCurrentList.get(position), position);
}
@ -239,7 +237,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
public void onSelectView(View pItemView, String pUrl, View pMenuItem, ImageView pLogoImage, boolean pIsForced, int pId, Date pDate){
if(!mSearchEnabled){
try {
mPopupWindow = (PopupWindow) mHistroyAdapterView.onTrigger(bookmarkEnums.eBookmarkViewAdapterCommands.M_SELECT_VIEW, Arrays.asList(pItemView, pMenuItem, pLogoImage, pIsForced, true));
mPopupWindow = (PopupWindow) mBookmarkAdapterView.onTrigger(bookmarkEnums.eBookmarkViewAdapterCommands.M_SELECT_VIEW, Arrays.asList(pItemView, pMenuItem, pLogoImage, pIsForced, true));
} catch (Exception e) {
e.printStackTrace();
}
@ -267,7 +265,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
public void onClearHighlight(View pItemView, String pUrl, View pMenuItem, ImageView pLogoImage, boolean pIsForced, int pId, Date pDate)
{
try {
mPopupWindow = (PopupWindow) mHistroyAdapterView.onTrigger(bookmarkEnums.eBookmarkViewAdapterCommands.M_CLEAR_HIGHLIGHT, Arrays.asList(pItemView, pMenuItem, pLogoImage, pIsForced));
mPopupWindow = (PopupWindow) mBookmarkAdapterView.onTrigger(bookmarkEnums.eBookmarkViewAdapterCommands.M_CLEAR_HIGHLIGHT, Arrays.asList(pItemView, pMenuItem, pLogoImage, pIsForced));
mLongSelectedDate.remove(pDate);
mLongSelectedIndex.remove(pUrl);
mLongSelectedID.remove((Integer) pId);
@ -280,19 +278,17 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
}
}
private float mPointerPosition = 0;
@SuppressLint("ClickableViewAccessibility")
public void onSwipe(View pItemView, int pPosition, String pUrl, View pMenuItem, ImageView pLogoImage, int pId, Date pDate){
public void onSwipe(View pItemView, String pUrl, View pMenuItem, ImageView pLogoImage, int pId, Date pDate){
Handler handler = new Handler();
Runnable mLongPressed = () -> {
if(!mDisableCallable && Math.abs(mRecyclerPositionX1-mPointerPosition) <= 20){
if(!mDisableCallable){
if(!mLongSelectedIndex.contains(pUrl) || !mLongSelectedID.contains(pId)) {
mLongPressedMenuActive = true;
onSelectView(pItemView, pUrl,pMenuItem, pLogoImage, false, pId, pDate);
}else {
Log.i("I AM HERE 22","I AM HERE");
onClearHighlight(pItemView, pUrl,pMenuItem, pLogoImage, false, pId, pDate);
mLongPressedMenuActive = true;
}
@ -304,33 +300,10 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
pItemView.setOnTouchListener((v, event) -> {
if (mRecyclerPositionX1!=0 && Math.abs(event.getX() - mRecyclerPositionX1) > 400 && !mLongPressedMenuActive) {
v.setPressed(false);
pItemView.clearFocus();
handler.removeCallbacks(mLongPressed);
pItemView.setOnTouchListener(null);
pItemView.clearFocus();
if(mPassedList.size()<=1){
mPassedList.clear();
initializeModelWithDate(false);
notifyItemRemoved(0);
notifyItemRangeChanged(0, 1);
mEvent.invokeObserver(Collections.singletonList(0),enums.etype.is_empty);
}else {
initializeModelWithDate(false);
bookmarkAdapter.this.onClose(pPosition);
}
return true;
}
mPointerPosition = event.getX();
if (event.getAction() == MotionEvent.ACTION_UP) {
mRecyclerPositionX2 = event.getX();
float deltaX = mRecyclerPositionX2 - mRecyclerPositionX1;
Log.i("FCK2","FCK2 : " + mLongSelectedIndex.size());
if (mLongSelectedIndex.size() > 0) {
if (Math.abs(deltaX) <= 20 && !mLongPressedMenuActive) {
if (!mLongPressedMenuActive) {
if (mLongSelectedIndex.contains(pUrl) && mLongSelectedID.contains(pId)) {
handler.removeCallbacks(mLongPressed);
bookmarkAdapter.this.onClearHighlight(pItemView, pUrl, pMenuItem, pLogoImage, false, pId, pDate);
@ -342,24 +315,15 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
return false;
}
if (Math.abs(deltaX) > 100) {
v.setPressed(false);
handler.removeCallbacks(mLongPressed);
bookmarkAdapter.this.onClose(pPosition);
} else {
v.setPressed(false);
handler.removeCallbacks(mLongPressed);
mEvent.invokeObserver(Collections.singletonList(pUrl), enums.etype.url_triggered);
}
v.setPressed(false);
handler.removeCallbacks(mLongPressed);
mEvent.invokeObserver(Collections.singletonList(pUrl), enums.etype.url_triggered);
return true;
} else if (event.getAction() == MotionEvent.ACTION_DOWN) {
mDisableCallable = false;
mLongPressedMenuActive = false;
v.setPressed(true);
mRecyclerPositionX1 = event.getX();
Log.i("1WOW : ","WOW : " + event.getX() + " -- " + mRecyclerPositionX1);
handler.postDelayed(mLongPressed, ViewConfiguration.getLongPressTimeout());
return true;
} else if (event.getAction() == MotionEvent.ACTION_CANCEL) {
@ -379,7 +343,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
void onOpenMenu(View pView, String pUrl, int pPosition, String pTitle){
LayoutInflater layoutInflater = (LayoutInflater) pView.getContext().getSystemService(LAYOUT_INFLATER_SERVICE);
@SuppressLint("InflateParams") final View mPopupView = layoutInflater.inflate(R.layout.recyclerview__row_menu, null);
mPopupWindow = (PopupWindow) mHistroyAdapterView.onTrigger(bookmarkEnums.eBookmarkViewAdapterCommands.M_OPEN_MENU, Arrays.asList(mPopupWindow, pView, mPopupView));
mPopupWindow = (PopupWindow) mBookmarkAdapterView.onTrigger(bookmarkEnums.eBookmarkViewAdapterCommands.M_OPEN_MENU, Arrays.asList(mPopupWindow, pView, mPopupView));
setPopupWindowEvents(mPopupView.findViewById(R.id.pMenuCopy), pUrl, pPosition, pTitle);
setPopupWindowEvents(mPopupView.findViewById(R.id.pMenuShare), pUrl, pPosition, pTitle);
@ -417,7 +381,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
private void setItemViewOnClickListener(View pItemView, View pItemMenu, String pUrl, int pPosition, String pTitle, View pMenuItem, ImageView pLogoImage, int pId, Date pDate)
{
pItemMenu.setOnClickListener((View v) -> onOpenMenu(v, pUrl, pPosition, pTitle));
onSwipe(pItemView, pPosition, pUrl,pMenuItem, pLogoImage, pId, pDate);
onSwipe(pItemView, pUrl,pMenuItem, pLogoImage, pId, pDate);
}
private void onClose(int pIndex){
@ -522,7 +486,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
mWebLogo.setText((helperMethod.getDomainName(model.getHeader()).toUpperCase().charAt(0)+""));
String header = model.getHeader();
mDescription.setText(("https://"+model.getDescription()));
mDescription.setText((model.getDescription()));
mHeader.setText(model.getHeader());
setItemViewOnClickListener(mRowContainer, mRowMenu, mDescription.getText().toString(), p_position, header, mRowMenu, mLogoImage, model.getID(), model.getDate());
@ -536,10 +500,10 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
mRowMenu.setClickable(true);
}
if(mLongSelectedIndex.contains("https://" + model.getDescription()) && mLongSelectedID.contains(model.getID())){
mPopupWindow = (PopupWindow) mHistroyAdapterView.onTrigger(bookmarkEnums.eBookmarkViewAdapterCommands.M_SELECT_VIEW, Arrays.asList(mRowContainer, mRowMenu, mLogoImage, true, false));
if(mLongSelectedIndex.contains(model.getDescription()) && mLongSelectedID.contains(model.getID())){
mPopupWindow = (PopupWindow) mBookmarkAdapterView.onTrigger(bookmarkEnums.eBookmarkViewAdapterCommands.M_SELECT_VIEW, Arrays.asList(mRowContainer, mRowMenu, mLogoImage, true, false));
}else if(mLogoImage.getAlpha()>0){
mPopupWindow = (PopupWindow) mHistroyAdapterView.onTrigger(bookmarkEnums.eBookmarkViewAdapterCommands.M_CLEAR_HIGHLIGHT, Arrays.asList(mRowContainer, mRowMenu, mLogoImage, true, false));
mPopupWindow = (PopupWindow) mBookmarkAdapterView.onTrigger(bookmarkEnums.eBookmarkViewAdapterCommands.M_CLEAR_HIGHLIGHT, Arrays.asList(mRowContainer, mRowMenu, mLogoImage, true, false));
}
}
}
@ -579,6 +543,9 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
else if(pCommands == bookmarkEnums.eBookmarkAdapterCommands.GET_LONG_SELECTED_URL){
return getLongSelectedleURL();
}
else if(pCommands == bookmarkEnums.eBookmarkAdapterCommands.GET_LONG_SELECTED_STATUS){
return isLongPressMenuActive();
}
return null;
}

View File

@ -1,6 +1,7 @@
package com.darkweb.genesissearchengine.appManager.bookmarkManager;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.text.Editable;
import android.text.TextWatcher;
@ -12,12 +13,15 @@ import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.databaseManager.databaseController;
import com.darkweb.genesissearchengine.appManager.historyManager.historyEnums;
import com.darkweb.genesissearchengine.appManager.homeManager.homeController;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.keys;
@ -35,7 +39,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import jp.wasabeef.recyclerview.animators.FadeInRightAnimator;
import static com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkEnums.eBookmarkViewCommands.M_VERTIFY_SELECTION_MENU;
@ -70,6 +74,7 @@ public class bookmarkController extends AppCompatActivity
initializeViews();
initializeList();
initCustomListeners();
initSwipe();
}
public void initializeListModel(){
@ -98,6 +103,12 @@ public class bookmarkController extends AppCompatActivity
mRecycleView.setNestedScrollingEnabled(false);
mRecycleView.setHasFixedSize(true);
mRecycleView.setItemAnimator(new FadeInRightAnimator());
Objects.requireNonNull(mRecycleView.getItemAnimator()).setAddDuration(200);
mRecycleView.getItemAnimator().setRemoveDuration(200);
mRecycleView.getItemAnimator().setMoveDuration(200);
mRecycleView.getItemAnimator().setChangeDuration(450);
mRecycleView.setAdapter(adapter);
mRecycleView.setItemViewCacheSize(100);
mRecycleView.setDrawingCacheEnabled(true);
@ -150,6 +161,29 @@ public class bookmarkController extends AppCompatActivity
});
}
private void initSwipe(){
ItemTouchHelper.SimpleCallback simpleItemTouchCallback = new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT) {
@Override
public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) {
return false;
}
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
int position = viewHolder.getAdapterPosition();
mbookmarkAdapter.onTrigger(bookmarkEnums.eBookmarkAdapterCommands.ON_CLOSE,Collections.singletonList(position));
}
@Override
public void onChildDraw(@NonNull Canvas c, @NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {
Canvas mCanvas = (Canvas) mbookmarkViewController.onTrigger(bookmarkEnums.eBookmarkViewCommands.ON_GENERATE_SWIPABLE_BACKGROUND, Arrays.asList(c, viewHolder, dX, actionState));
super.onChildDraw(mCanvas, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);
}
};
ItemTouchHelper itemTouchHelper = new ItemTouchHelper(simpleItemTouchCallback);
itemTouchHelper.attachToRecyclerView(mRecycleView);
}
/*View Custom Overrides*/
@Override
@ -198,7 +232,7 @@ public class bookmarkController extends AppCompatActivity
public void onBackPressed() {
if(mSearchInput.getVisibility() == View.VISIBLE){
onHideSearch(null);
}else if(mbookmarkAdapter.isLongPressMenuActive()){
}else if((Boolean) mbookmarkAdapter.onTrigger(bookmarkEnums.eBookmarkAdapterCommands.GET_LONG_SELECTED_STATUS,null)){
onClearMultipleSelection(null);
}else {
onBackPressed(null);
@ -262,7 +296,7 @@ public class bookmarkController extends AppCompatActivity
public class adapterCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
if(e_type.equals(enums.etype.url_triggered)){
String url_temp = helperMethod.completeURL(data.get(0).toString());

View File

@ -4,11 +4,11 @@ public class bookmarkEnums
{
/*History Manager*/
public enum eBookmarkViewCommands {
M_UPDATE_LIST_IF_EMPTY, M_UPDATE_LIST, M_REMOVE_FROM_LIST, M_CLEAR_LIST,M_VERTIFY_SELECTION_MENU, M_CLOSE_MENU, M_HIDE_SEARCH, M_LONG_PRESS_MENU
M_UPDATE_LIST_IF_EMPTY, M_UPDATE_LIST, M_REMOVE_FROM_LIST, M_CLEAR_LIST,M_VERTIFY_SELECTION_MENU, M_CLOSE_MENU, M_HIDE_SEARCH, M_LONG_PRESS_MENU, ON_GENERATE_SWIPABLE_BACKGROUND
}
public enum eBookmarkAdapterCommands {
M_ON_LOADING, M_LOADING_CLEAR, M_CLEAR_LONG_SELECTED_URL, GET_SELECTED_URL, GET_LONG_SELECTED_URL
M_ON_LOADING, M_LOADING_CLEAR, M_CLEAR_LONG_SELECTED_URL, GET_SELECTED_URL, GET_LONG_SELECTED_URL, GET_LONG_SELECTED_STATUS, ON_CLOSE
}
public enum eBookmarkViewAdapterCommands {

View File

@ -1,6 +1,11 @@
package com.darkweb.genesissearchengine.appManager.bookmarkManager;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.os.Build;
import android.view.View;
import android.view.Window;
@ -14,9 +19,8 @@ import android.widget.PopupWindow;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.example.myapplication.R;
@ -35,6 +39,8 @@ class bookmarkViewController
private ImageButton mMenuButton;
private ImageButton mSearchButton;
/*Private Local Variables*/
private Paint mPainter = new Paint();
private PopupWindow mPopupWindow = null;
/*Initializations*/
@ -183,6 +189,36 @@ class bookmarkViewController
mPopupWindow = helperMethod.onCreateMenu(pView, R.layout.recyclerview__menu);
}
private void onDrawSwipableBackground(Canvas pCanvas, RecyclerView.ViewHolder pViewHolder, float pDX, int pActionState) {
Bitmap icon;
if(pActionState == ItemTouchHelper.ANIMATION_TYPE_SWIPE_SUCCESS){
View itemView = pViewHolder.itemView;
itemView.animate().alpha(0f);
}
else if(pActionState == ItemTouchHelper.ACTION_STATE_SWIPE){
View itemView = pViewHolder.itemView;
float height = (float) itemView.getBottom() - (float) itemView.getTop();
float width = height / 3;
if(pDX > 0){
mPainter.setColor(ContextCompat.getColor(mContext, R.color.c_list_item_current));
RectF background = new RectF((float) itemView.getLeft(), (float) itemView.getTop(), pDX,(float) itemView.getBottom());
pCanvas.drawRect(background, mPainter);
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);
pCanvas.drawBitmap(icon,null,icon_dest, mPainter);
} else {
mPainter.setColor(ContextCompat.getColor(mContext, R.color.c_list_item_current));
RectF background = new RectF((float) itemView.getRight() + pDX, (float) itemView.getTop(),(float) itemView.getRight(), (float) itemView.getBottom());
pCanvas.drawRect(background, mPainter);
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);
pCanvas.drawBitmap(icon,null,icon_dest, mPainter);
}
}
}
public Object onTrigger(bookmarkEnums.eBookmarkViewCommands pCommands, List<Object> pData){
if(pCommands == bookmarkEnums.eBookmarkViewCommands.M_UPDATE_LIST_IF_EMPTY){
updateIfListEmpty((int)pData.get(0), (int)pData.get(1));
@ -207,6 +243,8 @@ class bookmarkViewController
}
else if(pCommands == bookmarkEnums.eBookmarkViewCommands.M_LONG_PRESS_MENU){
onLongPressMenu((View) pData.get(0));
}else if(pCommands.equals(bookmarkEnums.eBookmarkViewCommands.ON_GENERATE_SWIPABLE_BACKGROUND)){
onDrawSwipableBackground((Canvas)pData.get(0), (RecyclerView.ViewHolder)pData.get(1), (float)pData.get(2), (int)pData.get(3));
}
return null;
}

View File

@ -106,7 +106,7 @@ public class bridgeController extends AppCompatActivity {
public class bridgeModelCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}

View File

@ -42,10 +42,6 @@ public class databaseController
mDatabaseInstance = app_context.openOrCreateDatabase(constants.CONST_DATABASE_NAME, MODE_PRIVATE, null);
mDatabaseInstance.execSQL("CREATE TABLE IF NOT EXISTS " + "history" + " (id INT(4) PRIMARY KEY,date DATETIME,url VARCHAR,title VARCHAR);");
try {
mDatabaseInstance.execSQL("ALTER TABLE history ADD COLUMN title VARCHAR default ''");
} catch (SQLiteException ignored) {
}
mDatabaseInstance.execSQL("CREATE TABLE IF NOT EXISTS " + "bookmark" + " (id INT(4) PRIMARY KEY,title VARCHAR,url VARCHAR);");
}

View File

@ -3,7 +3,6 @@ package com.darkweb.genesissearchengine.appManager.historyManager;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Handler;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
@ -52,7 +51,6 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
/*Local Variables*/
private float mRecyclerPositionX1, mRecyclerPositionX2;
private boolean mDisableCallable = false;
private boolean mSearchEnabled = false;
@ -280,19 +278,17 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
}
}
private float mPointerPosition = 0;
@SuppressLint("ClickableViewAccessibility")
public void onSwipe(View pItemView, int pPosition, String pUrl, View pMenuItem, ImageView pLogoImage, int pId, Date pDate){
public void onSwipe(View pItemView, String pUrl, View pMenuItem, ImageView pLogoImage, int pId, Date pDate){
Handler handler = new Handler();
Runnable mLongPressed = () -> {
if(!mDisableCallable && Math.abs(mRecyclerPositionX1-mPointerPosition) <= 20){
if(!mDisableCallable){
if(!mLongSelectedIndex.contains(pUrl) || !mLongSelectedID.contains(pId)) {
mLongPressedMenuActive = true;
onSelectView(pItemView, pUrl,pMenuItem, pLogoImage, false, pId, pDate);
}else {
Log.i("I AM HERE 22","I AM HERE");
onClearHighlight(pItemView, pUrl,pMenuItem, pLogoImage, false, pId, pDate);
mLongPressedMenuActive = true;
}
@ -304,33 +300,10 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
pItemView.setOnTouchListener((v, event) -> {
if (mRecyclerPositionX1!=0 && Math.abs(event.getX() - mRecyclerPositionX1) > 400 && !mLongPressedMenuActive) {
v.setPressed(false);
pItemView.clearFocus();
handler.removeCallbacks(mLongPressed);
pItemView.setOnTouchListener(null);
pItemView.clearFocus();
if(mPassedList.size()<=1){
mPassedList.clear();
initializeModelWithDate(false);
notifyItemRemoved(0);
notifyItemRangeChanged(0, 1);
mEvent.invokeObserver(Collections.singletonList(0),enums.etype.is_empty);
}else {
initializeModelWithDate(false);
historyAdapter.this.onClose(pPosition);
}
return true;
}
mPointerPosition = event.getX();
if (event.getAction() == MotionEvent.ACTION_UP) {
mRecyclerPositionX2 = event.getX();
float deltaX = mRecyclerPositionX2 - mRecyclerPositionX1;
Log.i("FCK2","FCK2 : " + mLongSelectedIndex.size());
if (mLongSelectedIndex.size() > 0) {
if (Math.abs(deltaX) <= 20 && !mLongPressedMenuActive) {
if (!mLongPressedMenuActive) {
if (mLongSelectedIndex.contains(pUrl) && mLongSelectedID.contains(pId)) {
handler.removeCallbacks(mLongPressed);
historyAdapter.this.onClearHighlight(pItemView, pUrl, pMenuItem, pLogoImage, false, pId, pDate);
@ -342,24 +315,15 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
return false;
}
if (Math.abs(deltaX) > 100) {
v.setPressed(false);
handler.removeCallbacks(mLongPressed);
historyAdapter.this.onClose(pPosition);
} else {
v.setPressed(false);
handler.removeCallbacks(mLongPressed);
mEvent.invokeObserver(Collections.singletonList(pUrl), enums.etype.url_triggered);
}
v.setPressed(false);
handler.removeCallbacks(mLongPressed);
mEvent.invokeObserver(Collections.singletonList(pUrl), enums.etype.url_triggered);
return true;
} else if (event.getAction() == MotionEvent.ACTION_DOWN) {
mDisableCallable = false;
mLongPressedMenuActive = false;
v.setPressed(true);
mRecyclerPositionX1 = event.getX();
Log.i("1WOW : ","WOW : " + event.getX() + " -- " + mRecyclerPositionX1);
handler.postDelayed(mLongPressed, ViewConfiguration.getLongPressTimeout());
return true;
} else if (event.getAction() == MotionEvent.ACTION_CANCEL) {
@ -417,7 +381,7 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
private void setItemViewOnClickListener(View pItemView, View pItemMenu, String pUrl, int pPosition, String pTitle, View pMenuItem, ImageView pLogoImage, int pId, Date pDate)
{
pItemMenu.setOnClickListener((View v) -> onOpenMenu(v, pUrl, pPosition, pTitle));
onSwipe(pItemView, pPosition, pUrl,pMenuItem, pLogoImage, pId, pDate);
onSwipe(pItemView, pUrl,pMenuItem, pLogoImage, pId, pDate);
}
private void onClose(int pIndex){
@ -559,7 +523,7 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
}
}
public boolean isLongPressMenuActive(){
private boolean isLongPressMenuActive(){
return mLongSelectedIndex.size()>0;
}
@ -579,6 +543,12 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
else if(pCommands == historyEnums.eHistoryAdapterCommands.GET_LONG_SELECTED_URL){
return getLongSelectedleURL();
}
else if(pCommands == historyEnums.eHistoryAdapterCommands.GET_LONG_SELECTED_STATUS){
return isLongPressMenuActive();
}
else if(pCommands == historyEnums.eHistoryAdapterCommands.ON_CLOSE){
onClose((int)pData.get(0));
}
return null;
}

View File

@ -1,6 +1,7 @@
package com.darkweb.genesissearchengine.appManager.historyManager;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.text.Editable;
import android.text.TextWatcher;
@ -15,6 +16,7 @@ import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
@ -35,6 +37,8 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import jp.wasabeef.recyclerview.animators.FadeInRightAnimator;
import static com.darkweb.genesissearchengine.appManager.historyManager.historyEnums.eHistoryViewCommands.M_VERTIFY_SELECTION_MENU;
public class historyController extends AppCompatActivity
@ -69,6 +73,7 @@ public class historyController extends AppCompatActivity
initializeViews();
initializeList();
initCustomListeners();
initSwipe();
}
public void initializeListModel(){
@ -175,6 +180,30 @@ public class historyController extends AppCompatActivity
});
}
private void initSwipe(){
ItemTouchHelper.SimpleCallback simpleItemTouchCallback = new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT) {
@Override
public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) {
return false;
}
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
int position = viewHolder.getAdapterPosition();
mHistoryAdapter.onTrigger(historyEnums.eHistoryAdapterCommands.ON_CLOSE,Collections.singletonList(position));
}
@Override
public void onChildDraw(@NonNull Canvas c, @NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {
Canvas mCanvas = (Canvas) mHistoryViewController.onTrigger(historyEnums.eHistoryViewCommands.ON_GENERATE_SWIPABLE_BACKGROUND, Arrays.asList(c, viewHolder, dX, actionState));
super.onChildDraw(mCanvas, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);
}
};
ItemTouchHelper itemTouchHelper = new ItemTouchHelper(simpleItemTouchCallback);
itemTouchHelper.attachToRecyclerView(mRecycleView);
}
/*View Custom Overrides*/
@Override
@ -223,7 +252,7 @@ public class historyController extends AppCompatActivity
public void onBackPressed() {
if(mSearchInput.getVisibility() == View.VISIBLE){
onHideSearch(null);
}else if(mHistoryAdapter.isLongPressMenuActive()){
}else if((Boolean) mHistoryAdapter.onTrigger(historyEnums.eHistoryAdapterCommands.GET_LONG_SELECTED_STATUS,null)){
onClearMultipleSelection(null);
}else {
onBackPressed(null);
@ -308,7 +337,7 @@ public class historyController extends AppCompatActivity
public class adapterCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
if(e_type.equals(enums.etype.url_triggered)){
String url_temp = helperMethod.completeURL(data.get(0).toString());

View File

@ -4,11 +4,11 @@ public class historyEnums
{
/*History Manager*/
public enum eHistoryViewCommands {
M_UPDATE_LIST_IF_EMPTY, M_UPDATE_LIST, M_REMOVE_FROM_LIST, M_CLEAR_LIST,M_VERTIFY_SELECTION_MENU, M_CLOSE_MENU, M_HIDE_SEARCH, M_LONG_PRESS_MENU
M_UPDATE_LIST_IF_EMPTY, M_UPDATE_LIST, M_REMOVE_FROM_LIST, M_CLEAR_LIST,M_VERTIFY_SELECTION_MENU, M_CLOSE_MENU, M_HIDE_SEARCH, M_LONG_PRESS_MENU, ON_GENERATE_SWIPABLE_BACKGROUND
}
public enum eHistoryAdapterCommands {
M_ON_LOADING, M_LOADING_CLEAR, M_CLEAR_LONG_SELECTED_URL, GET_SELECTED_URL, GET_LONG_SELECTED_URL
M_ON_LOADING, M_LOADING_CLEAR, M_CLEAR_LONG_SELECTED_URL, GET_SELECTED_URL, GET_LONG_SELECTED_URL, GET_LONG_SELECTED_STATUS, ON_CLOSE
}
public enum eHistoryViewAdapterCommands {

View File

@ -1,6 +1,11 @@
package com.darkweb.genesissearchengine.appManager.historyManager;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.os.Build;
import android.view.View;
import android.view.Window;
@ -14,6 +19,7 @@ import android.widget.PopupWindow;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
@ -33,6 +39,9 @@ class historyViewController
private ImageButton mSearchButton;
private PopupWindow mPopupWindow = null;
/*Private Local Variables*/
private Paint mPainter = new Paint();
/*Initializations*/
historyViewController(ImageView pEmptyListNotification, EditText pSearchInput, RecyclerView pRecycleView, Button pClearButton,AppCompatActivity pContext,ImageButton pMenuButton,ImageButton pSearchButton)
@ -178,6 +187,36 @@ class historyViewController
mPopupWindow = helperMethod.onCreateMenu(pView, R.layout.recyclerview__menu);
}
private void onDrawSwipableBackground(Canvas pCanvas, RecyclerView.ViewHolder pViewHolder, float pDX, int pActionState) {
Bitmap icon;
if(pActionState == ItemTouchHelper.ANIMATION_TYPE_SWIPE_SUCCESS){
View itemView = pViewHolder.itemView;
itemView.animate().alpha(0f);
}
else if(pActionState == ItemTouchHelper.ACTION_STATE_SWIPE){
View itemView = pViewHolder.itemView;
float height = (float) itemView.getBottom() - (float) itemView.getTop();
float width = height / 3;
if(pDX > 0){
mPainter.setColor(ContextCompat.getColor(mContext, R.color.c_list_item_current));
RectF background = new RectF((float) itemView.getLeft(), (float) itemView.getTop(), pDX,(float) itemView.getBottom());
pCanvas.drawRect(background, mPainter);
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);
pCanvas.drawBitmap(icon,null,icon_dest, mPainter);
} else {
mPainter.setColor(ContextCompat.getColor(mContext, R.color.c_list_item_current));
RectF background = new RectF((float) itemView.getRight() + pDX, (float) itemView.getTop(),(float) itemView.getRight(), (float) itemView.getBottom());
pCanvas.drawRect(background, mPainter);
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);
pCanvas.drawBitmap(icon,null,icon_dest, mPainter);
}
}
}
public Object onTrigger(historyEnums.eHistoryViewCommands pCommands, List<Object> pData){
if(pCommands == historyEnums.eHistoryViewCommands.M_UPDATE_LIST_IF_EMPTY){
updateIfListEmpty((int)pData.get(0), (int)pData.get(1));
@ -202,6 +241,8 @@ class historyViewController
}
else if(pCommands == historyEnums.eHistoryViewCommands.M_LONG_PRESS_MENU){
onLongPressMenu((View) pData.get(0));
}else if(pCommands.equals(historyEnums.eHistoryViewCommands.ON_GENERATE_SWIPABLE_BACKGROUND)){
onDrawSwipableBackground((Canvas)pData.get(0), (RecyclerView.ViewHolder)pData.get(1), (float)pData.get(2), (int)pData.get(3));
}
return null;
}

View File

@ -5,10 +5,13 @@ import android.net.Uri;
import androidx.appcompat.app.AppCompatActivity;
import com.darkweb.genesissearchengine.constants.*;
import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import java.io.File;
import java.net.URI;
import java.util.Arrays;
import java.util.List;
import static com.darkweb.genesissearchengine.constants.enums.etype.on_handle_external_intent;
import static org.mozilla.geckoview.GeckoSessionSettings.USER_AGENT_MODE_MOBILE;
@ -146,6 +149,10 @@ class geckoClients
mSession.loadUri(url);
}
public void onRedrawPixel(){
mSession.onRedrawPixel();
}
void onClearSiteData(){
mRuntime.getStorageController().clearData(SITE_SETTINGS);
mRuntime.getStorageController().clearData(SITE_DATA);
@ -249,9 +256,9 @@ class geckoClients
public class geckoViewClientCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
if (mSessionID == (int)data.get(1) || e_type.equals(enums.etype.on_update_favicon) ||e_type.equals(enums.etype.on_update_history) || e_type.equals(enums.etype.on_request_completed) || e_type.equals(enums.etype.on_update_suggestion) || e_type.equals(enums.etype.on_update_suggestion_url))
if (mSessionID == (int)data.get(1) || e_type.equals(enums.etype.FINDER_RESULT_CALLBACK) || e_type.equals(enums.etype.ON_UPDATE_TAB_TITLE) || e_type.equals(enums.etype.on_update_favicon) ||e_type.equals(enums.etype.on_update_history) || e_type.equals(enums.etype.on_request_completed) || e_type.equals(enums.etype.on_update_suggestion) || e_type.equals(enums.etype.on_update_suggestion_url))
{
if (e_type.equals(on_handle_external_intent))
{

View File

@ -21,6 +21,8 @@ import android.util.Log;
import android.view.autofill.AutofillManager;
import android.view.autofill.AutofillValue;
import android.widget.Toast;
import org.mozilla.gecko.EventDispatcher;
import androidx.annotation.AnyThread;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
@ -30,6 +32,7 @@ import androidx.core.content.FileProvider;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.JavaScriptInterface;
import com.darkweb.genesissearchengine.helperManager.downloadFileService;
import com.darkweb.genesissearchengine.helperManager.errorHandler;
@ -41,18 +44,20 @@ import org.mozilla.geckoview.Autofill;
import org.mozilla.geckoview.GeckoResult;
import org.mozilla.geckoview.GeckoSession;
import org.mozilla.geckoview.GeckoView;
import org.mozilla.geckoview.SessionFinder;
import org.mozilla.geckoview.WebRequestError;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import static org.mozilla.geckoview.GeckoSessionSettings.USER_AGENT_MODE_DESKTOP;
import static org.mozilla.geckoview.GeckoSessionSettings.USER_AGENT_MODE_MOBILE;
public class geckoSession extends GeckoSession implements GeckoSession.PermissionDelegate,GeckoSession.ProgressDelegate, GeckoSession.HistoryDelegate,GeckoSession.NavigationDelegate,GeckoSession.ContentDelegate
public class geckoSession extends GeckoSession implements GeckoSession.ScrollDelegate,GeckoSession.PermissionDelegate,GeckoSession.ProgressDelegate, GeckoSession.HistoryDelegate,GeckoSession.NavigationDelegate,GeckoSession.ContentDelegate
{
private eventObserver.eventListener event;
@ -85,6 +90,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.Permissio
setContentDelegate(this);
setAutoFillDelegate();
setPermissionDelegate(this);
setScrollDelegate(this);
mDownloadManager = new geckoDownloadManager();
setPromptDelegate(new geckoPromptView(mContext));
this.event = event;
@ -110,6 +116,14 @@ public class geckoSession extends GeckoSession implements GeckoSession.Permissio
m_current_url_id = -1;
}
/*Scroll Delegate*/
@Override
public void onScrollChanged(GeckoSession session, int scrollX, int scrollY){
Log.i("SUPERMAN",scrollX + " - " + scrollY);
event.invokeObserver(Collections.singletonList(true), enums.etype.ON_UPDATE_TITLE_BAR);
}
/*Autofill Delegate*/
public void setAutoFillDelegate(){
@ -190,7 +204,9 @@ public class geckoSession extends GeckoSession implements GeckoSession.Permissio
@UiThread
public void onPageStop(@NonNull GeckoSession var1, boolean var2) {
if(var2){
event.invokeObserver(Arrays.asList("",mSessionID,mCurrentTitle, m_current_url_id), dataEnums.eTabCommands.M_UPDATE_PIXEL);
}
}
@Override
@ -206,12 +222,17 @@ public class geckoSession extends GeckoSession implements GeckoSession.Permissio
}
}
public void onRedrawPixel(){
event.invokeObserver(Arrays.asList("",mSessionID,mCurrentTitle, m_current_url_id), dataEnums.eTabCommands.M_UPDATE_PIXEL);
}
/*History Delegate*/
@Override
public GeckoResult<Boolean> onVisited(@NonNull GeckoSession var1, @NonNull String var2, @Nullable String var3, int var4) {
if(var4==3 || var4==5 || var4==1){
event.invokeObserver(Arrays.asList(var2,mSessionID), enums.etype.on_url_load);
m_current_url_id = (int)event.invokeObserver(Arrays.asList(var2,mSessionID,mCurrentTitle, m_current_url_id), enums.etype.on_update_history);
event.invokeObserver(Arrays.asList(var2,mSessionID,mCurrentTitle, m_current_url_id), dataEnums.eTabCommands.M_UPDATE_PIXEL);
isPageLoading = false;
}
return null;
@ -228,6 +249,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.Permissio
String newUrl = Objects.requireNonNull(var2).split("#")[0];
if(!mCurrentTitle.equals("loading")){
m_current_url_id = (int)event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id), enums.etype.on_update_history);
event.invokeObserver(Arrays.asList(var2,mSessionID,mCurrentTitle, m_current_url_id), dataEnums.eTabCommands.M_UPDATE_PIXEL);
}
mCurrentURL = newUrl;
@ -298,6 +320,8 @@ public class geckoSession extends GeckoSession implements GeckoSession.Permissio
if(var2!=null && !var2.equals(strings.GENERIC_EMPTY_STR) && var2.length()>2 && !var2.equals("about:blank")){
mCurrentTitle = var2;
m_current_url_id = (int)event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id), enums.etype.on_update_history);
event.invokeObserver(Arrays.asList(var2,mSessionID,mCurrentTitle, m_current_url_id), dataEnums.eTabCommands.M_UPDATE_PIXEL);
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle), enums.etype.ON_UPDATE_TAB_TITLE);
}
}
@ -526,6 +550,21 @@ public class geckoSession extends GeckoSession implements GeckoSession.Permissio
event.invokeObserver(Arrays.asList(null,mSessionID), enums.etype.on_close_sesson);
}
public void findInPage(String pQuery, int pDirection){
new Thread(){
public void run(){
try {
FinderResult mFinder = getFinder().find(pQuery, pDirection).poll(600);
if(mFinder!=null){
event.invokeObserver(Arrays.asList(mFinder.total, mFinder.current), enums.etype.FINDER_RESULT_CALLBACK);
}
} catch (Throwable throwable) {
throwable.printStackTrace();
}
}
}.start();
}
void goBackSession(){
if(mHistoryList!=null){

View File

@ -52,6 +52,7 @@ import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.example.myapplication.R;
import com.google.android.gms.ads.AdView;
import org.mozilla.geckoview.GeckoSession;
import org.mozilla.geckoview.GeckoView;
import org.torproject.android.service.util.Prefs;
import org.torproject.android.service.wrapper.LocaleHelper;
@ -91,6 +92,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
private ImageView mBackSplash;
private Button mConnectButton;
private Button mNewTab;
private View mFindBar;
private EditText mFindText;
private TextView mFindCount;
/*Redirection Objects*/
private boolean mPageClosed = false;
@ -103,7 +107,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
@Override
protected void onCreate(Bundle savedInstanceState)
{
pluginController.getInstance().preInitialize(this);
databaseController.getInstance().initialize(this);
dataController.getInstance().initialize(this);
@ -186,6 +189,13 @@ public class homeController extends AppCompatActivity implements ComponentCallba
status.sSettingFirstStart = false;
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_FIRST_INSTALLED,false));
}
if(status.sSettingIsAppStarted){
mHomeViewController.onPageFinished();
mSplashScreen.setAlpha(0);
onLoadURL(status.mCurrentReloadURL);
mHomeViewController.onProgressBarUpdate(100);
}
}
public void initializeAppModel()
@ -210,12 +220,15 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mBackSplash = findViewById(R.id.backsplash);
mConnectButton = findViewById(R.id.Connect);
mNewTab = findViewById(R.id.newButtonInvoke);
mFindBar = findViewById(R.id.pFindBar);
mFindText = findViewById(R.id.pFindText);
mFindCount = findViewById(R.id.pFindCount);
mGeckoView.setSaveEnabled(false);
mGeckoView.setSaveFromParentEnabled(false);
mGeckoClient = new geckoClients();
mHomeViewController.initialization(new homeViewCallback(),this,mNewTab, mWebViewContainer, mLoadingText, mProgressBar, mSearchbar, mSplashScreen, mLoadingIcon, mBannerAds,(ArrayList<historyRowModel>)dataController.getInstance().invokeSuggestion(dataEnums.eSuggestionCommands.M_GET_SUGGESTION, null), mGatewaySplash, mTopBar, mGeckoView, mBackSplash, mConnectButton);
mHomeViewController.initialization(new homeViewCallback(),this,mNewTab, mWebViewContainer, mLoadingText, mProgressBar, mSearchbar, mSplashScreen, mLoadingIcon, mBannerAds,(ArrayList<historyRowModel>)dataController.getInstance().invokeSuggestion(dataEnums.eSuggestionCommands.M_GET_SUGGESTION, null), mGatewaySplash, mTopBar, mGeckoView, mBackSplash, mConnectButton, mFindBar, mFindText, mFindCount);
}
public void onChangeTheme(){
@ -243,7 +256,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
public void initializeGeckoView(boolean isForced){
mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,isForced);
//mGeckoClient.loadURL("about:blank");
onSaveCurrentTab(mGeckoClient.getSession(),false);
mHomeViewController.initTab((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null));
}
@ -295,9 +307,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba
dataController.getInstance().invokeTab(dataEnums.eTabCommands.MOVE_TAB_TO_TOP, Collections.singletonList(mTempSession));
}
mGeckoView.releaseSession();
mGeckoClient.initSession(mTempSession);
mGeckoView.releaseSession();
mGeckoView.setSession(mTempSession);
mGeckoClient.onRedrawPixel();
mHomeViewController.onClearSelections(false);
mHomeViewController.onUpdateSearchBar(mTempSession.getCurrentURL(),false);
@ -306,6 +319,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}else {
mHomeViewController.progressBarReset();
}
mGeckoClient.onRedrawPixel();
}
/*-------------------------------------------------------USER EVENTS-------------------------------------------------------*/
@ -340,6 +354,27 @@ public class homeController extends AppCompatActivity implements ComponentCallba
registerReceiver(downloadStatus,new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
mFindText.addTextChangedListener(new TextWatcher() {
@Override
public void afterTextChanged(Editable s) {
}
@Override
public void beforeTextChanged(CharSequence s, int start,int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start,int before, int count) {
if(mFindText.getText().length()==0){
mGeckoClient.getSession().getFinder().clear();
mHomeViewController.onUpdateFindBarCount(0,0);
}else {
mGeckoClient.getSession().findInPage(mFindText.getText().toString(), GeckoSession.FINDER_FIND_MATCH_CASE & GeckoSession.FINDER_DISPLAY_HIGHLIGHT_ALL);
}
}
});
mSearchbar.setOnEditorActionListener((v, actionId, event) ->
{
if (actionId == EditorInfo.IME_ACTION_NEXT || actionId == EditorInfo.IME_ACTION_GO || actionId == EditorInfo.IME_ACTION_DONE)
@ -411,7 +446,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
void onSearchBarInvoked(View view){
String url = ((EditText)view).getText().toString();
String validated_url = mHomeModel.urlComplete(url);
String validated_url = mHomeModel.urlComplete(url, mHomeModel.getSearchEngine());
if(validated_url!=null){
url = validated_url;
}
@ -426,19 +461,24 @@ public class homeController extends AppCompatActivity implements ComponentCallba
onLoadURL(val);
}
public void applyTheme(){
status.mCurrentReloadURL = mSearchbar.getText().toString();
recreate();
}
public void onHomeButton(View view){
pluginController.getInstance().logEvent(strings.EVENT_HOME_INVOKED);
onLoadURL(mHomeModel.getSearchEngine());
onLoadURL(helperMethod.getDomainName(mHomeModel.getSearchEngine()));
mHomeViewController.onUpdateLogo();
}
public void onNewTab(boolean isKeyboardOpenedTemp, boolean isKeyboardOpened){
mGeckoClient.onRedrawPixel();
initializeGeckoView(true);
if(status.sOpenURLInNewTab){
onLoadURL(helperMethod.getDomainName(status.sSettingSearchStatus));
mHomeViewController. onUpdateSearchBar(helperMethod.getDomainName(status.sSettingSearchStatus),false);
}else {
mGeckoView.releaseSession();
onLoadURL("about:blank");
mHomeViewController. onUpdateSearchBar(strings.HOME_BLANK_PAGE,false);
}
@ -448,10 +488,15 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
public void onOpenTabViewBoundary(View view){
mGeckoClient.onRedrawPixel();
final Handler handler = new Handler();
mNewTab.setPressed(true);
isTabMenuOpened = true;
helperMethod.openActivity(tabController.class, constants.CONST_LIST_HISTORY, homeController.this,true);
overridePendingTransition(R.anim.popup_anim_in, R.anim.popup_anim_out);
handler.postDelayed(() ->
{
helperMethod.openActivity(tabController.class, constants.CONST_LIST_HISTORY, homeController.this,true);
overridePendingTransition(R.anim.popup_anim_in, R.anim.popup_anim_out);
}, 100);
}
public void onNotificationInvoked(String message,enums.etype e_type){
@ -459,7 +504,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
public void onOpenMenuItem(View view){
pluginController.getInstance().setLanguage(this);
pluginController.getInstance().setLanguage();
pluginController.getInstance().logEvent(strings.EVENT_MENU_INVOKED);
status.sSettingIsAppStarted = true;
pluginController.getInstance().onResetMessage();
@ -467,14 +512,17 @@ public class homeController extends AppCompatActivity implements ComponentCallba
pluginController.getInstance().onCreate(this);
mHomeViewController.onOpenMenu(view,mGeckoClient.canGoBack(),mGeckoClient.canGoForward(),!(mProgressBar.getAlpha()<=0 || mProgressBar.getVisibility() ==View.INVISIBLE),mGeckoClient.getUserAgent());
mHomeViewController.onOpenMenu(view,mGeckoClient.canGoBack(),!(mProgressBar.getAlpha()<=0 || mProgressBar.getVisibility() ==View.INVISIBLE),mGeckoClient.getUserAgent());
}
@Override
public void onBackPressed(){
pluginController.getInstance().logEvent(strings.EVENT_ON_BACK);
mSearchbar.clearFocus();
if(mGeckoClient.getFullScreenStatus()){
if(mFindBar.getVisibility() == View.VISIBLE){
mHomeViewController.onUpdateFindBar(false);
}
else if(mGeckoClient.getFullScreenStatus()){
mGeckoClient.onBackPressed(true);
mHomeViewController.onClearSelections(true);
}
@ -551,18 +599,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if(status.sSettingIsAppStarted){
onStartApplication(null);
}
super.onResume();
}
public void onAcquireDisplay(){
isTabMenuOpened = false;
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
if(model==null){
onLoadTab(model.getSession(),true);
}else {
mGeckoView.releaseSession();
mGeckoView.setSession(model.getSession());
if((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null)<=0){
onNewTab(false, false);
}
super.onResume();
}
@Override
@ -621,6 +662,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
public void onOpenLinkNewTab(String url){
mGeckoClient.onRedrawPixel();
initializeGeckoView(true);
mHomeViewController.progressBarReset();
mHomeViewController.onNewTab(false,isKeyboardOpened);
@ -659,10 +701,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.initTab((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null));
}
public void releaseSession(){
mGeckoView.releaseSession();
}
public void loadExistingTab(){
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
if (model != null)
@ -673,6 +711,21 @@ public class homeController extends AppCompatActivity implements ComponentCallba
/*-------------------------------------------------------CALLBACKS-------------------------------------------------------*/
public void onHideFindBar(View view){
mHomeViewController.onUpdateFindBar(false);
mGeckoClient.getSession().getFinder().clear();
}
public void onFindNext(View view){
mFindText.setText("0/0");
mGeckoClient.getSession().findInPage(mFindText.getText().toString(), GeckoSession.FINDER_FIND_MATCH_CASE & GeckoSession.FINDER_DISPLAY_HIGHLIGHT_ALL);
}
public void onFindPrev(View view){
mFindText.setText("0/0");
mGeckoClient.getSession().findInPage(mFindText.getText().toString(), GeckoSession.FINDER_FIND_BACKWARDS & GeckoSession.FINDER_DISPLAY_HIGHLIGHT_ALL);
}
public void onOpenDownloadFolder(View view){
helperMethod.openDownloadFolder(homeController.this);
}
@ -690,6 +743,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
else {
mSearchbar.clearFocus();
if (menuId == R.id.menu12) {
mHomeViewController.closeMenu();
helperMethod.hideKeyboard(this);
helperMethod.openActivity(orbotLogController.class, constants.CONST_LIST_HISTORY, homeController.this,true);
}
@ -736,6 +790,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
helperMethod.hideKeyboard(this);
helperMethod.shareApp(homeController.this);
}
else if (menuId == R.id.pMenuFind)
{
helperMethod.hideKeyboard(this);
mHomeViewController.onUpdateFindBar(true);
}
if (menuId == R.id.menu20) {
helperMethod.hideKeyboard(this);
mGeckoClient.onStop();
@ -770,13 +829,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
public void onOrbotLog(View view) {
mHomeViewController.closeMenu();
helperMethod.openActivity(orbotLogController.class, constants.CONST_LIST_HISTORY, homeController.this,true);
}
public class homeViewCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
if(e_type.equals(enums.etype.download_folder))
{
@ -819,14 +879,17 @@ public class homeController extends AppCompatActivity implements ComponentCallba
public class geckoViewCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
if(e_type.equals(enums.etype.progress_update)){
mHomeViewController.onProgressBarUpdate((int)data.get(0));
}
else if(e_type.equals(enums.etype.ON_UPDATE_TITLE_BAR)){
mHomeViewController.onUpdateTitleBar((boolean)data.get(0));
}
else if(e_type.equals(enums.etype.on_url_load)){
mHomeViewController.onUpdateSearchBar(dataToStr(data.get(0),mGeckoClient.getSession().getCurrentURL()),false);
}
}
else if(e_type.equals(enums.etype.back_list_empty)){
if((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null)>1){
if(!onCloseCurrentTab(mGeckoClient.getSession())){
@ -841,7 +904,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
else if(e_type.equals(enums.etype.on_update_history)){
if(activityContextManager.getInstance().getTabController()!=null && !activityContextManager.getInstance().getTabController().isDestroyed() && !activityContextManager.getInstance().getTabController().isFinishing()){
activityContextManager.getInstance().getTabController().onTabRowChanged((int)data.get(1));
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(data.get(1), mGeckoView.capturePixels()));
}
return dataController.getInstance().invokeHistory(dataEnums.eHistoryCommands.M_ADD_HISTORY ,data);
}
@ -876,7 +939,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
}
else if(e_type.equals(enums.etype.on_load_error)){
pluginController.getInstance().setLanguage(homeController.this);
pluginController.getInstance().setLanguage();
initLocalLanguage();
mHomeViewController.onPageFinished();
mHomeViewController.onUpdateSearchBar(dataToStr(data.get(0),mGeckoClient.getSession().getCurrentURL()),false);
@ -917,6 +980,21 @@ public class homeController extends AppCompatActivity implements ComponentCallba
else if(e_type.equals(enums.etype.on_update_suggestion_url)){
dataController.getInstance().invokeSuggestion(dataEnums.eSuggestionCommands.M_UPDATE_SUGGESTION, Arrays.asList(dataToStr(data.get(0)),dataToStr(data.get(2))));
}
else if(e_type.equals(enums.etype.ON_UPDATE_TAB_TITLE)){
if(activityContextManager.getInstance().getTabController()!=null && !activityContextManager.getInstance().getTabController().isDestroyed())
activityContextManager.getInstance().getTabController().onTabRowChanged((int)data.get(1));
}
else if(e_type.equals(dataEnums.eTabCommands.M_UPDATE_PIXEL)){
try{
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(data.get(1), mGeckoView.capturePixels()));
}catch (Exception ex){
}
}
else if(e_type.equals(enums.etype.FINDER_RESULT_CALLBACK)){
mHomeViewController.onUpdateFindBarCount((int)data.get(0),(int)data.get(1));
}
return null;
}
}

View File

@ -15,13 +15,13 @@ class homeModel
return status.sSettingSearchStatus;
}
String urlComplete(String url){
if(url.equals("about:config")){
return url;
String urlComplete(String pURL, String pSearchEngine){
if(pURL.equals("about:config")){
return pURL;
}else {
try
{
String updateUrl = helperMethod.completeURL(url);
String updateUrl = helperMethod.completeURL(pURL);
URL host = new URL(updateUrl);
boolean isUrlValid = Patterns.WEB_URL.matcher(updateUrl).matches();
if(isUrlValid && host.getHost().replace("www.","").contains("."))
@ -34,7 +34,7 @@ class homeModel
ex.printStackTrace();
}
return constants.CONST_BACKEND_GOOGLE_URL.replace("$s",url.replaceAll(" ","+"));
return pSearchEngine.replace("$s",pURL.replaceAll(" ","+"));
}
}

View File

@ -21,6 +21,8 @@ import android.view.ViewGroup;
import android.view.ViewOutlineProvider;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.DecelerateInterpolator;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
@ -73,12 +75,15 @@ class homeViewController
private Button mConnectButton;
private Button mNewTab;
private PopupWindow popupWindow = null;
private View mFindBar;
private EditText mFindText;
private TextView mFindCount;
/*Local Variables*/
private Callable<String> mLogs = null;
private boolean isLandscape = false;
void initialization(eventObserver.eventListener event, AppCompatActivity context, Button mNewTab, FrameLayout webviewContainer, TextView loadingText, com.darkweb.genesissearchengine.widget.AnimatedProgressBar progressBar, AutoCompleteTextView searchbar, ConstraintLayout splashScreen, ImageView loading, AdView banner_ads, ArrayList<historyRowModel> suggestions, ImageButton gateway_splash, LinearLayout top_bar, GeckoView gecko_view, ImageView backsplash, Button connect_button){
void initialization(eventObserver.eventListener event, AppCompatActivity context, Button mNewTab, FrameLayout webviewContainer, TextView loadingText, com.darkweb.genesissearchengine.widget.AnimatedProgressBar progressBar, AutoCompleteTextView searchbar, ConstraintLayout splashScreen, ImageView loading, AdView banner_ads, ArrayList<historyRowModel> suggestions, ImageButton gateway_splash, LinearLayout top_bar, GeckoView gecko_view, ImageView backsplash, Button connect_button, View pFindBar, EditText pFindText, TextView pFindCount){
this.mContext = context;
this.mProgressBar = progressBar;
this.mSearchbar = searchbar;
@ -95,12 +100,16 @@ class homeViewController
this.mConnectButton = connect_button;
this.mNewTab = mNewTab;
this.popupWindow = null;
this.mFindBar = pFindBar;
this.mFindText = pFindText;
this.mFindCount = pFindCount;
initSplashScreen();
initializeSuggestionView(suggestions);
initLock();
initSearchImage();
createUpdateUiHandler();
recreateStatusBar();
}
private void initSearchImage(){
@ -108,11 +117,6 @@ class homeViewController
void initTab(int count){
mNewTab.setText((count+strings.GENERIC_EMPTY_STR));
YoYo.with(Techniques.FlipInX)
.duration(450)
.repeat(0)
.playOn(mNewTab);
}
private void initPostUI(boolean isSplash){
@ -138,12 +142,34 @@ class homeViewController
}
}
public void recreateStatusBar(){
if(status.sSettingIsAppStarted){
Window window = mContext.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) {
window.setStatusBarColor(mContext.getResources().getColor(R.color.blue_dark));
}
else {
if(AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_NO){
mContext.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}else {
mContext.getWindow().setStatusBarColor(ContextCompat.getColor(mContext, R.color.black));
View decorView = mContext.getWindow().getDecorView();
decorView.setSystemUiVisibility(decorView.getSystemUiVisibility() & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}
mContext.getWindow().setStatusBarColor(ContextCompat.getColor(mContext, R.color.c_background));
}
}else {
onProgressBarUpdate(100);
}
}
@RequiresApi(api = Build.VERSION_CODES.M)
private void initStatusBarColor() {
animatedColor oneToTwo = new animatedColor(ContextCompat.getColor(mContext, R.color.landing_ease_blue), ContextCompat.getColor(mContext, R.color.landing_ease_blue_light_1));
animatedColor twoToThree = new animatedColor(ContextCompat.getColor(mContext, R.color.landing_ease_blue_light_1), ContextCompat.getColor(mContext, R.color.white));
animatedColor ThreeToFour = new animatedColor(ContextCompat.getColor(mContext, R.color.white), ContextCompat.getColor(mContext, R.color.white));
animatedColor oneToTwo = new animatedColor(ContextCompat.getColor(mContext, R.color.landing_ease_blue), ContextCompat.getColor(mContext, R.color.landing_ease_blue));
animatedColor twoToThree = new animatedColor(ContextCompat.getColor(mContext, R.color.landing_ease_blue), ContextCompat.getColor(mContext, R.color.c_background));
animatedColor ThreeToFour = new animatedColor(ContextCompat.getColor(mContext, R.color.c_background), ContextCompat.getColor(mContext, R.color.c_background));
ValueAnimator animator = ObjectAnimator.ofFloat(0f, 1f).setDuration(0);
animator.setStartDelay(600);
@ -164,6 +190,14 @@ class homeViewController
{
float v = (float) animation1.getAnimatedValue();
mContext.getWindow().setStatusBarColor(twoToThree.with(v));
if(AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_NO){
mContext.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}else {
mContext.getWindow().setStatusBarColor(ContextCompat.getColor(mContext, R.color.black));
View decorView = mContext.getWindow().getDecorView();
decorView.setSystemUiVisibility(decorView.getSystemUiVisibility() & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}
mContext.getWindow().setStatusBarColor(ContextCompat.getColor(mContext, R.color.c_background));
});
animator2.start();
@ -174,8 +208,6 @@ class homeViewController
animator3.addUpdateListener(animation1 ->
{
float v = (float) animation1.getAnimatedValue();
mContext.getWindow().setStatusBarColor(ThreeToFour.with(v));
});
animator3.start();
}
@ -188,7 +220,7 @@ class homeViewController
}
private void initLock(){
Drawable img = mContext.getResources().getDrawable( R.drawable.icon_lock);
@SuppressLint("UseCompatLoadingForDrawables") Drawable img = mContext.getResources().getDrawable( R.drawable.icon_lock);
mSearchbar.measure(0, 0);
img.setBounds( -10, (int)(mSearchbar.getMeasuredHeight()*0.00), (int)(mSearchbar.getMeasuredHeight()*1.10)-10, (int)(mSearchbar.getMeasuredHeight()*0.69) );
mSearchbar.setCompoundDrawables( img, null, null, null );
@ -246,7 +278,7 @@ class homeViewController
private void initSplashScreen(){
mSearchbar.setEnabled(false);
helperMethod.hideKeyboard(mContext);
initPostUI(true);
//initPostUI(true);
mBackSplash.getLayoutParams().height = helperMethod.getScreenHeight(mContext) - helperMethod.getStatusBarHeight(mContext)*2;
mSearchbar.setEnabled(false);
@ -301,7 +333,9 @@ class homeViewController
if(mSplashScreen.getAlpha()>=1)
{
mSplashScreen.animate().setDuration(300).setStartDelay(500).alpha(0).withEndAction((this::triggerPostUI));
initPostUI(false);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
initStatusBarColor();
}
}
}
@ -315,7 +349,7 @@ class homeViewController
/*-------------------------------------------------------Helper Methods-------------------------------------------------------*/
void onOpenMenu(View view,boolean canGoForward,boolean canGoBack,boolean isLoading,int userAgent){
void onOpenMenu(View view, boolean canGoBack, boolean isLoading, int userAgent){
if(popupWindow!=null){
popupWindow.dismiss();
@ -324,7 +358,7 @@ class homeViewController
LayoutInflater layoutInflater
= (LayoutInflater) mContext
.getSystemService(LAYOUT_INFLATER_SERVICE);
final View popupView = layoutInflater.inflate(R.layout.popup_menu, null);
@SuppressLint("InflateParams") final View popupView = layoutInflater.inflate(R.layout.popup_menu, null);
int height = helperMethod.getScreenHeight(mContext)*90 /100;
@ -375,7 +409,7 @@ class homeViewController
= (LayoutInflater) mContext
.getSystemService(LAYOUT_INFLATER_SERVICE);
assert layoutInflater != null;
final View popupView = layoutInflater.inflate(R.layout.notification_menu, null);
@SuppressLint("InflateParams") final View popupView = layoutInflater.inflate(R.layout.notification_menu, null);
popupWindow = new PopupWindow(
popupView,
ActionMenuView.LayoutParams.MATCH_PARENT,
@ -454,6 +488,35 @@ class homeViewController
}, delay);
}
public void onUpdateFindBarCount(int index, int total)
{
if(total==0){
mFindCount.setText(strings.GENERIC_EMPTY_STR);
}else {
mFindCount.setText((total + "/" + index));
}
}
public void onUpdateFindBar(boolean pStatus)
{
mFindBar.animate().cancel();
if(pStatus){
mFindBar.setVisibility(View.VISIBLE);
mFindBar.setAlpha(1);
mFindBar.startAnimation(AnimationUtils.loadAnimation(mContext, R.anim.popup_anim_in));
mFindText.requestFocus();
InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
}else {
mFindText.clearFocus();
mFindCount.setText(strings.GENERIC_EMPTY_STR);
mFindBar.startAnimation(AnimationUtils.loadAnimation(mContext, R.anim.popup_anim_out));
helperMethod.hideKeyboard(mContext);
mFindBar.animate().alpha(0).withEndAction(() -> mFindBar.setVisibility(View.GONE));
mFindText.setText(strings.GENERIC_EMPTY_STR);
}
}
private void triggerUpdateSearchBar(String url, boolean showProtocol){
if (mSearchbar == null || url==null)
{
@ -514,6 +577,8 @@ class homeViewController
mSearchbar.selectAll();
}
}
Handler mProgressHandler = new Handler();
Runnable mProgressBarRunnable = null;
void onUpdateLogs(String log){
mLoadingText.setText(log);
}
@ -522,16 +587,32 @@ class homeViewController
mProgressBar.setVisibility(View.INVISIBLE);
}
void onProgressBarUpdate(int value){
if(mProgressBarRunnable!=null){
mProgressHandler.removeCallbacks(mProgressBarRunnable);
}
if(mSplashScreen.getAlpha()>0){
mProgressBar.setProgress(value*100);
}
if(value==100){
mProgressBar.setAlpha(1f);
mProgressBar.animate().setStartDelay(200).alpha(0);
setProgressAnimate(mProgressBar,value);
mProgressBarRunnable = () -> {
animation.removeAllListeners();
animation.end();
animation.cancel();
mProgressBar.animate().cancel();
mProgressBar.animate().alpha(0);
};
mProgressHandler.postDelayed(mProgressBarRunnable, 250);
return;
}
else if(mSplashScreen.getAlpha()==0) {
mProgressBar.setVisibility(View.VISIBLE);
mProgressBar.animate().cancel();
mProgressBar.animate().setStartDelay(50).alpha(1);
}
setProgressAnimate(mProgressBar,value);
@ -554,9 +635,14 @@ class homeViewController
animation = ObjectAnimator.ofInt(pb, "progress", pb.getProgress(), progressTo * 100);
animation.setDuration(progress);
animation.setInterpolator(new DecelerateInterpolator());
animation.setAutoCancel(true);
animation.start();
}
void onUpdateTitleBar(boolean pStatus){
}
void onClearSelections(boolean hideKeyboard){
mSearchbar.clearFocus();
if(hideKeyboard){

View File

@ -48,7 +48,7 @@ public class languageController extends AppCompatActivity {
public class languageViewCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
@ -58,7 +58,7 @@ public class languageController extends AppCompatActivity {
public void changeLanguage(Locale language){
status.sSettingLanguage = language.getLanguage();
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.SETTING_LANGUAGE,language.getLanguage()));
pluginController.getInstance().setLanguage(this);
pluginController.getInstance().setLanguage();
}
/*-------------------------------------------------------CALLBACKS-------------------------------------------------------*/

View File

@ -0,0 +1,83 @@
package com.darkweb.genesissearchengine.appManager.orbotLogManager;
import android.app.SearchManager;
import android.content.Intent;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.tabManager.tabEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.example.myapplication.R;
import org.torproject.android.service.wrapper.logRowModel;
import java.util.ArrayList;
import java.util.List;
public class orbotAdapter extends RecyclerView.Adapter<orbotAdapter.listViewHolder>
{
/*Private Variables*/
private ArrayList<logRowModel> mModelList;
private eventObserver.eventListener mEvent;
orbotAdapter(ArrayList<logRowModel> model_list, eventObserver.eventListener event) {
this.mModelList = model_list;
this.mEvent = event;
}
@NonNull @Override
public orbotAdapter.listViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.orbotview_row, parent, false);
return new orbotAdapter.listViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull orbotAdapter.listViewHolder holder, int position)
{
holder.bindListView(mModelList.get(position));
}
@Override
public int getItemCount() {
return mModelList.size();
}
/*View Holder Extensions*/
class listViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
TextView mHeader;
TextView mDescription;
ConstraintLayout mRowContainerInner;
listViewHolder(View itemView) {
super(itemView);
}
void bindListView(logRowModel model) {
mHeader = itemView.findViewById(R.id.pHeader);
mDescription = itemView.findViewById(R.id.pDescription);
mRowContainerInner = itemView.findViewById(R.id.pRowContainerInner);
mHeader.setText((mModelList.size() - this.getLayoutPosition() + ". " + model.getLog()));
mDescription.setText(model.getDate());
mRowContainerInner.setOnClickListener(this);
}
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://google.com/search?q=tor logs " + mHeader.getText()));
intent.putExtra(SearchManager.QUERY, mDescription.getText());
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
activityContextManager.getInstance().getHomeController().startActivity(intent);
}
}
public Object onTrigger(tabEnums.eTabModelCommands pCommands, List<Object> pData){
return null;
}
}

View File

@ -2,49 +2,116 @@ package com.darkweb.genesissearchengine.appManager.orbotLogManager;
import android.os.Bundle;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.animation.AnimationUtils;
import android.view.animation.LayoutAnimationController;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.widget.NestedScrollView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.settingManager.logManager.settingLogController;
import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.example.myapplication.R;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import org.torproject.android.service.wrapper.orbotLocalConstants;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import jp.wasabeef.recyclerview.animators.FadeInDownAnimator;
import jp.wasabeef.recyclerview.animators.FadeInRightAnimator;
import jp.wasabeef.recyclerview.animators.FadeInUpAnimator;
import static android.widget.NumberPicker.OnScrollListener.SCROLL_STATE_IDLE;
public class orbotLogController extends AppCompatActivity {
/* PRIVATE VARIABLES */
private orbotLogModel mOrbotModel;
private orbotLogViewController mOrbotViewController;
private RecyclerView mRecycleView;
private orbotAdapter mOrbotAdapter;
private NestedScrollView mMainScroll;
private FloatingActionButton mFloatingScroller;
private TextView mLogs;
private int mLogCounter=0;
private boolean mActivityClosed = false;
int mLogCounter = 0;
/* INITIALIZATIONS */
@Override
protected void onCreate(Bundle savedInstanceState) {
pluginController.getInstance().onCreate(this);
super.onCreate(savedInstanceState);
setContentView(R.layout.orbot_log_view);
viewsInitializations();
onUpdateLogs();
initializeLogs();
onScrollListener();
}
public void viewsInitializations() {
mRecycleView = findViewById(R.id.pLogRecycleView);
mLogs = findViewById(R.id.pLogs);
mMainScroll = findViewById(R.id.mMainScroll);
mFloatingScroller = findViewById(R.id.pFloatingScroller);
activityContextManager.getInstance().setOrbotLogController(this);
mOrbotViewController = new orbotLogViewController(this, mLogs);
mOrbotModel = new orbotLogModel(new orbotModelCallback());
mOrbotViewController = new orbotLogViewController(this, mLogs, mRecycleView);
mOrbotModel = new orbotLogModel();
}
public void initializeLogs(){
mLogCounter = 0;
if(status.sLogListView){
mLogCounter = orbotLocalConstants.mTorLogsHistory.size();
mOrbotModel.setList(orbotLocalConstants.mTorLogsHistory);
LinearLayoutManager layoutManager = new LinearLayoutManager(orbotLogController.this);
orbotAdapter adapter = new orbotAdapter(mOrbotModel.getList(),new orbotLogController.orbotModelCallback());
mOrbotAdapter = adapter;
layoutManager.setReverseLayout(true);
LayoutAnimationController controller = AnimationUtils.loadLayoutAnimation(this, R.anim.log_layout_controller);
mRecycleView.setLayoutAnimation(controller);
mRecycleView.setAdapter(adapter);
mRecycleView.setItemViewCacheSize(100);
mRecycleView.setNestedScrollingEnabled(false);
mRecycleView.setItemViewCacheSize(100);
mRecycleView.setDrawingCacheEnabled(true);
mRecycleView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
mRecycleView.setLayoutManager(new LinearLayoutManager(orbotLogController.this));
mOrbotAdapter.notifyDataSetChanged();
}
mOrbotViewController.onTrigger(orbotLogEnums.eOrbotLogViewCommands.M_INIT_VIEWS, null);
mRecycleView.smoothScrollToPosition(mOrbotModel.getList().size());
}
/* LISTENERS */
private void onScrollListener(){
mMainScroll.getViewTreeObserver().addOnScrollChangedListener(() -> {
int scrollY = mMainScroll.getScrollY();
if(scrollY>0){
if(mFloatingScroller.getAlpha()==0){
mFloatingScroller.setVisibility(View.VISIBLE);
mFloatingScroller.animate().alpha(1);
}
}else {
mFloatingScroller.animate().cancel();
mFloatingScroller.animate().alpha(0).withEndAction(() -> mFloatingScroller.setVisibility(View.GONE));
}
});
}
public void onUpdateLogs(){
new Thread(){
public void run(){
@ -54,15 +121,25 @@ public class orbotLogController extends AppCompatActivity {
break;
}
if(orbotLocalConstants.mTorLogsHistory.size()>mLogCounter){
sleep(0);
if(!status.sLogListView){
sleep(0);
}else {
sleep(500);
}
}else {
sleep(400);
sleep(500);
}
if(orbotLocalConstants.mTorLogsHistory.size()>0){
runOnUiThread(() -> {
if(orbotLocalConstants.mTorLogsHistory.size()>mLogCounter){
mOrbotViewController.onTrigger(orbotLogEnums.eOrbotLogViewCommands.M_UPDATE_LOGS, Collections.singletonList(orbotLocalConstants.mTorLogsHistory.get(mLogCounter)));
mOrbotModel.getList().add(0,orbotLocalConstants.mTorLogsHistory.get(mLogCounter));
if(!status.sLogListView){
mOrbotViewController.onTrigger(orbotLogEnums.eOrbotLogViewCommands.M_UPDATE_LOGS, Collections.singletonList(orbotLocalConstants.mTorLogsHistory.get(mLogCounter).getLog()));
}else {
mOrbotAdapter.notifyItemInserted(0);
mOrbotAdapter.notifyItemChanged(0);
}
mLogCounter+=1;
}
});
@ -75,9 +152,13 @@ public class orbotLogController extends AppCompatActivity {
}.start();
}
public void onScrollTop(View view) {
mMainScroll.smoothScrollTo(0,0);
}
public class orbotModelCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}
@ -104,8 +185,15 @@ public class orbotLogController extends AppCompatActivity {
mActivityClosed = true;
}
/* Helper Methods */
public void openLogSettings(View view) {
helperMethod.openActivity(settingLogController.class, constants.CONST_LIST_HISTORY, this,true);
}
public void onClose(View view){
finish();
mActivityClosed = true;
}
}

View File

@ -4,7 +4,7 @@ public class orbotLogEnums
{
/*Settings Manager*/
public enum eOrbotLogViewCommands {
M_UPDATE_LOGS
M_UPDATE_LOGS, M_INIT_VIEWS
}
public enum eOrbotLogModelCommands {

View File

@ -1,30 +1,33 @@
package com.darkweb.genesissearchengine.appManager.orbotLogManager;
import com.darkweb.genesissearchengine.constants.keys;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import java.util.Arrays;
import java.util.List;
import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import org.torproject.android.service.wrapper.logRowModel;
import java.util.ArrayList;
import java.util.Collections;
class orbotLogModel
{
/*Variable Declaration*/
/*Private Variables*/
private eventObserver.eventListener mEvent;
/*Initializations*/
orbotLogModel(eventObserver.eventListener mEvent){
this.mEvent = mEvent;
}
private ArrayList<logRowModel> mModelList = new ArrayList<>();
/*Helper Methods*/
public void onTrigger(orbotLogEnums.eOrbotLogModelCommands pCommands, List<Object> pData){
void setList(ArrayList<logRowModel> model)
{
if(model.size()>0){
mModelList.clear();
mModelList.addAll(model);
Collections.reverse(mModelList);
}
else {
mModelList.add(0, new logRowModel(constants.LOGS_DEFAULT_MESSAGE, helperMethod.getCurrentTime()));
}
}
ArrayList<logRowModel> getList()
{
return mModelList;
}
}

View File

@ -1,6 +1,9 @@
package com.darkweb.genesissearchengine.appManager.orbotLogManager;
import android.annotation.SuppressLint;
import android.os.Build;
import android.text.Spannable;
import android.text.TextUtils;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
@ -10,7 +13,9 @@ import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.example.myapplication.R;
import com.google.android.material.switchmaterial.SwitchMaterial;
@ -22,17 +27,30 @@ class orbotLogViewController
private AppCompatActivity mContext;
private TextView mLogs;
private RecyclerView mRecycleView;
/*Initializations*/
orbotLogViewController(AppCompatActivity pContext, TextView pLogs)
orbotLogViewController(AppCompatActivity pContext, TextView pLogs, RecyclerView pRecycleView)
{
this.mContext = pContext;
this.mLogs = pLogs;
this.mRecycleView = pRecycleView;
initViews();
initPostUI();
}
private void initViews(){
if(status.sLogListView){
mRecycleView.setVisibility(View.VISIBLE);
mLogs.setVisibility(View.GONE);
}else {
mRecycleView.setVisibility(View.GONE);
mLogs.setVisibility(View.VISIBLE);
}
}
private void initPostUI(){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = mContext.getWindow();
@ -52,13 +70,16 @@ class orbotLogViewController
private void onUpdateLogs(String pLogs){
mLogs.append("\n\n~ " + (pLogs));
pLogs = "~ " + pLogs;
mLogs.setText(String.format("%s%s", pLogs + "\n\n", mLogs.getText()));
}
public void onTrigger(orbotLogEnums.eOrbotLogViewCommands pCommands, List<Object> pData){
if(pCommands.equals(orbotLogEnums.eOrbotLogViewCommands.M_UPDATE_LOGS)){
onUpdateLogs((String) pData.get(0));
}
else if(pCommands.equals(orbotLogEnums.eOrbotLogViewCommands.M_INIT_VIEWS)){
initViews();
}
}
}

View File

@ -7,7 +7,6 @@ import androidx.appcompat.app.AppCompatActivity;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.bridgeManager.bridgeController;
import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
@ -53,7 +52,7 @@ public class orbotController extends AppCompatActivity {
public class orbotModelCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}

View File

@ -56,7 +56,7 @@ public class settingAccessibilityController extends AppCompatActivity {
public class settingAccessibilityViewCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}
@ -66,7 +66,7 @@ public class settingAccessibilityController extends AppCompatActivity {
public class settingAccessibilityModelCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}

View File

@ -5,7 +5,6 @@ import android.view.View;
import android.widget.RadioButton;
import androidx.appcompat.app.AppCompatActivity;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.example.myapplication.R;
@ -49,7 +48,7 @@ public class settingAdvanceController extends AppCompatActivity {
public class settingAdvanceViewCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}
@ -59,7 +58,7 @@ public class settingAdvanceController extends AppCompatActivity {
public class settingAdvanceModelCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}

View File

@ -120,6 +120,4 @@ class settingAdvanceViewController
return null;
}
}

View File

@ -56,7 +56,7 @@ public class settingClearController extends AppCompatActivity {
public class settingClearViewCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}
@ -66,7 +66,7 @@ public class settingClearController extends AppCompatActivity {
public class settingClearModelCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}

View File

@ -1,6 +1,5 @@
package com.darkweb.genesissearchengine.appManager.settingManager.generalManager;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
@ -76,14 +75,15 @@ public class settingGeneralController extends AppCompatActivity {
public class settingGeneralViewCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
if(enums.etype.M_RESET_THEME_INVOKED_BACK.equals(e_type))
if(settingGeneralEnums.eGeneralViewCallback.M_RESET_THEME_INVOKED_BACK.equals(e_type))
{
helperMethod.restartActivity(getIntent(), settingGeneralController.this);
new Handler().postDelayed(() -> {
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
activityContextManager.getInstance().getSettingController().applyTheme();
activityContextManager.getInstance().getHomeController().applyTheme();
}, 150);
}
return null;
@ -94,7 +94,7 @@ public class settingGeneralController extends AppCompatActivity {
public class settingGeneralModelCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}

View File

@ -11,4 +11,7 @@ class settingGeneralEnums
M_SET_THEME, M_RESET_THEME, M_UPDATE_THEME_BLOCKER
}
public enum eGeneralViewCallback {
M_RESET_THEME_INVOKED_BACK
}
}

View File

@ -19,6 +19,8 @@ import com.google.android.material.switchmaterial.SwitchMaterial;
import java.util.Collections;
import java.util.List;
import static com.darkweb.genesissearchengine.appManager.settingManager.generalManager.settingGeneralEnums.eGeneralViewCallback.M_RESET_THEME_INVOKED_BACK;
class settingGeneralViewController
{
/*Private Variables*/
@ -95,11 +97,11 @@ class settingGeneralViewController
mOpenURLInNewTab.setChecked(false);
}
mHomePageText.setText(helperMethod.getDomainName(status.sSettingSearchStatus));
mHomePageText.setText(helperMethod.getDomainName(status.sSettingSearchStatus.replace("boogle.store","genesis.onion")));
}
private void updateThemeChanger(int pStatus){
mEvent.invokeObserver(Collections.singletonList(status.sTheme), enums.etype.M_RESET_THEME_INVOKED_BACK);
private void updateThemeChanger(){
mEvent.invokeObserver(Collections.singletonList(status.sTheme), M_RESET_THEME_INVOKED_BACK);
}
private void resetThemeSelection(){
@ -132,7 +134,7 @@ class settingGeneralViewController
resetThemeSelection();
}
else if(pCommands.equals(settingGeneralEnums.eGeneralViewController.M_UPDATE_THEME_BLOCKER)){
updateThemeChanger((int)pData.get(0));
updateThemeChanger();
}
return null;
}

View File

@ -0,0 +1,88 @@
package com.darkweb.genesissearchengine.appManager.settingManager.logManager;
import android.os.Bundle;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.example.myapplication.R;
import com.google.android.material.switchmaterial.SwitchMaterial;
import java.util.Collections;
import java.util.List;
public class settingLogController extends AppCompatActivity {
/* PRIVATE VARIABLES */
private SwitchMaterial mListView;
private settingLogModel mSettingLogModel;
private settingLogViewController mSettingLogViewController;
@Override
protected void onCreate(Bundle savedInstanceState) {
pluginController.getInstance().onCreate(this);
super.onCreate(savedInstanceState);
setContentView(R.layout.setting_log_view);
viewsInitializations();
}
public void viewsInitializations() {
mListView = findViewById(R.id.pListView);
mSettingLogViewController = new settingLogViewController(this, new settingLogViewCallback(), mListView);
mSettingLogModel = new settingLogModel(new settingLogModelCallback());
}
/* LISTENERS */
public class settingLogViewCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}
}
public class settingLogModelCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}
}
/* LOCAL OVERRIDES */
@Override
public void onResume()
{
activityContextManager.getInstance().setCurrentActivity(this);
super.onResume();
}
@Override
public void onPause()
{
super.onPause();
}
@Override
public void onBackPressed() {
finish();
}
/*UI Redirection*/
public void onClose(View view){
finish();
}
public void onSwitchLogUIMode(View view){
mSettingLogModel.onTrigger(settingLogEnums.eLogModel.M_SWITCH_LOG_VIEW, Collections.singletonList(!mListView.isChecked()));
mListView.toggle();
activityContextManager.getInstance().getOrbotLogController().initializeLogs();
}
}

View File

@ -0,0 +1,14 @@
package com.darkweb.genesissearchengine.appManager.settingManager.logManager;
class settingLogEnums
{
/*History Manager*/
public enum eLogModel {
M_SWITCH_LOG_VIEW
}
public enum eLogViewController {
}
}

View File

@ -0,0 +1,38 @@
package com.darkweb.genesissearchengine.appManager.settingManager.logManager;
import com.darkweb.genesissearchengine.constants.keys;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import java.util.Arrays;
import java.util.List;
class settingLogModel
{
/*Variable Declaration*/
private eventObserver.eventListener mEvent;
/*Initializations*/
settingLogModel(eventObserver.eventListener mEvent){
this.mEvent = mEvent;
}
public void onUpdateLogView(boolean pIsListView){
status.sLogListView = pIsListView;
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_LIST_VIEW, pIsListView));
}
/*Helper Methods*/
public Object onTrigger(settingLogEnums.eLogModel pCommands, List<Object> pData){
if(settingLogEnums.eLogModel.M_SWITCH_LOG_VIEW.equals(pCommands)){
onUpdateLogView((boolean)pData.get(0));
}
return null;
}
}

View File

@ -0,0 +1,63 @@
package com.darkweb.genesissearchengine.appManager.settingManager.logManager;
import android.os.Build;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.content.ContextCompat;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.example.myapplication.R;
import com.google.android.material.switchmaterial.SwitchMaterial;
class settingLogViewController
{
/*Private Variables*/
private eventObserver.eventListener mEvent;
private AppCompatActivity mContext;
private SwitchMaterial mLogUI;
/*Initializations*/
settingLogViewController(settingLogController pContext, eventObserver.eventListener pEvent, SwitchMaterial pLogManual)
{
this.mLogUI = pLogManual;
this.mEvent = pEvent;
this.mContext = pContext;
initViews();
initPostUI();
}
private void initViews()
{
if(status.sLogListView){
mLogUI.setChecked(true);
}else {
mLogUI.setChecked(false);
}
}
private void initPostUI(){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = mContext.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) {
window.setStatusBarColor(mContext.getResources().getColor(R.color.blue_dark));
}
else {
if(AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_NO){
mContext.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}
mContext.getWindow().setStatusBarColor(ContextCompat.getColor(mContext, R.color.c_background));
}
}
}
}

View File

@ -40,7 +40,7 @@ public class settingNotificationController extends AppCompatActivity {
public class settingNotificationViewCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}
@ -50,7 +50,7 @@ public class settingNotificationController extends AppCompatActivity {
public class settingNotificationModelCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}

View File

@ -28,7 +28,6 @@ class settingNotificationModel
int mStatus = pStatus ? 1 : 0;
status.sBridgeNotificationManual = mStatus;
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_NOTIFICATION_STATUS, mStatus));
pluginController.getInstance().setNotificationStatus(mStatus);
int notificationStatus = pluginController.getInstance().getNotificationStatus();

View File

@ -5,7 +5,6 @@ import android.view.View;
import android.widget.RadioButton;
import androidx.appcompat.app.AppCompatActivity;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
@ -55,7 +54,7 @@ public class settingPrivacyController extends AppCompatActivity {
public class settingAccessibilityViewCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}
@ -65,7 +64,7 @@ public class settingPrivacyController extends AppCompatActivity {
public class settingAccessibilityModelCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}
@ -113,25 +112,25 @@ public class settingPrivacyController extends AppCompatActivity {
public void onDoNotTrack(View view){
mSettingChanged = true;
mSettingPrivacyModel.onTrigger(settingPrivacyEnums.ePrivacyModel.SET_DONOT_TRACK, Collections.singletonList(!status.sStatusDoNotTrack));
mSettingPrivacyModel.onTrigger(settingPrivacyEnums.ePrivacyModel.M_SET_DONOT_TRACK, Collections.singletonList(!status.sStatusDoNotTrack));
mDoNotTrack.toggle();
}
public void onTrackingProtection(View view){
mSettingChanged = true;
mSettingPrivacyModel.onTrigger(settingPrivacyEnums.ePrivacyModel.SET_TRACKING_PROTECTION, Collections.singletonList(!status.sSettingTrackingProtection));
mSettingPrivacyModel.onTrigger(settingPrivacyEnums.ePrivacyModel.M_SET_TRACKING_PROTECTION, Collections.singletonList(!status.sSettingTrackingProtection));
mTrackingProtection.toggle();
}
public void onCookies(View view){
mSettingChanged = true;
mSettingPrivacyViewController.onTrigger(settingPrivacyEnums.ePrivacyViewController.SET_COOKIE_STATUS, Collections.singletonList(view));
mSettingPrivacyModel.onTrigger(settingPrivacyEnums.ePrivacyModel.SET_COOKIES, Collections.singletonList(view));
mSettingPrivacyViewController.onTrigger(settingPrivacyEnums.ePrivacyViewController.M_SET_COOKIE_STATUS, Collections.singletonList(view));
mSettingPrivacyModel.onTrigger(settingPrivacyEnums.ePrivacyModel.M_SET_COOKIES, Collections.singletonList(view));
}
public void onClearPrivateData(View view){
mSettingChanged = true;
mSettingPrivacyModel.onTrigger(settingPrivacyEnums.ePrivacyModel.SET_CLEAR_PRIVATE_DATA, Collections.singletonList(!status.sClearOnExit));
mSettingPrivacyModel.onTrigger(settingPrivacyEnums.ePrivacyModel.M_SET_CLEAR_PRIVATE_DATA, Collections.singletonList(!status.sClearOnExit));
mClearDataOnExit.toggle();
}

View File

@ -4,11 +4,11 @@ class settingPrivacyEnums
{
/*History Manager*/
public enum ePrivacyModel {
M_SET_JAVASCRIPT, SET_DONOT_TRACK, SET_TRACKING_PROTECTION, SET_COOKIES, SET_CLEAR_PRIVATE_DATA
M_SET_JAVASCRIPT, M_SET_DONOT_TRACK, M_SET_TRACKING_PROTECTION, M_SET_COOKIES, M_SET_CLEAR_PRIVATE_DATA
}
public enum ePrivacyViewController {
SET_COOKIE_STATUS
M_SET_COOKIE_STATUS
}
}

View File

@ -69,16 +69,16 @@ class settingPrivacyModel
if(pCommands.equals(settingPrivacyEnums.ePrivacyModel.M_SET_JAVASCRIPT)){
onJavaScript((boolean)pData.get(0));
}
else if(pCommands.equals(settingPrivacyEnums.ePrivacyModel.SET_DONOT_TRACK)){
else if(pCommands.equals(settingPrivacyEnums.ePrivacyModel.M_SET_DONOT_TRACK)){
onDoNotTrack((boolean)pData.get(0));
}
else if(pCommands.equals(settingPrivacyEnums.ePrivacyModel.SET_TRACKING_PROTECTION)){
else if(pCommands.equals(settingPrivacyEnums.ePrivacyModel.M_SET_TRACKING_PROTECTION)){
onTrackingProtection((boolean)pData.get(0));
}
else if(pCommands.equals(settingPrivacyEnums.ePrivacyModel.SET_COOKIES)){
else if(pCommands.equals(settingPrivacyEnums.ePrivacyModel.M_SET_COOKIES)){
onCookies((View) pData.get(0));
}
else if(pCommands.equals(settingPrivacyEnums.ePrivacyModel.SET_CLEAR_PRIVATE_DATA)){
else if(pCommands.equals(settingPrivacyEnums.ePrivacyModel.M_SET_CLEAR_PRIVATE_DATA)){
onClearPrivateData((Boolean) pData.get(0));
}
return null;

View File

@ -139,7 +139,7 @@ class settingPrivacyViewController
}
public Object onTrigger(settingPrivacyEnums.ePrivacyViewController pCommands, List<Object> pData){
if(pCommands.equals(settingPrivacyEnums.ePrivacyViewController.SET_COOKIE_STATUS)){
if(pCommands.equals(settingPrivacyEnums.ePrivacyViewController.M_SET_COOKIE_STATUS)){
setCookieStatus((View)pData.get(0));
}
return null;

View File

@ -81,7 +81,7 @@ public class settingSearchController extends AppCompatActivity {
public class settingSearchViewCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}
@ -91,7 +91,7 @@ public class settingSearchController extends AppCompatActivity {
public class settingSearchModelCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}

View File

@ -7,7 +7,6 @@ import android.os.Bundle;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.settingManager.accessibilityManager.settingAccessibilityController;
import com.darkweb.genesissearchengine.appManager.settingManager.advanceManager.settingAdvanceController;
@ -86,7 +85,7 @@ public class settingController extends AppCompatActivity
pluginController.getInstance().logEvent(strings.EVENT_SETTINGS_OPENED);
}
/*Event Handlers*/
/*Local Overrides*/
@Override
public void onTrimMemory(int level)
@ -120,6 +119,8 @@ public class settingController extends AppCompatActivity
finish();
}
/*UI Redirection*/
public void onNavigationBackPressed(View view){
finish();
}
@ -165,7 +166,7 @@ public class settingController extends AppCompatActivity
public class settingViewCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}
@ -174,7 +175,7 @@ public class settingController extends AppCompatActivity
public class settingModelCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}

View File

@ -14,6 +14,4 @@ class settingModel
this.mEvent = mEvent;
}
/*Helper Methods*/
}

View File

@ -1,6 +1,5 @@
package com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage;
import android.graphics.Color;
import android.os.Build;
import android.view.View;
import android.view.Window;
@ -8,8 +7,6 @@ import android.view.WindowManager;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.content.ContextCompat;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.example.myapplication.R;
@ -46,5 +43,4 @@ class settingViewController
}
}
}
}

View File

@ -1,28 +1,26 @@
package com.darkweb.genesissearchengine.appManager.tabManager;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.helperManager.TopCropImageView;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.example.myapplication.R;
import org.mozilla.geckoview.GeckoView;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
{
@ -30,22 +28,17 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
private ArrayList<tabRowModel> mModelList;
private eventObserver.eventListener mEvent;
private ArrayList<Integer> mSelectedList = new ArrayList<>();
private GeckoView mCurrentGeckoView = null;
private int mCurrentSession;
tabAdapter(ArrayList<tabRowModel> model_list, eventObserver.eventListener event, GeckoView pGeckoView, int pCurrentSession) {
tabAdapter(ArrayList<tabRowModel> model_list, eventObserver.eventListener event) {
this.mModelList = model_list;
this.mEvent = event;
pGeckoView.releaseSession();
this.mCurrentSession = pCurrentSession;
}
/*Initializations*/
@NonNull
@Override
@NonNull @Override
public listViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.tabview_row, parent, false);
return new listViewHolder(view);
@ -55,6 +48,9 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
public void onBindViewHolder(@NonNull tabAdapter.listViewHolder holder, int position)
{
holder.bindListView(mModelList.get(position));
holder.itemView.setTag(position);
holder.itemView.findViewById(R.id.pRemoveRow).setTag(position);
holder.itemView.findViewById(R.id.pLoadSession).setTag(position);
}
@Override
@ -64,59 +60,142 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
/*Listeners*/
public void onClose(){
if(mCurrentGeckoView!=null){
mCurrentGeckoView.releaseSession();
private int getSelectedListSize(){
return mSelectedList.size();
}
private void onRemoveAllSelection() {
mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_CLEAR_TAB_BACKUP);
for(int mCounter=0;mCounter<mModelList.size();mCounter++){
if(mSelectedList.contains(mModelList.get(mCounter).getSession().getSessionID())){
mSelectedList.remove((Integer) mModelList.get(mCounter).getSession().getSessionID());
mEvent.invokeObserver(Collections.singletonList(mCounter), tabEnums.eTabAdapterCallback.ON_REMOVE_TAB);
notifyItemRemoved(mCounter);
mCounter-=1;
}
}
}
public void setOnClickListener(ImageView pLoadSession, tabRowModel model, GeckoView pGeckoView, ImageButton mRemoveRow){
pLoadSession.setOnClickListener(v -> {
pGeckoView.releaseSession();
activityContextManager.getInstance().getHomeController().onLoadTab(model.getSession(), false);
activityContextManager.getInstance().getTabController().onBackPressed(null);
activityContextManager.getInstance().getTabController().initTabCount();
});
private void onClearAllSelection(){
mSelectedList.clear();
notifyDataSetChanged();
}
mRemoveRow.setOnClickListener(v -> {
model.getSession().closeSession();
activityContextManager.getInstance().getTabController().onRemoveView(model.getSession().getSessionID());
notifyDataSetChanged();
activityContextManager.getInstance().getTabController().initTabCount();
});
private void onSelectionCreate(FrameLayout mSelectedView){
mSelectedView.setAlpha(0);
mSelectedView.setVisibility(View.VISIBLE);
mSelectedView.animate().alpha(1);
mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_SHOW_SELECTION);
}
private void onSelectionClear(FrameLayout mSelectedView){
mSelectedView.animate().alpha(0).withEndAction(() -> mSelectedView.setVisibility(View.GONE));
if(mSelectedList.size()==0){
mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_HIDE_SELECTION);
}
}
private void onTriggerURL(tabRowModel model){
mEvent.invokeObserver(Arrays.asList(model.getSession(), false), tabEnums.eTabAdapterCallback.ON_LOAD_TAB);
mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_BACK_PRESSED);
mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_INIT_TAB_COUNT);
}
/*View Holder Extensions*/
class listViewHolder extends RecyclerView.ViewHolder
class listViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener
{
GeckoView mGeckoView;
TextView mHeader;
TextView mDescription;
TextView mDate;
ImageView mLoadSession;
ImageButton mRemoveRow;
TopCropImageView mWebThumbnail;
FrameLayout mSelectedView;
listViewHolder(View itemView) {
super(itemView);
}
void bindListView(tabRowModel model) {
mGeckoView = itemView.findViewById(R.id.pGeckoView);
mHeader = itemView.findViewById(R.id.pHeader);
mDescription = itemView.findViewById(R.id.pDescription);
mLoadSession = itemView.findViewById(R.id.pLoadSession);
mRemoveRow = itemView.findViewById(R.id.pRemoveRow);
mWebThumbnail = itemView.findViewById(R.id.pWebThumbnail);
mDate = itemView.findViewById(R.id.pDate);
mSelectedView = itemView.findViewById(R.id.pSelectedView);
mGeckoView.releaseSession();
mGeckoView.setSession(model.getSession());
if(model.getmId() == mCurrentSession){
mCurrentGeckoView = mGeckoView;
}
model.setGeckoView(mGeckoView);
mHeader.setText(model.getSession().getTitle());
mDescription.setText(model.getSession().getCurrentURL());
mDate.setText(model.getDate());
mWebThumbnail.setImageBitmap(model.getBitmap());
setOnClickListener(mLoadSession, model, mGeckoView, mRemoveRow);
if(mSelectedList.contains(model.getSession().getSessionID())){
onSelectionCreate(mSelectedView);
}else {
onSelectionClear(mSelectedView);
}
if(model.getSession().equals(mModelList.get(0).getSession())){
itemView.setBackgroundColor(ContextCompat.getColor(activityContextManager.getInstance().getTabController(), R.color.c_list_item_current));
}
mLoadSession.setOnLongClickListener(this);
mRemoveRow.setOnClickListener(this);
mLoadSession.setOnClickListener(this);
}
@Override
public void onClick(View v) {
if(v.getId() == R.id.pLoadSession){
if(mSelectedView.getVisibility() == View.GONE){
if(mSelectedList.size()>0){
mSelectedList.add(mModelList.get(this.getLayoutPosition()).getSession().getSessionID());
onSelectionCreate(mSelectedView);
}else {
onTriggerURL(mModelList.get(this.getLayoutPosition()));
}
}else {
for(int mCounter=0;mCounter<mSelectedList.size();mCounter++){
if(mSelectedList.get(mCounter) == mModelList.get(this.getLayoutPosition()).getSession().getSessionID()){
mSelectedList.remove(mCounter);
}
}
onSelectionClear(mSelectedView);
}
}else if(v.getId() == R.id.pRemoveRow){
mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_CLEAR_TAB_BACKUP);
mEvent.invokeObserver(Collections.singletonList(this.getLayoutPosition()), tabEnums.eTabAdapterCallback.ON_REMOVE_TAB_VIEW);
}
}
@Override
public boolean onLongClick(View v) {
if(v.getId() == R.id.pLoadSession){
if(mSelectedView.getVisibility() == View.GONE){
mSelectedList.add(mModelList.get(this.getLayoutPosition()).getSession().getSessionID());
onSelectionCreate(mSelectedView);
}else {
mSelectedList.remove(this.getLayoutPosition());
onSelectionClear(mSelectedView);
}
mLoadSession.setPressed(false);
}
return true;
}
}
public Object onTrigger(tabEnums.eTabModelCommands pCommands, List<Object> pData){
if(pCommands.equals(tabEnums.eTabModelCommands.M_SELECTED_LIST_SIZE)){
return getSelectedListSize();
}else if(pCommands.equals(tabEnums.eTabModelCommands.M_REMOVE_ALL_SELECTION)){
onRemoveAllSelection();
}else if(pCommands.equals(tabEnums.eTabModelCommands.M_CLEAR_ALL_SELECTION)){
onClearAllSelection();
}
return null;
}
}

View File

@ -1,18 +1,22 @@
package com.darkweb.genesissearchengine.appManager.tabManager;
import android.graphics.Canvas;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.homeManager.geckoSession;
import com.darkweb.genesissearchengine.appManager.homeManager.homeController;
import com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingController;
import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.keys;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.constants.strings;
@ -26,11 +30,19 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import jp.wasabeef.recyclerview.animators.FadeInRightAnimator;
public class tabController extends AppCompatActivity
{
/*Private Views*/
private Button mTabs;
private ImageView mRemoveSelection;
private LinearLayout mTabsContainer;
private ImageButton mMenuButton;
private ImageButton mClearSelection;
private View mPopupUndo;
/*Private Variables*/
@ -51,7 +63,7 @@ public class tabController extends AppCompatActivity
initializeListModel();
initializeViews();
initializeList();
onCustomeListeners();
initSwipe();
}
public void initializeListModel(){
@ -62,82 +74,137 @@ public class tabController extends AppCompatActivity
mContextManager.setTabController(this);
pluginController.getInstance().logEvent(strings.EVENT_TAB_OPENED);
}
public void initializeViews(){
mRecycleView = findViewById(R.id.pRecycleView);
mTabs = findViewById(R.id.pTabs);
mRemoveSelection = findViewById(R.id.pRemoveSelection);
mTabsContainer = findViewById(R.id.pTabsContainer);
mMenuButton = findViewById(R.id.pMenuButton);
mClearSelection = findViewById(R.id.pClearSelection);
mPopupUndo = findViewById(R.id.pPopupUndo);
mtabViewController = new tabViewController(this, mTabs);
mtabViewController = new tabViewController(this, mTabs, mRemoveSelection, mTabsContainer, mMenuButton, mClearSelection, mPopupUndo);
}
public void initializeList(){
LinearLayoutManager layoutManager = new LinearLayoutManager(tabController.this);
tabAdapter adapter = new tabAdapter(mListModel.getList(),new adapterCallback(), mHomeController.getmGeckoView(), ((tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB,null)).getmId());
tabAdapter adapter = new tabAdapter(mListModel.getList(),new adapterCallback());
mTabAdapter = adapter;
layoutManager.setReverseLayout(true);
mRecycleView.setItemAnimator(new FadeInRightAnimator());
Objects.requireNonNull(mRecycleView.getItemAnimator()).setAddDuration(200);
mRecycleView.getItemAnimator().setRemoveDuration(200);
mRecycleView.getItemAnimator().setMoveDuration(200);
mRecycleView.getItemAnimator().setChangeDuration(450);
mRecycleView.setAdapter(adapter);
mRecycleView.setItemViewCacheSize(100);
mRecycleView.setNestedScrollingEnabled(false);
mRecycleView.setHasFixedSize(true);
mRecycleView.setAdapter(adapter);
mRecycleView.setItemViewCacheSize(100);
mRecycleView.setDrawingCacheEnabled(true);
mRecycleView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
mRecycleView.setLayoutManager(new LinearLayoutManager(tabController.this));
mTabAdapter.notifyDataSetChanged();
}
/*Listeners*/
private void initSwipe(){
ItemTouchHelper.SimpleCallback simpleItemTouchCallback = new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT) {
@Override
public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) {
return false;
}
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
int position = viewHolder.getAdapterPosition();
onClearTabBackup();
onRemoveTab(position);
mTabAdapter.notifyItemRemoved(position);
initTabCount();
}
@Override
public void onChildDraw(@NonNull Canvas c, @NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {
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);
}
};
ItemTouchHelper itemTouchHelper = new ItemTouchHelper(simpleItemTouchCallback);
itemTouchHelper.attachToRecyclerView(mRecycleView);
}
/*View Handlers*/
public void onCustomeListeners(){
public void onBackPressedInvoked(View view) {
onBackPressed();
}
public void onReleaseDisplay(){
mTabAdapter.onClose();
mHomeController.onAcquireDisplay();
public void onRemoveTab(int pIndex){
mListModel.onRemoveTab(pIndex);
initTabCount();
}
@Override
public void onBackPressed() {
super.onBackPressed();
overridePendingTransition(R.anim.popup_anim_in, R.anim.popup_anim_out);
public void onClearTabBackup(){
mListModel.onClearBackup();
}
public void onBackPressed(View view) {
onReleaseDisplay();
finish();
overridePendingTransition(R.anim.popup_anim_in, R.anim.popup_anim_out);
}
public void onRemoveView(int pId){
for(int mCounter=0; mCounter<mListModel.getList().size();mCounter++){
if(mListModel.getList().get(mCounter).getSession().getSessionID() == pId){
mListModel.getList().get(mCounter).releaseGeckoView();
mListModel.getList().remove(mCounter);
mTabAdapter.notifyDataSetChanged();
//mTabAdapter.notifyItemRemoved(mCounter);
//mTabAdapter.notifyItemRangeChanged(mCounter-1, mListModel.getList().size());
}
}
public void onRemoveView(int pIndex){
onClearTabBackup();
onRemoveTab(pIndex);
mTabAdapter.notifyItemRemoved(pIndex);
onShowUndoDialog();
}
public void initTabCount()
{
mtabViewController.onTrigger(tabEnums.eTabViewCommands.INIT_TAB_COUNT, null);
mHomeController.initTabCount();
}
public void onNewTabInvoked(){
mHomeController.onNewTab(true,false);
onReleaseDisplay();
finish();
overridePendingTransition(R.anim.popup_anim_in, R.anim.popup_anim_out);
}
public void onRestoreTab(View view){
int mSize = mListModel.onLoadBackup();
mTabAdapter.notifyItemRangeInserted(0, mSize);
initTabCount();
}
public void onShowUndoDialog(){
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_SHOW_UNDO_DIALOG, null);
}
public void onTabRowChanged(int pId){
for(int mCounter=0; mCounter<mListModel.getList().size();mCounter++){
if(mListModel.getList().get(mCounter).getSession().getSessionID() == pId){
mTabAdapter.notifyItemChanged(mCounter);
}
}
}
/*UI Triggers*/
public void openTabMenu(View view) {
mtabViewController.onTrigger(tabEnums.eTabViewCommands.M_SHOW_MENU, Collections.singletonList(view));
}
public void onRemoveSelection(View view) {
mTabAdapter.onTrigger(tabEnums.eTabModelCommands.M_REMOVE_ALL_SELECTION, null);
onShowUndoDialog();
}
public void onClearSelection(View view) {
mTabAdapter.onTrigger(tabEnums.eTabModelCommands.M_CLEAR_ALL_SELECTION, null);
}
/*Tab Menu*/
public void onMenuTrigger(View pView){
@ -145,7 +212,11 @@ public class tabController extends AppCompatActivity
onNewTabInvoked();
}
else if(pView.getId() == R.id.pCloseTab){
mListModel.getList().clear();
mtabViewController.onTrigger(tabEnums.eTabViewCommands.M_DISMISS_MENU, null);
initTabCount();
mRecycleView.animate().setDuration(300).alpha(0).withEndAction(() -> mTabAdapter.notifyDataSetChanged());
onShowUndoDialog();
}
else if(pView.getId() == R.id.pOpenSetting){
mtabViewController.onTrigger(tabEnums.eTabViewCommands.M_DISMISS_MENU, null);
@ -153,22 +224,12 @@ public class tabController extends AppCompatActivity
}
}
public void onTabRowChanged(int pId){
for(int mCounter=0; mCounter<mListModel.getList().size();mCounter++){
if(mListModel.getList().get(mCounter).getSession().getSessionID() == pId){
mListModel.getList().get(mCounter).releaseGeckoView();
mTabAdapter.notifyItemChanged(mCounter);
}
}
}
@Override
public void onTrimMemory(int level)
{
if(status.sSettingIsAppPaused && (level==80 || level==15))
{
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.HOME_LOW_MEMORY,true));
onReleaseDisplay();
finish();
}
}
@ -193,12 +254,48 @@ public class tabController extends AppCompatActivity
super.onPause();
}
@Override
public void onBackPressed() {
int mSize = (Integer) mTabAdapter.onTrigger(tabEnums.eTabModelCommands.M_SELECTED_LIST_SIZE, null);
if(mSize>0){
onClearSelection(null);
}else {
super.onBackPressed();
finish();
overridePendingTransition(R.anim.popup_anim_in, R.anim.popup_anim_out);
}
}
/*Event Observer*/
public class adapterCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype e_type)
public Object invokeObserver(List<Object> data, Object e_type)
{
if(e_type.equals(tabEnums.eTabAdapterCallback.ON_HIDE_SELECTION)){
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_HIDE_SELECTION, null);
}
else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_SHOW_SELECTION)){
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_SHOW_SELECTION, null);
}
else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_CLEAR_TAB_BACKUP)){
onClearTabBackup();
}
else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_REMOVE_TAB)){
onRemoveTab((Integer) data.get(0));
}
else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_INIT_TAB_COUNT)){
initTabCount();
}
else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_BACK_PRESSED)){
onBackPressed();
}
else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_LOAD_TAB)){
mHomeController.onLoadTab((geckoSession)data.get(0),(boolean)data.get(1));
}
else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_REMOVE_TAB_VIEW)){
onRemoveView((Integer) data.get(0));
}
return null;
}
}

View File

@ -4,9 +4,15 @@ public class tabEnums
{
/*Settings Manager*/
public enum eTabViewCommands {
M_DISMISS_MENU, M_SHOW_MENU, INIT_TAB_COUNT
M_DISMISS_MENU, M_SHOW_MENU, INIT_TAB_COUNT, ON_HIDE_SELECTION, ON_SHOW_SELECTION, ON_SHOW_UNDO_DIALOG, ON_HIDE_UNDO_DIALOG, ON_GENERATE_SWIPABLE_BACKGROUND
}
public enum eTabModelCommands {
M_SELECTED_LIST_SIZE, M_REMOVE_ALL_SELECTION, M_CLEAR_ALL_SELECTION
}
public enum eTabAdapterCallback {
ON_HIDE_SELECTION, ON_SHOW_SELECTION, ON_CLEAR_TAB_BACKUP, ON_REMOVE_TAB, ON_INIT_TAB_COUNT, ON_BACK_PRESSED, ON_LOAD_TAB, ON_REMOVE_TAB_VIEW
}
}

View File

@ -7,17 +7,34 @@ class tabModel
/*Private Variables*/
private ArrayList<tabRowModel> mModelList = new ArrayList<>();
private ArrayList<tabRowModel> mBackupIndex = new ArrayList<>();
/*Initializations*/
void setList(ArrayList<tabRowModel> model)
{
mModelList = model;
}
ArrayList<tabRowModel> getList()
{
return mModelList;
}
void setList(ArrayList<tabRowModel> model)
{
mModelList = model;
}
public void onRemoveTab(int pIndex){
mBackupIndex.add(mModelList.remove(pIndex));
}
public void onClearBackup(){
mBackupIndex.clear();
}
public int onLoadBackup(){
int mSize = mBackupIndex.size();
for(int mCounter=0;mCounter<mBackupIndex.size();mCounter++){
mModelList.add(0,mBackupIndex.remove(mCounter));
mCounter-=1;
}
return mSize;
}
}

View File

@ -1,6 +1,9 @@
package com.darkweb.genesissearchengine.appManager.tabManager;
import android.graphics.Bitmap;
import com.darkweb.genesissearchengine.appManager.homeManager.geckoSession;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import org.mozilla.geckoview.GeckoView;
@ -11,29 +14,24 @@ public class tabRowModel
private geckoSession mSession;
private int mId;
private GeckoView mGeckoView = null;
private Bitmap mBitmap = null;
private String mDate;
/*Initializations*/
public tabRowModel(geckoSession mSession,int mId) {
this.mSession = mSession;
this.mId = mId;
this.mDate = helperMethod.getCurrentDate();
}
/*Helper Method*/
public geckoSession getSession()
{
return mSession;
}
public void setGeckoView(GeckoView pGeckoView){
mGeckoView = pGeckoView;
}
public void releaseGeckoView(){
if(mGeckoView!=null){
mGeckoView.releaseSession();
}
}
public int getmId() {
return mId;
}
@ -41,4 +39,15 @@ public class tabRowModel
mId = id;
}
public void setmBitmap(Bitmap pBitmap) {
mBitmap = null;
mBitmap = pBitmap;
}
public Bitmap getBitmap() {
return mBitmap;
}
public String getDate(){
return mDate;
}
}

View File

@ -1,20 +1,34 @@
package com.darkweb.genesissearchengine.appManager.tabManager;
import android.annotation.SuppressLint;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ActionMenuView;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.RecyclerView;
import com.daimajia.androidanimations.library.Techniques;
import com.daimajia.androidanimations.library.YoYo;
import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
@ -25,17 +39,31 @@ import static android.content.Context.LAYOUT_INFLATER_SERVICE;
class tabViewController
{
/*Private Variables*/
/*Private Views*/
private AppCompatActivity mContext;
private PopupWindow mTabOptionMenu = null;
private Button mTabs;
private ImageView mRemoveSelection;
private LinearLayout mTabsContainer;
private ImageButton mMenuButton;
private ImageButton mClearSelection;
private View mToastLayoutRoot;
/*Private Local Variables*/
private Handler mDelayHandler = new Handler();
private Paint mPainter = new Paint();
/*Initializations*/
tabViewController(AppCompatActivity mContext, Button pTabs)
tabViewController(AppCompatActivity mContext, Button pTabs, ImageView pRemoveSelection, LinearLayout pTabsContainer, ImageButton pMenuButton, ImageButton pClearSelection, View pToastLayoutRoot)
{
this.mContext = mContext;
this.mTabs = pTabs;
this.mRemoveSelection = pRemoveSelection;
this.mTabsContainer = pTabsContainer;
this.mMenuButton = pMenuButton;
this.mClearSelection = pClearSelection;
this.mToastLayoutRoot = pToastLayoutRoot;
initPostUI();
initUI();
@ -86,14 +114,83 @@ class tabViewController
}
}
public void onTrigger(tabEnums.eTabViewCommands pCommands, List<Object> pData){
private void onShowSelectionMenu() {
mRemoveSelection.setVisibility(View.VISIBLE);
mClearSelection.setVisibility(View.VISIBLE);
mTabsContainer.setVisibility(View.GONE);
mMenuButton.setVisibility(View.GONE);
}
private void onHideSelectionMenu() {
mRemoveSelection.setVisibility(View.GONE);
mClearSelection.setVisibility(View.GONE);
mTabsContainer.setVisibility(View.VISIBLE);
mMenuButton.setVisibility(View.VISIBLE);
}
private void onShowUndoDialog() {
mToastLayoutRoot.animate().cancel();
mToastLayoutRoot.setVisibility(View.VISIBLE);
mToastLayoutRoot.setAlpha(0);
mToastLayoutRoot.animate().alpha(1);
mDelayHandler.removeCallbacksAndMessages(null);
mDelayHandler.postDelayed(() -> mToastLayoutRoot.animate().alpha(0).withEndAction(() -> mToastLayoutRoot.setVisibility(View.GONE)), 1500);
}
private void onHideUndoDialog() {
mToastLayoutRoot.animate().cancel();
mToastLayoutRoot.animate().alpha(0).withEndAction(() -> mToastLayoutRoot.setVisibility(View.GONE));
}
private void onDrawSwipableBackground(Canvas pCanvas, RecyclerView.ViewHolder pViewHolder, float pDX, int pActionState) {
Bitmap icon;
if(pActionState == ItemTouchHelper.ANIMATION_TYPE_SWIPE_SUCCESS){
View itemView = pViewHolder.itemView;
itemView.animate().alpha(0f);
}
else if(pActionState == ItemTouchHelper.ACTION_STATE_SWIPE){
View itemView = pViewHolder.itemView;
float height = (float) itemView.getBottom() - (float) itemView.getTop();
float width = height / 3;
if(pDX > 0){
mPainter.setColor(ContextCompat.getColor(mContext, R.color.c_list_item_current));
RectF background = new RectF((float) itemView.getLeft(), (float) itemView.getTop(), pDX,(float) itemView.getBottom());
pCanvas.drawRect(background, mPainter);
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);
pCanvas.drawBitmap(icon,null,icon_dest, mPainter);
} else {
mPainter.setColor(ContextCompat.getColor(mContext, R.color.c_list_item_current));
RectF background = new RectF((float) itemView.getRight() + pDX, (float) itemView.getTop(),(float) itemView.getRight(), (float) itemView.getBottom());
pCanvas.drawRect(background, mPainter);
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);
pCanvas.drawBitmap(icon,null,icon_dest, mPainter);
}
}
}
public Object onTrigger(tabEnums.eTabViewCommands pCommands, List<Object> pData){
if(pCommands.equals(tabEnums.eTabViewCommands.M_SHOW_MENU)){
onOpenTabMenu((View) pData.get(0));
}else if(pCommands.equals(tabEnums.eTabViewCommands.M_DISMISS_MENU)){
onCloseTabMenu();
}else if(pCommands.equals(tabEnums.eTabViewCommands.INIT_TAB_COUNT)){
initTabCount();
}else if(pCommands.equals(tabEnums.eTabViewCommands.ON_HIDE_SELECTION)){
onHideSelectionMenu();
}else if(pCommands.equals(tabEnums.eTabViewCommands.ON_SHOW_SELECTION)){
onShowSelectionMenu();
}else if(pCommands.equals(tabEnums.eTabViewCommands.ON_SHOW_UNDO_DIALOG)){
onShowUndoDialog();
}else if(pCommands.equals(tabEnums.eTabViewCommands.ON_HIDE_UNDO_DIALOG)){
onHideUndoDialog();
}else if(pCommands.equals(tabEnums.eTabViewCommands.ON_GENERATE_SWIPABLE_BACKGROUND)){
onDrawSwipableBackground((Canvas)pData.get(0), (RecyclerView.ViewHolder)pData.get(1), (float)pData.get(2), (int)pData.get(3));
}
return null;
}
}

View File

@ -15,21 +15,25 @@ public class constants
public static final String CONST_GENESIS_UPDATE_URL = "https://boogle.store/manual?abi=";
public static final String CONST_PLAYSTORE_URL = "https://play.google.com/store/apps/details?id=com.darkweb.genesissearchengine";
public static final String CONST_BACKEND_GENESIS_URL = "http://boogle.store/q=$s";
public static final String CONST_BACKEND_GOOGLE_URL = "https://www.google.com/q=$s";
public static final String CONST_BACKEND_GENESIS_URL = "https://boogle.store/search?q=$sa&p_num=1&s_type=all";
public static final String CONST_BACKEND_GOOGLE_URL = "https://www.google.com/search?q=$s";
public static final String CONST_BACKEND_DUCK_DUCK_GO_URL = "https://duckduckgo.com/q=$s";
public static final String CONST_BACKEND_BING_URL = "https://bing.com/q=$s";
public static final String CONST_BACKEND_BING_URL = "https://bing.com/search?q=$s";
public static final String CONST_BACKEND_WIKI_URL = "https://en.wikipedia.org/wiki/$s";
/*PROXY CONSTANTS*/
public static final String CONST_PROXY_SOCKS = "127.0.0.1";
public static final int CONST_PROXY_SOCKS_VERSION = 5;
public static final boolean CONST_PROXY_SOCKS_REMOTE_DNS = true;
public static final boolean CONST_PROXY_CACHE = true;
public static final boolean CONST_PROXY_MEMORY = true;
public static final boolean CONST_PROXY_DO_NOT_TRACK_HEADER_ENABLED = false;
public static final int CONST_PROXY_DO_NOT_TRACK_HEADER_VALUE = 1;
public static final int CONST_PROXY_SOCKS_VERSION = 5;
/*LOG CONSTANTS*/
public static final String LOGS_DEFAULT_MESSAGE = "Genesis on standby at the moment";
/*HISTORY CONSTANTS*/

View File

@ -4,12 +4,12 @@ public class enums
{
/*Settings Manager*/
public enum etype{
on_update_favicon,M_RESET_THEME_INVOKED_BACK,
onion,on_verify_selected_url_menu,
welcome,abi_error, rate_failure,reported_success,bookmark, clear_tab,clear_history,clear_bookmark,report_url,default_home,rate_app,version_warning,start_orbot,download_file,download_file_long_press,on_long_press_url,
cancel_welcome,ignore_abi,reload,connect_vpn,app_rated,download_file_manual,download_folder, update_searcn, update_javascript,update_notification, update_history,update_cookies, update_font_size,update_font_adjustable,close_view,open_link_new_tab,open_link_current_tab,copy_link,
url_triggered, url_triggered_new_tab,url_clear,clear_recycler,url_clear_at,remove_from_database,is_empty,
on_close_sesson,on_long_press,on_long_press_with_link,on_reset_app,on_bridge_mail,on_not_support, data_cleared,on_full_screen,on_handle_external_intent,on_update_suggestion_url,progress_update,recheck_orbot,on_url_load,on_playstore_load,back_list_empty,start_proxy,on_request_completed, on_update_history,on_update_suggestion,on_page_loaded,on_load_error,download_file_popup,on_init_ads,rate_application,search_update, open_new_tab
ON_UPDATE_VIEW_PIXEL,on_update_favicon,ON_UPDATE_TAB_TITLE,
on_verify_selected_url_menu,FINDER_RESULT_CALLBACK,
welcome,abi_error, rate_failure,reported_success,bookmark, clear_tab,clear_history,clear_bookmark,report_url,rate_app,start_orbot,download_file,download_file_long_press,on_long_press_url,
cancel_welcome,ignore_abi,reload,connect_vpn,app_rated,download_file_manual,download_folder, open_link_new_tab,open_link_current_tab,copy_link,
url_triggered, url_triggered_new_tab,url_clear,url_clear_at,remove_from_database,is_empty,
on_close_sesson,on_long_press,on_long_press_with_link,on_bridge_mail,on_not_support, data_cleared,on_full_screen,on_handle_external_intent,on_update_suggestion_url,progress_update,recheck_orbot,on_url_load,on_playstore_load,back_list_empty,start_proxy,on_request_completed, on_update_history,on_update_suggestion,ON_UPDATE_TITLE_BAR,on_page_loaded,on_load_error,download_file_popup,on_init_ads,rate_application,search_update, open_new_tab
}
public static class Theme {

View File

@ -51,6 +51,7 @@ public class keys
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_OPEN_URL_IN_NEW_TAB = "SETTING_OPEN_URL_IN_NEW_TAB";
public static final String SETTING_LIST_VIEW = "SETTING_LIST_VIEW";
/*Bridge Settings*/

View File

@ -1,7 +1,5 @@
package com.darkweb.genesissearchengine.constants;
import android.content.res.Configuration;
import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
@ -13,16 +11,16 @@ public class status
{
/*App Status*/
public static boolean sPaidStatus = false;
public static boolean sPaidStatus = true;
public static String sAppCurrentABI = "7.0";
public static String mCurrentReloadURL = "";
/*Settings Status*/
public static String sSettingSearchStatus = constants.CONST_BACKEND_GENESIS_URL;
public static String sSettingRedirectStatus = strings.GENERIC_EMPTY_STR;
public static String sSettingLanguage = "en";
public static boolean sThemeChanged = false;
public static boolean sSettingEnableZoom = true;
public static boolean sSettingEnableVoiceInput = true;
public static boolean sSettingSearchHistory = false;
@ -43,21 +41,23 @@ public class status
public static boolean sAutoPlay = false;
public static boolean sFullScreenBrowsing = false;
public static boolean sOpenURLInNewTab = false;
public static boolean sDefaultNightMode;
public static boolean sLogListView;
public static float sSettingFontSize = 1;
public static int sTheme = enums.Theme.THEME_DEFAULT;
public static int sSettingCookieStatus = ACCEPT_FIRST_PARTY;
public static int sShowImages = -1;
public static float sSettingFontSize = 1;
public static String sSettingLanguage = "en";
public static boolean sDefaultNightMode;
/*Bridge Status*/
public static String sBridgeCustomBridge = strings.BRIDGE_CUSTOM_BRIDGE_OBFS4;
public static boolean sBridgeGatewayAuto = false;
public static boolean sBridgeGatewayManual = false;
public static boolean sBridgeVPNStatus = false;
public static boolean sBridgeStatus = false;
public static int sBridgeNotificationManual = 0;
public static String sBridgeCustomBridge = strings.BRIDGE_CUSTOM_BRIDGE_OBFS4;
public static void initStatus()
@ -94,6 +94,7 @@ public class status
status.sFullScreenBrowsing = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_FULL_SCREEN_BROWSIING,false));
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,false));
status.sLogListView = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_LIST_VIEW,true));
}
}

View File

@ -24,6 +24,6 @@ public class dataEnums
}
public enum eTabCommands{
M_ADD_TAB, M_CLEAR_TAB, M_CLOSE_TAB_PARAMETERIZED, CLOSE_TAB, GET_TAB, GET_CURRENT_TAB, GET_TOTAL_TAB, MOVE_TAB_TO_TOP
M_ADD_TAB, M_CLEAR_TAB, M_CLOSE_TAB_PARAMETERIZED, CLOSE_TAB, GET_TAB, GET_CURRENT_TAB, GET_TOTAL_TAB, MOVE_TAB_TO_TOP, M_UPDATE_PIXEL
}
}

View File

@ -1,9 +1,14 @@
package com.darkweb.genesissearchengine.dataManager;
import android.annotation.SuppressLint;
import android.graphics.Bitmap;
import android.os.Handler;
import com.darkweb.genesissearchengine.appManager.homeManager.geckoSession;
import com.darkweb.genesissearchengine.appManager.tabManager.tabRowModel;
import com.google.android.gms.ads.AdSize;
import org.mozilla.geckoview.GeckoResult;
import java.util.ArrayList;
import java.util.List;
@ -71,6 +76,26 @@ class tabDataModel
return null;
}
}
public void updatePixels(int pSessionID, GeckoResult<Bitmap> pBitmapManager){
for(int counter = 0; counter< mTabs.size(); counter++){
if(mTabs.get(counter).getSession().getSessionID()==pSessionID)
{
final Handler handler = new Handler();
int finalCounter = counter;
handler.postDelayed(() ->
{
try {
Bitmap mBitmap = pBitmapManager.poll(0);
mTabs.get(finalCounter).setmBitmap(mBitmap);
} catch (Throwable throwable) {
throwable.printStackTrace();
}
}, 100);
}
}
}
int getTotalTabs(){
return mTabs.size();
}
@ -101,6 +126,9 @@ class tabDataModel
else if(p_commands == dataEnums.eTabCommands.GET_TAB){
return getTab();
}
else if(p_commands == dataEnums.eTabCommands.M_UPDATE_PIXEL){
updatePixels((int)p_data.get(0), (GeckoResult<Bitmap>)p_data.get(1));
}
return null;
}

View File

@ -0,0 +1,70 @@
package com.darkweb.genesissearchengine.helperManager;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
/**
* Created by chris on 7/27/16.
*/
public class TopCropImageView extends androidx.appcompat.widget.AppCompatImageView {
public TopCropImageView(Context context) {
super(context);
init();
}
public TopCropImageView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public TopCropImageView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
recomputeImgMatrix();
}
@Override
protected boolean setFrame(int l, int t, int r, int b) {
recomputeImgMatrix();
return super.setFrame(l, t, r, b);
}
private void init() {
setScaleType(ScaleType.MATRIX);
}
private void recomputeImgMatrix() {
final Drawable drawable = getDrawable();
if (drawable == null) {
return;
}
final Matrix matrix = getImageMatrix();
float scale;
final int viewWidth = getWidth() - getPaddingLeft() - getPaddingRight();
final int viewHeight = getHeight() - getPaddingTop() - getPaddingBottom();
final int drawableWidth = drawable.getIntrinsicWidth();
final int drawableHeight = drawable.getIntrinsicHeight();
if (drawableWidth * viewHeight > drawableHeight * viewWidth) {
scale = (float) viewHeight / (float) drawableHeight;
} else {
scale = (float) viewWidth / (float) drawableWidth;
}
matrix.setScale(scale, scale);
setImageMatrix(matrix);
}
}

View File

@ -8,6 +8,6 @@ public class eventObserver
{
public interface eventListener
{
Object invokeObserver(List<Object> data, enums.etype event_type);
Object invokeObserver(List<Object> data, Object event_type);
}
}

View File

@ -47,8 +47,11 @@ import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.net.URLConnection;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import javax.net.ssl.HttpsURLConnection;
@ -404,6 +407,27 @@ public class helperMethod
context.startActivity(intent);
}
public static String getCurrentDate(){
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
Date date = new Date();
sdf.applyPattern("E | MMM dd,yyyy");
return sdf.format(date);
}
public static String getCurrentTime(){
Calendar now = Calendar.getInstance();
int year = now.get(Calendar.YEAR);
int month = now.get(Calendar.MONTH) + 1; // Note: zero based!
int day = now.get(Calendar.DAY_OF_MONTH);
int hour = now.get(Calendar.HOUR_OF_DAY);
int minute = now.get(Calendar.MINUTE);
int second = now.get(Calendar.SECOND);
int millis = now.get(Calendar.MILLISECOND);
System.out.printf("%d-%02d-%02d %02d:%02d:%02d.%03d", year, month, day, hour, minute, second, millis);
return month + "/" + year + " | " + hour + ":" + minute + ":" + second;
}
public static PopupWindow onCreateMenu(View p_view, int p_layout) {
PopupWindow popupWindow = null;
if(popupWindow!=null){

View File

@ -8,12 +8,14 @@ import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Handler;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.RatingBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.enums;
@ -25,12 +27,13 @@ import com.example.myapplication.R;
import java.io.File;
import java.util.Collections;
import java.util.List;
import static android.view.WindowManager.LayoutParams.FLAG_DIM_BEHIND;
class messageManager
{
/*Private Variables*/
private List<String> data;
private List<Object> data;
private AppCompatActivity app_context;
private eventObserver.eventListener event;
@ -40,6 +43,21 @@ class messageManager
/*Initializations*/
private void initializeDialog(int pLayout,int pGravity,int pFlag){
if(dialog!=null && dialog.isShowing()){
dialog.dismiss();
}
dialog = new Dialog(app_context);
dialog.getWindow().setGravity(pGravity);
dialog.getWindow().getAttributes().windowAnimations = R.style.dialiog_animation;
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
dialog.setCancelable(true);
dialog.setContentView(pLayout);
dialog.show();
dialog.getWindow().clearFlags(pFlag);
}
messageManager(eventObserver.eventListener event)
{
this.event = event;
@ -48,7 +66,7 @@ class messageManager
/*Helper Methods*/
private void welcomeMessage()
{
initializeDialog(R.layout.popup_welcome, Gravity.CENTER);
initializeDialog(R.layout.popup_welcome, Gravity.CENTER, FLAG_DIM_BEHIND);
dialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
event.invokeObserver(Collections.singletonList(constants.CONST_BLACK_MARKET_URL), enums.etype.welcome);
dialog.dismiss();
@ -82,7 +100,7 @@ class messageManager
@SuppressLint("QueryPermissionsNeeded")
private void abiError()
{
initializeDialog(R.layout.popup_abi_error, Gravity.CENTER);
initializeDialog(R.layout.popup_abi_error, Gravity.CENTER, FLAG_DIM_BEHIND);
dialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
dialog.dismiss();
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(constants.CONST_GENESIS_UPDATE_URL + status.sAppCurrentABI));
@ -107,7 +125,7 @@ class messageManager
private void rateFailure()
{
initializeDialog(R.layout.popup_rate_failure, Gravity.CENTER);
initializeDialog(R.layout.popup_rate_failure, Gravity.CENTER, FLAG_DIM_BEHIND);
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
dialog.dismiss();
@ -126,26 +144,27 @@ class messageManager
private void reportedSuccessfully()
{
initializeDialog(R.layout.popup_reported_successfully, Gravity.CENTER);
initializeDialog(R.layout.popup_reported_successfully, Gravity.CENTER, FLAG_DIM_BEHIND);
dialog.findViewById(R.id.pNext).setOnClickListener(v -> dialog.dismiss());
}
private void notSupportMessage()
{
initializeDialog(R.layout.popup_not_supported, Gravity.BOTTOM);
initializeDialog(R.layout.popup_not_supported, Gravity.BOTTOM, FLAG_DIM_BEHIND);
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
}
private void dataClearedSuccessfully()
{
initializeDialog(R.layout.popup_data_cleared, Gravity.BOTTOM);
initializeDialog(R.layout.popup_data_cleared, Gravity.BOTTOM, FLAG_DIM_BEHIND);
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
}
@SuppressLint("ResourceType")
private void bookmark()
{
initializeDialog(R.layout.popup_create_bookmark, Gravity.CENTER);
initializeDialog(R.layout.popup_create_bookmark, Gravity.CENTER, FLAG_DIM_BEHIND);
EditText mBoomMarkTitle = dialog.findViewById(R.id.pBookmark);
dialog.setOnDismissListener(dialog -> {
final Handler handler = new Handler();
@ -167,27 +186,13 @@ class messageManager
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
dialog.dismiss();
helperMethod.hideKeyboard(app_context);
event.invokeObserver(Collections.singletonList(data.get(0).replace("genesis.onion","boogle.store")+"split"+((EditText)dialog.findViewById(R.id.pBookmark)).getText().toString()), enums.etype.bookmark);
event.invokeObserver(Collections.singletonList(data.get(0).toString().replace("genesis.onion","boogle.store")+"split"+((EditText)dialog.findViewById(R.id.pBookmark)).getText().toString()), enums.etype.bookmark);
});
}
private void initializeDialog(int pLayout,int pGravity){
if(dialog!=null && dialog.isShowing()){
dialog.dismiss();
}
dialog = new Dialog(app_context);
dialog.getWindow().setGravity(pGravity);
dialog.getWindow().getAttributes().windowAnimations = R.style.dialiog_animation;
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
dialog.setCancelable(true);
dialog.setContentView(pLayout);
dialog.show();
}
private void clearHistory()
{
initializeDialog(R.layout.popup_clear_history, Gravity.CENTER);
initializeDialog(R.layout.popup_clear_history, Gravity.CENTER, FLAG_DIM_BEHIND);
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
dialog.dismiss();
@ -197,7 +202,7 @@ class messageManager
private void clearBookmark()
{
initializeDialog(R.layout.popup_clear_bookmark, Gravity.CENTER);
initializeDialog(R.layout.popup_clear_bookmark, Gravity.CENTER, FLAG_DIM_BEHIND);
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
dialog.dismiss();
@ -207,7 +212,7 @@ class messageManager
private void reportURL()
{
initializeDialog(R.layout.popup_report_url, Gravity.CENTER);
initializeDialog(R.layout.popup_report_url, Gravity.CENTER, FLAG_DIM_BEHIND);
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
dialog.dismiss();
@ -220,7 +225,7 @@ class messageManager
@SuppressLint("QueryPermissionsNeeded")
private void rateApp()
{
initializeDialog(R.layout.popup_rate_us, Gravity.CENTER);
initializeDialog(R.layout.popup_rate_us, Gravity.CENTER, FLAG_DIM_BEHIND);
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
RatingBar mRatingBar = dialog.findViewById(R.id.pRating);
@ -245,7 +250,7 @@ class messageManager
private void downloadFile()
{
initializeDialog(R.layout.popup_download_file, Gravity.BOTTOM);
initializeDialog(R.layout.popup_download_file, Gravity.BOTTOM, FLAG_DIM_BEHIND);
((TextView)dialog.findViewById(R.id.pDescription)).setText((app_context.getString(R.string.ALERT_DOWNLOAD_MESSAGE) + data.get(0)));
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
}
@ -253,17 +258,17 @@ class messageManager
@SuppressLint("ResourceAsColor")
private void downloadFileLongPress()
{
File f = new File(data.get(0));
File f = new File(data.get(0).toString());
String name = f.getName();
String title = data.get(1);
String title = data.get(1).toString();
int size = name.length();
if(size>235){
size = 235;
}
initializeDialog(R.layout.popup_file_longpress, Gravity.CENTER);
((TextView)dialog.findViewById(R.id.pDescription)).setText((title + " | " + data.get(0).substring(0,size)+"..."));
initializeDialog(R.layout.popup_file_longpress, Gravity.CENTER, FLAG_DIM_BEHIND);
((TextView)dialog.findViewById(R.id.pDescription)).setText((title + " | " + data.get(0).toString().substring(0,size)+"..."));
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
dialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
event.invokeObserver(Collections.singletonList(data.get(0)), enums.etype.download_file_manual);
@ -285,15 +290,15 @@ class messageManager
private void openURLLongPress()
{
int size = data.get(0).length()-1;
String title = data.get(1);
int size = data.get(0).toString().length()-1;
String title = data.get(1).toString();
if(size>235){
size = 235;
}
initializeDialog(R.layout.popup_url_longpress, Gravity.CENTER);
((TextView)dialog.findViewById(R.id.pDescription)).setText((title + data.get(0).substring(0,size)+"..."));
initializeDialog(R.layout.popup_url_longpress, Gravity.CENTER, FLAG_DIM_BEHIND);
((TextView)dialog.findViewById(R.id.pDescription)).setText((title + data.get(0).toString().substring(0,size)+"..."));
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
dialog.findViewById(R.id.pOption1).setOnClickListener(v -> {
event.invokeObserver(Collections.singletonList(data.get(0)), enums.etype.open_link_new_tab);
@ -310,9 +315,9 @@ class messageManager
}
private void popupDownloadFull(){
String url = data.get(0);
String file = data.get(1);
String title = data.get(2);
String url = data.get(0).toString();
String file = data.get(1).toString();
String title = data.get(2).toString();
String data_local = app_context.getString(R.string.ALERT_LONG_URL_MESSAGE);
@ -334,10 +339,10 @@ class messageManager
}
String mTitle = title;
if(mTitle.length()<=1){
mTitle = data.get(0).substring(0,size)+"...";
mTitle = data.get(0).toString().substring(0,size)+"...";
}
initializeDialog(R.layout.popup_download_full, Gravity.CENTER);
initializeDialog(R.layout.popup_download_full, Gravity.CENTER, FLAG_DIM_BEHIND);
((TextView)dialog.findViewById(R.id.pHeader)).setText(mTitle);
((TextView)dialog.findViewById(R.id.pDescription)).setText((data_local));
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
@ -373,13 +378,13 @@ class messageManager
private void startingOrbotInfo()
{
initializeDialog(R.layout.popup_starting_orbot_info, Gravity.BOTTOM);
initializeDialog(R.layout.popup_starting_orbot_info, Gravity.BOTTOM, FLAG_DIM_BEHIND);
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
}
private void sendBridgeMail()
{
initializeDialog(R.layout.popup_bridge_mail, Gravity.CENTER);
initializeDialog(R.layout.popup_bridge_mail, Gravity.CENTER, FLAG_DIM_BEHIND);
dialog.findViewById(R.id.pDismiss).setOnClickListener(v -> dialog.dismiss());
dialog.findViewById(R.id.pNext).setOnClickListener(v -> {
dialog.dismiss();
@ -404,7 +409,7 @@ class messageManager
/*External Helper Methods*/
void createMessage(AppCompatActivity app_context, List<String> data, enums.etype type)
void createMessage(AppCompatActivity app_context, List<Object> data, enums.etype type)
{
this.app_context = app_context;
this.data = data;

View File

@ -80,14 +80,11 @@ public class pluginController
public boolean isInitialized(){
return mIsInitialized;
}
void proxyManagerExitInvoke(){
}
/*---------------------------------------------- EXTERNAL REQUEST LISTENER-------------------------------------------------------*/
/*Message Manager*/
public void MessageManagerHandler(AppCompatActivity app_context,List<String> data,enums.etype type){
public void MessageManagerHandler(AppCompatActivity app_context,List<Object> data,enums.etype type){
mMessageManager.createMessage(app_context,data,type);
}
public void onResetMessage(){
@ -142,8 +139,7 @@ public class pluginController
public int getNotificationStatus(){
return orbotManager.getInstance().getNotificationStatus();
}
public void updateCookiesStatus(){
}
public void updateBridges(boolean p_status){
orbotManager.getInstance().updateBridges(p_status);
}
@ -156,7 +152,7 @@ public class pluginController
/*Ad Manager*/
private class admobCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype event_type)
public Object invokeObserver(List<Object> data, Object event_type)
{
mHomeController.onSetBannerAdMargin();
return null;
@ -166,7 +162,7 @@ public class pluginController
/*Analytics Manager*/
private class analyticCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype event_type)
public Object invokeObserver(List<Object> data, Object event_type)
{
mAnalyticManager.logUser();
return null;
@ -176,7 +172,7 @@ public class pluginController
/*Fabric Manager*/
private class fabricCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype event_type)
public Object invokeObserver(List<Object> data, Object event_type)
{
return null;
}
@ -185,7 +181,7 @@ public class pluginController
/*Firebase Manager*/
private class firebaseCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype event_type)
public Object invokeObserver(List<Object> data, Object event_type)
{
return null;
}
@ -194,7 +190,7 @@ public class pluginController
/*Lang Manager*/
private class langCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype event_type)
public Object invokeObserver(List<Object> data, Object event_type)
{
return null;
}
@ -203,18 +199,20 @@ public class pluginController
/*Onion Proxy Manager*/
private class orbotCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype event_type)
public Object invokeObserver(List<Object> data, Object event_type)
{
return null;
}
}
/*Lang Manager*/
public void setLanguage(AppCompatActivity context){
public void setLanguage(){
mLangManager.setDefaultLanguage(new Locale(status.sSettingLanguage));
}
public void onCreate(Activity activity) {
mLangManager.onCreate(activity);
if(activity==null || !activity.isDestroyed()){
mLangManager.onCreate(activity);
}
}
public void onResume(Activity activity) {
mLangManager.onResume(activity);
@ -223,7 +221,7 @@ public class pluginController
/*Message Manager*/
private class messageCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, enums.etype event_type)
public Object invokeObserver(List<Object> data, Object event_type)
{
if(event_type.equals(enums.etype.welcome))
{

View File

@ -1,7 +1,8 @@
<set xmlns:android="http://schemas.android.com/apk/res/android">
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:startOffset="250">
<alpha
android:duration="100"
android:fromAlpha="0.5"
android:duration="350"
android:fromAlpha="0.2"
android:interpolator="@android:anim/linear_interpolator"
android:toAlpha="1.0" />
</set>

View File

@ -1,6 +1,6 @@
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha
android:duration="100"
android:duration="0"
android:fromAlpha="1.0"
android:interpolator="@android:anim/linear_interpolator"
android:toAlpha="0.5" />

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:startOffset="250"
android:duration="500">
<translate
android:fromXDelta="-100%p"
android:interpolator="@android:anim/decelerate_interpolator"
android:toXDelta="0" />
<alpha
android:fromAlpha="0.5"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:toAlpha="1" />
</set>

View File

@ -0,0 +1,5 @@
<layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android"
android:delay="5%"
android:animationOrder="normal"
android:animation="@anim/fade_in">
</layoutAnimation>

View File

@ -0,0 +1,5 @@
<layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android"
android:delay="17%"
android:animationOrder="normal"
android:animation="@anim/fade_in">
</layoutAnimation>

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true"
android:fillEnabled="true">
<translate
android:duration="250"

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true"
android:fillEnabled="true">
<translate
android:duration="250"

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/holo_gray">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@color/holo_gray" />
<corners android:radius="5.5dp" />
</shape>
</item>
<item android:id="@android:id/background">
<shape android:shape="rectangle">
<gradient
android:angle="90"
android:endColor="@color/c_background_inverted"
android:startColor="@color/c_background_inverted"
android:type="linear" />
<corners android:radius="5.5dp" />
</shape>
</item>
</ripple>

View File

@ -0,0 +1,9 @@
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/c_ripple_v2">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@color/button_gray" />
<corners android:radius="00dp" />
</shape>
</item>
</ripple>

View File

@ -4,11 +4,11 @@
<item android:id="@android:id/mask" >
<shape android:shape="rectangle">
<solid android:color="@color/c_background"/>
<solid android:color="@color/c_alert_background"/>
<stroke
android:width="1dp"
android:color="@color/c_view_divier_background" />
android:color="@color/c_view_divier_background_v2" />
<corners
android:bottomLeftRadius="4dp"
@ -22,11 +22,11 @@
<item android:id="@android:id/background">
<shape android:shape="rectangle">
<solid android:color="@color/c_background"/>
<solid android:color="@color/c_view_divier_background_v1"/>
<stroke
android:width="1dp"
android:color="@color/c_view_divier_background" />
android:color="@color/c_view_divier_background_v2" />
<corners
android:bottomLeftRadius="4dp"
@ -36,8 +36,8 @@
<gradient
android:angle="90"
android:endColor="@color/c_background"
android:startColor="@color/c_background"
android:endColor="@color/c_alert_background"
android:startColor="@color/c_alert_background"
android:type="linear" />
</shape>
</item>

View File

@ -0,0 +1,11 @@
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/c_ripple">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@color/button_gray" />
<corners android:bottomLeftRadius="4dp"
android:bottomRightRadius="4dp"
/>
</shape>
</item>
</ripple>

View File

@ -0,0 +1,9 @@
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/c_ripple">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@color/button_gray" />
<corners android:topLeftRadius="4dp" />
</shape>
</item>
</ripple>

View File

@ -0,0 +1,9 @@
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/c_ripple">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@color/button_gray" />
<corners android:topRightRadius="4dp" />
</shape>
</item>
</ripple>

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M4,12l1.41,1.41L11,7.83V20h2V7.83l5.58,5.59L20,12l-8,-8 -8,8z"/>
</vector>

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,2C6.5,2 2,6.5 2,12s4.5,10 10,10s10,-4.5 10,-10S17.5,2 12,2zM16.2,16.2L11,13V7h1.5v5.2l4.5,2.7L16.2,16.2z"/>
</vector>

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z"/>
</vector>

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M7.41,8.59L12,13.17l4.59,-4.58L18,10l-6,6 -6,-6 1.41,-1.41z"/>
</vector>

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M8.59,16.59L13.17,12 8.59,7.41 10,6l6,6 -6,6 -1.41,-1.41z"/>
</vector>

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M7.41,15.41L12,10.83l4.59,4.58L18,14l-6,-6 -6,6z"/>
</vector>

View File

@ -3,7 +3,7 @@
<item android:left="0dp" android:right="-5dp" android:top="-5dp" android:bottom="-5dp">
<shape
android:shape="rectangle">
<stroke android:width="5dp" android:color="@color/c_border_left" />
<stroke android:width="4dp" android:color="@color/c_text_setting_heading" />
<solid android:color="@color/c_border_background" />
</shape>
</item>

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 638 B

View File

@ -89,7 +89,7 @@
android:clickable="false"
android:padding="0dp"
android:paddingStart="15dp"
android:text="@string/ALERT_WELCOME_MESSAGE_BT_1"
android:text="@string/ALERT_DOWNLOAD_OPTION_1"
android:textAlignment="textStart"
android:textAllCaps="false"
android:textColor="@color/c_alert_text"

View File

@ -0,0 +1,90 @@
<?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/pPopupFindContainer"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/pNavigationContainer"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:background="@color/c_background"
android:elevation="8dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<EditText
android:layout_width="0dp"
android:id="@+id/pFindText"
android:background="@color/c_background"
android:textColorHint="@color/c_hint_text"
android:layout_height="match_parent"
android:layout_weight="3"
android:focusedByDefault="true"
android:textSize="16sp"
android:padding="15dp"
android:hint="@string/GENERAL_FIND_HINT"
android:inputType="text"
android:importantForAutofill="yes"
android:autofillHints="yes">
</EditText>
<TextView
android:id="@+id/pFindCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAlignment="center"
android:layout_weight="1"/>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_marginRight="5dp"
android:background="@color/c_view_divier_background_inner_v1"
app:layout_constraintBottom_toTopOf="@+id/pNavigationContainer" />
<ImageButton
android:id="@+id/pFindPrevious"
android:layout_width="50dp"
android:layout_gravity="center"
android:layout_height="50dp"
android:onClick="onFindPrev"
android:background="@xml/gx_ripple_default_round"
android:src="@xml/ic_baseline_keyboard_arrow_up"
android:tint="@color/c_navigation_tint"
android:contentDescription="@string/GENERAL_TODO" />
<ImageButton
android:id="@+id/pFindNext"
android:layout_width="50dp"
android:layout_height="50dp"
android:onClick="onFindNext"
android:layout_gravity="center"
android:background="@xml/gx_ripple_default_round"
android:src="@xml/ic_baseline_keyboard_arrow_down"
android:tint="@color/c_navigation_tint"
android:contentDescription="@string/GENERAL_TODO" />
<ImageButton
android:id="@+id/pClose"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:onClick="onHideFindBar"
android:background="@xml/gx_ripple_default_round"
android:src="@xml/ic_close"
android:tint="@color/c_navigation_tint"
android:contentDescription="@string/GENERAL_TODO" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,61 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/pMainLayout"
android:layout_width="360dp"
android:layout_height="wrap_content"
android:layout_marginStart="26dp"
android:layout_marginEnd="25dp"
android:layout_marginBottom="25dp"
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:layout_marginTop="25dp"
android:alpha="0.6"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:text="@string/ALERT_UNDO_TAB_REMOVE_INFO"
android:textAlignment="textStart"
android:textStyle="bold"
android:textColor="@color/c_alert_text_inverted"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="SmallSp" />
<Button
android:id="@+id/pUndo"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:background="@xml/ax_ripple_default_round_right"
android:padding="0dp"
android:onClick="onRestoreTab"
android:text="@string/ALERT_UNDO_TAB_REMOVE_BUTTON"
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" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -92,6 +92,7 @@
android:scaleType="fitCenter"
android:src="@drawable/menu_item"
android:tint="@color/black" />
</LinearLayout>
<View

View File

@ -24,6 +24,8 @@
android:layout_width="match_parent"
android:layout_marginBottom="0dp"
android:focusable="true"
android:elevation="8dp"
android:background="@color/c_background"
android:orientation="horizontal"
android:layout_height="52dp">
<ImageButton
@ -44,18 +46,32 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40"
android:layout_marginTop="-3dp"
android:layout_marginTop="2dp"
android:layout_marginEnd="4dp"
android:gravity="center_vertical|start"
android:textStyle="bold"
android:text="@string/BRIDGE_HEADER"
/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="10dp"
android:background="@color/c_view_divier_background" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"/>
<ImageButton
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginStart="0dp"
android:scaleX="1.08"
android:scaleY="1.08"
android:layout_marginTop="3dp"
android:layout_marginEnd="7dp"
android:background="@xml/gx_ripple_default_round"
android:contentDescription="@string/GENERAL_TODO"
android:src="@xml/ic_baseline_info"
android:tint="@color/c_navigation_light" />
</LinearLayout>
<!-- Title Header -->
<LinearLayout

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -14,11 +14,11 @@
android:id="@+id/pHeaderContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/c_background"
android:clickable="true"
android:elevation="7dp"
android:focusable="true"
android:orientation="vertical"
android:background="@color/c_background"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
@ -28,10 +28,10 @@
android:layout_width="match_parent"
android:layout_height="48dp"
android:clickable="true"
android:paddingEnd="7dp"
android:paddingStart="5dp"
android:focusable="true"
android:orientation="horizontal"
android:paddingStart="5dp"
android:paddingEnd="7dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
@ -44,7 +44,7 @@
android:layout_marginTop="1dp"
android:background="@xml/gx_ripple_default_round"
android:contentDescription="@string/GENERAL_TODO"
android:onClick="onNewTabInvoked"
android:onClick="onBackPressed"
android:src="@xml/ic_arrow_back"
android:tint="@color/c_navigation_tint" />
@ -53,8 +53,8 @@
android:layout_height="match_parent"
android:layout_marginTop="-3dp"
android:layout_weight="40"
android:onClick="onNewTabInvoked"
android:gravity="center_vertical|start"
android:onClick="onBackPressed"
android:text="@string/HOME_TITLE"
android:textColor="@color/c_text_v1"
android:textSize="17sp"
@ -93,6 +93,85 @@
android:tint="@color/c_navigation_tint" />
</LinearLayout>
</LinearLayout>
<androidx.core.widget.NestedScrollView
android:id="@+id/mMainScroll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
android:paddingBottom="10dp"
android:layout_marginTop="48dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/pHeaderContainerBottom"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/c_background"
android:clickable="true"
android:focusable="true"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/pClearButton"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="0dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="0dp"
android:layout_weight="17"
android:background="@xml/gx_ripple_blue"
android:paddingStart="20dp"
android:stateListAnimator="@null"
android:text="@string/HOME_CLEAR"
android:textAlignment="textStart"
android:textColor="@color/c_text_setting_heading"
android:textSize="13sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="RtlSymmetry" />
<EditText
android:id="@+id/pSearchInput"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="0dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="0dp"
android:layout_marginBottom="0dp"
android:layout_weight="30"
android:background="@xml/gx_generic_input_square"
android:ems="10"
android:hint="@string/HOME_SEARCH_HINT"
android:importantForAutofill="no"
android:inputType="textNoSuggestions"
android:maxLines="1"
android:paddingStart="11dp"
android:paddingEnd="8dp"
android:textColor="@color/c_text_v1"
android:textColorHighlight="@color/text_color_highlight_v1"
android:textColorHint="@color/c_text_v2"
android:textCursorDrawable="@xml/gx_search_cursor_state"
android:textSize="15sp"
android:visibility="gone"
tools:targetApi="o" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
@ -100,78 +179,16 @@
android:paddingStart="10dp"
android:paddingEnd="10dp" />
<LinearLayout
android:id="@+id/pHeaderContainerBottom"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/c_background"
android:clickable="true"
android:focusable="true"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/pClearButton"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="0dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="0dp"
android:layout_weight="17"
android:background="@xml/gx_ripple_blue"
android:paddingStart="20dp"
android:stateListAnimator="@null"
android:text="@string/HOME_CLEAR"
android:textAlignment="textStart"
android:textColor="@color/c_text_setting_heading"
android:textSize="13sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="RtlSymmetry" />
<EditText
android:id="@+id/pSearchInput"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="0dp"
android:layout_weight="30"
android:layout_marginTop="0dp"
android:layout_marginEnd="0dp"
android:layout_marginBottom="0dp"
android:background="@xml/gx_generic_input_square"
android:ems="10"
android:hint="@string/HOME_SEARCH_HINT"
android:importantForAutofill="no"
android:inputType="textNoSuggestions"
android:maxLines="1"
android:paddingStart="11dp"
android:paddingEnd="8dp"
android:textColorHint="@color/c_text_v2"
android:textColor="@color/c_text_v1"
android:textColorHighlight="@color/text_color_highlight_v1"
android:textCursorDrawable="@xml/gx_search_cursor_state"
android:textSize="15sp"
android:visibility="gone"
tools:targetApi="o" />
</LinearLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/pRecycleView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="97dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/pHeaderContainer" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<ImageView
android:id="@+id/pEmptyListNotification"
android:layout_width="130dp"

View File

@ -12,7 +12,8 @@
android:id="@+id/pHeaderContainerTop"
android:layout_width="match_parent"
android:layout_height="48dp"
android:elevation="7dp"
android:elevation="8dp"
android:background="@color/c_background"
android:clickable="true"
android:focusable="true"
android:orientation="horizontal"
@ -46,6 +47,23 @@
android:textSize="17sp"
android:textStyle="bold" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"/>
<ImageButton
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginStart="0dp"
android:scaleX="1.08"
android:scaleY="1.08"
android:layout_marginTop="1dp"
android:background="@xml/gx_ripple_default_round"
android:contentDescription="@string/GENERAL_TODO"
android:src="@xml/ic_baseline_info"
android:tint="@color/c_navigation_light" />
</LinearLayout>
@ -66,11 +84,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/c_view_divier_background" />
<Button
android:id="@+id/langEnglish"
android:layout_width="match_parent"

View File

@ -18,6 +18,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_marginBottom="0dp"
android:elevation="8dp"
android:background="@color/c_background"
android:orientation="horizontal"
android:layout_height="52dp">
<ImageButton
@ -43,13 +45,26 @@
android:textStyle="bold"
android:text="@string/ORBOT_HEADER"
/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="10dp"
android:background="@color/c_view_divier_background" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"/>
<ImageButton
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginStart="0dp"
android:scaleX="1.08"
android:scaleY="1.08"
android:layout_marginTop="3dp"
android:layout_marginEnd="7dp"
android:background="@xml/gx_ripple_default_round"
android:contentDescription="@string/GENERAL_TODO"
android:src="@xml/ic_baseline_info"
android:tint="@color/c_navigation_light" />
</LinearLayout>
<!-- Title Header -->
<LinearLayout
@ -220,7 +235,7 @@
android:paddingTop="2dp"
android:layout_marginTop="-3dp"
android:scaleType="fitCenter"
android:src="@xml/ic_gateway_splash"
android:src="@xml/ic_gear"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/GENERAL_TODO"
app:tint="@color/c_navigation_tint" />

View File

@ -1,117 +1,172 @@
<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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/c_background">
<ScrollView
android:layout_width="match_parent"
android:isScrollContainer="true"
android:id="@+id/pScollview"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="8dp"
android:orientation="horizontal"
android:clipToPadding="false"
android:background="@color/c_background"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageButton
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginStart="0dp"
android:layout_marginTop="1dp"
android:background="@xml/gx_ripple_default_round"
android:contentDescription="@string/GENERAL_TODO"
android:onClick="onClose"
android:src="@xml/ic_arrow_back"
android:tint="@color/c_navigation_tint" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginTop="-3dp"
android:layout_weight="40"
android:gravity="center_vertical|start"
android:paddingStart="10dp"
android:onClick="onClose"
android:text="@string/ORBOT_LOG"
android:textColor="@color/c_text_v1"
android:textSize="17sp"
android:textStyle="bold"
tools:ignore="RtlSymmetry" />
<ImageButton
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginStart="0dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="2dp"
android:background="@xml/gx_ripple_default_round"
android:contentDescription="@string/GENERAL_TODO"
android:onClick="openLogSettings"
android:src="@xml/ic_gear"
android:tint="@color/c_navigation_tint" />
<ImageButton
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginStart="0dp"
android:scaleX="1.08"
android:scaleY="1.08"
android:layout_marginTop="0dp"
android:padding="5dp"
android:background="@xml/gx_ripple_default_round"
android:contentDescription="@string/GENERAL_TODO"
android:src="@xml/ic_baseline_info"
android:tint="@color/c_navigation_light" />
</LinearLayout>
<androidx.core.widget.NestedScrollView
android:id="@+id/mMainScroll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
android:paddingBottom="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout2">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:paddingBottom="50dp"
android:layout_height="wrap_content">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="15dp"
android:orientation="vertical"
android:paddingBottom="50dp">
<!-- Title Header -->
<LinearLayout
android:layout_width="match_parent"
android:layout_marginBottom="0dp"
android:orientation="horizontal"
android:layout_height="52dp">
<ImageButton
android:layout_width="20dp"
android:layout_height="45dp"
android:onClick="onClose"
android:layout_marginTop="3dp"
android:layout_marginStart="3dp"
android:layout_weight="2.5"
android:tint="@color/c_navigation_tint"
android:src="@xml/ic_arrow_back"
android:background="@xml/gx_ripple_default_round"
android:contentDescription="@string/GENERAL_TODO"/>
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="0dp"
android:background="@color/c_background"
android:orientation="horizontal">
<TextView
android:textColor="@color/c_text_v1"
android:onClick="onClose"
android:textSize="17sp"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_weight="40"
android:layout_marginTop="-3dp"
android:gravity="center_vertical|start"
android:textStyle="bold"
android:text="@string/ORBOT_LOG"
/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="10dp"
android:background="@color/c_view_divier_background" />
<!-- Title Header -->
<LinearLayout
android:layout_width="match_parent"
android:background="@color/c_background"
android:layout_marginBottom="0dp"
android:orientation="horizontal"
android:layout_height="40dp">
<TextView
android:textColor="@color/c_text_setting_heading"
android:textSize="16sp"
android:layout_width="0dp"
android:textStyle="bold"
android:layout_height="wrap_content"
android:layout_weight="40"
android:layout_marginTop="10dp"
android:layout_marginStart="14dp"
android:text="@string/ORBOT_LOG_HEADER"
/>
android:text="@string/ORBOT_LOG_HEADER"
android:textColor="@color/c_text_setting_heading"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:background="@color/clear_alpha"
android:layout_marginBottom="0dp"
android:layout_marginEnd = "20dp"
android:orientation="horizontal"
android:layout_height="wrap_content">
<TextView
android:textSize="14sp"
android:layout_width="0dp"
android:textColor="@color/c_text_v2"
android:paddingBottom="10dp"
android:layout_height="wrap_content"
android:layout_weight="40"
android:background="@color/clear_alpha"
android:layout_marginStart="15dp"
android:text="@string/ORBOT_LOG_INFO"
/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:background="@color/warning" />
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginBottom="0dp"
android:background="@color/clear_alpha"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="40"
android:background="@color/clear_alpha"
android:paddingBottom="10dp"
android:text="@string/ORBOT_LOG_INFO"
android:textColor="@color/c_text_v2"
android:textSize="14sp" />
</LinearLayout>
<TextView
android:id="@+id/pLogs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="12dp"
android:paddingStart="5dp"
android:paddingEnd="20dp"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:background="@xml/sx_border_left"
android:layout_marginStart="10dp"
android:paddingStart="10dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:textColor="@color/c_text_v4"
android:textSize="14sp"
android:text="@string/HOME_LOADING_STATIC" />
android:visibility="gone"
android:text="@string/HOME_LOADING_STATIC"
tools:ignore="RtlSymmetry" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/pLogRecycleView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutAnimation="@anim/log_layout_controller"
android:nestedScrollingEnabled="false"/>
</LinearLayout>
</ScrollView>
</androidx.core.widget.NestedScrollView>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/pFloatingScroller"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0"
android:visibility="gone"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:onClick="onScrollTop"
android:clickable="true"
android:tint="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@xml/ic_baseline_arrow_upward"
android:focusable="true"
android:contentDescription="@string/GENERAL_TODO" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,29 +1,31 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/c_background"
tools:context="com.darkweb.genesissearchengine.appManager.homeManager.homeController">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/c_background"
tools:context="com.darkweb.genesissearchengine.appManager.homeManager.homeController">
<FrameLayout
android:id="@+id/webviewContainer"
android:layout_width="match_parent"
android:layout_marginTop="55dp"
android:id="@+id/webviewContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="60dp"
android:background="@color/c_background"
android:layout_height="match_parent">
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/frameLayout">
<org.mozilla.geckoview.GeckoView
android:id="@+id/pWebView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="0dp"
android:background="@color/c_background"
android:alpha="1"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp" >
android:id="@+id/pWebView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="0dp"
android:alpha="1"
android:background="@color/c_background"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp">
</org.mozilla.geckoview.GeckoView>
@ -31,127 +33,130 @@
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="71dp"
android:background="#00000000"
app:layout_constraintTop_toTopOf="parent">
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="71dp"
android:background="#00000000"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:id="@+id/topbar"
android:id="@+id/topbar"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@xml/ic_secondary_gradinet"
android:elevation="7dp"
android:gravity="left"
android:orientation="vertical"
android:paddingBottom="1dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded,UselessParent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_height="match_parent"
android:elevation="7dp"
android:background="@xml/ic_secondary_gradinet"
android:gravity="left"
android:paddingBottom="1dp"
android:orientation="vertical"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded,UselessParent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="7dp"
android:gravity="left"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded,UselessParent">
<AutoCompleteTextView
android:id="@+id/pSearchInput"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:layout_marginEnd="0dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:layout_weight="1"
android:background="@xml/gx_generic_input"
android:completionHintView="@layout/hint_view"
android:ems="10"
android:popupElevation="5dp"
android:hint="@string/GENERAL_SEARCH_HINT"
android:inputType="textNoSuggestions"
android:importantForAutofill="no"
android:maxLines="1"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:selectAllOnFocus="true"
android:text="@string/GENERAL_HOME_URL"
android:textColor="@color/c_text_v1"
android:textColorHint="@color/c_text_v1"
android:textColorHighlight="@color/c_alert_background"
android:textCursorDrawable="@xml/gx_search_cursor_state"
android:textSize="16sp"
tools:targetApi="o" />
android:id="@+id/pSearchInput"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="0dp"
android:layout_marginBottom="8dp"
android:layout_weight="1"
android:background="@xml/gx_generic_input"
android:completionHintView="@layout/hint_view"
android:ems="10"
android:hint="@string/GENERAL_SEARCH_HINT"
android:importantForAutofill="no"
android:inputType="textNoSuggestions"
android:maxLines="1"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:popupElevation="5dp"
android:selectAllOnFocus="true"
android:text="@string/GENERAL_HOME_URL"
android:textColor="@color/c_text_v1"
android:textColorHighlight="@color/text_color_highlight_v3"
android:textColorHint="@color/c_text_v1"
android:textCursorDrawable="@xml/gx_search_cursor_state"
android:textSize="16sp"
tools:targetApi="o" />
<LinearLayout
android:layout_width="40dp"
android:layout_height="match_parent"
android:gravity="left"
android:onClick="onOpenTabViewBoundary"
android:paddingBottom="1dp">
<Button
android:id="@+id/newButtonInvoke"
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_marginStart="12dp"
android:layout_marginEnd="13dp"
android:layout_marginTop="17dp"
android:text="@string/HOME_TAB_TEXT"
android:textColor="@color/c_text_v1"
android:clickable="false"
android:textSize="12.5sp"
android:layout_marginBottom="0dp"
android:background="@xml/gx_generic_tab_button"
android:contentDescription="@string/GENERAL_TODO"
android:scaleType="fitCenter"
android:tint="@color/black" />
</LinearLayout>
<LinearLayout
android:layout_width="40dp"
android:layout_height="match_parent"
android:gravity="left"
android:onClick="onOpenTabViewBoundary"
android:paddingBottom="1dp">
<Button
android:id="@+id/newButtonInvoke"
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_marginStart="12dp"
android:layout_marginTop="17dp"
android:layout_marginEnd="13dp"
android:layout_marginBottom="0dp"
android:background="@xml/gx_generic_tab_button"
android:clickable="false"
android:contentDescription="@string/GENERAL_TODO"
android:scaleType="fitCenter"
android:text="@string/HOME_TAB_TEXT"
android:textColor="@color/c_text_v1"
android:textSize="12.5sp"
android:tint="@color/black" />
</LinearLayout>
<ImageButton
android:id="@+id/menu"
android:layout_width="35dp"
android:layout_height="wrap_content"
android:layout_marginTop="-4dp"
android:layout_marginEnd="0dp"
android:background="@xml/gx_ripple_gray"
android:contentDescription="@string/GENERAL_TODO"
android:tint="@color/c_navigation_tint"
android:paddingLeft="8dp"
android:paddingTop="15dp"
android:onClick="onOpenMenuItem"
android:paddingRight="8dp"
android:paddingBottom="15dp"
android:scaleType="fitCenter"
android:src="@drawable/menu_item" />
android:id="@+id/menu"
android:layout_width="35dp"
android:layout_height="wrap_content"
android:layout_marginTop="-4dp"
android:layout_marginEnd="0dp"
android:background="@xml/gx_ripple_gray"
android:contentDescription="@string/GENERAL_TODO"
android:onClick="onOpenMenuItem"
android:paddingLeft="8dp"
android:paddingTop="15dp"
android:paddingRight="8dp"
android:paddingBottom="15dp"
android:scaleType="fitCenter"
android:src="@drawable/menu_item"
android:tint="@color/c_navigation_tint" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.darkweb.genesissearchengine.widget.AnimatedProgressBar
android:id="@+id/progressBar"
style="@style/Base.Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="4dp"
android:alpha="0"
android:progressDrawable="@xml/hox_photon_progress"
app:shiftDuration="@integer/progress_shift_duration"
app:wrapShiftDrawable="true"
android:layout_marginTop="55.9dp"
android:progress="0"
android:max="10000"
android:scaleY="0.7"
tools:progress="0"
app:layout_constraintTop_toTopOf="parent" />
android:id="@+id/progressBar"
style="@style/Base.Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="4dp"
android:layout_marginTop="55.9dp"
android:alpha="0"
android:max="10000"
android:progress="0"
android:progressDrawable="@xml/hox_photon_progress"
android:scaleY="0.7"
app:layout_constraintTop_toTopOf="parent"
app:shiftDuration="@integer/progress_shift_duration"
app:wrapShiftDrawable="true"
tools:progress="0" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/splashScreen"
@ -163,11 +168,11 @@
<LinearLayout
android:layout_width="wrap_content"
android:background="@xml/hox_rounded_corner_container_bottom"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:background="@xml/hox_rounded_corner_container_bottom"
android:orientation="vertical"
android:padding="10dp"
android:layout_marginRight="10dp"
android:translationZ="11dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
@ -218,7 +223,7 @@
android:contentDescription="@string/GENERAL_TODO"
android:elevation="2dp"
android:onClick="onLoadProxy"
android:src="@xml/ic_gateway_splash"
android:src="@xml/ic_gear"
android:tint="@color/black"
app:layout_constraintStart_toEndOf="@+id/Connect"
app:layout_constraintTop_toTopOf="@+id/Connect" />
@ -260,36 +265,51 @@
</FrameLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:layout_width="wrap_content"
android:src="@drawable/icon_ban"
android:layout_height="wrap_content"
android:alpha="0"
app:borderWidth="0dp"
app:elevation="10dp"
android:backgroundTint="@color/white"
android:clickable="true" app:srcCompat="?attr/actionModeSelectAllDrawable"
android:id="@+id/floatingActionButton3" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginBottom="24dp"
android:layout_marginEnd="24dp"
android:focusable="true" />
android:id="@+id/floatingActionButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:layout_marginBottom="24dp"
android:alpha="0"
android:backgroundTint="@color/white"
android:clickable="true"
android:contentDescription="@string/GENERAL_TODO"
android:focusable="true"
android:src="@drawable/icon_ban"
app:borderWidth="0dp"
app:elevation="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="?attr/actionModeSelectAllDrawable"
tools:ignore="ExtraText" />
<com.google.android.gms.ads.AdView xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="395dp"
android:background="@color/holo_dark_gray"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="54.9dp"
android:alpha="0"
ads:adSize="SMART_BANNER"
ads:adUnitId="ca-app-pub-5074525529134731/7816565677"
ads:layout_constraintEnd_toEndOf="parent"
ads:layout_constraintHorizontal_bias="0.5"
ads:layout_constraintStart_toStartOf="parent"
ads:layout_constraintTop_toTopOf="parent" />
android:id="@+id/adView"
android:layout_width="395dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="54.9dp"
android:alpha="0"
android:background="@color/holo_dark_gray"
ads:adSize="SMART_BANNER"
ads:adUnitId="ca-app-pub-5074525529134731/7816565677"
ads:layout_constraintEnd_toEndOf="parent"
ads:layout_constraintHorizontal_bias="0.5"
ads:layout_constraintStart_toStartOf="parent"
ads:layout_constraintTop_toTopOf="parent" />
<include
android:id="@+id/pFindBar"
layout="@layout/popup_find"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="8dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/frameLayout" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -7,45 +7,47 @@
android:layout_height="wrap_content">
<ScrollView
android:layout_width="260dp"
android:layout_height="match_parent"
android:layout_marginBottom="20dp"
android:layout_marginEnd="5dp"
android:layout_marginTop="8dp"
android:elevation="4dp"
android:background="@xml/gx_side_menu"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_width="260dp"
android:layout_height="match_parent"
android:layout_marginStart="5dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="60dp"
android:background="@xml/gx_side_menu"
android:elevation="4dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
<LinearLayout
android:layout_width="259dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="1dp"
android:layout_marginTop="1dp"
android:layout_marginRight="1dp"
android:background="@color/clear_alpha"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="259dp"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:layout_marginTop="1dp"
android:layout_marginRight="1dp"
android:background="@color/clear_alpha"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageButton
android:id="@+id/menu24"
android:layout_width="wrap_content"
android:layout_height="52dp"
android:layout_weight="1"
android:background="@xml/gx_ripple_gray"
android:tint="@color/c_navigation_tint"
android:onClick="onMenuItemInvoked"
android:src="@xml/ic_home"
android:contentDescription="@string/GENERAL_TODO" />
android:id="@+id/menu24"
android:layout_width="wrap_content"
android:layout_height="52dp"
android:layout_weight="1"
android:background="@xml/gx_ripple_gray_top_left"
android:contentDescription="@string/GENERAL_TODO"
android:onClick="onMenuItemInvoked"
android:src="@xml/ic_home"
android:tint="@color/c_navigation_tint" />
<ImageButton
android:id="@+id/menu23"
@ -53,239 +55,264 @@
android:layout_height="52dp"
android:layout_weight="1"
android:background="@xml/gx_ripple_gray"
android:tint="@color/c_navigation_tint"
android:contentDescription="@string/GENERAL_TODO"
android:onClick="onMenuItemInvoked"
android:src="@xml/ic_baseline_bookmark"
android:contentDescription="@string/GENERAL_TODO" />
android:tint="@color/c_navigation_tint" />
<ImageButton
android:id="@+id/menu22"
android:layout_width="wrap_content"
android:layout_height="52dp"
android:layout_weight="1"
android:background="@xml/gx_ripple_gray"
android:tint="@color/c_navigation_tint"
android:onClick="onMenuItemInvoked"
android:src="@xml/ic_arrow_right"
android:contentDescription="@string/GENERAL_TODO" />
android:id="@+id/menu22"
android:layout_width="wrap_content"
android:layout_height="52dp"
android:layout_weight="1"
android:background="@xml/gx_ripple_gray"
android:contentDescription="@string/GENERAL_TODO"
android:onClick="onMenuItemInvoked"
android:src="@xml/ic_arrow_right"
android:tint="@color/c_navigation_tint" />
<ImageButton
android:id="@+id/menu21"
android:layout_width="wrap_content"
android:layout_height="52dp"
android:layout_weight="1"
android:background="@xml/gx_ripple_gray"
android:tint="@color/c_navigation_tint"
android:onClick="onMenuItemInvoked"
android:src="@xml/ic_refresh"
android:contentDescription="@string/GENERAL_TODO" />
android:id="@+id/menu21"
android:layout_width="wrap_content"
android:layout_height="52dp"
android:layout_weight="1"
android:background="@xml/gx_ripple_gray"
android:contentDescription="@string/GENERAL_TODO"
android:onClick="onMenuItemInvoked"
android:src="@xml/ic_refresh"
android:tint="@color/c_navigation_tint" />
<ImageButton
android:id="@+id/menu20"
android:layout_width="wrap_content"
android:layout_height="52dp"
android:layout_gravity="center"
android:layout_weight="1"
android:background="@xml/gx_ripple_gray"
android:tint="@color/c_navigation_tint"
android:onClick="onMenuItemInvoked"
android:src="@xml/ic_close"
android:contentDescription="@string/GENERAL_TODO" />
android:id="@+id/menu20"
android:layout_width="wrap_content"
android:layout_height="52dp"
android:layout_gravity="center"
android:layout_weight="1"
android:background="@xml/gx_ripple_gray_top_right"
android:contentDescription="@string/GENERAL_TODO"
android:onClick="onMenuItemInvoked"
android:src="@xml/ic_close"
android:tint="@color/c_navigation_tint" />
</LinearLayout>
<Button
<TextView
android:id="@+id/menu11"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@xml/gx_side_item"
android:gravity="left|center_vertical"
android:onClick="onMenuItemInvoked"
android:paddingStart="18dp"
android:text="@string/HOME_MENU__NEW_TABS"
android:textAllCaps="false"
android:textColor="@color/c_text_home_menu"
android:textSize="16sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView
android:id="@+id/menu12"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@xml/gx_side_item"
android:gravity="left|center_vertical"
android:onClick="onMenuItemInvoked"
android:paddingStart="15dp"
android:paddingStart="18dp"
android:text="@string/HOME_MENU__ORBOT_LOGS"
android:textColor="@color/c_text_v1"
android:textSize="14sp"
android:textAllCaps="false"
android:textColor="@color/c_text_home_menu"
android:textSize="16sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<Button
android:id="@+id/menu11"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@xml/gx_side_item"
android:gravity="left|center_vertical"
android:onClick="onMenuItemInvoked"
android:paddingStart="15dp"
android:text="@string/HOME_MENU__NEW_TABS"
android:textColor="@color/c_text_v1"
android:textSize="14sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<Button
<TextView
android:id="@+id/pMenuOpenNewTab"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@xml/gx_side_item"
android:gravity="left|center_vertical"
android:onClick="onMenuItemInvoked"
android:paddingStart="15dp"
android:paddingStart="18dp"
android:text="@string/HOME_MENU_OPEN_BOOKMARK"
android:textColor="@color/c_text_v1"
android:textSize="14sp"
android:textAllCaps="false"
android:textColor="@color/c_text_home_menu"
android:textSize="16sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<Button
<TextView
android:id="@+id/menu7"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@xml/gx_side_item"
android:gravity="left|center_vertical"
android:onClick="onMenuItemInvoked"
android:paddingLeft="15dp"
android:paddingStart="18dp"
android:text="@string/HOME_MENU_HISTORY"
android:textColor="@color/c_text_v1"
android:textSize="14sp"
android:textAllCaps="false"
android:textColor="@color/c_text_home_menu"
android:textSize="16sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<Button
<TextView
android:id="@+id/menu8"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@xml/gx_side_item"
android:gravity="left|center_vertical"
android:onClick="onMenuItemInvoked"
android:paddingLeft="15dp"
android:paddingStart="18dp"
android:text="@string/HOME_MENU_DOWNLOAD"
android:textColor="@color/c_text_v1"
android:textSize="14sp"
android:textAllCaps="false"
android:textColor="@color/c_text_home_menu"
android:textSize="16sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<Button
<TextView
android:id="@+id/menu25"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@xml/gx_side_item"
android:gravity="left|center_vertical"
android:onClick="onMenuItemInvoked"
android:paddingLeft="15dp"
android:paddingStart="18dp"
android:text="@string/HOME_MENU_LANGUAGE"
android:textColor="@color/c_text_v1"
android:textSize="14sp"
android:textAllCaps="false"
android:textColor="@color/c_text_home_menu"
android:textSize="16sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<Button
<TextView
android:id="@+id/pMenuShare"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@xml/gx_side_item"
android:gravity="left|center_vertical"
android:onClick="onMenuItemInvoked"
android:paddingLeft="15dp"
android:paddingStart="18dp"
android:text="@string/HOME_MENU_RATE"
android:textColor="@color/c_text_v1"
android:textSize="14sp"
android:textAllCaps="false"
android:textColor="@color/c_text_home_menu"
android:textSize="16sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView
android:id="@+id/pMenuFind"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@xml/gx_side_item"
android:gravity="left|center_vertical"
android:onClick="onMenuItemInvoked"
android:paddingStart="18dp"
android:text="@string/HOME_MENU_FIND"
android:textAllCaps="false"
android:textColor="@color/c_text_home_menu"
android:textSize="16sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<LinearLayout
android:id="@+id/menu26"
android:background="@xml/gx_side_item"
android:layout_width="259dp"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:layout_marginTop="1dp"
android:layout_marginRight="1dp"
android:orientation="horizontal"
android:background="@xml/gx_side_item"
android:clickable="true"
android:focusable="true"
android:onClick="onMenuItemInvoked"
android:orientation="horizontal"
android:textAllCaps="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
<TextView
android:id="@+id/menu28"
android:layout_width="0dp"
android:layout_weight="4"
android:layout_height="50dp"
android:background="@xml/gx_side_item"
android:gravity="left|center_vertical"
android:layout_weight="4"
android:background="@color/clear_alpha"
android:clickable="false"
android:focusable="false"
android:gravity="left|center_vertical"
android:onClick="onMenuItemInvoked"
android:paddingLeft="15dp"
android:paddingStart="16dp"
android:text="@string/HOME_MENU_DESKTOP"
android:textColor="@color/c_text_v1"
android:textSize="14sp"
android:textAllCaps="false"
android:textColor="@color/c_text_home_menu"
android:textSize="16sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<com.google.android.material.checkbox.MaterialCheckBox
android:id="@+id/menu27"
android:clickable="false"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="50dp"
android:background="@color/c_background"
android:onClick="onMenuItemInvoked"
android:buttonTint="@color/c_navigation_tint"
android:gravity="left|center_vertical"
android:layout_marginLeft="15dp"
android:layout_weight="1"
android:background="@color/clear_alpha"
android:buttonTint="@color/c_navigation_tint"
android:clickable="false"
android:focusable="false"
android:gravity="left|center_vertical"
android:paddingLeft="20dp"
android:textColor="@color/c_text_v1"
android:textSize="14sp"
android:textColor="@color/c_text_home_menu"
android:textSize="16sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
</LinearLayout>
<Button
<TextView
android:id="@+id/menu6"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@xml/gx_side_item"
android:gravity="left|center_vertical"
android:onClick="onMenuItemInvoked"
android:paddingLeft="15dp"
android:paddingStart="18dp"
android:text="@string/HOME_MENU_SETTING"
android:textColor="@color/c_text_v1"
android:textSize="14sp"
android:textAllCaps="false"
android:textColor="@color/c_text_home_menu"
android:textSize="16sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<Button
<TextView
android:id="@+id/menu30"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@xml/gx_side_item"
android:gravity="left|center_vertical"
android:onClick="onMenuItemInvoked"
android:paddingLeft="15dp"
android:paddingStart="18dp"
android:text="@string/HOME_CHARACTER_ENCODING"
android:textColor="@color/c_text_v1"
android:textSize="14sp"
android:textAllCaps="false"
android:textColor="@color/c_text_home_menu"
android:textSize="16sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<Button
android:id="@+id/pMenuOpenCurrentTab"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@xml/gx_side_item"
android:gravity="left|center_vertical"
android:onClick="onMenuItemInvoked"
android:paddingLeft="15dp"
android:text="@string/HOME_MENU_REPORT"
android:textColor="@color/c_text_v1"
android:textSize="14sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<View
<TextView
android:id="@+id/pMenuOpenCurrentTab"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/c_view_divier_background_inner"
android:paddingStart="10dp"
android:paddingEnd="10dp" />
android:layout_height="50dp"
android:background="@xml/gx_side_item"
android:gravity="left|center_vertical"
android:onClick="onMenuItemInvoked"
android:paddingStart="18dp"
android:text="@string/HOME_MENU_REPORT"
android:textAllCaps="false"
android:textColor="@color/c_text_home_menu"
android:textSize="16sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<Button
android:id="@+id/pMenuCopy"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@xml/gx_ripple_gray"
android:gravity="left|center_vertical"
android:onClick="onMenuItemInvoked"
android:paddingLeft="15dp"
android:text="@string/HOME_MENU_SHARE"
android:textColor="@color/c_text_v1"
android:textSize="14sp"
<TextView
android:id="@+id/pMenuCopy"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@xml/gx_ripple_gray_bottom"
android:gravity="left|center_vertical"
android:onClick="onMenuItemInvoked"
android:paddingStart="18dp"
android:text="@string/HOME_MENU_SHARE"
android:textAllCaps="false"
android:textColor="@color/c_text_home_menu"
android:textSize="16sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
</LinearLayout>
</ScrollView>

Some files were not shown because too many files have changed in this diff Show More