mirror of https://github.com/LeOS-GSI/LeOS-Genesis
parent
46f3fd8d78
commit
8418376554
|
@ -13,21 +13,22 @@
|
|||
|
||||
<!--Javascripts-->
|
||||
<script defer src="../resources/javascript/fontawesome.js"></script>
|
||||
<script src="../resources/javascript/jquery.js"></script>
|
||||
<script src="../resources/javascript/js-jquery.js"></script>
|
||||
<script src="../resources/javascript/bootstrap.bundle.min.js"></script>
|
||||
<script type="../resources/javascript/bootstrap.js"></script>
|
||||
<script type="../resources/javascript/bootstrap.min.js"></script>
|
||||
|
||||
<script src="javascript/enum-homepage.js"></script>
|
||||
<script src="javascript/string-homepage.js"></script>
|
||||
<script src="javascript/js-homepage.js"></script>
|
||||
|
||||
<!--Meta Data-->
|
||||
<title>Genesis Search Engine | Dark Web Based Search Engine</title>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="Darkweb or Deepweb Search Engine working on multiple layered network including i2p,onion and riddle. Optimized Searches with mobile support and seperate Mobile Apps">
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<div class="hi_container_size">
|
||||
<!--top bar-->
|
||||
|
@ -50,13 +51,32 @@
|
|||
|
||||
|
||||
<p class="hi_search__language-text gs-disable-highlight">Privacy, simplified <span class="hi_search__language-name ">Help Spread Genesis!</span></p>
|
||||
|
||||
<!--reference websites-->
|
||||
|
||||
</form>
|
||||
|
||||
<hr class="line-style">
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
<div id="mReferenceWebsites">
|
||||
<div class="hi_reference">
|
||||
<div class="clearfix content-heading">
|
||||
<div class="hi_loader"></div>
|
||||
<hr style="height:10px;border-width:0;color:gray;background-color:#cccccc;margin-left: 15px">
|
||||
<hr style="height:10px;border-width:0;color:gray;background-color:#cccccc;margin-left: 15px">
|
||||
<hr style="height:10px;border-width:0;color:gray;background-color:#cccccc;margin-right: 15%">
|
||||
<hr style="height:10px;border-width:0;color:gray;background-color:#cccccc;margin-right: 10%">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<!--footer-->
|
||||
<div class="footer-bar-container">
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
/*Enums*/
|
||||
|
||||
var Commands = {
|
||||
onLoadReferenceWebsites : "onLoadReferenceWebsites",
|
||||
};
|
||||
|
||||
/*Links*/
|
||||
|
||||
var GET = {
|
||||
pData : "pData",
|
||||
};
|
||||
|
||||
|
||||
var UIID = {
|
||||
mReferenceWebsites : "mReferenceWebsites",
|
||||
};
|
||||
|
||||
var ReferenceWebsitesDataID = {
|
||||
mIcon : "mIcon",
|
||||
mHeader : "mHeader",
|
||||
mBody : "mBody",
|
||||
};
|
|
@ -0,0 +1,56 @@
|
|||
|
||||
/*Homepage Classes*/
|
||||
|
||||
class homepage {
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
/*Helper Methods*/
|
||||
|
||||
onLoadReferenceWebsites(){
|
||||
document.getElementById('mReferenceWebsites').className = 'hide';
|
||||
}
|
||||
|
||||
onLoadReferenceWebsiteContent(mJson){
|
||||
var mResponseJson = mJson;
|
||||
var obj = JSON.parse(mResponseJson);
|
||||
var mReferenceHTML = strings.emptyString;
|
||||
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
var mObject = obj[key];
|
||||
mReferenceHTML += '<div class="hi_reference"><div class="clearfix content-heading"> <img style="float:left" src='+mObject[ReferenceWebsitesDataID.mIcon]+' alt="" /><h6 style="margin-left: 40px;padding-top:5px">'+mObject[ReferenceWebsitesDataID.mHeader]+'</h5><p style="margin-left: 0px;line-height: 18px;margin-top: 20px;color: #8c8c8c;font-size: 15px">'+mObject[ReferenceWebsitesDataID.mBody]+'</p></div></div>'
|
||||
});
|
||||
|
||||
|
||||
var mReferenceID = document.getElementById(UIID.mReferenceWebsites);
|
||||
mReferenceID.innerHTML = mReferenceHTML;
|
||||
|
||||
document.getElementById('mReferenceWebsites').className = 'show';
|
||||
}
|
||||
|
||||
/*Ajax Request*/
|
||||
|
||||
onParseReferenceWebsites() {
|
||||
var $_GET=[];
|
||||
decodeURIComponent(window.location.href).replace(/[?&]+([^=&]+)=([^&]*)/gi,function(a,name,value){$_GET[name]=value;});
|
||||
|
||||
setTimeout(mHomepageLoader.onLoadReferenceWebsites, 500);
|
||||
setTimeout(mHomepageLoader.onLoadReferenceWebsiteContent, 1000, $_GET[GET.pData]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
let mHomepageLoader = new homepage();
|
||||
|
||||
/*Helper Classes Manager*/
|
||||
function onTriggerScriptHandler(pCommand) {
|
||||
if(pCommand == Commands.onLoadReferenceWebsites){
|
||||
mHomepageLoader.onParseReferenceWebsites()
|
||||
}
|
||||
}
|
||||
|
||||
/*Default Loaders*/
|
||||
$(window).on('load', function() {
|
||||
onTriggerScriptHandler(Commands.onLoadReferenceWebsites)
|
||||
});
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
/*Strings*/
|
||||
|
||||
var strings = {
|
||||
emptyString : "",
|
||||
};
|
|
@ -75,6 +75,31 @@
|
|||
transition: .0s;
|
||||
}
|
||||
|
||||
.hi_reference{
|
||||
align-self: center;
|
||||
height:auto;
|
||||
padding: 10px;
|
||||
padding-bottom: 0px;
|
||||
border-radius: 6px;
|
||||
outline: none;
|
||||
|
||||
border: 1px solid #f0f0f0;
|
||||
box-shadow: 0 3px 3px 0 #cccccc;
|
||||
width:91% !important;
|
||||
max-width: 575px;
|
||||
display:block;
|
||||
font:16px arial,sans-serif;
|
||||
color: black;
|
||||
margin: 0 auto 0px;
|
||||
margin-top: -15px;
|
||||
margin-bottom: 35px;
|
||||
|
||||
-webkit-transition: .0s;
|
||||
-moz-transition: .0s;
|
||||
-o-transition: .0s;
|
||||
transition: .0s;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 943px) {
|
||||
.hi_search__search-box {
|
||||
margin-top: 30px;
|
||||
|
@ -192,3 +217,35 @@
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
.hi_loader {
|
||||
border: 4px solid #f3f3f3;
|
||||
border-radius: 50%;
|
||||
border-top: 4px solid #3498db;
|
||||
width: 30px;
|
||||
float: left;
|
||||
height: 30px;
|
||||
-webkit-animation: spin 2s linear infinite; /* Safari */
|
||||
animation: spin 2s linear infinite;
|
||||
}
|
||||
line-style
|
||||
/* Safari */
|
||||
@-webkit-keyframes spin {
|
||||
0% { -webkit-transform: rotate(0deg); }
|
||||
100% { -webkit-transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
.show {
|
||||
opacity: 1;
|
||||
transition: opacity 500ms;
|
||||
}
|
||||
|
||||
.hide {
|
||||
opacity: 0;
|
||||
transition: opacity 350ms;
|
||||
}
|
|
@ -12,7 +12,6 @@ import android.widget.*;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.darkweb.genesissearchengine.constants.enums;
|
||||
import com.darkweb.genesissearchengine.constants.strings;
|
||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
|
@ -24,9 +23,8 @@ import java.util.Calendar;
|
|||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import systems.intelligo.slight.ImageLoader;
|
||||
import static android.content.Context.LAYOUT_INFLATER_SERVICE;
|
||||
import static com.darkweb.genesissearchengine.constants.constants.CONST_BOOKMARK_LOAD_MORE;
|
||||
|
||||
public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listViewHolder>
|
||||
{
|
||||
|
@ -41,13 +39,14 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
|
|||
private ArrayList<String> mLongSelectedIndex = new ArrayList<>();
|
||||
private ArrayList<Integer> mLongSelectedID = new ArrayList<>();
|
||||
|
||||
private ImageLoader imageLoader;
|
||||
private AppCompatActivity mContext;
|
||||
private bookmarkAdapterView mBookmarkAdapterView;
|
||||
private bookmarkAdapterView mHistroyAdapterView;
|
||||
private Context mListHolderContext;
|
||||
private PopupWindow mPopupWindow = null;
|
||||
private eventObserver.eventListener mEvent;
|
||||
boolean mLongPressedMenuActive = false;
|
||||
private String mFilter = strings.GENERIC_EMPTY_STR;
|
||||
private boolean mLongPressedMenuActive = false;
|
||||
|
||||
/*Local Variables*/
|
||||
|
||||
|
@ -59,30 +58,15 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
|
|||
this.mCurrentList = new ArrayList<>();
|
||||
this.mPassedList = pModelList;
|
||||
this.mContext = pMainContext;
|
||||
this.mBookmarkAdapterView = new bookmarkAdapterView(mContext);
|
||||
this.mHistroyAdapterView = new bookmarkAdapterView(mContext);
|
||||
this.imageLoader = new ImageLoader(mContext);
|
||||
|
||||
initializeModelWithDate(false);
|
||||
}
|
||||
|
||||
|
||||
private void onLoading(){
|
||||
mContext.runOnUiThread(() -> {
|
||||
mCurrentList.add(new bookmarkRowModel(CONST_BOOKMARK_LOAD_MORE,null,-2));
|
||||
notifyItemInserted(mCurrentList.size());
|
||||
});
|
||||
}
|
||||
|
||||
private void onLoadingClear(){
|
||||
for(int mCounter = 0; mCounter< mCurrentList.size(); mCounter++){
|
||||
if(mCurrentList.get(mCounter).getHeader().equals(CONST_BOOKMARK_LOAD_MORE)){
|
||||
int finalM_counter = mCounter;
|
||||
mContext.runOnUiThread(() -> {
|
||||
mCurrentList.remove(finalM_counter);
|
||||
notifyItemRemoved(finalM_counter);
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
public void onLoadMore(ArrayList<bookmarkRowModel> pModelList){
|
||||
notifyDataSetChanged();
|
||||
initializeModelWithDate(false);
|
||||
}
|
||||
|
||||
|
||||
|
@ -116,7 +100,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
|
|||
float diff = m_date_2-m_date_1;
|
||||
|
||||
if(diff==0){
|
||||
if(m_date_state!=1){
|
||||
if(m_date_state!=1 && p_model_list.get(counter).getID()!=-2){
|
||||
this.mModelList.add(new bookmarkRowModel("Today ",null,-1));
|
||||
mRealID.add(m_real_counter);
|
||||
mRealIndex.add(m_real_counter);
|
||||
|
@ -157,7 +141,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(mCurrentList.get(m_counter_inner).getDescription())){
|
||||
if(mCurrentList.get(m_counter_inner).getDate() == mLongSelectedDate.get(m_counter) && mLongSelectedIndex.get(m_counter).equals("https://"+ 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);
|
||||
|
@ -175,8 +159,8 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
|
|||
if(mDateVerify){
|
||||
notifyItemRemoved(m_counter_inner-1);
|
||||
mCurrentList.remove(m_counter_inner-1);
|
||||
notifyItemRemoved(m_counter_inner-1);
|
||||
mCurrentList.remove(m_counter_inner-1);
|
||||
//notifyItemRemoved(m_counter_inner-1);
|
||||
//mCurrentList.remove(m_counter_inner-1);
|
||||
notifyItemRangeChanged(m_counter_inner-1, mCurrentList.size());
|
||||
}else {
|
||||
notifyItemRemoved(m_counter_inner);
|
||||
|
@ -215,7 +199,8 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull listViewHolder holder, int position) {
|
||||
public void onBindViewHolder(@NonNull bookmarkAdapter.listViewHolder holder, int position)
|
||||
{
|
||||
holder.bindListView(mCurrentList.get(position), position);
|
||||
}
|
||||
|
||||
|
@ -236,7 +221,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) mBookmarkAdapterView.onTrigger(bookmarkEnums.eBookmarkViewAdapterCommands.M_SELECT_VIEW, Arrays.asList(pItemView, pMenuItem, pLogoImage, pIsForced, true));
|
||||
mPopupWindow = (PopupWindow) mHistroyAdapterView.onTrigger(bookmarkEnums.eBookmarkViewAdapterCommands.M_SELECT_VIEW, Arrays.asList(pItemView, pMenuItem, pLogoImage, pIsForced, true));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -264,7 +249,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) mBookmarkAdapterView.onTrigger(bookmarkEnums.eBookmarkViewAdapterCommands.M_CLEAR_HIGHLIGHT, Arrays.asList(pItemView, pMenuItem, pLogoImage, pIsForced));
|
||||
mPopupWindow = (PopupWindow) mHistroyAdapterView.onTrigger(bookmarkEnums.eBookmarkViewAdapterCommands.M_CLEAR_HIGHLIGHT, Arrays.asList(pItemView, pMenuItem, pLogoImage, pIsForced));
|
||||
mLongSelectedDate.remove(pDate);
|
||||
mLongSelectedIndex.remove(pUrl);
|
||||
mLongSelectedID.remove((Integer) pId);
|
||||
|
@ -342,7 +327,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.history_bookmark__row_menu, null);
|
||||
mPopupWindow = (PopupWindow) mBookmarkAdapterView.onTrigger(bookmarkEnums.eBookmarkViewAdapterCommands.M_OPEN_MENU, Arrays.asList(mPopupWindow, pView, mPopupView));
|
||||
mPopupWindow = (PopupWindow) mHistroyAdapterView.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);
|
||||
|
@ -407,24 +392,11 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
|
|||
mCurrentList.remove(pIndex-1);
|
||||
notifyItemRangeChanged(pIndex-1, mCurrentList.size());
|
||||
}else {
|
||||
notifyItemRemoved(pIndex);
|
||||
mCurrentList.remove(pIndex);
|
||||
notifyItemRangeChanged(pIndex, mCurrentList.size());
|
||||
}
|
||||
|
||||
if(size>1){
|
||||
new Thread(){
|
||||
public void run(){
|
||||
try
|
||||
{
|
||||
sleep(500);
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
notifyItemRemoved(pIndex);
|
||||
notifyItemRangeChanged(pIndex, mCurrentList.size());
|
||||
notifyItemChanged(mCurrentList.size()-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -441,6 +413,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
|
|||
LinearLayout mRowContainer;
|
||||
LinearLayout mDateContainer;
|
||||
LinearLayout mLoadingContainer;
|
||||
ImageView mHindTypeIconTemp;
|
||||
|
||||
listViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
@ -457,6 +430,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
|
|||
mWebLogo = itemView.findViewById(R.id.pWebLogo);
|
||||
mLoadingContainer = itemView.findViewById(R.id.pLoadingContainer);
|
||||
mFaviconLogo = itemView.findViewById(R.id.pFaviconLogo);
|
||||
mHindTypeIconTemp = new ImageView(mContext);
|
||||
|
||||
if(model.getID() == -1){
|
||||
mDate.setText(model.getHeader());
|
||||
|
@ -475,6 +449,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
|
|||
mRowMenu.setClickable(false);
|
||||
mWebLogo.setVisibility(View.GONE);
|
||||
mLoadingContainer.setVisibility(View.VISIBLE);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
mDateContainer.setVisibility(View.GONE);
|
||||
|
@ -483,12 +458,34 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
|
|||
mRowMenu.setVisibility(View.VISIBLE);
|
||||
mRowMenu.setClickable(true);
|
||||
mWebLogo.setVisibility(View.VISIBLE);
|
||||
|
||||
mHeader.setText(model.getHeader());
|
||||
mWebLogo.setText((helperMethod.getDomainName(model.getHeader()).toUpperCase().charAt(0)+""));
|
||||
String header = model.getHeader();
|
||||
mDescription.setText((model.getDescription()));
|
||||
mEvent.invokeObserver(Arrays.asList(mFaviconLogo, model.getDescription()),enums.etype.fetch_favicon);
|
||||
mHeader.setText(model.getHeader());
|
||||
mDescription.setText(("https://"+model.getDescription()));
|
||||
|
||||
new Thread(){
|
||||
public void run(){
|
||||
try {
|
||||
mHindTypeIconTemp.setImageDrawable(null);
|
||||
mEvent.invokeObserver(Arrays.asList(mHindTypeIconTemp, "https://" + helperMethod.getDomainName(model.getDescription())), enums.etype.fetch_favicon);
|
||||
while (true){
|
||||
int mCounter=0;
|
||||
if(mHindTypeIconTemp.isAttachedToWindow() || mHindTypeIconTemp.getDrawable()==null){
|
||||
sleep(50);
|
||||
mCounter+=1;
|
||||
}else {
|
||||
break;
|
||||
}
|
||||
if(mCounter>6){
|
||||
break;
|
||||
}
|
||||
}
|
||||
mContext.runOnUiThread(() -> mFaviconLogo.setImageDrawable(mHindTypeIconTemp.getDrawable()));
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
|
||||
setItemViewOnClickListener(mRowContainer, mRowMenu, mDescription.getText().toString(), p_position, header, mRowMenu, mLogoImage, model.getID(), model.getDate());
|
||||
}
|
||||
|
@ -501,10 +498,10 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
|
|||
mRowMenu.setClickable(true);
|
||||
}
|
||||
|
||||
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));
|
||||
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));
|
||||
}else if(mLogoImage.getAlpha()>0){
|
||||
mPopupWindow = (PopupWindow) mBookmarkAdapterView.onTrigger(bookmarkEnums.eBookmarkViewAdapterCommands.M_CLEAR_HIGHLIGHT, Arrays.asList(mRowContainer, mRowMenu, mLogoImage, true, false));
|
||||
mPopupWindow = (PopupWindow) mHistroyAdapterView.onTrigger(bookmarkEnums.eBookmarkViewAdapterCommands.M_CLEAR_HIGHLIGHT, Arrays.asList(mRowContainer, mRowMenu, mLogoImage, true, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -524,7 +521,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isLongPressMenuActive(){
|
||||
private boolean isLongPressMenuActive(){
|
||||
return mLongSelectedIndex.size()>0;
|
||||
}
|
||||
|
||||
|
@ -532,12 +529,6 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
|
|||
if(pCommands == bookmarkEnums.eBookmarkAdapterCommands.GET_SELECTED_URL){
|
||||
return getSelectedURL();
|
||||
}
|
||||
else if(pCommands == bookmarkEnums.eBookmarkAdapterCommands.M_ON_LOADING){
|
||||
onLoading();
|
||||
}
|
||||
else if(pCommands == bookmarkEnums.eBookmarkAdapterCommands.M_LOADING_CLEAR){
|
||||
onLoadingClear();
|
||||
}
|
||||
else if(pCommands == bookmarkEnums.eBookmarkAdapterCommands.M_CLEAR_LONG_SELECTED_URL){
|
||||
clearLongSelectedURL();
|
||||
}
|
||||
|
@ -547,6 +538,9 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
|
|||
else if(pCommands == bookmarkEnums.eBookmarkAdapterCommands.GET_LONG_SELECTED_STATUS){
|
||||
return isLongPressMenuActive();
|
||||
}
|
||||
else if(pCommands == bookmarkEnums.eBookmarkAdapterCommands.ON_CLOSE){
|
||||
onClose((int)pData.get(0));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ public class databaseController
|
|||
public ArrayList<historyRowModel> selectHistory(int startIndex,int endIndex){
|
||||
ArrayList<historyRowModel> tempmodel = new ArrayList<>();
|
||||
|
||||
Cursor c = mDatabaseInstance.rawQuery("SELECT * FROM history ORDER BY date ASC LIMIT "+endIndex+" OFFSET "+startIndex, null);
|
||||
Cursor c = mDatabaseInstance.rawQuery("SELECT * FROM history ORDER BY date DESC LIMIT " + endIndex + " OFFSET "+startIndex, null);
|
||||
if (c.moveToFirst()){
|
||||
do {
|
||||
historyRowModel model = new historyRowModel(c.getString(3), c.getString(2),Integer.parseInt(c.getString(0)));
|
||||
|
@ -93,7 +93,7 @@ public class databaseController
|
|||
if(Calendar.getInstance().getTime().getTime() < model.getDate().getTime()){
|
||||
tempmodel.add(model);
|
||||
}else {
|
||||
tempmodel.add(0, model);
|
||||
tempmodel.add(model);
|
||||
}
|
||||
} while(c.moveToNext());
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ 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;
|
||||
|
@ -28,7 +29,6 @@ import java.util.List;
|
|||
import systems.intelligo.slight.ImageLoader;
|
||||
|
||||
import static android.content.Context.LAYOUT_INFLATER_SERVICE;
|
||||
import static com.darkweb.genesissearchengine.constants.constants.CONST_HISTORY_LOAD_MORE;
|
||||
|
||||
public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listViewHolder>
|
||||
{
|
||||
|
@ -68,25 +68,9 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
|
|||
initializeModelWithDate(false);
|
||||
}
|
||||
|
||||
|
||||
private void onLoading(){
|
||||
mContext.runOnUiThread(() -> {
|
||||
mCurrentList.add(new historyRowModel(CONST_HISTORY_LOAD_MORE,null,-2));
|
||||
notifyItemInserted(mCurrentList.size());
|
||||
});
|
||||
}
|
||||
|
||||
private void onLoadingClear(){
|
||||
for(int mCounter = 0; mCounter< mCurrentList.size(); mCounter++){
|
||||
if(mCurrentList.get(mCounter).getHeader().equals(CONST_HISTORY_LOAD_MORE)){
|
||||
int finalM_counter = mCounter;
|
||||
mContext.runOnUiThread(() -> {
|
||||
mCurrentList.remove(finalM_counter);
|
||||
notifyItemRemoved(finalM_counter);
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
public void onLoadMore(ArrayList<historyRowModel> pModelList){
|
||||
notifyDataSetChanged();
|
||||
initializeModelWithDate(false);
|
||||
}
|
||||
|
||||
|
||||
|
@ -120,7 +104,7 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
|
|||
float diff = m_date_2-m_date_1;
|
||||
|
||||
if(diff==0){
|
||||
if(m_date_state!=1){
|
||||
if(m_date_state!=1 && p_model_list.get(counter).getID()!=-2){
|
||||
this.mModelList.add(new historyRowModel("Today ",null,-1));
|
||||
mRealID.add(m_real_counter);
|
||||
mRealIndex.add(m_real_counter);
|
||||
|
@ -179,8 +163,8 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
|
|||
if(mDateVerify){
|
||||
notifyItemRemoved(m_counter_inner-1);
|
||||
mCurrentList.remove(m_counter_inner-1);
|
||||
notifyItemRemoved(m_counter_inner-1);
|
||||
mCurrentList.remove(m_counter_inner-1);
|
||||
//notifyItemRemoved(m_counter_inner-1);
|
||||
//mCurrentList.remove(m_counter_inner-1);
|
||||
notifyItemRangeChanged(m_counter_inner-1, mCurrentList.size());
|
||||
}else {
|
||||
notifyItemRemoved(m_counter_inner);
|
||||
|
@ -412,24 +396,11 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
|
|||
mCurrentList.remove(pIndex-1);
|
||||
notifyItemRangeChanged(pIndex-1, mCurrentList.size());
|
||||
}else {
|
||||
notifyItemRemoved(pIndex);
|
||||
mCurrentList.remove(pIndex);
|
||||
notifyItemRangeChanged(pIndex, mCurrentList.size());
|
||||
}
|
||||
|
||||
if(size>1){
|
||||
new Thread(){
|
||||
public void run(){
|
||||
try
|
||||
{
|
||||
sleep(500);
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
notifyItemRemoved(pIndex);
|
||||
notifyItemRangeChanged(pIndex, mCurrentList.size());
|
||||
notifyItemChanged(mCurrentList.size()-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -446,6 +417,7 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
|
|||
LinearLayout mRowContainer;
|
||||
LinearLayout mDateContainer;
|
||||
LinearLayout mLoadingContainer;
|
||||
ImageView mHindTypeIconTemp;
|
||||
|
||||
listViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
@ -462,6 +434,7 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
|
|||
mWebLogo = itemView.findViewById(R.id.pWebLogo);
|
||||
mLoadingContainer = itemView.findViewById(R.id.pLoadingContainer);
|
||||
mFaviconLogo = itemView.findViewById(R.id.pFaviconLogo);
|
||||
mHindTypeIconTemp = new ImageView(mContext);
|
||||
|
||||
if(model.getID() == -1){
|
||||
mDate.setText(model.getHeader());
|
||||
|
@ -480,6 +453,7 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
|
|||
mRowMenu.setClickable(false);
|
||||
mWebLogo.setVisibility(View.GONE);
|
||||
mLoadingContainer.setVisibility(View.VISIBLE);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
mDateContainer.setVisibility(View.GONE);
|
||||
|
@ -488,12 +462,34 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
|
|||
mRowMenu.setVisibility(View.VISIBLE);
|
||||
mRowMenu.setClickable(true);
|
||||
mWebLogo.setVisibility(View.VISIBLE);
|
||||
|
||||
mHeader.setText(model.getHeader());
|
||||
mWebLogo.setText((helperMethod.getDomainName(model.getHeader()).toUpperCase().charAt(0)+""));
|
||||
String header = model.getHeader();
|
||||
mDescription.setText(("https://"+model.getDescription()));
|
||||
mEvent.invokeObserver(Arrays.asList(mFaviconLogo, "https://" + model.getDescription()),enums.etype.fetch_favicon);
|
||||
mHeader.setText(model.getHeader());
|
||||
|
||||
new Thread(){
|
||||
public void run(){
|
||||
try {
|
||||
mHindTypeIconTemp.setImageDrawable(null);
|
||||
mEvent.invokeObserver(Arrays.asList(mHindTypeIconTemp, "https://" + helperMethod.getDomainName(model.getDescription())), enums.etype.fetch_favicon);
|
||||
while (true){
|
||||
int mCounter=0;
|
||||
if(mHindTypeIconTemp.isAttachedToWindow() || mHindTypeIconTemp.getDrawable()==null){
|
||||
sleep(50);
|
||||
mCounter+=1;
|
||||
}else {
|
||||
break;
|
||||
}
|
||||
if(mCounter>6){
|
||||
break;
|
||||
}
|
||||
}
|
||||
mContext.runOnUiThread(() -> mFaviconLogo.setImageDrawable(mHindTypeIconTemp.getDrawable()));
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
|
||||
setItemViewOnClickListener(mRowContainer, mRowMenu, mDescription.getText().toString(), p_position, header, mRowMenu, mLogoImage, model.getID(), model.getDate());
|
||||
}
|
||||
|
@ -537,12 +533,6 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
|
|||
if(pCommands == historyEnums.eHistoryAdapterCommands.GET_SELECTED_URL){
|
||||
return getSelectedURL();
|
||||
}
|
||||
else if(pCommands == historyEnums.eHistoryAdapterCommands.M_ON_LOADING){
|
||||
onLoading();
|
||||
}
|
||||
else if(pCommands == historyEnums.eHistoryAdapterCommands.M_LOADING_CLEAR){
|
||||
onLoadingClear();
|
||||
}
|
||||
else if(pCommands == historyEnums.eHistoryAdapterCommands.M_CLEAR_LONG_SELECTED_URL){
|
||||
clearLongSelectedURL();
|
||||
}
|
||||
|
|
|
@ -340,14 +340,18 @@ public class historyController extends AppCompatActivity
|
|||
isUpdatingRecyclerView = true;
|
||||
new Thread(){
|
||||
public void run(){
|
||||
if(pLoadingEnabled){
|
||||
mHistoryAdapter.onTrigger(historyEnums.eHistoryAdapterCommands.M_ON_LOADING, null);
|
||||
}
|
||||
int mPrevSize = mHistoryModel.getList().size();
|
||||
dataController.getInstance().invokeHistory(dataEnums.eHistoryCommands.M_LOAD_MORE_HISTORY ,null);
|
||||
ArrayList<historyRowModel> model = (ArrayList<historyRowModel>) dataController.getInstance().invokeHistory(dataEnums.eHistoryCommands.M_GET_HISTORY ,null);
|
||||
mHistoryModel.setList(model);
|
||||
activityContextManager.getInstance().getHistoryController().runOnUiThread(() -> {
|
||||
if(mPrevSize<mHistoryModel.getList().size()){
|
||||
mHistoryAdapter.onLoadMore(mHistoryModel.getList());
|
||||
//mHistoryAdapter.notifyItemRangeInserted(mPrevSize, mHistoryModel.getList().size()-1);
|
||||
}
|
||||
});
|
||||
try {
|
||||
sleep(500);
|
||||
activityContextManager.getInstance().getHistoryController().runOnUiThread(() -> mHistoryAdapter.onTrigger(historyEnums.eHistoryAdapterCommands.M_LOADING_CLEAR, null));
|
||||
sleep(1000);
|
||||
isUpdatingRecyclerView = false;
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -8,7 +8,7 @@ public class historyEnums
|
|||
}
|
||||
|
||||
public enum eHistoryAdapterCommands {
|
||||
M_ON_LOADING, M_LOADING_CLEAR, M_CLEAR_LONG_SELECTED_URL, GET_SELECTED_URL, GET_LONG_SELECTED_URL, GET_LONG_SELECTED_STATUS, ON_CLOSE
|
||||
M_CLEAR_LONG_SELECTED_URL, GET_SELECTED_URL, GET_LONG_SELECTED_URL, GET_LONG_SELECTED_STATUS, ON_CLOSE
|
||||
}
|
||||
|
||||
public enum eHistoryViewAdapterCommands {
|
||||
|
|
|
@ -7,6 +7,8 @@ import android.widget.ImageView;
|
|||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.darkweb.genesissearchengine.appManager.kotlinHelperLibraries.BrowserIconManager;
|
||||
import com.darkweb.genesissearchengine.constants.*;
|
||||
import com.darkweb.genesissearchengine.dataManager.dataController;
|
||||
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||
|
||||
|
@ -185,7 +187,8 @@ public class geckoClients
|
|||
if(url.startsWith("https://boogle.store?pG") || url.endsWith("boogle.store") || url.endsWith(constants.CONST_GENESIS_DOMAIN_URL_SLASHED)){
|
||||
try{
|
||||
mSession.initURL(constants.CONST_GENESIS_DOMAIN_URL);
|
||||
mSession.loadUri(constants.CONST_GENESIS_URL_CACHED);
|
||||
String mURL = constants.CONST_GENESIS_URL_CACHED + "?pData="+ dataController.getInstance().invokeReferenceWebsite(dataEnums.eReferenceWebsiteCommands.M_FETCH,null);
|
||||
mSession.loadUri(mURL);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ import java.util.Objects;
|
|||
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_URL_CACHED;
|
||||
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.M_LONG_PRESS_URL;
|
||||
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.M_LONG_PRESS_WITH_LINK;
|
||||
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManagerCallbacks.M_RATE_APPLICATION;
|
||||
|
@ -82,6 +83,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
|||
private AppCompatActivity mContext;
|
||||
private geckoDownloadManager mDownloadManager;
|
||||
private String mTheme = null;
|
||||
private boolean mPreviousErrorPage = false;
|
||||
|
||||
/*Temp Variables*/
|
||||
private GeckoSession.HistoryDelegate.HistoryList mHistoryList = null;
|
||||
|
@ -304,7 +306,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
|||
if(!mCurrentTitle.equals("loading")){
|
||||
m_current_url_id = (int)event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.on_update_history);
|
||||
}
|
||||
if(newUrl.equals(constants.CONST_GENESIS_URL_CACHED)){
|
||||
if(newUrl.startsWith(CONST_GENESIS_URL_CACHED)){
|
||||
mCurrentURL = constants.CONST_GENESIS_DOMAIN_URL;
|
||||
}
|
||||
else if(newUrl.equals(constants.CONST_GENESIS_HELP_URL_CACHE)){
|
||||
|
@ -330,8 +332,8 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
|||
}
|
||||
|
||||
public GeckoResult<AllowOrDeny> onLoadRequest(@NonNull GeckoSession var2, @NonNull GeckoSession.NavigationDelegate.LoadRequest var1) {
|
||||
|
||||
if(!var1.uri.equals(constants.CONST_GENESIS_URL_CACHED) && var1.uri.startsWith("https://boogle.store") && !var1.uri.contains(constants.CONST_GENESIS_LOCAL_TIME_GET_KEY) && !var1.uri.contains(constants.CONST_GENESIS_LOCAL_TIME_GET_KEY)){
|
||||
mPreviousErrorPage = false;
|
||||
if(!var1.uri.startsWith(CONST_GENESIS_URL_CACHED) && var1.uri.startsWith("https://boogle.store") && !var1.uri.contains(constants.CONST_GENESIS_LOCAL_TIME_GET_KEY) && !var1.uri.contains(constants.CONST_GENESIS_LOCAL_TIME_GET_KEY)){
|
||||
String mVerificationURL = setGenesisVerificationToken(var1.uri);
|
||||
initURL(mVerificationURL);
|
||||
loadUri(mVerificationURL);
|
||||
|
@ -348,6 +350,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
|||
}
|
||||
else if(var1.uri.equals("about:blank") && mIsLoaded){
|
||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.ON_EXPAND_TOP_BAR);
|
||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, false), enums.etype.M_ON_BANNER_UPDATE);
|
||||
return GeckoResult.fromValue(AllowOrDeny.ALLOW);
|
||||
}
|
||||
else if(var1.target==2){
|
||||
|
@ -356,7 +359,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
|||
}
|
||||
else if(!var1.uri.equals("about:blank")){
|
||||
mCurrentURL = var1.uri;
|
||||
if(mCurrentURL.equals(constants.CONST_GENESIS_URL_CACHED)){
|
||||
if(mCurrentURL.startsWith(CONST_GENESIS_URL_CACHED)){
|
||||
mCurrentURL = constants.CONST_GENESIS_DOMAIN_URL;
|
||||
}else if(mCurrentURL.equals(constants.CONST_GENESIS_HELP_URL_CACHE)){
|
||||
mCurrentURL = constants.CONST_GENESIS_HELP_URL;
|
||||
|
@ -366,6 +369,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
|||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID), enums.etype.search_update);
|
||||
checkApplicationRate();
|
||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.ON_EXPAND_TOP_BAR);
|
||||
|
||||
return GeckoResult.fromValue(AllowOrDeny.ALLOW);
|
||||
}else {
|
||||
return GeckoResult.fromValue(AllowOrDeny.DENY);
|
||||
|
@ -388,6 +392,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
|||
public GeckoResult<String> onLoadError(@NonNull GeckoSession var1, @Nullable String var2, WebRequestError var3) {
|
||||
errorHandler handler = new errorHandler();
|
||||
mProgress = 0;
|
||||
mPreviousErrorPage = true;
|
||||
event.invokeObserver(Arrays.asList(var2,mSessionID), enums.etype.on_load_error);
|
||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.ON_UPDATE_THEME);
|
||||
return GeckoResult.fromValue("data:text/html," + handler.createErrorPage(var3.category, var3.code,mContext,var2));
|
||||
|
@ -408,6 +413,13 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
|||
@UiThread
|
||||
public void onFirstContentfulPaint(@NonNull GeckoSession var1) {
|
||||
isFirstPaintExecuted = true;
|
||||
|
||||
if(mPreviousErrorPage || mCurrentURL.contains("boogle.store") || mCurrentURL.startsWith(CONST_GENESIS_URL_CACHED)){
|
||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, false), enums.etype.M_ON_BANNER_UPDATE);
|
||||
}else {
|
||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, true), enums.etype.M_ON_BANNER_UPDATE);
|
||||
}
|
||||
|
||||
if(!mCurrentURL.equals("about:blank")){
|
||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id,mTheme), enums.etype.ON_FIRST_PAINT);
|
||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id,mTheme), enums.etype.ON_LOAD_REQUEST);
|
||||
|
|
|
@ -438,6 +438,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
/*-------------------------------------------------------Helper Methods-------------------------------------------------------*/
|
||||
|
||||
public void onGetFavIcon(ImageView pImageView, String pURL){
|
||||
mGeckoClient.onGetFavIcon(pImageView, pURL);
|
||||
}
|
||||
|
||||
public void onGetThumbnail(ImageView pImageView){
|
||||
|
@ -1422,9 +1423,13 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
@Override
|
||||
public Object invokeObserver(List<Object> data, Object e_type)
|
||||
{
|
||||
|
||||
if(e_type.equals(enums.etype.ON_EXPAND_TOP_BAR)){
|
||||
mAppBar.setExpanded(true,true);
|
||||
}
|
||||
else if(e_type.equals(enums.etype.M_ON_BANNER_UPDATE)){
|
||||
mHomeViewController.updateBannerAdvertStatus((boolean)data.get(3));
|
||||
}
|
||||
else if(e_type.equals(enums.etype.progress_update)){
|
||||
mHomeViewController.onProgressBarUpdate((int)data.get(0));
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import static android.content.Context.LAYOUT_INFLATER_SERVICE;
|
||||
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eAdManagerCallbacks.M_SHOW_LOADED_ADS;
|
||||
import static org.mozilla.geckoview.GeckoSessionSettings.USER_AGENT_MODE_DESKTOP;
|
||||
|
||||
class homeViewController
|
||||
|
@ -145,6 +146,8 @@ class homeViewController
|
|||
{
|
||||
mContext.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_USER);
|
||||
}, 1500);
|
||||
|
||||
updateBannerAdvertStatus(false);
|
||||
}
|
||||
|
||||
public void initTopBarPadding(){
|
||||
|
@ -560,6 +563,20 @@ class homeViewController
|
|||
}
|
||||
}
|
||||
|
||||
void updateBannerAdvertStatus(boolean status){
|
||||
if(status){
|
||||
mBannerAds.animate().cancel();
|
||||
mBannerAds.setAlpha(0);
|
||||
mBannerAds.animate().alpha(1);
|
||||
mBannerAds.setVisibility(View.VISIBLE);
|
||||
onSetBannerAdMargin(true,true);
|
||||
}else{
|
||||
mBannerAds.animate().cancel();
|
||||
mBannerAds.animate().alpha(0).withEndAction(() -> mBannerAds.setVisibility(View.GONE));
|
||||
onSetBannerAdMargin(false,true);
|
||||
}
|
||||
}
|
||||
|
||||
private Handler searchBarUpdateHandler = new Handler();
|
||||
private String handlerLocalUrl = "";
|
||||
void onUpdateSearchBar(String url,boolean showProtocol, boolean pClearText){
|
||||
|
|
|
@ -37,6 +37,7 @@ public class settingLogController extends AppCompatActivity {
|
|||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.setting_log_view);
|
||||
activityContextManager.getInstance().onStack(this);
|
||||
|
||||
viewsInitializations();
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ class tabViewController
|
|||
mRemoveSelection.setVisibility(View.GONE);
|
||||
mClearSelection.setVisibility(View.GONE);
|
||||
mMenuButton.setVisibility(View.VISIBLE);
|
||||
mTabs.animate().setStartDelay(350).setDuration(200).alpha(1);
|
||||
mTabs.animate().setStartDelay(0).setDuration(250).alpha(1);
|
||||
}
|
||||
|
||||
private void onShowUndoDialog(int pTabCount) {
|
||||
|
|
|
@ -19,6 +19,7 @@ public class constants
|
|||
public static final String CONST_GENESIS_URL_CACHED = "resource://android/assets/homepage/homepage.html";
|
||||
public static final String CONST_GENESIS_ERROR_CACHED = "resource://android/assets/error/error.html";
|
||||
public static final String CONST_GENESIS_DOMAIN_URL_SLASHED = "https://boogle.store/";
|
||||
public static final String CONST_GENESIS_REFERENCE_WEBSITES = "https://drive.google.com/uc?export=download&id=1lOmukKOPYHApBFyTDkaRPoAwm59E_YEE";
|
||||
public static final String CONST_GENESIS_DOMAIN_URL = "https://boogle.store";
|
||||
public static final String CONST_GENESIS_LOCAL_TIME_GET_KEY = "pLocalTimeVerificationToken";
|
||||
public static final String CONST_GENESIS_GMT_TIME_GET_KEY = "pGlobalTimeVerificationToken";
|
||||
|
|
|
@ -6,7 +6,7 @@ public class enums
|
|||
public enum etype{
|
||||
on_update_favicon,ON_UPDATE_TAB_TITLE, ON_LOAD_REQUEST,GECKO_SCROLL_CHANGED,ON_UPDATE_SEARCH_BAR,
|
||||
on_verify_selected_url_menu,FINDER_RESULT_CALLBACK,
|
||||
welcome, reload,download_folder,
|
||||
welcome, reload,download_folder,M_ON_BANNER_UPDATE,
|
||||
url_triggered, url_triggered_new_tab,url_clear,fetch_favicon, fetch_thumbnail,url_clear_at,remove_from_database,is_empty,M_HOME_PAGE,M_PRELOAD_URL,ON_KEYBOARD_CLOSE,
|
||||
on_close_sesson,on_long_press, on_full_screen,on_handle_external_intent,on_update_suggestion_url,progress_update, ON_EXPAND_TOP_BAR,recheck_orbot,on_url_load,on_playstore_load,back_list_empty,start_proxy, ON_UPDATE_THEME, M_INITIALIZE_TAB_SINGLE, M_INITIALIZE_TAB_LINK,on_request_completed, on_update_history,on_update_suggestion,M_WELCOME_MESSAGE,ON_UPDATE_TITLE_BAR,ON_FIRST_PAINT, ON_LOAD_TAB_ON_RESUME, ON_SESSION_REINIT,on_page_loaded,on_load_error,download_file_popup,on_init_ads,search_update, open_new_tab
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ public class keys
|
|||
/*Home page*/
|
||||
|
||||
public static String HOME_LOW_MEMORY = "LOW_MEMORY";
|
||||
public static final String HOME_REFERENCE_WEBSITES = "HOME_REFERENCE_WEBSITES";
|
||||
|
||||
/*Proxy Manager*/
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ public class status
|
|||
public static String sSettingRedirectStatus = strings.GENERIC_EMPTY_STR;
|
||||
public static String sSettingLanguage = "en";
|
||||
public static String sSettingLanguageRegion = "Us";
|
||||
public static String mReferenceWebsites;
|
||||
|
||||
public static boolean sSettingEnableZoom = true;
|
||||
public static boolean sSettingEnableVoiceInput = true;
|
||||
|
@ -87,8 +88,9 @@ public class status
|
|||
status.sStatusDoNotTrack = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_DONOT_TRACK,true));
|
||||
status.sSettingCookieStatus = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_COOKIE_ADJUSTABLE,ACCEPT_FIRST_PARTY));
|
||||
status.sSettingFontSize = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_FLOAT, Arrays.asList(keys.SETTING_FONT_SIZE,100));
|
||||
status.mReferenceWebsites = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.SETTING_LANGUAGE,strings.SETTING_DEFAULT_LANGUAGE));
|
||||
|
||||
status.sSettingLanguage = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.SETTING_LANGUAGE,strings.SETTING_DEFAULT_LANGUAGE));
|
||||
status.sSettingLanguage = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.HOME_REFERENCE_WEBSITES,strings.HOME_REFERENCE_WEBSITES_DEFAULT));
|
||||
status.sSettingLanguageRegion = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.SETTING_LANGUAGE_REGION,strings.SETTING_DEFAULT_LANGUAGE_REGION));
|
||||
status.sSettingSearchStatus = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.SETTING_SEARCH_ENGINE,constants.CONST_BACKEND_GENESIS_URL));
|
||||
status.sBridgeCustomBridge = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_BRIDGE_1,strings.BRIDGE_CUSTOM_BRIDGE_OBFS4));
|
||||
|
|
|
@ -46,6 +46,7 @@ public class strings
|
|||
/*Home Manager*/
|
||||
|
||||
public static final String HOME_BLANK_PAGE = "about:blank";
|
||||
public static final String HOME_REFERENCE_WEBSITES_DEFAULT = "";
|
||||
|
||||
/*Message Manager*/
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ public class dataController
|
|||
private bookmarkDataModel mBookmarkDataModel;
|
||||
private suggestionDataModel mSuggestionDataModel;
|
||||
private helpDataModel mHelpDataModel;
|
||||
private referenceWebsiteDataModel mReferenceWebsiteDataModel;
|
||||
|
||||
/*Private Declarations*/
|
||||
|
||||
|
@ -43,8 +44,10 @@ public class dataController
|
|||
mBookmarkDataModel = new bookmarkDataModel();
|
||||
mSuggestionDataModel = new suggestionDataModel(pAppContext);
|
||||
mHelpDataModel = new helpDataModel();
|
||||
mReferenceWebsiteDataModel = new referenceWebsiteDataModel();
|
||||
}
|
||||
public void initializeListData(){
|
||||
mReferenceWebsiteDataModel.onTrigger(dataEnums.eReferenceWebsiteCommands.M_LOAD,Collections.singletonList(activityContextManager.getInstance().getHomeController()));
|
||||
mBookmarkDataModel.initializebookmark(databaseController.getInstance().selectBookmark());
|
||||
if(!status.sClearOnExit)
|
||||
{
|
||||
|
@ -69,7 +72,7 @@ public class dataController
|
|||
}
|
||||
|
||||
if(pCommands.equals(dataEnums.eHistoryCommands.M_LOAD_MORE_HISTORY)){
|
||||
int m_history_size = (int) mHistoryModel.onTrigger(dataEnums.eHistoryCommands.M_HISTORY_SIZE,null);
|
||||
int m_history_size = (int) mHistoryModel.onTrigger(dataEnums.eHistoryCommands.M_HISTORY_SIZE,null) - 1;
|
||||
return mHistoryModel.onTrigger(pCommands, Collections.singletonList(databaseController.getInstance().selectHistory(m_history_size+1,constants.CONST_FETCHABLE_LIST_SIZE)));
|
||||
}else {
|
||||
return mHistoryModel.onTrigger(pCommands, pData);
|
||||
|
@ -80,6 +83,10 @@ public class dataController
|
|||
return mSuggestionDataModel.onTrigger(pCommands, Arrays.asList(pData.get(0), mHistoryModel.onTrigger(dataEnums.eHistoryCommands.M_GET_HISTORY, null), mBookmarkDataModel.onTrigger(dataEnums.eBookmarkCommands.M_GET_BOOKMARK, null)));
|
||||
}
|
||||
|
||||
public Object invokeReferenceWebsite(dataEnums.eReferenceWebsiteCommands pCommands, List<Object> pData){
|
||||
return mReferenceWebsiteDataModel.onTrigger(pCommands, null);
|
||||
}
|
||||
|
||||
/*Recieving Preferences*/
|
||||
public Object invokePrefs(dataEnums.ePreferencesCommands pCommands, List<Object> pData){
|
||||
return mPreferenceModel.onTrigger(pCommands, pData);
|
||||
|
|
|
@ -11,6 +11,10 @@ public class dataEnums
|
|||
M_ADD_BOOKMARK, M_GET_BOOKMARK, M_DELETE_BOOKMARK, M_CLEAR_BOOKMARK;
|
||||
}
|
||||
|
||||
public enum eReferenceWebsiteCommands {
|
||||
M_LOAD, M_FETCH;
|
||||
}
|
||||
|
||||
public enum ePreferencesCommands{
|
||||
M_SET_STRING, M_SET_BOOL, M_SET_INT, M_SET_FLOAT, M_GET_STRING, M_GET_BOOL, M_GET_INT, M_GET_FLOAT, M_CLEAR_PREFS
|
||||
}
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
package com.darkweb.genesissearchengine.dataManager;
|
||||
|
||||
import android.content.Context;
|
||||
import com.android.volley.Request;
|
||||
import com.android.volley.RequestQueue;
|
||||
import com.android.volley.toolbox.StringRequest;
|
||||
import com.android.volley.toolbox.Volley;
|
||||
import com.darkweb.genesissearchengine.constants.status;
|
||||
import com.darkweb.genesissearchengine.constants.strings;
|
||||
import java.util.List;
|
||||
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_REFERENCE_WEBSITES;
|
||||
|
||||
public class referenceWebsiteDataModel {
|
||||
|
||||
private String mReferenceWebsiteData = "null";
|
||||
private boolean mLoading = false;
|
||||
|
||||
public referenceWebsiteDataModel(){
|
||||
mReferenceWebsiteData = status.mReferenceWebsites;
|
||||
}
|
||||
|
||||
private void onLoad(Context pContext){
|
||||
if(!mLoading){
|
||||
mLoading = true;
|
||||
|
||||
StringRequest stringRequest = new StringRequest(Request.Method.GET, CONST_GENESIS_REFERENCE_WEBSITES,
|
||||
response -> {
|
||||
mReferenceWebsiteData = response;
|
||||
mLoading = false;
|
||||
},
|
||||
error -> {});
|
||||
|
||||
RequestQueue requestQueue = Volley.newRequestQueue(pContext);
|
||||
requestQueue.add(stringRequest);
|
||||
}
|
||||
}
|
||||
|
||||
private String onFetch(){
|
||||
try {
|
||||
return mReferenceWebsiteData;
|
||||
}catch (Exception ignored){}
|
||||
return strings.GENERIC_EMPTY_SPACE;
|
||||
}
|
||||
|
||||
public Object onTrigger(dataEnums.eReferenceWebsiteCommands p_commands, List<Object> pData){
|
||||
if(p_commands == dataEnums.eReferenceWebsiteCommands.M_LOAD){
|
||||
onLoad((Context) pData.get(0));
|
||||
}
|
||||
if(p_commands == dataEnums.eReferenceWebsiteCommands.M_FETCH){
|
||||
return onFetch();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -64,10 +64,6 @@ class adManager
|
|||
@Override
|
||||
public void onAdLoaded() {
|
||||
bannerAdsLoaded = true;
|
||||
mBannerAds.animate().cancel();
|
||||
mBannerAds.animate().alpha(0);
|
||||
mBannerAds.setVisibility(View.VISIBLE);
|
||||
mBannerAds.animate().setStartDelay(100).setDuration(500).alpha(1).withEndAction(() -> mEvent.invokeObserver(null,M_SHOW_LOADED_ADS));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -173,8 +173,7 @@
|
|||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/pRecycleView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="60dp"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/c_background"
|
||||
android:orientation="horizontal"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
@ -143,8 +143,9 @@
|
|||
|
||||
<Button
|
||||
android:id="@+id/pClearButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:elevation="1dp"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
|
@ -166,6 +167,11 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:ignore="RtlSymmetry" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/c_ripple_v2"
|
||||
android:layout_height="1dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
@ -173,8 +179,7 @@
|
|||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/pRecycleView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="60dp"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
android:textStyle="bold"
|
||||
android:textSize="17sp"
|
||||
android:text="A"
|
||||
android:translationZ="3dp"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/white"
|
||||
android:background="@xml/hx_circle_favicon"
|
||||
|
@ -39,20 +38,21 @@
|
|||
tools:ignore="RtlCompat" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_width="43dp"
|
||||
android:layout_height="43dp"
|
||||
android:padding="20dp"
|
||||
android:layout_marginStart="-47dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:translationZ="1dp"
|
||||
android:layout_marginStart="-48dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:gravity="center_vertical"
|
||||
app:cardCornerRadius="40dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/pFaviconLogo"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="@xml/hx_circle_favicon"
|
||||
android:layout_width="43dp"
|
||||
android:layout_height="43dp"
|
||||
android:background="@color/button_gray"
|
||||
android:contentDescription="@string/GENERAL_TODO"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/white"
|
||||
|
@ -62,11 +62,11 @@
|
|||
</androidx.cardview.widget.CardView>
|
||||
<ImageView
|
||||
android:id="@+id/pLogoImage"
|
||||
android:layout_width="43dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginStart="-47.5dp"
|
||||
android:layout_width="45dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_marginStart="-49dp"
|
||||
android:layout_marginEnd="4.5dp"
|
||||
android:layout_height="43dp"
|
||||
android:layout_height="45dp"
|
||||
android:visibility="gone"
|
||||
android:alpha="0"
|
||||
android:translationZ="3dp"
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
android:layout_height="65dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -57,7 +56,6 @@
|
|||
android:visibility="gone"
|
||||
android:textSize="18sp"
|
||||
android:paddingStart="20dp"
|
||||
android:animateLayoutChanges="true"
|
||||
android:layout_marginTop="-3dp"
|
||||
android:textColor="@color/c_navigation_tint"
|
||||
android:textStyle="bold"/>
|
||||
|
|
Loading…
Reference in New Issue