Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/Jetcaster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ jobs:
with:
name: Jetcaster
path: Jetcaster
module: mobile
7 changes: 5 additions & 2 deletions .github/workflows/build-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
path:
required: true
type: string
module:
default: "app"
type: string

concurrency:
group: ${{ inputs.name }}-build-${{ github.ref }}
Expand Down Expand Up @@ -66,11 +69,11 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: build-outputs
path: ${{ inputs.path }}/app/build/outputs
path: ${{ inputs.path }}/${{ inputs.module }}/build/outputs

- name: Upload build reports
if: always()
uses: actions/upload-artifact@v4
with:
name: build-reports
path: ${{ inputs.path }}/app/build/reports
path: ${{ inputs.path }}/${{ inputs.module }}/build/reports
34 changes: 17 additions & 17 deletions Jetcaster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Some other notable things which are implemented:
### Architecture
The app is built in a Redux-style, where each UI 'screen' has its own [ViewModel][viewmodel], which exposes a single [StateFlow][stateflow] containing the entire view state. Each [ViewModel][viewmodel] is responsible for subscribing to any data streams required for the view, as well as exposing functions which allow the UI to send events.

Using the example of the home screen in the [`com.example.jetcaster.ui.home`](app/src/main/java/com/example/jetcaster/ui/home) package:
Using the example of the home screen in the [`com.example.jetcaster.ui.home`](mobile/src/main/java/com/example/jetcaster/ui/home) package:

- The ViewModel is implemented as [`HomeViewModel`][homevm], which exposes a `StateFlow<HomeViewState>` for the UI to observe.
- [`HomeViewState`][homevm] contains the complete view state for the home screen as an [`@Immutable`](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Immutable) `data class`.
Expand All @@ -55,9 +55,9 @@ val viewState by viewModel.state.collectAsStateWithLifecycle()

This pattern is used across the different screens:

- __Home:__ [`com.example.jetcaster.ui.home`](app/src/main/java/com/example/jetcaster/ui/home)
- __Discover:__ [`com.example.jetcaster.ui.home.discover`](app/src/main/java/com/example/jetcaster/ui/home/discover)
- __Podcast Category:__ [`com.example.jetcaster.ui.category`](app/src/main/java/com/example/jetcaster/ui/home/category)
- __Home:__ [`com.example.jetcaster.ui.home`](mobile/src/main/java/com/example/jetcaster/ui/home)
- __Discover:__ [`com.example.jetcaster.ui.home.discover`](mobile/src/main/java/com/example/jetcaster/ui/home/discover)
- __Podcast Category:__ [`com.example.jetcaster.ui.category`](mobile/src/main/java/com/example/jetcaster/ui/home/category)

## Wear

Expand Down Expand Up @@ -93,7 +93,7 @@ own [ViewModel][viewmodel] which exposes a `StateFlow<ScreenState>` for the UI t

### Podcast data

The podcast data in this sample is dynamically fetched from a number of podcast RSS feeds, which are listed in [`Feeds.kt`](app/src/main/java/com/example/jetcaster/data/Feeds.kt).
The podcast data in this sample is dynamically fetched from a number of podcast RSS feeds, which are listed in [`Feeds.kt`](mobile/src/main/java/com/example/jetcaster/data/Feeds.kt).

The [`PodcastRepository`][podcastrepo] class is responsible for handling the data fetching of all podcast information:

Expand All @@ -102,11 +102,11 @@ The [`PodcastRepository`][podcastrepo] class is responsible for handling the dat

### Follow podcasts

The sample allows users to 'follow' podcasts, which is implemented within the data layer in the [`PodcastFollowedEntry`](app/src/main/java/com/example/jetcaster/data/PodcastFollowedEntry.kt) entity class, and as functions in [PodcastStore][podcaststore]: `followPodcast()`, `unfollowPodcast()`.
The sample allows users to 'follow' podcasts, which is implemented within the data layer in the [`PodcastFollowedEntry`](mobile/src/main/java/com/example/jetcaster/data/PodcastFollowedEntry.kt) entity class, and as functions in [PodcastStore][podcaststore]: `followPodcast()`, `unfollowPodcast()`.

