Bug Fixes

Bug Fixes
master
msmannan00 2021-01-18 15:07:12 +05:00
parent d6f76b3d2d
commit 3297d555c2
206 changed files with 19762 additions and 3384 deletions

View File

@ -21,6 +21,7 @@
<option value="$PROJECT_DIR$/autofillServices" /> <option value="$PROJECT_DIR$/autofillServices" />
<option value="$PROJECT_DIR$/chromiumTabs" /> <option value="$PROJECT_DIR$/chromiumTabs" />
<option value="$PROJECT_DIR$/orbotservice" /> <option value="$PROJECT_DIR$/orbotservice" />
<option value="$PROJECT_DIR$/shutterbug" />
</set> </set>
</option> </option>
<option name="resolveModulePerSourceSet" value="false" /> <option name="resolveModulePerSourceSet" value="false" />

View File

@ -5,6 +5,7 @@
<inspection_tool class="AndroidLintSuspiciousImport" enabled="false" level="WARNING" enabled_by_default="false" /> <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="BooleanMethodIsAlwaysInverted" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="BusyWait" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="BusyWait" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="CollectionAddAllCanBeReplacedWithConstructor" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="EmptyStatementBody" enabled="false" level="WARNING" enabled_by_default="false"> <inspection_tool class="EmptyStatementBody" enabled="false" level="WARNING" enabled_by_default="false">
<option name="m_reportEmptyBlocks" value="true" /> <option name="m_reportEmptyBlocks" value="true" />
</inspection_tool> </inspection_tool>

View File

@ -3,6 +3,7 @@ apply from: 'variables.gradle'
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
ext { ext {
geckoviewChannel = project.ext.firefox_channel geckoviewChannel = project.ext.firefox_channel
@ -80,6 +81,7 @@ android {
'src/main/res/layouts/tab', 'src/main/res/layouts/tab',
'src/main/res/layouts/language', 'src/main/res/layouts/language',
'src/main/res/layouts/orbot', 'src/main/res/layouts/orbot',
'src/main/res/layouts/proxyStatus',
'src/main/res/layouts/orbotLog', 'src/main/res/layouts/orbotLog',
'src/main/res/layouts/setting', 'src/main/res/layouts/setting',
'src/main/res/layouts/bridge', 'src/main/res/layouts/bridge',
@ -134,6 +136,7 @@ dependencies {
implementation 'androidx.recyclerview:recyclerview:1.1.0' implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0' implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
implementation 'com.google.firebase:firebase-messaging:21.0.1'
// Testing-only dependencies // Testing-only dependencies
androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0') { androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0') {
@ -149,6 +152,7 @@ dependencies {
implementation 'androidx.preference:preference:1.1.1' implementation 'androidx.preference:preference:1.1.1'
implementation 'com.google.android.material:material:1.2.1' implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.appcompat:appcompat:1.2.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.4.21"
/*Firefox ABI Splits*/ /*Firefox ABI Splits*/
implementation "org.mozilla.components:browser-engine-gecko:$mozilla_components_version" implementation "org.mozilla.components:browser-engine-gecko:$mozilla_components_version"
@ -180,6 +184,17 @@ dependencies {
androidTestImplementation "junit:junit:4.13.1" androidTestImplementation "junit:junit:4.13.1"
implementation 'jp.wasabeef:recyclerview-animators:2.2.7' implementation 'jp.wasabeef:recyclerview-animators:2.2.7'
implementation 'com.android.support:design:24.0.0' implementation 'com.android.support:design:24.0.0'
implementation "org.mozilla.components:browser-icons:9.0.0"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:0.30.1'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.github.gabrielemariotti.recyclerview:recyclerview-animators:0.3.0-SNAPSHOT@aar'
/*Image Cache Libraries*/
implementation 'com.github.intelligo-systems:slight:1.1.3'
implementation "org.mozilla.components:concept-fetch:70.0.5"
implementation "org.mozilla.components:concept-base:70.0.9"
} }
apply plugin: 'com.android.application' apply plugin: 'com.android.application'

View File

@ -13,23 +13,26 @@
<uses-permission android:name="android.permission.VIBRATE"/> <uses-permission android:name="android.permission.VIBRATE"/>
<application <application
android:allowBackup="true" android:allowBackup="true"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:fullBackupContent="false" android:fullBackupContent="false"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:launchMode="singleTask" android:networkSecurityConfig="@xml/gx_network_security_config"
android:networkSecurityConfig="@xml/gx_network_security_config" android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true"
android:supportsRtl="true" android:theme="@style/AppTheme"
android:theme="@style/AppTheme" android:usesCleartextTraffic="true"
android:usesCleartextTraffic="true"
tools:targetApi="n"> tools:targetApi="n">
<!-- Activities --> <!-- Activities -->
<activity <activity
android:name="com.darkweb.genesissearchengine.appManager.orbotManager.orbotController" android:name="com.darkweb.genesissearchengine.appManager.orbotManager.orbotController"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"/>
android:launchMode="singleTask" />
<activity
android:name="com.darkweb.genesissearchengine.appManager.proxyStatusManager.proxyStatusController"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"/>
<activity <activity
android:name="com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingController" android:name="com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingController"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
@ -68,54 +71,45 @@
<activity <activity
android:name="com.darkweb.genesissearchengine.appManager.bridgeManager.bridgeController" android:name="com.darkweb.genesissearchengine.appManager.bridgeManager.bridgeController"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity <activity
android:name="com.darkweb.genesissearchengine.appManager.settingManager.notificationManager.settingNotificationController" android:name="com.darkweb.genesissearchengine.appManager.settingManager.notificationManager.settingNotificationController"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity <activity
android:name="com.darkweb.genesissearchengine.appManager.settingManager.privacyManager.settingPrivacyController" android:name="com.darkweb.genesissearchengine.appManager.settingManager.privacyManager.settingPrivacyController"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity <activity
android:name="com.darkweb.genesissearchengine.appManager.settingManager.logManager.settingLogController" android:name="com.darkweb.genesissearchengine.appManager.settingManager.logManager.settingLogController"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity <activity
android:name="com.darkweb.genesissearchengine.appManager.settingManager.advanceManager.settingAdvanceController" android:name="com.darkweb.genesissearchengine.appManager.settingManager.advanceManager.settingAdvanceController"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity <activity
android:name="com.darkweb.genesissearchengine.appManager.orbotLogManager.orbotLogController" android:name="com.darkweb.genesissearchengine.appManager.orbotLogManager.orbotLogController"
android:configChanges="uiMode" android:configChanges="uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity <activity
android:name="com.darkweb.genesissearchengine.appManager.settingManager.generalManager.settingGeneralController" android:name="com.darkweb.genesissearchengine.appManager.settingManager.generalManager.settingGeneralController"
android:configChanges="uiMode" android:configChanges="uiMode"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity <activity
android:name="com.darkweb.genesissearchengine.appManager.settingManager.searchEngineManager.settingSearchController" android:name="com.darkweb.genesissearchengine.appManager.settingManager.searchEngineManager.settingSearchController"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity <activity
android:name="com.darkweb.genesissearchengine.appManager.tabManager.tabController" android:name="com.darkweb.genesissearchengine.appManager.tabManager.tabController"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity <activity
android:name="com.darkweb.genesissearchengine.appManager.landingManager.landingController" android:name="com.darkweb.genesissearchengine.appManager.landingManager.landingController"
@ -124,66 +118,50 @@
<activity <activity
android:name="com.darkweb.genesissearchengine.appManager.homeManager.homeController" android:name="com.darkweb.genesissearchengine.appManager.homeManager.homeController"
android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize|locale|layoutDirection|smallestScreenSize|screenLayout" android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize|locale|layoutDirection|smallestScreenSize|screenLayout"
android:launchMode="singleTask" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|adjustResize"> android:windowSoftInputMode="adjustPan">
<intent-filter> <intent-filter>
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
</intent-filter> </intent-filter>
</activity>
<activity android:name="com.darkweb.genesissearchengine.appManager.externalNavigationManager.externalNavigationController">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="bridge" />
</intent-filter>
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="org.torproject.android.REQUEST_HS_PORT" />
</intent-filter>
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="org.torproject.android.START_TOR" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" /> <data android:scheme="http" />
<data android:scheme="https" /> <data android:scheme="https" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" /> <data android:scheme="http" />
<data android:scheme="https" /> <data android:scheme="https" />
<data android:mimeType="text/html" /> <data android:mimeType="text/html"/>
<data android:mimeType="text/plain"/>
<data android:mimeType="application/xhtml+xml"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" /> <data android:mimeType="text/plain" />
<data android:mimeType="application/xhtml+xml" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.ASSIST" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="content"
android:scheme="rocket" />
</intent-filter> </intent-filter>
</activity> <!-- Services & Settings --> </activity>
<!-- Services & Settings -->
<uses-library <uses-library
android:name="org.apache.http.legacy" android:name="org.apache.http.legacy"
android:required="false" /> android:required="false" />
@ -215,6 +193,8 @@
android:exported="false" android:exported="false"
android:stopWithTask="true" /> android:stopWithTask="true" />
<receiver android:name = "com.darkweb.genesissearchengine.helperManager.userEngagementNotification" />
<receiver <receiver
android:name="org.torproject.android.service.StartTorReceiver" android:name="org.torproject.android.service.StartTorReceiver"
android:exported="true" android:exported="true"

View File

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--Includes-->
<link rel="icon" href="../resources/images/favicon.ico">
<link rel="stylesheet" href="style/cs-help.css" />
<link rel="stylesheet" href="../resources/style/cs-bootstrap.css">
<!--Javascripts-->
<script src="../resources/javascript/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 type="text/javascript" src="javascript/js-help.js"></script>
<script src="../resources/javascript/jquery.min.js"></script>
<script src="../resources/javascript/bootstrap.min.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="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="container">
<p class="hi_info"><strong>Note | </strong> The following<strong> help manual</strong> is loaded from local cache. Connect to proxy for viewing latest help repository</p>
<div id="accordion">
<div class="card">
<div class="card-header">
<a class="card-link" data-toggle="collapse" href="#collapseOne">
<strong>Issue 1: Connection Problem</strong>
</a>
</div>
<div id="collapseOne" class="collapse show" data-parent="#accordion">
<div class="card-body">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</div>
</div>
</div>
<br>
<div class="card">
<div class="card-header">
<a class="collapsed card-link" data-toggle="collapse" href="#collapseTwo">
<strong>Issue 2: Bridge not connection</strong>
</a>
</div>
<div id="collapseTwo" class="collapse" data-parent="#accordion">
<div class="card-body">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</div>
</div>
</div>
<br>
<div class="card">
<div class="card-header">
<a class="collapsed card-link" data-toggle="collapse" href="#collapseThree">
<strong>Issue 3: Stuck at connecting</strong>
</a>
</div>
<div id="collapseThree" class="collapse" data-parent="#accordion">
<div class="card-body">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,17 @@
.hi_logo_text{
max-width: 450px;
width: 65%;
height: auto;
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: 30px;
}
.hi_info{
margin-top: 30px;
padding-left:3%;
margin-bottom: 30px;
border-left: 5px solid #ff9933;
}

View File

@ -0,0 +1,81 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!--Includes-->
<link rel="icon" href="../resources/images/favicon.ico">
<link rel="stylesheet" href="style/cs-homepage.css" />
<link rel="stylesheet" href="style/cs-footer.css" />
<link rel="stylesheet" href="style/cs-light_header.css" />
<link rel="stylesheet" href="style/cs-global-properties.css" />
<link rel="stylesheet" href="../resources/style/cs-bootstrap.css">
<!--Javascripts-->
<script defer src="../resources/javascript/fontawesome.js"></script>
<script src="../resources/javascript/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>
<!--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="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-->
<p class="lh_light_header gs-disable-highlight" id="lh_light_header_identifier">
<span ><a href="https://boogle.store/search?q=random&p_num=1&s_type=image" class="lh_light_header__catagory lh_light_header__catagory_image">Images</a></span>
<span ><a href="http://protonirockerxow.onion" class="lh_light_header__catagory lh_light_header__catagory_bold_mobile">Proton Mail</a></span>
<span ><a href="https://www.bitfinex.com/" class="lh_light_header__catagory lh_light_header__bold lh_light_header__catagory-spacing-right" id="mobid">Bitcoin Market</a></span>
</p>
<!--search bar-->
<form id="hi_search_container" method="GET" action="https://boogle.store/search?q=bit&p_num=1&s_type=all" enctype="multipart/form-data">
<img class="hi_logo_text" src="../resources/images/logo-home-slogan-1.png" alt="Genesis Search">
<input autocomplete="off" type="text" class="form-control hi_search__search-box" name="q" autofocus>
<input type="hidden" size="32" value="1" name="p_num" />
<input type="hidden" size="32" value="all" name="s_type" />
<div class="hi_search__button-container gs-disable-highlight">
<input type="submit" class="hi_search__search-button hi_search__search-button--left-spacing" id="hi_search_button" value="Genesis Search">
<input type="submit" class="hi_search__search-button" id="hi_lucky_button" value="Feeling Lucky">
</div>
<p class="hi_search__language-text gs-disable-highlight">Privacy, simplified <span class="hi_search__language-name ">Help Spread Genesis!</span></p>
</form>
<hr class="line-style">
</div>
<!--footer-->
<div class="footer-bar-container">
<div class="fb_shared-footer-bar gs-disable-highlight" >
<!--footer first line-->
<div class="fb_footer-bar__content_top fb_footer-bar__text-bottom fb_footer-bar__border_bottom" >
<a href="https://whatismycountry.com/" class="fb_footer-bar__catagories fb_footer-bar__catagories--padding" >Location</a>
</div>
<!--footer second line-->
<div class="fb_footer-bar__content_bottom fb_footer-bar__text-bottom" >
<a href="https://boogle.store/privacy" class="fb_footer-bar__catagories fb_footer-bar__catagories--padding" >Privacy & Policy</a>
<a href="https://boogle.store/reportus" class="fb_footer-bar__catagories fb_footer-bar__catagories--padding" >Report</a>
<a href="https://boogle.store/create" class="fb_footer-bar__catagories fb_footer-bar__catagories--padding" >Sitemap</a>
</div>
</div>
<div>
</body>
</html>

View File

@ -0,0 +1,99 @@
/*footer-bar style*/
.fb_shared-footer-bar{
position: relative;
margin-top: -86px;
}
@media only screen and (max-width: 943px) {
.fb_shared-footer-bar {
display : none
}
}
.fb_footer-bar__content_bottom{
background-color:#5c5cd6;
border-style: solid;
border-top-width: 0;
border-right-width: 0;
border-left-width: 0;
border-color:#3333cc;
border-bottom-width: 0;
width:100%;
text-align: center;
height: 43px;
padding: 10.5px 13px 8px;
}
.fb_footer-bar__content_top{
background-color:#5c5cd6;
border-style: solid;
border-top-width: 0;
border-right-width: 0;
border-left-width: 0;
border-color:#3333cc;
border-bottom-width: 0;
width:100%;
text-align: center;
height: 43px;
padding: 10.5px 13px 8px;
}
.fb_footer-bar__border_bottom {
border-bottom-width: 1px;
}
.fb_footer-bar__text-bottom{
color:#767676;
font-size: 13px;
text-align:left;
}
.fb_footer-bar__catagories--padding{
padding: 15px 15px 8px;
}
.fb_footer-bar__catagories--padding:hover{
color: white !important;
text-decoration: none !important;
border-bottom: 4px solid whitesmoke !important;;
}
.fb_footer-bar__catagories--padding:focus {
color: white !important;
text-decoration: none !important;
border-bottom: 4px solid white !important;
}
.fb_footer-bar__catagories{
cursor: pointer;
color:white !important;
font-family: Arial, sans-serif;
font-size: 14px;
height: 43px;
}
/*footer-bar events*/
.fb_footer-bar__catagories:hover{
}
.fb_footer-bar__catagories-start:hover{
color: white !important;
text-decoration: none !important;
border-bottom: 4px solid white !important;
}
.fb_footer-bar__catagories-start:focus {
color: white !important;
text-decoration: none !important;
border-bottom: 4px solid white !important;
}
.fb_footer-bar__catagories-start{
cursor: pointer;
color:white !important;
display: inline-block;
font-size: 14px;
font-family: Arial, sans-serif;
margin-left: 15px;
}

View File

@ -0,0 +1,159 @@
/*global styles*/
.line-style {
border: 0;
height: 1px;
background-image: -webkit-linear-gradient(left, #f0f0f0, #8c8b8b, #f0f0f0);
background-image: -moz-linear-gradient(left, #f0f0f0, #8c8b8b, #f0f0f0);
background-image: -ms-linear-gradient(left, #f0f0f0, #8c8b8b, #f0f0f0);
background-image: -o-linear-gradient(left, #f0f0f0, #8c8b8b, #f0f0f0);
width:40% !important;
max-width:500px !important;
}
/* visited link */
a:visited {
color: darkblue;
}
/* mouse over link */
a:hover {
color: blue;
}
a:active {
color: darkblue;
text-decoration: underline;
}
#load{
width:100%;
height:100%;
position:fixed;
z-index:9999;
background:url("https://www.creditmutuel.fr/cmne/fr/banques/webservices/nswr/images/loading.gif") no-repeat center center rgba(0,0,0,0.25)
}
button:focus {
outline:0 !important;
}
input:focus {
outline:0 !important;
}
html{
overflow-x: hidden;
height: 100%;
}
body {
height: 100%;
background-repeat: no-repeat;
background-position: left bottom;
}
.delay-load{
-webkit-animation: fadein 0; /* Firefox < 16 */
-moz-animation: fadein 0s; /* Firefox < 16 */
-ms-animation: fadein 0s; /* Internet Explorer */
-o-animation: fadein 0s; /* Opera < 12.1 */
-animation: fadein 0s;
-webkit-animation-delay: 0s;
-moz-animation-delay: 0s;
-ms-animation-delay: 0s;
-o-animation-delay: 0s;
-animation-delay: 0s;
-webkit-animation-fill-mode: forwards;
-moz-animation-fill-mode: forwards;
-ms-animation-fill-mode: forwards;
-o-animation-fill-mode: forwards;
-animation-fill-mode: forwards;
}
.body-wrap{
max-height: 90%;
}
.gs-disable-highlight
{
-webkit-touch-callout: none !important;
-webkit-user-select: none !important;;
-khtml-user-select: none !important;;
-moz-user-select: none !important;;
-ms-user-select: none !important;;
outline:none !important;;
}
.gs-disable-decoration
{
text-decoration: none !important;
}
.gs_container_size
{
min-height: 100%;
margin-top: -28px;
}
.hi_search__logo{
margin-left: 36%;
}
/*light-header style*/
.dark_header{
color:#000000;
height: 60px;
text-align: right;
background-image: linear-gradient(to right, #e6e6e6, #ffffff);
border-bottom-color:#cfe2e2;
border-style: solid;border-right-width: 0;
border-left-width: 0;border-top-width: 0;
border-bottom-width: 1px;
}
.scroller {
height: 100px;
overflow-y: scroll;
scrollbar-width: thin;
}
@keyframes fadein {
from { opacity: 1; }
to { opacity: 1; }
}
/* Firefox < 16 */
@-moz-keyframes fadein {
from { opacity: 0.2; }
to { opacity: 1; }
}
/* Safari, Chrome and Opera > 12.1 */
@-webkit-keyframes fadein {
from { opacity: 0.2; }
to { opacity: 1; }
}
/* Opera < 12.1 */
@-o-keyframes fadein {
from { opacity: 0.2; }
to { opacity: 1; }
}
/* Placeholder Text Color */
::-webkit-input-placeholder { /* Edge */
color: #b3b3b3 !important;
}
:-ms-input-placeholder { /* Internet Explorer 10-11 */
color: #b3b3b3 !important;
}
::placeholder {
color: #b3b3b3 !important;
}

View File

@ -0,0 +1,194 @@
/*Search*/
#hi_search_container {
margin-top:15vh;
}
@media only screen and (max-width: 943px) {
#hi_search_container {
margin-top:9vh;
}
}
.hi_logo_text{
max-width: 450px;
width: 90%;
height: auto;
display: block;
margin-top: -20px;
margin-left: auto;
margin-right: auto;
margin-bottom: 10px;
}
@media only screen and (max-width: 943px) {
.hp_logo_text {
max-width: 380px;
}
}
.hi_logo_image{
max-width: 150px;
width: 30%;
height: auto;
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: 00px;
}
@media only screen and (max-width: 943px) {
.hi_logo_image {
max-width: 100px;
}
}
.hi_search__logo{
text-align: center;
color: lightblue;
margin-bottom: -17px;
font-style: normal;
font-variant: normal;
line-height: 26px;
font-family: helvetica, monospace;
font-weight:bold;
}
.hi_search__search-box{
border-radius: 8px !important;
align-self: center;
height:42px !important;
outline: none;
border-color: #e7e7e7;
width:91% !important;
max-width: 575px;
display:block;
font:16px arial,sans-serif;
color: black;
padding-left:22px;
margin: 0 auto 5px;
box-shadow: 0 1px 1px 0 #cccccc;
-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;
}
}
.hi_search__search-box:hover {
box-shadow: 0 4px 4px -1.5px #cccccc;
-webkit-transition: .07s linear 0s;
-moz-transition: .07s linear 0s;
-o-transition: .07s linear 0s;
transition: .07s linear 0s
}
.hi_search__search-box:focus{
box-shadow: 0 4px 4px -1.5px #cccccc !important;
-webkit-transition: .07s linear 0s !important;;
-moz-transition: .07s linear 0s !important;;
-o-transition: .07s linear 0s !important;;
transition: .07s linear 0s !important;
}
/*footer-bar style*/
.hi_search__logo{
margin:0 auto;
display:block;
width: 90%;
max-width: 400px;
}
.hi_search__language-text{
font-size: 14px;
text-align:center;
margin-top: 25px;
padding-top: 3px
}
@media only screen and (max-width: 943px) {
.hi_search__language-text {
margin-top: 0px;
}
}
.hi_search__language-name{
color:#7173f8;
}
.hi_search__search-button{
margin-top: 12px;
background-color:#f2f2f2;
height: 35px;
width:110%;
text-align:center;
max-width: 130px;
border-width: 0;
color:#6c6c6c;
font-size: 14px;
}
@media only screen and (max-width: 943px) {
.hi_search__search-button {
width: 0;
height: 0;
}
}
.hi_search__button-container{
display:block;
text-align: center;
width: 100% !important;
}
.hi_search__search-button--left-spacing{
margin-left: 0
}
/* Homepage Search Buttons */
.hi_search__search-button:hover{
color : #000000;
background: linear-gradient(#f7f7f7,#f1f1f1);
border-style: solid;
border-width: 1px;
border-color:#C4C4C4;
border-radius: 4px;
cursor:pointer;
}
#hi_search_button {
font-size: 14px;
}
@media only screen and (max-width: 943px) {
#hi_search_button {
font-size: 13px;
}
}
#hi_lucky_button {
font-size: 14px;
}
@media only screen and (max-width: 943px) {
#hi_lucky_button {
font-size: 13px;
}
}
.hi_container_size
{
min-height: 100% !important;
}
@media only screen and (max-width: 943px) {
.hi_container_size {
}
}

View File

@ -0,0 +1,71 @@
@media only screen and (max-width: 943px) {
.lh_light_header__catagory_image {
display : none
}
}
@media only screen and (max-width: 943px) {
.lh_light_header__catagory_bold_mobile {
font-weight: bold;
color: #b3b3b3 !important;
}
}
.lh_light_header{
color:#000000;
text-align: right;
padding-top: 0px;
border-bottom-color:#efefef;
padding-top: 11px;
padding-bottom: 15px;
border-style: solid;border-right-width: 0;
border-left-width: 0;border-top-width: 0;
border-bottom-width: 1px;
}
@media only screen and (max-width: 943px) {
.lh_light_header {
border-bottom-width: 1px;
padding-bottom: 12px;
}
}
#lh_light_header_identifier {
background-color:#ffffff;
}
@media only screen and (max-width: 943px) {
#lh_light_header_identifier {
background-color:#ffffff;
}
}
.lh_light_header__bold{
font-weight: bold;
color: #1967d2 !important;
}
.lh_light_header__catagory-spacing-right{
margin-right: 15px;
}
.lh_light_header__catagory{
cursor: pointer;
font-size: 14px;
color: black;
padding: 13px 9px 14px;
}
/*light-header events*/
.lh_light_header__catagory:hover{
color: darkslategray;
text-decoration: none !important;
border-bottom: 4px solid lightslategray;
background: whitesmoke;
}
.lh_light_header__catagory:focus{
color: darkslategray;
text-decoration: none !important;
border-bottom: 4px solid lightslategray;
background: whitesmoke;
}

View File

@ -1 +0,0 @@
../../../../LICENSE

View File

@ -1,11 +0,0 @@
<html>
<head>
<title>
A Simple HTML Document
</title>
</head>
<body>
<p>This is a very simple HTML document</p>
<p>It only has two paragraphs</p>
</body>
</html>

View File

@ -1,713 +0,0 @@
<!DOCTYPE HTML>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. -->
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>GNU General Public License 3.0</title>
<link rel="stylesheet" type="text/css" href="style.css">
<style type="text/css">
.path {
font-family: monospace;
}
dt {
font-weight: bold;
}
</style>
<link rel="stylesheet" href="chrome://global/skin/about.css" type="text/css">
</head>
<body id="lic-info" class="aboutPageWideContainer">
<h1 id="gpl-3.0">GNU General Public License 3.0</h1>
<pre>Version 3, 29 June 2007
Copyright &copy; 2007 Free Software Foundation, Inc.
&lt;<a href="http://fsf.org/">http://fsf.org/</a>&gt;
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.</pre>
<h2><a name="preamble"></a>Preamble</h2>
<p>The GNU General Public License is a free, copyleft license for
software and other kinds of works.</p>
<p>The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.</p>
<p>When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.</p>
<p>To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.</p>
<p>For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.</p>
<p>Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.</p>
<p>For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.</p>
<p>Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.</p>
<p>Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.</p>
<p>The precise terms and conditions for copying, distribution and
modification follow.</p>
<h2><a name="terms"></a>TERMS AND CONDITIONS</h2>
<h3><a name="section0"></a>0. Definitions.</h3>
<p>&ldquo;This License&rdquo; refers to version 3 of the GNU General Public License.</p>
<p>&ldquo;Copyright&rdquo; also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.</p>
<p>&ldquo;The Program&rdquo; refers to any copyrightable work licensed under this
License. Each licensee is addressed as &ldquo;you&rdquo;. &ldquo;Licensees&rdquo; and
&ldquo;recipients&rdquo; may be individuals or organizations.</p>
<p>To &ldquo;modify&rdquo; a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a &ldquo;modified version&rdquo; of the
earlier work or a work &ldquo;based on&rdquo; the earlier work.</p>
<p>A &ldquo;covered work&rdquo; means either the unmodified Program or a work based
on the Program.</p>
<p>To &ldquo;propagate&rdquo; a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.</p>
<p>To &ldquo;convey&rdquo; a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.</p>
<p>An interactive user interface displays &ldquo;Appropriate Legal Notices&rdquo;
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.</p>
<h3><a name="section1"></a>1. Source Code.</h3>
<p>The &ldquo;source code&rdquo; for a work means the preferred form of the work
for making modifications to it. &ldquo;Object code&rdquo; means any non-source
form of a work.</p>
<p>A &ldquo;Standard Interface&rdquo; means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.</p>
<p>The &ldquo;System Libraries&rdquo; of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
&ldquo;Major Component&rdquo;, in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.</p>
<p>The &ldquo;Corresponding Source&rdquo; for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.</p>
<p>The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.</p>
<p>The Corresponding Source for a work in source code form is that
same work.</p>
<h3><a name="section2"></a>2. Basic Permissions.</h3>
<p>All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.</p>
<p>You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.</p>
<p>Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.</p>
<h3><a name="section3"></a>3. Protecting Users' Legal Rights From Anti-Circumvention Law.</h3>
<p>No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.</p>
<p>When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.</p>
<h3><a name="section4"></a>4. Conveying Verbatim Copies.</h3>
<p>You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.</p>
<p>You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.</p>
<h3><a name="section5"></a>5. Conveying Modified Source Versions.</h3>
<p>You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:</p>
<ul>
<li>a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.</li>
<li>b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
&ldquo;keep intact all notices&rdquo;.</li>
<li>c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.</li>
<li>d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.</li>
</ul>
<p>A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
&ldquo;aggregate&rdquo; if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.</p>
<h3><a name="section6"></a>6. Conveying Non-Source Forms.</h3>
<p>You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:</p>
<ul>
<li>a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.</li>
<li>b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.</li>
<li>c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.</li>
<li>d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.</li>
<li>e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.</li>
</ul>
<p>A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.</p>
<p>A &ldquo;User Product&rdquo; is either (1) a &ldquo;consumer product&rdquo;, which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, &ldquo;normally used&rdquo; refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.</p>
<p>&ldquo;Installation Information&rdquo; for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.</p>
<p>If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).</p>
<p>The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.</p>
<p>Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.</p>
<h3><a name="section7"></a>7. Additional Terms.</h3>
<p>&ldquo;Additional permissions&rdquo; are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.</p>
<p>When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.</p>
<p>Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:</p>
<ul>
<li>a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or</li>
<li>b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or</li>
<li>c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or</li>
<li>d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or</li>
<li>e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or</li>
<li>f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.</li>
</ul>
<p>All other non-permissive additional terms are considered &ldquo;further
restrictions&rdquo; within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.</p>
<p>If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.</p>
<p>Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.</p>
<h3><a name="section8"></a>8. Termination.</h3>
<p>You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).</p>
<p>However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.</p>
<p>Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.</p>
<p>Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.</p>
<h3><a name="section9"></a>9. Acceptance Not Required for Having Copies.</h3>
<p>You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.</p>
<h3><a name="section10"></a>10. Automatic Licensing of Downstream Recipients.</h3>
<p>Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.</p>
<p>An &ldquo;entity transaction&rdquo; is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.</p>
<p>You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.</p>
<h3><a name="section11"></a>11. Patents.</h3>
<p>A &ldquo;contributor&rdquo; is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's &ldquo;contributor version&rdquo;.</p>
<p>A contributor's &ldquo;essential patent claims&rdquo; are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, &ldquo;control&rdquo; includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.</p>
<p>Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.</p>
<p>In the following three paragraphs, a &ldquo;patent license&rdquo; is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To &ldquo;grant&rdquo; such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.</p>
<p>If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. &ldquo;Knowingly relying&rdquo; means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.</p>
<p>If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.</p>
<p>A patent license is &ldquo;discriminatory&rdquo; if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.</p>
<p>Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.</p>
<h3><a name="section12"></a>12. No Surrender of Others' Freedom.</h3>
<p>If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.</p>
<h3><a name="section13"></a>13. Use with the GNU Affero General Public License.</h3>
<p>Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.</p>
<h3><a name="section14"></a>14. Revised Versions of this License.</h3>
<p>The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.</p>
<p>Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License &ldquo;or any later version&rdquo; applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.</p>
<p>If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.</p>
<p>Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.</p>
<h3><a name="section15"></a>15. Disclaimer of Warranty.</h3>
<p>THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM &ldquo;AS IS&rdquo; WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</p>
<h3><a name="section16"></a>16. Limitation of Liability.</h3>
<p>IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.</p>
<h3><a name="section17"></a>17. Interpretation of Sections 15 and 16.</h3>
<p>If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.</p>
<p>END OF TERMS AND CONDITIONS</p>
<h2><a name="howto"></a>How to Apply These Terms to Your New Programs</h2>
<p>If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.</p>
<p>To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the &ldquo;copyright&rdquo; line and a pointer to where the full notice is found.</p>
<pre> &lt;one line to give the program's name and a brief idea of what it does.&gt;
Copyright (C) &lt;year&gt; &lt;name of author&gt;
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
</pre>
<p>Also add information on how to contact you by electronic and paper mail.</p>
<p>If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:</p>
<pre> &lt;program&gt; Copyright (C) &lt;year&gt; &lt;name of author&gt;
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
</pre>
<p>The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an &ldquo;about box&rdquo;.</p>
<p>You should also get your employer (if you work as a programmer) or school,
if any, to sign a &ldquo;copyright disclaimer&rdquo; for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
&lt;<a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>&gt;.</p>
<p>The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
&lt;<a href="http://www.gnu.org/philosophy/why-not-lgpl.html">http://www.gnu.org/philosophy/why-not-lgpl.html</a>&gt;.</p>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -1,946 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h1>Licenses</h1>
<p>
Binaries of this product are made available to you by Mozilla under the Mozilla Public License 2.0 (MPL).
</p>
<p>
More specifically, most of the source code for this product is available under the Mozilla Public License 2.0 (MPL)
and Apache License 2.0. Additional software components for this product are available under one of a variety of
other free and open source licenses. Those that require reproduction of the license text in the distribution are
given below. (Note: your copy of this product may not contain code covered by one or more of the licenses listed
here, depending on the exact product and version you choose.)
</p>
<ul>
<li><a href="#mpl2">Mozilla Public License 2.0</a></li>
<li><a href="#apache2">Apache License 2.0</a></li>
<li><a href="#lgpl21">GNU Lesser General Public License 2.1</a></li>
<li><a href="#adjust">adjust-android License</a></li>
</ul>
<!-- ****************************************************************************************************************************** -->
<!-- ****************************************************************************************************************************** -->
<!-- ****************************************************************************************************************************** -->
<h2><a name="mpl2">Mozilla Public License 2.0</a></h2>
<ul>
<li>Focus - https://github.com/mozilla-mobile/focus-android</li>
<li>Telemetry - https://github.com/mozilla-mobile/telemetry-android</li>
</ul>
<h4>1. Definitions</h4>
<dl>
<dt>1.1. “Contributor”</dt>
<dd><p>means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software.</p>
</dd>
<dt>1.2. “Contributor Version”</dt>
<dd><p>means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributors Contribution.</p>
</dd>
<dt>1.3. “Contribution”</dt>
<dd><p>means Covered Software of a particular Contributor.</p>
</dd>
<dt>1.4. “Covered Software”</dt>
<dd><p>means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof.</p>
</dd>
<dt>1.5. “Incompatible With Secondary Licenses”</dt>
<dd><p>means</p>
<ol type="a">
<li><p>that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or</p></li>
<li><p>that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License.</p></li>
</ol>
</dd>
<dt>1.6. “Executable Form”</dt>
<dd><p>means any form of the work other than Source Code Form.</p>
</dd>
<dt>1.7. “Larger Work”</dt>
<dd><p>means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software.</p>
</dd>
<dt>1.8. “License”</dt>
<dd><p>means this document.</p>
</dd>
<dt>1.9. “Licensable”</dt>
<dd><p>means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License.</p>
</dd>
<dt>1.10. “Modifications”</dt>
<dd><p>means any of the following:</p>
<ol type="a">
<li><p>any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or</p></li>
<li><p>any new file in Source Code Form that contains any Covered Software.</p></li>
</ol>
</dd>
<dt>1.11. “Patent Claims” of a Contributor</dt>
<dd><p>means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version.</p>
</dd>
<dt>1.12. “Secondary License”</dt>
<dd><p>means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses.</p>
</dd>
<dt>1.13. “Source Code Form”</dt>
<dd><p>means the form of the work preferred for making modifications.</p>
</dd>
<dt>1.14. “You” (or “Your”)</dt>
<dd><p>means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.</p>
</dd>
</dl>
<h4>2. License Grants and Conditions</h4>
<h3>2.1. Grants</h3>
<p>Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:</p>
<ol type="a">
<li><p>under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and</p></li>
<li><p>under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version.</p></li>
</ol>
<h3>2.2. Effective Date</h3>
<p>The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution.</p>
<h3>2.3. Limitations on Grant Scope</h3>
<p>The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor:</p>
<ol type="a">
<li><p>for any code that a Contributor has removed from Covered Software; or</p></li>
<li><p>for infringements caused by: (i) Your and any other third partys modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or</p></li>
<li><p>under Patent Claims infringed by Covered Software in the absence of its Contributions.</p></li>
</ol>
<p>This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4).</p>
<h3>2.4. Subsequent Licenses</h3>
<p>No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3).</p>
<h3>2.5. Representation</h3>
<p>Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License.</p>
<h3>2.6. Fair Use</h3>
<p>This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents.</p>
<h3>2.7. Conditions</h3>
<p>Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1.</p>
<h4>3. Responsibilities</h4>
<h3>3.1. Distribution of Source Form</h3>
<p>All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients rights in the Source Code Form.</p>
<h3>3.2. Distribution of Executable Form</h3>
<p>If You distribute Covered Software in Executable Form then:</p>
<ol type="a">
<li><p>such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and</p></li>
<li><p>You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients rights in the Source Code Form under this License.</p></li>
</ol>
<h3>3.3. Distribution of a Larger Work</h3>
<p>You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s).</p>
<h3>3.4. Notices</h3>
<p>You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies.</p>
<h3>3.5. Application of Additional Terms</h3>
<p>You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction.</p>
<h4>4. Inability to Comply Due to Statute or Regulation</h4>
<p>If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.</p>
<h4>5. Termination</h4>
<p>5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice.</p>
<p>5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate.</p>
<p>5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination.</p>
<h4>6. Disclaimer of Warranty</h4>
<p><em>Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer.</em></p>
<h4>7. Limitation of Liability</h4>
<p><em>Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such partys negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.</em></p>
<h4>8. Litigation</h4>
<p>Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a partys ability to bring cross-claims or counter-claims.</p>
<h4>9. Miscellaneous</h4>
<p>This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor.</p>
<h4>10. Versions of the License</h4>
<h3>10.1. New Versions</h3>
<p>Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number.</p>
<h3>10.2. Effect of New Versions</h3>
<p>You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward.</p>
<h3>10.3. Modified Versions</h3>
<p>If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License).</p>
<h3>10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses</h3>
<p>If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached.</p>
<h4>Exhibit A - Source Code Form License Notice</h4>
<blockquote>
<p>This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at <a href="http://mozilla.org/MPL/2.0/" target="_blank">http://mozilla.org/MPL/2.0/</a>.</p>
</blockquote>
<p>If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice.</p>
<p>You may add additional accurate notices of copyright ownership.</p>
<h4>Exhibit B - “Incompatible With Secondary Licenses” Notice</h4>
<blockquote>
<p>This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0.</p>
</blockquote>
<!-- ****************************************************************************************************************************** -->
<!-- ****************************************************************************************************************************** -->
<!-- ****************************************************************************************************************************** -->
<h2><a name="apache2">Apache License 2.0</a></h2>
<ul>
<li>com.android.support : animated-vector-drawable</li>
<li>org.jetbrains : annotations</li>
<li>com.android.support : appcompat-v7</li>
<li>com.android.support : cardview-v7</li>
<li>android.arch.lifecycle : common</li>
<li>android.arch.core : common</li>
<li>com.android.support : customtabs</li>
<li>com.android.support : design</li>
<li>android.arch.lifecycle : extensions</li>
<li>com.android.support : recyclerview-v7</li>
<li>android.arch.core : runtime</li>
<li>android.arch.lifecycle : runtime</li>
<li>com.android.support : support-annotations</li>
<li>com.android.support : support-compat</li>
<li>com.android.support : support-core-ui</li>
<li>com.android.support : support-core-utils</li>
<li>com.android.support : support-fragment</li>
<li>com.android.support : support-media-compat</li>
<li>com.android.support : support-v4</li>
<li>com.android.support :support-vector-drawable</li>
<li>com.android.support :transition</li>
</ul>
<p><strong><a name="definitions">1. Definitions</a></strong>.</p>
<p>"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.</p>
<p>"Licensor" shall mean the copyright owner or entity authorized by the
copyright owner that is granting the License.</p>
<p>"Legal Entity" shall mean the union of the acting entity and all other
entities that control, are controlled by, or are under common control with
that entity. For the purposes of this definition, "control" means (i) the
power, direct or indirect, to cause the direction or management of such
entity, whether by contract or otherwise, or (ii) ownership of fifty
percent (50%) or more of the outstanding shares, or (iii) beneficial
ownership of such entity.</p>
<p>"You" (or "Your") shall mean an individual or Legal Entity exercising
permissions granted by this License.</p>
<p>"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation source,
and configuration files.</p>
<p>"Object" form shall mean any form resulting from mechanical transformation
or translation of a Source form, including but not limited to compiled
object code, generated documentation, and conversions to other media types.</p>
<p>"Work" shall mean the work of authorship, whether in Source or Object form,
made available under the License, as indicated by a copyright notice that
is included in or attached to the work (an example is provided in the
Appendix below).</p>
<p>"Derivative Works" shall mean any work, whether in Source or Object form,
that is based on (or derived from) the Work and for which the editorial
revisions, annotations, elaborations, or other modifications represent, as
a whole, an original work of authorship. For the purposes of this License,
Derivative Works shall not include works that remain separable from, or
merely link (or bind by name) to the interfaces of, the Work and Derivative
Works thereof.</p>
<p>"Contribution" shall mean any work of authorship, including the original
version of the Work and any modifications or additions to that Work or
Derivative Works thereof, that is intentionally submitted to Licensor for
inclusion in the Work by the copyright owner or by an individual or Legal
Entity authorized to submit on behalf of the copyright owner. For the
purposes of this definition, "submitted" means any form of electronic,
verbal, or written communication sent to the Licensor or its
representatives, including but not limited to communication on electronic
mailing lists, source code control systems, and issue tracking systems that
are managed by, or on behalf of, the Licensor for the purpose of discussing
and improving the Work, but excluding communication that is conspicuously
marked or otherwise designated in writing by the copyright owner as "Not a
Contribution."</p>
<p>"Contributor" shall mean Licensor and any individual or Legal Entity on
behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.</p>
<p><strong><a name="copyright">2. Grant of Copyright License</a></strong>. Subject to the
terms and conditions of this License, each Contributor hereby grants to You
a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of, publicly
display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.</p>
<p><strong><a name="patent">3. Grant of Patent License</a></strong>. Subject to the terms
and conditions of this License, each Contributor hereby grants to You a
perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made, use,
offer to sell, sell, import, and otherwise transfer the Work, where such
license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by
combination of their Contribution(s) with the Work to which such
Contribution(s) was submitted. If You institute patent litigation against
any entity (including a cross-claim or counterclaim in a lawsuit) alleging
that the Work or a Contribution incorporated within the Work constitutes
direct or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate as of the
date such litigation is filed.</p>
<p><strong><a name="redistribution">4. Redistribution</a></strong>. You may reproduce and
distribute copies of the Work or Derivative Works thereof in any medium,
with or without modifications, and in Source or Object form, provided that
You meet the following conditions:</p>
<ol style="list-style: lower-latin;">
<li>You must give any other recipients of the Work or Derivative Works a
copy of this License; and</li>
<li>You must cause any modified files to carry prominent notices stating
that You changed the files; and</li>
<li>You must retain, in the Source form of any Derivative Works that You
distribute, all copyright, patent, trademark, and attribution notices from
the Source form of the Work, excluding those notices that do not pertain to
any part of the Derivative Works; and</li>
<li>If the Work includes a "NOTICE" text file as part of its distribution,
then any Derivative Works that You distribute must include a readable copy
of the attribution notices contained within such NOTICE file, excluding
those notices that do not pertain to any part of the Derivative Works, in
at least one of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or documentation,
if provided along with the Derivative Works; or, within a display generated
by the Derivative Works, if and wherever such third-party notices normally
appear. The contents of the NOTICE file are for informational purposes only
and do not modify the License. You may add Your own attribution notices
within Derivative Works that You distribute, alongside or as an addendum to
the NOTICE text from the Work, provided that such additional attribution
notices cannot be construed as modifying the License.
<br/>
<br/>
You may add Your own copyright statement to Your modifications and may
provide additional or different license terms and conditions for use,
reproduction, or distribution of Your modifications, or for any such
Derivative Works as a whole, provided Your use, reproduction, and
distribution of the Work otherwise complies with the conditions stated in
this License.
</li>
</ol>
<p><strong><a name="contributions">5. Submission of Contributions</a></strong>. Unless You
explicitly state otherwise, any Contribution intentionally submitted for
inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the
terms of any separate license agreement you may have executed with Licensor
regarding such Contributions.</p>
<p><strong><a name="trademarks">6. Trademarks</a></strong>. This License does not grant
permission to use the trade names, trademarks, service marks, or product
names of the Licensor, except as required for reasonable and customary use
in describing the origin of the Work and reproducing the content of the
NOTICE file.</p>
<p><strong><a name="no-warranty">7. Disclaimer of Warranty</a></strong>. Unless required by
applicable law or agreed to in writing, Licensor provides the Work (and
each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including,
without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You
are solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise
of permissions under this License.</p>
<p><strong><a name="no-liability">8. Limitation of Liability</a></strong>. In no event and
under no legal theory, whether in tort (including negligence), contract, or
otherwise, unless required by applicable law (such as deliberate and
grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a result
of this License or out of the use or inability to use the Work (including
but not limited to damages for loss of goodwill, work stoppage, computer
failure or malfunction, or any and all other commercial damages or losses),
even if such Contributor has been advised of the possibility of such
damages.</p>
<p><strong><a name="additional">9. Accepting Warranty or Additional Liability</a></strong>.
While redistributing the Work or Derivative Works thereof, You may choose
to offer, and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this License.
However, in accepting such obligations, You may act only on Your own behalf
and on Your sole responsibility, not on behalf of any other Contributor,
and only if You agree to indemnify, defend, and hold each Contributor
harmless for any liability incurred by, or claims asserted against, such
Contributor by reason of your accepting any such warranty or additional
liability.</p>
<p>END OF TERMS AND CONDITIONS</p>
<!-- ****************************************************************************************************************************** -->
<!-- ****************************************************************************************************************************** -->
<!-- ****************************************************************************************************************************** -->
<h2><a name="lgpl21">GNU Lesser General Public License 2.1</a></h2>
<ul>
<li>findbugs annotations (com.google.code.findbugs:annotations)</li>
</ul>
<h3><a id="SEC1">GNU LESSER GENERAL PUBLIC LICENSE</a></h3>
<p>
Version 2.1, February 1999
</p>
<p>
Copyright (C) 1991, 1999 Free Software Foundation, Inc.<br />
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA<br />
Everyone is permitted to copy and distribute verbatim copies<br />
of this license document, but changing it is not allowed.
</p>
<p>
[This is the first released version of the Lesser GPL. It also counts<br />
as the successor of the GNU Library Public License, version 2, hence<br />
the version number 2.1.]
</p>
<h3><a id="SEC2">Preamble</a></h3>
<p>
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
</p>
<p>
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
</p>
<p>
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
</p>
<p>
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
</p>
<p>
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
</p>
<p>
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
</p>
<p>
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
</p>
<p>
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
</p>
<p>
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
</p>
<p>
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
</p>
<p>
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
</p>
<p>
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
</p>
<p>
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
</p>
<p>
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
</p>
<p>
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
</p>
<h3><a id="SEC3">TERMS AND CONDITIONS FOR COPYING,
DISTRIBUTION AND MODIFICATION</a></h3>
<p>
<strong>0.</strong>
This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
</p>
<p>
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
</p>
<p>
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
</p>
<p>
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
</p>
<p>
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
</p>
<p>
<strong>1.</strong>
You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
</p>
<p>
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
</p>
<p>
<strong>2.</strong>
You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
</p>
<ul>
<li><strong>a)</strong>
The modified work must itself be a software library.</li>
<li><strong>b)</strong>
You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.</li>
<li><strong>c)</strong>
You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.</li>
<li><strong>d)</strong>
If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
<p>
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)</p></li>
</ul>
<p>
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Library, and can be
reasonably considered independent and separate works in themselves, then
this License, and its terms, do not apply to those sections when you
distribute them as separate works. But when you distribute the same
sections as part of a whole which is a work based on the Library, the
distribution of the whole must be on the terms of this License, whose
permissions for other licensees extend to the entire whole, and thus to
each and every part regardless of who wrote it.
</p>
<p>
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise
the right to control the distribution of derivative or collective works
based on the Library.
</p>
<p>
In addition, mere aggregation of another work not based on the Library with
the Library (or with a work based on the Library) on a volume of a storage
or distribution medium does not bring the other work under the scope of
this License.
</p>
<p>
<strong>3.</strong>
You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
</p>
<p>
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
</p>
<p>
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
</p>
<p>
<strong>4.</strong>
You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
</p>
<p>
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
</p>
<p>
<strong>5.</strong>
A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
</p>
<p>
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
</p>
<p>
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
</p>
<p>
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
</p>
<p>
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
</p>
<p>
<strong>6.</strong>
As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
</p>
<p>
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
</p>
<ul>
<li><strong>a)</strong> Accompany the work with the complete
corresponding machine-readable source code for the Library
including whatever changes were used in the work (which must be
distributed under Sections 1 and 2 above); and, if the work is an
executable linked with the Library, with the complete
machine-readable "work that uses the Library", as object code
and/or source code, so that the user can modify the Library and
then relink to produce a modified executable containing the
modified Library. (It is understood that the user who changes the
contents of definitions files in the Library will not necessarily
be able to recompile the application to use the modified
definitions.)</li>
<li><strong>b)</strong> Use a suitable shared library mechanism
for linking with the Library. A suitable mechanism is one that
(1) uses at run time a copy of the library already present on the
user's computer system, rather than copying library functions into
the executable, and (2) will operate properly with a modified
version of the library, if the user installs one, as long as the
modified version is interface-compatible with the version that the
work was made with.</li>
<li><strong>c)</strong> Accompany the work with a written offer,
valid for at least three years, to give the same user the
materials specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.</li>
<li><strong>d)</strong> If distribution of the work is made by
offering access to copy from a designated place, offer equivalent
access to copy the above specified materials from the same
place.</li>
<li><strong>e)</strong> Verify that the user has already received
a copy of these materials or that you have already sent this user
a copy.</li>
</ul>
<p>
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
</p>
<p>
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
</p>
<p>
<strong>7.</strong> You may place library facilities that are a work
based on the Library side-by-side in a single library together with
other library facilities not covered by this License, and distribute
such a combined library, provided that the separate distribution of
the work based on the Library and of the other library facilities is
otherwise permitted, and provided that you do these two things:
</p>
<ul>
<li><strong>a)</strong> Accompany the combined library with a copy
of the same work based on the Library, uncombined with any other
library facilities. This must be distributed under the terms of
the Sections above.</li>
<li><strong>b)</strong> Give prominent notice with the combined
library of the fact that part of it is a work based on the
Library, and explaining where to find the accompanying uncombined
form of the same work.</li>
</ul>
<p>
<strong>8.</strong> You may not copy, modify, sublicense, link with,
or distribute the Library except as expressly provided under this
License. Any attempt otherwise to copy, modify, sublicense, link
with, or distribute the Library is void, and will automatically
terminate your rights under this License. However, parties who have
received copies, or rights, from you under this License will not have
their licenses terminated so long as such parties remain in full
compliance.
</p>
<p>
<strong>9.</strong>
You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
</p>
<p>
<strong>10.</strong>
Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
</p>
<p>
<strong>11.</strong>
If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
</p>
<p>
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
</p>
<p>
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
</p>
<p>
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
</p>
<p>
<strong>12.</strong>
If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
</p>
<p>
<strong>13.</strong>
The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
</p>
<p>
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
</p>
<p>
<strong>14.</strong>
If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
</p>
<p>
<strong>NO WARRANTY</strong>
</p>
<p>
<strong>15.</strong>
BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
</p>
<p>
<strong>16.</strong>
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
</p>
<h3>END OF TERMS AND CONDITIONS</h3>
<!-- ****************************************************************************************************************************** -->
<!-- ****************************************************************************************************************************** -->
<!-- ****************************************************************************************************************************** -->
<h2><a name="adjust">adjust-android License</a></h2>
<p>Copyright (c) 2012-2017 adjust GmbH,<br />
http://www.adjust.com</p>
<p>Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:</p>
<p>The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,39 +0,0 @@
body, html {
background: white;
color: #FFFFFF;
font-family: sans-serif;
line-height: 24px;
font-size: 14px;
}
body{
padding-left: 24px;
padding-right: 24px;
margin-left: 0px;
margin-right: 0px;
}
a {
color: #0A9AF4;
}
/* Make only about page links ("learn more") white */
.about a {
color: #FFFFFF;
}
p.subtitle {
text-align: center;
opacity: .7;
margin: 0;
}
img#wordmark {
/* We need to set the dp size here, because by default webview assumes the image is not
density specific (but since it's an android resource, we get a density specific version). */
width: 180px;
display: block;
margin-left: auto;
margin-right: auto;
padding-top: 24px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

View File

@ -1,11 +1,13 @@
package com.darkweb.genesissearchengine.appManager; package com.darkweb.genesissearchengine.appManager;
import androidx.appcompat.app.AppCompatActivity;
import com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkController; import com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkController;
import com.darkweb.genesissearchengine.appManager.historyManager.historyController; import com.darkweb.genesissearchengine.appManager.historyManager.historyController;
import com.darkweb.genesissearchengine.appManager.homeManager.homeController; import com.darkweb.genesissearchengine.appManager.homeManager.homeController;
import com.darkweb.genesissearchengine.appManager.orbotLogManager.orbotLogController; import com.darkweb.genesissearchengine.appManager.orbotLogManager.orbotLogController;
import com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingController; import com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingController;
import com.darkweb.genesissearchengine.appManager.tabManager.tabController; import com.darkweb.genesissearchengine.appManager.tabManager.tabController;
import java.util.ArrayList;
public class activityContextManager public class activityContextManager
{ {
@ -25,11 +27,13 @@ public class activityContextManager
private android.app.Activity pCurrentActivity = null; private android.app.Activity pCurrentActivity = null;
private settingController pSettingController; private settingController pSettingController;
private orbotLogController pOrbotLogController; private orbotLogController pOrbotLogController;
private ArrayList<AppCompatActivity> mStackList;
/*Initialization*/ /*Initialization*/
private activityContextManager() private activityContextManager()
{ {
mStackList = new ArrayList<>();
} }
/*List ContextGetterSetters*/ /*List ContextGetterSetters*/
@ -78,7 +82,26 @@ public class activityContextManager
public void setCurrentActivity(android.app.Activity pCurrentActivity){ public void setCurrentActivity(android.app.Activity pCurrentActivity){
this.pCurrentActivity = pCurrentActivity; this.pCurrentActivity = pCurrentActivity;
} }
public android.app.Activity setCurrentActivity(){ public android.app.Activity getCurrentActivity(){
return pCurrentActivity; return pCurrentActivity;
} }
public void onStack(AppCompatActivity pActivity){
mStackList.add(pActivity);
}
public void onRemoveStack(AppCompatActivity pActivity){
if(mStackList.size()>0 && mStackList.get(mStackList.size()-1).equals(pActivity)){
mStackList.remove(mStackList.size()-1);
}
}
public void onClearStack(){
for(int mCounter=0;mCounter<mStackList.size();mCounter++){
if(!mStackList.get(mCounter).isFinishing()){
mStackList.get(mCounter).finish();
mStackList.remove(mCounter);
}
}
}
} }

View File

@ -13,7 +13,6 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.historyManager.historyEnums;
import com.darkweb.genesissearchengine.constants.enums; import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.strings; import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.helperManager.eventObserver; import com.darkweb.genesissearchengine.helperManager.eventObserver;
@ -211,7 +210,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
@Override @Override
public listViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public listViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
mListHolderContext = parent.getContext(); mListHolderContext = parent.getContext();
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.recyclerview_row, parent, false); View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.history_bookmark_row_view, parent, false);
return new listViewHolder(view); return new listViewHolder(view);
} }
@ -342,7 +341,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
void onOpenMenu(View pView, String pUrl, int pPosition, String pTitle){ void onOpenMenu(View pView, String pUrl, int pPosition, String pTitle){
LayoutInflater layoutInflater = (LayoutInflater) pView.getContext().getSystemService(LAYOUT_INFLATER_SERVICE); LayoutInflater layoutInflater = (LayoutInflater) pView.getContext().getSystemService(LAYOUT_INFLATER_SERVICE);
@SuppressLint("InflateParams") final View mPopupView = layoutInflater.inflate(R.layout.recyclerview__row_menu, null); @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) 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.pMenuCopy), pUrl, pPosition, pTitle);
@ -438,6 +437,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
TextView mWebLogo; TextView mWebLogo;
ImageButton mRowMenu; ImageButton mRowMenu;
ImageView mLogoImage; ImageView mLogoImage;
ImageView mFaviconLogo;
LinearLayout mRowContainer; LinearLayout mRowContainer;
LinearLayout mDateContainer; LinearLayout mDateContainer;
LinearLayout mLoadingContainer; LinearLayout mLoadingContainer;
@ -456,7 +456,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
mLogoImage = itemView.findViewById(R.id.pLogoImage); mLogoImage = itemView.findViewById(R.id.pLogoImage);
mWebLogo = itemView.findViewById(R.id.pWebLogo); mWebLogo = itemView.findViewById(R.id.pWebLogo);
mLoadingContainer = itemView.findViewById(R.id.pLoadingContainer); mLoadingContainer = itemView.findViewById(R.id.pLoadingContainer);
mFaviconLogo = itemView.findViewById(R.id.pFaviconLogo);
if(model.getID() == -1){ if(model.getID() == -1){
mDate.setText(model.getHeader()); mDate.setText(model.getHeader());
@ -487,6 +487,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
mWebLogo.setText((helperMethod.getDomainName(model.getHeader()).toUpperCase().charAt(0)+"")); mWebLogo.setText((helperMethod.getDomainName(model.getHeader()).toUpperCase().charAt(0)+""));
String header = model.getHeader(); String header = model.getHeader();
mDescription.setText((model.getDescription())); mDescription.setText((model.getDescription()));
mEvent.invokeObserver(Arrays.asList(mFaviconLogo, model.getDescription()),enums.etype.fetch_favicon);
mHeader.setText(model.getHeader()); mHeader.setText(model.getHeader());
setItemViewOnClickListener(mRowContainer, mRowMenu, mDescription.getText().toString(), p_position, header, mRowMenu, mLogoImage, model.getID(), model.getDate()); setItemViewOnClickListener(mRowContainer, mRowMenu, mDescription.getText().toString(), p_position, header, mRowMenu, mLogoImage, model.getID(), model.getDate());

View File

@ -214,6 +214,8 @@ public class bookmarkController extends AppCompatActivity
{ {
activityContextManager.getInstance().setCurrentActivity(this); activityContextManager.getInstance().setCurrentActivity(this);
status.sSettingIsAppPaused = false; status.sSettingIsAppPaused = false;
activityContextManager.getInstance().onStack(this);
super.onResume(); super.onResume();
} }
@ -221,6 +223,7 @@ public class bookmarkController extends AppCompatActivity
public void onPause() public void onPause()
{ {
status.sSettingIsAppPaused = true; status.sSettingIsAppPaused = true;
super.onPause(); super.onPause();
} }
@ -231,6 +234,7 @@ public class bookmarkController extends AppCompatActivity
}else if((Boolean) mbookmarkAdapter.onTrigger(bookmarkEnums.eBookmarkAdapterCommands.GET_LONG_SELECTED_STATUS,null)){ }else if((Boolean) mbookmarkAdapter.onTrigger(bookmarkEnums.eBookmarkAdapterCommands.GET_LONG_SELECTED_STATUS,null)){
onClearMultipleSelection(null); onClearMultipleSelection(null);
}else { }else {
activityContextManager.getInstance().onRemoveStack(this);
finish(); finish();
} }
} }
@ -306,6 +310,10 @@ public class bookmarkController extends AppCompatActivity
mHomeController.onOpenLinkNewTab(url_temp); mHomeController.onOpenLinkNewTab(url_temp);
finish(); finish();
} }
else if(e_type.equals(enums.etype.fetch_favicon)){
mHomeController.onGetFavIcon((ImageView) data.get(0), (String) data.get(1));
}
else if(e_type.equals(enums.etype.url_clear)){ else if(e_type.equals(enums.etype.url_clear)){
mbookmarkModel.onManualClear((int)data.get(0)); mbookmarkModel.onManualClear((int)data.get(0));
} }

View File

@ -267,7 +267,7 @@ class bookmarkViewController
} }
private void onLongPressMenu(View pView) { private void onLongPressMenu(View pView) {
mPopupWindow = helperMethod.onCreateMenu(pView, R.layout.recyclerview__menu); mPopupWindow = helperMethod.onCreateMenu(pView, R.layout.history_bookmark_menu);
} }
private void onDrawSwipableBackground(Canvas pCanvas, RecyclerView.ViewHolder pViewHolder, float pDX, int pActionState) { private void onDrawSwipableBackground(Canvas pCanvas, RecyclerView.ViewHolder pViewHolder, float pDX, int pActionState) {

View File

@ -55,6 +55,7 @@ public class bridgeController extends AppCompatActivity {
public void initializeAppModel() public void initializeAppModel()
{ {
activityContextManager.getInstance().onStack(this);
mBridgeViewController = new bridgeViewController(); mBridgeViewController = new bridgeViewController();
} }
@ -132,8 +133,14 @@ public class bridgeController extends AppCompatActivity {
super.onResume(); super.onResume();
} }
@Override
protected void onStop() {
super.onStop();
}
@Override @Override
public void onBackPressed() { public void onBackPressed() {
activityContextManager.getInstance().onRemoveStack(this);
finish(); finish();
} }

View File

@ -44,7 +44,7 @@ public class databaseController
mDatabaseInstance.execSQL("CREATE TABLE IF NOT EXISTS " + "history" + " (id INT(4) PRIMARY KEY,date DATETIME,url VARCHAR,title VARCHAR);"); mDatabaseInstance.execSQL("CREATE TABLE IF NOT EXISTS " + "history" + " (id INT(4) PRIMARY KEY,date DATETIME,url VARCHAR,title VARCHAR);");
mDatabaseInstance.execSQL("CREATE TABLE IF NOT EXISTS " + "bookmark" + " (id INT(4) PRIMARY KEY,title VARCHAR,url VARCHAR);"); mDatabaseInstance.execSQL("CREATE TABLE IF NOT EXISTS " + "bookmark" + " (id INT(4) PRIMARY KEY,title VARCHAR,url VARCHAR);");
mDatabaseInstance.execSQL("CREATE TABLE IF NOT EXISTS " + "tab" + " (mid INT(4) PRIMARY KEY,date,title VARCHAR,url VARCHAR,mThumbnail BLOB);"); mDatabaseInstance.execSQL("CREATE TABLE IF NOT EXISTS " + "tab" + " (mid INT(4) PRIMARY KEY,date,title VARCHAR,url VARCHAR,mThumbnail BLOB, theme VARCHAR);");
} }
catch (Exception ex) catch (Exception ex)
@ -110,7 +110,7 @@ public class databaseController
do { do {
geckoSession mSession = activityContextManager.getInstance().getHomeController().onNewTabInit(); geckoSession mSession = activityContextManager.getInstance().getHomeController().onNewTabInit();
tabRowModel model = new tabRowModel(c.getString(0), c.getString(1),c.getBlob(4)); tabRowModel model = new tabRowModel(c.getString(0), c.getString(1),c.getBlob(4));
model.setSession(mSession, c.getString(2),c.getString(3)); model.setSession(mSession, c.getString(2),c.getString(3), c.getString(5));
model.getSession().setSessionID(model.getmId()); model.getSession().setSessionID(model.getmId());
mTempListModel.add(model); mTempListModel.add(model);
} while(c.moveToNext()); } while(c.moveToNext());

View File

@ -0,0 +1,47 @@
package com.darkweb.genesissearchengine.appManager.externalNavigationManager;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.homeManager.homeController;
import com.example.myapplication.R;
public class externalNavigationController extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.home_view);
Intent intent = new Intent(this.getIntent());
intent.setClassName(this.getApplicationContext(), homeController.class.getName());
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
Uri data = this.getIntent().getData();
if(data!=null){
activityContextManager.getInstance().getHomeController().onLoadURL(data.toString());
}
this.startActivity(intent);
new Thread(){
public void run(){
try {
sleep(1000);
externalNavigationController.this.runOnUiThread(() -> finish());
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}.start();
}
@Override
protected void onNewIntent(Intent intent)
{
super.onNewIntent(intent);
Uri data = intent.getData();
if(data!=null){
activityContextManager.getInstance().getHomeController().onLoadURL("https://bbc.com");
}
}
}

View File

@ -0,0 +1,46 @@
package com.darkweb.genesissearchengine.appManager.helpManager;
import android.content.Context;
import android.util.AttributeSet;
import android.view.KeyEvent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
public class editTextManager extends androidx.appcompat.widget.AppCompatAutoCompleteTextView {
Context mContext;
private eventObserver.eventListener mEvent = null;
public editTextManager(@NonNull Context context) {
super(context);
mContext = context;
}
public editTextManager(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
mContext = context;
}
public editTextManager(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mContext = context;
}
public void setEventHandler(eventObserver.eventListener pEvent){
mEvent = pEvent;
}
@Override
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if(mEvent!=null){
mEvent.invokeObserver(null, enums.etype.ON_KEYBOARD_CLOSE);
}
}
return false;
}
}

View File

@ -0,0 +1,157 @@
package com.darkweb.genesissearchengine.appManager.helpManager;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.text.Html;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.historyManager.historyEnums;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.example.myapplication.R;
import java.util.ArrayList;
import java.util.List;
public class helpAdapter extends RecyclerView.Adapter<helpAdapter.helpViewHolder>{
private List<helpDataModel> mModelList = new ArrayList<>();
private List<helpDataModel> mCompleteModelList = new ArrayList<>();
private LinearLayout mPrevRow;
private Context mContext;
private int mCurrentPosition = -1;
private boolean mIsAnimating = false;
public helpAdapter(List<helpDataModel> pModelList, Context context) {
if(pModelList!=null){
this.mCompleteModelList.addAll(pModelList);
this.mModelList.addAll(pModelList);
}
this.mContext = context;
}
private void onSearchFilterInvoked(String pQuery){
pQuery = pQuery.toLowerCase();
this.mModelList.clear();
mCurrentPosition = -1;
for(int mCounter=0;mCounter<mCompleteModelList.size();mCounter++){
if(mCompleteModelList.get(mCounter).getHeader().toLowerCase().contains(pQuery) || mCompleteModelList.get(mCounter).getDescription().toLowerCase().contains(pQuery)){
mModelList.add(mCompleteModelList.get(mCounter));
}
}
notifyDataSetChanged();
}
@NonNull
@Override
public helpViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.help_row_view, parent, false);
return new helpViewHolder(v);
}
@Override
public void onBindViewHolder(@NonNull helpViewHolder holder, int position) {
holder.bindListView(mModelList.get(position));
}
@Override
public int getItemCount() {
return mModelList.size();
}
class helpViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
TextView mRowHeader;
TextView mRowDescription;
ImageView mIcon;
ImageView mArrowNavigation;
LinearLayout linearLayout;
RelativeLayout mHelpRowContainer;
helpViewHolder(View itemView) {
super(itemView);
}
void bindListView(helpDataModel model) {
mRowHeader = itemView.findViewById(R.id.pRowHeader);
mIcon = itemView.findViewById(R.id.pIcon);
linearLayout = itemView.findViewById(R.id.linearLayout);
mArrowNavigation = itemView.findViewById(R.id.pArrowNavigation);
mHelpRowContainer = itemView.findViewById(R.id.pHelpRowContainer);
mRowDescription = itemView.findViewById(R.id.pRowDescription);
linearLayout.animate().setDuration(150).alpha(0);
mRowHeader.setText(model.getHeader());
mRowDescription.setText(Html.fromHtml(model.getDescription()));
Drawable mDrawable;
Resources res = itemView.getContext().getResources();
try {
int mImageID = helperMethod.getResId(model.getIconID(), R.xml.class);
mDrawable = Drawable.createFromXml(res, res.getXml(mImageID));
mIcon.setImageDrawable(mDrawable);
if (mCurrentPosition == getLayoutPosition()) {
mPrevRow = linearLayout;
linearLayout.animate().setDuration(300).setStartDelay(100).alpha(1);
linearLayout.setVisibility(View.VISIBLE);
mDrawable = Drawable.createFromXml(res, res.getXml(R.xml.ic_baseline_keyboard_arrow_up));
mArrowNavigation.setImageDrawable(mDrawable);
}else {
linearLayout.setVisibility(View.GONE);
mDrawable = Drawable.createFromXml(res, res.getXml(R.xml.ic_baseline_keyboard_arrow_down));
mArrowNavigation.setImageDrawable(mDrawable);
}
} catch (Exception ignored) { }
mHelpRowContainer.setOnClickListener(this);
}
@Override
public void onClick(View v) {
if(!mIsAnimating){
mIsAnimating = true;
if(mPrevRow !=null && mCurrentPosition !=-1){
try {
mPrevRow.animate().cancel();
mPrevRow.animate().alpha(0).setDuration(300);
onCollapse();
}catch (Exception ex){
mIsAnimating = false;
ex.printStackTrace();
}
}else {
onCollapse();
}
}
}
public void onCollapse(){
mIsAnimating = false;
int mPreviousItem = mCurrentPosition;
if(mCurrentPosition ==getLayoutPosition()){
mCurrentPosition = -1;
}else {
mCurrentPosition = getLayoutPosition();
notifyItemChanged(mCurrentPosition);
}
notifyItemChanged(mPreviousItem);
}
}
public Object onTrigger(helpEnums.eHelpAdapter pCommands, List<Object> pData){
if(pCommands == helpEnums.eHelpAdapter.M_INIT_FILTER){
onSearchFilterInvoked((String) pData.get(0));
}
return null;
}
}

View File

@ -1,26 +1,48 @@
package com.darkweb.genesissearchengine.appManager.helpManager; package com.darkweb.genesissearchengine.appManager.helpManager;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.SimpleItemAnimator;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.constants.constants; 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.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod; import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.pluginManager.pluginController; import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.example.myapplication.R; import com.example.myapplication.R;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Objects;
@SuppressWarnings("FieldCanBeLocal")
public class helpController extends AppCompatActivity { public class helpController extends AppCompatActivity {
/*Initializations*/ /*Initializations*/
private helpViewController mHelpViewController; private helpViewController mHelpViewController;
private helpModel mHelpModel; private helpModel mHelpModel;
private helpAdapter mHelpAdapter;
private ProgressBar mProgressBar;
private RecyclerView mRecycleView;
private ConstraintLayout mRetryContainer;
private Button mReloadButton;
private editTextManager mSearchInput;
/*Private Variables*/
private Handler mSearchInvokedHandler = new Handler();
private Runnable postToServerRunnable;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -29,21 +51,102 @@ public class helpController extends AppCompatActivity {
setContentView(R.layout.help_view); setContentView(R.layout.help_view);
initializeAppModel(); initializeAppModel();
initializeConnections(); initializeViews();
initializeLocalEventHandlers();
} }
public void initializeAppModel() private void initializeAppModel()
{ {
mHelpModel = new helpModel(this, new helpAdapterCallback());
mHelpModel.onTrigger(helpEnums.eHelpModel.M_LOAD_HELP_DATA,null);
}
private void initializeViews(){
mHelpViewController = new helpViewController(); mHelpViewController = new helpViewController();
mHelpModel = new helpModel(); mProgressBar = findViewById(R.id.pProgressBar);
mRecycleView = findViewById(R.id.pRecycleView);
mRetryContainer = findViewById(R.id.pRetryContainer);
mReloadButton = findViewById(R.id.pReloadButton);
mSearchInput = findViewById(R.id.pSearchInput);
mHelpViewController.initialization(new helpViewCallback(),this, mProgressBar, mRecycleView, mRetryContainer, mReloadButton);
mHelpViewController.onTrigger(helpEnums.eHelpViewController.M_INIT_VIEWS, null);
} }
public void initializeConnections() public void initializeLocalEventHandlers(){
{
mHelpViewController.initialization(new helpViewCallback(),this); mRecycleView.addOnItemTouchListener(new RecyclerView.OnItemTouchListener() {
@Override
public boolean onInterceptTouchEvent(RecyclerView recyclerView, MotionEvent motionEvent) {
if (motionEvent.getAction() != MotionEvent.ACTION_UP) {
return false;
}
View child = recyclerView.findChildViewUnder(motionEvent.getX(), motionEvent.getY());
if (child != null) {
return false;
} else {
mSearchInput.clearFocus();
helperMethod.hideKeyboard(helpController.this);
return true;
}
}
@Override
public void onTouchEvent(RecyclerView recyclerView, MotionEvent motionEvent) {
}
@Override
public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
}
});
mSearchInput.setEventHandler(new edittextManagerCallback());
postToServerRunnable = () -> {
mHelpAdapter.onTrigger(helpEnums.eHelpAdapter.M_INIT_FILTER, Collections.singletonList(mSearchInput.getText().toString()));
};
mSearchInput.addTextChangedListener(new TextWatcher() {
@Override
public void afterTextChanged(Editable s) {
mSearchInvokedHandler.removeCallbacks(postToServerRunnable);
mSearchInvokedHandler.postDelayed(postToServerRunnable, 50);
}
@Override
public void beforeTextChanged(CharSequence s, int start,int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start,int before, int count) {
}
});
} }
public class helpViewCallback implements eventObserver.eventListener{ public class edittextManagerCallback implements eventObserver.eventListener {
@Override
public Object invokeObserver(List<Object> data, Object e_type) {
if(e_type.equals(enums.etype.ON_KEYBOARD_CLOSE)){
mSearchInput.clearFocus();
//helperMethod.hideKeyboard(helpController.this);
}
return null;
}
}
public void onOpenHelp(View view) {
helperMethod.sendIssueEmail(this);
}
/*LISTENERS CALLBACKS*/
private class helpViewCallback implements eventObserver.eventListener{
@Override @Override
public Object invokeObserver(List<Object> data, Object e_type) public Object invokeObserver(List<Object> data, Object e_type)
@ -52,10 +155,66 @@ public class helpController extends AppCompatActivity {
} }
} }
/*CALLBACKS HELPER FUNCTIONS*/
private void onShowHelperManager(ArrayList<helpDataModel> pHelpListModel){
mHelpAdapter = new helpAdapter(pHelpListModel, getApplicationContext());
mRecycleView.setLayoutManager(new LinearLayoutManager(this));
mRecycleView.setAdapter(mHelpAdapter);
((SimpleItemAnimator) Objects.requireNonNull(mRecycleView.getItemAnimator())).setSupportsChangeAnimations(false);
mHelpViewController.onTrigger(helpEnums.eHelpViewController.M_DATA_LOADED, null);
mSearchInput.setVisibility(View.VISIBLE);
mSearchInput.animate().setDuration(300).alpha(1);
}
/*LISTENERS*/
private class helpAdapterCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, Object e_type)
{
if(helpEnums.eHelpModelCallback.M_LOAD_JSON_RESPONSE_SUCCESS.equals(e_type))
{
onShowHelperManager((ArrayList<helpDataModel>) data.get(0));
}
else if(helpEnums.eHelpModelCallback.M_LOAD_JSON_RESPONSE_FAILURE.equals(e_type))
{
mHelpViewController.onTrigger(helpEnums.eHelpViewController.M_LOAD_ERROR, null);
}
return null;
}
}
/*UI Redirection*/ /*UI Redirection*/
public void onClose(View view) { public void onClose(View view) {
finish(); finish();
} }
public void onReloadData(View view) {
mHelpViewController.onTrigger(helpEnums.eHelpViewController.M_RELOAD_DATA, null);
mHelpModel.onTrigger(helpEnums.eHelpModel.M_LOAD_HELP_DATA,null);
}
@Override
public void onBackPressed() {
if(mSearchInput.hasFocus()){
mSearchInput.clearFocus();
}else {
finish();
}
super.onBackPressed();
}
public void onOpenHelpExternal(View view) {
if(!status.sSettingIsAppStarted){
activityContextManager.getInstance().getHomeController().onStartApplication(null);
}
activityContextManager.getInstance().getHomeController().onLoadURL(constants.CONST_GENESIS_HELP_URL_CACHE);
finish();
activityContextManager.getInstance().onClearStack();
}
} }

View File

@ -0,0 +1,26 @@
package com.darkweb.genesissearchengine.appManager.helpManager;
public class helpDataModel {
private String mHeader;
private String mDescription;
private String mIcon;
public helpDataModel(String pHeader, String pDescription, String pIcon) {
this.mHeader = pHeader;
this.mDescription = pDescription;
this.mIcon = pIcon;
}
public String getHeader() {
return mHeader;
}
public String getDescription() {
return mDescription;
}
public String getIconID() {
return mIcon;
}
}

View File

@ -0,0 +1,24 @@
package com.darkweb.genesissearchengine.appManager.helpManager;
class helpEnums
{
/*History Manager*/
public enum eHelpModel {
M_LOAD_HELP_DATA
}
public enum eHelpModelCallback {
M_LOAD_JSON_RESPONSE_SUCCESS, M_LOAD_JSON_RESPONSE_FAILURE
}
public enum eHelpViewController {
M_INIT_VIEWS, M_DATA_LOADED, M_LOAD_ERROR, M_RELOAD_DATA
}
public enum eHelpAdapter {
M_INIT_FILTER
}
public enum eHelpViewCallback {
}
}

View File

@ -1,7 +1,67 @@
package com.darkweb.genesissearchengine.appManager.helpManager; package com.darkweb.genesissearchengine.appManager.helpManager;
import androidx.appcompat.app.AppCompatActivity;
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.helperManager.ProxiedHurlStack;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
class helpModel class helpModel
{ {
private eventObserver.eventListener mEvent;
private String mJsonPath = "https://drive.google.com/uc?export=download&id=1es7XOAWCktGGfSnJu_o8W4_LZuudjR-T";
private AppCompatActivity mContext;
private ArrayList<helpDataModel> mHelpListModel;
public helpModel(AppCompatActivity pContext, eventObserver.eventListener pEvent){
this.mContext = pContext;
this.mEvent = pEvent;
this.mHelpListModel = new ArrayList<>();
}
private void getHelpJSON(){
mHelpListModel.clear();
StringRequest stringRequest = new StringRequest(Request.Method.GET, mJsonPath,
response -> {
try {
JSONArray jsonArray = new JSONArray(response);
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject obj = jsonArray.getJSONObject(i);
helpDataModel hero = new helpDataModel(
obj.getString("mHeader"),
obj.getString("mDescription"),
obj.getString("mIcon"));
mHelpListModel.add(hero);
}
mEvent.invokeObserver(Collections.singletonList(mHelpListModel),helpEnums.eHelpModelCallback.M_LOAD_JSON_RESPONSE_SUCCESS);
} catch (JSONException e) {
mEvent.invokeObserver(Collections.singletonList(mHelpListModel),helpEnums.eHelpModelCallback.M_LOAD_JSON_RESPONSE_FAILURE);
e.printStackTrace();
}
},
error -> {
mEvent.invokeObserver(Collections.singletonList(mHelpListModel),helpEnums.eHelpModelCallback.M_LOAD_JSON_RESPONSE_FAILURE);
});
RequestQueue requestQueue = Volley.newRequestQueue(mContext/*, new ProxiedHurlStack()*/);
requestQueue.add(stringRequest);
}
public Object onTrigger(helpEnums.eHelpModel pCommands, List<Object> pData){
if(pCommands.equals(helpEnums.eHelpModel.M_LOAD_HELP_DATA)){
getHelpJSON();
}
return null;
}
} }

View File

@ -4,23 +4,39 @@ import android.os.Build;
import android.view.View; import android.view.View;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.app.AppCompatDelegate;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.orbotLogManager.orbotLogEnums;
import com.darkweb.genesissearchengine.constants.status; import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.helperManager.eventObserver; import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.example.myapplication.R; import com.example.myapplication.R;
import java.util.List;
class helpViewController class helpViewController
{ {
/*ViewControllers*/ /*ViewControllers*/
private AppCompatActivity mContext; private AppCompatActivity mContext;
private eventObserver.eventListener mEvent; private eventObserver.eventListener mEvent;
private ProgressBar mProgressBar;
private RecyclerView mRecyclerView;
private ConstraintLayout mRetryContainer;
private Button mReloadButton;
void initialization(eventObserver.eventListener event, AppCompatActivity context){ void initialization(eventObserver.eventListener event, AppCompatActivity context, ProgressBar pProgressBar, RecyclerView pRecyclerView, ConstraintLayout pRetryContainer, Button pReloadButton){
this.mContext = context; this.mContext = context;
initPostUI(); this.mProgressBar = pProgressBar;
this.mRecyclerView = pRecyclerView;
this.mRetryContainer = pRetryContainer;
this.mReloadButton = pReloadButton;
} }
private void initPostUI(){ private void initPostUI(){
@ -39,4 +55,53 @@ class helpViewController
} }
} }
} }
public void onDataLoaded(){
mProgressBar.animate().cancel();
mRetryContainer.animate().cancel();
mRecyclerView.animate().cancel();
mRecyclerView.animate().setDuration(300).alpha(1);
mProgressBar.animate().setDuration(300).alpha(0);
}
public void onLoadError(){
mRecyclerView.animate().setDuration(300).alpha(0);
mProgressBar.setVisibility(View.VISIBLE);
mProgressBar.setAlpha(1);
mRetryContainer.bringToFront();
mProgressBar.animate().setDuration(300).setStartDelay(200).alpha(0).withEndAction(() -> {
mRetryContainer.setAlpha(0);
mRetryContainer.animate().setDuration(300).alpha(1).withEndAction(() -> mReloadButton.setClickable(true));
mRetryContainer.setVisibility(View.VISIBLE);
});
}
public void onReloadData(){
mRecyclerView.animate().setDuration(300).alpha(0);
mReloadButton.setClickable(false);
mRetryContainer.animate().cancel();
mProgressBar.animate().cancel();
mProgressBar.animate().setDuration(300).alpha(1);
mRetryContainer.animate().alpha(0).withEndAction(() -> {
mRetryContainer.setVisibility(View.GONE);
});
}
public void onTrigger(helpEnums.eHelpViewController pCommands, List<Object> pData){
if(pCommands.equals(helpEnums.eHelpViewController.M_INIT_VIEWS)){
initPostUI();
}
else if(pCommands.equals(helpEnums.eHelpViewController.M_DATA_LOADED)){
onDataLoaded();
}
else if(pCommands.equals(helpEnums.eHelpViewController.M_LOAD_ERROR)){
onLoadError();
}
else if(pCommands.equals(helpEnums.eHelpViewController.M_RELOAD_DATA)){
onReloadData();
}
}
} }

View File

@ -25,6 +25,8 @@ import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import systems.intelligo.slight.ImageLoader;
import static android.content.Context.LAYOUT_INFLATER_SERVICE; 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.HISTORY_LOAD_MORE;
@ -41,13 +43,14 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
private ArrayList<String> mLongSelectedIndex = new ArrayList<>(); private ArrayList<String> mLongSelectedIndex = new ArrayList<>();
private ArrayList<Integer> mLongSelectedID = new ArrayList<>(); private ArrayList<Integer> mLongSelectedID = new ArrayList<>();
private ImageLoader imageLoader;
private AppCompatActivity mContext; private AppCompatActivity mContext;
private historyAdapterView mHistroyAdapterView; private historyAdapterView mHistroyAdapterView;
private Context mListHolderContext; private Context mListHolderContext;
private PopupWindow mPopupWindow = null; private PopupWindow mPopupWindow = null;
private eventObserver.eventListener mEvent; private eventObserver.eventListener mEvent;
boolean mLongPressedMenuActive = false;
private String mFilter = strings.GENERIC_EMPTY_STR; private String mFilter = strings.GENERIC_EMPTY_STR;
private boolean mLongPressedMenuActive = false;
/*Local Variables*/ /*Local Variables*/
@ -60,6 +63,7 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
this.mPassedList = pModelList; this.mPassedList = pModelList;
this.mContext = pMainContext; this.mContext = pMainContext;
this.mHistroyAdapterView = new historyAdapterView(mContext); this.mHistroyAdapterView = new historyAdapterView(mContext);
this.imageLoader = new ImageLoader(mContext);
initializeModelWithDate(false); initializeModelWithDate(false);
} }
@ -210,7 +214,7 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
@Override @Override
public listViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public listViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
mListHolderContext = parent.getContext(); mListHolderContext = parent.getContext();
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.recyclerview_row, parent, false); View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.history_bookmark_row_view, parent, false);
return new listViewHolder(view); return new listViewHolder(view);
} }
@ -342,7 +346,7 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
void onOpenMenu(View pView, String pUrl, int pPosition, String pTitle){ void onOpenMenu(View pView, String pUrl, int pPosition, String pTitle){
LayoutInflater layoutInflater = (LayoutInflater) pView.getContext().getSystemService(LAYOUT_INFLATER_SERVICE); LayoutInflater layoutInflater = (LayoutInflater) pView.getContext().getSystemService(LAYOUT_INFLATER_SERVICE);
@SuppressLint("InflateParams") final View mPopupView = layoutInflater.inflate(R.layout.recyclerview__row_menu, null); @SuppressLint("InflateParams") final View mPopupView = layoutInflater.inflate(R.layout.history_bookmark__row_menu, null);
mPopupWindow = (PopupWindow) mHistroyAdapterView.onTrigger(historyEnums.eHistoryViewAdapterCommands.M_OPEN_MENU, Arrays.asList(mPopupWindow, pView, mPopupView)); mPopupWindow = (PopupWindow) mHistroyAdapterView.onTrigger(historyEnums.eHistoryViewAdapterCommands.M_OPEN_MENU, Arrays.asList(mPopupWindow, pView, mPopupView));
setPopupWindowEvents(mPopupView.findViewById(R.id.pMenuCopy), pUrl, pPosition, pTitle); setPopupWindowEvents(mPopupView.findViewById(R.id.pMenuCopy), pUrl, pPosition, pTitle);
@ -438,6 +442,7 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
TextView mWebLogo; TextView mWebLogo;
ImageButton mRowMenu; ImageButton mRowMenu;
ImageView mLogoImage; ImageView mLogoImage;
ImageView mFaviconLogo;
LinearLayout mRowContainer; LinearLayout mRowContainer;
LinearLayout mDateContainer; LinearLayout mDateContainer;
LinearLayout mLoadingContainer; LinearLayout mLoadingContainer;
@ -456,7 +461,7 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
mLogoImage = itemView.findViewById(R.id.pLogoImage); mLogoImage = itemView.findViewById(R.id.pLogoImage);
mWebLogo = itemView.findViewById(R.id.pWebLogo); mWebLogo = itemView.findViewById(R.id.pWebLogo);
mLoadingContainer = itemView.findViewById(R.id.pLoadingContainer); mLoadingContainer = itemView.findViewById(R.id.pLoadingContainer);
mFaviconLogo = itemView.findViewById(R.id.pFaviconLogo);
if(model.getID() == -1){ if(model.getID() == -1){
mDate.setText(model.getHeader()); mDate.setText(model.getHeader());
@ -487,6 +492,7 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
mWebLogo.setText((helperMethod.getDomainName(model.getHeader()).toUpperCase().charAt(0)+"")); mWebLogo.setText((helperMethod.getDomainName(model.getHeader()).toUpperCase().charAt(0)+""));
String header = model.getHeader(); String header = model.getHeader();
mDescription.setText(("https://"+model.getDescription())); mDescription.setText(("https://"+model.getDescription()));
mEvent.invokeObserver(Arrays.asList(mFaviconLogo, "https://" + model.getDescription()),enums.etype.fetch_favicon);
mHeader.setText(model.getHeader()); mHeader.setText(model.getHeader());
setItemViewOnClickListener(mRowContainer, mRowMenu, mDescription.getText().toString(), p_position, header, mRowMenu, mLogoImage, model.getID(), model.getDate()); setItemViewOnClickListener(mRowContainer, mRowMenu, mDescription.getText().toString(), p_position, header, mRowMenu, mLogoImage, model.getID(), model.getDate());

View File

@ -98,6 +98,7 @@ public class historyController extends AppCompatActivity
mHeaderContainer = findViewById(R.id.pHeaderContainer); mHeaderContainer = findViewById(R.id.pHeaderContainer);
mTitle = findViewById(R.id.pTitle); mTitle = findViewById(R.id.pTitle);
activityContextManager.getInstance().onStack(this);
mHistoryViewController = new historyViewController(mEmptyListNotification, mSearchInput, mRecycleView, mClearButton,this, mMenuButton, mSearchButton, mHeaderContainer, mTitle); mHistoryViewController = new historyViewController(mEmptyListNotification, mSearchInput, mRecycleView, mClearButton,this, mMenuButton, mSearchButton, mHeaderContainer, mTitle);
} }
@ -252,6 +253,17 @@ public class historyController extends AppCompatActivity
super.onPause(); super.onPause();
} }
@Override
protected void onStop() {
super.onStop();
}
@Override
protected void onDestroy() {
super.onDestroy();
}
@Override @Override
public void onBackPressed() { public void onBackPressed() {
if(mSearchInput.getVisibility() == View.VISIBLE){ if(mSearchInput.getVisibility() == View.VISIBLE){
@ -259,6 +271,7 @@ public class historyController extends AppCompatActivity
}else if((Boolean) mHistoryAdapter.onTrigger(historyEnums.eHistoryAdapterCommands.GET_LONG_SELECTED_STATUS,null)){ }else if((Boolean) mHistoryAdapter.onTrigger(historyEnums.eHistoryAdapterCommands.GET_LONG_SELECTED_STATUS,null)){
onClearMultipleSelection(null); onClearMultipleSelection(null);
}else { }else {
activityContextManager.getInstance().onRemoveStack(this);
finish(); finish();
} }
} }
@ -355,6 +368,9 @@ public class historyController extends AppCompatActivity
mHomeController.onOpenLinkNewTab(url_temp); mHomeController.onOpenLinkNewTab(url_temp);
finish(); finish();
} }
else if(e_type.equals(enums.etype.fetch_favicon)){
mHomeController.onGetFavIcon((ImageView) data.get(0), (String) data.get(1));
}
else if(e_type.equals(enums.etype.url_clear)){ else if(e_type.equals(enums.etype.url_clear)){
mHistoryModel.onManualClear((int)data.get(0)); mHistoryModel.onManualClear((int)data.get(0));
} }

View File

@ -8,51 +8,51 @@ public class historyRowModel
{ {
/*Private Variables*/ /*Private Variables*/
private int m_id; private int mID;
private String m_header; private String mHeader;
private String m_description; private String mDescription;
private Date m_date; private Date mDate;
private ImageView m_logo; private ImageView mLogo;
/*Initializations*/ /*Initializations*/
public historyRowModel(String p_header, String p_description,int p_id) { public historyRowModel(String pHeader, String pDescription,int pID) {
this.m_id = p_id; this.mID = pID;
this.m_header = p_header; this.mHeader = pHeader;
this.m_description = p_description; this.mDescription = pDescription;
m_date = Calendar.getInstance().getTime(); mDate = Calendar.getInstance().getTime();
} }
/*Variable Setters*/ /*Variable Setters*/
public void setHeader(String p_header){ public void setHeader(String pHeader){
this.m_header = p_header; this.mHeader = pHeader;
} }
public void setURL(String p_url){ public void setURL(String pURL){
this.m_description = p_url; this.mDescription = pURL;
} }
public void setLogo(ImageView p_logo){ public void setLogo(ImageView pLogo){
this.m_logo = p_logo; this.mLogo = pLogo;
} }
public void setDate(Date p_date) { public void setDate(Date pDate) {
m_date = p_date; mDate = pDate;
} }
/*Variable Getters*/ /*Variable Getters*/
public String getHeader() { public String getHeader() {
return m_header; return mHeader;
} }
public String getDescription() { public String getDescription() {
return m_description; return mDescription;
} }
public int getID() { public int getID() {
return m_id; return mID;
} }
public ImageView getLogo() { public ImageView getLogo() {
return m_logo; return mLogo;
} }
public Date getDate() { public Date getDate() {
return m_date; return mDate;
} }
} }

View File

@ -264,7 +264,7 @@ class historyViewController
} }
private void onLongPressMenu(View pView) { private void onLongPressMenu(View pView) {
mPopupWindow = helperMethod.onCreateMenu(pView, R.layout.recyclerview__menu); mPopupWindow = helperMethod.onCreateMenu(pView, R.layout.history_bookmark_menu);
} }
private void onDrawSwipableBackground(Canvas pCanvas, RecyclerView.ViewHolder pViewHolder, float pDX, int pActionState) { private void onDrawSwipableBackground(Canvas pCanvas, RecyclerView.ViewHolder pViewHolder, float pDX, int pActionState) {

View File

@ -0,0 +1,96 @@
package com.darkweb.genesissearchengine.appManager.homeManager;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.content.Context;
import android.util.AttributeSet;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator;
import android.widget.ProgressBar;
public class AnimatingProgressBar extends ProgressBar {
private static final Interpolator DEFAULT_INTERPOLATER = new AccelerateDecelerateInterpolator();
private ValueAnimator animator;
private ValueAnimator animatorSecondary;
private boolean animate = true;
public AnimatingProgressBar(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public AnimatingProgressBar(Context context, AttributeSet attrs) {
super(context, attrs);
}
public AnimatingProgressBar(Context context) {
super(context);
}
public boolean isAnimate() {
return animate;
}
public void setAnimate(boolean animate) {
this.animate = animate;
}
@Override
public synchronized void setProgress(int progress) {
if (!animate) {
super.setProgress(progress);
return;
}
if (animator != null)
animator.cancel();
if (animator == null) {
animator = ValueAnimator.ofInt(getProgress(), progress);
animator.setInterpolator(DEFAULT_INTERPOLATER);
animator.addUpdateListener(new AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
AnimatingProgressBar.super.setProgress((Integer) animation.getAnimatedValue());
}
});
} else
animator.setIntValues(getProgress(), progress);
animator.start();
}
@Override
public synchronized void setSecondaryProgress(int secondaryProgress) {
if (!animate) {
super.setSecondaryProgress(secondaryProgress);
return;
}
if (animatorSecondary != null)
animatorSecondary.cancel();
if (animatorSecondary == null) {
animatorSecondary = ValueAnimator.ofInt(getProgress(), secondaryProgress);
animatorSecondary.setInterpolator(DEFAULT_INTERPOLATER);
animatorSecondary.addUpdateListener(new AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
AnimatingProgressBar.super.setSecondaryProgress((Integer) animation
.getAnimatedValue());
}
});
} else
animatorSecondary.setIntValues(getProgress(), secondaryProgress);
animatorSecondary.start();
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
if (animator != null)
animator.cancel();
if (animatorSecondary != null)
animatorSecondary.cancel();
}
}

View File

@ -0,0 +1,47 @@
package com.darkweb.genesissearchengine.appManager.homeManager;
import android.content.Context;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.inputmethod.InputMethodManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
public class editTextManager extends androidx.appcompat.widget.AppCompatAutoCompleteTextView {
Context mContext;
private eventObserver.eventListener mEvent = null;
public editTextManager(@NonNull Context context) {
super(context);
mContext = context;
}
public editTextManager(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
mContext = context;
}
public editTextManager(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mContext = context;
}
public void setEventHandler(eventObserver.eventListener pEvent){
mEvent = pEvent;
}
@Override
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if(mEvent!=null){
mEvent.invokeObserver(null, enums.etype.ON_KEYBOARD_CLOSE);
}
}
return false;
}
}

View File

