Commit Graph

72 Commits

Author SHA1 Message Date
Calvin Pan
b7f5d4063f Merge "Add unit test for AppLocalePickerActivity" into tm-dev am: 8ad2642b5f am: 215b87861a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17903006

Change-Id: I6066777568412a7a9746efcf4ea53020eca92497
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 21:19:25 +00:00
Calvin Pan
049aa73cb1 Add unit test for AppLocalePickerActivity
Bug: 223503670
Test: atest
Change-Id: I0e92be43d661dd3bff19c3274d1572ef1f4e9c46
2022-04-28 08:15:34 +00:00
Presubmit Automerger Backend
f2bdc7519e [automerge] [Panlingual] Fix settings's crash. 2p: 25dc3817a9 2p: d12e3daef6
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17730681

Bug: 229044820
Change-Id: Ia572e4ee0a5e2cf1ab10082a969a76986343b53d
2022-04-13 06:57:36 +00:00
tom hsu
25dc3817a9 [Panlingual] Fix settings's crash.
- fix crash due to no listview.

Bug: 229044820
Test: local
Change-Id: Ic3a15f9cfd89ff24ce1d764417de4686e10d3008
2022-04-13 14:56:23 +08:00
tom hsu
3558492c55 [automerge] [Panlingual] Fix settings crash due to no content view. 2p: db1b6accac 2p: a7377878be
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17684392

Bug: 228563549
Change-Id: I0da02d0abc2eb416c05194748366b8b2e25fc607
2022-04-11 11:11:06 +00:00
tom hsu
db1b6accac [Panlingual] Fix settings crash due to no content view.
- Sometimes, listview may not created instantly, so move the action of
   addHeaderView after fragment finished the onResume;

Bug: 228563549
Test: local
Change-Id: Ie5d53c962bed35783decd374c743a168a98cbf6a
2022-04-11 19:10:18 +08:00
Josh Hou
ffa73fceeb Merge changes from topic "screen_title" into tm-mainline-prod am: 2808fd6a7e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17631064

Change-Id: Ia79431bb96fa13709352d6a0e13386a9ccf76d9f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-08 12:22:43 +00:00
Josh Hou
98490cc740 [Panlingual] Screen title is displayed incorrectly
Fix the issue that the screen title name of the app language page is displayed incorrectly

Bug: 227285277
Test: Verify the issue by testing between the system language and app
language page

Change-Id: I5dbb10763bd5cc346bff9c270b14b945eb499273
2022-04-07 14:02:22 +08:00
Tom Hsu
27b82ddc9b Merge changes from topic "presubmit-am-f6b1787fd0f3424db0a7a4bb5c8bd472" into tm-mainline-prod am: 94b0789323
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17615237

Change-Id: I94465169345e13cc62c5eeb2109a9bf989c18cb1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-07 03:04:03 +00:00
Tom Hsu
a9d7aae694 Merge "[Panlingual] Fix the back button press" into tm-dev 2022-04-07 02:52:23 +00:00
tom hsu
0ce8355c63 [automerge] [Panlingual] Fix the back button press 2p: c0214ff9f3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17615237

Bug: 226894999
Change-Id: I81b99b74f45acdd9f7073aea1d4f5bebd1cd13b1
2022-04-06 15:37:24 +00:00
tom hsu
c0214ff9f3 [Panlingual] Fix the back button press
Bug: 226894999
Test: local
Change-Id: I81e6408ebf2587bd023a13dbbdfa97e38efd8c31
2022-04-06 23:28:17 +08:00
tom hsu
072510b144 [automerge] [Panlingual] Fix settings crash from rotation. 2p: 19bd21d96c 2p: d36ff21fb1
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17615231

Bug: 228126890
Change-Id: I98aa625c53af24db93a5388e77714e01deeb56bd
2022-04-06 11:34:07 +00:00
tom hsu
19bd21d96c [Panlingual] Fix settings crash from rotation.
- View may not create in time when add view of fragment.

Bug: 228126890
Test: local test.
Change-Id: Idce63dc9d39de09ff1ee684881ea6cb90637ee22
2022-04-06 19:32:36 +08:00
tom hsu
6436a5aa6f [Pnalingual] Resolve code conflict.
Bug: 228292561
Test: local
Change-Id: Idc79694fdecf3ad64e93e2f353837fd7bbdde1ed
(cherry picked from commit aac21a59aa)
2022-04-06 11:07:22 +00:00
tom hsu
aac21a59aa [Pnalingual] Resolve code conflict.
Bug: 228292561
Test: local
Change-Id: Idc79694fdecf3ad64e93e2f353837fd7bbdde1ed
2022-04-06 10:31:34 +00:00
Chaohui Wang
f03f79b145 Fix cannot add language
Fix: 227972634
Test: manual
Change-Id: I3382879e51238be55687072eeb07bb553dafc952
2022-04-04 11:26:55 +08:00
Tom Hsu
84f78bc493 Merge "Fix System language option missing and locale region missing issue" into tm-dev 2022-04-01 07:52:52 +00:00
Josh Hou
e32d422d3d [Panlingual] Fix the app language is shown incorrectly in the work profile
The root cause is that the context corresponding to the specified
profile Id is not correctly used when using LocaleManager to query the
app language.

Bug: 222769707
Test: Verify the issue by using the steps provided in the bug
Change-Id: Ic1f9e4cc9e90f5aecfa5e1094184aa63f3d94ffb
2022-04-01 13:00:47 +08:00
Calvin Pan
cfb04f4c35 Fix System language option missing and locale region missing issue
- Taking app package name into LocalePickerWithRegion
- Using toLanguageTag() instead of getLanguage() to prevent locale
 region missing

Bug: 226278910
Bug: 226280740
Change-Id: Ieac42616192065abc0cf82db023e4e50f1ca562d
Test: To be verified
(cherry picked from commit c117a89a53)
2022-04-01 04:31:44 +00:00
tom hsu
213b3ce4af [Panlingual] Improve and refactor revamped UI
- Remove useless file
 - Make Icon be able to scroll up and down

Bug: 226350483
Test: local test
Change-Id: I4564f432143e7e31ba5beff1dd32d7bc7764f9bf
(cherry picked from commit ded10f8e24)
Merged-In: I4564f432143e7e31ba5beff1dd32d7bc7764f9bf
2022-04-01 10:33:22 +08:00
danielwbhuang
963abde2dc [Panlingual] Handle onLocaleSelected.
1. When a new locale is selected, onLocaleSelected(...) will get the LocaleInfo.
2. Set LocaleList to LocaleManager for apps.
3. Check isSystemLocale().

Bug: 223090738
Test: local test pass
Change-Id: I20bc2e2349d0bad123661e0964a4e271dd319147
Merged-In: I20bc2e2349d0bad123661e0964a4e271dd319147
2022-03-31 18:05:04 +08:00
Tom Hsu
7eb32dec44 Merge "[Panlingual] Revamp the panlingual UI in Settings." into tm-dev 2022-03-31 08:32:52 +00:00
tom hsu
9be043e750 [Panlingual] Revamp the panlingual UI in Settings.
- Create a Activity to contain AppLocaleDetail and
    LocalePickerWithRegion
  - Update the Entry from apps language page

Bug: 223089715
Test: local test pass
Change-Id: Id01e93f3df32412c7323ca577a149009eb1862ad
Merged-In: Id01e93f3df32412c7323ca577a149009eb1862ad
2022-03-31 03:35:21 +00:00
Josh Hou
3550064e2e [Panlingual] Fix the app language is shown incorrectly in the work profile
The root cause is that the context corresponding to the specified
profile Id is not correctly used when using LocaleManager to query the
app language.

Bug: 222769707
Test: Verify the issue by using the steps provided in the bug
Change-Id: Ic1f9e4cc9e90f5aecfa5e1094184aa63f3d94ffb
2022-03-29 12:00:13 +08:00
tom hsu
ded10f8e24 [Panlingual] Improve and refactor revamped UI
- Remove useless file
 - Make Icon be able to scroll up and down

Bug: 226350483
Test: local test
Change-Id: I4564f432143e7e31ba5beff1dd32d7bc7764f9bf
2022-03-28 17:13:04 +08:00
TreeHugger Robot
b81c42d043 Merge "Fix System language option missing and locale region missing issue" 2022-03-23 18:16:07 +00:00
Calvin Pan
c117a89a53 Fix System language option missing and locale region missing issue
- Taking app package name into LocalePickerWithRegion
- Using toLanguageTag() instead of getLanguage() to prevent locale
 region missing

Bug: 226278910
Bug: 226280740
Change-Id: Ieac42616192065abc0cf82db023e4e50f1ca562d
Test: To be verified
2022-03-23 07:48:10 +00:00
danielwbhuang
817e168e37 [Panlingual][patch] Handle onLocaleSelected.
1. reference: https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/17157185/13/core/java/com/android/internal/app/LocaleStore.java#204
2. check isSystemLocale()

Bug: 223090738
Test: local test pass
Change-Id: I42fbd06495880698201831d947d28515fb674a5a
2022-03-22 18:42:13 +08:00
Treehugger Robot
e7b6e48b89 Merge "Add i18n team to localepicker OWNER" am: 21eebdce59 am: 7ccb003e9a am: 2054adddf7 am: 31ae1b4623
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2033623

Change-Id: I3ee8af37931bdf8e42df150bac5bec8bc6be7c23
2022-03-21 08:58:56 +00:00
Calvin Pan
1fd5f8ff5c Add i18n team to localepicker OWNER
Change-Id: I5769d5040958b62d9f29f3a802bf06e10a40ea1d
2022-03-21 05:46:10 +00:00
danielwbhuang
19859b63c9 [Panlingual] Handle onLocaleSelected.
1. When a new locale is selected, onLocaleSelected(...) will get the LocaleInfo.
2. Set LocaleList to LocaleManager for apps.

Bug: 223090738
Test: local test pass
Change-Id: I20bc2e2349d0bad123661e0964a4e271dd319147
2022-03-16 14:03:55 +08:00
tom hsu
6fc5bb64dc [Panlingual] Revamp the panlingual UI in Settings.
- Create a Activity to contain AppLocaleDetail and
    LocalePickerWithRegion
  - Update the Entry from apps language page

Bug: 223089715
Test: local test pass
Change-Id: Id01e93f3df32412c7323ca577a149009eb1862ad
2022-03-09 17:06:33 +08:00
Mill Chen
0080784d10 Revert "Fix overlapping issue for Add a language page"
This reverts commit 28195f52a6.

Reason for revert: The solution has been moved to framework (see ag/16636785)

Change-Id: I834bf7b31d71a3bf76902404fca6891bf0e9c429
2022-01-19 14:53:33 +00:00
Mill Chen
28195f52a6 Fix overlapping issue for Add a language page
As the Add a language page changed its parent class, the collapsing
toolbar did not work smoothly. Also the nested scrolling feature of the
locale list is disabled, that caused the overlapping problem.

This change is to make the locale list enable the nested scrolling
feature.

Fixes: 207318265
Test: manual test
Change-Id: I95929cd569c94d392c325e4e5b2a35e78185d0b8
2021-12-30 16:23:18 +08:00
tom hsu
0c0daf7034 Let activity of "add language" fit settingsactivity style.
Bug: 202104027
Test: Maunal test. see b/202104027#5
Change-Id: I1f087885912179bb501ae72d0eb50bb8280dcbc0
2021-11-09 21:22:09 +08:00
Tsung-Mao Fang
2b78aa0988 Fix unable to change language
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
2021-04-23 22:35:55 +08:00
Edgar Wang
329b20a445 Add metrics log for special cases in Lanugages & About page
Bug: 137559984
Test: robotest

Change-Id: I007282d8c4d5f9c6168dd84f6feee7e237ec7c42
2020-04-30 17:19:52 +08:00
Edgar Wang
3b47408016 Refine remove locale warning dialog string
- 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
2020-03-13 12:49:21 +08:00
Stanley Wang
25c5e3ce6c Add the item in Language page to dynamic index.
Add "Add a language" item to dynamic index.

Fixes: 145492913
Test: maunal & robotest
Change-Id: Ife3ee7c90eb6c81e4ce042db4cd585a0993fb5fe
2019-12-05 15:09:29 +08:00
Colin Cross
807e861105 Use if instead of switch for resources
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
2019-05-13 13:42:01 -07:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
tmfang
41ab6b4bf8 Migrate all AlertDialogs to AndroidX version
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.
2018-07-20 11:32:13 +08:00
tmfang
c0ed614252 Remove LocalePickerWithRegion class in Settings.
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
2018-07-17 17:34:00 +08:00
tmfang
27c84de325 Settings Fragment Migration (Build pass app)
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
2018-07-11 18:24:51 -07:00
tmfang
99cc23d0da Settings Fragment Migration (Change imports)
This commit *only* changes imports and optimize imports.
We don't do anything else.

This patch can't compile pass and run test case.
We will update other patches to fix these problem.

Change list.

1. import android.app.Fragment; ->
   import androidx.fragment.app.Fragment;
2. import android.app.DialogFragment; ->
   import androidx.fragment.app.DialogFragment;
3. import android.app.ListFragment; ->
   import androidx.fragment.app.ListFragment;
4. import android.app.LoaderManager; ->
   import androidx.loader.app.LoaderManager;
5. import android.content.AsyncTaskLoader; ->
   import androidx.loader.content.AsyncTaskLoader;
6. import android.content.Loader; ->
   import androidx.loader.content.Loader;
7. import android.app.FragmentTransaction; ->
   import androidx.fragment.app.FragmentTransaction;
8. import android.app.FragmentManager; ->
   import androidx.fragment.app.FragmentManager;
9. import android.app.LoaderManager.LoaderCallbacks; ->
    import androidx.loader.app.LoaderManager.LoaderCallbacks;

Bug: 110259478
Test: Can't test it.
Change-Id: I0a3f98fff34a3494a839c3c42aeabcec3df2c8b3
2018-07-11 18:23:51 -07:00
Fan Zhang
2f4355aa66 Misc cleanup on AndroidManifest.xml
- 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
2018-06-21 16:57:41 -07:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00