### Date + time

The sample uses the JDK 8 [date and time APIs](https://developer.android.com/reference/java/time/package-summary) through the [desugaring support][jdk8desugar] available in Android Gradle Plugin 4.0+. Relevant Room [`TypeConverters`](https://developer.android.com/reference/kotlin/androidx/room/TypeConverters) are implemented in [`DateTimeTypeConverters.kt`](app/src/main/java/com/example/jetcaster/data/room/DateTimeTypeConverters.kt).
The sample uses the JDK 8 [date and time APIs](https://developer.android.com/reference/java/time/package-summary) through the [desugaring support][jdk8desugar] available in Android Gradle Plugin 4.0+. Relevant Room [`TypeConverters`](https://developer.android.com/reference/kotlin/androidx/room/TypeConverters) are implemented in [`DateTimeTypeConverters.kt`](mobile/src/main/java/com/example/jetcaster/data/room/DateTimeTypeConverters.kt).

## License

Expand All @@ -126,15 +126,15 @@ See the License for the specific language governing permissions and
limitations under the License.
```

[feeds]: app/src/main/java/com/example/jetcaster/data/Feeds.kt
[fetcher]: app/src/main/java/com/example/jetcaster/data/PodcastFetcher.kt
[podcastrepo]: app/src/main/java/com/example/jetcaster/data/PodcastsRepository.kt
[podcaststore]: app/src/main/java/com/example/jetcaster/data/PodcastStore.kt
[epstore]: app/src/main/java/com/example/jetcaster/data/EpisodeStore.kt
[catstore]: app/src/main/java/com/example/jetcaster/data/CategoryStore.kt
[db]: app/src/main/java/com/example/jetcaster/data/room/JetcasterDatabase.kt
[homevm]: app/src/main/java/com/example/jetcaster/ui/home/HomeViewModel.kt
[homeui]: app/src/main/java/com/example/jetcaster/ui/home/Home.kt
[feeds]: mobile/src/main/java/com/example/jetcaster/data/Feeds.kt
[fetcher]: mobile/src/main/java/com/example/jetcaster/data/PodcastFetcher.kt
[podcastrepo]: mobile/src/main/java/com/example/jetcaster/data/PodcastsRepository.kt
[podcaststore]: mobile/src/main/java/com/example/jetcaster/data/PodcastStore.kt
[epstore]: mobile/src/main/java/com/example/jetcaster/data/EpisodeStore.kt
[catstore]: mobile/src/main/java/com/example/jetcaster/data/CategoryStore.kt
[db]: mobile/src/main/java/com/example/jetcaster/data/room/JetcasterDatabase.kt
[homevm]: mobile/src/main/java/com/example/jetcaster/ui/home/HomeViewModel.kt
[homeui]: mobile/src/main/java/com/example/jetcaster/ui/home/Home.kt
[compose]: https://developer.android.com/jetpack/compose
[palette]: https://developer.android.com/reference/kotlin/androidx/palette/graphics/package-summary
[room]: https://developer.android.com/topic/libraries/architecture/room
Expand All @@ -150,4 +150,4 @@ limitations under the License.
[wearmediaguidance]: https://developer.android.com/media/implement/surfaces/wear-os#play-downloaded-content
[horologist]: https://google.github.io/horologist/
[entityscreen]: https://github.com/google/horologist/blob/main/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/entity/EntityScreen.kt
[mediappsbestpractices]: https://developer.android.com/design/ui/wear/guides/foundations/media-apps
[mediappsbestpractices]: https://developer.android.com/design/ui/wear/guides/foundations/media-apps
File renamed without changes.
2 changes: 1 addition & 1 deletion Jetcaster/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ dependencyResolutionManagement {
}
}
rootProject.name = "Jetcaster"
include(":app", ":core", ":core:model", ":designsystem", ":tv-app", ":wear")
include(":mobile", ":core", ":core:model", ":designsystem", ":tv-app", ":wear")
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")