diff --git a/.autorc b/.autorc index e0616aac0..926a020dd 100644 --- a/.autorc +++ b/.autorc @@ -6,19 +6,14 @@ "owner": "player-ui", "repo": "player", "plugins": [ - [ - "upload-assets", - { - "assets": [ - "./bazel-bin/PlayerUI_Pod.zip" - ] - } - ], [ "version-file", { "versionFile": "./VERSION", - "publishScript": "./scripts/release.sh" + "publishScript": "./scripts/release.sh", + "publishScriptReleaseTypeArgs": { + "next": ["release"] + } } ], [ @@ -27,7 +22,6 @@ "labels": "release" } ], - "./scripts/after-shipit-pod-push.js", "./scripts/delete-old-prerelease.js" ] -} +} \ No newline at end of file diff --git a/.bazelignore b/.bazelignore index 548e7a9ec..debd2f487 100644 --- a/.bazelignore +++ b/.bazelignore @@ -37,6 +37,7 @@ plugins/asset-provider/react/node_modules plugins/asset-transform/core/node_modules plugins/async-node/core/node_modules plugins/common-types/core/node_modules +plugins/async-node/components/node_modules plugins/types-provider/core/node_modules plugins/auto-scroll/react/node_modules plugins/beacon/react/node_modules @@ -62,7 +63,7 @@ plugins/stage-revert-data/core/node_modules tools/asset-testing-library/core/node_modules docs/storybook/node_modules plugins/reference-assets/mocks/node_modules -tools/addon-storybook/node_modules +tools/storybook/node_modules tools/components/node_modules tools/mocks/node_modules docs/site/node_modules \ No newline at end of file diff --git a/.circleci/config.yml b/.circleci/config.yml index bca2410ba..628ed2a51 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ orbs: executors: base: docker: - - image: docker.io/playerui/bazel-docker:10 + - image: docker.io/playerui/bazel-docker working_directory: ~/player resource_class: xlarge environment: @@ -50,8 +50,14 @@ commands: - gem-v1-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }} - gem-v1-{{ arch }}-main-{{ checksum "Gemfile.lock" }} - - run: mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config + - add_ssh_keys: + fingerprints: + - "SHA256:hUAWVYdfSW5ml6ufbfyEHUcuPwUJ88xVhsZc21b2lA8" + + - run: mkdir -p ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config - run: echo "//registry.npmjs.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc + - run: git config --global user.name "Intuit Service" + - run: git config --global user.email "opensource-svc@intuit.com" - run: | echo -e $GPG_KEY | gpg --import --batch echo -e "pinentry-mode loopback\npassphrase $DEPLOY_MAVEN_GPG_PASSPHRASE" > ~/.gnupg/gpg.conf @@ -95,7 +101,7 @@ jobs: - attach_workspace: at: ~/player # need to filter because //android/demo rules dont resolve - - run: bazel build --config=ci -- $(bazel query '//plugins/... except filter("ios|swiftui|jvm|android", //plugins/...)') $(bazel query '//core/... except filter("ios|swiftui|jvm|android", //core/...)') $(bazel query '//react/... except filter("ios|swiftui|jvm|android", //react/...)') + - run: bazel build --config=ci -- $(bazel query 'filter("native_bundle$", //...)') - save_cache: paths: @@ -119,8 +125,8 @@ jobs: name: Homebrew Dependencies command: | HOMEBREW_NO_AUTO_UPDATE=1 brew install bazelisk lcov - brew install --cask temurin@8 - sudo installer -pkg /opt/homebrew/Caskroom/temurin@8/8,412,08/OpenJDK8U-jdk_x64_mac_hotspot_8u412b08.pkg -target / + wget -P /tmp/temurin https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u422-b05/OpenJDK8U-jdk_x64_mac_hotspot_8u422b05.pkg + sudo installer -pkg /tmp/temurin/OpenJDK8U-jdk_x64_mac_hotspot_8u422b05.pkg -target / - restore_cache: keys: @@ -142,6 +148,11 @@ jobs: environment: JAVA_HOME: /Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home + - save_cache: + key: android-tools-{{ arch }}-{{ checksum "scripts/install-android-tools.sh" }} + paths: + - ~/android-tools + - macos/preboot-simulator: version: "17.4" platform: "iOS" @@ -382,6 +393,7 @@ workflows: - /pull\/.*/ requires: - bazelrc + - build-trunk - build_ios: name: build-ios-fork @@ -390,7 +402,7 @@ workflows: only: - /pull\/.*/ requires: - - setup + - build-fork - maybe_release: filters: @@ -476,7 +488,7 @@ workflows: - build_ios: requires: - - setup + - build - android_test: requires: @@ -507,7 +519,7 @@ workflows: - build_ios: requires: - - setup + - build - android_test: requires: @@ -523,4 +535,4 @@ workflows: requires: - android_test - coverage - - build_ios \ No newline at end of file + - build_ios diff --git a/BUILD.bazel b/BUILD.bazel index 0cd3ec2a9..3708b8935 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,4 +1,4 @@ -load("@rules_player//ios:defs.bzl", "assemble_pod") +load("@rules_player//ios:defs.bzl", "assemble_pod", "ios_publish") load("@rules_player//internal:defs.bzl", "stamp") load("@npm//:defs.bzl", "npm_link_all_packages") load("@aspect_rules_js//js:defs.bzl", "js_library") @@ -190,6 +190,25 @@ assemble_pod( podspec = ":PlayerUI_Podspec", ) +ios_publish( + name = "ios_publish", + zip = ":PlayerUI_Pod", + # SPM Release Repo + repository = "git@github.com:player-ui/playerui-swift-package.git", + # CocoaPods + podspec = ":PlayerUI_Podspec", + executable = "bundle exec pod", + globalFlags = [ + # because jenkins runs as root + "--allow-root", + ], + pushFlags = [ + # skip tests because it never runs them right + # and they're run as part of the build pipeline anyway + "--skip-tests", + ], +) + # # Push podspec to specs repo # # tag must exist in github first # pod_push( diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9702a02f..3b0b160a7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,7 +17,7 @@ If the changes are larger (API design, architecture, etc), [opening an issue](ht * [Swift >= 5.5](https://www.swift.org/download/) * [Xcode 15.3](https://developer.apple.com/download/all/) -* [Android NDK >= 19.2.5345600, <= 21](https://github.com/android/ndk/wiki/Unsupported-Downloads#r19c). Any version > 21 will not work, period. You'll need to add `ANDROID_NDK_HOME` to your environment manually. +* [Android NDK 23.2.8568313](https://github.com/android/ndk/wiki/Unsupported-Downloads#r23c). You'll need to add `ANDROID_NDK_HOME` to your environment manually. * Python < 3 (recommended 2.7.18) - you can use [pyenv](https://realpython.com/intro-to-pyenv/) to manage different python versions with ease. * [Signed Commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification). For convenience it is recommended to set git to sign all commits by default as mentioned [here](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key) diff --git a/MODULE.bazel b/MODULE.bazel index 91032e69f..f056f7b0c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -7,9 +7,9 @@ bazel_dep(name = "rules_player") archive_override( module_name = "rules_player", - strip_prefix = "rules_player-1.0.0", - urls = ["https://github.com/player-ui/rules_player/archive/refs/tags/v1.0.0.tar.gz"], - integrity = "sha256-08MFpLzTnmwrIZhvE1cBL21cSqmjXzD6SH2HhTf8hR4=" + strip_prefix = "rules_player-1.0.1", + urls = ["https://github.com/player-ui/rules_player/archive/refs/tags/v1.0.1.tar.gz"], + integrity = "sha256-zIbxx1Bh/X4E8OwbPJz1nY9mOd2uAgmTZyf1Hs2mq+U=" ) #local_path_override(module_name = "rules_player", path = "../rules_player") @@ -113,15 +113,6 @@ use_repo(android_ndk_repository_extension, "androidndk") register_toolchains("@androidndk//:all") -# Databinding -bazel_dep(name = "grab_bazel_common") -git_override( - module_name = "grab_bazel_common", - # bazel-6 branch - commit = "75e9fd4d280329d3b13fc6f6bde1ab0f05fd2e86", - remote = "https://github.com/sugarmanz/grab-bazel-common.git", -) - remote_android_extensions = use_extension("@bazel_tools//tools/android:android_extensions.bzl", "remote_android_tools_extensions") use_repo(remote_android_extensions, "android_gmaven_r8") @@ -139,6 +130,7 @@ maven.install( artifacts = [ "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0", "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0", + "org.jetbrains.kotlin:kotlin-reflect:1.7.10", "com.intuit.hooks:hooks:0.15.0", # Testing @@ -147,9 +139,8 @@ maven.install( "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.0", # Android - "androidx.databinding:databinding-adapters:7.2.2", - "androidx.databinding:databinding-common:7.2.2", - "androidx.databinding:databinding-runtime:7.2.2", + "androidx.databinding:viewbinding:7.2.2", + "androidx.annotation:annotation:1.1.0", # Android Demo "androidx.navigation:navigation-runtime:2.3.3", diff --git a/PlayerUI.podspec b/PlayerUI.podspec index c6d548139..d22c81bdc 100644 --- a/PlayerUI.podspec +++ b/PlayerUI.podspec @@ -18,7 +18,7 @@ and display it as a SwiftUI view comprised of registered assets. s.homepage = 'https://github.com/player-ui/player' s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = { 'hborawski' => 'harris_borawski@intuit.com' } - s.source = { :http => "https://github.com/player-ui/player/releases/download/#{s.version.to_s}/PlayerUI_Pod.zip" } + s.source = { :git => "https://github.com/player-ui/playerui-swift-package.git", :tag => s.version.to_s } s.ios.deployment_target = '14.0' @@ -96,7 +96,7 @@ and display it as a SwiftUI view comprised of registered assets. subspec.source_files = "plugins/#{path}/ios/Sources/**/*" if resources == TRUE subspec.resource_bundles = { - name => ["plugins/#{path}/ios/Resources/**/*.js"] + "PlayerUI_#{name}" => ["plugins/#{path}/ios/Resources/**/*.js"] } end end @@ -112,7 +112,7 @@ and display it as a SwiftUI view comprised of registered assets. subspec.source_files = "plugins/#{path}/swiftui/Sources/**/*" if resources == TRUE subspec.resource_bundles = { - name => ["plugins/#{path}/swiftui/Resources/**/*.js"] + "PlayerUI_#{name}" => ["plugins/#{path}/swiftui/Resources/**/*.js"] } end end diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod index 6aceca001..fc90c51a7 100644 --- a/WORKSPACE.bzlmod +++ b/WORKSPACE.bzlmod @@ -9,22 +9,11 @@ android_sdk_repository( api_level = 33 ) -load("@grab_bazel_common//rules:repositories.bzl", "bazel_common_dependencies") - -bazel_common_dependencies() - bind( name = "databinding_annotation_processor", actual = "//:compiler_annotation_processor", ) -load("@grab_bazel_common//rules:setup.bzl", "bazel_common_setup") - -bazel_common_setup( - patched_android_tools = True, # Optionally use patched android_tools jars - buildifier_version = "6.3.3", -) - http_file( name = "android_test_orchestrator_apk", sha256 = "b7a2e7d0184b03e12c7357f3914d539da40b52a11e90815edff1022c655f459b", diff --git a/android/demo/BUILD b/android/demo/BUILD index a20c1e2e1..ad859a47f 100644 --- a/android/demo/BUILD +++ b/android/demo/BUILD @@ -1,7 +1,7 @@ load("@rules_android//android:rules.bzl", "android_binary", "android_library") load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_import") load("@rules_kotlin//kotlin:android.bzl", "kt_android_library") -load(":defs.bzl", "main_deps", "test_deps") +load(":deps.bzl", "main_deps", "test_deps") load("@rules_player//kotlin:defs.bzl", "lint") kt_android_library( @@ -19,13 +19,10 @@ android_binary( assets = glob(["src/main/assets/mocks/**"]), assets_dir = "src/main/assets", dex_shards = 3, - enable_data_binding = True, manifest = ":src/main/AndroidManifest.xml", multidex = "native", deps = [ ":demo_lib", - "@maven//:androidx_databinding_databinding_common", - "@maven//:androidx_databinding_databinding_runtime", "@maven//:org_jetbrains_kotlin_kotlin_reflect", ], ) diff --git a/android/demo/defs.bzl b/android/demo/deps.bzl similarity index 100% rename from android/demo/defs.bzl rename to android/demo/deps.bzl diff --git a/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/action/ActionUITest.kt b/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/action/ActionUITest.kt index 693412ef0..ef136e239 100644 --- a/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/action/ActionUITest.kt +++ b/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/action/ActionUITest.kt @@ -14,7 +14,7 @@ import com.intuit.playerui.core.player.state.dataModel import org.junit.Assert.assertEquals import org.junit.Test -class ActionUITest : AssetUITest("reference-assets") { +class ActionUITest : AssetUITest("action") { @Test fun basic() { diff --git a/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/collection/CollectionUITest.kt b/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/collection/CollectionUITest.kt index 52fb274f4..5997d7222 100644 --- a/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/collection/CollectionUITest.kt +++ b/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/collection/CollectionUITest.kt @@ -10,7 +10,7 @@ import com.intuit.playerui.android.reference.demo.test.base.waitForViewInRoot import com.intuit.playerui.core.player.state.InProgressState import org.junit.Test -class CollectionUITest : AssetUITest("reference-assets") { +class CollectionUITest : AssetUITest("collection") { @Test fun basic() { diff --git a/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/info/InfoUITest.kt b/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/info/InfoUITest.kt index 8aad36792..8a68670e7 100644 --- a/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/info/InfoUITest.kt +++ b/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/info/InfoUITest.kt @@ -11,7 +11,7 @@ import com.intuit.playerui.android.reference.demo.test.base.waitForViewInRoot import com.intuit.playerui.core.player.state.InProgressState import org.junit.Test -class InfoUITest : AssetUITest("reference-assets") { +class InfoUITest : AssetUITest("info") { enum class Action { Next, Dismiss, CONTINUE diff --git a/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/input/InputUITest.kt b/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/input/InputUITest.kt index 468233b80..b022d30b1 100644 --- a/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/input/InputUITest.kt +++ b/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/input/InputUITest.kt @@ -21,7 +21,7 @@ import org.hamcrest.Matchers.allOf import org.junit.Assert.assertEquals import org.junit.Test -class InputUITest : AssetUITest("reference-assets") { +class InputUITest : AssetUITest("input") { fun verifyIsDisplayed(matcher: Matcher) = waitForViewInRoot(matcher) .check(matches(isDisplayed())) diff --git a/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/text/TextUITest.kt b/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/text/TextUITest.kt index ff5c5f14e..1b0ca5e91 100644 --- a/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/text/TextUITest.kt +++ b/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/assets/text/TextUITest.kt @@ -16,7 +16,7 @@ import com.intuit.playerui.android.reference.demo.test.base.waitForViewInRoot import org.hamcrest.Matchers.allOf import org.junit.Test -class TextUITest : AssetUITest("reference-assets") { +class TextUITest : AssetUITest("text") { @Test fun basic() { diff --git a/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/base/AssetUITest.kt b/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/base/AssetUITest.kt index dd82d8b13..f73a5575f 100644 --- a/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/base/AssetUITest.kt +++ b/android/demo/src/androidTest/java/com/intuit/playerui/android/reference/demo/test/base/AssetUITest.kt @@ -26,7 +26,9 @@ abstract class AssetUITest(val group: String? = null) { protected val currentState: PlayerFlowState? get() = playerViewModel.playerFlowState.value - protected val mocks get() = viewModel.mocks + protected val mocks get() = viewModel.mocks.filter { + group == null || group == it.group + } @Before fun before() { diff --git a/android/player/BUILD b/android/player/BUILD index 40b493b70..5045a70c3 100644 --- a/android/player/BUILD +++ b/android/player/BUILD @@ -1,33 +1,42 @@ -load(":defs.bzl", "main_deps", "main_exports", "main_resources", "test_deps") +load(":deps.bzl", "main_deps", "main_exports", "main_resources", "test_deps") load("@build_constants//:constants.bzl", "VERSION") +load("@rules_kotlin//kotlin:android.bzl", "kt_android_library") load("@rules_kotlin//kotlin:core.bzl", "kt_kotlinc_options") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library") load("//jvm:defs.bzl", "distribution") -load("@grab_bazel_common//tools/databinding:databinding.bzl", "kt_db_android_library") load("@rules_player//kotlin:defs.bzl", "kt_jvm_junit5_test", "lint") -kt_db_android_library( - name = "player", +kt_android_library( + name = "player_android", srcs = glob(["src/main/java/**/*.kt"]), custom_package = "com.intuit.playerui.android", manifest = ":src/main/AndroidManifest.xml", resource_files = glob(["src/main/res/**"]), resources = main_resources, + deps = main_deps, +) + +android_library( + name = "player", + custom_package = "com.intuit.playerui.android", + resource_files = glob(["src/main/res/**"]), + manifest = ":src/main/AndroidManifest.xml", tags = ["maven_coordinates=com.intuit.playerui:android:aar:%s" % VERSION], - visibility = ["//visibility:public"], - exports = main_exports, deps = main_deps, + exports = main_exports + [":player_android"], + visibility = ["//visibility:public"], ) distribution( - name = "player", - lib_name = "player-databinding", + name = "player-distribution", + lib_name = "player", maven_coordinates = "com.intuit.playerui:android:%s" % VERSION, ) kt_jvm_junit5_test( name = "player-tests", srcs = glob(["src/test/java/**"]), - associates = [":player-kotlin"], + associates = [":player_android_kt"], kotlinc_opts = "//jvm:test_options", test_package = "com.intuit.playerui.android", deps = [":player"] + test_deps, diff --git a/android/player/defs.bzl b/android/player/deps.bzl similarity index 89% rename from android/player/defs.bzl rename to android/player/deps.bzl index baf305530..814d427ec 100644 --- a/android/player/defs.bzl +++ b/android/player/deps.bzl @@ -3,6 +3,8 @@ main_exports = [ ] main_deps = main_exports + [ + "@maven//:androidx_databinding_viewbinding", + "@maven//:androidx_annotation_annotation", "@maven//:androidx_core_core_ktx", "@maven//:androidx_transition_transition", "@maven//:androidx_lifecycle_lifecycle_runtime_ktx", diff --git a/android/player/src/main/java/com/intuit/playerui/android/asset/SuspendableAsset.kt b/android/player/src/main/java/com/intuit/playerui/android/asset/SuspendableAsset.kt index 8cd95e900..8e18e9642 100644 --- a/android/player/src/main/java/com/intuit/playerui/android/asset/SuspendableAsset.kt +++ b/android/player/src/main/java/com/intuit/playerui/android/asset/SuspendableAsset.kt @@ -5,7 +5,6 @@ import android.content.Context import android.graphics.Canvas import android.util.AttributeSet import android.view.View -import android.view.View.OnAttachStateChangeListener import android.view.ViewGroup import androidx.core.view.children import com.intuit.hooks.HookContext @@ -154,6 +153,7 @@ public abstract class SuspendableAsset(assetContext: AssetContext, seriali } hydratedView.await().also { parent -> (parent as? ViewGroup)?.awaitAsyncChildren() + replaceSelfWithView(parent) } } catch (e: CancellationException) { // if it was the calling scope that is cancelled, this will re-raise @@ -169,7 +169,7 @@ public abstract class SuspendableAsset(assetContext: AssetContext, seriali } override fun onViewAttachedToWindow(v: View) { scope.launch(Dispatchers.Main) { - awaitView()?.let(::replaceSelfWithView) + awaitView() } } override fun onViewDetachedFromWindow(v: View) {} diff --git a/android/player/src/main/java/com/intuit/playerui/android/ui/FallbackBinding.kt b/android/player/src/main/java/com/intuit/playerui/android/ui/FallbackBinding.kt index bdfe9671d..2e2ee2030 100644 --- a/android/player/src/main/java/com/intuit/playerui/android/ui/FallbackBinding.kt +++ b/android/player/src/main/java/com/intuit/playerui/android/ui/FallbackBinding.kt @@ -11,7 +11,7 @@ import com.intuit.playerui.android.R /** * This class is currently NOT automatically generated by the databinding/viewbinding, - * That means any changes to the underlying layout file will nto automatically update the available API + * That means any changes to the underlying layout file will not automatically update the available API */ public class FallbackBinding private constructor( private val rootView: ConstraintLayout, diff --git a/android/player/src/main/java/com/intuit/playerui/android/ui/PlayerBinding.kt b/android/player/src/main/java/com/intuit/playerui/android/ui/PlayerBinding.kt index 04363a53f..1e575a130 100644 --- a/android/player/src/main/java/com/intuit/playerui/android/ui/PlayerBinding.kt +++ b/android/player/src/main/java/com/intuit/playerui/android/ui/PlayerBinding.kt @@ -10,7 +10,7 @@ import com.intuit.playerui.android.R /** * This class is currently NOT automatically generated by the databinding/viewbinding, - * That means any changes to the underlying layout file will nto automatically update the available API + * That means any changes to the underlying layout file will not automatically update the available API */ public class PlayerBinding private constructor( private val rootView: ScrollView, diff --git a/android/player/src/main/java/com/intuit/playerui/android/ui/PlayerFragment.kt b/android/player/src/main/java/com/intuit/playerui/android/ui/PlayerFragment.kt index e0d731195..f1fbb65b3 100644 --- a/android/player/src/main/java/com/intuit/playerui/android/ui/PlayerFragment.kt +++ b/android/player/src/main/java/com/intuit/playerui/android/ui/PlayerFragment.kt @@ -17,8 +17,6 @@ import androidx.transition.Transition import com.intuit.playerui.android.AndroidPlayer import com.intuit.playerui.android.asset.RenderableAsset import com.intuit.playerui.android.asset.SuspendableAsset -import com.intuit.playerui.android.databinding.FallbackViewBinding -import com.intuit.playerui.android.databinding.PlayerFragmentBinding import com.intuit.playerui.android.extensions.into import com.intuit.playerui.android.extensions.transitionInto import com.intuit.playerui.android.lifecycle.ManagedPlayerState @@ -78,7 +76,7 @@ public abstract class PlayerFragment : Fragment(), ManagedPlayerState.Listener { private var _binding: PlayerBinding? = null /** - * [PlayerFragmentBinding] instance + * [PlayerBinding] instance * This property is only valid between onCreateView and onDestroyView. * Will throw a NPE if called out of turn. */ @@ -201,10 +199,10 @@ public abstract class PlayerFragment : Fragment(), ManagedPlayerState.Listener { /** * Builder method to provide a fallback [View] to be shown when the - * [PlayerViewModel] encounters an [exception]. Defaults to an instance of [FallbackViewBinding]. + * [PlayerViewModel] encounters an [exception]. Defaults to an instance of [FallbackBinding]. */ public open fun buildFallbackView(exception: Exception): View? = - FallbackViewBinding.inflate(layoutInflater).apply { + FallbackBinding.inflate(layoutInflater).apply { this.error.text = exception.localizedMessage retry.setOnClickListener { @@ -214,7 +212,7 @@ public abstract class PlayerFragment : Fragment(), ManagedPlayerState.Listener { reset.setOnClickListener { reset() } - }.root + }.getRoot() /** * Builder method to provide a [View] to be shown when the [PlayerViewModel] diff --git a/android/player/src/main/res/layout/fallback_view.xml b/android/player/src/main/res/layout/fallback_view.xml index 4073d46da..33a86b195 100644 --- a/android/player/src/main/res/layout/fallback_view.xml +++ b/android/player/src/main/res/layout/fallback_view.xml @@ -1,11 +1,10 @@ - - + - - -