-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding support for Compose assets and reference assets #537
Open
A1shK
wants to merge
17
commits into
player-ui:main
Choose a base branch
from
A1shK:composable-asset
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+639
−217
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
905c3b7
General - update gitignore and README
A1shK c7be6a4
Adding composable asset
A1shK 1be7f3c
Reference Compose assets - Collection and Badge
A1shK 24d8372
Adding support for testing
A1shK 8692974
Adding docs and consolidating the API
A1shK 25e8e3b
Adding AndroidManifest to support Compose assets
A1shK 850708f
Adding support for tags in ComposableAsset
A1shK 1dde8c7
Fixing unit tests
A1shK f6806cb
making modifier and tag common
A1shK d49cb5d
Updating github workflow to authorize people for PRs on forks
A1shK f5c1290
missed the fork
A1shK c827b09
Changing styling support
A1shK 3cb52ca
Adding styling support
A1shK 85c2178
Adding support for a theming hook
A1shK e24d8ed
Updating docs site
A1shK bf2e99d
Moving Action to compose
A1shK d96ef5b
Fixing tests
A1shK File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ _backup | |
.eslintcache | ||
.next | ||
android-tools | ||
*.iml | ||
|
||
|
||
# Xcode | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,7 @@ It's been tested on Andriod Studio Chipmunk(2021.2.1) and Android Studio Giraffe | |
Assuming you have read the [requirements on the root contributing guide](https://github.com/player-ui/player/blob/main/CONTRIBUTING.md). | ||
|
||
1. Once you have Android Studio installed, you will need to go to tools->SDK Manager->SDK Platforms. | ||
1. Make sure you have **only** the following SDK installed: Android API 32. | ||
*If you are using Android Giraffe, you may need to click on show package details and it will be under Android12L. (Android SDK Platrform 32)* | ||
1. Make sure you have **only** the following SDK installed: Android API 33. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if this is needed but I couldnt get it to build with API 32 |
||
2. The next step will be to make sure you have the right (and _only_ the right) SDK Build tools and NDK. Click on the SDK Tools tab and make sure you have only the following clicked: | ||
1. 30.0.3 | ||
2. 21.4.7075529 | ||
|
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
16 changes: 8 additions & 8 deletions
16
.../src/androidTest/java/com/intuit/playerui/android/reference/demo/test/MainActivityTest.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,31 +1,31 @@ | ||
package com.intuit.playerui.android.reference.demo.test | ||
|
||
import androidx.test.espresso.Espresso.onView | ||
import androidx.test.espresso.action.ViewActions.click | ||
import androidx.compose.ui.test.junit4.createAndroidComposeRule | ||
import androidx.compose.ui.test.onNodeWithTag | ||
import androidx.compose.ui.test.performClick | ||
import androidx.test.espresso.assertion.ViewAssertions.matches | ||
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed | ||
import androidx.test.espresso.matcher.ViewMatchers.withText | ||
import androidx.test.ext.junit.rules.activityScenarioRule | ||
import com.intuit.playerui.android.reference.demo.test.base.PerformanceTest | ||
import com.intuit.playerui.android.reference.demo.test.base.waitForViewInRoot | ||
import com.intuit.playerui.android.reference.demo.ui.main.MainActivity | ||
import org.hamcrest.Matchers.allOf | ||
import org.junit.Rule | ||
import org.junit.Test | ||
|
||
class MainActivityTest : PerformanceTest<MainActivity> { | ||
|
||
@get:Rule override val activityRule = activityScenarioRule<MainActivity>() | ||
|
||
@get:Rule | ||
val androidComposeRule = createAndroidComposeRule<MainActivity>() | ||
|
||
@Test | ||
fun verifyDefault() { | ||
waitForViewInRoot(withText("Android Reference Assets")) | ||
.check(matches(isDisplayed())) | ||
|
||
onView( | ||
allOf( | ||
withText("Random Mock"), | ||
), | ||
).perform(click()) | ||
androidComposeRule.onNodeWithTag("action") | ||
.performClick() | ||
} | ||
} |
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
21 changes: 21 additions & 0 deletions
21
...roidTest/java/com/intuit/playerui/android/reference/demo/test/assets/badge/BadgeUITest.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.intuit.playerui.android.reference.demo.test.assets.badge | ||
|
||
import androidx.compose.ui.test.onNodeWithText | ||
import com.intuit.playerui.android.reference.demo.test.base.ComposeUITest | ||
import com.intuit.playerui.android.reference.demo.test.base.shouldBePlayerState | ||
import com.intuit.playerui.core.player.state.InProgressState | ||
import org.junit.Test | ||
|
||
class BadgeUITest : ComposeUITest("badge") { | ||
|
||
@Test | ||
fun basic() { | ||
launchMock("badge-all") | ||
|
||
androidComposeRule.onNodeWithText("INFO") | ||
.assertExists() | ||
androidComposeRule.onNodeWithText("ERROR") | ||
.assertExists() | ||
currentState.shouldBePlayerState<InProgressState>() | ||
} | ||
} |
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
27 changes: 13 additions & 14 deletions
27
...ndroidTest/java/com/intuit/playerui/android/reference/demo/test/assets/info/InfoUITest.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
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
15 changes: 15 additions & 0 deletions
15
...rc/androidTest/java/com/intuit/playerui/android/reference/demo/test/base/ComposeUITest.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.intuit.playerui.android.reference.demo.test.base | ||
|
||
import androidx.compose.ui.test.junit4.createAndroidComposeRule | ||
import androidx.test.ext.junit.rules.ActivityScenarioRule | ||
import com.intuit.playerui.android.reference.demo.ui.main.MainActivity | ||
import org.junit.Rule | ||
|
||
abstract class ComposeUITest(group: String? = null) : AssetUITest(group) { | ||
@get:Rule | ||
val androidComposeRule = createAndroidComposeRule<MainActivity>() | ||
|
||
override fun getActivityRule(): ActivityScenarioRule<MainActivity> { | ||
return androidComposeRule.activityRule | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason in particular we have to downgrade rules versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was mainly due to point 5 in the PR description. This was the highest version I could stay at with the least amount of changes. I will give another combination of dependencies a shot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to upgrade to a few different versions till v1.8.20 but all such changes open a can of worms that require several other dependencies to be updated