Skip to content

Commit

Permalink
Update media-ui to use domain module instead of media-data (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
luizgrp authored May 18, 2022
1 parent 9629022 commit 90e86cf
Show file tree
Hide file tree
Showing 19 changed files with 471 additions and 606 deletions.
51 changes: 0 additions & 51 deletions media-data/api/current.api
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,3 @@ package com.google.android.horologist.media.data {

}

package com.google.android.horologist.media.data.model {

public final class TrackPosition {
ctor public TrackPosition(long current, long duration);
method public long component1();
method public long component2();
method public com.google.android.horologist.media.data.model.TrackPosition copy(long current, long duration);
method public long getCurrent();
method public long getDuration();
method public float getPercent();
property public final long current;
property public final long duration;
property public final float percent;
field public static final com.google.android.horologist.media.data.model.TrackPosition.Companion Companion;
}

public static final class TrackPosition.Companion {
method public com.google.android.horologist.media.data.model.TrackPosition getUnknown();
property public final com.google.android.horologist.media.data.model.TrackPosition Unknown;
}

}

package com.google.android.horologist.media.data.repository {

@com.google.android.horologist.media.data.ExperimentalHorologistMediaDataApi public interface PlayerRepository {
method public kotlinx.coroutines.flow.StateFlow<androidx.media3.common.Player.Commands> getAvailableCommands();
method public kotlinx.coroutines.flow.StateFlow<androidx.media3.common.MediaItem> getCurrentMediaItem();
method public Long? getSeekBackIncrement();
method public Long? getSeekForwardIncrement();
method public kotlinx.coroutines.flow.StateFlow<java.lang.Boolean> getShuffleModeEnabled();
method public kotlinx.coroutines.flow.StateFlow<com.google.android.horologist.media.data.model.TrackPosition> getTrackPosition();
method public kotlinx.coroutines.flow.StateFlow<java.lang.Boolean> isPlaying();
method public void pause();
method public void prepareAndPlay(androidx.media3.common.MediaItem mediaItem, optional boolean play);
method public void prepareAndPlay(optional java.util.List<androidx.media3.common.MediaItem>? mediaItems, optional int startIndex, optional boolean play);
method public void seekBack();
method public void seekForward();
method public void seekToNextMediaItem();
method public void seekToPreviousMediaItem();
method public void toggleShuffle();
method public void updatePosition();
property public abstract kotlinx.coroutines.flow.StateFlow<androidx.media3.common.Player.Commands> availableCommands;
property public abstract kotlinx.coroutines.flow.StateFlow<androidx.media3.common.MediaItem> currentMediaItem;
property public abstract kotlinx.coroutines.flow.StateFlow<java.lang.Boolean> isPlaying;
property public abstract kotlinx.coroutines.flow.StateFlow<java.lang.Boolean> shuffleModeEnabled;
property public abstract kotlinx.coroutines.flow.StateFlow<com.google.android.horologist.media.data.model.TrackPosition> trackPosition;
}

}

This file was deleted.

This file was deleted.

15 changes: 7 additions & 8 deletions media-ui/api/current.api
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,14 @@ package com.google.android.horologist.media.ui.state {
}

@com.google.android.horologist.media.ui.ExperimentalHorologistMediaUiApi public class PlayerViewModel extends androidx.lifecycle.ViewModel {
ctor public PlayerViewModel(com.google.android.horologist.media.data.repository.PlayerRepository playerRepository);
ctor public PlayerViewModel(com.google.android.horologist.media.repository.PlayerRepository playerRepository);
method public final kotlinx.coroutines.flow.StateFlow<com.google.android.horologist.media.ui.state.PlayerUiState> getPlayerUiState();
method public final void pause();
method public final void prepareAndPlay();
method public final void play();
method public final void seekBack();
method public final void seekForward();
method public final void seekToNextMediaItem();
method public final void seekToPreviousMediaItem();
method public final void toggleShuffle();
method public final void skipToNextMediaItem();
method public final void skipToPreviousMediaItem();
property public final kotlinx.coroutines.flow.StateFlow<com.google.android.horologist.media.ui.state.PlayerUiState> playerUiState;
field public static final com.google.android.horologist.media.ui.state.PlayerViewModel.Companion Companion;
}
Expand All @@ -196,17 +195,17 @@ package com.google.android.horologist.media.ui.state {
package com.google.android.horologist.media.ui.state.mapper {

@com.google.android.horologist.media.ui.ExperimentalHorologistMediaUiApi public final class MediaItemUiModelMapper {
method public com.google.android.horologist.media.ui.state.model.MediaItemUiModel map(androidx.media3.common.MediaItem mediaItem);
method public com.google.android.horologist.media.ui.state.model.MediaItemUiModel map(com.google.android.horologist.media.model.MediaItem mediaItem);
field public static final com.google.android.horologist.media.ui.state.mapper.MediaItemUiModelMapper INSTANCE;
}

@com.google.android.horologist.media.ui.ExperimentalHorologistMediaUiApi public final class PlayerUiStateMapper {
method public com.google.android.horologist.media.ui.state.PlayerUiState map(androidx.media3.common.Player.Commands playerCommands, boolean shuffleModeEnabled, boolean isPlaying, androidx.media3.common.MediaItem? mediaItem, com.google.android.horologist.media.data.model.TrackPosition? trackPosition);
method public com.google.android.horologist.media.ui.state.PlayerUiState map(com.google.android.horologist.media.model.PlayerState currentState, java.util.Set<? extends com.google.android.horologist.media.model.Command> availableCommands, com.google.android.horologist.media.model.MediaItem? mediaItem, com.google.android.horologist.media.model.MediaItemPosition? mediaItemPosition, boolean shuffleModeEnabled);
field public static final com.google.android.horologist.media.ui.state.mapper.PlayerUiStateMapper INSTANCE;
}

@com.google.android.horologist.media.ui.ExperimentalHorologistMediaUiApi public final class TrackPositionUiModelMapper {
method public com.google.android.horologist.media.ui.state.model.TrackPositionUiModel map(com.google.android.horologist.media.data.model.TrackPosition trackPosition);
method public com.google.android.horologist.media.ui.state.model.TrackPositionUiModel map(com.google.android.horologist.media.model.MediaItemPosition mediaItemPosition);
field public static final com.google.android.horologist.media.ui.state.mapper.TrackPositionUiModelMapper INSTANCE;
}

Expand Down
3 changes: 1 addition & 2 deletions media-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile.class).co
}

dependencies {
implementation projects.mediaData
implementation projects.media
implementation libs.kotlin.stdlib
implementation libs.androidx.wear
implementation libs.androidx.lifecycle.runtime
Expand All @@ -89,7 +89,6 @@ dependencies {
implementation libs.compose.ui.tooling
implementation libs.compose.material.iconscore
implementation libs.compose.material.iconsext
implementation libs.androidx.media3.common

debugImplementation libs.compose.ui.test.manifest
debugImplementation libs.compose.ui.toolingpreview
Expand Down
Loading

0 comments on commit 90e86cf

Please sign in to comment.