aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-09-29 02:51:09 -0700
committerGitHub <noreply@github.com>2019-09-29 02:51:09 -0700
commit8932e9f5eb9995729f674ebe02464a6f20f4d1ec (patch)
treeb40f3f7d1b291b0d38b84f7bb36d44863e4cad43
parent980c8ded82e5d8aba4626aed09650dba1992ebf9 (diff)
parent2da6aef03b8a3aba0a76964764f01cd1b26ab401 (diff)
downloadfrost-8932e9f5eb9995729f674ebe02464a6f20f4d1ec.tar.gz
frost-8932e9f5eb9995729f674ebe02464a6f20f4d1ec.tar.bz2
frost-8932e9f5eb9995729f674ebe02464a6f20f4d1ec.zip
Merge pull request #1563 from AllanWang/notification-shortcut
Overlay Context Updates
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/WebOverlayActivity.kt14
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt3
-rw-r--r--app/src/main/play/en-US/whatsnew4
-rw-r--r--app/src/main/res/menu/menu_web.xml11
-rw-r--r--app/src/main/res/values/strings_web_context.xml1
-rw-r--r--app/src/main/res/xml/frost_changelog.xml2
-rw-r--r--docs/Changelog.md2
7 files changed, 21 insertions, 16 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/WebOverlayActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/WebOverlayActivity.kt
index 3a6af146..c3d77dc5 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/WebOverlayActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/WebOverlayActivity.kt
@@ -38,8 +38,8 @@ import ca.allanwang.kau.utils.dpToPx
import ca.allanwang.kau.utils.finishSlideOut
import ca.allanwang.kau.utils.materialDialog
import ca.allanwang.kau.utils.navigationBarColor
-import ca.allanwang.kau.utils.setMenuIcons
import ca.allanwang.kau.utils.shareText
+import ca.allanwang.kau.utils.startLink
import ca.allanwang.kau.utils.statusBarColor
import ca.allanwang.kau.utils.tint
import ca.allanwang.kau.utils.toDrawable
@@ -47,7 +47,6 @@ import ca.allanwang.kau.utils.toast
import ca.allanwang.kau.utils.withAlpha
import ca.allanwang.kau.utils.withMainContext
import com.google.android.material.snackbar.BaseTransientBottomBar
-import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.contracts.ActivityContract
@@ -314,18 +313,15 @@ abstract class WebOverlayActivityBase(private val userAgent: String = USER_AGENT
menuInflater.inflate(R.menu.menu_web, menu)
overlayContext?.onMenuCreate(this, menu)
toolbar.tint(Prefs.iconColor)
- setMenuIcons(
- menu, Prefs.iconColor,
- R.id.action_share to CommunityMaterial.Icon2.cmd_share,
- R.id.action_copy_link to GoogleMaterial.Icon.gmd_content_copy
- )
return true
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
+ val url = web.currentUrl.formattedFbUrl
when (item.itemId) {
- R.id.action_copy_link -> copyToClipboard(web.currentUrl.formattedFbUrl)
- R.id.action_share -> shareText(web.currentUrl.formattedFbUrl)
+ R.id.action_copy_link -> copyToClipboard(url)
+ R.id.action_share -> shareText(url)
+ R.id.action_open_in_browser -> startLink(url)
else -> if (!OverlayContext.onOptionsItemSelected(web, item.itemId))
return super.onOptionsItemSelected(item)
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt b/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt
index e4d0b485..955d6482 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt
@@ -258,9 +258,8 @@ enum class NotificationType(
* and will only show if we have at least 2 notifications
*/
private fun summaryNotification(context: Context, userId: Long, count: Int): FrostNotification {
- val intent = Intent(context, FrostWebActivity::class.java)
+ val intent = createCommonIntent(context, userId)
intent.data = Uri.parse(fbItem.url)
- intent.putExtra(ARG_USER_ID, userId)
val group = "${groupPrefix}_$userId"
val pendingIntent =
PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
diff --git a/app/src/main/play/en-US/whatsnew b/app/src/main/play/en-US/whatsnew
index 2c68cc55..6f1d0b36 100644
--- a/app/src/main/play/en-US/whatsnew
+++ b/app/src/main/play/en-US/whatsnew
@@ -3,4 +3,6 @@ v2.4.1
* Add better support for mobile url conversions
* Notification tab will keep first page in the same window; fixes marking notifications as read
* Fix nav and status bar icon colors for custom themes (Android O+)
-* Fix biometric prompt, and prompt on activity resume \ No newline at end of file
+* Fix biometric prompt, and prompt on activity resume
+* Fix notification title
+* Add option to open overlay links in browser \ No newline at end of file
diff --git a/app/src/main/res/menu/menu_web.xml b/app/src/main/res/menu/menu_web.xml
index 5baefa1b..15394c75 100644
--- a/app/src/main/res/menu/menu_web.xml
+++ b/app/src/main/res/menu/menu_web.xml
@@ -5,14 +5,17 @@
<item
android:id="@+id/action_copy_link"
- android:orderInCategory="100"
android:title="@string/copy_link"
- app:showAsAction="ifRoom" />
+ app:showAsAction="never" />
<item
android:id="@+id/action_share"
- android:orderInCategory="200"
android:title="@string/kau_share"
- app:showAsAction="ifRoom" />
+ app:showAsAction="never" />
+
+ <item
+ android:id="@+id/action_open_in_browser"
+ android:title="@string/open_in_browser"
+ app:showAsAction="never" />
</menu>
diff --git a/app/src/main/res/values/strings_web_context.xml b/app/src/main/res/values/strings_web_context.xml
index 2a8ca71c..fe3972cb 100644
--- a/app/src/main/res/values/strings_web_context.xml
+++ b/app/src/main/res/values/strings_web_context.xml
@@ -11,4 +11,5 @@
<string name="copy_link">Copy Link</string>
<string name="copy_text">Copy Text</string>
<string name="debug_image_link_subject" translatable="false">Frost for Facebook: Image Link Debug</string>
+ <string name="open_in_browser">Open in browser</string>
</resources> \ No newline at end of file
diff --git a/app/src/main/res/xml/frost_changelog.xml b/app/src/main/res/xml/frost_changelog.xml
index 88216d63..4cf51cb0 100644
--- a/app/src/main/res/xml/frost_changelog.xml
+++ b/app/src/main/res/xml/frost_changelog.xml
@@ -11,6 +11,8 @@
<item text="Notification tab will keep first page in the same window; fixes marking notifications as read" />
<item text="Fix nav and status bar icon colors for custom themes (Android O+)" />
<item text="Fix biometric prompt, and prompt on activity resume" />
+ <item text="Fix notification title" />
+ <item text="Add option to open overlay links in browser" />
<item text="" />
<version title="v2.4.0" />
diff --git a/docs/Changelog.md b/docs/Changelog.md
index 30820aa0..673f2e22 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -5,6 +5,8 @@
* Notification tab will keep first page in the same window; fixes marking notifications as read
* Fix nav and status bar icon colors for custom themes (Android O+)
* Fix biometric prompt, and prompt on activity resume
+* Fix notification title
+* Add option to open overlay links in browser
## v2.4.0
* Removed request services, which potentially caused phishing warnings.