@ -2,7 +2,9 @@ package com.darkweb.genesissearchengine.appManager.homeManager;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.widget.ImageView;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import com.darkweb.genesissearchengine.appManager.kotlinHelperLibraries.BrowserIconManager;
import com.darkweb.genesissearchengine.constants.*; import com.darkweb.genesissearchengine.constants.*;
import com.darkweb.genesissearchengine.helperManager.eventObserver; import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod; import com.darkweb.genesissearchengine.helperManager.helperMethod;
@ -18,6 +20,7 @@ import static org.mozilla.geckoview.StorageController.ClearFlags.NETWORK_CACHE;
import static org.mozilla.geckoview.StorageController.ClearFlags.PERMISSIONS; import static org.mozilla.geckoview.StorageController.ClearFlags.PERMISSIONS;
import static org.mozilla.geckoview.StorageController.ClearFlags.SITE_DATA; import static org.mozilla.geckoview.StorageController.ClearFlags.SITE_DATA;
import static org.mozilla.geckoview.StorageController.ClearFlags.SITE_SETTINGS; import static org.mozilla.geckoview.StorageController.ClearFlags.SITE_SETTINGS;
import org.mozilla.geckoview.ContentBlocking; import org.mozilla.geckoview.ContentBlocking;
import org.mozilla.geckoview.GeckoRuntime; import org.mozilla.geckoview.GeckoRuntime;
import org.mozilla.geckoview.GeckoSession; import org.mozilla.geckoview.GeckoSession;
@ -29,11 +32,14 @@ class geckoClients
private geckoSession mSession = null; private geckoSession mSession = null;
private GeckoRuntime mRuntime = null; private GeckoRuntime mRuntime = null;
private String mSessionID; private BrowserIconManager mIconManager;
private eventObserver.eventListener event; private eventObserver.eventListener event;
private AppCompatActivity context; private AppCompatActivity context;
/*Local Variable*/
private String mSessionID;
void initialize(GeckoView geckoView, eventObserver.eventListener event, AppCompatActivity context, boolean isForced) void initialize(GeckoView geckoView, eventObserver.eventListener event, AppCompatActivity context, boolean isForced)
{ {
this.context = context; this.context = context;
@ -56,6 +62,8 @@ class geckoClients
geckoView.setSession(mSession); geckoView.setSession(mSession);
} }
mSession.onSetInitializeFromStartup(); mSession.onSetInitializeFromStartup();
onUpdateFont(); onUpdateFont();
} }
@ -79,6 +87,10 @@ class geckoClients
return mTempSession; return mTempSession;
} }
public void onSessionReinit(){
mSession.onSessionReinit();
}
void toogleUserAgent(){ void toogleUserAgent(){
mSession.toogleUserAgent(); mSession.toogleUserAgent();
} }
@ -96,6 +108,7 @@ class geckoClients
mRuntime.getSettings().getContentBlocking().setCookieBehavior(getCookiesBehaviour()); mRuntime.getSettings().getContentBlocking().setCookieBehavior(getCookiesBehaviour());
mRuntime.getSettings().getContentBlocking().setSafeBrowsing(ContentBlocking.SafeBrowsing.DEFAULT); mRuntime.getSettings().getContentBlocking().setSafeBrowsing(ContentBlocking.SafeBrowsing.DEFAULT);
mRuntime.getSettings().setAutomaticFontSizeAdjustment(status.sSettingFontAdjustable); mRuntime.getSettings().setAutomaticFontSizeAdjustment(status.sSettingFontAdjustable);
mIconManager = new BrowserIconManager();
if(status.sSettingTrackingProtection){ if(status.sSettingTrackingProtection){
mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.AD); mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.AD);
mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.FINGERPRINTING); mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.FINGERPRINTING);
@ -105,6 +118,16 @@ class geckoClients
} }
} }
public void onGetFavIcon(ImageView pImageView, String pURL){
pURL = helperMethod.completeURL(helperMethod.getDomainName(pURL));
mIconManager.onLoadIconIntoView(context,mRuntime, pImageView, pURL);
}
public void onLoadFavIcon(){
BrowserIconManager mIconManager = new BrowserIconManager();
mIconManager.onLoadIcon(context, mRuntime);
}
private int getCookiesBehaviour(){ private int getCookiesBehaviour(){
return status.sSettingCookieStatus; return status.sSettingCookieStatus;
} }
@ -115,6 +138,7 @@ class geckoClients
mRuntime.getSettings().getContentBlocking().setCookieBehavior(getCookiesBehaviour()); mRuntime.getSettings().getContentBlocking().setCookieBehavior(getCookiesBehaviour());
mRuntime.getSettings().setAutomaticFontSizeAdjustment(status.sSettingFontAdjustable); mRuntime.getSettings().setAutomaticFontSizeAdjustment(status.sSettingFontAdjustable);
mRuntime.getSettings().getContentBlocking().setSafeBrowsing(ContentBlocking.SafeBrowsing.DEFAULT); mRuntime.getSettings().getContentBlocking().setSafeBrowsing(ContentBlocking.SafeBrowsing.DEFAULT);
mIconManager = new BrowserIconManager();
if(status.sSettingTrackingProtection){ if(status.sSettingTrackingProtection){
mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.AD); mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.AD);
mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.FINGERPRINTING); mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.FINGERPRINTING);
@ -142,20 +166,36 @@ class geckoClients
void onUploadRequest(int resultCode,Intent data){ void onUploadRequest(int resultCode,Intent data){
mSession.onFileUploadRequest(resultCode,data); mSession.onFileUploadRequest(resultCode,data);
} }
void setLoading(boolean status){ void setLoading(boolean status){
mSession.setLoading(status); mSession.setLoading(status);
} }
void loadURL(String url){ void loadURL(String url) {
if(mSession.onGetInitializeFromStartup()){ if(mSession.onGetInitializeFromStartup()){
mSession.initURL(url); mSession.initURL(url);
mSession.loadUri(url); if(url.equals("boogle.store") || url.equals(constants.CONST_GENESIS_DOMAIN_URL_SLASHED)){
try{
mSession.initURL(constants.CONST_GENESIS_DOMAIN_URL);
mSession.loadUri(constants.CONST_GENESIS_URL_CACHED);
}catch (Exception ex){
ex.printStackTrace();
}
}else if(url.contains(constants.CONST_GENESIS_HELP_URL_SUB)){
try{
mSession.initURL(constants.CONST_GENESIS_HELP_URL);
mSession.loadUri(constants.CONST_GENESIS_HELP_URL_CACHE);
}catch (Exception ex){
ex.printStackTrace();
}
}else {
mSession.loadUri(url);
}
} }
} }
public void onRedrawPixel(){ public void onRedrawPixel(){
mSession.onRedrawPixel(); mSession.onRedrawPixel();
onLoadFavIcon();
} }
void onClearSiteData(){ void onClearSiteData(){

View File

@ -27,6 +27,8 @@ import androidx.annotation.UiThread;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.NotificationCompat; import androidx.core.app.NotificationCompat;
import androidx.core.content.FileProvider; import androidx.core.content.FileProvider;
import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.enums; import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.status; import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.constants.strings; import com.darkweb.genesissearchengine.constants.strings;
@ -35,14 +37,15 @@ import com.darkweb.genesissearchengine.helperManager.JavaScriptInterface;
import com.darkweb.genesissearchengine.helperManager.downloadFileService; import com.darkweb.genesissearchengine.helperManager.downloadFileService;
import com.darkweb.genesissearchengine.helperManager.errorHandler; import com.darkweb.genesissearchengine.helperManager.errorHandler;
import com.darkweb.genesissearchengine.helperManager.eventObserver; import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R; import com.example.myapplication.R;
import org.json.JSONObject;
import org.mozilla.gecko.util.ThreadUtils; import org.mozilla.gecko.util.ThreadUtils;
import org.mozilla.geckoview.AllowOrDeny; import org.mozilla.geckoview.AllowOrDeny;
import org.mozilla.geckoview.Autofill; import org.mozilla.geckoview.Autofill;
import org.mozilla.geckoview.GeckoResult; import org.mozilla.geckoview.GeckoResult;
import org.mozilla.geckoview.GeckoSession; import org.mozilla.geckoview.GeckoSession;
import org.mozilla.geckoview.GeckoView; import org.mozilla.geckoview.GeckoView;
import org.mozilla.geckoview.SlowScriptResponse;
import org.mozilla.geckoview.WebRequestError; import org.mozilla.geckoview.WebRequestError;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
@ -69,6 +72,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
private Uri mUriPermission = null; private Uri mUriPermission = null;
private AppCompatActivity mContext; private AppCompatActivity mContext;
private geckoDownloadManager mDownloadManager; private geckoDownloadManager mDownloadManager;
private String mTheme = null;
/*Temp Variables*/ /*Temp Variables*/
private GeckoSession.HistoryDelegate.HistoryList mHistoryList = null; private GeckoSession.HistoryDelegate.HistoryList mHistoryList = null;
@ -76,13 +80,17 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
private int m_current_url_id = -1; private int m_current_url_id = -1;
private GeckoView mGeckoView; private GeckoView mGeckoView;
private boolean mIsLoaded = false; private boolean mIsLoaded = false;
private boolean isFirstPaintExecuted = false;
private boolean mIsProgressBarChanging = false;
geckoSession(eventObserver.eventListener event,String mSessionID,AppCompatActivity mContext, GeckoView pGeckoView){ geckoSession(eventObserver.eventListener event,String mSessionID,AppCompatActivity mContext, GeckoView pGeckoView){
this.mGeckoView = pGeckoView; this.mGeckoView = pGeckoView;
this.mContext = mContext; this.mContext = mContext;
this.mSessionID = mSessionID; this.mSessionID = mSessionID;
this.event = event;
onSessionReinit();
setProgressDelegate(this); setProgressDelegate(this);
setHistoryDelegate(this); setHistoryDelegate(this);
setNavigationDelegate(this); setNavigationDelegate(this);
@ -91,7 +99,6 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
setPermissionDelegate(this); setPermissionDelegate(this);
mDownloadManager = new geckoDownloadManager(); mDownloadManager = new geckoDownloadManager();
setPromptDelegate(new geckoPromptView(mContext)); setPromptDelegate(new geckoPromptView(mContext));
this.event = event;
} }
public void onSetInitializeFromStartup(){ public void onSetInitializeFromStartup(){
@ -116,6 +123,14 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
Objects.requireNonNull(mPromptDelegate).onFileCallbackResult(resultCode,data); Objects.requireNonNull(mPromptDelegate).onFileCallbackResult(resultCode,data);
} }
public void onSessionReinit(){
if(!isFirstPaintExecuted){
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id), enums.etype.ON_SESSION_REINIT);
}else {
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id), enums.etype.ON_FIRST_PAINT);
}
}
void initURL(String url){ void initURL(String url){
if(mIsLoaded){ if(mIsLoaded){
isPageLoading = true; isPageLoading = true;
@ -201,15 +216,16 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
@Override @Override
public void onPageStart(@NonNull GeckoSession var1, @NonNull String var2) { public void onPageStart(@NonNull GeckoSession var1, @NonNull String var2) {
mCanGoBack = true;
if(mIsLoaded){ if(mIsLoaded){
if(!isPageLoading){ if(!isPageLoading){
mCurrentTitle = "loading"; mCurrentTitle = "loading";
m_current_url_id = -1; m_current_url_id = -1;
mTheme = null;
} }
isPageLoading = true; isPageLoading = true;
if(!var2.equals("about:blank") && !mCurrentTitle.equals("loading")){ if(!var2.equals("about:blank") && !mCurrentTitle.equals("loading")){
mProgress = 5; mProgress = 5;
mTheme = null;
} }
} }
} }
@ -217,7 +233,12 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
@UiThread @UiThread
public void onPageStop(@NonNull GeckoSession var1, boolean var2) { public void onPageStop(@NonNull GeckoSession var1, boolean var2) {
if(var2){ if(var2){
event.invokeObserver(Arrays.asList("",mSessionID,mCurrentTitle, m_current_url_id), dataEnums.eTabCommands.M_UPDATE_PIXEL); if(mProgress>=100){
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.ON_UPDATE_THEME);
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme), enums.etype.on_update_favicon);
event.invokeObserver(Arrays.asList(null,mSessionID), enums.etype.on_page_loaded);
onRedrawPixel();
}
} }
} }
@ -226,7 +247,16 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
{ {
if(!mFullScreen){ if(!mFullScreen){
mProgress = progress; mProgress = progress;
event.invokeObserver(Arrays.asList(mProgress,mSessionID), enums.etype.progress_update);
if(progress==100){
if(!mIsProgressBarChanging){
mIsProgressBarChanging = true;
mContext.runOnUiThread(() -> event.invokeObserver(Arrays.asList(mProgress,mSessionID), enums.etype.progress_update));
}
}else {
mIsProgressBarChanging = false;
mContext.runOnUiThread(() -> event.invokeObserver(Arrays.asList(mProgress,mSessionID), enums.etype.progress_update));
}
} }
if(progress>=100){ if(progress>=100){
@ -235,7 +265,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
} }
public void onRedrawPixel(){ public void onRedrawPixel(){
event.invokeObserver(Arrays.asList("",mSessionID,mCurrentTitle, m_current_url_id), dataEnums.eTabCommands.M_UPDATE_PIXEL); event.invokeObserver(Arrays.asList("",mSessionID,mCurrentTitle, m_current_url_id, mTheme), dataEnums.eTabCommands.M_UPDATE_PIXEL);
} }
/*History Delegate*/ /*History Delegate*/
@ -243,8 +273,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
public GeckoResult<Boolean> onVisited(@NonNull GeckoSession var1, @NonNull String var2, @Nullable String var3, int var4) { public GeckoResult<Boolean> onVisited(@NonNull GeckoSession var1, @NonNull String var2, @Nullable String var3, int var4) {
if(var4==3 || var4==5 || var4==1){ if(var4==3 || var4==5 || var4==1){
event.invokeObserver(Arrays.asList(var2,mSessionID), enums.etype.on_url_load); 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); m_current_url_id = (int)event.invokeObserver(Arrays.asList(var2,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.on_update_history);
event.invokeObserver(Arrays.asList(var2,mSessionID,mCurrentTitle, m_current_url_id), dataEnums.eTabCommands.M_UPDATE_PIXEL);
isPageLoading = false; isPageLoading = false;
} }
return null; return null;
@ -264,22 +293,19 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
String newUrl = Objects.requireNonNull(var2).split("#")[0]; String newUrl = Objects.requireNonNull(var2).split("#")[0];
if(!mCurrentTitle.equals("loading")){ 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); m_current_url_id = (int)event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.on_update_history);
event.invokeObserver(Arrays.asList(var2,mSessionID,mCurrentTitle, m_current_url_id), dataEnums.eTabCommands.M_UPDATE_PIXEL);
} }
mCurrentURL = newUrl; if(newUrl.equals(constants.CONST_GENESIS_URL_CACHED)){
mCurrentURL = constants.CONST_GENESIS_DOMAIN_URL;
if (!var2.equals("about:blank")) }
{ else if(newUrl.equals(constants.CONST_GENESIS_HELP_URL_CACHE)){
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID), enums.etype.start_proxy); mCurrentURL = constants.CONST_GENESIS_HELP_URL;
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID), enums.etype.search_update); }else {
event.invokeObserver(Arrays.asList(null,mSessionID), enums.etype.on_page_loaded); mCurrentURL = newUrl;
checkApplicationRate(); }
if(!mCurrentURL.equals("about:blank")){
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.ON_UPDATE_SEARCH_BAR);
} }
}
@Override
public void loadData(@NonNull byte[] var1, @Nullable String var2) {
} }
public GeckoResult<AllowOrDeny> onLoadRequest(@NonNull GeckoSession var2, @NonNull GeckoSession.NavigationDelegate.LoadRequest var1) { public GeckoResult<AllowOrDeny> onLoadRequest(@NonNull GeckoSession var2, @NonNull GeckoSession.NavigationDelegate.LoadRequest var1) {
@ -287,6 +313,11 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
event.invokeObserver(Arrays.asList(var1.uri,mSessionID), enums.etype.on_playstore_load); event.invokeObserver(Arrays.asList(var1.uri,mSessionID), enums.etype.on_playstore_load);
return GeckoResult.fromValue(AllowOrDeny.DENY); return GeckoResult.fromValue(AllowOrDeny.DENY);
} }
else if(var1.uri.equals(constants.CONST_GENESIS_DOMAIN_URL_SLASHED)){
initURL(constants.CONST_GENESIS_DOMAIN_URL);
loadUri("resource://android/assets/Homepage/homepage.html");
return GeckoResult.fromValue(AllowOrDeny.DENY);
}
else if(var1.uri.equals("about:blank") && mIsLoaded){ else if(var1.uri.equals("about:blank") && mIsLoaded){
return GeckoResult.fromValue(AllowOrDeny.ALLOW); return GeckoResult.fromValue(AllowOrDeny.ALLOW);
} }
@ -294,9 +325,20 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
event.invokeObserver(Arrays.asList(var1.uri,mSessionID), enums.etype.open_new_tab); event.invokeObserver(Arrays.asList(var1.uri,mSessionID), enums.etype.open_new_tab);
return GeckoResult.fromValue(AllowOrDeny.DENY); return GeckoResult.fromValue(AllowOrDeny.DENY);
} }
else { else if(!var1.uri.equals("about:blank")){
mCurrentURL = var1.uri;
if(mCurrentURL.equals(constants.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;
}
event.invokeObserver(Arrays.asList(var1.uri,mSessionID), enums.etype.start_proxy); event.invokeObserver(Arrays.asList(var1.uri,mSessionID), enums.etype.start_proxy);
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID), enums.etype.search_update);
checkApplicationRate();
return GeckoResult.fromValue(AllowOrDeny.ALLOW); return GeckoResult.fromValue(AllowOrDeny.ALLOW);
}else {
return GeckoResult.fromValue(AllowOrDeny.DENY);
} }
} }
@ -312,15 +354,17 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
mCanGoForward = var2; mCanGoForward = var2;
} }
public GeckoResult<String> onLoadError(@NonNull GeckoSession var1, @Nullable String var2, WebRequestError var3) { public GeckoResult<String> onLoadError(@NonNull GeckoSession var1, @Nullable String var2, WebRequestError var3) {
errorHandler handler = new errorHandler(); errorHandler handler = new errorHandler();
mProgress = 0; mProgress = 0;
event.invokeObserver(Arrays.asList(var2,mSessionID), enums.etype.on_load_error); event.invokeObserver(Arrays.asList(var2,mSessionID), enums.etype.on_load_error);
event.invokeObserver(Arrays.asList(mProgress,mSessionID), enums.etype.progress_update); 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)); return GeckoResult.fromValue("data:text/html," + handler.createErrorPage(var3.category, var3.code,mContext,var2));
} }
/*Content Delegate*/ /*Content Delegate*/
@UiThread
@Override @Override
public void onExternalResponse(@NonNull GeckoSession session, @NonNull GeckoSession.WebResponseInfo response) { public void onExternalResponse(@NonNull GeckoSession session, @NonNull GeckoSession.WebResponseInfo response) {
try { try {
@ -331,13 +375,46 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
} }
} }
@UiThread
public void onFirstContentfulPaint(@NonNull GeckoSession var1) {
isFirstPaintExecuted = true;
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);
}else {
onSessionReinit();
}
}
@UiThread
public GeckoResult<SlowScriptResponse> onSlowScript(@NonNull GeckoSession var1, @NonNull String var2) {
return null;
}
@UiThread
public void onWebAppManifest(@NonNull GeckoSession var1, @NonNull JSONObject var2) {
try {
mTheme = var2.getString("theme_color");
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.ON_UPDATE_THEME);
} catch (Exception ex) {
ex.printStackTrace();
}
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme), enums.etype.ON_UPDATE_TAB_TITLE);
}
@UiThread @UiThread
public void onTitleChange(@NonNull GeckoSession var1, @Nullable String var2) { public void onTitleChange(@NonNull GeckoSession var1, @Nullable String var2) {
if(var2!=null && !var2.equals(strings.GENERIC_EMPTY_STR) && var2.length()>2 && !var2.equals("about:blank") && mIsLoaded){ if(var2!=null && !var2.equals(strings.GENERIC_EMPTY_STR) && var2.length()>2 && !var2.equals("about:blank") && mIsLoaded){
mCurrentTitle = var2; mCurrentTitle = var2;
m_current_url_id = (int)event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id), enums.etype.on_update_history); m_current_url_id = (int)event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), 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, mTheme), enums.etype.ON_UPDATE_TAB_TITLE);
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle), enums.etype.ON_UPDATE_TAB_TITLE); }
}
@UiThread
public void onCloseRequest(@NonNull GeckoSession var1) {
if(!canGoBack()){
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle), enums.etype.back_list_empty);
} }
} }
@ -347,6 +424,8 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
event.invokeObserver(Arrays.asList(var2,mSessionID), enums.etype.on_full_screen); event.invokeObserver(Arrays.asList(var2,mSessionID), enums.etype.on_full_screen);
} }
@UiThread
@Override
public void onContextMenu(@NonNull GeckoSession var1, int var2, int var3, @NonNull GeckoSession.ContentDelegate.ContextElement var4) { public void onContextMenu(@NonNull GeckoSession var1, int var2, int var3, @NonNull GeckoSession.ContentDelegate.ContextElement var4) {
String title = strings.GENERIC_EMPTY_STR; String title = strings.GENERIC_EMPTY_STR;
@ -355,14 +434,14 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
} }
if(var4.type!=0){ if(var4.type!=0){
if(var4.linkUri!=null){ if(var4.linkUri!=null){
event.invokeObserver(Arrays.asList(var4.linkUri,mSessionID,var4.srcUri,title), enums.eMessageEnums.M_LONG_PRESS_WITH_LINK); event.invokeObserver(Arrays.asList(var4.linkUri,mSessionID,var4.srcUri,title, mTheme), enums.eMessageEnums.M_LONG_PRESS_WITH_LINK);
} }
else { else {
event.invokeObserver(Arrays.asList(var4.srcUri,mSessionID,title), enums.etype.on_long_press); event.invokeObserver(Arrays.asList(var4.srcUri,mSessionID,title, mTheme), enums.etype.on_long_press);
} }
} }
else{ else{
event.invokeObserver(Arrays.asList(var4.linkUri,mSessionID,title), enums.eMessageEnums.M_LONG_PRESS_URL); event.invokeObserver(Arrays.asList(var4.linkUri,mSessionID,title, mTheme), enums.eMessageEnums.M_LONG_PRESS_URL);
} }
} }
@ -372,7 +451,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
public void onContentPermissionRequest(final GeckoSession session, final String uri, public void onContentPermissionRequest(final GeckoSession session, final String uri,
final int type, final Callback callback) { final int type, final Callback callback) {
if (PERMISSION_AUTOPLAY_AUDIBLE == type || PERMISSION_AUTOPLAY_INAUDIBLE == type) { if (PERMISSION_AUTOPLAY_AUDIBLE == type || PERMISSION_AUTOPLAY_INAUDIBLE == type) {
if (!status.sAutoPlay) { if (!status.sToolbarTheme) {
callback.reject(); callback.reject();
} else { } else {
callback.grant(); callback.grant();
@ -546,6 +625,13 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
mCurrentURL = pURL; mCurrentURL = pURL;
} }
public void setTheme(String pTheme){
mTheme = pTheme;
}
public String getTheme(){
return mTheme;
}
boolean canGoBack(){ boolean canGoBack(){
return mCanGoBack; return mCanGoBack;
} }
@ -590,7 +676,6 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
} }
void goBackSession(){ void goBackSession(){
if(mHistoryList!=null){ if(mHistoryList!=null){
int index = mHistoryList.getCurrentIndex()-1; int index = mHistoryList.getCurrentIndex()-1;
@ -635,7 +720,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
private void checkApplicationRate(){ private void checkApplicationRate(){
if(rateCount==7){ if(rateCount==7){
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle), enums.eMessageEnums.M_RATE_APPLICATION); event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.eMessageEnums.M_RATE_APPLICATION);
} }
rateCount+=1; rateCount+=1;
} }

View File

@ -0,0 +1,195 @@
package com.darkweb.genesissearchengine.appManager.homeManager;
import android.annotation.SuppressLint;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.historyManager.historyRowModel;
import com.darkweb.genesissearchengine.appManager.tabManager.tabEnums;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.example.myapplication.R;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class hintAdapter extends RecyclerView.Adapter<hintAdapter.listViewHolder>
{
/*Private Variables*/
private ArrayList<historyRowModel> mHintList;
private AppCompatActivity mContext;
private eventObserver.eventListener mEvent;
ImageView[] mWebIcon = new ImageView[15];
boolean mCounters=false;
hintAdapter(ArrayList<historyRowModel> pHintList, eventObserver.eventListener pEvent, AppCompatActivity pContext) {
this.mHintList = new ArrayList();
int maxCounter=5;
if(pHintList.size()<maxCounter){
maxCounter = pHintList.size();
}
this.mHintList.addAll(pHintList.subList(0,maxCounter));
this.mContext = pContext;
this.mEvent = pEvent;
}
public void onUpdateAdapter(ArrayList<historyRowModel> pHintList){
mHintList.clear();
mHintList.addAll(pHintList);
notifyDataSetChanged();
}
/*Initializations*/
@NonNull @Override
public listViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.hint_view, parent, false);
return new listViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull hintAdapter.listViewHolder holder, int position)
{
holder.bindListView(mHintList.get(position));
}
@Override
public int getItemCount() {
return mHintList.size();
}
/*Listeners*/
/*View Holder Extensions*/
class listViewHolder extends RecyclerView.ViewHolder implements View.OnTouchListener
{
TextView mHeader;
TextView mHeaderSingle;
TextView mURL;
ImageButton mMoveURL;
ImageView mHindTypeIcon;
ImageView mHintWebIcon = null;
LinearLayout mpHintListener;
ImageView mHindTypeIconTemp;
listViewHolder(View itemView) {
super(itemView);
}
@SuppressLint("ClickableViewAccessibility")
void bindListView(historyRowModel model) {
mHeader = itemView.findViewById(R.id.pHeader);
mHeaderSingle = itemView.findViewById(R.id.pHeaderSingle);
mURL = itemView.findViewById(R.id.pURL);
mHindTypeIcon = itemView.findViewById(R.id.pHindTypeIcon);
mpHintListener = itemView.findViewById(R.id.pHintListener);
mMoveURL = itemView.findViewById(R.id.pMoveURL);
mHintWebIcon = itemView.findViewById(R.id.pHintWebIcon);
mHindTypeIconTemp = new ImageView(mContext);
if(mWebIcon[getLayoutPosition()]!=null){
mHintWebIcon = itemView.findViewById(R.id.pHintWebIcon);
mHintWebIcon.setImageDrawable(mWebIcon[getLayoutPosition()].getDrawable());
mHindTypeIconTemp.setImageDrawable(mWebIcon[getLayoutPosition()].getDrawable());
}
mWebIcon[getLayoutPosition()] = mHintWebIcon;
if(model.getDescription().equals(strings.GENERIC_EMPTY_STR)){
mHeaderSingle.setText(model.getHeader());
mHeaderSingle.setVisibility(View.VISIBLE);
mHeader.setVisibility(View.GONE);
mURL.setVisibility(View.GONE);
mHintWebIcon.setVisibility(View.GONE);
mHindTypeIcon.setVisibility(View.VISIBLE);
}else {
mHeaderSingle.setVisibility(View.GONE);
mHeader.setVisibility(View.VISIBLE);
mURL.setVisibility(View.VISIBLE);
mHintWebIcon.setVisibility(View.VISIBLE);
mHindTypeIcon.setVisibility(View.GONE);
}
mHeader.setText(model.getHeader());
mMoveURL.setTag(model.getDescription());
mURL.setText(model.getDescription());
Drawable mDrawable = null;
Resources res = itemView.getContext().getResources();
try {
if(model.getDescription().equals(strings.GENERIC_EMPTY_STR)){
mDrawable = Drawable.createFromXml(res, res.getXml(R.xml.ic_baseline_search));
mMoveURL.setVisibility(View.GONE);
}else {
mDrawable = Drawable.createFromXml(res, res.getXml(R.xml.ic_baseline_browser));
mMoveURL.setVisibility(View.VISIBLE);
mMoveURL.setOnTouchListener(listViewHolder.this);
}
} catch (Exception ignored) {
}
if(model.getDescription().equals(strings.GENERIC_EMPTY_STR)){
mHindTypeIcon.setImageDrawable(mDrawable);
}
mpHintListener.setOnTouchListener(listViewHolder.this);
new Thread(){
public void run(){
try {
mHindTypeIconTemp.setImageDrawable(null);
mEvent.invokeObserver(Arrays.asList(mHindTypeIconTemp, "https://" + model.getDescription()), enums.etype.fetch_favicon);
while (true){
int mCounter=0;
if(mHindTypeIconTemp.isAttachedToWindow() || mHindTypeIconTemp.getDrawable()==null){
sleep(50);
mCounter+=1;
}else {
Log.i("BREAK","");
break;
}
if(mCounter>6){
break;
}
}
mContext.runOnUiThread(() -> mHintWebIcon.setImageDrawable(mHindTypeIconTemp.getDrawable()));
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}.start();
}
@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouch(View v, MotionEvent event) {
if(v.getId() == mpHintListener.getId() || v.getId() == mMoveURL.getId()){
if(event.getAction() == MotionEvent.ACTION_MOVE){
helperMethod.hideKeyboard(mContext);
}
}
return false;
}
}
public Object onTrigger(tabEnums.eTabAdapterCommands pCommands, List<Object> pData){
return null;
}
}

View File

@ -0,0 +1,27 @@
package com.darkweb.genesissearchengine.appManager.homeManager;
import com.darkweb.genesissearchengine.appManager.tabManager.tabRowModel;
import java.util.ArrayList;
public class hintModel
{
/*Private Variables*/
private String mHeader;
private String mURL;
public hintModel(String pHeader, String pURL){
mHeader = pHeader;
mURL = pURL;
}
public String getHeader(){
return mHeader;
}
public String getURL(){
return mURL;
}
}

View File

@ -11,6 +11,7 @@ import android.content.IntentFilter;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.content.res.Resources; import android.content.res.Resources;
import android.database.Cursor; import android.database.Cursor;
import android.graphics.Color;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@ -18,9 +19,11 @@ import android.os.Handler;
import android.speech.RecognizerIntent; import android.speech.RecognizerIntent;
import android.text.Editable; import android.text.Editable;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.util.Log;
import android.view.GestureDetector; import android.view.GestureDetector;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
import android.webkit.URLUtil; import android.webkit.URLUtil;
@ -29,8 +32,9 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.app.AppCompatDelegate;
import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.view.MotionEventCompat; import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.activityContextManager; import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkController; import com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkController;
import com.darkweb.genesissearchengine.appManager.databaseManager.databaseController; import com.darkweb.genesissearchengine.appManager.databaseManager.databaseController;
@ -91,7 +95,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
/*View Objects*/ /*View Objects*/
private AnimatedProgressBar mProgressBar; private AnimatedProgressBar mProgressBar;
private ConstraintLayout mSplashScreen; private ConstraintLayout mSplashScreen;
private AutoCompleteTextView mSearchbar; private editTextManager mSearchbar;
private ImageView mLoadingIcon; private ImageView mLoadingIcon;
private ImageView mBlocker; private ImageView mBlocker;
private TextView mLoadingText; private TextView mLoadingText;
@ -110,11 +114,18 @@ public class homeController extends AppCompatActivity implements ComponentCallba
private FrameLayout mNestedScroll; private FrameLayout mNestedScroll;
private ImageView mBlockerFullSceen; private ImageView mBlockerFullSceen;
private TextView mCopyright; private TextView mCopyright;
private RecyclerView mHintListView;
private ImageView mSearchLock;
private ImageButton mOrbotLogManager;
private com.google.android.material.appbar.AppBarLayout mAppBar;
/*Redirection Objects*/ /*Redirection Objects*/
private boolean mPageClosed = false; private boolean mPageClosed = false;
private boolean isKeyboardOpened = false; private boolean isKeyboardOpened = false;
private boolean isSuggestionChanged = false; private boolean isSuggestionChanged = false;
private boolean isSuggestionSearchOpened = false;
private boolean isFocusChanging = false;
private boolean mAppRestarted = false;
private String mSearchBarPreviousText = strings.GENERIC_EMPTY_STR; private String mSearchBarPreviousText = strings.GENERIC_EMPTY_STR;
/*-------------------------------------------------------INITIALIZATION-------------------------------------------------------*/ /*-------------------------------------------------------INITIALIZATION-------------------------------------------------------*/
@ -122,6 +133,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
@Override @Override
protected void onCreate(Bundle savedInstanceState) protected void onCreate(Bundle savedInstanceState)
{ {
mAppRestarted = false;
orbotLocalConstants.mIsTorInitialized = false;
orbotLocalConstants.mHomeIntent = getIntent();
getWindow().getDecorView().setBackgroundColor(Color.WHITE);
pluginController.getInstance().preInitialize(this); pluginController.getInstance().preInitialize(this);
databaseController.getInstance().initialize(this); databaseController.getInstance().initialize(this);
dataController.getInstance().initialize(this); dataController.getInstance().initialize(this);
@ -142,12 +158,54 @@ public class homeController extends AppCompatActivity implements ComponentCallba
initializeLocalEventHandlers(); initializeLocalEventHandlers();
initLandingPage(); initLandingPage();
initLocalLanguage(); initLocalLanguage();
onInitResume(savedInstanceState != null); onInitResume(false);
} }
public void onInitResume(boolean pStatus){ public void onInitResume(boolean pStatus){
if(pStatus){ if(status.mThemeApplying){
mSplashScreen.animate().alpha(0); isFocusChanging = true;
mSplashScreen.setAlpha(0);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
mHomeViewController.initStatusBarColor(false);
}else {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(ContextCompat.getColor(this, R.color.c_text_v3));
}
mSplashScreen.setAlpha(0f);
onLoadTabOnResume();
mSearchLock.setColorFilter(ContextCompat.getColor(this, R.color.c_lock_tint));
}
initSuggestionView(new ArrayList<>());
}
public void onLoadTabOnResume(){
Object mTempModel = dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
if(mTempModel!=null){
tabRowModel model = (tabRowModel)mTempModel;
if(!status.mThemeApplying){
mHomeViewController.onUpdateSearchBar(model.getSession().getCurrentURL(), false, false);
}
onLoadTab(model.getSession(),false);
onLoadURL(model.getSession().getCurrentURL());
}else {
onNewIntent(getIntent());
}
initTabCount();
if(!status.mThemeApplying){
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(), false, false);
}
status.mThemeApplying = false;
}
public void onInitDefaultTab(){
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
if(model!=null){
if(!mGeckoClient.getSession().getSessionID().equals(model.getSession().getSessionID())){
onLoadTab(model.getSession(),true);
}
}else {
onNewTab(false, false);
} }
} }
@ -174,6 +232,34 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
} }
@SuppressLint("ClickableViewAccessibility")
private void initSuggestionView(ArrayList<historyRowModel> pList){
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
hintAdapter mAdapter = new hintAdapter(pList,new hintViewCallback(), this);
layoutManager.setReverseLayout(true);
mHintListView.setAdapter(mAdapter);
mHintListView.setNestedScrollingEnabled(false);
mHintListView.setHasFixedSize(true);
mHintListView.setItemViewCacheSize(10);
mHintListView.setDrawingCacheEnabled(true);
mHintListView.setDrawingCacheEnabled(true);
mHintListView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
mHintListView.setLayoutManager(new LinearLayoutManager(this));
Objects.requireNonNull(mHintListView.getItemAnimator()).setChangeDuration(0);
findViewById(R.id.pSuggestionScroll).setOnTouchListener((v, event) -> {
if (MotionEvent.ACTION_DOWN == event.getAction()) {
helperMethod.hideKeyboard(this);
}
return false;
});
}
public void onUpdateSuggestionList(ArrayList<historyRowModel> pList){
((hintAdapter) Objects.requireNonNull(mHintListView.getAdapter())).onUpdateAdapter(pList);
}
private void initLocalLanguage() { private void initLocalLanguage() {
String lang = Resources.getSystem().getConfiguration().locale.getLanguage(); String lang = Resources.getSystem().getConfiguration().locale.getLanguage();
@ -195,24 +281,19 @@ public class homeController extends AppCompatActivity implements ComponentCallba
super.onNewIntent(intent); super.onNewIntent(intent);
Uri data = intent.getData(); Uri data = intent.getData();
if(data!=null){ if(data!=null){
status.sSettingIsAppRedirected = true;
status.sSettingRedirectStatus = data.toString(); status.sSettingRedirectStatus = data.toString();
if(status.sSettingIsAppStarted){ if(status.sSettingIsAppStarted){
onLoadURL(status.sSettingRedirectStatus); mSplashScreen.setAlpha(0);
mSplashScreen.setVisibility(View.GONE);
} }
onStartApplication(null);
} }
} }
public void initLandingPage(){ public void initLandingPage(){
if(status.sSettingFirstStart){ if(status.sSettingFirstStart){
helperMethod.openActivity(landingController.class, constants.CONST_LIST_HISTORY, homeController.this,false); helperMethod.openActivity(landingController.class, constants.CONST_LIST_HISTORY, homeController.this,false);
status.sSettingFirstStart = false;
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_FIRST_INSTALLED,false));
}
if(status.sSettingIsAppStarted){
mHomeViewController.onPageFinished();
mSplashScreen.animate().alpha(0);
mHomeViewController.onProgressBarUpdate(100);
} }
} }
@ -239,7 +320,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mBackSplash = findViewById(R.id.pTopImage); mBackSplash = findViewById(R.id.pTopImage);
mConnectButton = findViewById(R.id.Connect); mConnectButton = findViewById(R.id.Connect);
mNewTab = findViewById(R.id.pTabCounter); mNewTab = findViewById(R.id.pTabCounter);
mFindBar = findViewById(R.id.pFindBar);
mSearchEngineBar = findViewById(R.id.pSearchEngineBar); mSearchEngineBar = findViewById(R.id.pSearchEngineBar);
mFindText = findViewById(R.id.pFindText); mFindText = findViewById(R.id.pFindText);
mFindCount = findViewById(R.id.pFindCount); mFindCount = findViewById(R.id.pFindCount);
@ -249,31 +329,29 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mNestedScroll = findViewById(R.id.pNestedScroll); mNestedScroll = findViewById(R.id.pNestedScroll);
mBlockerFullSceen = findViewById(R.id.pBlockerFullSceen); mBlockerFullSceen = findViewById(R.id.pBlockerFullSceen);
mCopyright = findViewById(R.id.pCopyright); mCopyright = findViewById(R.id.pCopyright);
mHintListView = mSearchEngineBar.findViewById(R.id.pHistListView);
mAppBar = findViewById(R.id.pAppbar);
mSearchLock = findViewById(R.id.pSearchLock);
mOrbotLogManager = findViewById(R.id.pOrbotLogManager);
mFindBar = findViewById(R.id.pFindBar);
mGeckoView.setSaveEnabled(false); mGeckoView.setSaveEnabled(false);
mGeckoView.setSaveFromParentEnabled(false); mGeckoView.setSaveFromParentEnabled(false);
mGeckoView.setAutofillEnabled(true);
mGeckoClient = new geckoClients(); 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, mFindBar, mFindText, mFindCount, mTopLayout, mVoiceInput, mMenu, mNestedScroll, mBlocker, mBlockerFullSceen, mSearchEngineBar, mCopyright); 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, mTopLayout, mVoiceInput, mMenu, mNestedScroll, mBlocker, mBlockerFullSceen, mSearchEngineBar, mCopyright, mHintListView, mAppBar, mOrbotLogManager);
mGeckoView.onSetHomeEvent(new nestedGeckoViewCallback()); mGeckoView.onSetHomeEvent(new nestedGeckoViewCallback());
mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,false); mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,false);
mGeckoClient.onValidateInitializeFromStartup(); mGeckoClient.onValidateInitializeFromStartup();
dataController.getInstance().initializeListData(); dataController.getInstance().initializeListData();
if(status.sSettingIsAppStarted){
Object mTempModel = dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
if(mTempModel!=null){
tabRowModel model = (tabRowModel)mTempModel;
onLoadTab(model.getSession(),false);
onLoadURL(mGeckoClient.getSession().getCurrentURL());
mGeckoClient.initSession(model.getSession());
}else {
onNewIntent(getIntent());
}
}
} }
public void onUpdateToolbarTheme(){
mHomeViewController.onUpdateToolbarTheme();
}
public void onChangeTheme(){ public void onChangeTheme(){
if(!status.sSettingIsAppStarted){ if(!status.sSettingIsAppStarted){
status.sDefaultNightMode = (getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES; status.sDefaultNightMode = (getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
@ -318,12 +396,19 @@ public class homeController extends AppCompatActivity implements ComponentCallba
protected void attachBaseContext(Context base) { protected void attachBaseContext(Context base) {
Prefs.setContext(base); Prefs.setContext(base);
orbotLocalConstants.mHomeContext = new WeakReference<>(base); orbotLocalConstants.mHomeContext = new WeakReference<>(base);
super.attachBaseContext(LocaleHelper.onAttach(base, Prefs.getDefaultLocale())); super.attachBaseContext(LocaleHelper.onAttach(base, Prefs.getDefaultLocale()));
} }
/*-------------------------------------------------------Helper Methods-------------------------------------------------------*/ /*-------------------------------------------------------Helper Methods-------------------------------------------------------*/
public void onGetFavIcon(ImageView pImageView, String pURL){
mGeckoClient.onGetFavIcon(pImageView, pURL);
}
public void onLoadFavIcon(){
mGeckoClient.onLoadFavIcon();
}
public void onLoadFont(){ public void onLoadFont(){
mGeckoClient.onUpdateFont(); mGeckoClient.onUpdateFont();
mHomeViewController.onReDraw(); mHomeViewController.onReDraw();
@ -345,6 +430,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
public void onLoadURL(String url){ public void onLoadURL(String url){
mHomeViewController.onClearSelections(true); mHomeViewController.onClearSelections(true);
mGeckoClient.loadURL(url.replace("genesis.onion","boogle.store")); mGeckoClient.loadURL(url.replace("genesis.onion","boogle.store"));
mAppBar.setExpanded(true,true);
} }
public void onLoadTab(geckoSession mTempSession,boolean isSessionClosed){ public void onLoadTab(geckoSession mTempSession,boolean isSessionClosed){
@ -366,7 +452,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if(mGeckoClient.getSession().onGetInitializeFromStartup()){ if(mGeckoClient.getSession().onGetInitializeFromStartup()){
mGeckoClient.onRedrawPixel(); mGeckoClient.onRedrawPixel();
} }
mGeckoClient.onValidateInitializeFromStartup(); mGeckoClient.onValidateInitializeFromStartup();
mGeckoClient.onRedrawPixel();
mGeckoClient.onSessionReinit();
mHomeViewController.onUpdateStatusBarTheme(mTempSession.getTheme(), false);
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(), false, false);
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(),true);
mAppBar.setExpanded(true,true);
} }
/*-------------------------------------------------------USER EVENTS-------------------------------------------------------*/ /*-------------------------------------------------------USER EVENTS-------------------------------------------------------*/
@ -417,7 +510,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mGeckoClient.getSession().getFinder().clear(); mGeckoClient.getSession().getFinder().clear();
mHomeViewController.onUpdateFindBarCount(0,0); mHomeViewController.onUpdateFindBarCount(0,0);
}else { }else {
mGeckoClient.getSession().findInPage(mFindText.getText().toString(), GeckoSession.FINDER_FIND_MATCH_CASE & GeckoSession.FINDER_DISPLAY_HIGHLIGHT_ALL); assert mGeckoClient != null;
mGeckoClient.getSession().findInPage(mFindText.getText().toString(), GeckoSession.FINDER_FIND_MATCH_CASE & GeckoSession.FINDER_DISPLAY_HIGHLIGHT_ALL);
} }
} }
}); });
@ -449,20 +543,55 @@ public class homeController extends AppCompatActivity implements ComponentCallba
return false; return false;
}); });
mGeckoView.setOnTouchListener((v, event) -> {
helperMethod.hideKeyboard(homeController.this);
return false;
});
mGeckoView.setOnFocusChangeListener((v, hasFocus) -> { mGeckoView.setOnFocusChangeListener((v, hasFocus) -> {
if(hasFocus) if(hasFocus)
{ {
helperMethod.hideKeyboard(homeController.this);
status.sSettingIsAppStarted = true;
pluginController.getInstance().onResetMessage(); pluginController.getInstance().onResetMessage();
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,true); mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,true);
final Handler handler = new Handler();
handler.postDelayed(() ->
{
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
}, 300);
}else {
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
} }
}); });
mSearchbar.addTextChangedListener(new TextWatcher() { mSearchbar.addTextChangedListener(new TextWatcher() {
@Override @Override
public void afterTextChanged(Editable s) {} public void afterTextChanged(Editable s) {
if(status.sSearchSuggestionStatus && isSuggestionChanged){
mSuggestions = (ArrayList<historyRowModel>)dataController.getInstance().invokeSuggestion(dataEnums.eSuggestionCommands.M_GET_SUGGESTION, Collections.singletonList(mSearchbar.getText().toString()));
if(mSuggestions.size()>0){
if(mHintListView.getAdapter()==null){
initSuggestionView(mSuggestions);
mSearchEngineBar.setVisibility(View.VISIBLE);
mSearchEngineBar.setAlpha(1);
}else {
mSearchEngineBar.setVisibility(View.VISIBLE);
mSearchEngineBar.setAlpha(1);
mEdittextChanged.removeCallbacks(postToServerRunnable);
mEdittextChanged.postDelayed(postToServerRunnable, 50);
}
if(!isSuggestionSearchOpened && mSearchbar.isFocused()){
if(Objects.requireNonNull(mHintListView.getAdapter()).getItemCount()>0){
mHomeViewController.onUpdateSearchEngineBar(true, 0);
}
}
}
}
}
@Override @Override
public void beforeTextChanged(CharSequence s, int start,int count, int after) { public void beforeTextChanged(CharSequence s, int start,int count, int after) {
@ -473,24 +602,33 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
}); });
mSearchbar.setEventHandler(new edittextManagerCallback());
mSearchbar.setOnFocusChangeListener((v, hasFocus) -> { mSearchbar.setOnFocusChangeListener((v, hasFocus) -> {
if(!hasFocus) if(!hasFocus)
{ {
mHomeViewController.onUpdateSearchEngineBar(false); if(!isSuggestionSearchOpened){
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); if(isSuggestionChanged){
mHomeViewController.initSearchBarFocus(false); isSuggestionChanged = false;
if(!mGeckoClient.isLoading()){ if(mHintListView!=null && mHintListView.getAdapter()!=null && mHintListView.getAdapter().getItemCount()>0){
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,true); mHomeViewController.onUpdateSearchEngineBar(false, 150);
} }
if(isSuggestionChanged){ mHomeViewController.initSearchBarFocus(false);
isSuggestionChanged = false; if(!mGeckoClient.isLoading()){
mHomeViewController.initializeSuggestionView((ArrayList<historyRowModel>)dataController.getInstance().invokeSuggestion(dataEnums.eSuggestionCommands.M_GET_SUGGESTION, null)); mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,true);
}
helperMethod.hideKeyboard(homeController.this);
}
} }
}else { }else {
mHomeViewController.onUpdateSearchEngineBar(true); if(!isFocusChanging){
mHomeViewController.initSearchBarFocus(true); if(!status.mThemeApplying){
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING); mHomeViewController.initSearchBarFocus(true);
mSearchbar.setText(strings.GENERIC_EMPTY_STR); }
isSuggestionChanged = true;
isSuggestionSearchOpened = false;
}
mHomeViewController.onNewTab(false,false);
} }
}); });
@ -498,11 +636,13 @@ public class homeController extends AppCompatActivity implements ComponentCallba
@Override @Override
public boolean onSwipe(Direction direction) { public boolean onSwipe(Direction direction) {
if (direction==Direction.left){ if(mSplashScreen.getAlpha()>=1 && mSplashScreen.getVisibility()==View.VISIBLE){
helperMethod.openActivity(orbotLogController.class, constants.CONST_LIST_HISTORY, homeController.this, true); if (direction==Direction.left){
} helperMethod.openActivity(orbotLogController.class, constants.CONST_LIST_HISTORY, homeController.this, true);
else if (direction==Direction.right){ }
helperMethod.openActivity(orbotController.class, constants.CONST_LIST_HISTORY, homeController.this, true); else if (direction==Direction.right){
helperMethod.openActivity(orbotController.class, constants.CONST_LIST_HISTORY, homeController.this, true);
}
} }
return true; return true;
} }
@ -512,6 +652,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba
KeyboardUtils.addKeyboardToggleListener(this, isVisible -> isKeyboardOpened = isVisible); KeyboardUtils.addKeyboardToggleListener(this, isVisible -> isKeyboardOpened = isVisible);
} }
private ArrayList<historyRowModel> mSuggestions;
private Handler mEdittextChanged = new Handler();
private Runnable postToServerRunnable = () -> {
onUpdateSuggestionList(mSuggestions);
};
void onSearchBarInvoked(View view){ void onSearchBarInvoked(View view){
String url = ((EditText)view).getText().toString(); String url = ((EditText)view).getText().toString();
String validated_url = mHomeModel.urlComplete(url, mHomeModel.getSearchEngine()); String validated_url = mHomeModel.urlComplete(url, mHomeModel.getSearchEngine());
@ -519,28 +665,34 @@ public class homeController extends AppCompatActivity implements ComponentCallba
url = validated_url; url = validated_url;
} }
mHomeViewController.onUpdateSearchBar(url,false,true); mHomeViewController.onUpdateSearchBar(url,false,true);
Log.i("FUCLSSS","FUCLSSS2");
onLoadURL(url); onLoadURL(url);
} }
public void onSuggestionInvoked(View view){ public void onSuggestionInvoked(View view){
//String val = ((TextView)view.findViewById(R.id.hintCompletionUrl)).getText().toString(); String val = ((TextView)view.findViewById(R.id.pURL)).getText().toString();
//onLoadURL(val); if(val.equals(strings.GENERIC_EMPTY_STR)){
//mSearchbar.setSelection(0); val = ((TextView)view.findViewById(R.id.pHeaderSingle)).getText().toString();
//mHomeViewController.onUpdateSearchBar(val,false,true); }
Log.i("FUCLSSS","FUCLSSS3");
onLoadURL(val);
mHomeViewController.onUpdateSearchBar(val,false,true);
} }
public void onSuggestionMove(View view){ public void onSuggestionMove(View view){
String val = ((ImageButton)view).getTag().toString(); String val = view.getTag().toString();
mHomeViewController.onUpdateSearchBar(val,false,false); mHomeViewController.onUpdateSearchBar(val,false,false);
} }
public void applyTheme(){ public void applyTheme(){
status.mCurrentReloadURL = mSearchbar.getText().toString(); status.mCurrentReloadURL = mSearchbar.getText().toString();
onResume();
recreate(); recreate();
} }
public void onHomeButton(View view){ public void onHomeButton(View view){
pluginController.getInstance().logEvent(strings.EVENT_HOME_INVOKED); pluginController.getInstance().logEvent(strings.EVENT_HOME_INVOKED);
Log.i("FUCLSSS","FUCLSSS4");
onLoadURL(helperMethod.getDomainName(mHomeModel.getSearchEngine())); onLoadURL(helperMethod.getDomainName(mHomeModel.getSearchEngine()));
mHomeViewController.onUpdateLogo(); mHomeViewController.onUpdateLogo();
} }
@ -553,23 +705,29 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mGeckoClient.onRedrawPixel(); mGeckoClient.onRedrawPixel();
initializeGeckoView(true, true); initializeGeckoView(true, true);
if(status.sOpenURLInNewTab){ if(status.sOpenURLInNewTab){
Log.i("FUCLSSS","FUCLSSS5");
onLoadURL(helperMethod.getDomainName(status.sSettingSearchStatus)); onLoadURL(helperMethod.getDomainName(status.sSettingSearchStatus));
mHomeViewController. onUpdateSearchBar(helperMethod.getDomainName(status.sSettingSearchStatus),false,true); mHomeViewController. onUpdateSearchBar(helperMethod.getDomainName(status.sSettingSearchStatus),false,true);
}else { }else {
Log.i("FUCLSSS","FUCLSSS6");
onLoadURL("about:blank"); onLoadURL("about:blank");
mHomeViewController. onUpdateSearchBar(strings.HOME_BLANK_PAGE,false,true); mHomeViewController. onUpdateSearchBar(strings.HOME_BLANK_PAGE,false,true);
} }
mHomeViewController.progressBarReset(); mHomeViewController.progressBarReset();
mHomeViewController.onNewTab(isKeyboardOpened,isKeyboardOpenedTemp); mHomeViewController.onNewTab(isKeyboardOpened,isKeyboardOpenedTemp);
mHomeViewController.onSessionChanged(); mHomeViewController.onSessionChanged();
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), false);
} }
public void onOpenTabViewBoundary(View view){ public void onOpenTabViewBoundary(View view){
mGeckoClient.onRedrawPixel();
mNewTab.setPressed(true); mNewTab.setPressed(true);
mGeckoClient.onRedrawPixel();
helperMethod.openActivity(tabController.class, constants.CONST_LIST_HISTORY, homeController.this,true); helperMethod.openActivity(tabController.class, constants.CONST_LIST_HISTORY, homeController.this,true);
overridePendingTransition(R.anim.popup_anim_in, R.anim.popup_anim_out); overridePendingTransition(R.anim.popup_anim_in, R.anim.popup_anim_out);
mGeckoClient.onRedrawPixel();
}
public void onLockSecure(View view){
pluginController.getInstance().MessageManagerHandler(homeController.this, Arrays.asList(mGeckoClient.getSession().getCurrentURL(), status.sSettingJavaStatus, status.sStatusDoNotTrack, status.sSettingTrackingProtection, status.sSettingCookieStatus), enums.eMessageEnums.M_SECURE_CONNECTION);
} }
public void onNotificationInvoked(String message,enums.etype e_type){ public void onNotificationInvoked(String message,enums.etype e_type){
@ -577,14 +735,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
public void onOpenMenuItem(View view){ public void onOpenMenuItem(View view){
pluginController.getInstance().setLanguage();
pluginController.getInstance().logEvent(strings.EVENT_MENU_INVOKED); pluginController.getInstance().logEvent(strings.EVENT_MENU_INVOKED);
status.sSettingIsAppStarted = true;
pluginController.getInstance().onResetMessage(); pluginController.getInstance().onResetMessage();
initLocalLanguage(); initLocalLanguage();
pluginController.getInstance().onCreate(this); pluginController.getInstance().onCreate(this);
helperMethod.hideKeyboard(this);
mHomeViewController.onOpenMenu(view,mGeckoClient.canGoBack(),!(mProgressBar.getAlpha()<=0 || mProgressBar.getVisibility() ==View.INVISIBLE),mGeckoClient.getUserAgent()); mHomeViewController.onOpenMenu(view,mGeckoClient.canGoBack(),!(mProgressBar.getAlpha()<=0 || mProgressBar.getVisibility() ==View.INVISIBLE),mGeckoClient.getUserAgent());
} }
@ -594,20 +750,24 @@ public class homeController extends AppCompatActivity implements ComponentCallba
@Override @Override
public void onBackPressed(){ public void onBackPressed(){
pluginController.getInstance().logEvent(strings.EVENT_ON_BACK); pluginController.getInstance().logEvent(strings.EVENT_ON_BACK);
mSearchbar.clearFocus(); mSearchbar.clearFocus();
if(mFindBar.getVisibility() == View.VISIBLE){ if(mFindBar!=null && mFindBar.getVisibility() == View.VISIBLE){
mHomeViewController.onUpdateFindBar(false); mHomeViewController.onUpdateFindBar(false);
} }
else if(mSearchEngineBar.getVisibility() == View.VISIBLE){ else if(mSearchEngineBar.getVisibility() == View.VISIBLE){
mHomeViewController.onUpdateSearchEngineBar(false); mHomeViewController.onUpdateSearchEngineBar(false, 150);
} }
else if(mGeckoClient.getFullScreenStatus()){ else if(!mGeckoClient.getFullScreenStatus()){
mGeckoClient.onExitFullScreen();
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), true);
}
else if((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null)>0){
mGeckoClient.onBackPressed(true); mGeckoClient.onBackPressed(true);
mHomeViewController.onClearSelections(true);
} }
else { else {
mGeckoClient.onExitFullScreen(); mGeckoClient.onBackPressed(true);
} }
} }
@ -638,9 +798,16 @@ public class homeController extends AppCompatActivity implements ComponentCallba
public void onConfigurationChanged(@NonNull Configuration newConfig) { public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig); super.onConfigurationChanged(newConfig);
pluginController.getInstance().onResetMessage(); pluginController.getInstance().onResetMessage();
mHomeViewController.closeMenu(); mHomeViewController.closeMenu();
final Handler handler = new Handler();
handler.postDelayed(() ->
{
mGeckoClient.onRedrawPixel();
}, 300);
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) { if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
mHomeViewController.setOrientation(true); mHomeViewController.setOrientation(true);
if(mGeckoClient.getFullScreenStatus()) if(mGeckoClient.getFullScreenStatus())
@ -665,7 +832,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
mGeckoClient.onExitFullScreen(); mGeckoClient.onExitFullScreen();
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), true);
pluginController.getInstance().onResetMessage(); pluginController.getInstance().onResetMessage();
pluginController.getInstance().onScheduleUserEngagementNotification(1296000000 /* Every 15 Days */ );
} }
@Override @Override
@ -676,22 +845,40 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if (mGeckoClient.getSession()!=null && mGeckoClient!=null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && mGeckoClient.getUriPermission()!=null) { if (mGeckoClient.getSession()!=null && mGeckoClient!=null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && mGeckoClient.getUriPermission()!=null) {
this.revokeUriPermission(mGeckoClient.getUriPermission(), Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION); this.revokeUriPermission(mGeckoClient.getUriPermission(), Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);
} }
if(status.sSettingIsAppStarted){ if(isSuggestionSearchOpened){
onStartApplication(null); isSuggestionChanged = true;
isFocusChanging = false;
isSuggestionSearchOpened = false;
mSearchbar.requestFocus();
mSearchbar.setText(helperMethod.urlDesigner(mSearchBarPreviousText, this, mSearchbar.getCurrentTextColor()));
mSearchbar.selectAll();
mHomeViewController.initSearchBarFocus(true);
}
if(status.sSettingIsAppStarted && mAppRestarted){
activityContextManager.getInstance().onClearStack();
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null); tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
if(model!=null){ if(model==null || !mGeckoClient.getSession().getSessionID().equals(model.getSession().getSessionID())){
onLoadTab(model.getSession(),true); if(model==null){
onInitDefaultTab();
}else {
onLoadTab(model.getSession(), false);
}
} }
} }
if(!mSearchBarPreviousText.equals(strings.GENERIC_EMPTY_STR)){ if(mAppBar!=null){
mSearchbar.setText(mSearchBarPreviousText); mAppBar.setExpanded(true,true);
mSearchbar.requestFocus();
mSearchBarPreviousText = strings.GENERIC_EMPTY_STR;
} }
mAppRestarted = true;
pluginController.getInstance().onClearUserEngagementNotification();
super.onResume(); super.onResume();
} }
public void OnClearSuggestion(View view){
mSearchbar.clearFocus();
}
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data){ protected void onActivityResult(int requestCode, int resultCode, Intent data){
if(requestCode==100){ if(requestCode==100){
@ -736,12 +923,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
/*-------------------------------------------------------External Callback Methods-------------------------------------------------------*/ /*-------------------------------------------------------External Callback Methods-------------------------------------------------------*/
public void onSuggestionUpdate(){ public String onGetCurrentURL(){
if(!mSearchbar.isFocused()){ return mGeckoClient.getSession().getCurrentURL();
mHomeViewController.initializeSuggestionView((ArrayList<historyRowModel>)dataController.getInstance().invokeSuggestion(dataEnums.eSuggestionCommands.M_GET_SUGGESTION, null));
}else {
isSuggestionChanged = true;
}
} }
public void onStartApplication(View view){ public void onStartApplication(View view){
@ -817,23 +1000,29 @@ public class homeController extends AppCompatActivity implements ComponentCallba
/*-------------------------------------------------------CALLBACKS-------------------------------------------------------*/ /*-------------------------------------------------------CALLBACKS-------------------------------------------------------*/
public void onHideFindBar(View view){ public void onHideFindBar(View view){
mHomeViewController.onUpdateFindBar(false); mHomeViewController.onUpdateFindBar(false);
mGeckoClient.getSession().getFinder().clear(); mGeckoClient.getSession().getFinder().clear();
} }
public void onClearSearchBar(View view){
mHomeViewController.onUpdateSearchBar(strings.GENERIC_EMPTY_STR, false, false);
}
public void onFindNext(View view){ public void onFindNext(View view){
mFindText.setText("0/0"); mFindCount.setText("0/0");
mGeckoClient.getSession().findInPage(mFindText.getText().toString(), GeckoSession.FINDER_FIND_MATCH_CASE & GeckoSession.FINDER_DISPLAY_HIGHLIGHT_ALL); mGeckoClient.getSession().findInPage(mFindText.getText().toString(), GeckoSession.FINDER_FIND_MATCH_CASE & GeckoSession.FINDER_DISPLAY_HIGHLIGHT_ALL);
} }
public void onOpenSearchEngine(View view){ public void onOpenSearchEngine(View view){
mSearchBarPreviousText = mSearchbar.getText().toString(); mSearchBarPreviousText = mSearchbar.getText().toString();
isSuggestionSearchOpened = true;
helperMethod.openActivity(settingSearchController.class,constants.CONST_LIST_HISTORY, homeController.this,true); helperMethod.openActivity(settingSearchController.class,constants.CONST_LIST_HISTORY, homeController.this,true);
} }
public void onFindPrev(View view){ public void onFindPrev(View view){
mFindText.setText("0/0"); mFindCount.setText("0/0");
mGeckoClient.getSession().findInPage(mFindText.getText().toString(), GeckoSession.FINDER_FIND_BACKWARDS & GeckoSession.FINDER_DISPLAY_HIGHLIGHT_ALL); mGeckoClient.getSession().findInPage(mFindText.getText().toString(), GeckoSession.FINDER_FIND_BACKWARDS & GeckoSession.FINDER_DISPLAY_HIGHLIGHT_ALL);
} }
@ -890,17 +1079,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
helperMethod.hideKeyboard(this); helperMethod.hideKeyboard(this);
pluginController.getInstance().MessageManagerHandler(homeController.this,null,enums.eMessageEnums.M_REPORT_URL); pluginController.getInstance().MessageManagerHandler(homeController.this,null,enums.eMessageEnums.M_REPORT_URL);
} }
else if (menuId == R.id.pMenuShare) else if (menuId == R.id.pMenuQuit)
{ {
helperMethod.hideKeyboard(this); finishAndRemoveTask();
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.PROXY_IS_APP_RATED,true));
status.sSettingIsAppRated = true;
pluginController.getInstance().MessageManagerHandler(activityContextManager.getInstance().getHomeController(), Collections.singletonList(strings.GENERIC_EMPTY_STR), enums.eMessageEnums.M_RATE_APP);
}
else if (menuId == R.id.pMenuCopy)
{
helperMethod.hideKeyboard(this);
helperMethod.shareApp(homeController.this);
} }
else if (menuId == R.id.pMenuFind) else if (menuId == R.id.pMenuFind)
{ {
@ -966,13 +1147,44 @@ public class homeController extends AppCompatActivity implements ComponentCallba
{ {
onOpenDownloadFolder(null); onOpenDownloadFolder(null);
} }
if(e_type.equals(enums.etype.on_init_ads)) else if(e_type.equals(enums.etype.ON_UPDATE_THEME)){
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(),false);
}
else if(e_type.equals(enums.etype.on_init_ads))
{ {
mHomeViewController.onSetBannerAdMargin((boolean)data.get(0),pluginController.getInstance().isAdvertLoaded()); mHomeViewController.onSetBannerAdMargin((boolean)data.get(0),pluginController.getInstance().isAdvertLoaded());
} }
else if(e_type.equals(enums.etype.on_url_load)){ else if(e_type.equals(enums.etype.on_url_load)){
onOpenLinkNewTab(data.get(0).toString()); if(status.sSettingIsAppRedirected){
onLoadURL(data.get(0).toString()); mHomeViewController.onPageFinished();
status.sSettingIsAppRedirected = false;
onLoadURL(status.sSettingRedirectStatus);
status.sSettingRedirectStatus = strings.GENERIC_EMPTY_STR;
}else {
if(status.mThemeApplying){
mHomeViewController.onUpdateSearchBar(data.get(0).toString(),false, false);
mSplashScreen.setAlpha(0f);
onLoadTabOnResume();
}
onLoadURL(data.get(0).toString());
mHomeViewController.onUpdateSearchBar(dataToStr(data.get(0),mGeckoClient.getSession().getCurrentURL()),false,true);
}
}
else if(e_type.equals(enums.etype.ON_LOAD_TAB_ON_RESUME)){
if(status.sSettingIsAppRedirected){
status.sSettingIsAppRedirected = false;
onLoadURL(status.sSettingRedirectStatus);
status.sSettingRedirectStatus = strings.GENERIC_EMPTY_STR;
}else {
if(status.mThemeApplying){
mSplashScreen.setAlpha(0f);
onLoadTabOnResume();
}
else if(status.sSettingIsAppStarted){
mHomeViewController.onPageFinished();
onOpenLinkNewTab(helperMethod.getDomainName(mHomeModel.getSearchEngine()));
}
}
} }
else if(e_type.equals(enums.etype.recheck_orbot)){ else if(e_type.equals(enums.etype.recheck_orbot)){
pluginController.getInstance().isOrbotRunning(); pluginController.getInstance().isOrbotRunning();
@ -1006,19 +1218,66 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
} }
public class edittextManagerCallback implements eventObserver.eventListener {
@Override
public Object invokeObserver(List<Object> data, Object e_type) {
if(e_type.equals(enums.etype.ON_KEYBOARD_CLOSE)){
isSuggestionChanged = false;
isFocusChanging = true;
mSearchbar.setSelection(0);
mHomeViewController.onClearSelections(false);
if(!isSuggestionSearchOpened){
if(mHintListView!=null && mHintListView.getAdapter()!=null && mHintListView.getAdapter().getItemCount()>0){
mHomeViewController.onUpdateSearchEngineBar(false, 150);
}
mHomeViewController.initSearchBarFocus(false);
if(!mGeckoClient.isLoading()){
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,true);
}
helperMethod.hideKeyboard(homeController.this);
}
isFocusChanging = false;
}
return null;
}
}
public class hintViewCallback implements eventObserver.eventListener {
@Override
public Object invokeObserver(List<Object> data, Object e_type) {
if(e_type.equals(enums.etype.fetch_favicon)){
mGeckoClient.onGetFavIcon((ImageView) data.get(0), (String) data.get(1));
}
return null;
}
}
public class geckoViewCallback implements eventObserver.eventListener{ public class geckoViewCallback implements eventObserver.eventListener{
@Override @Override
public Object invokeObserver(List<Object> data, Object e_type) public Object invokeObserver(List<Object> data, Object e_type)
{ {
if(e_type.equals(enums.etype.progress_update)){ if(e_type.equals(enums.etype.ON_LOAD_REQUEST)){
mAppBar.setExpanded(true,true);
}
else if(e_type.equals(enums.etype.progress_update)){
mHomeViewController.onProgressBarUpdate((int)data.get(0)); mHomeViewController.onProgressBarUpdate((int)data.get(0));
} }
else if(e_type.equals(enums.etype.ON_UPDATE_TITLE_BAR)){ else if(e_type.equals(enums.etype.ON_UPDATE_SEARCH_BAR)){
mHomeViewController.onUpdateSearchBar((String)data.get(0), false, false);
}
else if(e_type.equals(enums.etype.ON_FIRST_PAINT)){
mHomeViewController.onFirstPaint();
}
else if(e_type.equals(enums.etype.ON_SESSION_REINIT)){
mHomeViewController.onSessionReinit();
} }
else if(e_type.equals(enums.etype.on_url_load)){ else if(e_type.equals(enums.etype.on_url_load)){
mHomeViewController.onUpdateSearchBar(dataToStr(data.get(0),mGeckoClient.getSession().getCurrentURL()),false,true); //mHomeViewController.onUpdateSearchBar(dataToStr(data.get(0),mGeckoClient.getSession().getCurrentURL()),false,true);
} }
else if(e_type.equals(enums.etype.back_list_empty)){ else if(e_type.equals(enums.etype.back_list_empty)){
if((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null)>1){ if((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null)>1){
@ -1029,12 +1288,15 @@ public class homeController extends AppCompatActivity implements ComponentCallba
helperMethod.onMinimizeApp(homeController.this); helperMethod.onMinimizeApp(homeController.this);
} }
} }
else if(e_type.equals(enums.etype.ON_UPDATE_THEME)){
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(),false);
}
else if(e_type.equals(enums.etype.start_proxy)){ else if(e_type.equals(enums.etype.start_proxy)){
pluginController.getInstance().setProxy(dataToStr(data.get(0))); pluginController.getInstance().setProxy(dataToStr(data.get(0)));
} }
else if(e_type.equals(enums.etype.on_update_history)){ else if(e_type.equals(enums.etype.on_update_history)){
if(activityContextManager.getInstance().getTabController()!=null && !activityContextManager.getInstance().getTabController().isDestroyed() && !activityContextManager.getInstance().getTabController().isFinishing()){ if(activityContextManager.getInstance().getTabController()!=null && !activityContextManager.getInstance().getTabController().isDestroyed() && !activityContextManager.getInstance().getTabController().isFinishing()){
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(data.get(1), mGeckoView.capturePixels())); //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); return dataController.getInstance().invokeHistory(dataEnums.eHistoryCommands.M_ADD_HISTORY ,data);
} }
@ -1052,7 +1314,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if(!status.sSettingIsAppStarted){ if(!status.sSettingIsAppStarted){
pluginController.getInstance().MessageManagerHandler(activityContextManager.getInstance().getHomeController(), Collections.singletonList(strings.GENERIC_EMPTY_STR), enums.eMessageEnums.M_WELCOME); pluginController.getInstance().MessageManagerHandler(activityContextManager.getInstance().getHomeController(), Collections.singletonList(strings.GENERIC_EMPTY_STR), enums.eMessageEnums.M_WELCOME);
} }
status.sSettingIsAppStarted = true;
}; };
handler.postDelayed(runnable, 1300); handler.postDelayed(runnable, 1300);
}else { }else {
@ -1083,15 +1344,17 @@ public class homeController extends AppCompatActivity implements ComponentCallba
else if(e_type.equals(enums.etype.on_full_screen)){ else if(e_type.equals(enums.etype.on_full_screen)){
boolean status = (Boolean)data.get(0); boolean status = (Boolean)data.get(0);
mHomeViewController.onFullScreenUpdate(status); mHomeViewController.onFullScreenUpdate(status);
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(),true);
} }
else if(e_type.equals(enums.etype.on_update_favicon)){ else if(e_type.equals(enums.etype.on_update_favicon)){
dataController.getInstance().invokeImageCache(dataEnums.eImageCacheCommands.M_SET_IMAGE ,data); dataController.getInstance().invokeImage(dataEnums.eImageCommands.M_REQUEST_IMAGE_URL,Collections.singletonList((String)data.get(0)));
} }
else if(e_type.equals(enums.eMessageEnums.M_LONG_PRESS_WITH_LINK)){ else if(e_type.equals(enums.eMessageEnums.M_LONG_PRESS_WITH_LINK)){
pluginController.getInstance().MessageManagerHandler(homeController.this, Arrays.asList(dataToStr(data.get(0)),dataToStr(data.get(2)),dataToStr(data.get(3))),enums.eMessageEnums.M_LONG_PRESS_WITH_LINK); pluginController.getInstance().MessageManagerHandler(homeController.this, Arrays.asList(dataToStr(data.get(0)),dataToStr(data.get(2)),dataToStr(data.get(3))),enums.eMessageEnums.M_LONG_PRESS_WITH_LINK);
} }
else if(e_type.equals(enums.etype.on_long_press)){ else if(e_type.equals(enums.etype.on_long_press)){
pluginController.getInstance().MessageManagerHandler(homeController.this,Arrays.asList(dataToStr(data.get(0)),dataToStr(data.get(2))),enums.eMessageEnums.M_LONG_PRESS_DOWNLOAD); pluginController.getInstance().MessageManagerHandler(homeController.this,Arrays.asList(dataToStr(data.get(0)),dataToStr(data.get(2))),enums.eMessageEnums.M_LONG_PRESS_DOWNLOAD);
pluginController.getInstance().MessageManagerHandler(homeController.this,Arrays.asList(dataToStr(data.get(0)),dataToStr(data.get(2))),enums.eMessageEnums.M_LONG_PRESS_DOWNLOAD);
} }
else if(e_type.equals(enums.eMessageEnums.M_LONG_PRESS_URL)){ else if(e_type.equals(enums.eMessageEnums.M_LONG_PRESS_URL)){
pluginController.getInstance().MessageManagerHandler(homeController.this,Arrays.asList(dataToStr(data.get(0)),dataToStr(data.get(2))),enums.eMessageEnums.M_LONG_PRESS_URL); pluginController.getInstance().MessageManagerHandler(homeController.this,Arrays.asList(dataToStr(data.get(0)),dataToStr(data.get(2))),enums.eMessageEnums.M_LONG_PRESS_URL);

View File

@ -12,27 +12,29 @@ import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.StateListDrawable;
import android.os.Build; import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
import android.util.Log;
import android.view.Gravity; import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.ViewOutlineProvider;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.view.animation.Animation; import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.Transformation; import android.view.animation.Transformation;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.*; import android.widget.*;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.app.AppCompatDelegate;
import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.historyManager.historyRowModel; import com.darkweb.genesissearchengine.appManager.historyManager.historyRowModel;
import com.darkweb.genesissearchengine.constants.*; import com.darkweb.genesissearchengine.constants.*;
import com.darkweb.genesissearchengine.dataManager.dataController; import com.darkweb.genesissearchengine.dataManager.dataController;
@ -64,7 +66,7 @@ class homeViewController
/*ViewControllers*/ /*ViewControllers*/
private FrameLayout mWebviewContainer; private FrameLayout mWebviewContainer;
private AnimatedProgressBar mProgressBar; private AnimatedProgressBar mProgressBar;
private AutoCompleteTextView mSearchbar; private editTextManager mSearchbar;
private ConstraintLayout mSplashScreen; private ConstraintLayout mSplashScreen;
private ImageView mLoading; private ImageView mLoading;
private TextView mLoadingText; private TextView mLoadingText;
@ -73,7 +75,6 @@ class homeViewController
private ImageButton mGatewaySplash; private ImageButton mGatewaySplash;
private LinearLayout mTopBar; private LinearLayout mTopBar;
private GeckoView mGeckoView; private GeckoView mGeckoView;
private ImageView mBackSplash;
private Button mConnectButton; private Button mConnectButton;
private Button mNewTab; private Button mNewTab;
private PopupWindow popupWindow = null; private PopupWindow popupWindow = null;
@ -84,16 +85,17 @@ class homeViewController
private FrameLayout mTopLayout; private FrameLayout mTopLayout;
private ImageButton mVoiceInput; private ImageButton mVoiceInput;
private ImageButton mMenu; private ImageButton mMenu;
private FrameLayout mNestedScroll;
private ImageView mBlocker; private ImageView mBlocker;
private ImageView mBlockerFullSceen; private ImageView mBlockerFullSceen;
private TextView mCopyright; private TextView mCopyright;
private ImageButton mOrbotLogManager;
private com.google.android.material.appbar.AppBarLayout mAppBar;
/*Local Variables*/ /*Local Variables*/
private Callable<String> mLogs = null; private Callable<String> mLogs = null;
private boolean isLandscape = false; private boolean isLandscape = false;
void initialization(eventObserver.eventListener event, AppCompatActivity context, Button mNewTab, FrameLayout webviewContainer, TextView loadingText, 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, FrameLayout pTopLayout, ImageButton pVoiceInput, ImageButton pMenu, FrameLayout pNestedScroll, ImageView pBlocker, ImageView pBlockerFullSceen, View mSearchEngineBar, TextView pCopyright){ void initialization(eventObserver.eventListener event, AppCompatActivity context, Button mNewTab, FrameLayout webviewContainer, TextView loadingText, AnimatedProgressBar progressBar, editTextManager 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, FrameLayout pTopLayout, ImageButton pVoiceInput, ImageButton pMenu, FrameLayout pNestedScroll, ImageView pBlocker, ImageView pBlockerFullSceen, View mSearchEngineBar, TextView pCopyright, RecyclerView pHistListView, com.google.android.material.appbar.AppBarLayout pAppBar, ImageButton pOrbotLogManager){
this.mContext = context; this.mContext = context;
this.mProgressBar = progressBar; this.mProgressBar = progressBar;
this.mSearchbar = searchbar; this.mSearchbar = searchbar;
@ -106,7 +108,6 @@ class homeViewController
this.mGatewaySplash = gateway_splash; this.mGatewaySplash = gateway_splash;
this.mTopBar = top_bar; this.mTopBar = top_bar;
this.mGeckoView = gecko_view; this.mGeckoView = gecko_view;
this.mBackSplash = backsplash;
this.mConnectButton = connect_button; this.mConnectButton = connect_button;
this.mNewTab = mNewTab; this.mNewTab = mNewTab;
this.popupWindow = null; this.popupWindow = null;
@ -116,11 +117,12 @@ class homeViewController
this.mTopLayout = pTopLayout; this.mTopLayout = pTopLayout;
this.mVoiceInput = pVoiceInput; this.mVoiceInput = pVoiceInput;
this.mMenu = pMenu; this.mMenu = pMenu;
this.mNestedScroll = pNestedScroll;
this.mBlocker = pBlocker; this.mBlocker = pBlocker;
this.mBlockerFullSceen = pBlockerFullSceen; this.mBlockerFullSceen = pBlockerFullSceen;
this.mSearchEngineBar = mSearchEngineBar; this.mSearchEngineBar = mSearchEngineBar;
this.mCopyright = pCopyright; this.mCopyright = pCopyright;
this.mAppBar = pAppBar;
this.mOrbotLogManager = pOrbotLogManager;
initSplashScreen(); initSplashScreen();
initializeSuggestionView(suggestions); initializeSuggestionView(suggestions);
@ -174,14 +176,11 @@ class homeViewController
((LinearLayout)this.mNewTab.getParent()).setVisibility(View.GONE); ((LinearLayout)this.mNewTab.getParent()).setVisibility(View.GONE);
this.mMenu.setVisibility(View.GONE); this.mMenu.setVisibility(View.GONE);
mSearchbar.setPadding(mSearchbar.getPaddingLeft(),0,helperMethod.pxFromDp(40),0); //mSearchbar.setPadding(mSearchbar.getPaddingLeft(),0,helperMethod.pxFromDp(40),0);
mSearchbar.requestFocus();
final Handler handler_keyboard = new Handler(); InputMethodManager imm = (InputMethodManager)mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
handler_keyboard.postDelayed(() -> imm.showSoftInput(mSearchbar, InputMethodManager.SHOW_IMPLICIT);
{
InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
Objects.requireNonNull(imm).toggleSoftInput(InputMethodManager.RESULT_UNCHANGED_SHOWN, 0);
}, 250);
} }
} }
@ -190,79 +189,49 @@ class homeViewController
} }
public void recreateStatusBar(){ public void recreateStatusBar(){
if(status.sSettingIsAppStarted){ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = mContext.getWindow(); Window window = mContext.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) {
window.setStatusBarColor(mContext.getResources().getColor(R.color.blue_dark)); window.setStatusBarColor(ContextCompat.getColor(mContext, R.color.c_text_v3));
} }
else { else {
if(AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_NO){ mContext.getWindow().setStatusBarColor(ContextCompat.getColor(mContext, R.color.landing_ease_blue));
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) public void initStatusBarColor(boolean mInstant) {
private void initStatusBarColor() { animatedColor oneToTwo = new animatedColor(ContextCompat.getColor(mContext, R.color.landing_ease_blue), ContextCompat.getColor(mContext, R.color.green_dark_v2));
animatedColor oneToTwo = new animatedColor(ContextCompat.getColor(mContext, R.color.secondary), ContextCompat.getColor(mContext, R.color.secondary));
animatedColor twoToThree = new animatedColor(ContextCompat.getColor(mContext, R.color.secondary), 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); int mDelay = 0;
animator.setStartDelay(1200); if(status.mThemeApplying || mInstant){
mDelay = 0;
}
ValueAnimator animator = ObjectAnimator.ofFloat(0f, 1f);
animator.setStartDelay(mDelay);
animator.addUpdateListener(animation -> animator.addUpdateListener(animation ->
{ {
float v = (float) animation.getAnimatedValue(); float v = (float) animation.getAnimatedValue();
mContext.getWindow().setStatusBarColor(oneToTwo.with(v)); mContext.getWindow().setStatusBarColor(oneToTwo.with(v));
mContext.getWindow().setStatusBarColor(oneToTwo.with(v)); mContext.getWindow().setStatusBarColor(oneToTwo.with(v));
mContext.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);// set status text dark mContext.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}); });
animator.start();
animator.addListener(new AnimatorListenerAdapter() { animator.addListener(new AnimatorListenerAdapter() {
@Override @Override
public void onAnimationEnd(Animator animation) { public void onAnimationEnd(Animator animation) {
final ValueAnimator animator2 = ObjectAnimator.ofFloat(0f, 1f).setDuration(217); mContext.getWindow().setStatusBarColor(ContextCompat.getColor(mContext, R.color.c_background));
animator2.addUpdateListener(animation1 -> if(AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_NO){
{ mContext.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
float v = (float) animation1.getAnimatedValue(); }else {
mContext.getWindow().setStatusBarColor(twoToThree.with(v)); View decorView = mContext.getWindow().getDecorView();
if(AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_NO){ decorView.setSystemUiVisibility(decorView.getSystemUiVisibility() & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
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();
animator2.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
final ValueAnimator animator3 = ObjectAnimator.ofFloat(0f, 1f).setDuration(0);
animator3.addUpdateListener(animation1 ->
{
float v = (float) animation1.getAnimatedValue();
});
animator3.start();
}
});
animator2.start();
} }
}); });
animator.start(); animator.start();
} }
@ -282,6 +251,8 @@ class homeViewController
mSearchbar.setDropDownBackgroundDrawable(new ColorDrawable(mContext.getResources().getColor(R.color.c_background))); mSearchbar.setDropDownBackgroundDrawable(new ColorDrawable(mContext.getResources().getColor(R.color.c_background)));
mSearchbar.setDropDownHeight(helperMethod.getScreenHeight(mContext)*75/100); mSearchbar.setDropDownHeight(helperMethod.getScreenHeight(mContext)*75/100);
mSearchbar.setInputType(EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS); mSearchbar.setInputType(EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
mSearchbar.setInputType(EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
mSearchbar.setAnimation(null);
} }
public void initSplashLoading(){ public void initSplashLoading(){
@ -310,15 +281,14 @@ class homeViewController
} }
private void initSplashScreen(){ private void initSplashScreen(){
mSearchbar.setEnabled(false); mSearchbar.setEnabled(false);
helperMethod.hideKeyboard(mContext); helperMethod.hideKeyboard(mContext);
//mBackSplash.getLayoutParams().height = (int)(helperMethod.getScreenHeight(mContext) - helperMethod.getStatusBarHeight(mContext)*1.5f);
mSearchbar.setEnabled(false); mSearchbar.setEnabled(false);
View root = mSearchbar.getRootView(); View root = mSearchbar.getRootView();
root.setBackgroundColor(ContextCompat.getColor(mContext, R.color.c_background_keyboard)); root.setBackgroundColor(ContextCompat.getColor(mContext, R.color.c_background_keyboard));
mGeckoView.setBackgroundResource( R.color.dark_purple);
} }
@ -344,7 +314,11 @@ class homeViewController
e.printStackTrace(); e.printStackTrace();
} }
} }
startPostTask(messages.MESSAGE_ON_URL_LOAD); if(!status.sSettingIsAppStarted){
startPostTask(messages.MESSAGE_ON_URL_LOAD);
}else {
mContext.runOnUiThread(() -> mEvent.invokeObserver(null, enums.etype.ON_LOAD_TAB_ON_RESUME));
}
} }
}.start(); }.start();
} }
@ -356,28 +330,30 @@ class homeViewController
mSearchbar.setEnabled(true); mSearchbar.setEnabled(true);
mProgressBar.bringToFront(); mProgressBar.bringToFront();
mSplashScreen.bringToFront(); mSplashScreen.bringToFront();
if(mSplashScreen.getVisibility()!=View.GONE){
mContext.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_USER);//Set Portrait
}
splashScreenDisable(); splashScreenDisable();
} }
private void splashScreenDisable(){ private void splashScreenDisable(){
mTopBar.setAlpha(1); mTopBar.setAlpha(1);
if(mSplashScreen.getVisibility()==View.VISIBLE)
{ if(mSplashScreen.getAlpha()==1){
mSplashScreen.animate().setStartDelay(1000).setDuration(500).alpha(0).withEndAction((this::triggerPostUI)); triggerPostUI();
mProgressBar.setVisibility(View.GONE);
mSplashScreen.animate().setStartDelay(0).alpha(0);
mOrbotLogManager.setClickable(false);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
initStatusBarColor(); initStatusBarColor(false);
} }
status.sSettingIsAppRestarting = true;
} }
} }
private void triggerPostUI(){ public void onUpdateToolbarTheme(){
if(mSplashScreen.getVisibility()!=View.GONE){ mContext.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_USER);
mSplashScreen.setVisibility(View.GONE); }
mSplashScreen.invalidate();
}
private void triggerPostUI(){
onUpdateToolbarTheme();
mAppBar.setExpanded(true,true);
if(mProgressBar.getProgress()>0 && mProgressBar.getProgress()<10000){ if(mProgressBar.getProgress()>0 && mProgressBar.getProgress()<10000){
mProgressBar.animate().setStartDelay(0).alpha(1); mProgressBar.animate().setStartDelay(0).alpha(1);
} }
@ -415,10 +391,6 @@ class homeViewController
} }
popupWindow.showAtLocation(parent, Gravity.TOP|Gravity.END,0,0); popupWindow.showAtLocation(parent, Gravity.TOP|Gravity.END,0,0);
if(!status.sCharacterEncoding){
popupView.findViewById(R.id.menu30).setVisibility(View.GONE);
}
ImageButton back = popupView.findViewById(R.id.menu22); ImageButton back = popupView.findViewById(R.id.menu22);
ImageButton close = popupView.findViewById(R.id.menu20); ImageButton close = popupView.findViewById(R.id.menu20);
CheckBox desktop = popupView.findViewById(R.id.menu27); CheckBox desktop = popupView.findViewById(R.id.menu27);
@ -540,35 +512,124 @@ class homeViewController
} }
} }
public void onUpdateStatusBarTheme(String pTheme, boolean mForced)
{
if(mSplashScreen.getAlpha()<=0){
int mColor = -1;
try{
mColor = Color.parseColor(pTheme);
}catch (Exception ex){
mColor = -1;
}
if(pTheme!=null && status.sToolbarTheme && mColor!=-1){
mTopBar.setBackgroundColor(mColor);
mSearchbar.setTextColor(helperMethod.invertedGrayColor(mColor));
mSearchbar.setHintTextColor(helperMethod.invertedGrayColor(mColor));
mNewTab.setTextColor(helperMethod.invertedGrayColor(mColor));
GradientDrawable mGradientDrawable = new GradientDrawable();
mGradientDrawable.setColor(helperMethod.invertedShadeColor(mColor,0.85f));
mGradientDrawable.setCornerRadius(helperMethod.pxFromDp(7));
mSearchbar.setBackground(mGradientDrawable);
GradientDrawable gradientDrawable1 = new GradientDrawable();
gradientDrawable1.setColor(helperMethod.invertedShadeColor(mColor,0.85f));
gradientDrawable1.setCornerRadius(helperMethod.pxFromDp(4));
gradientDrawable1.setStroke(helperMethod.pxFromDp(2), helperMethod.invertedGrayColor(mColor));
GradientDrawable gradientDrawable2 = new GradientDrawable();
gradientDrawable2.setColor(helperMethod.invertedShadeColor(mColor,0.85f));
gradientDrawable2.setCornerRadius(helperMethod.pxFromDp(4));
gradientDrawable2.setStroke(helperMethod.pxFromDp(2), mColor);
StateListDrawable states = new StateListDrawable();
states.addState(new int[] {android.R.attr.state_pressed}, gradientDrawable2);
states.addState(new int[] { }, gradientDrawable1);
mNewTab.setBackground(states);
mMenu.setColorFilter(helperMethod.invertedGrayColor(mColor));
mVoiceInput.setColorFilter(helperMethod.invertedGrayColor(mColor));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
mContext.getWindow().setStatusBarColor(Color.parseColor(pTheme));
}else {
mContext.getWindow().setStatusBarColor(mContext.getResources().getColor(R.color.blue_dark));
}
if(helperMethod.isColorDark(mColor)){
View decorView = mContext.getWindow().getDecorView(); //set status background black
decorView.setSystemUiVisibility(decorView.getSystemUiVisibility() & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}else {
mContext.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}
}
else{
mTopBar.setBackground(ContextCompat.getDrawable(mContext, R.color.c_background));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
mContext.getWindow().setStatusBarColor(ContextCompat.getColor(mContext, R.color.c_background));
}else {
mContext.getWindow().setStatusBarColor(mContext.getResources().getColor(R.color.blue_dark));
}
Drawable drawable;
Resources res = mContext.getResources();
try {
drawable = Drawable.createFromXml(res, res.getXml(R.xml.gx_generic_tab_button));
mNewTab.setBackground(drawable);
drawable = Drawable.createFromXml(res, res.getXml(R.xml.gx_generic_input));
mSearchbar.setBackground(drawable);
} catch (Exception ignored) {
}
mNewTab.setTextColor(ContextCompat.getColor(mContext, R.color.c_text_v1));
mMenu.setColorFilter(ContextCompat.getColor(mContext, R.color.c_navigation_tint));
mVoiceInput.setColorFilter(ContextCompat.getColor(mContext, R.color.c_navigation_tint));
mSearchbar.setTextColor(ContextCompat.getColor(mContext, R.color.c_text_v1));
if(status.sTheme == enums.Theme.THEME_DARK){
View decorView = mContext.getWindow().getDecorView();
decorView.setSystemUiVisibility(decorView.getSystemUiVisibility() & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}else {
mContext.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}
}
}
}
public void onUpdateFindBar(boolean pStatus) public void onUpdateFindBar(boolean pStatus)
{ {
mFindBar.animate().cancel(); mFindBar.animate().cancel();
if(pStatus){ if(pStatus){
mFindBar.setVisibility(View.VISIBLE); mFindBar.setVisibility(View.VISIBLE);
mFindBar.setAlpha(1); mFindBar.setAlpha(1);
mFindBar.startAnimation(AnimationUtils.loadAnimation(mContext, R.anim.popup_anim_in));
mFindText.requestFocus(); mFindText.requestFocus();
InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0); imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT,0);
}else { }else {
mFindText.clearFocus(); mFindText.clearFocus();
mFindCount.setText(strings.GENERIC_EMPTY_STR); mFindCount.setText(strings.GENERIC_EMPTY_STR);
mFindBar.startAnimation(AnimationUtils.loadAnimation(mContext, R.anim.popup_anim_out));
helperMethod.hideKeyboard(mContext); helperMethod.hideKeyboard(mContext);
mFindBar.animate().alpha(0).withEndAction(() -> mFindBar.setVisibility(View.GONE)); mFindBar.animate().alpha(0).withEndAction(() -> mFindBar.setVisibility(View.GONE));
mFindText.setText(strings.GENERIC_EMPTY_STR); mFindText.setText(strings.GENERIC_EMPTY_STR);
} }
} }
public void onUpdateSearchEngineBar(boolean pStatus) public void onUpdateSearchEngineBar(boolean pStatus, int delay)
{ {
mSearchEngineBar.animate().cancel();
if(pStatus){ if(pStatus){
mSearchEngineBar.setAlpha(0f); if(mSearchEngineBar.getAlpha() == 0 || mSearchEngineBar.getVisibility() == View.GONE){
mSearchEngineBar.animate().setDuration(300).alpha(1); mSearchEngineBar.animate().cancel();
mSearchEngineBar.setVisibility(View.VISIBLE); mSearchEngineBar.setAlpha(0f);
mSearchEngineBar.animate().setDuration(delay).alpha(1);
mSearchEngineBar.setVisibility(View.VISIBLE);
}
}else { }else {
mSearchEngineBar.animate().setDuration(300).alpha(0).withEndAction(() -> { mSearchEngineBar.animate().setDuration(delay).alpha(0).withEndAction(() -> {
mSearchEngineBar.animate().cancel();
mSearchEngineBar.setAlpha(0f); mSearchEngineBar.setAlpha(0f);
mSearchEngineBar.setVisibility(View.GONE); mSearchEngineBar.setVisibility(View.GONE);
}); });
@ -596,7 +657,7 @@ class homeViewController
if(url.length()<=300){ if(url.length()<=300){
url = removeEndingSlash(url); url = removeEndingSlash(url);
mSearchbar.setText(helperMethod.urlDesigner(url, mContext)); mSearchbar.setText(helperMethod.urlDesigner(url, mContext, mSearchbar.getCurrentTextColor()));
mSearchbar.selectAll(); mSearchbar.selectAll();
if(isTextSelected){ if(isTextSelected){
@ -635,60 +696,33 @@ class homeViewController
mProgressBar.setVisibility(View.INVISIBLE); mProgressBar.setVisibility(View.INVISIBLE);
} }
void onProgressBarUpdate(int value){ public void onFirstPaint(){
mGeckoView.setForeground(ContextCompat.getDrawable(mContext, R.color.clear_alpha));
mProgressBar.setAlpha(1f);
mProgressBar.setVisibility(View.VISIBLE);
ProgressBarAnimation mProgressAnimation = new ProgressBarAnimation(mProgressBar, 1000);
mProgressAnimation.setProgress(value*100);
} }
public class ProgressBarAnimation extends Animation { public void onSessionReinit(){
private ProgressBar mProgressBar; mGeckoView.setForeground(ContextCompat.getDrawable(mContext, R.color.c_background));
private int mTo; }
private int mFrom;
private long mStepDuration;
/** void onProgressBarUpdate(int value){
* @param fullDuration - time required to fill progress from 0% to 100% if(mProgressBar.getVisibility()==View.GONE){
*/ mProgressBar.setVisibility(View.VISIBLE);
public ProgressBarAnimation(ProgressBar progressBar, long fullDuration) {
super();
mProgressBar = progressBar;
mStepDuration = fullDuration / progressBar.getMax();
} }
else if(value != mProgressBar.getProgress()){
if(value<=5 && value>0){
public void setProgress(int progress) { mProgressBar.setProgress(5);
if(progress == 10000){ }else {
mProgressBar.animate().setStartDelay(100).alpha(0); mProgressBar.setProgress(value);
}
if(value >= 100 || value<=0){
mProgressBar.animate().alpha(0).withEndAction(() -> mProgressBar.setProgress(0));
}else { }else {
mProgressBar.animate().cancel();
mProgressBar.setAlpha(1); mProgressBar.setAlpha(1);
} }
if (progress < 0) {
progress = 0;
}
if (progress > mProgressBar.getMax()) {
progress = mProgressBar.getMax();
}
mTo = progress;
mFrom = mProgressBar.getProgress();
setDuration(Math.abs(mTo - mFrom) * mStepDuration);
mProgressBar.startAnimation(this);
}
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
float value = mFrom + (mTo - mFrom) * interpolatedTime;
mProgressBar.setProgress((int) value);
} }
} }
void onClearSelections(boolean hideKeyboard){ void onClearSelections(boolean hideKeyboard){
mSearchbar.setFocusable(false); mSearchbar.setFocusable(false);
mSearchbar.setFocusableInTouchMode(true); mSearchbar.setFocusableInTouchMode(true);
@ -786,9 +820,7 @@ class homeViewController
mContext.getWindow().setStatusBarColor(mContext.getResources().getColor(R.color.blue_dark)); mContext.getWindow().setStatusBarColor(mContext.getResources().getColor(R.color.blue_dark));
} }
this.mBlockerFullSceen.animate().setStartDelay(0).setDuration(200).alpha(0).withEndAction(() -> { this.mBlockerFullSceen.animate().setStartDelay(0).setDuration(200).alpha(0).withEndAction(() -> mBlockerFullSceen.setVisibility(View.GONE));
mBlockerFullSceen.setVisibility(View.GONE);
});
} }
} }
@ -837,6 +869,7 @@ class homeViewController
mEvent.invokeObserver(Collections.singletonList(helperMethod.getDomainName(status.sSettingRedirectStatus)), enums.etype.on_url_load); mEvent.invokeObserver(Collections.singletonList(helperMethod.getDomainName(status.sSettingRedirectStatus)), enums.etype.on_url_load);
} }
} }
status.sSettingIsAppStarted = true;
} }
if(msg.what == messages.MESSAGE_UPDATE_LOADING_TEXT) if(msg.what == messages.MESSAGE_UPDATE_LOADING_TEXT)
{ {

View File

@ -0,0 +1,25 @@
package com.darkweb.genesissearchengine.appManager.kotlinHelperLibraries
import android.content.Context
import android.widget.ImageView
import mozilla.components.browser.engine.gecko.fetch.GeckoViewFetchClient
import mozilla.components.browser.icons.BrowserIcons
import mozilla.components.browser.icons.IconRequest
import mozilla.components.browser.icons.generator.DefaultIconGenerator
import org.mozilla.geckoview.GeckoRuntime
import java.util.concurrent.TimeUnit
class BrowserIconManager {
fun onLoadIconIntoView(mContext: Context, mRuntime: GeckoRuntime, mView:ImageView, pURL:String) : BrowserIcons {
val fetchClient = GeckoViewFetchClient(mContext,mRuntime, Pair(10L, TimeUnit.MINUTES))
val mIcons = BrowserIcons(mContext, httpClient = fetchClient, generator = DefaultIconGenerator())
mIcons.loadIntoView(mView,IconRequest(pURL))
return mIcons
}
fun onLoadIcon(mContext: Context, mRuntime: GeckoRuntime) {
val fetchClient = GeckoViewFetchClient(mContext,mRuntime, Pair(10L, TimeUnit.MINUTES))
BrowserIcons(mContext, httpClient = fetchClient, generator = DefaultIconGenerator())
}
}

View File

@ -7,10 +7,17 @@ import androidx.fragment.app.Fragment;
import android.view.View; import android.view.View;
import com.darkweb.genesissearchengine.appManager.bridgeManager.bridgeController; import com.darkweb.genesissearchengine.appManager.bridgeManager.bridgeController;
import com.darkweb.genesissearchengine.appManager.orbotManager.orbotController;
import com.darkweb.genesissearchengine.constants.keys;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.pluginManager.pluginController; import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.example.myapplication.R; import com.example.myapplication.R;
import com.github.paolorotolo.appintro.AppIntro; import com.github.paolorotolo.appintro.AppIntro;
import java.util.Arrays;
public class landingController extends AppIntro { public class landingController extends AppIntro {
private landingViewController mLauncherViewController; private landingViewController mLauncherViewController;
@ -37,7 +44,7 @@ public class landingController extends AppIntro {
cs2.showButton(getString(R.string.LANDING_MORE), new View.OnClickListener() { cs2.showButton(getString(R.string.LANDING_MORE), new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
startActivity(new Intent(landingController.this,bridgeController.class)); startActivity(new Intent(landingController.this, orbotController.class));
} }
}); });
addSlide(cs2); addSlide(cs2);
@ -45,8 +52,8 @@ public class landingController extends AppIntro {
// OPTIONAL METHODS // OPTIONAL METHODS
// Override bar/separator color. // Override bar/separator color.
setBarColor(getResources().getColor(R.color.secondary)); setBarColor(getResources().getColor(R.color.landing_ease_blue));
setSeparatorColor(getResources().getColor(R.color.white)); setSeparatorColor(getResources().getColor(R.color.headerblack));
// Hide Skip/Done button. // Hide Skip/Done button.
showSkipButton(false); showSkipButton(false);
@ -61,6 +68,8 @@ public class landingController extends AppIntro {
@Override @Override
public void onDonePressed(Fragment currentFragment) { public void onDonePressed(Fragment currentFragment) {
super.onDonePressed(currentFragment); super.onDonePressed(currentFragment);
status.sSettingFirstStart = false;
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_FIRST_INSTALLED,false));
finish(); finish();
} }

View File

@ -5,10 +5,12 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator; import android.animation.ObjectAnimator;
import android.animation.ValueAnimator; import android.animation.ValueAnimator;
import android.os.Build; import android.os.Build;
import android.view.View;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import com.darkweb.genesissearchengine.helperManager.animatedColor; import com.darkweb.genesissearchengine.helperManager.animatedColor;
import com.darkweb.genesissearchengine.helperManager.eventObserver; import com.darkweb.genesissearchengine.helperManager.eventObserver;
@ -32,62 +34,13 @@ class landingViewController
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = mContext.getWindow(); Window window = mContext.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) {
window.setStatusBarColor(mContext.getResources().getColor(R.color.secondary)); window.setStatusBarColor(ContextCompat.getColor(mContext, R.color.c_text_v3));
} }
else { else {
initStatusBarColor(); mContext.getWindow().setStatusBarColor(ContextCompat.getColor(mContext, R.color.landing_ease_blue));
} }
} }
} }
@RequiresApi(api = Build.VERSION_CODES.M)
private void initStatusBarColor() {
animatedColor oneToTwo = new animatedColor(ContextCompat.getColor(mContext, R.color.secondary), ContextCompat.getColor(mContext, R.color.secondary));
animatedColor twoToThree = new animatedColor(ContextCompat.getColor(mContext, R.color.secondary), ContextCompat.getColor(mContext, R.color.secondary));
animatedColor ThreeToFour = new animatedColor(ContextCompat.getColor(mContext, R.color.secondary), ContextCompat.getColor(mContext, R.color.secondary));
ValueAnimator animator = ObjectAnimator.ofFloat(0f, 1f).setDuration(0);
animator.addUpdateListener(animation ->
{
float v = (float) animation.getAnimatedValue();
mContext.getWindow().setStatusBarColor(oneToTwo.with(v));
mContext.getWindow().setStatusBarColor(oneToTwo.with(v));
});
animator.start();
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
final ValueAnimator animator2 = ObjectAnimator.ofFloat(0f, 1f).setDuration(217);
animator2.addUpdateListener(animation1 ->
{
float v = (float) animation1.getAnimatedValue();
mContext.getWindow().setStatusBarColor(twoToThree.with(v));
});
animator2.start();
animator2.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
final ValueAnimator animator3 = ObjectAnimator.ofFloat(0f, 1f).setDuration(0);
animator3.addUpdateListener(animation1 ->
{
float v = (float) animation1.getAnimatedValue();
mContext.getWindow().setStatusBarColor(ThreeToFour.with(v));
});
animator3.start();
}
});
animator2.start();
}
});
animator.start();
}
} }

