2afabd060e15342c0ba622cb08f5be61a328e566 |
|
17-May-2017 |
Seigo Nonaka <nona@google.com> |
Introduce fetch strategy and timeout attribute. This CL makes developer to be able to choose the fetching strategy. Since the font inflation happens on UI thread, it is not a good idea to block until the font fetch finishes. On the other hand, it may be also bad if the fetch happens asynchronously and refresh the display once it finishes. This blinks the contents. Blocking fetching and timeout works as follows: - First, check the local cache and use it if it is available. - Request the font to the font provider and wait until it finishes or timeout happens. - If timeout happens, use default typeface instead. Asynchronous fetching works as follows: - First, check the local cache and use it if it is available. - Request the font to the font provider and use default typeface during initial inflation. - When the fetch finishes, refresh the TextView. We can't add automated tests for resources xml for provider fonts since it requires the static certificates. Bug: 38340183 Test: ./gradlew support-compat:connectedAndroidTest on API 16, 17, 18, 19, 21, 23, 25, 26 Test: ./gradlew support-appcompat-v7:connectedAndroidTest on API 16, 17, 18, 19, 21, 23, 25, 26 Test: ./gradlew support-emoji:connectedDebugAndroidTest on API 16, 17, 18, 19, 21, 23, 25, 26 Change-Id: Iec9d953f1a762a020f3556055f0eda868e6f2641
/frameworks/support/compat/java/android/support/v4/provider/SelfDestructiveThread.java
|
fc857452283b38dfbac9ca023a77a8cf8b8c5599 |
|
09-May-2017 |
Seigo Nonaka <nona@google.com> |
Refactoring DL Font - Extract thread model from TypefaceCompat. - Remove TypefaceCompatBaseImpl.create - Decouple BackgroundThread from TypefaceCompat and put it FontsContractCompat. - Extract self destructive handler thread functionality to SelfDestructiveThread with tests. Bug: 37493347 Test: ./gradlew support-compat:connectedDebugAndroidTest on API 16, 17, 18, 19, 21, 22, 23, 24, 25, O ./gradlew support-emoji:connectedDebugAndroidTest on API 16, 17, 18, 19, 21, 22, 23, 24, 25, O Change-Id: I577fcb02fe2e266fa88b16fbe4788228dfb96d11
/frameworks/support/compat/java/android/support/v4/provider/SelfDestructiveThread.java
|