In some cases, recycler view receives the cancel touch event,
it causes recycler view doesn't update the new locale list.
Currently, we also treat cancel event as a signal to update the locale.
According to the document, we can treat cancel event as a up
event, but not perform any action that you normally would.
It's ok in our case since we check if updated list is same as
last one in adapater.
Test: Drag and drop locale item, and make sure the language system
is updated.
Fix: 184051013
Fix: 184903189
Fix: 185000363
Change-Id: I06610080f34c5ed3562c74e1cdd955571cae55c0
- If the first language is not selected, just remove the body copy
else warning user the locale will change to another language.
Fixes: 140723349
Test: manual & robotest
Change-Id: I9fec17ae85889f2864c3f3cae744f7181e6f9b2c
Converting to Soong will move some code from directly compiled
into the app to compiled into an Android library and then
shared between the app and the tests. This will cause resource
IDs in the library to become non-final, which means they can
no longer be used in case statements. Convert affect case
statements to if blocks.
Test: m RunSettingsRoboTests
Change-Id: I25742a374f06d3fa4decbfc0d223a350acc50881
Having consistent import order will reduce chance of merge
conflict between internal and external master
Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
This CL only changed AlertDialog imports.
So, reviewer can review it easily.
Change-Id: I097bc44394195b14287f4f920c570ac8653f356a
Fixes: 111413092
Test: This CL can't pass Robo test.
This class is too complex, we can't afford maintaining this long term.
We need a new Activity that wraps the framework version of LocalePickerWithRegion.
Bug: 111373939
Test: manual test & make RunSettingsRoboTests -j56
Change-Id: I93c719246b84350d2eee4e8ce1ffd97cd168925b
This patch focused on fixing compile errors and some runtime errors.
Test: We can't test it now. But we will have an integration test later.
Bug: 110259478
Change-Id: I16c471ddcd0fa1460c665b7f74d86fcace5ee67b
- Add a few activities to widget list. These are more commonly
used settings, so adding them to widget list for easier access.
- Storage
- System
- About phone
- Remove useless intent-filters from AndroidManifest.
- If the intent-filter is just action MAIN and category DEFAULT, it
doesn't do anything.
Bug: 74806595
Test: visual
Change-Id: I5d80bc6c88f7bf60adabac872e92b72b341b97e6
Bug: 67883179
Change-Id: I650084cc3fceb82c874e8e8e36bf5182da183f2b
Fixes: 67883179
Test: manual test by following the reproduce steps
Test: verify the issue is fixed
When building icon for shortcut, check if the icon is LayerDrawable.
- If yes, only take the second layer (foreground).
Also move the class to shortcut package
Change-Id: I3513dbeb6509f11aa70ab3230d441e268ca9356d
Fixes: 72553870
Test: atest
1. Move getPreferenceScreenResId() from individual subclass to
InstrumentedPreferenceFragment.
2. Removed InstrumentedPreferenceFragment.getTitle() and let the
preference fragments that do not have preference screen set the activity
title directly instead.
3. Removed OptionsMenuFragment as all it does is call
setHasOptionMenu().
- changed subclasses of OptionsMenuFragment to extend from
InstrumentedPreferenceFragment directly.
- none of the exisitng subclasses actually implements the option menu
related methods to provide any option menu. So, the setHasOptionMenu()
call is not added to the subclasses.
4. Update Languages preference title.
- launch the fragment from the preference controller instead of from the
default handling, as we need the title res id at launch time to get it
work properly when retrieving the title from back stack.
Bug: 64564191
Test: blaze-bin/screenshots/android/i18nscreenshots/i18nscreenshots
Change-Id: Ibecdcab32cbaed8bf604ec5ebe0a926b4e489a7d
Refactored getLocaleNames() into a FeatureProvider interface so it's
reusable and testable.
Bug: 31801428
Test: RunSettingsRoboTests
Change-Id: I2d31a66a4b32cfa7a364a4cfef1f6eea87084577
Bug: 30681771
Test: SettingsUnitTests
Refactor visibility logging from InstrumentedFragment into a mixin. And
apply mixin in remaining fragments.
Change-Id: Ibbb59904336254a3e4bb9e8c7d0b36e5a6bc2622
In order to avoid layering violation, LocaleList needs to be moved from
android.util package to android.os package [1]. This CL follows up that
package change.
No behavior change is intended.
[1]: Ia8de2ee9df3dd0a42b1fe84574439519b680fe18
Bug: 28819696
Change-Id: Ibd7934b30062046830d63f33d1c6febef32da976
Also added a comment in onItemMove explaining why that method
does not call doTheUpdate().
Bug: 28173358
Change-Id: Ifdc00e70346149aeb09bd95ec21c7df2ccbaa996
Dragging is not supported neither by TalkBack or the accessibility
framework at the moment. So we need custom actions to be able
to change the order of the locales.
Also, the remove functionality is difficult to discover and use
with TalkBack only, so we are also adding a "remove" action.
It only removes one locale at the time, but most users don't
really add many locales "by mistake", so there is no real need
to delete a lot of locales at once.
Bug: 28173358
Change-Id: I3566304e3d2de87cf9243d7e87631b12d72fc929
Google TTS currently does not support language auto-switching.
Also, not all languages are available in TTS at all times.
This means that TTS cannot properly handle text in other languages / scripts
than the current language.
Languages with different scripts would not be read at all, and the others
would be read with "bad pronunciation", to the point of being unrecognizable.
This change is not a full fix, but makes things slightly better by using
the default locale for the contentDescription in the language / region lists.
This might be a bit unsettling, as the label will not match the sound.
The label will show "Deutsch" or "Русский" and text-to-speech will say "German"
or "Russian" (for English UI), or "Allemand" or "Russe" (if the UI is French).
Might also say nothing, if the current UI language has no text-to-speech engine.
But this is the best we can do, and better that what we get if we do nothing.
Bug: 28087937
Change-Id: I54d49ec96a10bab3e31198e162230fb277426e66
The frame is destroyed then the device rotates, so we need
to save and restore the complete status (remove mode or not,
list of checked locales, if the warning dialog it showing).
Bug: 26720315
Bug: 26758726
Change-Id: Ie1340d3242cb61dc736a0b456224b8570826e937
Using RecyclerView.ItemAnimator.ItemAnimatorFinishedListener
to only update the locales when all the animations finished.
This also reduces the number of repeated updates if the
locale list did not actually changed.
This was tested by setting the duration of animations to 3 seconds,
which made it possible to "shuffle" the list a lot and see several
items slowly moving around in the same time.
Bug: 26710681
Change-Id: I7d025e60cc252f4b90006b7b18c86d93ab94826f
When there's just one locale, showing the "Remove" menu and the
drag handle is confusing to the user since nothing can happen if
they try to use them: the drag simply won't happen, and if they
go through the delete process, we give them an error.
Bug: 26730336
Change-Id: Ie219dd9b3d653272b325d7af01aba205a58cd472
* In the drag & drop list align numbers with the + in
the "+ Add a language" button
* Keep the "+ Add a language" button under the list
* Shadow cell while drag & drop
* Updated various strings for dialog titles and messages
Bug: 26557242
Bug: 26710677
Bug: 26712004
Bug: 27070104
Change-Id: I10d26eac9581c955328e667d7309b5f0ac649110
This should bring things closer to the recommended UX guidelines.
It changes the way the checkbox / label play together,
and changes the "localization missing" warning icon to a string.
Also some cleanup of hard-coded styles and sizes.
Bug: 26758865
Bug: 26707846
Change-Id: I07a78a1e4a41122b91e895e363a217d3e9cacd40
The digits used for numbering the drag-and-drop locale list should
use a locale-aware formatter.
We will not see decimal or thousand separators, but the visible
difference is in the use of native digits. Example: Arabic.
Change-Id: I3f8cd5a3adea1cb88ae63f09711c728f4588020c