View File

@ -3,6 +3,8 @@ package com.darkweb.genesissearchengine.appManager.languageManager;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.helpManager.helpController; import com.darkweb.genesissearchengine.appManager.helpManager.helpController;
import com.darkweb.genesissearchengine.constants.constants; import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.keys; import com.darkweb.genesissearchengine.constants.keys;
@ -42,6 +44,7 @@ public class languageController extends AppCompatActivity {
public void initializeConnections() public void initializeConnections()
{ {
activityContextManager.getInstance().onStack(this);
mLanguageViewController.initialization(new languageViewCallback(),this); mLanguageViewController.initialization(new languageViewCallback(),this);
} }
@ -68,9 +71,26 @@ public class languageController extends AppCompatActivity {
/*-------------------------------------------------------CALLBACKS-------------------------------------------------------*/ /*-------------------------------------------------------CALLBACKS-------------------------------------------------------*/
public void onClose(View view) { public void onClose(View view) {
activityContextManager.getInstance().onRemoveStack(this);
finish(); finish();
} }
@Override
public void onBackPressed() {
onClose(null);
super.onBackPressed();
}
@Override
protected void onStop() {
super.onStop();
}
@Override
protected void onDestroy() {
super.onDestroy();
}
public void onMenuItemInvoked(View view) { public void onMenuItemInvoked(View view) {
int menuId = view.getId(); int menuId = view.getId();
if (menuId == R.id.langEnglish) { if (menuId == R.id.langEnglish) {

View File

@ -33,7 +33,7 @@ public class orbotAdapter extends RecyclerView.Adapter<orbotAdapter.listViewHold
@NonNull @Override @NonNull @Override
public orbotAdapter.listViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public orbotAdapter.listViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.orbotview_row, parent, false); View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.orbot_row_view, parent, false);
return new orbotAdapter.listViewHolder(view); return new orbotAdapter.listViewHolder(view);
} }
@ -77,7 +77,7 @@ public class orbotAdapter extends RecyclerView.Adapter<orbotAdapter.listViewHold
activityContextManager.getInstance().getHomeController().startActivity(intent); activityContextManager.getInstance().getHomeController().startActivity(intent);
} }
} }
public Object onTrigger(tabEnums.eTabModelCommands pCommands, List<Object> pData){ public Object onTrigger(tabEnums.eTabAdapterCommands pCommands, List<Object> pData){
return null; return null;
} }
} }

