Skip to content

Commit

Permalink
Merge branch 'main' into merge/release-7.24.2-into-main
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
ashiagr committed Oct 21, 2022
2 parents 61d780f + ff8ce0c commit 6a9701d
Show file tree
Hide file tree
Showing 150 changed files with 2,704 additions and 746 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
7.26
-----

* New Features:
* Fixed skip backwards settings
([#425](https://github.com/Automattic/pocket-casts-android/pull/425)).
* Fixed background color for screens using the compose theme
([#432](https://github.com/Automattic/pocket-casts-android/pull/432)).

7.25
-----

* Bug Fixes:
* Allow Discover feed collection titles to wrap.
([#335](https://github.com/Automattic/pocket-casts-android/pull/335)).
* Allow select text in show notes from episode details view.
([#372](https://github.com/Automattic/pocket-casts-android/pull/372)).
* Added Automotive OS setting to show played episodes.
([#389](https://github.com/Automattic/pocket-casts-android/pull/389)).
* Added new episode lists to Automotive OS. Starred, Listening History, and Files.
([#403](https://github.com/Automattic/pocket-casts-android/pull/403)).

7.24.2
-----

Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
# Pocket Casts Android
<p align="center">
<img src="https://user-images.githubusercontent.com/308331/194037473-41ad7eba-8602-4be5-be73-49e3c0c48c12.svg#gh-light-mode-only" />
<img src="https://user-images.githubusercontent.com/308331/194041226-4c6d8181-cafa-4ea8-8735-1d8106f5e5f6.svg#gh-dark-mode-only" />
</p>

<p align="center">
<a href="https://buildkite.com/automattic/pocket-casts-android"><img src="https://badge.buildkite.com/dc67ef3537ad6cf097ff193b28063347418205a341d55f9940.svg?branch=main" /></a>
<a href="https://github.com/Automattic/pocket-casts-android/blob/main/LICENSE.md"><img src="https://img.shields.io/badge/license-MPL-blue" /></a>
</p>

<p align="center">
Pocket Casts is the world's most powerful podcast platform, an app by listeners, for listeners.
</p>

## Install

If you're just looking to install Pocket Casts Android, you can find it on [Google Play](https://play.google.com/store/apps/details?id=au.com.shiftyjelly.pocketcasts). If you're a developer wanting to contribute, read on.

Expand Down
7 changes: 3 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ apply from: "../base.gradle"
apply plugin: 'com.google.android.gms.oss-licenses-plugin'

android {
namespace 'au.com.shiftyjelly.pocketcasts'

defaultConfig {
applicationId project.applicationId
multiDexEnabled true
Expand All @@ -26,10 +28,6 @@ android {
compose true
}

lintOptions {
abortOnError false
}

buildTypes {
debug {
applicationIdSuffix '.debug'
Expand Down Expand Up @@ -69,6 +67,7 @@ android {
}

sentry {
includeProguardMapping = file("$rootDir/sentry.properties").exists()
tracingInstrumentation {
features = EnumSet.allOf(InstrumentationFeature) - InstrumentationFeature.FILE_IO
}
Expand Down
28 changes: 28 additions & 0 deletions app/src/debug/res/xml/shortcuts.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<shortcuts xmlns:android="https://schemas.android.com/apk/res/android">

<shortcut android:icon="@drawable/shortcut_grid" android:enabled="true" android:shortcutId="shortcut-podcasts" android:shortcutShortLabel="@string/podcasts">
<intent android:targetPackage="au.com.shiftyjelly.pocketcasts.debug"
android:targetClass="au.com.shiftyjelly.pocketcasts.ui.MainActivity"
android:action="android.intent.action.VIEW">
<extra android:name="launch-page" android:value="podcasts" />
</intent>
</shortcut>

<shortcut android:icon="@drawable/shortcut_search" android:enabled="true" android:shortcutId="shortcut-search" android:shortcutShortLabel="@string/search">
<intent android:targetPackage="au.com.shiftyjelly.pocketcasts.debug"
android:targetClass="au.com.shiftyjelly.pocketcasts.ui.MainActivity"
android:action="android.intent.action.VIEW">
<extra android:name="launch-page" android:value="search" />
</intent>
</shortcut>

<shortcut android:icon="@drawable/shortcut_upnext" android:enabled="true" android:shortcutId="shortcut-up-next" android:shortcutShortLabel="@string/up_next">
<intent android:targetPackage="au.com.shiftyjelly.pocketcasts.debug"
android:targetClass="au.com.shiftyjelly.pocketcasts.ui.MainActivity"
android:action="android.intent.action.VIEW">
<extra android:name="launch-page" android:value="upnext" />
</intent>
</shortcut>

</shortcuts>
28 changes: 28 additions & 0 deletions app/src/debugProd/res/xml/shortcuts.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<shortcuts xmlns:android="https://schemas.android.com/apk/res/android">

<shortcut android:icon="@drawable/shortcut_grid" android:enabled="true" android:shortcutId="shortcut-podcasts" android:shortcutShortLabel="@string/podcasts">
<intent android:targetPackage="au.com.shiftyjelly.pocketcasts.debug"
android:targetClass="au.com.shiftyjelly.pocketcasts.ui.MainActivity"
android:action="android.intent.action.VIEW">
<extra android:name="launch-page" android:value="podcasts" />
</intent>
</shortcut>

<shortcut android:icon="@drawable/shortcut_search" android:enabled="true" android:shortcutId="shortcut-search" android:shortcutShortLabel="@string/search">
<intent android:targetPackage="au.com.shiftyjelly.pocketcasts.debug"
android:targetClass="au.com.shiftyjelly.pocketcasts.ui.MainActivity"
android:action="android.intent.action.VIEW">
<extra android:name="launch-page" android:value="search" />
</intent>
</shortcut>

<shortcut android:icon="@drawable/shortcut_upnext" android:enabled="true" android:shortcutId="shortcut-up-next" android:shortcutShortLabel="@string/up_next">
<intent android:targetPackage="au.com.shiftyjelly.pocketcasts.debug"
android:targetClass="au.com.shiftyjelly.pocketcasts.ui.MainActivity"
android:action="android.intent.action.VIEW">
<extra android:name="launch-page" android:value="upnext" />
</intent>
</shortcut>

</shortcuts>
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="https://schemas.android.com/apk/res/android"
xmlns:tools="https://schemas.android.com/tools" package="au.com.shiftyjelly.pocketcasts">
xmlns:tools="https://schemas.android.com/tools">

<supports-screens
android:largeScreens="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.appcompat.widget.Toolbar
import androidx.compose.ui.res.stringResource
import androidx.core.view.isVisible
import androidx.core.view.updatePadding
import androidx.fragment.app.Fragment
Expand All @@ -26,13 +27,18 @@ import au.com.shiftyjelly.pocketcasts.account.PromoCodeUpgradedFragment
import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsEvent
import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsTrackerWrapper
import au.com.shiftyjelly.pocketcasts.analytics.FirebaseAnalyticsTracker
import au.com.shiftyjelly.pocketcasts.compose.AppTheme
import au.com.shiftyjelly.pocketcasts.compose.bottomsheet.BottomSheetContentState
import au.com.shiftyjelly.pocketcasts.compose.bottomsheet.BottomSheetContentState.Content.Button
import au.com.shiftyjelly.pocketcasts.compose.bottomsheet.ModalBottomSheet
import au.com.shiftyjelly.pocketcasts.databinding.ActivityMainBinding
import au.com.shiftyjelly.pocketcasts.discover.view.DiscoverFragment
import au.com.shiftyjelly.pocketcasts.filters.FiltersFragment
import au.com.shiftyjelly.pocketcasts.localization.helper.LocaliseHelper
import au.com.shiftyjelly.pocketcasts.models.entity.Episode
import au.com.shiftyjelly.pocketcasts.models.entity.Podcast
import au.com.shiftyjelly.pocketcasts.models.to.SignInState
import au.com.shiftyjelly.pocketcasts.models.type.EpisodeViewSource
import au.com.shiftyjelly.pocketcasts.navigation.BottomNavigator
import au.com.shiftyjelly.pocketcasts.navigation.FragmentInfo
import au.com.shiftyjelly.pocketcasts.navigation.NavigatorAction
Expand All @@ -58,6 +64,7 @@ import au.com.shiftyjelly.pocketcasts.repositories.playback.PlaybackManager
import au.com.shiftyjelly.pocketcasts.repositories.playback.PlaybackManager.PlaybackSource
import au.com.shiftyjelly.pocketcasts.repositories.playback.PlaybackState
import au.com.shiftyjelly.pocketcasts.repositories.playback.UpNextQueue
import au.com.shiftyjelly.pocketcasts.repositories.playback.UpNextSource
import au.com.shiftyjelly.pocketcasts.repositories.podcast.EpisodeManager
import au.com.shiftyjelly.pocketcasts.repositories.podcast.PlaylistManager
import au.com.shiftyjelly.pocketcasts.repositories.podcast.PodcastManager
Expand Down Expand Up @@ -125,6 +132,7 @@ class MainActivity :

companion object {
private const val INITIAL_KEY = "initial"
private const val SOURCE_KEY = "source"
init {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true)
}
Expand Down Expand Up @@ -246,6 +254,10 @@ class MainActivity :
handleIntent(intent, savedInstanceState)

updateSystemColors()

if (BuildConfig.END_OF_YEAR_ENABLED) {
setupEndOfYearLaunchBottomSheet()
}
}

override fun onStart() {
Expand Down Expand Up @@ -431,11 +443,37 @@ class MainActivity :
}

override fun onUpNextClicked() {
showBottomSheet(UpNextFragment())
showUpNextFragment(UpNextSource.MINI_PLAYER)
}

override fun onMiniPlayerLongClick() {
MiniPlayerDialog(playbackManager, podcastManager, episodeManager, supportFragmentManager).show(this)
MiniPlayerDialog(playbackManager, podcastManager, episodeManager, supportFragmentManager, analyticsTracker).show(this)
}

private fun showUpNextFragment(source: UpNextSource) {
analyticsTracker.track(AnalyticsEvent.UP_NEXT_SHOWN, mapOf(SOURCE_KEY to source.analyticsValue))
showBottomSheet(UpNextFragment.newInstance(source = source))
}

private fun setupEndOfYearLaunchBottomSheet() {
binding.modalBottomSheet.setContent {
AppTheme(themeType = theme.activeTheme) {
ModalBottomSheet(
showOnLoad = true,
content = BottomSheetContentState.Content(
titleText = stringResource(LR.string.end_of_year_launch_modal_title),
summaryText = stringResource(LR.string.end_of_year_launch_modal_summary),
primaryButton = Button.Primary(
label = stringResource(LR.string.end_of_year_launch_modal_primary_button_title),
onClick = {}
),
secondaryButton = Button.Secondary(
label = stringResource(LR.string.end_of_year_launch_modal_secondary_button_title),
),
)
)
}
}
}

@OptIn(DelicateCoroutinesApi::class)
Expand Down Expand Up @@ -522,6 +560,7 @@ class MainActivity :

override fun onStateChanged(bottomSheet: View, newState: Int) {
if (newState == BottomSheetBehavior.STATE_COLLAPSED) {
analyticsTracker.track(AnalyticsEvent.UP_NEXT_DISMISSED)
supportFragmentManager.findFragmentByTag(bottomSheetTag)?.let {
removeBottomSheetFragment(it)
}
Expand Down Expand Up @@ -580,7 +619,7 @@ class MainActivity :
if (intent.getStringExtra(INTENT_EXTRA_PAGE) == "upnext") {
intent.putExtra(INTENT_EXTRA_PAGE, null as String?)
binding.playerBottomSheet.openPlayer()
onUpNextClicked()
showUpNextFragment(UpNextSource.UP_NEXT_SHORTCUT)
}
}

Expand Down Expand Up @@ -647,6 +686,8 @@ class MainActivity :
binding.frameBottomSheet.importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO
}

override fun isUpNextShowing() = bottomSheetTag == UpNextFragment::class.java.name

private fun removeBottomSheetFragment(fragment: Fragment) {
val tag = fragment::class.java.name
supportFragmentManager.findFragmentByTag(tag)?.let {
Expand Down Expand Up @@ -811,7 +852,12 @@ class MainActivity :
// intents were being reused for notifications so we had to use the extra to pass action
val episodeUuid =
intent.extras?.getString(Settings.INTENT_OPEN_APP_EPISODE_UUID, null)
openEpisodeDialog(episodeUuid, null, forceDark = false)
openEpisodeDialog(
episodeUuid = episodeUuid,
source = EpisodeViewSource.NOTIFICATION,
podcastUuid = null,
forceDark = false
)
} else if (action == Intent.ACTION_VIEW) {
val extraPage = intent.extras?.getString(INTENT_EXTRA_PAGE, null)
if (extraPage != null) {
Expand Down Expand Up @@ -933,7 +979,12 @@ class MainActivity :
addFragment(PodcastFragment.newInstance(podcastUuid = uuid))
}

override fun openEpisodeDialog(episodeUuid: String?, podcastUuid: String?, forceDark: Boolean) {
override fun openEpisodeDialog(
episodeUuid: String?,
source: EpisodeViewSource,
podcastUuid: String?,
forceDark: Boolean
) {
episodeUuid ?: return

launch(Dispatchers.Main.immediate) {
Expand All @@ -943,13 +994,15 @@ class MainActivity :
val podcastUuidFound = podcastUuid ?: return@launch
// Assume it's an episode we don't know about
EpisodeFragment.newInstance(
episodeUuid,
episodeUuid = episodeUuid,
source = source,
podcastUuid = podcastUuidFound,
forceDark = forceDark
)
} else if (playable is Episode) {
EpisodeFragment.newInstance(
episodeUuid,
episodeUuid = episodeUuid,
source = source,
podcastUuid = podcastUuid,
forceDark = forceDark
)
Expand Down Expand Up @@ -1021,7 +1074,12 @@ class MainActivity :

val episode = result.episode
if (episode != null) {
openEpisodeDialog(episode.uuid, podcastUuid, forceDark = false)
openEpisodeDialog(
episodeUuid = episode.uuid,
source = EpisodeViewSource.SHARE,
podcastUuid = podcastUuid,
forceDark = false
)
} else {
openPodcastPage(podcastUuid)
}
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@
android:clickable="true"
android:translationZ="200dp"/>

<androidx.compose.ui.platform.ComposeView
android:id="@+id/modalBottomSheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:translationZ="200dp"/>

</androidx.coordinatorlayout.widget.CoordinatorLayout>

<au.com.shiftyjelly.pocketcasts.views.component.RadioactiveLineView
Expand Down
22 changes: 12 additions & 10 deletions automotive/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ plugins {
apply from: "../base.gradle"

android {
namespace 'au.com.shiftyjelly.pocketcasts'

defaultConfig {
applicationId project.applicationId
minSdkVersion 28
Expand Down Expand Up @@ -47,17 +49,17 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// Commented out the Automotive library as it clashes with the Material library and we don't use it. Duplicate value for resource attr/navigationIconTint.
//implementation 'androidx.car:car:1.0.0-alpha7'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'com.mikepenz:aboutlibraries-core:10.4.0'
implementation 'com.mikepenz:aboutlibraries-compose:10.4.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation project(':modules:services:localization')
implementation androidLibs.appCompat
implementation androidLibs.ktx
implementation androidLibs.design
implementation androidLibs.constraintLayout
implementation libs.aboutLibrariesCore
implementation libs.aboutLibrariesCompose
testImplementation libs.junit
androidTestImplementation androidLibs.junitExt
androidTestImplementation androidLibs.testEspressoCore

implementation project(':modules:services:localization')
implementation project(':modules:services:preferences')
implementation project(':modules:services:utils')
implementation project(':modules:services:model')
Expand Down
1 change: 0 additions & 1 deletion automotive/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="https://schemas.android.com/apk/res/android"
package="au.com.shiftyjelly.pocketcasts"
xmlns:tools="https://schemas.android.com/tools">

<uses-feature
Expand Down
Loading

0 comments on commit 6a9701d

Please sign in to comment.