Skip to content

Commit

Permalink
Merge branch 'main' into fix/chromecast-discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
mchowning authored Feb 16, 2023
2 parents 4a9b17a + 1190e87 commit e816504
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 4 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
7.33
-----

* Bug Fixes:
* Improve discovery of chromecast devices.
* App no longer crashes when the device browser has been disabled
([#762](https://github.com/Automattic/pocket-casts-android/issues/762)).
* Improve discovery of chromecast devices
([#780](https://github.com/Automattic/pocket-casts-android/issues/780)).

7.32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,19 @@ class PodcastViewModel
launch {
podcast.value?.let {
podcastManager.updateEpisodesSortType(it, episodesSortType)
analyticsTracker.track(
AnalyticsEvent.PODCASTS_SCREEN_SORT_ORDER_CHANGED,
mapOf(
"sort_order" to when (episodesSortType) {
EpisodesSortType.EPISODES_SORT_BY_DATE_ASC -> "oldest_to_newest"
EpisodesSortType.EPISODES_SORT_BY_DATE_DESC -> "newest_to_oldest"
EpisodesSortType.EPISODES_SORT_BY_LENGTH_ASC -> "shortest_to_longest"
EpisodesSortType.EPISODES_SORT_BY_LENGTH_DESC -> "longest_to_shortest"
EpisodesSortType.EPISODES_SORT_BY_TITLE_ASC -> "title_a_to_z"
EpisodesSortType.EPISODES_SORT_BY_TITLE_DESC -> "title_z_to_a"
}
)
)
}
}
}
Expand All @@ -253,6 +266,18 @@ class PodcastViewModel
launch {
podcast.value?.let {
podcastManager.updateGrouping(it, grouping)
analyticsTracker.track(
AnalyticsEvent.PODCASTS_SCREEN_EPISODE_GROUPING_CHANGED,
mapOf(
"value" to when (grouping) {
PodcastGrouping.None -> "none"
PodcastGrouping.Downloaded -> "downloaded"
PodcastGrouping.Season -> "season"
PodcastGrouping.Unplayed -> "unplayed"
PodcastGrouping.Starred -> "starred"
}
)
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ enum class AnalyticsEvent(val key: String) {
PODCAST_SCREEN_TOGGLE_ARCHIVED("podcast_screen_toggle_archived"),
PODCAST_SCREEN_TOGGLE_SUMMARY("podcast_screen_toggle_summary"),
PODCAST_SCREEN_SHARE_TAPPED("podcast_screen_share_tapped"),
PODCASTS_SCREEN_SORT_ORDER_CHANGED("podcasts_screen_sort_order_changed"),
PODCASTS_SCREEN_EPISODE_GROUPING_CHANGED("podcasts_screen_episode_grouping_changed"),

/* Podcast Settings */
PODCAST_SETTINGS_FEED_ERROR_TAPPED("podcast_settings_feed_error_tapped"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1603,4 +1603,5 @@
<string name="filter_id_description">An unique ID that represents the filter. Can be used on the \'Query Filter Episodes\' action.</string>
<string name="filter_title">Filter Title</string>
<string name="filter_id_or_title">Filter ID or Title</string>
<string name="error_opening_links_activity_not_found">Looks like you don\'t have an app capable of viewing this content.</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import android.content.ActivityNotFoundException
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import au.com.shiftyjelly.pocketcasts.localization.R
import au.com.shiftyjelly.pocketcasts.preferences.BuildConfig
import au.com.shiftyjelly.pocketcasts.preferences.Settings
import java.io.UnsupportedEncodingException
Expand Down Expand Up @@ -93,8 +95,16 @@ object IntentUtil {
var urlFound: String = url ?: return true
val urlLower = urlFound.lowercase()
if (urlLower.startsWith("http://") || urlLower.startsWith("https://") || urlLower.startsWith("ftp://") || urlLower.startsWith("market://")) {
context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(urlFound)))
return true
try {
context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(urlFound)))
return true
} catch (e: ActivityNotFoundException) {
Toast.makeText(
context,
context.getString(R.string.error_opening_links_activity_not_found),
Toast.LENGTH_LONG
).show()
}
}
if (urlFound.startsWith("mailto:")) {
try {
Expand Down

0 comments on commit e816504

Please sign in to comment.