View File

@ -13,6 +13,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.activityContextManager; import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.helpManager.helpController; import com.darkweb.genesissearchengine.appManager.helpManager.helpController;
import com.darkweb.genesissearchengine.appManager.settingManager.logManager.settingLogController;
import com.darkweb.genesissearchengine.constants.constants; import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.status; import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.helperManager.SimpleGestureFilter; import com.darkweb.genesissearchengine.helperManager.SimpleGestureFilter;
@ -61,6 +62,7 @@ public class orbotLogController extends AppCompatActivity {
mFloatingScroller = findViewById(R.id.pFloatingScroller); mFloatingScroller = findViewById(R.id.pFloatingScroller);
activityContextManager.getInstance().setOrbotLogController(this); activityContextManager.getInstance().setOrbotLogController(this);
activityContextManager.getInstance().onStack(this);
mOrbotViewController = new orbotLogViewController(this, mLogs, mRecycleView); mOrbotViewController = new orbotLogViewController(this, mLogs, mRecycleView);
mOrbotModel = new orbotLogModel(); mOrbotModel = new orbotLogModel();
@ -166,7 +168,7 @@ public class orbotLogController extends AppCompatActivity {
} }
public void onOpenInfo(View view) { public void onOpenInfo(View view) {
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true); helperMethod.openActivity(settingLogController.class, constants.CONST_LIST_HISTORY, this,true);
} }
public class orbotModelCallback implements eventObserver.eventListener{ public class orbotModelCallback implements eventObserver.eventListener{
@ -181,12 +183,18 @@ public class orbotLogController extends AppCompatActivity {
public void onClose(View view){ public void onClose(View view){
finish(); finish();
activityContextManager.getInstance().onRemoveStack(this);
overridePendingTransition(R.anim.push_anim_in, R.anim.push_anim_out); overridePendingTransition(R.anim.push_anim_in, R.anim.push_anim_out);
mActivityClosed = true; mActivityClosed = true;
} }
/* LOCAL OVERRIDES */ /* LOCAL OVERRIDES */
@Override
protected void onStop() {
super.onStop();
}
@Override @Override
public void onResume() public void onResume()
{ {

View File

@ -104,6 +104,7 @@ public class orbotController extends AppCompatActivity {
public void onClose(View view){ public void onClose(View view){
finish(); finish();
activityContextManager.getInstance().onRemoveStack(this);
overridePendingTransition(R.anim.push_anim_out_reverse, R.anim.push_anim_in_reverse); overridePendingTransition(R.anim.push_anim_out_reverse, R.anim.push_anim_in_reverse);
} }
@ -114,6 +115,8 @@ public class orbotController extends AppCompatActivity {
{ {
activityContextManager.getInstance().setCurrentActivity(this); activityContextManager.getInstance().setCurrentActivity(this);
mOrbotViewController.onTrigger(orbotEnums.eOrbotViewCommands.M_INIT_POST_UI,null); mOrbotViewController.onTrigger(orbotEnums.eOrbotViewCommands.M_INIT_POST_UI,null);
activityContextManager.getInstance().onStack(this);
super.onResume(); super.onResume();
} }
@ -123,6 +126,11 @@ public class orbotController extends AppCompatActivity {
super.onPause(); super.onPause();
} }
@Override
protected void onStop() {
super.onStop();
}
@Override @Override
public void onBackPressed() { public void onBackPressed() {
onClose(null); onClose(null);

View File

@ -0,0 +1,99 @@
package com.darkweb.genesissearchengine.appManager.proxyStatusManager;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.helpManager.helpController;
import com.darkweb.genesissearchengine.appManager.orbotLogManager.orbotLogController;
import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.example.myapplication.R;
import com.google.android.material.switchmaterial.SwitchMaterial;
import java.util.Arrays;
import java.util.List;
public class proxyStatusController extends AppCompatActivity {
/* PRIVATE VARIABLES */
private proxyStatusModel mProxyStatusModel;
private proxyStatusViewController mProxyStatusViewController;
/* INITIALIZATIONS */
private TextView mOrbotStatus;
private SwitchMaterial mVpnStatus;
private SwitchMaterial mBridgeStatus;
@Override
protected void onCreate(Bundle savedInstanceState) {
overridePendingTransition(R.anim.push_anim_in, R.anim.push_anim_out);
pluginController.getInstance().onCreate(this);
super.onCreate(savedInstanceState);
setContentView(R.layout.proxy_status_view);
viewsInitializations();
}
public void viewsInitializations() {
mOrbotStatus = findViewById(R.id.pOrbotStatus);
mVpnStatus = findViewById(R.id.pVpnStatus);
mBridgeStatus = findViewById(R.id.pBridgeStatus);
activityContextManager.getInstance().onStack(this);
mProxyStatusViewController = new proxyStatusViewController(this, mOrbotStatus, mVpnStatus, mBridgeStatus);
mProxyStatusViewController.onTrigger(proxyStatusEnums.eProxyStatusViewCommands.M_INIT_VIEWS, Arrays.asList(pluginController.getInstance().getOrbotStatus(), status.sBridgeVPNStatus,status.sBridgeStatus));
mProxyStatusModel = new proxyStatusModel(new proxyStatusModelCallback());
}
public void orbotLog(View view) {
helperMethod.openActivity(orbotLogController.class, constants.CONST_LIST_HISTORY, this,true);
}
/* LISTENERS */
public class proxyStatusModelCallback implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, Object e_type)
{
return null;
}
}
public void onClose(View view){
finish();
activityContextManager.getInstance().onRemoveStack(this);
overridePendingTransition(R.anim.push_anim_out_reverse, R.anim.push_anim_in_reverse);
}
/* LOCAL OVERRIDES */
@Override
public void onResume()
{
super.onResume();
}
@Override
public void onPause()
{
super.onPause();
}
@Override
public void onBackPressed() {
onClose(null);
}
@Override
protected void onStop() {
super.onStop();
}
}

View File

@ -0,0 +1,12 @@
package com.darkweb.genesissearchengine.appManager.proxyStatusManager;
public class proxyStatusEnums
{
/*Settings Manager*/
public enum eProxyStatusViewCommands {
M_INIT_VIEWS
}
public enum eProxyStatusModelCommands {
}
}

View File

@ -0,0 +1,17 @@
package com.darkweb.genesissearchengine.appManager.proxyStatusManager;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
class proxyStatusModel
{
/*Variable Declaration*/
private eventObserver.eventListener mEvent;
/*Initializations*/
proxyStatusModel(eventObserver.eventListener mEvent){
this.mEvent = mEvent;
}
}

View File

@ -0,0 +1,69 @@
package com.darkweb.genesissearchengine.appManager.proxyStatusManager;
import android.os.Build;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.content.ContextCompat;
import com.example.myapplication.R;
import com.google.android.material.switchmaterial.SwitchMaterial;
import java.util.List;
class proxyStatusViewController
{
/*Private Variables*/
private AppCompatActivity mContext;
private SwitchMaterial mBridgeSwitch;
private SwitchMaterial mVpnSwitch;
private LinearLayout mCustomizableBridgeMenu;
/*Initializations*/
private TextView mOrbotStatus;
private SwitchMaterial mVpnStatus;
private SwitchMaterial mBridgeStatus;
proxyStatusViewController(AppCompatActivity pContext, TextView pOrbotStatus, SwitchMaterial pVpnStatus, SwitchMaterial pBridgeStatus)
{
this.mContext = pContext;
this.mOrbotStatus = pOrbotStatus;
this.mVpnStatus = pVpnStatus;
this.mBridgeStatus = pBridgeStatus;
initPostUI();
}
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));
}
}
}
private void initViews(String pOrbotStatus, boolean pVPNStatus, boolean pGatewayStatus){
mOrbotStatus.setText(pOrbotStatus);
mVpnStatus.setChecked(pVPNStatus);
mBridgeStatus.setChecked(pGatewayStatus);
}
public void onTrigger(proxyStatusEnums.eProxyStatusViewCommands pCommands, List<Object> pData){
if(pCommands.equals(proxyStatusEnums.eProxyStatusViewCommands.M_INIT_VIEWS)){
initViews((String)pData.get(0),(boolean)pData.get(1),(boolean)pData.get(2));
}
}
}

View File

@ -49,6 +49,7 @@ public class settingAccessibilityController extends AppCompatActivity {
mSeekBarSample = findViewById(R.id.pSeekBarSample); mSeekBarSample = findViewById(R.id.pSeekBarSample);
mScalePercentage = findViewById(R.id.pScalePercentage); mScalePercentage = findViewById(R.id.pScalePercentage);
activityContextManager.getInstance().onStack(this);
mSettingAccessibilityViewController = new settingAccessibilityViewController(this, new settingAccessibilityController.settingAccessibilityViewCallback(), mZoom, mVoiceInput, mSeekBar, mSeekBarSample, mScalePercentage); mSettingAccessibilityViewController = new settingAccessibilityViewController(this, new settingAccessibilityController.settingAccessibilityViewCallback(), mZoom, mVoiceInput, mSeekBar, mSeekBarSample, mScalePercentage);
mSettingAccessibilityModel = new settingAccessibilityModel(new settingAccessibilityController.settingAccessibilityModelCallback()); mSettingAccessibilityModel = new settingAccessibilityModel(new settingAccessibilityController.settingAccessibilityModelCallback());
} }
@ -114,9 +115,10 @@ public class settingAccessibilityController extends AppCompatActivity {
@Override @Override
public void onBackPressed() { public void onBackPressed() {
finish(); onClose(null);
} }
/*UI Redirection*/ /*UI Redirection*/
public void onOpenInfo(View view) { public void onOpenInfo(View view) {
@ -124,6 +126,7 @@ public class settingAccessibilityController extends AppCompatActivity {
} }
public void onClose(View view){ public void onClose(View view){
activityContextManager.getInstance().onRemoveStack(this);
finish(); finish();
} }

View File

@ -28,7 +28,7 @@ public class settingAdvanceController extends AppCompatActivity {
private settingAdvanceViewController mSettingAdvanceViewController; private settingAdvanceViewController mSettingAdvanceViewController;
private SwitchMaterial mRestoreTabs; private SwitchMaterial mRestoreTabs;
private SwitchMaterial mShowWebFonts; private SwitchMaterial mShowWebFonts;
private SwitchMaterial mAllowAutoPlay; private SwitchMaterial mToolbarTheme;
private ArrayList<RadioButton> mImageOption = new ArrayList<>(); private ArrayList<RadioButton> mImageOption = new ArrayList<>();
private boolean mIsChanged = false; private boolean mIsChanged = false;
@ -44,11 +44,12 @@ public class settingAdvanceController extends AppCompatActivity {
public void viewsInitializations() { public void viewsInitializations() {
mRestoreTabs = findViewById(R.id.pRestoreTabs); mRestoreTabs = findViewById(R.id.pRestoreTabs);
mShowWebFonts = findViewById(R.id.pShowWebFonts); mShowWebFonts = findViewById(R.id.pShowWebFonts);
mAllowAutoPlay = findViewById(R.id.pAllowAutoPlay); mToolbarTheme = findViewById(R.id.pToolbarTheme);
mImageOption.add(findViewById(R.id.pAdvanceImageOption1)); mImageOption.add(findViewById(R.id.pAdvanceImageOption1));
mImageOption.add(findViewById(R.id.pAdvanceImageOption2)); mImageOption.add(findViewById(R.id.pAdvanceImageOption2));
mSettingAdvanceViewController = new settingAdvanceViewController(this, new settingAdvanceViewCallback(), mRestoreTabs, mShowWebFonts, mAllowAutoPlay, mImageOption); activityContextManager.getInstance().onStack(this);
mSettingAdvanceViewController = new settingAdvanceViewController(this, new settingAdvanceViewCallback(), mRestoreTabs, mShowWebFonts, mToolbarTheme, mImageOption);
mSettingAdvanceModel = new settingAdvanceModel(new settingAdvanceModelCallback()); mSettingAdvanceModel = new settingAdvanceModel(new settingAdvanceModelCallback());
} }
@ -104,6 +105,7 @@ public class settingAdvanceController extends AppCompatActivity {
pluginController.getInstance().updatePrivacy(); pluginController.getInstance().updatePrivacy();
activityContextManager.getInstance().getHomeController().initRuntimeSettings(); activityContextManager.getInstance().getHomeController().initRuntimeSettings();
} }
activityContextManager.getInstance().onRemoveStack(this);
finish(); finish();
} }
@ -138,10 +140,10 @@ public class settingAdvanceController extends AppCompatActivity {
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SHOW_FONTS,status.sShowWebFonts)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SHOW_FONTS,status.sShowWebFonts));
} }
public void onAllowAutoPlay(View view) { public void onToolbarTheme(View view) {
mIsChanged = true; mSettingAdvanceModel.onTrigger(settingAdvanceEnums.eAdvanceModel.M_TOOLBAR_THEME, Collections.singletonList(!mToolbarTheme.isChecked()));
mSettingAdvanceModel.onTrigger(settingAdvanceEnums.eAdvanceModel.M_ALLOW_AUTOPLAY, Collections.singletonList(!mAllowAutoPlay.isChecked())); mToolbarTheme.toggle();
mAllowAutoPlay.toggle(); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_TOOLBAR_THEME,status.sToolbarTheme));
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_AUTO_PLAY,status.sAutoPlay)); activityContextManager.getInstance().getHomeController().onUpdateToolbarTheme();
} }
} }

View File

@ -4,7 +4,7 @@ class settingAdvanceEnums
{ {
/*History Manager*/ /*History Manager*/
public enum eAdvanceModel { public enum eAdvanceModel {
M_RESTORE_TAB, M_SHOW_IMAGE, M_SHOW_WEB_FONTS, M_ALLOW_AUTOPLAY M_RESTORE_TAB, M_SHOW_IMAGE, M_SHOW_WEB_FONTS, M_TOOLBAR_THEME
} }
public enum eAdvanceViewController { public enum eAdvanceViewController {

View File

@ -2,12 +2,10 @@ package com.darkweb.genesissearchengine.appManager.settingManager.advanceManager
import android.view.View; import android.view.View;
import com.darkweb.genesissearchengine.constants.keys;
import com.darkweb.genesissearchengine.constants.status; import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver; import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.example.myapplication.R; import com.example.myapplication.R;
import java.util.Arrays;
import java.util.List; import java.util.List;
class settingAdvanceModel class settingAdvanceModel
@ -42,8 +40,8 @@ class settingAdvanceModel
status.sShowWebFonts = pStatus; status.sShowWebFonts = pStatus;
} }
private void onAllowAutoPlay(boolean pStatus) { private void onToolbarThemeChange(boolean pStatus) {
status.sAutoPlay = pStatus; status.sToolbarTheme = pStatus;
} }
public Object onTrigger(settingAdvanceEnums.eAdvanceModel pCommands, List<Object> pData){ public Object onTrigger(settingAdvanceEnums.eAdvanceModel pCommands, List<Object> pData){
@ -56,8 +54,8 @@ class settingAdvanceModel
else if(pCommands.equals(settingAdvanceEnums.eAdvanceModel.M_SHOW_WEB_FONTS)){ else if(pCommands.equals(settingAdvanceEnums.eAdvanceModel.M_SHOW_WEB_FONTS)){
onShowWebFonts((boolean)pData.get(0)); onShowWebFonts((boolean)pData.get(0));
} }
else if(pCommands.equals(settingAdvanceEnums.eAdvanceModel.M_ALLOW_AUTOPLAY)){ else if(pCommands.equals(settingAdvanceEnums.eAdvanceModel.M_TOOLBAR_THEME)){
onAllowAutoPlay((boolean)pData.get(0)); onToolbarThemeChange((boolean)pData.get(0));
} }
return null; return null;
} }

View File

@ -25,18 +25,18 @@ class settingAdvanceViewController
private SwitchMaterial mRestoreTabs; private SwitchMaterial mRestoreTabs;
private SwitchMaterial mShowWebFonts; private SwitchMaterial mShowWebFonts;
private SwitchMaterial mAllowAutoPlay; private SwitchMaterial mToolbarTheme;
private ArrayList<RadioButton> mImageOption; private ArrayList<RadioButton> mImageOption;
/*Initializations*/ /*Initializations*/
settingAdvanceViewController(settingAdvanceController pContext, eventObserver.eventListener pEvent, SwitchMaterial pRestoreTabs, SwitchMaterial pShowWebFonts, SwitchMaterial pAllowAutoPlay, ArrayList<RadioButton> pImageOption) settingAdvanceViewController(settingAdvanceController pContext, eventObserver.eventListener pEvent, SwitchMaterial pRestoreTabs, SwitchMaterial pShowWebFonts, SwitchMaterial pToolbarTheme, ArrayList<RadioButton> pImageOption)
{ {
this.mEvent = pEvent; this.mEvent = pEvent;
this.mContext = pContext; this.mContext = pContext;
this.mRestoreTabs = pRestoreTabs; this.mRestoreTabs = pRestoreTabs;
this.mShowWebFonts = pShowWebFonts; this.mShowWebFonts = pShowWebFonts;
this.mAllowAutoPlay = pAllowAutoPlay; this.mToolbarTheme = pToolbarTheme;
this.mImageOption = pImageOption; this.mImageOption = pImageOption;
initViews(); initViews();
@ -57,10 +57,10 @@ class settingAdvanceViewController
mShowWebFonts.setChecked(false); mShowWebFonts.setChecked(false);
} }
if(status.sAutoPlay){ if(status.sToolbarTheme){
mAllowAutoPlay.setChecked(true); mToolbarTheme.setChecked(true);
}else { }else {
mAllowAutoPlay.setChecked(false); mToolbarTheme.setChecked(false);
} }
clearImageOptions(); clearImageOptions();

View File

@ -50,6 +50,7 @@ public class settingClearController extends AppCompatActivity {
mCheckBoxList.add(findViewById(R.id.pClearChecked_7)); mCheckBoxList.add(findViewById(R.id.pClearChecked_7));
mCheckBoxList.add(findViewById(R.id.pClearChecked_8)); mCheckBoxList.add(findViewById(R.id.pClearChecked_8));
activityContextManager.getInstance().onStack(this);
mSettingClearViewController = new settingClearViewController(this, new settingClearController.settingClearViewCallback(), mCheckBoxList); mSettingClearViewController = new settingClearViewController(this, new settingClearController.settingClearViewCallback(), mCheckBoxList);
mSettingClearModel = new settingClearModel(new settingClearController.settingClearModelCallback()); mSettingClearModel = new settingClearModel(new settingClearController.settingClearModelCallback());
} }
@ -156,11 +157,12 @@ public class settingClearController extends AppCompatActivity {
@Override @Override
public void onBackPressed() { public void onBackPressed() {
finish(); onClose(null);
} }
/*UI Redirection*/ /*UI Redirection*/
public void onClose(View view){ public void onClose(View view){
activityContextManager.getInstance().onRemoveStack(this);
finish(); finish();
} }

View File

@ -51,13 +51,14 @@ public class settingGeneralController extends AppCompatActivity {
public void viewsInitializations() { public void viewsInitializations() {
mFullScreenMode = findViewById(R.id.pFullScreenMode); mFullScreenMode = findViewById(R.id.pJSStatus);
mThemeLight = findViewById(R.id.pThemeLight); mThemeLight = findViewById(R.id.pThemeLight);
mThemeDark = findViewById(R.id.pThemeDark); mThemeDark = findViewById(R.id.pThemeDark);
mThemeDefault = findViewById(R.id.pThemeDefault); mThemeDefault = findViewById(R.id.pThemeDefault);
mHomePageText = findViewById(R.id.pHomePageText); mHomePageText = findViewById(R.id.pHomePageText);
mOpenURLInNewTab = findViewById(R.id.pOpenURLInNewTab); mOpenURLInNewTab = findViewById(R.id.pOpenURLInNewTab);
activityContextManager.getInstance().onStack(this);
mSettingGeneralViewController = new settingGeneralViewController(this, new settingGeneralViewCallback(), mFullScreenMode, mThemeLight, mThemeDark, mThemeDefault, mHomePageText, mOpenURLInNewTab); mSettingGeneralViewController = new settingGeneralViewController(this, new settingGeneralViewCallback(), mFullScreenMode, mThemeLight, mThemeDark, mThemeDefault, mHomePageText, mOpenURLInNewTab);
mSettingGeneralModel = new settingGeneralModel(new settingGeneralModelCallback()); mSettingGeneralModel = new settingGeneralModel(new settingGeneralModelCallback());
} }
@ -93,14 +94,12 @@ public class settingGeneralController extends AppCompatActivity {
new Handler().postDelayed(() -> { new Handler().postDelayed(() -> {
overridePendingTransition(R.anim.fade_in, R.anim.fade_out); overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
activityContextManager.getInstance().getSettingController().applyTheme(); activityContextManager.getInstance().getSettingController().applyTheme();
activityContextManager.getInstance().getHomeController().applyTheme(); }, 100);
}, 150);
} }
return null; return null;
} }
} }
public class settingGeneralModelCallback implements eventObserver.eventListener{ public class settingGeneralModelCallback implements eventObserver.eventListener{
@Override @Override
@ -130,6 +129,7 @@ public class settingGeneralController extends AppCompatActivity {
@Override @Override
public void onBackPressed() { public void onBackPressed() {
activityContextManager.getInstance().onRemoveStack(this);
finish(); finish();
} }

View File

@ -38,6 +38,7 @@ public class settingLogController extends AppCompatActivity {
public void viewsInitializations() { public void viewsInitializations() {
mListView = findViewById(R.id.pListView); mListView = findViewById(R.id.pListView);
activityContextManager.getInstance().onStack(this);
mSettingLogViewController = new settingLogViewController(this, new settingLogViewCallback(), mListView); mSettingLogViewController = new settingLogViewController(this, new settingLogViewCallback(), mListView);
mSettingLogModel = new settingLogModel(new settingLogModelCallback()); mSettingLogModel = new settingLogModel(new settingLogModelCallback());
@ -85,6 +86,7 @@ public class settingLogController extends AppCompatActivity {
@Override @Override
public void onBackPressed() { public void onBackPressed() {
finish(); finish();
activityContextManager.getInstance().onRemoveStack(this);
} }
/*UI Redirection*/ /*UI Redirection*/

View File

@ -37,6 +37,7 @@ public class settingNotificationController extends AppCompatActivity {
} }
public void viewsInitializations() { public void viewsInitializations() {
activityContextManager.getInstance().onStack(this);
mNotificationManual = findViewById(R.id.pNotificationManual); mNotificationManual = findViewById(R.id.pNotificationManual);
mSettingNotificationViewController = new settingNotificationViewController(this, new settingNotificationViewCallback(), mNotificationManual); mSettingNotificationViewController = new settingNotificationViewController(this, new settingNotificationViewCallback(), mNotificationManual);
@ -88,6 +89,7 @@ public class settingNotificationController extends AppCompatActivity {
@Override @Override
public void onBackPressed() { public void onBackPressed() {
finish(); finish();
activityContextManager.getInstance().onRemoveStack(this);
} }
/*UI Redirection*/ /*UI Redirection*/

View File

@ -53,6 +53,7 @@ public class settingPrivacyController extends AppCompatActivity {
mCookie.add(findViewById(R.id.pCookieRadioOption3)); mCookie.add(findViewById(R.id.pCookieRadioOption3));
mCookie.add(findViewById(R.id.pCookieRadioOption4)); mCookie.add(findViewById(R.id.pCookieRadioOption4));
activityContextManager.getInstance().onStack(this);
mSettingPrivacyViewController = new settingPrivacyViewController(this, new settingPrivacyController.settingAccessibilityViewCallback(), mJavaScript, mDoNotTrack, mTrackingProtection, mClearDataOnExit, mCookie); mSettingPrivacyViewController = new settingPrivacyViewController(this, new settingPrivacyController.settingAccessibilityViewCallback(), mJavaScript, mDoNotTrack, mTrackingProtection, mClearDataOnExit, mCookie);
mSettingPrivacyModel = new settingPrivacyModel(new settingPrivacyController.settingAccessibilityModelCallback()); mSettingPrivacyModel = new settingPrivacyModel(new settingPrivacyController.settingAccessibilityModelCallback());
} }
@ -106,6 +107,7 @@ public class settingPrivacyController extends AppCompatActivity {
if(mSettingChanged){ if(mSettingChanged){
activityContextManager.getInstance().setCurrentActivity(this); activityContextManager.getInstance().setCurrentActivity(this);
} }
activityContextManager.getInstance().onRemoveStack(this);
finish(); finish();
} }

View File

@ -48,6 +48,7 @@ public class settingSearchController extends AppCompatActivity {
mSearchHistory = findViewById(R.id.pSearchHistory); mSearchHistory = findViewById(R.id.pSearchHistory);
mSearchSuggestions = findViewById(R.id.pSearchSuggestions); mSearchSuggestions = findViewById(R.id.pSearchSuggestions);
activityContextManager.getInstance().onStack(this);
mSettingSearchViewController = new settingSearchViewController(this, new settingSearchViewCallback(), mSearchEngines, mSearchHistory, mSearchSuggestions); mSettingSearchViewController = new settingSearchViewController(this, new settingSearchViewCallback(), mSearchEngines, mSearchHistory, mSearchSuggestions);
mSettingSearchModel = new settingSearchModel(new settingSearchModelCallback()); mSettingSearchModel = new settingSearchModel(new settingSearchModelCallback());
} }
@ -84,10 +85,10 @@ public class settingSearchController extends AppCompatActivity {
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SEARCH_HISTORY, status.sSettingSearchHistory)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SEARCH_HISTORY, status.sSettingSearchHistory));
} }
public void setSearchStatus(View view){ public void setSuggestionStatus(View view){
mSettingSearchModel.onTrigger(settingSearchEnums.eSearchModel.M_SET_SEARCH_HISTORY, Collections.singletonList(!mSearchSuggestions.isChecked())); mSettingSearchModel.onTrigger(settingSearchEnums.eSearchModel.M_SET_SEARCH_SUGGESTION_STATUS, Collections.singletonList(!mSearchSuggestions.isChecked()));
mSearchSuggestions.toggle(); mSearchSuggestions.toggle();
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SEARCH_SUGGESTION, status.getsSettingSearchSuggestion)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SEARCH_SUGGESTION, status.sSearchSuggestionStatus));
} }
public void onOpenInfo(View view) { public void onOpenInfo(View view) {
@ -132,6 +133,7 @@ public class settingSearchController extends AppCompatActivity {
@Override @Override
public void onBackPressed() { public void onBackPressed() {
activityContextManager.getInstance().onRemoveStack(this);
finish(); finish();
} }

View File

@ -4,7 +4,7 @@ class settingSearchEnums
{ {
/*History Manager*/ /*History Manager*/
public enum eSearchModel { public enum eSearchModel {
M_SET_SEARCH_ENGINE, M_SET_SEARCH_HISTORY, M_SET_SEARCH_STATUS M_SET_SEARCH_ENGINE, M_SET_SEARCH_HISTORY, M_SET_SEARCH_SUGGESTION_STATUS
} }
public enum eSearchViewController { public enum eSearchViewController {

View File

@ -27,8 +27,8 @@ class settingSearchModel
private void setSearchHistory(boolean pStatus){ private void setSearchHistory(boolean pStatus){
status.sSettingSearchHistory = pStatus; status.sSettingSearchHistory = pStatus;
} }
private void setSearchStatus(boolean pStatus){ private void setSearchSuggestionStatus(boolean pStatus){
status.getsSettingSearchSuggestion = pStatus; status.sSearchSuggestionStatus = pStatus;
} }
public Object onTrigger(settingSearchEnums.eSearchModel pCommands, List<Object> pData){ public Object onTrigger(settingSearchEnums.eSearchModel pCommands, List<Object> pData){
@ -39,9 +39,9 @@ class settingSearchModel
setSearchHistory((boolean) pData.get(0)); setSearchHistory((boolean) pData.get(0));
} }
else if(pCommands.equals(settingSearchEnums.eSearchModel.M_SET_SEARCH_STATUS)){ else if(pCommands.equals(settingSearchEnums.eSearchModel.M_SET_SEARCH_SUGGESTION_STATUS)){
setSearchStatus((boolean) pData.get(0)); setSearchSuggestionStatus((boolean) pData.get(0));
} }
return null; return null;
} }

View File

@ -68,7 +68,7 @@ class settingSearchViewController
if(status.sSettingSearchHistory){ if(status.sSettingSearchHistory){
mSearchHistory.setChecked(true); mSearchHistory.setChecked(true);
} }
if(status.getsSettingSearchSuggestion){ if(status.sSearchSuggestionStatus){
mSearchSuggestions.setChecked(true); mSearchSuggestions.setChecked(true);
} }
} }

View File

@ -9,6 +9,8 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.app.AppCompatDelegate;
import com.darkweb.genesissearchengine.appManager.activityContextManager; import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.helpManager.helpController; import com.darkweb.genesissearchengine.appManager.helpManager.helpController;
import com.darkweb.genesissearchengine.appManager.homeManager.homeController;
import com.darkweb.genesissearchengine.appManager.proxyStatusManager.proxyStatusController;
import com.darkweb.genesissearchengine.appManager.settingManager.accessibilityManager.settingAccessibilityController; import com.darkweb.genesissearchengine.appManager.settingManager.accessibilityManager.settingAccessibilityController;
import com.darkweb.genesissearchengine.appManager.settingManager.advanceManager.settingAdvanceController; import com.darkweb.genesissearchengine.appManager.settingManager.advanceManager.settingAdvanceController;
import com.darkweb.genesissearchengine.appManager.settingManager.clearManager.settingClearController; import com.darkweb.genesissearchengine.appManager.settingManager.clearManager.settingClearController;
@ -28,6 +30,7 @@ import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.pluginManager.pluginController; import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.example.myapplication.R; import com.example.myapplication.R;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.List; import java.util.List;
import static com.darkweb.genesissearchengine.constants.enums.eMessageEnums.M_NOT_SUPPORTED; import static com.darkweb.genesissearchengine.constants.enums.eMessageEnums.M_NOT_SUPPORTED;
@ -59,6 +62,7 @@ public class settingController extends AppCompatActivity
public void onInitTheme(){ public void onInitTheme(){
status.mThemeApplying = true;
if(status.sTheme == enums.Theme.THEME_DARK){ if(status.sTheme == enums.Theme.THEME_DARK){
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
}else if(status.sTheme == enums.Theme.THEME_LIGHT){ }else if(status.sTheme == enums.Theme.THEME_LIGHT){
@ -99,13 +103,14 @@ public class settingController extends AppCompatActivity
} }
} }
@Override @Override
public void onResume() public void onResume()
{ {
activityContextManager.getInstance().setCurrentActivity(this); activityContextManager.getInstance().setCurrentActivity(this);
status.sSettingIsAppPaused = false; status.sSettingIsAppPaused = false;
onInitTheme(); onInitTheme();
activityContextManager.getInstance().onStack(this);
super.onResume(); super.onResume();
} }
@ -118,6 +123,7 @@ public class settingController extends AppCompatActivity
@Override @Override
public void onBackPressed(){ public void onBackPressed(){
activityContextManager.getInstance().onRemoveStack(this);
finish(); finish();
} }
@ -167,6 +173,24 @@ public class settingController extends AppCompatActivity
helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true); helperMethod.openActivity(helpController.class, constants.CONST_LIST_HISTORY, this,true);
} }
public void onReportWebsite(View view) {
pluginController.getInstance().MessageManagerHandler(this, Collections.singletonList(activityContextManager.getInstance().getHomeController().onGetCurrentURL()),enums.eMessageEnums.M_REPORT_URL);
}
public void onRateApplication(View view) {
pluginController.getInstance().MessageManagerHandler(this, Collections.singletonList(activityContextManager.getInstance().getHomeController().onGetCurrentURL()),enums.eMessageEnums.M_RATE_APP);
status.sSettingIsAppRated = true;
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.PROXY_IS_APP_RATED,true));
}
public void onShareApplication(View view) {
helperMethod.shareApp(this);
}
public void onOpenProxyStatus(View view) {
helperMethod.openActivity(proxyStatusController.class, constants.CONST_LIST_HISTORY, this,true);
}
/*Event Observer*/ /*Event Observer*/
public class settingViewCallback implements eventObserver.eventListener{ public class settingViewCallback implements eventObserver.eventListener{

View File

@ -1,18 +1,24 @@
package com.darkweb.genesissearchengine.appManager.tabManager; package com.darkweb.genesissearchengine.appManager.tabManager;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.activityContextManager; import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.helperManager.TopCropImageView; import com.darkweb.genesissearchengine.helperManager.TopCropImageView;
import com.darkweb.genesissearchengine.helperManager.eventObserver; import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.example.myapplication.R; import com.example.myapplication.R;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -23,21 +29,35 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
{ {
/*Private Variables*/ /*Private Variables*/
private ArrayList<tabRowModel> mModelList; private ArrayList<tabRowModel> mModelList = new ArrayList<>();
private eventObserver.eventListener mEvent; private eventObserver.eventListener mEvent;
private ArrayList<String> mSelectedList = new ArrayList<>(); private ArrayList<String> mSelectedList = new ArrayList<>();
private Boolean mLongPressMenuEnabled = false;
tabAdapter(ArrayList<tabRowModel> model_list, eventObserver.eventListener event) {
this.mModelList = model_list; tabAdapter(ArrayList<tabRowModel> pModelList, eventObserver.eventListener event) {
this.mModelList.addAll(pModelList);
mModelList.add(new tabRowModel(null, null,null));
this.mEvent = event; this.mEvent = event;
}
private void reInitData(ArrayList<tabRowModel> pModelList){
for(int mCounter=0;mCounter<pModelList.size();mCounter++){
mModelList.add(0,pModelList.get(mCounter));
}
notifyItemRangeInserted(0, pModelList.size());
notifyItemChanged(pModelList.size());
}
public void initFirstRow(){
notifyItemChanged(0);
} }
/*Initializations*/ /*Initializations*/
@NonNull @Override @NonNull @Override
public listViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public listViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.tabview_row, parent, false); View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.tab_row_view, parent, false);
return new listViewHolder(view); return new listViewHolder(view);
} }
@ -57,29 +77,75 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
/*Listeners*/ /*Listeners*/
private int getSelectedListSize(){ private boolean isSelectionMenuShowing(){
return mSelectedList.size(); return mLongPressMenuEnabled;
} }
private void onRemoveAllSelection() { private void onRemoveAllSelection() {
mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_CLEAR_TAB_BACKUP); if(mSelectedList!=null && mSelectedList.size()>0){
for(int mCounter=0;mCounter<mModelList.size();mCounter++){ for(int mCounter=0;mCounter<mSelectedList.size();mCounter++){
if(mSelectedList.contains(mModelList.get(mCounter).getSession().getSessionID())){ for(int mCounterInner=0;mCounterInner<mModelList.size();mCounterInner++){
mSelectedList.remove((String) mModelList.get(mCounter).getSession().getSessionID()); if(mSelectedList.get(mCounter).equals(mModelList.get(mCounterInner).getmId())){
mEvent.invokeObserver(Collections.singletonList(mCounter), tabEnums.eTabAdapterCallback.ON_REMOVE_TAB); mSelectedList.remove(mCounter);
notifyItemRemoved(mCounter); mModelList.remove(mCounterInner);
mCounter-=1; notifyItemRemoved(mCounterInner);
notifyItemRangeChanged(mCounterInner,mModelList.size());
mEvent.invokeObserver(Collections.singletonList(mCounterInner), tabEnums.eTabAdapterCallback.ON_REMOVE_TAB_VIEW_RETAIN_BACKUP);
mCounter=-1;
break;
}
}
} }
mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_SHOW_UNDO_DIALOG);
} }
} }
private void onNotifyItemSwiped(int pIndex){
for(int mCounter=0;mCounter<mSelectedList.size();mCounter++){
if(mSelectedList.get(mCounter).equals(mModelList.get(pIndex).getmId())){
mSelectedList.remove(mCounter);
break;
}
}
mModelList.remove(pIndex);
notifyItemRemoved(pIndex);
notifyItemRangeChanged(pIndex, mModelList.size());
notifyItemChanged(mModelList.size()-1);
}
private void onClearAllSelection(){ private void onClearAllSelection(){
mSelectedList.clear(); mEvent.invokeObserver(Arrays.asList(false, mSelectedList.size()), tabEnums.eTabAdapterCallback.ON_SHOW_SELECTION_MENU);
notifyDataSetChanged();
for(int mCounter=0;mCounter<mSelectedList.size();mCounter++){
boolean mIsChanged = false;
for(int mCounterInner=0;mCounterInner<mModelList.size();mCounterInner++){
if(mSelectedList.get(mCounter).equals(mModelList.get(mCounterInner).getmId())){
notifyItemChanged(mCounterInner, null);
mIsChanged = true;
}
}
if(mIsChanged){
mSelectedList.remove(mCounter);
mCounter=mCounter-1;
}
}
if(mSelectedList.size()<=0){
mEvent.invokeObserver(Arrays.asList(true, mSelectedList.size()), tabEnums.eTabAdapterCallback.ON_HIDE_SELECTION);
}else{
mEvent.invokeObserver(Arrays.asList(true, mSelectedList.size()), tabEnums.eTabAdapterCallback.ON_SHOW_SELECTION_MENU);
}
notifyItemChanged(mModelList.size()-1);
}
public void onEnableLongClickMenu(){
mLongPressMenuEnabled = true;
} }
private void onSelectionCreate(FrameLayout mSelectedView){ private void onSelectionCreate(FrameLayout mSelectedView){
mSelectedView.setAlpha(0);
mSelectedView.setVisibility(View.VISIBLE); mSelectedView.setVisibility(View.VISIBLE);
mSelectedView.animate().alpha(1); mSelectedView.animate().alpha(1);
mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_SHOW_SELECTION); mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_SHOW_SELECTION);
@ -108,6 +174,10 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
ImageButton mRemoveRow; ImageButton mRemoveRow;
TopCropImageView mWebThumbnail; TopCropImageView mWebThumbnail;
FrameLayout mSelectedView; FrameLayout mSelectedView;
FrameLayout mItemSelectionMenu;
Button mItemSelectionMenuButton;
ConstraintLayout mItemSelectionMenuReference;
ImageView mBorder;
listViewHolder(View itemView) { listViewHolder(View itemView) {
super(itemView); super(itemView);
@ -121,35 +191,82 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
mWebThumbnail = itemView.findViewById(R.id.pWebThumbnail); mWebThumbnail = itemView.findViewById(R.id.pWebThumbnail);
mDate = itemView.findViewById(R.id.pDate); mDate = itemView.findViewById(R.id.pDate);
mSelectedView = itemView.findViewById(R.id.pSelectedView); mSelectedView = itemView.findViewById(R.id.pSelectedView);
mItemSelectionMenu = itemView.findViewById(R.id.pItemSelectionMenu);
mItemSelectionMenuButton = itemView.findViewById(R.id.pItemSelectionMenuButton);
mItemSelectionMenuReference = itemView.findViewById(R.id.pRowContainer);
mBorder = itemView.findViewById(R.id.pBorder);
mHeader.setText(model.getSession().getTitle()); if(model.getmId()==null){
mDescription.setText(model.getSession().getCurrentURL()); mItemSelectionMenu.setVisibility(View.VISIBLE);
mDate.setText(model.getDate()); mItemSelectionMenuButton.setOnClickListener(this);
mWebThumbnail.setImageBitmap(model.getBitmap());
if(mSelectedList.contains(model.getSession().getSessionID())){
onSelectionCreate(mSelectedView);
}else { }else {
onSelectionClear(mSelectedView); if(model.getSession().getTheme()==null){
mBorder.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.c_border_background_divider));
}else {
try{
mBorder.setBackgroundColor(Color.parseColor(model.getSession().getTheme()));
}catch (Exception ignored){}
}
mItemSelectionMenu.setVisibility(View.GONE);
if(model.getSession().getTitle().equals("$TITLE") || model.getSession().getTitle().toLowerCase().equals("loading")){
mHeader.setText(helperMethod.getDomainName(model.getSession().getCurrentURL()));
}else {
mHeader.setText(model.getSession().getTitle());
}
mDescription.setText(model.getSession().getCurrentURL());
mDate.setText(model.getDate());
mWebThumbnail.setImageBitmap(model.getBitmap());
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));
}else {
Drawable mDrawable;
Resources res = itemView.getContext().getResources();
try {
mDrawable = Drawable.createFromXml(res, res.getXml(R.xml.hx_border));
itemView.setBackground(mDrawable);
} catch (Exception ignored) {
}
}
mLoadSession.setOnLongClickListener(this);
mRemoveRow.setOnClickListener(this);
mLoadSession.setOnClickListener(this);
} }
if(model.getSession().equals(mModelList.get(0).getSession())){ mItemSelectionMenuReference.animate().cancel();
itemView.setBackgroundColor(ContextCompat.getColor(activityContextManager.getInstance().getTabController(), R.color.c_list_item_current)); if(this.getLayoutPosition()==mModelList.size()-1){
if(mSelectedList.size()>0){
itemView.setVisibility(View.GONE);
mLongPressMenuEnabled = true;
}else {
itemView.setVisibility(View.VISIBLE);
mLongPressMenuEnabled = false;
}
}else {
itemView.setVisibility(View.VISIBLE);
mLongPressMenuEnabled = false;
} }
mLoadSession.setOnLongClickListener(this);
mRemoveRow.setOnClickListener(this);
mLoadSession.setOnClickListener(this);
} }
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if(v.getId() == R.id.pLoadSession){ if(v.getId() == R.id.pLoadSession){
if(mSelectedView.getVisibility() == View.GONE){ if(mSelectedView.getVisibility() == View.GONE){
if(mSelectedList.size()>0){ if(mLongPressMenuEnabled){
mSelectedList.add(mModelList.get(this.getLayoutPosition()).getSession().getSessionID()); mSelectedList.add(mModelList.get(this.getLayoutPosition()).getSession().getSessionID());
mEvent.invokeObserver(Arrays.asList(true, mSelectedList.size()), tabEnums.eTabAdapterCallback.ON_SHOW_SELECTION_MENU);
onSelectionCreate(mSelectedView); onSelectionCreate(mSelectedView);
notifyItemChanged(mModelList.size()-1);
}else { }else {
onTriggerURL(mModelList.get(this.getLayoutPosition())); onTriggerURL(mModelList.get(this.getLayoutPosition()));
} }
@ -157,14 +274,35 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
for(int mCounter=0;mCounter<mSelectedList.size();mCounter++){ for(int mCounter=0;mCounter<mSelectedList.size();mCounter++){
if(mSelectedList.get(mCounter).equals(mModelList.get(this.getLayoutPosition()).getSession().getSessionID())){ if(mSelectedList.get(mCounter).equals(mModelList.get(this.getLayoutPosition()).getSession().getSessionID())){
mSelectedList.remove(mCounter); mSelectedList.remove(mCounter);
if(mSelectedList.size()<=0){
mEvent.invokeObserver(Arrays.asList(true, mSelectedList.size()), tabEnums.eTabAdapterCallback.ON_HIDE_SELECTION);
onClearAllSelection();
}else{
mEvent.invokeObserver(Arrays.asList(true, mSelectedList.size()), tabEnums.eTabAdapterCallback.ON_SHOW_SELECTION_MENU);
}
} }
} }
onSelectionClear(mSelectedView); onSelectionClear(mSelectedView);
notifyItemChanged(mModelList.size()-1);
} }
}else if(v.getId() == R.id.pRemoveRow){ }else if(v.getId() == R.id.pRemoveRow){
mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_CLEAR_TAB_BACKUP); for(int mCounter=0;mCounter<mSelectedList.size();mCounter++){
if(mSelectedList.get(mCounter).equals(mModelList.get(this.getLayoutPosition()).getmId())){
mSelectedList.remove(mCounter);
break;
}
}
mModelList.remove(this.getLayoutPosition());
notifyItemRemoved(this.getLayoutPosition());
notifyItemChanged(mModelList.size()-1);
notifyItemRangeChanged(this.getLayoutPosition(), mModelList.size());
mEvent.invokeObserver(Collections.singletonList(this.getLayoutPosition()), tabEnums.eTabAdapterCallback.ON_REMOVE_TAB_VIEW); mEvent.invokeObserver(Collections.singletonList(this.getLayoutPosition()), tabEnums.eTabAdapterCallback.ON_REMOVE_TAB_VIEW);
} }
else if(v.getId() == R.id.pItemSelectionMenuButton){
onEnableLongClickMenu();
mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_SHOW_SELECTION);
}
} }
@Override @Override
@ -173,9 +311,10 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
if(mSelectedView.getVisibility() == View.GONE){ if(mSelectedView.getVisibility() == View.GONE){
mSelectedList.add(mModelList.get(this.getLayoutPosition()).getSession().getSessionID()); mSelectedList.add(mModelList.get(this.getLayoutPosition()).getSession().getSessionID());
onSelectionCreate(mSelectedView); onSelectionCreate(mSelectedView);
notifyItemChanged(mModelList.size()-1);
mEvent.invokeObserver(Arrays.asList(false, mSelectedList.size()), tabEnums.eTabAdapterCallback.ON_SHOW_SELECTION_MENU);
}else { }else {
mSelectedList.remove(this.getLayoutPosition()); v.performClick();
onSelectionClear(mSelectedView);
} }
mLoadSession.setPressed(false); mLoadSession.setPressed(false);
} }
@ -183,13 +322,21 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
} }
} }
public Object onTrigger(tabEnums.eTabModelCommands pCommands, List<Object> pData){ public Object onTrigger(tabEnums.eTabAdapterCommands pCommands, List<Object> pData){
if(pCommands.equals(tabEnums.eTabModelCommands.M_SELECTED_LIST_SIZE)){ if(pCommands.equals(tabEnums.eTabAdapterCommands.M_SELECTION_MENU_SHOWING)){
return getSelectedListSize(); return isSelectionMenuShowing();
}else if(pCommands.equals(tabEnums.eTabModelCommands.M_REMOVE_ALL_SELECTION)){ }else if(pCommands.equals(tabEnums.eTabAdapterCommands.M_REMOVE_ALL_SELECTION)){
onRemoveAllSelection(); onRemoveAllSelection();
}else if(pCommands.equals(tabEnums.eTabModelCommands.M_CLEAR_ALL_SELECTION)){ }else if(pCommands.equals(tabEnums.eTabAdapterCommands.M_CLEAR_ALL_SELECTION)){
onClearAllSelection(); onClearAllSelection();
}else if(pCommands.equals(tabEnums.eTabAdapterCommands.ENABLE_LONG_CLICK_MENU)){
onEnableLongClickMenu();
}else if(pCommands.equals(tabEnums.eTabAdapterCommands.INIT_FIRST_ROW)){
initFirstRow();
}else if(pCommands.equals(tabEnums.eTabAdapterCommands.REINIT_DATA)){
reInitData((ArrayList<tabRowModel>)pData.get(0));
}else if(pCommands.equals(tabEnums.eTabAdapterCommands.NOTIFY_sWIPE)){
onNotifyItemSwiped((int)pData.get(0));
} }
return null; return null;
} }

View File

