-
Notifications
You must be signed in to change notification settings - Fork 6k
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
TrackSelectionDialogBuilder does not use androidx AlertDialog #7357
Comments
@tonihei, the code is here: ExoPlayer/library/ui/src/main/java/com/google/android/exoplayer2/ui/TrackSelectionDialogBuilder.java Line 209 in 76962d5
I guess this should be replace by |
This ensure style themes are correctly applied. issue:#7357 PiperOrigin-RevId: 313145345
This ensure style themes are correctly applied. issue:#7357 PiperOrigin-RevId: 313145345
Are you shrinking your code and resources for your release build, as per this guide? You should be using:
|
yes if I don't the app size is around 4 to 5MB. |
@fgl27 Could you answer these questions to understand your change a bit more?
|
No, I don't have any dialog on that app, it's a basic app just a webview UI that uses Exoplayer to play videos, I build I don't understand how the auto generate file
Maybe that helps understand the issue.
App dependencies https://github.com/fgl27/SmartTwitchTV/blob/master/apk/app/build.gradle#L58 I don't think anyone of those androidx dependencies the app uses is causing this issue.
No the app doesn't uses Guava. To achive the small apk size the only commit I revert was this I reset the head of exoplayer here: Before all Guava changes this is the app size So the Guava changes add less then 20K to the apk
I don't think so, app proguard file https://github.com/fgl27/SmartTwitchTV/blob/master/apk/app/proguard-rules.pro I don't think that proguard file is the issue, but I erase the file content and made a clean build the size is this Only 10K bigger from when using the proguard file, so it's not the issue. On that test build I didn't revert the commit f099f57 to make sure that the proguard file is not the issue, so it shows app size is bigger no matter what. I don't know what is causing this is not a big deal, I'm not complaining I build Exo from source and reverting a commit is not a problem, I just wanna inform the problem I notice, and maybe there is something that can be improve here not just for me but for others. I doing all this builds clean using latest version of studio for linux. |
Thanks for detailed answers! That's really helpful.
In this case, it's even stranger that this happens given that there are no dependencies from your code to the new androidx lib. I'll reopen the issue to see if we can reproduce that somehow. |
OK thank you, I will do some other test on the weekend if I find something I inform. |
This ensure style themes are correctly applied. issue:#7357 PiperOrigin-RevId: 313145345
I investigated this a little bit with your example project.
Based on the last point it looks like this can't be solved easily. For people who already depend on the AndroidX appcompat module it won't be an issue. But in cases like yours where you don't use it already, it will create a big apk size impact. I see 3 options to work around that:
|
Thanks you for the detailed description, on my test I didn't find any way to prevent the issue. I assume on thi issue the best solution is leave as it's to prevent confusion and others issue the size is not a big problem. But that is just me, you guys decide what is best for the project. |
The dependency is only used to create a dialog in TrackSelectionDialogBuilder that is compatible with newer styling options. This dependendy adds over 500Kb to the apk (even if unused) and we shoudn't force this on an app. Instead make the dependency optional by automatically falling back to the platform version if the AndroidX one doesn't exist. Issue: #7357 PiperOrigin-RevId: 322143005
The commit above solved the apk size issue by only using the AndroidX dialog if the dependency is already available in the app. |
This ensure style themes are correctly applied. issue:google#7357 PiperOrigin-RevId: 313145345
TrackSelectionDialogBuilder uses legacy android.app.AlertDialog instead of androidx.appcompat.app.AlertDialog. The problems arises when using the TrackSelectionDialogBuilder with a DayNight theme, because the legacy alert dialog do not respect the styles.
The text was updated successfully, but these errors were encountered: