14 Commits

Author SHA1 Message Date
Material Design Team
342ea9ad25 Internal cleanup
PiperOrigin-RevId: 317147378
2020-06-19 13:42:35 -04:00
marianomartin
0d4515cb46 Internal cleanup
PiperOrigin-RevId: 265971745
2019-08-29 14:59:20 -04:00
marianomartin
c99f9522c7 Update peekHeight's getter and setter to be not final.
PiperOrigin-RevId: 265891346
2019-08-29 14:51:33 -04:00
cketcham
1d2cb7aa35 Add @NonNull and @Nullable annotations
PiperOrigin-RevId: 265133488
2019-08-29 11:21:03 -04:00
dniz
cc73c2a630 Update TODOs
PiperOrigin-RevId: 259535844
2019-07-23 11:21:39 -04:00
cketcham
dc72aaeed4 Migrate Gradle build and sources to androidx
PiperOrigin-RevId: 225551505
2018-12-21 11:07:45 -05:00
connieshi
f3a95d09fe Avoid constantly invalidating ChipDrawable when used in standalone mode.
Created TextAppearanceFontCallback (a fork of FontCallback) in order to pass parameter indicating whether font was resolved synchronously.

PiperOrigin-RevId: 216566240
2018-10-11 18:21:33 -04:00
Material Design Team
850795da31 Delegates CollapsingTextHelper text attributes processing to TextAppearance.
This removes duplication between the 2 implementations and automatically fixes font loading bug in CollapsingToolbarLayout & TextInputLayout. It has a side effect of changing font loading from sync to async but it shouldn't affect anyone since font loading wasn't really working in the first place. It may affect the UIs that were affected by the original bug though.

To alleviate possible "font flickering" due to async loading, CollapsingTextHelper defers the TextPaint changes until the font is actually loaded.

Another scenario the async loading would have an impact on is when the font is manually overwritten with CollapsingTextHelper.setTypeface() while async op is still ongoing. The result of async load would then overwrite the font back to the originally requested. This happens in TextInputLayout which overwrites its own font setting to this of its child whenever its added. This may happen before async op completes. To guard against that, any direct font setting automatically cancels the async load (cancels == ignores the result when it comes).

PiperOrigin-RevId: 212328671
2018-09-14 10:53:39 -04:00
connieshi
1f98c64b66 Remove redundant call to onSizeChange() in ChipDrawable#setTextAppearance(). Always evoke callback in TextAppearance#getFontAsync
Switch to using TextUtils.equals for more robust string comparison.

PiperOrigin-RevId: 209764943
2018-08-28 16:36:00 -04:00
Material Design Team
b65d0e3e57 TextAppearance typeface bug fix & refactoring of getFontAsync().
This is in preparation of larger change of moving CollapsingTextHelper onto TextAppearance to fix related bugs & avoid code duplication.

1. Introduces a version of getFontAsync() in TextAppearance that doesn't require TextPaint as an argument.
2. Refactors the existing getFontAsync to wrap the new implementation.
3. Fixes a bug - TextAppearance would not apply the correct typeface from a style when fontFamily was not present in the style def.

PiperOrigin-RevId: 209147825
2018-08-17 17:20:54 -04:00
dniz
24867f367c Fix error in Gradle build due to TextAppearance variable scope
PiperOrigin-RevId: 202488746
2018-07-02 09:46:29 -04:00
connieshi
d584f91ccc Resolve fonts asynchronously to avoid ANR.
Added flag to specify that fonts should be resolved synchronously for instrumentation tests.

PiperOrigin-RevId: 202033678
2018-07-02 09:37:14 -04:00
dniz
b97023751b Restrict TextAppearance class to library usage
PiperOrigin-RevId: 193249985
2018-04-30 11:27:44 -04:00
dniz
9ca33544ac Update package name to com.google.android.material
PiperOrigin-RevId: 193236235
2018-04-30 11:24:23 -04:00