For #1430 - Adds a changelog entry

nightly-build-test
Jeff Boek 6 years ago
parent 5acd386ecd
commit e98db8bfb8

@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- #1239 - Added the ability to move bookmark folders - #1239 - Added the ability to move bookmark folders
- #1068 - Adds the ability to quickly copy the URL by long clicking the URLBar - #1068 - Adds the ability to quickly copy the URL by long clicking the URLBar
- #1170: Allow user to add a new site exception to site permissions - #1170: Allow user to add a new site exception to site permissions
- #1430 - Adds the Fenix Snackbar
### Changed ### Changed
- #1429 - Updated site permissions ui for MVP - #1429 - Updated site permissions ui for MVP
### Removed ### Removed

@ -65,7 +65,6 @@ import org.mozilla.fenix.components.toolbar.ToolbarIntegration
import org.mozilla.fenix.components.toolbar.ToolbarMenu import org.mozilla.fenix.components.toolbar.ToolbarMenu
import org.mozilla.fenix.components.toolbar.ToolbarUIView import org.mozilla.fenix.components.toolbar.ToolbarUIView
import org.mozilla.fenix.customtabs.CustomTabsIntegration import org.mozilla.fenix.customtabs.CustomTabsIntegration
import org.mozilla.fenix.ext.asActivity
import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.requireComponents import org.mozilla.fenix.ext.requireComponents
import org.mozilla.fenix.ext.share import org.mozilla.fenix.ext.share
@ -310,6 +309,9 @@ class BrowserFragment : Fragment(), BackHandler, CoroutineScope {
} }
is SearchAction.ToolbarLongClicked -> { is SearchAction.ToolbarLongClicked -> {
getSessionByIdOrUseSelectedSession().copyUrl(requireContext()) getSessionByIdOrUseSelectedSession().copyUrl(requireContext())
FenixSnackbar.make(view!!, Snackbar.LENGTH_LONG)
.setText(resources.getString(R.string.url_copied))
.show()
} }
} }
} }
@ -514,11 +516,6 @@ class BrowserFragment : Fragment(), BackHandler, CoroutineScope {
val clipBoard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager val clipBoard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
val uri = Uri.parse(url) val uri = Uri.parse(url)
clipBoard.primaryClip = ClipData.newRawUri("Uri", uri) clipBoard.primaryClip = ClipData.newRawUri("Uri", uri)
val rootView = context.asActivity()?.window?.decorView?.findViewById<View>(android.R.id.content) as ViewGroup
FenixSnackbar.make(rootView, Snackbar.LENGTH_LONG)
.setText(context.getString(R.string.url_copied))
.show()
} }
companion object { companion object {

@ -51,7 +51,6 @@ class FenixSnackbar private constructor(
} }
} }
companion object { companion object {
const val LENGTH_LONG = Snackbar.LENGTH_LONG const val LENGTH_LONG = Snackbar.LENGTH_LONG
const val LENGTH_SHORT = Snackbar.LENGTH_SHORT const val LENGTH_SHORT = Snackbar.LENGTH_SHORT
@ -77,6 +76,7 @@ class FenixSnackbar private constructor(
} }
} }
// Use the same implementation of `Snackbar`
private fun findSuitableParent(_view: View?): ViewGroup? { private fun findSuitableParent(_view: View?): ViewGroup? {
var view = _view var view = _view
var fallback: ViewGroup? = null var fallback: ViewGroup? = null
@ -87,7 +87,7 @@ class FenixSnackbar private constructor(
} }
if (view is FrameLayout) { if (view is FrameLayout) {
if (view.id == 16908290) { if (view.id == R.id.content) {
return view return view
} }

@ -19,7 +19,6 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import androidx.navigation.Navigation import androidx.navigation.Navigation
import com.google.android.material.snackbar.Snackbar
import kotlinx.android.synthetic.main.fragment_home.* import kotlinx.android.synthetic.main.fragment_home.*
import kotlinx.android.synthetic.main.fragment_home.view.* import kotlinx.android.synthetic.main.fragment_home.view.*
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
@ -36,7 +35,6 @@ import org.mozilla.fenix.BrowsingModeManager
import org.mozilla.fenix.DefaultThemeManager import org.mozilla.fenix.DefaultThemeManager
import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.R import org.mozilla.fenix.R
import org.mozilla.fenix.components.FenixSnackbar
import org.mozilla.fenix.utils.ItsNotBrokenSnack import org.mozilla.fenix.utils.ItsNotBrokenSnack
import org.mozilla.fenix.components.metrics.Event import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.archive import org.mozilla.fenix.ext.archive

Loading…
Cancel
Save