1
0
Fork 0

For #5959 & #5958: Integrates download feature into Fenix (#6368)

master
Sawyer Blatz 2019-10-31 14:37:05 -07:00 committed by GitHub
parent 675fe6a3a9
commit e62407e766
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 1 deletions

View File

@ -246,6 +246,16 @@
<meta-data
android:name="firebase_analytics_collection_enabled"
android:value="false" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
</application>
</manifest>

View File

@ -10,6 +10,7 @@ import android.content.pm.ActivityInfo
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@ -74,6 +75,7 @@ import org.mozilla.fenix.components.toolbar.ToolbarIntegration
import org.mozilla.fenix.downloads.DownloadService
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.enterToImmersiveMode
import org.mozilla.fenix.ext.getDimenInDip
import org.mozilla.fenix.ext.getRootView
import org.mozilla.fenix.ext.metrics
import org.mozilla.fenix.ext.nav
@ -262,6 +264,13 @@ abstract class BaseBrowserFragment : Fragment(), BackHandler, SessionManager.Obs
context.applicationContext,
DownloadService::class
),
promptsStyling = DownloadsFeature.PromptsStyling(
gravity = Gravity.BOTTOM,
shouldWidthMatchParent = true,
positiveButtonBackgroundColor = ThemeManager.resolveAttribute(R.attr.accent, context),
positiveButtonTextColor = ThemeManager.resolveAttribute(R.attr.primaryText, context),
positiveButtonRadius = context.getDimenInDip(R.dimen.tab_corner_radius)
),
onNeedToRequestPermissions = { permissions ->
requestPermissions(permissions, REQUEST_CODE_DOWNLOAD_PERMISSIONS)
}),

View File

@ -0,0 +1,9 @@
<!-- 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/. -->
<paths>
<external-path
name="Download"
path="." />
</paths>

File diff suppressed because one or more lines are too long