├── app
├── .gitignore
├── src
│ └── main
│ │ ├── res
│ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ ├── values
│ │ │ ├── strings.xml
│ │ │ ├── colors.xml
│ │ │ └── themes.xml
│ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ ├── values-night
│ │ │ └── themes.xml
│ │ ├── drawable
│ │ │ ├── url_background.xml
│ │ │ └── ic_launcher_background.xml
│ │ ├── drawable-v24
│ │ │ └── ic_launcher_foreground.xml
│ │ └── layout
│ │ │ ├── fragment_browser.xml
│ │ │ └── item_tab.xml
│ │ ├── java
│ │ └── de
│ │ │ └── pocmo
│ │ │ └── iceant
│ │ │ ├── BrowserApplication.kt
│ │ │ ├── downloads
│ │ │ └── DownloadService.kt
│ │ │ ├── compose
│ │ │ ├── Browser.kt
│ │ │ ├── ext
│ │ │ │ └── BrowserStore.kt
│ │ │ ├── WebContent.kt
│ │ │ └── Toolbar.kt
│ │ │ ├── BrowserActivity.kt
│ │ │ ├── BrowserComposeActivity.kt
│ │ │ ├── modules
│ │ │ ├── UseCasesModule.kt
│ │ │ └── CoreComponentsModule.kt
│ │ │ └── browser
│ │ │ ├── tabstray
│ │ │ └── TabsTrayIntegration.kt
│ │ │ ├── toolbar
│ │ │ └── ToolbarIntegration.kt
│ │ │ └── BrowserFragment.kt
│ │ └── AndroidManifest.xml
├── proguard-rules.pro
└── build.gradle
├── settings.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── README.md
├── gradle.properties
├── gradlew.bat
├── gradlew
└── LICENSE
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | rootProject.name = "Ice Ant"
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pocmo/iceant/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pocmo/iceant/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pocmo/iceant/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pocmo/iceant/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pocmo/iceant/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pocmo/iceant/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pocmo/iceant/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pocmo/iceant/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pocmo/iceant/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pocmo/iceant/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pocmo/iceant/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Ice Ant
3 |
4 | Close tab
5 |
--------------------------------------------------------------------------------
/app/src/main/java/de/pocmo/iceant/BrowserApplication.kt:
--------------------------------------------------------------------------------
1 | package de.pocmo.iceant
2 |
3 | import android.app.Application
4 | import dagger.hilt.android.HiltAndroidApp
5 |
6 | @HiltAndroidApp
7 | class BrowserApplication : Application()
8 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Jul 09 15:05:58 CEST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https://services.gradle.org/distributions/gradle-7.0-bin.zip
7 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/
5 | /.idea/caches
6 | /.idea/libraries
7 | /.idea/modules.xml
8 | /.idea/workspace.xml
9 | /.idea/navEditor.xml
10 | /.idea/assetWizardSettings.xml
11 | .DS_Store
12 | /build
13 | /captures
14 | .externalNativeBuild
15 | .cxx
16 | local.properties
17 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #BB86FC
4 | #6200EE
5 | #3700B3
6 | #03DAC5
7 |
8 | #ffffffff
9 |
--------------------------------------------------------------------------------
/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/url_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/de/pocmo/iceant/downloads/DownloadService.kt:
--------------------------------------------------------------------------------
1 | package de.pocmo.iceant.downloads
2 |
3 | import dagger.hilt.android.AndroidEntryPoint
4 | import mozilla.components.browser.state.store.BrowserStore
5 | import mozilla.components.concept.fetch.Client
6 | import mozilla.components.feature.downloads.AbstractFetchDownloadService
7 | import javax.inject.Inject
8 |
9 | @AndroidEntryPoint
10 | class DownloadService : AbstractFetchDownloadService() {
11 | @Inject override lateinit var store: BrowserStore
12 | @Inject override lateinit var httpClient: Client
13 |
14 | override fun onCreate() {
15 | super.onCreate()
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/java/de/pocmo/iceant/compose/Browser.kt:
--------------------------------------------------------------------------------
1 | package de.pocmo.iceant.compose
2 |
3 | import androidx.compose.foundation.layout.Column
4 | import androidx.compose.runtime.Composable
5 | import mozilla.components.browser.state.store.BrowserStore
6 | import mozilla.components.concept.engine.Engine
7 | import mozilla.components.feature.session.SessionUseCases
8 |
9 | @Composable
10 | fun Browser(store: BrowserStore, engine: Engine, sessionUseCases: SessionUseCases) {
11 | Column {
12 | Toolbar(
13 | store = store,
14 | onLoadUrl = { url -> sessionUseCases.loadUrl(url) }
15 | )
16 |
17 | WebContent(store, engine)
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Ice Ant ([Suggest a better name!](https://github.com/pocmo/iceant/issues/1))
2 |
3 | This is a web browser for Android, built with [Mozilla's Android Components](https://github.com/mozilla-mobile/android-components).
4 |
5 | Work on this browser will be [streamed live on Twitch](https://www.twitch.tv/pocmo) and participation is welcome! You can watch recordings of past episodes [on YouTube](https://www.youtube.com/playlist?list=PLRJ4pSIA9DGtamE77FNiLj_TZkAFS9OSb).
6 |
7 | # License
8 |
9 | This Source Code Form is subject to the terms of the Mozilla Public
10 | License, v. 2.0. If a copy of the MPL was not distributed with this
11 | file, You can obtain one at http://mozilla.org/MPL/2.0/
12 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/src/main/java/de/pocmo/iceant/compose/ext/BrowserStore.kt:
--------------------------------------------------------------------------------
1 | package de.pocmo.iceant.compose.ext
2 |
3 | import androidx.compose.runtime.Composable
4 | import androidx.compose.runtime.State
5 | import androidx.compose.runtime.mutableStateOf
6 | import androidx.compose.runtime.remember
7 | import androidx.compose.ui.platform.LocalLifecycleOwner
8 | import mozilla.components.browser.state.state.BrowserState
9 | import mozilla.components.browser.state.store.BrowserStore
10 | import mozilla.components.lib.state.ext.observe
11 |
12 | @Composable
13 | fun BrowserStore.observeAsState(map: (BrowserState) -> R): State {
14 | val lifecycleOwner = LocalLifecycleOwner.current
15 | val state = remember { mutableStateOf(map(state)) }
16 |
17 | observe(lifecycleOwner) { browserState ->
18 | state.value = map(browserState)
19 | }
20 |
21 | return state
22 | }
23 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
--------------------------------------------------------------------------------
/app/src/main/java/de/pocmo/iceant/BrowserActivity.kt:
--------------------------------------------------------------------------------
1 | package de.pocmo.iceant
2 |
3 | import android.content.Context
4 | import android.os.Bundle
5 | import android.util.AttributeSet
6 | import android.view.View
7 | import androidx.appcompat.app.AppCompatActivity
8 | import dagger.hilt.android.AndroidEntryPoint
9 | import de.pocmo.iceant.browser.BrowserFragment
10 | import mozilla.components.concept.engine.Engine
11 | import mozilla.components.concept.engine.EngineView
12 | import javax.inject.Inject
13 |
14 | @AndroidEntryPoint
15 | class BrowserActivity : AppCompatActivity() {
16 | @Inject lateinit var engine: Engine
17 |
18 | override fun onCreate(savedInstanceState: Bundle?) {
19 | super.onCreate(savedInstanceState)
20 |
21 | if (savedInstanceState == null) {
22 | supportFragmentManager
23 | .beginTransaction()
24 | .add(android.R.id.content, BrowserFragment())
25 | .commit()
26 | }
27 | }
28 |
29 | override fun onCreateView(
30 | parent: View?,
31 | name: String,
32 | context: Context,
33 | attrs: AttributeSet
34 | ): View? {
35 | if (name == EngineView::class.java.name) {
36 | return engine.createView(context, attrs).asView()
37 | }
38 |
39 | return super.onCreateView(name, context, attrs)
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/java/de/pocmo/iceant/compose/WebContent.kt:
--------------------------------------------------------------------------------
1 | package de.pocmo.iceant.compose
2 |
3 | import androidx.compose.foundation.layout.fillMaxSize
4 | import androidx.compose.runtime.Composable
5 | import androidx.compose.ui.Modifier
6 | import androidx.compose.ui.viewinterop.AndroidView
7 | import de.pocmo.iceant.compose.ext.observeAsState
8 | import mozilla.components.browser.state.action.EngineAction
9 | import mozilla.components.browser.state.selector.selectedTab
10 | import mozilla.components.browser.state.store.BrowserStore
11 | import mozilla.components.concept.engine.Engine
12 | import mozilla.components.concept.engine.EngineView
13 |
14 | @Composable
15 | fun WebContent(store: BrowserStore, engine: Engine) {
16 | val selectedTab = store.observeAsState { state ->
17 | // TODO: Data inside the selected tab will change more often and causing a recompose too often
18 | state.selectedTab
19 | }
20 |
21 | AndroidView(
22 | modifier = Modifier.fillMaxSize(),
23 | factory = { context -> engine.createView(context).asView() },
24 | update = { view ->
25 | val engineView = view as EngineView
26 |
27 | val tab = selectedTab.value
28 | if (tab == null) {
29 | engineView.release()
30 | } else {
31 | val session = tab.engineState.engineSession
32 | if (session == null) {
33 | store.dispatch(EngineAction.CreateEngineSessionAction(tab.id))
34 | } else {
35 | engineView.render(session)
36 | }
37 | }
38 | }
39 | )
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/java/de/pocmo/iceant/BrowserComposeActivity.kt:
--------------------------------------------------------------------------------
1 | package de.pocmo.iceant
2 |
3 | import android.os.Bundle
4 | import android.widget.TextView
5 | import androidx.activity.compose.setContent
6 | import androidx.appcompat.app.AppCompatActivity
7 | import androidx.compose.foundation.layout.Column
8 | import androidx.compose.foundation.layout.fillMaxSize
9 | import androidx.compose.material.Text
10 | import androidx.compose.runtime.Composable
11 | import androidx.compose.runtime.State
12 | import androidx.compose.runtime.mutableStateOf
13 | import androidx.compose.runtime.remember
14 | import androidx.compose.ui.Modifier
15 | import androidx.compose.ui.platform.LocalLifecycleOwner
16 | import androidx.compose.ui.viewinterop.AndroidView
17 | import dagger.hilt.android.AndroidEntryPoint
18 | import de.pocmo.iceant.compose.Browser
19 | import mozilla.components.browser.state.action.EngineAction
20 | import mozilla.components.browser.state.selector.selectedTab
21 | import mozilla.components.browser.state.state.BrowserState
22 | import mozilla.components.browser.state.store.BrowserStore
23 | import mozilla.components.concept.engine.Engine
24 | import mozilla.components.concept.engine.EngineSession
25 | import mozilla.components.concept.engine.EngineView
26 | import mozilla.components.feature.session.SessionUseCases
27 | import mozilla.components.lib.state.ext.observe
28 | import javax.inject.Inject
29 |
30 | @AndroidEntryPoint
31 | class BrowserComposeActivity : AppCompatActivity() {
32 | @Inject lateinit var store: BrowserStore
33 | @Inject lateinit var engine: Engine
34 | @Inject lateinit var sessionUseCases: SessionUseCases
35 |
36 | override fun onCreate(savedInstanceState: Bundle?) {
37 | super.onCreate(savedInstanceState)
38 |
39 | setContent {
40 | Browser(store, engine, sessionUseCases)
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/app/src/main/java/de/pocmo/iceant/modules/UseCasesModule.kt:
--------------------------------------------------------------------------------
1 | package de.pocmo.iceant.modules
2 |
3 | import android.app.Application
4 | import dagger.Module
5 | import dagger.Provides
6 | import dagger.hilt.InstallIn
7 | import dagger.hilt.android.components.ApplicationComponent
8 | import mozilla.components.browser.search.SearchEngineManager
9 | import mozilla.components.browser.search.ext.toDefaultSearchEngineProvider
10 | import mozilla.components.browser.session.SessionManager
11 | import mozilla.components.browser.state.store.BrowserStore
12 | import mozilla.components.feature.downloads.DownloadsUseCases
13 | import mozilla.components.feature.search.SearchUseCases
14 | import mozilla.components.feature.session.SessionUseCases
15 | import mozilla.components.feature.tabs.TabsUseCases
16 | import javax.inject.Singleton
17 |
18 | @Module
19 | @InstallIn(ApplicationComponent::class)
20 | class UseCasesModule {
21 | @Provides
22 | @Singleton
23 | fun providesSessionUseCases(store: BrowserStore, sessionManager: SessionManager): SessionUseCases {
24 | return SessionUseCases(store, sessionManager)
25 | }
26 |
27 | @Provides
28 | @Singleton
29 | fun providesDownloadUseCases(store: BrowserStore): DownloadsUseCases {
30 | return DownloadsUseCases(store)
31 | }
32 |
33 | @Provides
34 | @Singleton
35 | fun providesSearchUseCases(
36 | application: Application,
37 | searchEngineManager: SearchEngineManager,
38 | store: BrowserStore,
39 | tabsUseCases: TabsUseCases
40 | ): SearchUseCases {
41 | return SearchUseCases(store, searchEngineManager.toDefaultSearchEngineProvider(application), tabsUseCases)
42 | }
43 |
44 | @Provides
45 | @Singleton
46 | fun providesTabsUseCases(
47 | store: BrowserStore,
48 | sessionManager: SessionManager
49 | ): TabsUseCases {
50 | return TabsUseCases(store, sessionManager)
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_browser.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
17 |
18 |
23 |
24 |
28 |
29 |
30 |
31 |
37 |
38 |
43 |
44 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/app/src/main/java/de/pocmo/iceant/compose/Toolbar.kt:
--------------------------------------------------------------------------------
1 | package de.pocmo.iceant.compose
2 |
3 | import androidx.compose.foundation.clickable
4 | import androidx.compose.foundation.text.KeyboardActions
5 | import androidx.compose.foundation.text.KeyboardOptions
6 | import androidx.compose.material.Text
7 | import androidx.compose.material.TextField
8 | import androidx.compose.runtime.Composable
9 | import androidx.compose.runtime.mutableStateOf
10 | import androidx.compose.runtime.remember
11 | import androidx.compose.ui.Modifier
12 | import androidx.compose.ui.text.input.ImeAction
13 | import androidx.compose.ui.text.input.KeyboardType
14 | import de.pocmo.iceant.compose.ext.observeAsState
15 | import mozilla.components.browser.state.selector.selectedTab
16 | import mozilla.components.browser.state.store.BrowserStore
17 |
18 | @Composable
19 | fun Toolbar(
20 | store: BrowserStore,
21 | onLoadUrl: (String) -> Unit
22 | ) {
23 | val editMode = remember { mutableStateOf(false) }
24 | val url = store.observeAsState { state ->
25 | state.selectedTab?.content?.url ?: ""
26 | }
27 |
28 | if (editMode.value) {
29 | EditToolbar(
30 | url = url.value,
31 | onCommit = { text ->
32 | editMode.value = false
33 | onLoadUrl(text)
34 | }
35 | )
36 | } else {
37 | DisplayToolbar(
38 | url = url.value,
39 | onClick = { editMode.value = true }
40 | )
41 | }
42 | }
43 |
44 | @Composable
45 | fun DisplayToolbar(
46 | url: String,
47 | onClick: () -> Unit
48 | ) {
49 | Text(
50 | text = url,
51 | maxLines = 1,
52 | modifier = Modifier.clickable { onClick() }
53 | )
54 | }
55 |
56 | @Composable
57 | fun EditToolbar(
58 | url: String,
59 | onCommit: (String) -> Unit
60 | ) {
61 | val text = remember { mutableStateOf(url) }
62 |
63 | TextField(
64 | value = text.value,
65 | singleLine = true,
66 | onValueChange = { value -> text.value = value },
67 | keyboardOptions = KeyboardOptions(
68 | keyboardType = KeyboardType.Uri,
69 | imeAction = ImeAction.Go
70 | ),
71 | keyboardActions = KeyboardActions(
72 | onGo = { onCommit(text.value) }
73 | ),
74 | )
75 | }
76 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/app/src/main/java/de/pocmo/iceant/browser/tabstray/TabsTrayIntegration.kt:
--------------------------------------------------------------------------------
1 | package de.pocmo.iceant.browser.tabstray
2 |
3 | import android.graphics.Color
4 | import android.view.LayoutInflater
5 | import android.widget.Button
6 | import androidx.core.content.ContextCompat
7 | import androidx.drawerlayout.widget.DrawerLayout
8 | import androidx.recyclerview.widget.LinearLayoutManager
9 | import androidx.recyclerview.widget.RecyclerView
10 | import de.pocmo.iceant.R
11 | import mozilla.components.browser.state.store.BrowserStore
12 | import mozilla.components.browser.tabstray.DefaultTabViewHolder
13 | import mozilla.components.browser.tabstray.TabsAdapter
14 | import mozilla.components.browser.tabstray.TabsTrayStyling
15 | import mozilla.components.browser.tabstray.ViewHolderProvider
16 | import mozilla.components.browser.thumbnails.loader.ThumbnailLoader
17 | import mozilla.components.browser.thumbnails.storage.ThumbnailStorage
18 | import mozilla.components.concept.tabstray.TabsTray
19 | import mozilla.components.feature.tabs.TabsUseCases
20 | import mozilla.components.feature.tabs.tabstray.TabsFeature
21 | import mozilla.components.support.base.feature.LifecycleAwareFeature
22 |
23 | class TabsTrayIntegration(
24 | store: BrowserStore,
25 | recyclerView: RecyclerView,
26 | addTabButton: Button,
27 | drawer: DrawerLayout,
28 | tabsUseCases: TabsUseCases,
29 | private val thumbnailStorage: ThumbnailStorage
30 | ) : LifecycleAwareFeature {
31 | private val tabsFeature = TabsFeature(
32 | createAndSetupTabsTray(recyclerView),
33 | store,
34 | tabsUseCases.selectTab,
35 | tabsUseCases.removeTab
36 | ) {
37 | drawer.close()
38 | }
39 |
40 | init {
41 | addTabButton.setOnClickListener {
42 | tabsUseCases.addTab("about:blank", selectTab = true)
43 | drawer.close()
44 | }
45 | }
46 |
47 | override fun start() {
48 | tabsFeature.start()
49 | }
50 |
51 | override fun stop() {
52 | tabsFeature.stop()
53 | }
54 |
55 | private fun createAndSetupTabsTray(
56 | recyclerView: RecyclerView
57 | ): TabsTray {
58 | recyclerView.layoutManager = LinearLayoutManager(
59 | recyclerView.context, LinearLayoutManager.VERTICAL, false
60 | )
61 |
62 | val loader = ThumbnailLoader(thumbnailStorage)
63 |
64 | val viewHolderProvider: ViewHolderProvider = { viewGroup ->
65 | val view = LayoutInflater.from(recyclerView.context)
66 | .inflate(R.layout.item_tab, viewGroup, false)
67 |
68 | DefaultTabViewHolder(view, loader)
69 | }
70 |
71 | val adapter = TabsAdapter(
72 | thumbnailLoader = loader,
73 | viewHolderProvider = viewHolderProvider
74 | ).apply {
75 | styling = TabsTrayStyling(
76 | itemBackgroundColor = Color.TRANSPARENT,
77 | selectedItemBackgroundColor = ContextCompat.getColor(recyclerView.context, R.color.teal200),
78 | itemTextColor = Color.WHITE,
79 | selectedItemTextColor = Color.WHITE,
80 | itemUrlTextColor = Color.WHITE,
81 | selectedItemUrlTextColor = Color.WHITE
82 | )
83 | }
84 |
85 | recyclerView.adapter = adapter
86 |
87 | return adapter
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/app/src/main/java/de/pocmo/iceant/browser/toolbar/ToolbarIntegration.kt:
--------------------------------------------------------------------------------
1 | package de.pocmo.iceant.browser.toolbar
2 |
3 | import android.content.Context
4 | import androidx.appcompat.content.res.AppCompatResources
5 | import androidx.core.content.ContextCompat
6 | import androidx.drawerlayout.widget.DrawerLayout
7 | import androidx.lifecycle.LifecycleOwner
8 | import de.pocmo.iceant.R
9 | import mozilla.components.browser.domains.autocomplete.ShippedDomainsProvider
10 | import mozilla.components.browser.menu.BrowserMenuBuilder
11 | import mozilla.components.browser.menu.item.SimpleBrowserMenuItem
12 | import mozilla.components.browser.session.SessionManager
13 | import mozilla.components.browser.state.store.BrowserStore
14 | import mozilla.components.browser.toolbar.BrowserToolbar
15 | import mozilla.components.concept.engine.Engine
16 | import mozilla.components.feature.search.SearchUseCases
17 | import mozilla.components.feature.session.SessionUseCases
18 | import mozilla.components.feature.tabs.toolbar.TabsToolbarFeature
19 | import mozilla.components.feature.toolbar.ToolbarAutocompleteFeature
20 | import mozilla.components.feature.toolbar.ToolbarFeature
21 | import mozilla.components.support.base.feature.LifecycleAwareFeature
22 |
23 | class ToolbarIntegration(
24 | context: Context,
25 | lifecycleOwner: LifecycleOwner,
26 | engine: Engine,
27 | sessionManager: SessionManager,
28 | store: BrowserStore,
29 | toolbar: BrowserToolbar,
30 | drawer: DrawerLayout,
31 | sessionUseCases: SessionUseCases,
32 | private val searchUseCases: SearchUseCases,
33 | private val findInPage: () -> Unit
34 | ) : LifecycleAwareFeature {
35 | private val domainProvider = ShippedDomainsProvider().apply {
36 | initialize(context)
37 | }
38 |
39 | private val toolbarFeature = ToolbarFeature(
40 | toolbar,
41 | store,
42 | sessionUseCases.loadUrl,
43 | { searchTerms -> searchUseCases.defaultSearch(searchTerms) }
44 | )
45 |
46 | private val tabsToolbarFeature = TabsToolbarFeature(
47 | toolbar,
48 | store,
49 | lifecycleOwner = lifecycleOwner,
50 | showTabs = { drawer.open() }
51 | )
52 |
53 | init {
54 | toolbar.display.menuBuilder = BrowserMenuBuilder(
55 | items = listOf(
56 | SimpleBrowserMenuItem(
57 | label = "Find in Page",
58 | listener = { findInPage() }
59 | )
60 | )
61 | )
62 |
63 | toolbar.display.setUrlBackground(
64 | AppCompatResources.getDrawable(context, R.drawable.url_background)
65 | )
66 |
67 | toolbar.display.colors = toolbar.display.colors.copy(
68 | text = 0xFFFFFFFF.toInt()
69 | )
70 |
71 | toolbar.edit.colors = toolbar.edit.colors.copy(
72 | text = 0xFFFFFFFF.toInt(),
73 | suggestionForeground = 0xFFFFFFFF.toInt(),
74 | suggestionBackground = ContextCompat.getColor(context, R.color.teal200)
75 | )
76 |
77 | ToolbarAutocompleteFeature(
78 | toolbar,
79 | engine
80 | ).apply {
81 | addDomainProvider(domainProvider)
82 | }
83 | }
84 |
85 | override fun start() {
86 | toolbarFeature.start()
87 | }
88 |
89 | override fun stop() {
90 | toolbarFeature.stop()
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_tab.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
10 |
11 |
20 |
21 |
25 |
26 |
27 |
28 |
43 |
44 |
58 |
59 |
71 |
72 |
--------------------------------------------------------------------------------
/app/src/main/java/de/pocmo/iceant/modules/CoreComponentsModule.kt:
--------------------------------------------------------------------------------
1 | package de.pocmo.iceant.modules
2 |
3 | import android.app.Application
4 | import dagger.Module
5 | import dagger.Provides
6 | import dagger.hilt.InstallIn
7 | import dagger.hilt.android.components.ApplicationComponent
8 | import de.pocmo.iceant.downloads.DownloadService
9 | import kotlinx.coroutines.GlobalScope
10 | import kotlinx.coroutines.launch
11 | import mozilla.components.browser.engine.gecko.GeckoEngine
12 | import mozilla.components.browser.engine.gecko.fetch.GeckoViewFetchClient
13 | import mozilla.components.browser.search.SearchEngineManager
14 | import mozilla.components.browser.session.Session
15 | import mozilla.components.browser.session.SessionManager
16 | import mozilla.components.browser.session.engine.EngineMiddleware
17 | import mozilla.components.browser.session.storage.AutoSave
18 | import mozilla.components.browser.session.storage.SessionStorage
19 | import mozilla.components.browser.state.store.BrowserStore
20 | import mozilla.components.browser.thumbnails.ThumbnailsMiddleware
21 | import mozilla.components.browser.thumbnails.storage.ThumbnailStorage
22 | import mozilla.components.concept.engine.Engine
23 | import mozilla.components.concept.fetch.Client
24 | import mozilla.components.feature.downloads.DownloadMiddleware
25 | import javax.inject.Singleton
26 |
27 | private lateinit var sessionLookup: (String) -> Session?
28 |
29 | @Module
30 | @InstallIn(ApplicationComponent::class)
31 | class CoreComponentsModule {
32 | @Provides
33 | @Singleton
34 | fun providesEngine(application: Application): Engine {
35 | return GeckoEngine(application)
36 | }
37 |
38 | @Provides
39 | @Singleton
40 | fun provideStore(
41 | application: Application,
42 | engine: Engine,
43 | thumbnailStorage: ThumbnailStorage
44 | ): BrowserStore {
45 | return BrowserStore(
46 | middleware = listOf(
47 | DownloadMiddleware(application.applicationContext, DownloadService::class.java),
48 | ThumbnailsMiddleware(thumbnailStorage),
49 | ) + EngineMiddleware.create(engine, { id -> sessionLookup.invoke(id) })
50 | )
51 | }
52 |
53 | @Provides
54 | @Singleton
55 | fun provideSessionStorage(application: Application, engine: Engine): SessionStorage {
56 | return SessionStorage(application, engine)
57 | }
58 |
59 | @Provides
60 | @Singleton
61 | fun providesSessionManager(
62 | engine: Engine,
63 | store: BrowserStore,
64 | sessionStorage: SessionStorage
65 | ): SessionManager {
66 | return SessionManager(engine, store).also { sessionManger ->
67 | sessionLookup = { tab -> sessionManger.findSessionById(tab) }
68 |
69 | sessionStorage.restore()?.let {
70 | sessionManger.restore(it.tabs, it.selectedTabId)
71 | }
72 |
73 | AutoSave(store, sessionStorage, 5000)
74 | .whenSessionsChange()
75 | .whenGoingToBackground()
76 | .periodicallyInForeground()
77 | }
78 | }
79 |
80 | @Provides
81 | @Singleton
82 | fun providesClient(application: Application): Client {
83 | return GeckoViewFetchClient(application)
84 | }
85 |
86 | @Provides
87 | @Singleton
88 | fun providesSearchEngineManager(application: Application): SearchEngineManager {
89 | return SearchEngineManager().apply {
90 | GlobalScope.launch {
91 | loadAsync(application).await()
92 | }
93 | }
94 | }
95 |
96 | @Provides
97 | @Singleton
98 | fun providesThumbnailStorage(application: Application): ThumbnailStorage {
99 | return ThumbnailStorage(application)
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | id 'kotlin-android'
4 | id 'kotlin-android-extensions'
5 | id 'dagger.hilt.android.plugin'
6 | id 'kotlin-kapt'
7 | }
8 |
9 | android {
10 | compileSdkVersion 29
11 | buildToolsVersion "29.0.3"
12 |
13 | defaultConfig {
14 | applicationId "de.pocmo.iceant"
15 | minSdkVersion 21
16 | targetSdkVersion 29
17 | versionCode 1
18 | versionName "1.0"
19 |
20 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
21 | }
22 |
23 | buildFeatures {
24 | compose true
25 | }
26 |
27 | buildTypes {
28 | release {
29 | minifyEnabled false
30 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
31 | }
32 | }
33 | compileOptions {
34 | sourceCompatibility JavaVersion.VERSION_1_8
35 | targetCompatibility JavaVersion.VERSION_1_8
36 | }
37 | kotlinOptions {
38 | jvmTarget = '1.8'
39 | }
40 | composeOptions {
41 | kotlinCompilerExtensionVersion '1.0.0-beta05'
42 | }
43 | }
44 |
45 | dependencies {
46 | implementation "org.mozilla.components:concept-engine:$mozilla_android_components"
47 | implementation "org.mozilla.components:concept-fetch:$mozilla_android_components"
48 |
49 | implementation "org.mozilla.components:browser-engine-gecko-nightly:$mozilla_android_components"
50 | implementation "org.mozilla.components:browser-domains:$mozilla_android_components"
51 | implementation "org.mozilla.components:browser-session:$mozilla_android_components"
52 | implementation "org.mozilla.components:browser-session-storage:$mozilla_android_components"
53 | implementation "org.mozilla.components:browser-search:$mozilla_android_components"
54 | implementation "org.mozilla.components:browser-state:$mozilla_android_components"
55 | implementation "org.mozilla.components:browser-toolbar:$mozilla_android_components"
56 | implementation "org.mozilla.components:browser-tabstray:$mozilla_android_components"
57 | implementation "org.mozilla.components:browser-menu:$mozilla_android_components"
58 | implementation "org.mozilla.components:browser-thumbnails:$mozilla_android_components"
59 |
60 | implementation "org.mozilla.components:feature-findinpage:$mozilla_android_components"
61 | implementation "org.mozilla.components:feature-downloads:$mozilla_android_components"
62 | implementation "org.mozilla.components:feature-session:$mozilla_android_components"
63 | implementation "org.mozilla.components:feature-search:$mozilla_android_components"
64 | implementation "org.mozilla.components:feature-toolbar:$mozilla_android_components"
65 | implementation "org.mozilla.components:feature-tabs:$mozilla_android_components"
66 | implementation "org.mozilla.components:ui-icons:$mozilla_android_components"
67 | implementation "org.mozilla.components:ui-tabcounter:$mozilla_android_components"
68 |
69 | implementation "org.mozilla.components:support-images:$mozilla_android_components"
70 |
71 | implementation 'com.google.dagger:hilt-android:2.28-alpha'
72 | kapt 'com.google.dagger:hilt-android-compiler:2.28-alpha'
73 |
74 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
75 | implementation 'androidx.core:core-ktx:1.3.0'
76 | implementation 'androidx.drawerlayout:drawerlayout:1.1.0'
77 | implementation 'androidx.appcompat:appcompat:1.1.0'
78 | implementation 'com.google.android.material:material:1.1.0'
79 |
80 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
81 |
82 | implementation 'androidx.compose.ui:ui:1.0.0-beta05'
83 | implementation 'androidx.compose.ui:ui-tooling:1.0.0-beta05'
84 | implementation 'androidx.compose.foundation:foundation:1.0.0-beta05'
85 | implementation 'androidx.compose.material:material:1.0.0-beta05'
86 | implementation 'androidx.compose.material:material-icons-core:1.0.0-beta05'
87 | implementation 'androidx.compose.material:material-icons-extended:1.0.0-beta05'
88 | implementation 'androidx.activity:activity-compose:1.3.0-alpha07'
89 | //implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha02'
90 | //implementation 'androidx.compose.runtime:runtime-livedata:1.0.0-beta01'
91 |
92 | // UI Tests
93 | androidTestImplementation 'androidx.compose.ui:ui-test-junit4:1.0.0-beta05'
94 |
95 |
96 | testImplementation 'junit:junit:4.+'
97 |
98 | androidTestImplementation 'androidx.test.ext:junit:1.1.1'
99 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
100 | }
101 |
102 | kapt {
103 | correctErrorTypes true
104 | }
--------------------------------------------------------------------------------
/app/src/main/java/de/pocmo/iceant/browser/BrowserFragment.kt:
--------------------------------------------------------------------------------
1 | package de.pocmo.iceant.browser
2 |
3 | import android.os.Bundle
4 | import android.view.LayoutInflater
5 | import android.view.View
6 | import android.view.ViewGroup
7 | import androidx.drawerlayout.widget.DrawerLayout
8 | import androidx.fragment.app.Fragment
9 | import dagger.hilt.android.AndroidEntryPoint
10 | import de.pocmo.iceant.R
11 | import de.pocmo.iceant.browser.tabstray.TabsTrayIntegration
12 | import de.pocmo.iceant.browser.toolbar.ToolbarIntegration
13 | import de.pocmo.iceant.downloads.DownloadService
14 | import mozilla.components.browser.search.SearchEngineManager
15 | import mozilla.components.browser.session.SessionManager
16 | import mozilla.components.browser.state.selector.selectedTab
17 | import mozilla.components.browser.state.store.BrowserStore
18 | import mozilla.components.browser.thumbnails.BrowserThumbnails
19 | import mozilla.components.browser.thumbnails.storage.ThumbnailStorage
20 | import mozilla.components.browser.toolbar.BrowserToolbar
21 | import mozilla.components.concept.engine.Engine
22 | import mozilla.components.concept.engine.EngineView
23 | import mozilla.components.feature.downloads.DownloadsFeature
24 | import mozilla.components.feature.downloads.DownloadsUseCases
25 | import mozilla.components.feature.downloads.manager.FetchDownloadManager
26 | import mozilla.components.feature.findinpage.FindInPageFeature
27 | import mozilla.components.feature.findinpage.view.FindInPageBar
28 | import mozilla.components.feature.search.SearchUseCases
29 | import mozilla.components.feature.session.SessionFeature
30 | import mozilla.components.feature.session.SessionUseCases
31 | import mozilla.components.feature.tabs.TabsUseCases
32 | import mozilla.components.support.base.feature.ViewBoundFeatureWrapper
33 | import javax.inject.Inject
34 |
35 | @AndroidEntryPoint
36 | class BrowserFragment : Fragment() {
37 | @Inject lateinit var store: BrowserStore
38 | @Inject lateinit var engine: Engine
39 | @Inject lateinit var sessionManager: SessionManager
40 | @Inject lateinit var searchEngineManager: SearchEngineManager
41 | @Inject lateinit var thumbnailStorage: ThumbnailStorage
42 |
43 | @Inject lateinit var sessionUseCases: SessionUseCases
44 | @Inject lateinit var downloadUseCases: DownloadsUseCases
45 | @Inject lateinit var searchUseCases: SearchUseCases
46 | @Inject lateinit var tabsUseCases: TabsUseCases
47 |
48 | private val sessionFeature = ViewBoundFeatureWrapper()
49 | private val downloadsFeature = ViewBoundFeatureWrapper()
50 | private val findInPageFeature = ViewBoundFeatureWrapper()
51 | private val thumbnailsFeature = ViewBoundFeatureWrapper()
52 | private val toolbarIntegration = ViewBoundFeatureWrapper()
53 | private val tabsTrayIntegration = ViewBoundFeatureWrapper()
54 |
55 | override fun onCreateView(
56 | inflater: LayoutInflater,
57 | container: ViewGroup?,
58 | savedInstanceState: Bundle?
59 | ): View? {
60 | return inflater.inflate(R.layout.fragment_browser, container, false)
61 | }
62 |
63 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
64 | sessionFeature.set(SessionFeature(
65 | store,
66 | sessionUseCases.goBack,
67 | view.findViewById(R.id.engineView) as EngineView
68 | ), this, view)
69 |
70 | val toolbar = view.findViewById(R.id.toolbar)
71 | val drawer = view.findViewById(R.id.drawer)
72 |
73 | findInPageFeature.set(FindInPageFeature(
74 | store,
75 | view.findViewById(R.id.findInPageBar),
76 | view.findViewById(R.id.engineView) as EngineView
77 | ) {
78 | view.findViewById(R.id.findInPageBar).visibility = View.GONE
79 | }, this, view)
80 |
81 | toolbarIntegration.set(ToolbarIntegration(
82 | requireContext(),
83 | this,
84 | engine,
85 | sessionManager,
86 | store,
87 | toolbar,
88 | drawer,
89 | sessionUseCases,
90 | searchUseCases
91 | ) {
92 | view.findViewById(R.id.findInPageBar).visibility = View.VISIBLE
93 | findInPageFeature.get()?.bind(store.state.selectedTab!!)
94 | }, this, view)
95 |
96 | downloadsFeature.set(DownloadsFeature(
97 | requireContext(),
98 | store,
99 | downloadUseCases,
100 | onNeedToRequestPermissions = { permissions ->
101 | requestPermissions(permissions, 1)
102 | },
103 | downloadManager = FetchDownloadManager(
104 | requireContext(),
105 | store,
106 | DownloadService::class
107 | ),
108 | fragmentManager = childFragmentManager
109 | ), this, view)
110 |
111 | tabsTrayIntegration.set(
112 | TabsTrayIntegration(
113 | store,
114 | view.findViewById(R.id.tabsTray),
115 | view.findViewById(R.id.addTab),
116 | drawer,
117 | tabsUseCases,
118 | thumbnailStorage
119 | ), this, view)
120 |
121 | thumbnailsFeature.set(
122 | BrowserThumbnails(
123 | requireContext(),
124 | view.findViewById(R.id.engineView) as EngineView,
125 | store
126 | ),
127 | this,
128 | view
129 | )
130 | }
131 |
132 | override fun onRequestPermissionsResult(
133 | requestCode: Int,
134 | permissions: Array,
135 | grantResults: IntArray
136 | ) {
137 | downloadsFeature.get()?.onPermissionsResult(permissions, grantResults)
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Mozilla Public License Version 2.0
2 | ==================================
3 |
4 | 1. Definitions
5 | --------------
6 |
7 | 1.1. "Contributor"
8 | means each individual or legal entity that creates, contributes to
9 | the creation of, or owns Covered Software.
10 |
11 | 1.2. "Contributor Version"
12 | means the combination of the Contributions of others (if any) used
13 | by a Contributor and that particular Contributor's Contribution.
14 |
15 | 1.3. "Contribution"
16 | means Covered Software of a particular Contributor.
17 |
18 | 1.4. "Covered Software"
19 | means Source Code Form to which the initial Contributor has attached
20 | the notice in Exhibit A, the Executable Form of such Source Code
21 | Form, and Modifications of such Source Code Form, in each case
22 | including portions thereof.
23 |
24 | 1.5. "Incompatible With Secondary Licenses"
25 | means
26 |
27 | (a) that the initial Contributor has attached the notice described
28 | in Exhibit B to the Covered Software; or
29 |
30 | (b) that the Covered Software was made available under the terms of
31 | version 1.1 or earlier of the License, but not also under the
32 | terms of a Secondary License.
33 |
34 | 1.6. "Executable Form"
35 | means any form of the work other than Source Code Form.
36 |
37 | 1.7. "Larger Work"
38 | means a work that combines Covered Software with other material, in
39 | a separate file or files, that is not Covered Software.
40 |
41 | 1.8. "License"
42 | means this document.
43 |
44 | 1.9. "Licensable"
45 | means having the right to grant, to the maximum extent possible,
46 | whether at the time of the initial grant or subsequently, any and
47 | all of the rights conveyed by this License.
48 |
49 | 1.10. "Modifications"
50 | means any of the following:
51 |
52 | (a) any file in Source Code Form that results from an addition to,
53 | deletion from, or modification of the contents of Covered
54 | Software; or
55 |
56 | (b) any new file in Source Code Form that contains any Covered
57 | Software.
58 |
59 | 1.11. "Patent Claims" of a Contributor
60 | means any patent claim(s), including without limitation, method,
61 | process, and apparatus claims, in any patent Licensable by such
62 | Contributor that would be infringed, but for the grant of the
63 | License, by the making, using, selling, offering for sale, having
64 | made, import, or transfer of either its Contributions or its
65 | Contributor Version.
66 |
67 | 1.12. "Secondary License"
68 | means either the GNU General Public License, Version 2.0, the GNU
69 | Lesser General Public License, Version 2.1, the GNU Affero General
70 | Public License, Version 3.0, or any later versions of those
71 | licenses.
72 |
73 | 1.13. "Source Code Form"
74 | means the form of the work preferred for making modifications.
75 |
76 | 1.14. "You" (or "Your")
77 | means an individual or a legal entity exercising rights under this
78 | License. For legal entities, "You" includes any entity that
79 | controls, is controlled by, or is under common control with You. For
80 | purposes of this definition, "control" means (a) the power, direct
81 | or indirect, to cause the direction or management of such entity,
82 | whether by contract or otherwise, or (b) ownership of more than
83 | fifty percent (50%) of the outstanding shares or beneficial
84 | ownership of such entity.
85 |
86 | 2. License Grants and Conditions
87 | --------------------------------
88 |
89 | 2.1. Grants
90 |
91 | Each Contributor hereby grants You a world-wide, royalty-free,
92 | non-exclusive license:
93 |
94 | (a) under intellectual property rights (other than patent or trademark)
95 | Licensable by such Contributor to use, reproduce, make available,
96 | modify, display, perform, distribute, and otherwise exploit its
97 | Contributions, either on an unmodified basis, with Modifications, or
98 | as part of a Larger Work; and
99 |
100 | (b) under Patent Claims of such Contributor to make, use, sell, offer
101 | for sale, have made, import, and otherwise transfer either its
102 | Contributions or its Contributor Version.
103 |
104 | 2.2. Effective Date
105 |
106 | The licenses granted in Section 2.1 with respect to any Contribution
107 | become effective for each Contribution on the date the Contributor first
108 | distributes such Contribution.
109 |
110 | 2.3. Limitations on Grant Scope
111 |
112 | The licenses granted in this Section 2 are the only rights granted under
113 | this License. No additional rights or licenses will be implied from the
114 | distribution or licensing of Covered Software under this License.
115 | Notwithstanding Section 2.1(b) above, no patent license is granted by a
116 | Contributor:
117 |
118 | (a) for any code that a Contributor has removed from Covered Software;
119 | or
120 |
121 | (b) for infringements caused by: (i) Your and any other third party's
122 | modifications of Covered Software, or (ii) the combination of its
123 | Contributions with other software (except as part of its Contributor
124 | Version); or
125 |
126 | (c) under Patent Claims infringed by Covered Software in the absence of
127 | its Contributions.
128 |
129 | This License does not grant any rights in the trademarks, service marks,
130 | or logos of any Contributor (except as may be necessary to comply with
131 | the notice requirements in Section 3.4).
132 |
133 | 2.4. Subsequent Licenses
134 |
135 | No Contributor makes additional grants as a result of Your choice to
136 | distribute the Covered Software under a subsequent version of this
137 | License (see Section 10.2) or under the terms of a Secondary License (if
138 | permitted under the terms of Section 3.3).
139 |
140 | 2.5. Representation
141 |
142 | Each Contributor represents that the Contributor believes its
143 | Contributions are its original creation(s) or it has sufficient rights
144 | to grant the rights to its Contributions conveyed by this License.
145 |
146 | 2.6. Fair Use
147 |
148 | This License is not intended to limit any rights You have under
149 | applicable copyright doctrines of fair use, fair dealing, or other
150 | equivalents.
151 |
152 | 2.7. Conditions
153 |
154 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
155 | in Section 2.1.
156 |
157 | 3. Responsibilities
158 | -------------------
159 |
160 | 3.1. Distribution of Source Form
161 |
162 | All distribution of Covered Software in Source Code Form, including any
163 | Modifications that You create or to which You contribute, must be under
164 | the terms of this License. You must inform recipients that the Source
165 | Code Form of the Covered Software is governed by the terms of this
166 | License, and how they can obtain a copy of this License. You may not
167 | attempt to alter or restrict the recipients' rights in the Source Code
168 | Form.
169 |
170 | 3.2. Distribution of Executable Form
171 |
172 | If You distribute Covered Software in Executable Form then:
173 |
174 | (a) such Covered Software must also be made available in Source Code
175 | Form, as described in Section 3.1, and You must inform recipients of
176 | the Executable Form how they can obtain a copy of such Source Code
177 | Form by reasonable means in a timely manner, at a charge no more
178 | than the cost of distribution to the recipient; and
179 |
180 | (b) You may distribute such Executable Form under the terms of this
181 | License, or sublicense it under different terms, provided that the
182 | license for the Executable Form does not attempt to limit or alter
183 | the recipients' rights in the Source Code Form under this License.
184 |
185 | 3.3. Distribution of a Larger Work
186 |
187 | You may create and distribute a Larger Work under terms of Your choice,
188 | provided that You also comply with the requirements of this License for
189 | the Covered Software. If the Larger Work is a combination of Covered
190 | Software with a work governed by one or more Secondary Licenses, and the
191 | Covered Software is not Incompatible With Secondary Licenses, this
192 | License permits You to additionally distribute such Covered Software
193 | under the terms of such Secondary License(s), so that the recipient of
194 | the Larger Work may, at their option, further distribute the Covered
195 | Software under the terms of either this License or such Secondary
196 | License(s).
197 |
198 | 3.4. Notices
199 |
200 | You may not remove or alter the substance of any license notices
201 | (including copyright notices, patent notices, disclaimers of warranty,
202 | or limitations of liability) contained within the Source Code Form of
203 | the Covered Software, except that You may alter any license notices to
204 | the extent required to remedy known factual inaccuracies.
205 |
206 | 3.5. Application of Additional Terms
207 |
208 | You may choose to offer, and to charge a fee for, warranty, support,
209 | indemnity or liability obligations to one or more recipients of Covered
210 | Software. However, You may do so only on Your own behalf, and not on
211 | behalf of any Contributor. You must make it absolutely clear that any
212 | such warranty, support, indemnity, or liability obligation is offered by
213 | You alone, and You hereby agree to indemnify every Contributor for any
214 | liability incurred by such Contributor as a result of warranty, support,
215 | indemnity or liability terms You offer. You may include additional
216 | disclaimers of warranty and limitations of liability specific to any
217 | jurisdiction.
218 |
219 | 4. Inability to Comply Due to Statute or Regulation
220 | ---------------------------------------------------
221 |
222 | If it is impossible for You to comply with any of the terms of this
223 | License with respect to some or all of the Covered Software due to
224 | statute, judicial order, or regulation then You must: (a) comply with
225 | the terms of this License to the maximum extent possible; and (b)
226 | describe the limitations and the code they affect. Such description must
227 | be placed in a text file included with all distributions of the Covered
228 | Software under this License. Except to the extent prohibited by statute
229 | or regulation, such description must be sufficiently detailed for a
230 | recipient of ordinary skill to be able to understand it.
231 |
232 | 5. Termination
233 | --------------
234 |
235 | 5.1. The rights granted under this License will terminate automatically
236 | if You fail to comply with any of its terms. However, if You become
237 | compliant, then the rights granted under this License from a particular
238 | Contributor are reinstated (a) provisionally, unless and until such
239 | Contributor explicitly and finally terminates Your grants, and (b) on an
240 | ongoing basis, if such Contributor fails to notify You of the
241 | non-compliance by some reasonable means prior to 60 days after You have
242 | come back into compliance. Moreover, Your grants from a particular
243 | Contributor are reinstated on an ongoing basis if such Contributor
244 | notifies You of the non-compliance by some reasonable means, this is the
245 | first time You have received notice of non-compliance with this License
246 | from such Contributor, and You become compliant prior to 30 days after
247 | Your receipt of the notice.
248 |
249 | 5.2. If You initiate litigation against any entity by asserting a patent
250 | infringement claim (excluding declaratory judgment actions,
251 | counter-claims, and cross-claims) alleging that a Contributor Version
252 | directly or indirectly infringes any patent, then the rights granted to
253 | You by any and all Contributors for the Covered Software under Section
254 | 2.1 of this License shall terminate.
255 |
256 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
257 | end user license agreements (excluding distributors and resellers) which
258 | have been validly granted by You or Your distributors under this License
259 | prior to termination shall survive termination.
260 |
261 | ************************************************************************
262 | * *
263 | * 6. Disclaimer of Warranty *
264 | * ------------------------- *
265 | * *
266 | * Covered Software is provided under this License on an "as is" *
267 | * basis, without warranty of any kind, either expressed, implied, or *
268 | * statutory, including, without limitation, warranties that the *
269 | * Covered Software is free of defects, merchantable, fit for a *
270 | * particular purpose or non-infringing. The entire risk as to the *
271 | * quality and performance of the Covered Software is with You. *
272 | * Should any Covered Software prove defective in any respect, You *
273 | * (not any Contributor) assume the cost of any necessary servicing, *
274 | * repair, or correction. This disclaimer of warranty constitutes an *
275 | * essential part of this License. No use of any Covered Software is *
276 | * authorized under this License except under this disclaimer. *
277 | * *
278 | ************************************************************************
279 |
280 | ************************************************************************
281 | * *
282 | * 7. Limitation of Liability *
283 | * -------------------------- *
284 | * *
285 | * Under no circumstances and under no legal theory, whether tort *
286 | * (including negligence), contract, or otherwise, shall any *
287 | * Contributor, or anyone who distributes Covered Software as *
288 | * permitted above, be liable to You for any direct, indirect, *
289 | * special, incidental, or consequential damages of any character *
290 | * including, without limitation, damages for lost profits, loss of *
291 | * goodwill, work stoppage, computer failure or malfunction, or any *
292 | * and all other commercial damages or losses, even if such party *
293 | * shall have been informed of the possibility of such damages. This *
294 | * limitation of liability shall not apply to liability for death or *
295 | * personal injury resulting from such party's negligence to the *
296 | * extent applicable law prohibits such limitation. Some *
297 | * jurisdictions do not allow the exclusion or limitation of *
298 | * incidental or consequential damages, so this exclusion and *
299 | * limitation may not apply to You. *
300 | * *
301 | ************************************************************************
302 |
303 | 8. Litigation
304 | -------------
305 |
306 | Any litigation relating to this License may be brought only in the
307 | courts of a jurisdiction where the defendant maintains its principal
308 | place of business and such litigation shall be governed by laws of that
309 | jurisdiction, without reference to its conflict-of-law provisions.
310 | Nothing in this Section shall prevent a party's ability to bring
311 | cross-claims or counter-claims.
312 |
313 | 9. Miscellaneous
314 | ----------------
315 |
316 | This License represents the complete agreement concerning the subject
317 | matter hereof. If any provision of this License is held to be
318 | unenforceable, such provision shall be reformed only to the extent
319 | necessary to make it enforceable. Any law or regulation which provides
320 | that the language of a contract shall be construed against the drafter
321 | shall not be used to construe this License against a Contributor.
322 |
323 | 10. Versions of the License
324 | ---------------------------
325 |
326 | 10.1. New Versions
327 |
328 | Mozilla Foundation is the license steward. Except as provided in Section
329 | 10.3, no one other than the license steward has the right to modify or
330 | publish new versions of this License. Each version will be given a
331 | distinguishing version number.
332 |
333 | 10.2. Effect of New Versions
334 |
335 | You may distribute the Covered Software under the terms of the version
336 | of the License under which You originally received the Covered Software,
337 | or under the terms of any subsequent version published by the license
338 | steward.
339 |
340 | 10.3. Modified Versions
341 |
342 | If you create software not governed by this License, and you want to
343 | create a new license for such software, you may create and use a
344 | modified version of this License if you rename the license and remove
345 | any references to the name of the license steward (except to note that
346 | such modified license differs from this License).
347 |
348 | 10.4. Distributing Source Code Form that is Incompatible With Secondary
349 | Licenses
350 |
351 | If You choose to distribute Source Code Form that is Incompatible With
352 | Secondary Licenses under the terms of this version of the License, the
353 | notice described in Exhibit B of this License must be attached.
354 |
355 | Exhibit A - Source Code Form License Notice
356 | -------------------------------------------
357 |
358 | This Source Code Form is subject to the terms of the Mozilla Public
359 | License, v. 2.0. If a copy of the MPL was not distributed with this
360 | file, You can obtain one at http://mozilla.org/MPL/2.0/.
361 |
362 | If it is not possible or desirable to put the notice in a particular
363 | file, then You may include the notice in a location (such as a LICENSE
364 | file in a relevant directory) where a recipient would be likely to look
365 | for such a notice.
366 |
367 | You may add additional accurate notices of copyright ownership.
368 |
369 | Exhibit B - "Incompatible With Secondary Licenses" Notice
370 | ---------------------------------------------------------
371 |
372 | This Source Code Form is "Incompatible With Secondary Licenses", as
373 | defined by the Mozilla Public License, v. 2.0.
374 |
--------------------------------------------------------------------------------