forked from oppia/oppia-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added audio based content highlighting - to highlight the correct rec…
…ycler view item based on the audio track playing.
- Loading branch information
Showing
8 changed files
with
90 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 9 additions & 1 deletion
10
app/src/main/java/org/oppia/android/app/player/state/itemviewmodel/ContentViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
package org.oppia.android.app.player.state.itemviewmodel | ||
|
||
import androidx.databinding.Observable | ||
import androidx.databinding.ObservableField | ||
|
||
/** [StateItemViewModel] for content-card state. */ | ||
class ContentViewModel( | ||
val contentId: String, | ||
val htmlContent: CharSequence, | ||
val gcsEntityId: String, | ||
val hasConversationView: Boolean, | ||
val isSplitView: Boolean, | ||
val supportsConceptCards: Boolean | ||
) : StateItemViewModel(ViewType.CONTENT) | ||
) : StateItemViewModel(ViewType.CONTENT) { | ||
val isPlaying = ObservableField<Boolean>(false) | ||
|
||
fun updateIsAudioPlaying(playing: Boolean) = isPlaying.set(playing) | ||
} |
16 changes: 15 additions & 1 deletion
16
app/src/main/java/org/oppia/android/app/player/state/itemviewmodel/FeedbackViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
package org.oppia.android.app.player.state.itemviewmodel | ||
|
||
import androidx.databinding.ObservableField | ||
import androidx.lifecycle.LiveData | ||
import androidx.lifecycle.MutableLiveData | ||
|
||
/** [StateItemViewModel] for feedback blurbs. */ | ||
class FeedbackViewModel( | ||
val contentId: String, | ||
val htmlContent: CharSequence, | ||
val gcsEntityId: String, | ||
val hasConversationView: Boolean, | ||
val isSplitView: Boolean, | ||
val supportsConceptCards: Boolean | ||
) : StateItemViewModel(ViewType.FEEDBACK) | ||
) : StateItemViewModel(ViewType.FEEDBACK) { | ||
val isPlaying = ObservableField<Boolean>(false) | ||
val isInitialized: MutableLiveData<Boolean> = MutableLiveData(false) | ||
|
||
fun updateIsAudioPlaying(playing: Boolean) = isPlaying.set(playing) | ||
|
||
fun updateIsInitialized(initialized: Boolean) { | ||
isInitialized.value = initialized | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
<stroke | ||
android:width="2dp" | ||
android:color="@color/oppiaContentHighlighting"/> | ||
<corners | ||
android:radius="4dp"/> | ||
<solid | ||
android:color="@color/oppiaSolidBlue"/> | ||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters