- Replaced `text()` with `getWholeText()`:
- avoids losing whitespaces at the beginning, end, or within the text;
- avoids merging two or more consecutive spaces into a single space ' ';
- avoids converting '\r', '\n', and '\r\n' within the text into a single space ' ';
For subtitle conversion, the goal is to preserve every character exactly as intended by the subtitle author.
- Normalized tabs, line breaks, and other special characters for SRT-safe output.
- Added comprehensive unit tests in `SrtFromTtmlWriterTest.java`, including cases for simple and nested tags.
- Previously, *.SRT files only contained timestamps and sequence numbers, without the actual text content.
- Added recursive text extraction to handle nested tags in TTML
files.(e.g.: <span> tags)
formatters() is called again by the player before the user has a chance to click on the language in the language chooser.
So the correct solution would probably be to attach to https://developer.android.com/reference/android/content/Intent#ACTION_LOCALE_CHANGED, but let's keep it simple. I added `PlayerHelper.resetFormat();` in `ContentSettingsFragment.onDestroy()` and it works. It will mean the player formatters will be reset every time the user exits content settings, but whatever.
and reset them when the language is changed/changing.
This way they will be re-initialized on the next call.
Also Remove a bunch of outdated/non-thread safe code (STRING_FORMATTER)
* fix: handle nullable nextPage behavior when searching albums #12401
* feat: add nullable annotation to newPage attribute in SearchFragment
* Updated more usages of InfoItemsPage#getNextPage. Nullability is already handled in these areas so no other changes needed
---------
Co-authored-by: Siddhesh Naik <siddheshnaik20@protonmail.com>
* Use build constants when possible
* Inline variables
* Don't use var for normal-sized types (that way it's easier to review)
* Split code into methods
Fixes#12400, see there for explanation. Citing from there:
So apparently the problem is onGetRoot always returning a BrowserRoot instance. Making it return null solved the issue (but again, breaks Android Auto compatibility). It turns out (see https://stackoverflow.com/q/63818988/) that onGetRoot is also used for media resumption https://developer.android.com/media/implement/surfaces/mobile#mediabrowserservice_implementation, which causes a new notification to pop up (in this case a useless notification because our onGetRoot does not return something that can be used for resumption). So what needs to be done is to check if rootHints?.getBoolean(EXTRA_RECENT) == true and if that's the case not return anything (as EXTRA_RECENT is used by the system for resumption).
The PackageValidator file is taken from 329a21b63c/common/src/main/java/com/example/android/uamp/media/PackageValidator.kt .