aishwaryabhishek3
06/12/2023, 10:23 AMYoshio Schermer
06/12/2023, 1:21 PMTran An
06/12/2023, 1:52 PMVrajendra Bhavsar
06/12/2023, 2:10 PMIsaacMart
06/12/2023, 5:49 PMBilly Newman
06/12/2023, 8:27 PMSam Pengilly
06/13/2023, 4:39 AMActivity::onCreateOptionsMenu
) that has barely been relevant for a few years now
• Usage involves a class from play-services-cast-framework
that is explicitly tied to the activity options menu API (CastButtonFactory::setUpMediaRouteButton
)
• play-services-cast-framework
is a closed source library so there’s no way to know what setUpMediaRouteButton
is doing in order to replicate it in a different way
• Under the hood dependency on androidx.mediarouter
, which combines both the backend and UI components of media routing functionality into a single artifact, forcing a dependency on AppCompat/Fragments/etc
◦ Issue on the issue tracker for splitting mediarouter into two artifacts has been up with little activity since November 2020.
◦ UI side of mediarouter is heavily reliant on AppCompat and Fragments
• Zero apparent support for implementing a Cast button and cast behaviour on any app that doesn’t use the above APIs. Pure Compose app? Forget about it, only official advice is from two years ago and it’s: “wrap MediaRouterButton in `AndroidView`” which seems to carry its own issues and still requires an app to ship AppCompat/Fragment classes when it would have no other need for them
• This isn’t even getting into how the support for integrating with media2 was apparently not amazing and has regressed further with media3, this is just to get a cast button on screen
How is the state of casting this far behind the rest of the android ecosystem? Am I missing a library somewhere which works around some of these issues? I’m basically at the point where I feel I need to fork MediaRouter to remove the UI parts and write my own Compose equivalents, and I still have to deal with forcing the play-services-cast-framework
to use my fork instead of the actual library as well as work out what setUpMediaRouteButton
is doing to tie cast-framework
to the mediarouter
.
Has anyone been doing any work with casting that is sufficiently modern (even if not Compose) that can shed some light on whether there’s a better way?Prafull M
06/13/2023, 7:06 AMtheapache64
06/14/2023, 6:35 PMarpitpatel009
06/15/2023, 12:49 AMM.WAQAS
06/17/2023, 6:44 AMKevinMartinez
06/17/2023, 5:15 PMVladimir Vainer
06/18/2023, 5:29 AMJonathan Root
06/18/2023, 7:50 PMbryankeltonadams
06/19/2023, 11:24 PMGaurav Tyagi
06/20/2023, 12:54 PMTower Guidev2
06/20/2023, 1:33 PMMap<MyDo, List<MyDO>>
from my local database table which has the following columnsSlackbot
06/21/2023, 8:45 PMAditya Verma
06/22/2023, 6:05 AMOfek
06/22/2023, 11:21 AMSharedViewModel
in order to preserve data saved in SavedStateHandle
through a flow of screens after process death, let me explain:
I have a flow of screens: A, B & C where each screen “contributes” data to a single data holder. Then the final screen, screen C takes all that data and use it.
I’ve implemented a SharedViewModel
and inject it to all consumers screens via hiltNavGraphViewModel
& @AssistedInject
(@AssistedInject
is used in order to inject the SharedViewModel
into each screen’s ViewModel
).
Everything works fine, I’m able to get the same SharedViewModel
instance and each screen can contribute his data where finally screen C can use it (everything works, happy flow).
The issue starts with process death
- I’ve tried to save the SharedViewModel
data as a Parcelable
with his own SavedStateInstance
but as soon as I simulate process death, when the screen loads and the SharedViewModel
is injected, I get null
when I try to access the saved data.
I’ve attached the SharedViewModel
and the Parcelable model in the thread.
Has anyone stumbled upon this behavior?moroluckydragon
06/22/2023, 11:57 AMmoroluckydragon
06/22/2023, 11:58 AMmoroluckydragon
06/22/2023, 12:44 PMAntónio Bastião
06/22/2023, 7:56 PMreactormonk
06/24/2023, 10:45 AMMethod parse in android.net.Uri not mocked.
, even though I added @RunWith(RobolectricTestRunner::class)
on top of my class.salman
06/24/2023, 12:30 PMsalman
06/24/2023, 12:30 PMAsad Mukhtar
06/24/2023, 10:48 PMval mediaPath = "<content://media/external/file/252819>"
AsyncImage(
model = mediaPath,
contentDescription = stringResource(id = R.string.thumbnail),
placeholder = painterResource(id = R.drawable.ic_default_thumbnail),
error = painterResource(id = R.drawable.ic_default_thumbnail),
modifier = Modifier
.fillMaxWidth()
.aspectRatio(1f),
contentScale = ContentScale.Crop
)
Asad Mukhtar
06/25/2023, 1:16 AMGlideImage(
model = media.mediaPath, contentDescription = stringResource(id = R.string.thumbnail),
modifier = Modifier
.fillMaxWidth()
.aspectRatio(1f),
contentScale = ContentScale.Crop,
)
AsyncImage(
model = { media.mediaPath },
contentDescription = stringResource(id = R.string.thumbnail),
placeholder = painterResource(id = R.drawable.ic_default_thumbnail),
error = painterResource(id = R.drawable.ic_default_thumbnail),
modifier = Modifier
.fillMaxWidth()
.aspectRatio(1f),
contentScale = ContentScale.Crop
)