@ -2,16 +2,20 @@ package com.darkweb.genesissearchengine.appManager.tabManager;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.view.View; import android.view.View;
import android.view.WindowManager;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.ItemTouchHelper; import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.SimpleItemAnimator;
import com.darkweb.genesissearchengine.appManager.activityContextManager; import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.homeManager.geckoSession; import com.darkweb.genesissearchengine.appManager.homeManager.geckoSession;
import com.darkweb.genesissearchengine.appManager.homeManager.homeController; import com.darkweb.genesissearchengine.appManager.homeManager.homeController;
@ -26,14 +30,14 @@ import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod; import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.pluginManager.pluginController; import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.example.myapplication.R; import com.example.myapplication.R;
import com.google.android.gms.ads.AdSize;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import jp.wasabeef.recyclerview.animators.FadeInRightAnimator;
public class tabController extends AppCompatActivity public class tabController extends AppCompatActivity
{ {
/*Private Views*/ /*Private Views*/
@ -43,6 +47,8 @@ public class tabController extends AppCompatActivity
private ImageButton mMenuButton; private ImageButton mMenuButton;
private ImageButton mClearSelection; private ImageButton mClearSelection;
private View mPopupUndo; private View mPopupUndo;
private TextView mSelectionCount;
private ImageView mBlocker;
/*Private Variables*/ /*Private Variables*/
@ -60,13 +66,18 @@ public class tabController extends AppCompatActivity
pluginController.getInstance().onCreate(this); pluginController.getInstance().onCreate(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.tab_view); setContentView(R.layout.tab_view);
initializeListModel(); }
@Override
protected void onStart() {
super.onStart();
initializeActivity();
initializeViews(); initializeViews();
initializeList(); initializeList();
initSwipe(); initSwipe();
} }
public void initializeListModel(){ public void initializeActivity(){
mListModel = new tabModel(); mListModel = new tabModel();
mListModel.setList((ArrayList<tabRowModel>)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TAB, null)); mListModel.setList((ArrayList<tabRowModel>)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TAB, null));
mContextManager = activityContextManager.getInstance(); mContextManager = activityContextManager.getInstance();
@ -83,8 +94,10 @@ public class tabController extends AppCompatActivity
mMenuButton = findViewById(R.id.pMenuButton); mMenuButton = findViewById(R.id.pMenuButton);
mClearSelection = findViewById(R.id.pClearSelection); mClearSelection = findViewById(R.id.pClearSelection);
mPopupUndo = findViewById(R.id.pPopupUndo); mPopupUndo = findViewById(R.id.pPopupUndo);
mSelectionCount = findViewById(R.id.pSelectionCount);
mBlocker = findViewById(R.id.pBlocker);
mtabViewController = new tabViewController(this, mTabs, mRemoveSelection, mTabsContainer, mMenuButton, mClearSelection, mPopupUndo); mtabViewController = new tabViewController(this, mTabs, mRemoveSelection, mTabsContainer, mMenuButton, mClearSelection, mPopupUndo, mSelectionCount, mBlocker);
} }
public void initializeList(){ public void initializeList(){
@ -93,11 +106,7 @@ public class tabController extends AppCompatActivity
mTabAdapter = adapter; mTabAdapter = adapter;
layoutManager.setReverseLayout(true); layoutManager.setReverseLayout(true);
mRecycleView.setItemAnimator(new FadeInRightAnimator()); ((SimpleItemAnimator) Objects.requireNonNull(mRecycleView.getItemAnimator())).setSupportsChangeAnimations(false);
Objects.requireNonNull(mRecycleView.getItemAnimator()).setAddDuration(200);
mRecycleView.getItemAnimator().setRemoveDuration(200);
mRecycleView.getItemAnimator().setMoveDuration(200);
mRecycleView.getItemAnimator().setChangeDuration(450);
mRecycleView.setAdapter(adapter); mRecycleView.setAdapter(adapter);
mRecycleView.setItemViewCacheSize(100); mRecycleView.setItemViewCacheSize(100);
@ -107,7 +116,6 @@ public class tabController extends AppCompatActivity
mRecycleView.setDrawingCacheEnabled(true); mRecycleView.setDrawingCacheEnabled(true);
mRecycleView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH); mRecycleView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
mRecycleView.setLayoutManager(new LinearLayoutManager(tabController.this)); mRecycleView.setLayoutManager(new LinearLayoutManager(tabController.this));
mTabAdapter.notifyDataSetChanged();
} }
/*Listeners*/ /*Listeners*/
@ -123,7 +131,8 @@ public class tabController extends AppCompatActivity
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) { public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
int position = viewHolder.getAdapterPosition(); int position = viewHolder.getAdapterPosition();
onClearTabBackup(); onClearTabBackup();
onRemoveView(position); onInitRemoveView(position, true);
mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.NOTIFY_sWIPE, Collections.singletonList(position));
} }
@Override @Override
@ -137,24 +146,23 @@ public class tabController extends AppCompatActivity
} }
/*View Handlers*/ /*View Handlers*/
public void onBackPressedInvoked(View view) {
onBackPressed();
}
public void onRemoveTab(int pIndex){ public void onRemoveTab(int pIndex){
mListModel.onRemoveTab(pIndex); mListModel.onRemoveTab(pIndex);
if(mListModel.getList().size()<1){
mRecycleView.animate().setStartDelay(150).alpha(0);
}
initTabCount(); initTabCount();
mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.INIT_FIRST_ROW, null);
} }
public void onClearTabBackup(){ public void onInitRemoveView(int pIndex, boolean pCreateBackup){
mListModel.onClearBackup();
}
public void onRemoveView(int pIndex){
onRemoveTab(pIndex); onRemoveTab(pIndex);
mListModel.getList().remove(pIndex);
mTabAdapter.notifyItemRemoved(pIndex);
onShowUndoDialog(); onShowUndoDialog();
if(mListModel.onGetBackup().size()>=mListModel.getList().size()){
mRecycleView.animate().setStartDelay(0).alpha(0);
}
initTabCount();
mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.INIT_FIRST_ROW, null);
} }
public void initTabCount() public void initTabCount()
@ -178,15 +186,27 @@ public class tabController extends AppCompatActivity
} }
public void onRestoreTab(View view){ public void onRestoreTab(View view){
int mSize = mListModel.onLoadBackup(); ArrayList<tabRowModel> mBackup = mListModel.onLoadBackup();
mTabAdapter.notifyItemRangeInserted(0, mSize); mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.REINIT_DATA, Collections.singletonList(mBackup));
mListModel.onClearBackupWithoutClose();
initTabCount(); initTabCount();
mRecycleView.animate().cancel();
mRecycleView.animate().alpha(1);
} }
public void onShowUndoDialog(){ public void onShowUndoDialog(){
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_SHOW_UNDO_DIALOG, null); mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_SHOW_UNDO_DIALOG, null);
} }
public void onClearTabBackup(){
ArrayList<tabRowModel> mBackupIndex = mListModel.onGetBackup();
for(int mCounter=0;mCounter<mBackupIndex.size();mCounter++){
dataController.getInstance().invokeTab(dataEnums.eTabCommands.CLOSE_TAB, Collections.singletonList(mBackupIndex.get(mCounter).getSession()));
mBackupIndex.get(mCounter).getSession().closeSession();
}
}
public void onTabRowChanged(String pId){ public void onTabRowChanged(String pId){
for(int mCounter=0; mCounter<mListModel.getList().size();mCounter++){ for(int mCounter=0; mCounter<mListModel.getList().size();mCounter++){
if(mListModel.getList().get(mCounter).getSession().getSessionID().equals(pId)){ if(mListModel.getList().get(mCounter).getSession().getSessionID().equals(pId)){
@ -202,12 +222,21 @@ public class tabController extends AppCompatActivity
} }
public void onRemoveSelection(View view) { public void onRemoveSelection(View view) {
mTabAdapter.onTrigger(tabEnums.eTabModelCommands.M_REMOVE_ALL_SELECTION, null); mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.M_REMOVE_ALL_SELECTION, null);
onShowUndoDialog();
} }
public void onClearSelection(View view) { public void onClearSelection(View view) {
mTabAdapter.onTrigger(tabEnums.eTabModelCommands.M_CLEAR_ALL_SELECTION, null); mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.M_CLEAR_ALL_SELECTION, null);
}
public void onTriggerSelected(View view){
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_SHOW_SELECTION, null);
}
public void onBackPressedInvoked(View view) {
mTabs.setPressed(true);
onBackPressed();
activityContextManager.getInstance().onRemoveStack(this);
} }
/*Tab Menu*/ /*Tab Menu*/
@ -219,7 +248,7 @@ public class tabController extends AppCompatActivity
else if(pView.getId() == R.id.pCloseTab){ else if(pView.getId() == R.id.pCloseTab){
mtabViewController.onTrigger(tabEnums.eTabViewCommands.M_DISMISS_MENU, null); mtabViewController.onTrigger(tabEnums.eTabViewCommands.M_DISMISS_MENU, null);
for(int mCounter=0;mCounter<mListModel.getList().size();mCounter++){ for(int mCounter=0;mCounter<mListModel.getList().size();mCounter++){
onRemoveView(mCounter); onInitRemoveView(mCounter, true);
mCounter-=1; mCounter-=1;
} }
} }
@ -244,11 +273,13 @@ public class tabController extends AppCompatActivity
{ {
activityContextManager.getInstance().setCurrentActivity(this); activityContextManager.getInstance().setCurrentActivity(this);
status.sSettingIsAppPaused = false; status.sSettingIsAppPaused = false;
activityContextManager.getInstance().onStack(this);
super.onResume(); super.onResume();
} }
@Override @Override
public void onStop() { public void onStop() {
onBackPressed();
super.onStop(); super.onStop();
} }
@ -256,13 +287,15 @@ public class tabController extends AppCompatActivity
public void onPause() public void onPause()
{ {
status.sSettingIsAppPaused = true; status.sSettingIsAppPaused = true;
onBackPressed();
super.onPause(); super.onPause();
} }
@Override @Override
public void onBackPressed() { public void onBackPressed() {
int mSize = (Integer) mTabAdapter.onTrigger(tabEnums.eTabModelCommands.M_SELECTED_LIST_SIZE, null); boolean mStatus = (boolean) mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.M_SELECTION_MENU_SHOWING, null);
if(mSize>0){ if(mStatus){
onClearTabBackup();
onClearSelection(null); onClearSelection(null);
}else { }else {
super.onBackPressed(); super.onBackPressed();
@ -281,7 +314,7 @@ public class tabController extends AppCompatActivity
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_HIDE_SELECTION, null); mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_HIDE_SELECTION, null);
} }
else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_SHOW_SELECTION)){ else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_SHOW_SELECTION)){
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_SHOW_SELECTION, null); onTriggerSelected(null);
} }
else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_CLEAR_TAB_BACKUP)){ else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_CLEAR_TAB_BACKUP)){
onClearTabBackup(); onClearTabBackup();
@ -300,8 +333,18 @@ public class tabController extends AppCompatActivity
} }
else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_REMOVE_TAB_VIEW)){ else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_REMOVE_TAB_VIEW)){
onClearTabBackup(); onClearTabBackup();
onRemoveView((Integer) data.get(0)); onInitRemoveView((Integer) data.get(0), true);
} }
else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_REMOVE_TAB_VIEW_RETAIN_BACKUP)){
onInitRemoveView((Integer) data.get(0), false);
}
else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_SHOW_UNDO_DIALOG)){
onShowUndoDialog();
}
else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_SHOW_SELECTION_MENU)){
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_SHOW_SELECTION_MENU, data);
}
return null; return null;
} }
} }

View File

@ -4,15 +4,15 @@ public class tabEnums
{ {
/*Settings Manager*/ /*Settings Manager*/
public enum eTabViewCommands { public enum eTabViewCommands {
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 M_DISMISS_MENU, M_SHOW_MENU, INIT_TAB_COUNT, ON_HIDE_SELECTION, ON_SHOW_SELECTION, ON_SHOW_SELECTION_MENU, ON_SHOW_UNDO_DIALOG, ON_HIDE_UNDO_DIALOG, ON_GENERATE_SWIPABLE_BACKGROUND
} }
public enum eTabModelCommands { public enum eTabAdapterCommands {
M_SELECTED_LIST_SIZE, M_REMOVE_ALL_SELECTION, M_CLEAR_ALL_SELECTION M_SELECTION_MENU_SHOWING, M_REMOVE_ALL_SELECTION, M_CLEAR_ALL_SELECTION, ENABLE_LONG_CLICK_MENU, INIT_FIRST_ROW, REINIT_DATA, NOTIFY_sWIPE
} }
public enum eTabAdapterCallback { 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 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,ON_REMOVE_TAB_VIEW_RETAIN_BACKUP, ON_SHOW_UNDO_DIALOG, ON_SHOW_SELECTION_MENU
} }
} }

View File

@ -24,20 +24,19 @@ class tabModel
mBackupIndex.add(mModelList.get(pIndex)); mBackupIndex.add(mModelList.get(pIndex));
} }
public void onClearBackup(){ public ArrayList<tabRowModel> onGetBackup(){
for(int mCounter=0;mCounter<mBackupIndex.size();mCounter++){ return mBackupIndex;
mBackupIndex.get(mCounter).getSession().closeSession(); }
}
public void onClearBackupWithoutClose(){
mBackupIndex.clear(); mBackupIndex.clear();
} }
public int onLoadBackup(){ public ArrayList<tabRowModel> onLoadBackup(){
int mSize = mBackupIndex.size();
for(int mCounter=0;mCounter<mBackupIndex.size();mCounter++){ for(int mCounter=0;mCounter<mBackupIndex.size();mCounter++){
mModelList.add(0,mBackupIndex.remove(mBackupIndex.size()-1)); mModelList.add(0,mBackupIndex.get(mCounter));
mCounter-=1;
} }
return mSize; return mBackupIndex;
} }
} }

View File

@ -49,11 +49,12 @@ public class tabRowModel
return mSession; return mSession;
} }
public void setSession(geckoSession pSession, String pURL, String pTitle) public void setSession(geckoSession pSession, String pURL, String pTitle, String pTheme)
{ {
mSession = pSession; mSession = pSession;
mSession.setTitle(pTitle); mSession.setTitle(pTitle);
mSession.setURL(pURL); mSession.setURL(pURL);
mSession.setTheme(pTheme);
} }
public String getmId() { public String getmId() {

View File

@ -11,24 +11,24 @@ import android.graphics.drawable.ColorDrawable;
import android.os.Build; import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ActionMenuView; import android.widget.ActionMenuView;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.PopupWindow; import android.widget.PopupWindow;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.ItemTouchHelper; import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.RecyclerView; 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.constants.strings;
import com.darkweb.genesissearchengine.dataManager.dataController; import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums; import com.darkweb.genesissearchengine.dataManager.dataEnums;
@ -48,6 +48,8 @@ class tabViewController
private ImageButton mMenuButton; private ImageButton mMenuButton;
private ImageButton mClearSelection; private ImageButton mClearSelection;
private View mToastLayoutRoot; private View mToastLayoutRoot;
private TextView mSelectionCount;
private ImageView mBlocker;
/*Private Local Variables*/ /*Private Local Variables*/
private Handler mDelayHandler = new Handler(); private Handler mDelayHandler = new Handler();
@ -55,7 +57,7 @@ class tabViewController
/*Initializations*/ /*Initializations*/
tabViewController(AppCompatActivity mContext, Button pTabs, ImageView pRemoveSelection, LinearLayout pTabsContainer, ImageButton pMenuButton, ImageButton pClearSelection, View pToastLayoutRoot) tabViewController(AppCompatActivity mContext, Button pTabs, ImageView pRemoveSelection, LinearLayout pTabsContainer, ImageButton pMenuButton, ImageButton pClearSelection, View pToastLayoutRoot, TextView pSelectionCount, ImageView pBlocker)
{ {
this.mContext = mContext; this.mContext = mContext;
this.mTabs = pTabs; this.mTabs = pTabs;
@ -64,15 +66,27 @@ class tabViewController
this.mMenuButton = pMenuButton; this.mMenuButton = pMenuButton;
this.mClearSelection = pClearSelection; this.mClearSelection = pClearSelection;
this.mToastLayoutRoot = pToastLayoutRoot; this.mToastLayoutRoot = pToastLayoutRoot;
this.mSelectionCount = pSelectionCount;
this.mBlocker = pBlocker;
initPostUI(); initPostUI();
initUI(); initUI();
onHoldInteraction();
} }
private void initUI(){ private void initUI(){
initTabCount(); initTabCount();
} }
@SuppressLint("ClickableViewAccessibility")
public void onHoldInteraction(){
final Handler handler = new Handler();
handler.postDelayed(() ->
{
mBlocker.setVisibility(View.GONE);
}, 350);
}
private void initTabCount(){ private void initTabCount(){
mTabs.setText((((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null))+ strings.GENERIC_EMPTY_STR)); mTabs.setText((((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null))+ strings.GENERIC_EMPTY_STR));
} }
@ -114,14 +128,28 @@ class tabViewController
} }
} }
private void onShowSelectionMenu() { private void onShowSelection() {
mRemoveSelection.setVisibility(View.VISIBLE); if(mSelectionCount.getVisibility() == View.GONE){
mClearSelection.setVisibility(View.VISIBLE); mSelectionCount.setText(0 + " Selected");
}
mTabsContainer.setVisibility(View.GONE); mTabsContainer.setVisibility(View.GONE);
mMenuButton.setVisibility(View.GONE); mMenuButton.setVisibility(View.GONE);
mSelectionCount.setVisibility(View.VISIBLE);
mClearSelection.setVisibility(View.VISIBLE);
}
private void onShowSelectionMenu(boolean pStatus, int pCount) {
if(pStatus || pCount>0){
mRemoveSelection.setVisibility(View.VISIBLE);
}else {
mRemoveSelection.setVisibility(View.GONE);
}
mSelectionCount.setText(pCount + " Selected");
} }
private void onHideSelectionMenu() { private void onHideSelectionMenu() {
mSelectionCount.setVisibility(View.GONE);
mRemoveSelection.setVisibility(View.GONE); mRemoveSelection.setVisibility(View.GONE);
mClearSelection.setVisibility(View.GONE); mClearSelection.setVisibility(View.GONE);
mTabsContainer.setVisibility(View.VISIBLE); mTabsContainer.setVisibility(View.VISIBLE);
@ -136,7 +164,7 @@ class tabViewController
initTabCount(); initTabCount();
mDelayHandler.removeCallbacksAndMessages(null); mDelayHandler.removeCallbacksAndMessages(null);
mDelayHandler.postDelayed(() -> mToastLayoutRoot.animate().alpha(0).withEndAction(() -> mToastLayoutRoot.setVisibility(View.GONE)), 1500); mDelayHandler.postDelayed(() -> mToastLayoutRoot.animate().alpha(0).withEndAction(() -> mToastLayoutRoot.setVisibility(View.GONE)), 2000);
} }
private void onHideUndoDialog() { private void onHideUndoDialog() {
@ -183,8 +211,12 @@ class tabViewController
initTabCount(); initTabCount();
}else if(pCommands.equals(tabEnums.eTabViewCommands.ON_HIDE_SELECTION)){ }else if(pCommands.equals(tabEnums.eTabViewCommands.ON_HIDE_SELECTION)){
onHideSelectionMenu(); onHideSelectionMenu();
}else if(pCommands.equals(tabEnums.eTabViewCommands.ON_SHOW_SELECTION)){ }
onShowSelectionMenu(); else if(pCommands.equals(tabEnums.eTabViewCommands.ON_SHOW_SELECTION_MENU)){
onShowSelectionMenu((boolean) pData.get(0), (int) pData.get(1));
}
else if(pCommands.equals(tabEnums.eTabViewCommands.ON_SHOW_SELECTION)){
onShowSelection();
}else if(pCommands.equals(tabEnums.eTabViewCommands.ON_SHOW_UNDO_DIALOG)){ }else if(pCommands.equals(tabEnums.eTabViewCommands.ON_SHOW_UNDO_DIALOG)){
onShowUndoDialog(); onShowUndoDialog();
}else if(pCommands.equals(tabEnums.eTabViewCommands.ON_HIDE_UNDO_DIALOG)){ }else if(pCommands.equals(tabEnums.eTabViewCommands.ON_HIDE_UNDO_DIALOG)){

View File

@ -13,6 +13,12 @@ public class constants
/*URL CONSTANTS*/ /*URL CONSTANTS*/
public static final String CONST_GENESIS_URL_CACHED = "resource://android/assets/homepage/homepage.html";
public static final String CONST_GENESIS_DOMAIN_URL_SLASHED = "https://boogle.store/";
public static final String CONST_GENESIS_DOMAIN_URL = "https://boogle.store";
public static final String CONST_GENESIS_HELP_URL_CACHE = "resource://android/assets/help/help.html";
public static final String CONST_GENESIS_HELP_URL = "https://boogle.store/help";
public static final String CONST_GENESIS_HELP_URL_SUB = "boogle.store/help";
public static final String CONST_GENESIS_UPDATE_URL = "https://boogle.store/manual?abi="; 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_PLAYSTORE_URL = "https://play.google.com/store/apps/details?id=com.darkweb.genesissearchengine";
public static final String CONST_BACKEND_GENESIS_URL = "https://boogle.store/search?q=$s&p_num=1&s_type=all"; public static final String CONST_BACKEND_GENESIS_URL = "https://boogle.store/search?q=$s&p_num=1&s_type=all";

View File

@ -4,11 +4,11 @@ public class enums
{ {
/*Settings Manager*/ /*Settings Manager*/
public enum etype{ public enum etype{
on_update_favicon,ON_UPDATE_TAB_TITLE,GECKO_SCROLL_CHANGED, 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, on_verify_selected_url_menu,FINDER_RESULT_CALLBACK,
welcome, reload,download_folder, welcome, reload,download_folder,
url_triggered, url_triggered_new_tab,url_clear,url_clear_at,remove_from_database,is_empty,M_HOME_PAGE,M_PRELOAD_URL, url_triggered, url_triggered_new_tab,url_clear,fetch_favicon,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,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,search_update, open_new_tab on_close_sesson,on_long_press, 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_UPDATE_THEME,on_request_completed, on_update_history,on_update_suggestion,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
} }
/*General Enums*/ /*General Enums*/
@ -19,7 +19,13 @@ public class enums
public static final int THEME_DEFAULT = 2; public static final int THEME_DEFAULT = 2;
} }
public static class ImageQueueStatus {
public static final int M_IMAGE_LOADING = 0;
public static final int M_IMAGE_LOADED_SUCCESSFULLY = 1;
public static final int M_IMAGE_LOADING_FAILED = 2;
}
public enum eMessageEnums { public enum eMessageEnums {
M_DATA_CLEARED, M_NOT_SUPPORTED, M_BRIDGE_MAIL, M_LONG_PRESS_WITH_LINK, M_LONG_PRESS_URL, M_LONG_PRESS_DOWNLOAD, M_START_ORBOT, M_DOWNLOAD_FILE, M_RATE_APP, M_REPORT_URL, M_CLEAR_BOOKMARK, M_CLEAR_HISTORY, M_BOOKMARK, M_RATE_SUCCESS, M_RATE_FAILURE, M_ABI_ERROR, M_WELCOME, M_CANCEL_WELCOME, M_APP_RATED, M_DOWNLOAD_FILE_MANUAL, M_OPEN_LINK_CURRENT_TAB, M_COPY_LINK, M_OPEN_LINK_NEW_TAB, M_CLEAR_TAB, M_CONNECT_VPN, M_IGNORE_ABI, M_RATE_APPLICATION M_DATA_CLEARED, M_SECURE_CONNECTION, M_NOT_SUPPORTED, M_BRIDGE_MAIL, M_LONG_PRESS_WITH_LINK, M_LONG_PRESS_URL, M_LONG_PRESS_DOWNLOAD, M_START_ORBOT, M_DOWNLOAD_FILE, M_RATE_APP, M_REPORT_URL, M_CLEAR_BOOKMARK, M_CLEAR_HISTORY, M_BOOKMARK, M_RATE_SUCCESS, M_RATE_FAILURE, M_ABI_ERROR, M_WELCOME, M_CANCEL_WELCOME, M_APP_RATED, M_DOWNLOAD_FILE_MANUAL, M_OPEN_LINK_CURRENT_TAB, M_COPY_LINK, M_OPEN_LINK_NEW_TAB, M_CLEAR_TAB, M_CONNECT_VPN, M_IGNORE_ABI, M_RATE_APPLICATION
} }
} }

View File

@ -47,7 +47,7 @@ public class keys
public static final String SETTING_CHARACTER_ENCODING = "SETTING_CHARACTER_ENCODING"; public static final String SETTING_CHARACTER_ENCODING = "SETTING_CHARACTER_ENCODING";
public static final String SETTING_SHOW_IMAGES = "SETTING_SHOW_IMAGES"; public static final String SETTING_SHOW_IMAGES = "SETTING_SHOW_IMAGES";
public static final String SETTING_SHOW_FONTS = "SETTING_SHOW_FONTS"; public static final String SETTING_SHOW_FONTS = "SETTING_SHOW_FONTS";
public static final String SETTING_AUTO_PLAY = "SETTING_AUTO_PLAY"; public static final String SETTING_TOOLBAR_THEME = "SETTING_TOOLBAR_THEME";
public static final String SETTING_THEME = "SETTING_THEME_LIGHT"; public static final String SETTING_THEME = "SETTING_THEME_LIGHT";
public static final String SETTING_FULL_SCREEN_BROWSIING = "SETTING_FULL_SCREEN_BROWSIING"; public static final String SETTING_FULL_SCREEN_BROWSIING = "SETTING_FULL_SCREEN_BROWSIING";
public static final String SETTING_OPEN_URL_IN_NEW_TAB = "SETTING_OPEN_URL_IN_NEW_TAB"; public static final String SETTING_OPEN_URL_IN_NEW_TAB = "SETTING_OPEN_URL_IN_NEW_TAB";

View File

@ -14,6 +14,7 @@ public class status
public static boolean sPaidStatus = true; public static boolean sPaidStatus = true;
public static String sAppCurrentABI = "7.0"; public static String sAppCurrentABI = "7.0";
public static String mCurrentReloadURL = ""; public static String mCurrentReloadURL = "";
public static int mNotificationID = 1001;
/*Settings Status*/ /*Settings Status*/
@ -24,21 +25,25 @@ public class status
public static boolean sSettingEnableZoom = true; public static boolean sSettingEnableZoom = true;
public static boolean sSettingEnableVoiceInput = true; public static boolean sSettingEnableVoiceInput = true;
public static boolean sSettingSearchHistory = false; public static boolean sSettingSearchHistory = false;
public static boolean getsSettingSearchSuggestion = false; public static boolean sSearchSuggestionStatus = false;
public static boolean sSettingJavaStatus = true; public static boolean sSettingJavaStatus = true;
public static boolean sClearOnExit = true; public static boolean sClearOnExit = true;
public static boolean sSettingIsAppPaused = false; public static boolean sSettingIsAppPaused = false;
public static boolean sSettingIsWelcomeEnabled = true; public static boolean sSettingIsWelcomeEnabled = true;
public static boolean sSettingIsAppStarted = false; public static boolean sSettingIsAppStarted = false;
public static boolean sSettingIsAppRedirected = false;
public static boolean sSettingIsAppRestarting = false;
public static boolean sSettingIsAppRated = false; public static boolean sSettingIsAppRated = false;
public static boolean sSettingFontAdjustable = true; public static boolean sSettingFontAdjustable = true;
public static boolean sSettingFirstStart = true; public static boolean sSettingFirstStart = true;
public static boolean sSettingTrackingProtection = true; public static boolean sSettingTrackingProtection = true;
public static boolean mThemeApplying = false;
public static boolean sStatusDoNotTrack = true; public static boolean sStatusDoNotTrack = true;
public static boolean sRestoreTabs = false; public static boolean sRestoreTabs = false;
public static boolean sCharacterEncoding = false; public static boolean sCharacterEncoding = false;
public static boolean sShowWebFonts = true; public static boolean sShowWebFonts = true;
public static boolean sAutoPlay = false; public static boolean sToolbarTheme = false;
public static boolean sFullScreenBrowsing = false; public static boolean sFullScreenBrowsing = false;
public static boolean sOpenURLInNewTab = false; public static boolean sOpenURLInNewTab = false;
public static boolean sDefaultNightMode; public static boolean sDefaultNightMode;
@ -63,7 +68,7 @@ public class status
public static void initStatus() public static void initStatus()
{ {
status.sSettingSearchHistory = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_SEARCH_HISTORY,true)); status.sSettingSearchHistory = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_SEARCH_HISTORY,true));
status.getsSettingSearchSuggestion = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_SEARCH_SUGGESTION,true)); status.sSearchSuggestionStatus = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_SEARCH_SUGGESTION,true));
status.sSettingJavaStatus = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_JAVA_SCRIPT,true)); status.sSettingJavaStatus = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_JAVA_SCRIPT,true));
status.sClearOnExit = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_HISTORY_CLEAR,true)); status.sClearOnExit = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_HISTORY_CLEAR,true));
status.sBridgeGatewayAuto = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_GATEWAY_AUTO,true)); status.sBridgeGatewayAuto = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_GATEWAY_AUTO,true));
@ -90,7 +95,7 @@ public class status
status.sCharacterEncoding = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_CHARACTER_ENCODING,false)); status.sCharacterEncoding = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_CHARACTER_ENCODING,false));
status.sShowImages = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_SHOW_IMAGES,0)); status.sShowImages = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_SHOW_IMAGES,0));
status.sShowWebFonts = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_SHOW_FONTS,true)); status.sShowWebFonts = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_SHOW_FONTS,true));
status.sAutoPlay = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_AUTO_PLAY,false)); status.sToolbarTheme = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_TOOLBAR_THEME,true));
status.sFullScreenBrowsing = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_FULL_SCREEN_BROWSIING,true)); status.sFullScreenBrowsing = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_FULL_SCREEN_BROWSIING,true));
status.sTheme = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_THEME,enums.Theme.THEME_DEFAULT)); status.sTheme = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_THEME,enums.Theme.THEME_DEFAULT));
status.sOpenURLInNewTab = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_OPEN_URL_IN_NEW_TAB,false)); status.sOpenURLInNewTab = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_OPEN_URL_IN_NEW_TAB,false));

View File

@ -2,6 +2,18 @@ package com.darkweb.genesissearchengine.constants;
public class strings public class strings
{ {
/*Notification Manager Manager*/
public static final String NOTIFICATION_TITLE = "Genesis Browser";
public static final String[] NOTIFICATION_BODY = {"Genesis Browser updated successfully",
"Use Genesis Browser to enhance your privacy",
"Privacy and security enhanced, use Genesis Browser",
"Hidden web & Genesis Search Engine updated",
"Live websites updated on Genesis Search Engine",
"Access secure part of internet, Use Genesis Browser",
"Your privacy matters to us, Use Genesis browser",
"Stop tracking, use Genesis Browser"};
/*History Manager*/ /*History Manager*/
public static final String HISTORY_TITLE = "history"; public static final String HISTORY_TITLE = "history";
public static final String HISTORY_CLEAR_HISTORY = "Clear History"; public static final String HISTORY_CLEAR_HISTORY = "Clear History";

View File

@ -2,6 +2,7 @@ package com.darkweb.genesissearchengine.dataManager;
import com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkRowModel; import com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkRowModel;
import com.darkweb.genesissearchengine.appManager.databaseManager.databaseController; import com.darkweb.genesissearchengine.appManager.databaseManager.databaseController;
import com.darkweb.genesissearchengine.appManager.historyManager.historyRowModel;
import com.darkweb.genesissearchengine.constants.constants; import com.darkweb.genesissearchengine.constants.constants;
import java.util.ArrayList; import java.util.ArrayList;
@ -68,17 +69,34 @@ public class bookmarkDataModel {
databaseController.getInstance().execSQL("delete from bookmark where id="+ pID,null); databaseController.getInstance().execSQL("delete from bookmark where id="+ pID,null);
} }
public ArrayList<historyRowModel> getSuggestions(String pQuery){
pQuery = pQuery.toLowerCase();
ArrayList<historyRowModel> mModel = new ArrayList<>();
for(int count = 0; count<= mBookmarks.size()-1 && mBookmarks.size()<500; count++){
if(mBookmarks.get(count).getHeader().toLowerCase().contains(pQuery)){
mModel.add(0, new historyRowModel(mBookmarks.get(count).getHeader(),mBookmarks.get(count).getDescription(),-1));
}else if(mModel.size()>0 && mBookmarks.get(count).getDescription().toLowerCase().contains(pQuery)){
mModel.add(mModel.size()-1, new historyRowModel(mBookmarks.get(count).getHeader(),mBookmarks.get(count).getDescription(),-1));
}
}
return mModel;
}
public Object onTrigger(dataEnums.eBookmarkCommands p_commands, List<Object> pData){ public Object onTrigger(dataEnums.eBookmarkCommands p_commands, List<Object> pData){
if(p_commands == dataEnums.eBookmarkCommands.M_GET_BOOKMARK){ if(p_commands == dataEnums.eBookmarkCommands.M_GET_BOOKMARK){
return getBookmark(); return getBookmark();
} }
if(p_commands == dataEnums.eBookmarkCommands.M_ADD_BOOKMARK){ else if(p_commands == dataEnums.eBookmarkCommands.M_ADD_BOOKMARK){
addBookmark((String)pData.get(0), (String)pData.get(1)); addBookmark((String)pData.get(0), (String)pData.get(1));
} }
if(p_commands == dataEnums.eBookmarkCommands.M_DELETE_BOOKMARK){ else if(p_commands == dataEnums.eBookmarkCommands.M_GET_SUGGESTIONS){
return getSuggestions((String)pData.get(0));
}
else if(p_commands == dataEnums.eBookmarkCommands.M_DELETE_BOOKMARK){
deleteBookmark((int)pData.get(0)); deleteBookmark((int)pData.get(0));
} }
if(p_commands == dataEnums.eBookmarkCommands.M_CLEAR_BOOKMARK){ else if(p_commands == dataEnums.eBookmarkCommands.M_CLEAR_BOOKMARK){
clearBookmark(); clearBookmark();
} }

View File

@ -3,11 +3,14 @@ package com.darkweb.genesissearchengine.dataManager;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import com.darkweb.genesissearchengine.appManager.activityContextManager; import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.databaseManager.databaseController; import com.darkweb.genesissearchengine.appManager.databaseManager.databaseController;
import com.darkweb.genesissearchengine.appManager.historyManager.historyRowModel;
import com.darkweb.genesissearchengine.constants.constants; import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.status; import com.darkweb.genesissearchengine.constants.status;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import static com.darkweb.genesissearchengine.constants.status.mThemeApplying;
public class dataController public class dataController
{ {
@ -16,9 +19,8 @@ public class dataController
private tabDataModel mTabModel; private tabDataModel mTabModel;
private preferenceDataModel mPreferenceModel; private preferenceDataModel mPreferenceModel;
private historyDataModel mHistoryModel; private historyDataModel mHistoryModel;
private imageCacheModel mImageCacheModel; private imageDataModel mImageDataModel;
private bookmarkDataModel mBookMarkDataModel; private bookmarkDataModel mBookMarkDataModel;
private suggestionDataModel mSuggestionDataModel;
/*Private Declarations*/ /*Private Declarations*/
@ -34,9 +36,8 @@ public class dataController
mHistoryModel = new historyDataModel(); mHistoryModel = new historyDataModel();
mTabModel = new tabDataModel(); mTabModel = new tabDataModel();
mPreferenceModel = new preferenceDataModel(app_context); mPreferenceModel = new preferenceDataModel(app_context);
mImageCacheModel = new imageCacheModel(); mImageDataModel = new imageDataModel();
mBookMarkDataModel = new bookmarkDataModel(); mBookMarkDataModel = new bookmarkDataModel();
mSuggestionDataModel = new suggestionDataModel();
} }
public void initializeListData(){ public void initializeListData(){
invokeSuggestion(dataEnums.eSuggestionCommands.M_INIT_SUGGESTION, null); invokeSuggestion(dataEnums.eSuggestionCommands.M_INIT_SUGGESTION, null);
@ -45,11 +46,10 @@ public class dataController
{ {
mHistoryModel.onTrigger(dataEnums.eHistoryCommands.M_INITIALIZE_HISTORY, Arrays.asList(databaseController.getInstance().selectHistory(0,constants.CONST_FETCHABLE_LIST_SIZE), databaseController.getInstance().getLargestHistoryID(),databaseController.getInstance().getLargestHistoryID())); mHistoryModel.onTrigger(dataEnums.eHistoryCommands.M_INITIALIZE_HISTORY, Arrays.asList(databaseController.getInstance().selectHistory(0,constants.CONST_FETCHABLE_LIST_SIZE), databaseController.getInstance().getLargestHistoryID(),databaseController.getInstance().getLargestHistoryID()));
} }
else else {
{
databaseController.getInstance().execSQL("delete from history where 1",null); databaseController.getInstance().execSQL("delete from history where 1",null);
} }
if(status.sRestoreTabs){ if(status.sRestoreTabs || mThemeApplying){
mTabModel.initializeTab(databaseController.getInstance().selectTabs()); mTabModel.initializeTab(databaseController.getInstance().selectTabs());
activityContextManager.getInstance().getHomeController().initTabCount(); activityContextManager.getInstance().getHomeController().initTabCount();
}else{ }else{
@ -72,11 +72,6 @@ public class dataController
} }
} }
/*Recieving Images*/
public Object invokeImageCache(dataEnums.eImageCacheCommands p_commands, List<Object> p_data){
return mImageCacheModel.onTrigger(p_commands, p_data);
}
/*Recieving Preferences*/ /*Recieving Preferences*/
public Object invokePrefs(dataEnums.ePreferencesCommands p_commands, List<Object> p_data){ public Object invokePrefs(dataEnums.ePreferencesCommands p_commands, List<Object> p_data){
return mPreferenceModel.onTrigger(p_commands, p_data); return mPreferenceModel.onTrigger(p_commands, p_data);
@ -88,21 +83,24 @@ public class dataController
} }
public Object invokeSuggestion(dataEnums.eSuggestionCommands p_commands, List<Object> p_data){ public Object invokeSuggestion(dataEnums.eSuggestionCommands p_commands, List<Object> p_data){
if(dataEnums.eSuggestionCommands.M_UPDATE_SUGGESTION.equals(p_commands)){ if(dataEnums.eSuggestionCommands.M_GET_SUGGESTION.equals(p_commands)) {
mSuggestionDataModel.onTrigger(p_commands, p_data); ArrayList<historyRowModel> mModel = new ArrayList<>();
activityContextManager.getInstance().getHomeController().onSuggestionUpdate(); if(p_data!=null){
} mModel.addAll((ArrayList<historyRowModel>) dataController.getInstance().invokeBookmark(dataEnums.eBookmarkCommands.M_GET_SUGGESTIONS, p_data));
else if(dataEnums.eSuggestionCommands.M_ADD_SUGGESTION.equals(p_commands)){ dataController.getInstance().invokeHistory(dataEnums.eHistoryCommands.M_GET_SUGGESTIONS, Arrays.asList(p_data.get(0),mModel));
mSuggestionDataModel.onTrigger(p_commands, p_data); }
activityContextManager.getInstance().getHomeController().onSuggestionUpdate(); return mModel;
}else { }else {
return mSuggestionDataModel.onTrigger(p_commands, p_data); return null;
} }
return null;
} }
public Object invokeTab(dataEnums.eTabCommands p_commands, List<Object> p_data){ public Object invokeTab(dataEnums.eTabCommands p_commands, List<Object> p_data){
return mTabModel.onTrigger(p_commands, p_data); return mTabModel.onTrigger(p_commands, p_data);
} }
public Object invokeImage(dataEnums.eImageCommands p_commands, List<Object> p_data){
return mImageDataModel.onTrigger(p_commands, p_data);
}
} }

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