From 7745d3a668fb5903806f595728983e89b1df69e5 Mon Sep 17 00:00:00 2001 From: shah Date: Tue, 26 Nov 2024 17:16:44 +0530 Subject: [PATCH 1/5] fix: zoom level fix, chinese language name changes and removed unused strings ALS-1889 --- .../java/com/aws/amazonlocation/utils/Constants.kt | 2 +- app/src/main/res/values-ar/string.xml | 13 ------------- app/src/main/res/values-de/string.xml | 13 ------------- app/src/main/res/values-es/string.xml | 13 ------------- app/src/main/res/values-fr/string.xml | 13 ------------- app/src/main/res/values-hi/string.xml | 13 ------------- app/src/main/res/values-it/string.xml | 13 ------------- app/src/main/res/values-iw/string.xml | 13 ------------- app/src/main/res/values-ja/string.xml | 13 ------------- app/src/main/res/values-ko/string.xml | 13 ------------- app/src/main/res/values-pt/string.xml | 13 ------------- app/src/main/res/values-zh-rCN/string.xml | 13 ------------- app/src/main/res/values-zh-rTW/string.xml | 13 ------------- app/src/main/res/values/strings.xml | 4 ++-- 14 files changed, 3 insertions(+), 159 deletions(-) diff --git a/app/src/main/java/com/aws/amazonlocation/utils/Constants.kt b/app/src/main/java/com/aws/amazonlocation/utils/Constants.kt index d3fd1ce5..539d71a2 100644 --- a/app/src/main/java/com/aws/amazonlocation/utils/Constants.kt +++ b/app/src/main/java/com/aws/amazonlocation/utils/Constants.kt @@ -184,7 +184,7 @@ object MapCameraZoom { const val DEFAULT_CAMERA_ZOOM = 14.0 const val TRACKING_CAMERA_ZOOM = 14.0 const val MAX_ZOOM = 22.0 - const val MIN_ZOOM = 1.0 + const val MIN_ZOOM = 2.0 } object Durations { diff --git a/app/src/main/res/values-ar/string.xml b/app/src/main/res/values-ar/string.xml index e89fb3a6..67311c67 100644 --- a/app/src/main/res/values-ar/string.xml +++ b/app/src/main/res/values-ar/string.xml @@ -221,19 +221,6 @@ اللغة متعقب دخل متعقب خرج - Deutsch - Español - English - Français - Italiano - Português Brasileiro - Simplified Chinese - Traditional Chinese - 日本語 - 한국어 - العربية - עברית - हिन्दी من أجل ناعم محاكاة تجربة من فضلك سمح إعلام تصريح من عند إعدادات. المنطقة ضوء diff --git a/app/src/main/res/values-de/string.xml b/app/src/main/res/values-de/string.xml index 83a8ff29..c1316779 100644 --- a/app/src/main/res/values-de/string.xml +++ b/app/src/main/res/values-de/string.xml @@ -221,19 +221,6 @@ Sprache Tracker eingegeben Tracker hinausgegangen - Deutsch - Español - English - Français - Italiano - Português Brasileiro - Simplified Chinese - Traditional Chinese - 日本語 - 한국어 - العربية - עברית - हिन्दी Für glatt Simulation Erfahrung bitte ermöglichen Benachrichtigung Genehmigung von Einstellungen. Region Licht diff --git a/app/src/main/res/values-es/string.xml b/app/src/main/res/values-es/string.xml index 847630fd..43cc39be 100644 --- a/app/src/main/res/values-es/string.xml +++ b/app/src/main/res/values-es/string.xml @@ -221,19 +221,6 @@ Lengua rastreador ingresó rastreador salió - Deutsch - Español - English - Français - Italiano - Português Brasileiro - Simplified Chinese - Traditional Chinese - 日本語 - 한국어 - العربية - עברית - हिन्दी Para suave simulación experiencia por favor permitir notificación permiso de ajustes. Región Luz diff --git a/app/src/main/res/values-fr/string.xml b/app/src/main/res/values-fr/string.xml index 49e08474..b729986f 100644 --- a/app/src/main/res/values-fr/string.xml +++ b/app/src/main/res/values-fr/string.xml @@ -221,19 +221,6 @@ Langue Traqueur entré Traqueur sorti - Deutsch - Español - English - Français - Italiano - Português Brasileiro - Simplified Chinese - Traditional Chinese - 日本語 - 한국어 - العربية - עברית - हिन्दी Pour lisse simulation expérience s\'il vous plaît permettre notification autorisation à partir de paramètres. Région Lumière diff --git a/app/src/main/res/values-hi/string.xml b/app/src/main/res/values-hi/string.xml index 220c55d9..304a22fe 100644 --- a/app/src/main/res/values-hi/string.xml +++ b/app/src/main/res/values-hi/string.xml @@ -221,19 +221,6 @@ भाषा ट्रैकर घुसा ट्रैकर बाहर निकल गया - Deutsch - Español - English - Français - Italiano - Português Brasileiro - Simplified Chinese - Traditional Chinese - 日本語 - 한국어 - العربية - עברית - हिन्दी के लिए चिकनी अनुकरण अनुभव कृपया अनुमति देना अधिसूचना अनुमति से सेटिंग्स। क्षेत्र लाइट diff --git a/app/src/main/res/values-it/string.xml b/app/src/main/res/values-it/string.xml index 967065e2..48d90837 100644 --- a/app/src/main/res/values-it/string.xml +++ b/app/src/main/res/values-it/string.xml @@ -221,19 +221,6 @@ Lingua Localizzatore entrato Localizzatore uscito - Deutsch - Español - English - Français - Italiano - Português Brasileiro - Simplified Chinese - Traditional Chinese - 日本語 - 한국어 - العربية - עברית - हिन्दी Per liscia simulazione esperienza per favore permettere notifica autorizzazione da impostazioni. Regione Leggero diff --git a/app/src/main/res/values-iw/string.xml b/app/src/main/res/values-iw/string.xml index e8f9685b..923ad4eb 100644 --- a/app/src/main/res/values-iw/string.xml +++ b/app/src/main/res/values-iw/string.xml @@ -221,19 +221,6 @@ שפה גשש נכנס גשש יצא - Deutsch - Español - English - Français - Italiano - Português Brasileiro - Simplified Chinese - Traditional Chinese - 日本語 - 한국어 - العربية - עברית - हिन्दी עבור חלק הדמייה חוויה בבקשה להתיר הודעה רשות מ הגדרות. אזור אור diff --git a/app/src/main/res/values-ja/string.xml b/app/src/main/res/values-ja/string.xml index c044aad6..450da437 100644 --- a/app/src/main/res/values-ja/string.xml +++ b/app/src/main/res/values-ja/string.xml @@ -221,19 +221,6 @@ 言語 トラッカー 入った トラッカー 出た - Deutsch - Español - English - Français - Italiano - Português Brasileiro - Simplified Chinese - Traditional Chinese - 日本語 - 한국어 - العربية - עברית - हिन्दी にとって スムーズ シミュレーション 経験 お願い 許す 通知 許可 から 設定。 リージョン ライト diff --git a/app/src/main/res/values-ko/string.xml b/app/src/main/res/values-ko/string.xml index cb451dad..95382f00 100644 --- a/app/src/main/res/values-ko/string.xml +++ b/app/src/main/res/values-ko/string.xml @@ -221,19 +221,6 @@ 언어 트래커 입력했다 트래커 종료되었습니다 - Deutsch - Español - English - Français - Italiano - Português Brasileiro - Simplified Chinese - Traditional Chinese - 日本語 - 한국어 - العربية - עברית - हिन्दी 에 대해 부드러운 시뮬레이션 경험 제발 허용 알림 허가 …에서 설정. 지역 라이트 diff --git a/app/src/main/res/values-pt/string.xml b/app/src/main/res/values-pt/string.xml index 279ff3e2..d1f04de3 100644 --- a/app/src/main/res/values-pt/string.xml +++ b/app/src/main/res/values-pt/string.xml @@ -221,19 +221,6 @@ Idioma Rastreador entraram Rastreador saiu - Deutsch - Español - English - Français - Italiano - Português Brasileiro - Simplified Chinese - Traditional Chinese - 日本語 - 한국어 - العربية - עברית - हिन्दी Para suave simulação experiência por favor autorizar alerta permissão desde configurações. Região Luz diff --git a/app/src/main/res/values-zh-rCN/string.xml b/app/src/main/res/values-zh-rCN/string.xml index 24385d4b..1c7ede57 100644 --- a/app/src/main/res/values-zh-rCN/string.xml +++ b/app/src/main/res/values-zh-rCN/string.xml @@ -221,19 +221,6 @@ 语言 追踪器 已输入 追踪器 退出 - Deutsch - Español - English - Français - Italiano - Português Brasileiro - Simplified Chinese - Traditional Chinese - 日本語 - 한국어 - العربية - עברית - हिन्दी 对于 光滑 模拟 经历 拜托 允许 通知 许可 从 设置。 区域 diff --git a/app/src/main/res/values-zh-rTW/string.xml b/app/src/main/res/values-zh-rTW/string.xml index c4ed311b..0cd67b83 100644 --- a/app/src/main/res/values-zh-rTW/string.xml +++ b/app/src/main/res/values-zh-rTW/string.xml @@ -221,19 +221,6 @@ 語言 追蹤器 輸入 追蹤器 退出 - Deutsch - Español - English - Français - Italiano - Português Brasileiro - Simplified Chinese - Traditional Chinese - 日本語 - 한국어 - العربية - עברית - हिन्दी 對於 順利 模擬 經驗 請 允許 通知 允許 從 設置。 地區 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index eca4dffd..4068615e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -244,8 +244,8 @@ Français Italiano Português Brasileiro - Simplified Chinese - Traditional Chinese + 简体中文 + 繁体中文 日本語 한국어 العربية From 2631a41bbcc277cd1535f69b63006c4aab87f308 Mon Sep 17 00:00:00 2001 From: shah Date: Wed, 27 Nov 2024 15:00:37 +0530 Subject: [PATCH 2/5] fix: worked on unit test cases update ALS-1889 --- .../com/aws/amazonlocation/utils/GeneralUtils.kt | 5 ++--- .../java/com/aws/amazonlocation/utils/ViewUtils.kt | 4 ++++ .../data/response/ResponseDataTest.kt | 5 +++++ .../java/com/aws/amazonlocation/mock/Constants.kt | 1 + .../GeneralUtilsIsInternetAvailableTest.kt | 14 ++++++++++++++ .../explore/ExploreVMCalculateDistance.kt | 8 ++++++++ .../viewmodel/explore/ExploreVMSetMapListData.kt | 1 + .../explore/ExploreVMSetPoliticalListData.kt | 2 ++ .../geofence/GeofenceVMGeofenceDeleteTest.kt | 7 ++++++- .../viewmodel/mapstyle/MapStyleVMMapListData.kt | 1 + .../mapstyle/MapStyleVMSetPoliticalListData.kt | 2 ++ 11 files changed, 46 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/aws/amazonlocation/utils/GeneralUtils.kt b/app/src/main/java/com/aws/amazonlocation/utils/GeneralUtils.kt index 3e5c1ee8..85f95315 100644 --- a/app/src/main/java/com/aws/amazonlocation/utils/GeneralUtils.kt +++ b/app/src/main/java/com/aws/amazonlocation/utils/GeneralUtils.kt @@ -61,9 +61,6 @@ import org.maplibre.android.geometry.LatLng // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT-0 -val Int.px: Int - get() = (this * Resources.getSystem().displayMetrics.density).toInt() - val isRunningTest: Boolean by lazy { try { val testProperty = System.getProperty("robolectric") != null || @@ -601,12 +598,14 @@ fun getLanguageCode(): String? { return languageCode } +@ExcludeFromJacocoGeneratedReport fun hideKeyboard(activity: Activity, appCompatEditText: AppCompatEditText) { val imm: InputMethodManager = activity.getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager imm.hideSoftInputFromWindow(appCompatEditText.windowToken, 0) } +@ExcludeFromJacocoGeneratedReport fun copyTextToClipboard(context: Context, text: String) { val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager val clip = ClipData.newPlainText("label", text) diff --git a/app/src/main/java/com/aws/amazonlocation/utils/ViewUtils.kt b/app/src/main/java/com/aws/amazonlocation/utils/ViewUtils.kt index d8072c68..68eb9715 100644 --- a/app/src/main/java/com/aws/amazonlocation/utils/ViewUtils.kt +++ b/app/src/main/java/com/aws/amazonlocation/utils/ViewUtils.kt @@ -1,5 +1,6 @@ package com.aws.amazonlocation.utils +import android.content.res.Resources import android.view.View // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -29,3 +30,6 @@ fun hideViews(vararg view: View?) { it?.hide() } } + +val Int.px: Int + get() = (this * Resources.getSystem().displayMetrics.density).toInt() diff --git a/app/src/test/java/com/aws/amazonlocation/data/response/ResponseDataTest.kt b/app/src/test/java/com/aws/amazonlocation/data/response/ResponseDataTest.kt index d6e64897..68c8ac12 100644 --- a/app/src/test/java/com/aws/amazonlocation/data/response/ResponseDataTest.kt +++ b/app/src/test/java/com/aws/amazonlocation/data/response/ResponseDataTest.kt @@ -203,6 +203,11 @@ class ResponseDataTest { isSelected = false, mapInnerData = null ) + // checking default it is not disabled and then making it disable + if (!mapStyleData.isDisable) { + mapStyleData.isDisable = true + } + mapStyleData.mapInnerData = arrayListOf(data) Assert.assertTrue(TEST_FAILED_MAP_STYLE_DATA, !mapStyleData.isSelected) } diff --git a/app/src/test/java/com/aws/amazonlocation/mock/Constants.kt b/app/src/test/java/com/aws/amazonlocation/mock/Constants.kt index ee9de2f6..c0afc78b 100644 --- a/app/src/test/java/com/aws/amazonlocation/mock/Constants.kt +++ b/app/src/test/java/com/aws/amazonlocation/mock/Constants.kt @@ -53,6 +53,7 @@ const val TEST_FAILED_DUE_TO_DATA_NOT_EMPTY = "Test failed due to data not empty const val TEST_FAILED_DUE_TO_INCORRECT_DATA_SIZE = "Test failed due to incorrect data size" const val TEST_FAILED_DUE_TO_INCORRECT_ERROR_MESSAGE = "Test failed due to incorrect error message" const val TEST_FAILED_DUE_TO_INCORRECT_NO_INTERNET_ERROR = "Test failed due to incorrect no internet error" +const val TEST_FAILED_DUE_TO_ROBOLECTRIC_TEST_RUNNING = "Test failed due to robolectric test running" const val TEST_FAILED_DUE_TO_INCORRECT_NO_OF_PROVIDERS_LOADED = "Test failed due to incorrect no of providers loaded" const val TEST_FAILED_DUE_TO_INCORRECT_STYLE_NAME_FOR_STANDARD = "Test failed due to incorrect style name for Standard" diff --git a/app/src/test/java/com/aws/amazonlocation/utils/generalutils/GeneralUtilsIsInternetAvailableTest.kt b/app/src/test/java/com/aws/amazonlocation/utils/generalutils/GeneralUtilsIsInternetAvailableTest.kt index ce0d5bca..cf089e13 100644 --- a/app/src/test/java/com/aws/amazonlocation/utils/generalutils/GeneralUtilsIsInternetAvailableTest.kt +++ b/app/src/test/java/com/aws/amazonlocation/utils/generalutils/GeneralUtilsIsInternetAvailableTest.kt @@ -5,6 +5,11 @@ import com.aws.amazonlocation.BaseTest import com.aws.amazonlocation.mock.* import com.aws.amazonlocation.setConnectivity import com.aws.amazonlocation.utils.isInternetAvailable +import com.aws.amazonlocation.utils.isRunningRemoteDataSourceImplTest +import com.aws.amazonlocation.utils.isRunningTest +import com.aws.amazonlocation.utils.isRunningTest2LiveLocation +import com.aws.amazonlocation.utils.isRunningTest3LiveLocation +import com.aws.amazonlocation.utils.isRunningTestLiveLocation import org.junit.Assert import org.junit.Test import org.junit.runner.RunWith @@ -25,4 +30,13 @@ class GeneralUtilsIsInternetAvailableTest : BaseTest() { result = context.isInternetAvailable() Assert.assertTrue(TEST_FAILED_DUE_TO_INCORRECT_DATA, !result) } + + @Test + fun isUnitTestRunningCheck() { + Assert.assertTrue(TEST_FAILED_DUE_TO_ROBOLECTRIC_TEST_RUNNING, !isRunningTest) + Assert.assertTrue(TEST_FAILED_DUE_TO_ROBOLECTRIC_TEST_RUNNING, !isRunningTestLiveLocation) + Assert.assertTrue(TEST_FAILED_DUE_TO_ROBOLECTRIC_TEST_RUNNING, !isRunningTest2LiveLocation) + Assert.assertTrue(TEST_FAILED_DUE_TO_ROBOLECTRIC_TEST_RUNNING, !isRunningTest3LiveLocation) + Assert.assertTrue(TEST_FAILED_DUE_TO_ROBOLECTRIC_TEST_RUNNING, !isRunningRemoteDataSourceImplTest) + } } diff --git a/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMCalculateDistance.kt b/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMCalculateDistance.kt index 5a1ed1f1..a1c16aa9 100644 --- a/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMCalculateDistance.kt +++ b/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMCalculateDistance.kt @@ -48,6 +48,10 @@ class ExploreVMCalculateDistance : BaseTest() { mExploreVM.mWalkingData = null mExploreVM.mTruckData = null mExploreVM.mScooterData = null + mExploreVM.mCarCalculateDistanceResponse = null + mExploreVM.mWalkCalculateDistanceResponse = null + mExploreVM.mTruckCalculateDistanceResponse = null + mExploreVM.mScooterCalculateDistanceResponse = null } @Test @@ -65,10 +69,14 @@ class ExploreVMCalculateDistance : BaseTest() { } mExploreVM.mCalculateDistance.test { + mExploreVM.mStartLatLng = null + mExploreVM.mDestinationLatLng = null val start = DISTANCE_COORDINATE_FROM val end = DISTANCE_COORDINATE_TO mExploreVM.calculateDistance(start.latitude, start.longitude, end.latitude, end.longitude, AVOID_FERRIES, AVOID_TOLLS, false) var result = awaitItem() + Assert.assertTrue(TEST_FAILED_DUE_TO_STATE_NOT_LOADING, mExploreVM.mStartLatLng == start) + Assert.assertTrue(TEST_FAILED_DUE_TO_STATE_NOT_LOADING, mExploreVM.mDestinationLatLng == end) Assert.assertTrue(TEST_FAILED_DUE_TO_STATE_NOT_LOADING, result is HandleResult.Loading) result = awaitItem() Assert.assertTrue(TEST_FAILED_DUE_TO_STATE_NOT_SUCCESS, result is HandleResult.Success) diff --git a/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMSetMapListData.kt b/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMSetMapListData.kt index f1eb7e6a..a8893c9a 100644 --- a/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMSetMapListData.kt +++ b/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMSetMapListData.kt @@ -39,6 +39,7 @@ class ExploreVMSetMapListData : BaseTest() { @Test fun setMapListDataSuccess() = runTest { + mExploreVM.mStyleList = arrayListOf() mExploreVM.setMapListData(context) mExploreVM.mStyleList[0].styleNameDisplay = STANDARD diff --git a/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMSetPoliticalListData.kt b/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMSetPoliticalListData.kt index c735df01..b61dea18 100644 --- a/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMSetPoliticalListData.kt +++ b/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMSetPoliticalListData.kt @@ -37,6 +37,8 @@ class ExploreVMSetPoliticalListData : BaseTest() { @Test fun setPoliticalListDataSuccess() = runTest { + mExploreVM.mPoliticalData = arrayListOf() + mExploreVM.mPoliticalSearchData = arrayListOf() mExploreVM.setPoliticalListData(context) Assert.assertTrue( diff --git a/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMGeofenceDeleteTest.kt b/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMGeofenceDeleteTest.kt index 00294200..3b4bd452 100644 --- a/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMGeofenceDeleteTest.kt +++ b/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMGeofenceDeleteTest.kt @@ -100,6 +100,7 @@ class GeofenceVMGeofenceDeleteTest : BaseTest() { val result = awaitItem() assert(result is HandleResult.Success) assert((result as HandleResult.Success).response.data != null) + assert(result.response.position == 1) cancelAndIgnoreRemainingEvents() } } @@ -114,8 +115,12 @@ class GeofenceVMGeofenceDeleteTest : BaseTest() { ) ).thenAnswer { val callback: GeofenceAPIInterface = it.arguments[2] as GeofenceAPIInterface + val deleteGeofence = DeleteGeofence() + deleteGeofence.position = 0 + deleteGeofence.errorMessage = NO_DATA_FOUND + deleteGeofence.data = null callback.deleteGeofence( - DeleteGeofence(data = null, errorMessage = NO_DATA_FOUND) + deleteGeofence ) } diff --git a/app/src/test/java/com/aws/amazonlocation/viewmodel/mapstyle/MapStyleVMMapListData.kt b/app/src/test/java/com/aws/amazonlocation/viewmodel/mapstyle/MapStyleVMMapListData.kt index 9c4cbddb..10d9cab6 100644 --- a/app/src/test/java/com/aws/amazonlocation/viewmodel/mapstyle/MapStyleVMMapListData.kt +++ b/app/src/test/java/com/aws/amazonlocation/viewmodel/mapstyle/MapStyleVMMapListData.kt @@ -30,6 +30,7 @@ class MapStyleVMSetMapListData : BaseTest() { @Test fun setMapListDataSuccess() = runTest { + mMapStyleViewModel.mStyleList = arrayListOf() mMapStyleViewModel.setMapListData(context) Assert.assertTrue(TEST_FAILED_DUE_TO_INCORRECT_NO_OF_STYLES_LOADED_FOR_STANDARD, mMapStyleViewModel.mStyleList.size == 1) } diff --git a/app/src/test/java/com/aws/amazonlocation/viewmodel/mapstyle/MapStyleVMSetPoliticalListData.kt b/app/src/test/java/com/aws/amazonlocation/viewmodel/mapstyle/MapStyleVMSetPoliticalListData.kt index b5898827..afa1e18c 100644 --- a/app/src/test/java/com/aws/amazonlocation/viewmodel/mapstyle/MapStyleVMSetPoliticalListData.kt +++ b/app/src/test/java/com/aws/amazonlocation/viewmodel/mapstyle/MapStyleVMSetPoliticalListData.kt @@ -31,6 +31,8 @@ class MapStyleVMSetPoliticalListData : BaseTest() { @Test fun setPoliticalListDataSuccess() = runTest { + mMapStyleViewModel.mPoliticalData = arrayListOf() + mMapStyleViewModel.mPoliticalSearchData = arrayListOf() mMapStyleViewModel.setPoliticalListData(context) Assert.assertTrue( From e201a6dea677e7a2ea2ec1ec62b0bca31fe2121f Mon Sep 17 00:00:00 2001 From: shah Date: Wed, 27 Nov 2024 15:05:55 +0530 Subject: [PATCH 3/5] fix: code optimize ALS-1889 --- .../test/java/com/aws/amazonlocation/mock/Constants.kt | 9 --------- 1 file changed, 9 deletions(-) diff --git a/app/src/test/java/com/aws/amazonlocation/mock/Constants.kt b/app/src/test/java/com/aws/amazonlocation/mock/Constants.kt index c0afc78b..692cded0 100644 --- a/app/src/test/java/com/aws/amazonlocation/mock/Constants.kt +++ b/app/src/test/java/com/aws/amazonlocation/mock/Constants.kt @@ -73,7 +73,6 @@ const val TEST_FAILED_MAP_STYLE_DATA = "Map style data not match" const val NO_DATA_FOUND = "No data found" const val TEST_DATA = "Mumbai" -const val TEST_DATA_1 = "en" const val TEST_DATA_2 = "IND" const val TEST_DATA_3 = "The Taj, Mumbai, Mahārāshtra, IND" const val TEST_DATA_4 = "Mahārāshtra" @@ -118,12 +117,6 @@ const val UNIT_METRICS_I_INPUT_2 = 5281.0 const val UNIT_METRICS_I_OUTPUT_2 = "1 mi" const val UNIT_METRICS_I_OUTPUT_3 = "5,280 ft" -const val UNIT_KM_TO_M_INPUT = 1.0 -const val UNIT_KM_TO_M_OUTPUT = 1000.0 - -const val UNIT_MI_TO_FT_INPUT = 1.0 -const val UNIT_MI_TO_FT_OUTPUT = 5280.0 - const val UNIT_TIME_SEC_1 = 50L const val UNIT_TIME_SEC_2 = 120L const val UNIT_TIME_SEC_3 = 3600L @@ -136,12 +129,10 @@ val LOCALE_US = Locale.US val METRIC = "Metric" val IMPERIAL = "Imperial" val AUTOMATIC = "Automatic" -val SE_REGION = "ap-southeast-1" // Dummy credential for test case val IDENTITY_POOL_CLIENT_ID_TEST = "66afllav6ri6hf66sikh6t6foh" val USER_POOL_ID_TEST = "ca-central-1_X6aaHHHb6" -const val UNIT_AMPLIFY_JSON_CONF_INPUT_REGION = "us-east-1" val jsonTurf: String = """ { "type": "Feature", From def7cdbf58a06283e7a06a387ca51a6395113bd7 Mon Sep 17 00:00:00 2001 From: shah Date: Wed, 27 Nov 2024 16:09:19 +0530 Subject: [PATCH 4/5] fix: code optimize and removed unused strings ALS-1889 --- .../com/aws/amazonlocation/utils/GeneralUtils.kt | 3 --- app/src/main/res/values-ar/string.xml | 16 ---------------- app/src/main/res/values-de/string.xml | 16 ---------------- app/src/main/res/values-es/string.xml | 16 ---------------- app/src/main/res/values-fr/string.xml | 16 ---------------- app/src/main/res/values-hi/string.xml | 16 ---------------- app/src/main/res/values-it/string.xml | 16 ---------------- app/src/main/res/values-iw/string.xml | 16 ---------------- app/src/main/res/values-ja/string.xml | 16 ---------------- app/src/main/res/values-ko/string.xml | 16 ---------------- app/src/main/res/values-pt/string.xml | 16 ---------------- app/src/main/res/values-zh-rCN/string.xml | 16 ---------------- app/src/main/res/values-zh-rTW/string.xml | 16 ---------------- app/src/main/res/values/strings.xml | 14 -------------- .../explore/ExploreVMGetAddressLineFromLatLng.kt | 1 - .../geofence/GeofenceVMGeofenceAddTest.kt | 1 - .../geofence/GeofenceVMGeofenceDeleteTest.kt | 1 - .../geofence/GeofenceVMGeofenceListTest.kt | 1 - .../geofence/GeofenceVMSearchSuggestionTest.kt | 1 - .../viewmodel/geofence/GeofenceVMSearchTest.kt | 1 - .../simulation/SimulationVMGetGeofenceList.kt | 2 -- .../tracking/TrackingVMGetGeofenceList.kt | 2 -- 22 files changed, 219 deletions(-) diff --git a/app/src/main/java/com/aws/amazonlocation/utils/GeneralUtils.kt b/app/src/main/java/com/aws/amazonlocation/utils/GeneralUtils.kt index 85f95315..066de114 100644 --- a/app/src/main/java/com/aws/amazonlocation/utils/GeneralUtils.kt +++ b/app/src/main/java/com/aws/amazonlocation/utils/GeneralUtils.kt @@ -6,7 +6,6 @@ import android.content.ClipboardManager import android.content.Context import android.content.Intent import android.content.res.Configuration -import android.content.res.Resources import android.graphics.Color import android.graphics.Typeface import android.net.ConnectivityManager @@ -51,7 +50,6 @@ import com.aws.amazonlocation.ui.main.web_view.WebViewActivity import java.util.Locale import java.util.regex.Matcher import java.util.regex.Pattern -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.callbackFlow @@ -187,7 +185,6 @@ fun changeConditionPrivacyColor(conditionPrivacy: AppCompatTextView) { } @ExcludeFromJacocoGeneratedReport -@ExperimentalCoroutinesApi @CheckResult fun EditText.textChanges(): Flow { return callbackFlow { diff --git a/app/src/main/res/values-ar/string.xml b/app/src/main/res/values-ar/string.xml index 67311c67..89ceb2ee 100644 --- a/app/src/main/res/values-ar/string.xml +++ b/app/src/main/res/values-ar/string.xml @@ -30,9 +30,6 @@ أنت يستطيعون حذف هؤلاء الموارد خلال ال كومة حذف اختيار أو «إدارة» الموارد» صفحات في ال قائمة طعام في ال يسار. قم بالاتصال ال تجريبي التطبيق مع ال حديثا تم إنشاؤه الخدمات اللاسلكية المتقدمة الموارد بواسطة نسخ في مدخل الحقول. من ك تشكيل السحابة انتاج الجزء نسخ ال موافق اسمه يقيم كما انعكست في ال حق الجزء نموذج (معرف تجمع الهوية) إلخ.). **تعلم المزيد**. - - Learn more - 1 2 تسجيل الدخول باستخدام ال ولدت مستخدم أوراق اعتماد. @@ -44,7 +41,6 @@ بواسطة توصيل أنا يوافق إلى Amazon شروط الموقع\n** & الشروط** الشروط & الشروط المساعدة - انقر هنا نطاق المستخدم أدخل نطاق المستخدم أدخل معرف تجمع الهوية @@ -96,13 +92,11 @@ حذف تحرير السياج الجغرافي خريطة أسلوب - تغيير البيانات مزود أيضا يؤثر الأماكن & المسارات API رجاء يدخل لائق هوية حوض السباحة هوية شخصية تم إدخالها مستخدم نطاق هو خطأ تم إدخالها مستخدم حوض السباحة عميل هوية شخصية هو خطأ تم إدخالها مستخدم حوض السباحة هوية شخصية هو خطأ تم إدخالها انترنت قابس كهرباء رابط هو خطأ - البيانات مزود خريطة طراز قم بالاتصال ك الخدمات اللاسلكية المتقدمة الحساب أنت يكونوا متصل @@ -143,7 +137,6 @@ قم بالاتصال الخدمات اللاسلكية المتقدمة الحساب استطلاع الموقع تصريح تم رفضه - اعطي تصريح مسافة لا أستطيع هو حسب لو موقع تصريح هو لا منحت. رجاء تمكين موقع تصريح من أجل Amazon الموقع من عند إعدادات الإسناد قطع الاتصال @@ -154,10 +147,6 @@ © 2024، Amazon الويب خدمات، شركة أو لها الشركات التابعة. جميع حقوق محجوز. بواسطة تنزيل، تثبيت، أو باستخدام ال Amazon الموقع نسخة تجريبية التطبيق، أنت يوافق إلى ال التطبيقات **الشروط & الشروط** من أجل استخدم. بواسطة تنزيل، تثبيت، أو باستخدام ال Amazon الموقع نسخة تجريبية التطبيق، أنت يوافق إلى ال التطبيقات **الشروط & الشروط** من أجل استخدم. - الشروط & الشروط - الخدمات اللاسلكية المتقدمة مقبول استخدم السياسة - الخدمات اللاسلكية المتقدمة الخصوصية تنويه - قانوني و الخصوصية الإصدار علامة خارج شريك الإسناد @@ -181,11 +170,6 @@ كم قدم ميل - الموفر - السمة - النوع - تقدم بطلبك مرشحات - واضح اختيار لا مطابقة الأنماط وجد يصنع بالتأكيد ك بحث هو توضيح بشكل صحيح و محاولة مرة أخرى، ماركة بالتأكيد أنت يملك طبق ال مناسب فلتر أو إزالة ال فلتر و محاولة مرة أخرى واضح مرشحات diff --git a/app/src/main/res/values-de/string.xml b/app/src/main/res/values-de/string.xml index c1316779..0bba5ce8 100644 --- a/app/src/main/res/values-de/string.xml +++ b/app/src/main/res/values-de/string.xml @@ -30,9 +30,6 @@ Du Dose löschen diese Ressourcen durch die stapeln Löschung Option oder \'Verwalten Ressourcen“ Seiten in die Speisekarte auf die links. Verbinden die Demo App mit die vor kurzem erstellt AWS Ressourcen von Kopieren in Eingang Felder. Von dein Wolkenbildung Ausgang Abschnitt Kopie die entsprechende genannt Werte als reflektiert in die Recht Abschnitt bilden (Identity) Oolid usw.). **Lernen mehr**. - - Learn more - 1 2 Einloggen unter Verwendung von die generiert Benutzer Referenzen. @@ -44,7 +41,6 @@ Von verbindend ICH zustimmen zu Amazon Standort\n**Nutzungsbedingungen & Bedingungen** Bedingungen & Bedingungen Hilfe - Klick hier Benutzerdomäne Geben Sie ein Benutzerdomäne Geben Sie ein Identity Oolid @@ -96,13 +92,11 @@ Löschen Bearbeiten Geofence Karte Stil - Ändern Daten Anbieter ebenfalls wirkt Orte & Routen API Bitte eintragen richtig Identität bündeln id Eingetragen Benutzer Domäne ist falsch Eingetragen Benutzer bündeln Auftraggeber id ist falsch Eingetragen Benutzer bündeln id ist falsch Eingetragen Netz Steckdose url ist falsch - Daten Anbieter Karte Stil Verbinden dein AWS Konto Du sind verbunden @@ -143,7 +137,6 @@ Verbinden AWS Konto Vorschau Standort Genehmigung verweigert - Schenken Genehmigung Entfernung kann\nicht Sein berechnete wenn Standort Genehmigung ist nicht gewährt. Bitte ermöglichen Standort Genehmigung zum Amazon Standort von Einstellungen Namensnennung Verbindung trennen @@ -154,10 +147,6 @@ © 2024, Amazon Web Dienstleistungen, Inc. oder seine verbundene Unternehmen. Alles Rechte reserviert. Von wird heruntergeladen, installieren, oder unter Verwendung von die Amazon Standort Demoversion App, Sie zustimmen zu die Apps\'s **Bedingungen & Bedingungen** zum verwenden. Von wird heruntergeladen, installieren, oder unter Verwendung von die Amazon Standort Demoversion App, Sie zustimmen zu die Apps\'s **Bedingungen & Bedingungen** zum verwenden. - Bedingungen & Bedingungen - AWS Annehmbar Benutzen Politik - AWS Datenschutz Hinweis - Rechtlich und Datenschutz Version Schild aus Partnerin Namensnennung @@ -181,11 +170,6 @@ km ft mi - Anbieter - Attribut - Typ - Bewerben Filter - Klar Auswahl Nein übereinstimmende Arten gefunden Machen sicher dein Suche ist buchstabiert richtig und versuchen wieder machen sicher Sie haben angewandt die aneignen Filter oder entfernen die Filter und versuchen nochmal Klar Filter diff --git a/app/src/main/res/values-es/string.xml b/app/src/main/res/values-es/string.xml index 43cc39be..7b2a66b1 100644 --- a/app/src/main/res/values-es/string.xml +++ b/app/src/main/res/values-es/string.xml @@ -30,9 +30,6 @@ Tú poder eliminar estos recursos por la pila eliminación opción o «Gestionar recursos\' páginas en la menú en la izquierda. Conéctate la muestra app con la recientemente creado AWS recursos por copiado en entrada campos. De vuestro Formación en la nube salida sección copiar la correspondiente llamado valora tan reflejada en la derecha sección formulario (ID de grupo de identidad) etc.). **Aprenda más**. - - Learn more - 1 2 Iniciar sesión usando la generado usuario credenciales. @@ -44,7 +41,6 @@ Por conectando YO acordar a Amazon \n**Términos de la ubicación y Condiciones** Términos y Condiciones Ayuda - Haga clic aquí Dominio de usuario Entrar Dominio de usuario Entrar ID de grupo de identidad @@ -96,13 +92,11 @@ Eliminar Editar Geofence Mapa Estilo - Cambiando dato proveedora además afecta Lugares y Rutas API Por favor entrar apropiado identidad piscina id Entró usuario dominio es incorrecta Entró usuario piscina cliente id es incorrecta Entró usuario piscina id es incorrecta Entró web toma de corriente URL es incorrecta - Datos proveedora Mapa estilo Conéctate vuestro AWS Cuenta Tú somos conectada @@ -143,7 +137,6 @@ Conéctate AWS Cuenta Vista previa Ubicación permiso denegado - Regala permiso Distancia no puedo estar calculada si ubicación permiso es no concedido. Por favor habilitar ubicación permiso por Amazon Ubicación de Ajustes Atribución Desconectar @@ -154,10 +147,6 @@ © 2024, Amazon Web Servicios, Cía. o sus afiliados. Todos derechos reservado. Por descargando, instalar, o usando la Amazon Ubicación Demo Aplicación, tú acordar a la Apps\'s **Términos y Condiciones** por usar. Por descargando, instalar, o usando la Amazon Ubicación Demo Aplicación, tú acordar a la Apps\'s **Términos y Condiciones** por usar. - Términos y Condiciones - AWS Aceptable Uso Política - AWS Privacidad Aviso - Legal y Privacidad Versión Signo fuera Socio Atribución @@ -181,11 +170,6 @@ km pies mi - Proveedor - Atributo - Tipo - Aplicar filtra - Borrar selección No a juego estilos encontrado Hacer Sí, claro vuestro búsqueda es deletreado correctamente y intentar otra vez, hacer Sí, claro tú tener aplicado la apropiado filtrar o retirar la filtrar y intentar nuevamente Borrar filtra diff --git a/app/src/main/res/values-fr/string.xml b/app/src/main/res/values-fr/string.xml index b729986f..a46c00f5 100644 --- a/app/src/main/res/values-fr/string.xml +++ b/app/src/main/res/values-fr/string.xml @@ -30,9 +30,6 @@ Vous peut supprimer celles-ci ressources à travers le empiler suppression option ou « Gérer ressources » pages dans le menu sur le gauche. Connecter le démo appli avec le récemment créé AWS ressources par copier dans entrée champs. À partir de votre Formation dans le cloud sortie section copie le correspondant nommé valeurs comme reflété dans le droit section formulaire (Identité : Oolid etc.). **En savoir plus Plus**. - - Learn more - 1 2 Se connecter en utilisant le générée utilisateur informations d\'identification. @@ -44,7 +41,6 @@ Par reliant I d\'accord pour Amazon \n**Termes de l\'emplacement et Conditions** Termes et Conditions Aide - Cliquez ici Domaine utilisateur Entrez Domaine utilisateur Entrez Identité Oolid @@ -96,13 +92,11 @@ Supprimer Modifier Geofence Carte Style - En mutation données fournisseur également affecte Lieux et Itinéraires API Veuillez entrer correct identité piscine identifiant Entré utilisateur domaine est faux Entré utilisateur piscine client identifiant est faux Entré utilisateur piscine identifiant est faux Entré web prise url est faux - Données fournisseur Carte style Connecter votre AWS Compte Vous sont connecté @@ -143,7 +137,6 @@ Connecter AWS Compte Aperçu Emplacement autorisation nié - Donnez autorisation Distance ne peut pas être calculé si emplacement autorisation est pas accordé. Veuillez activer emplacement autorisation pour Amazon Emplacement à partir de Réglages Attribution Déconnecter @@ -154,10 +147,6 @@ © 2024, Amazon Web Des services, Inc. ou ses affiliés. Tous droits réservé. Par téléchargement, installation, ou en utilisant le Amazon Emplacement Démo Application, vous d\'accord pour le Applis **Termes et Conditions** pour utiliser. Par téléchargement, installation, ou en utilisant le Amazon Emplacement Démo Application, vous d\'accord pour le Applis **Termes et Conditions** pour utiliser. - Termes et Conditions - AWS Acceptable Utiliser Politique - AWS Confidentialité Notice - Légal et Confidentialité Version Signe en dehors Partenaire Attribution @@ -181,11 +170,6 @@ km pieds mi - Prestataire - Attribut - Type - Appliquer filtres - Transparent sélection Non appariement styles trouvé Fabriquer sûr votre chercher est orthographié correctement et essayer encore une fois, faire sûr vous avoir appliqué le approprié filtre ou supprimer le filtre et essayer encore Transparent filtres diff --git a/app/src/main/res/values-hi/string.xml b/app/src/main/res/values-hi/string.xml index 304a22fe..50d850e2 100644 --- a/app/src/main/res/values-hi/string.xml +++ b/app/src/main/res/values-hi/string.xml @@ -30,9 +30,6 @@ आप कर सकते हैं हटाना ये साधनों से यह ढेर विलोपन विकल्प या \'मैनेज करें संसाधन\' पृष्ठों में यह मेन्यू के ऊपर यह छोड़ दिया है। कनेक्ट करें यह प्रदर्शन ऐप साथ यह हाल ही में बनाया था एडब्ल्यूएस साधनों द्वारा नकल में इनपुट फ़ील्ड। से तुम्हारा क्लाउड फ़ॉर्मेशन आउटपुट अनुभाग कॉपी करें यह इसी नामित मान जैसा परिलक्षित होता है में यह दाएँ अनुभाग प्रपत्र (आइडेंटिटीपूलिड आदि)। **सीखें अधिक**। - - Learn more - 1 2 लॉगइन इस्तेमाल करते हुए यह उत्पन्न हुआ उपभोक्ता क्रेडेंशियल्स। @@ -44,7 +41,6 @@ द्वारा जोड़ने मैं सहमत हैं को Amazon स्थान की\n**शर्तें & शर्तें** शर्तें & शर्तेँ मदद - क्लिक करें इधर यूज़र डोमेन दर्ज करें यूज़र डोमेन दर्ज करें आइडेंटिटी पूलिड @@ -96,13 +92,11 @@ डिलीट करें संपादित करें जियोफेंस नक्शा स्टाइल - बदल रहा है डेटा प्रदाता भी प्रभावित करता है प्लेसेस & रूट्स एपीआई कृपया दर्ज करें उचित पहचान पूल आईडी दर्ज किया गया उपभोक्ता डोमेन है गलत दर्ज किया गया उपभोक्ता पूल ग्राहक आईडी है गलत दर्ज किया गया उपभोक्ता पूल आईडी है गलत दर्ज किया गया वेब सॉकेट यूआरएल है गलत - डेटा प्रदाता नक्शा अंदाज कनेक्ट करें तुम्हारा एडब्ल्यूएस अकाउंट आप हैं जुड़े हुए @@ -143,7 +137,6 @@ कनेक्ट करें एडब्ल्यूएस अकाउंट पूर्वावलोकन लोकेशन अनुमति इनकार किया - दे अनुमति दूरी कर सकते हैं\ नहीं होना गणना की अगर स्थान अनुमति है ना दी। कृपया सक्षम स्थान अनुमति के लिए Amazon लोकेशन से सेटिंग एट्रिब्यूशन डिस्कनेक्ट करें @@ -154,10 +147,6 @@ © 2024, Amazon वेब सेवाएँ, निगमित या इसके सहयोगी कंपनियों। सभी अधिकार आरक्षित। द्वारा डाउनलोड कर रहा है, स्थापित कर रहा है, या इस्तेमाल करते हुए यह Amazon लोकेशन डेमो ऐप, आप सहमत हैं को यह ऐप्लिकेशन\'s **शर्तें & शर्तें** के लिए उपयोग करें। द्वारा डाउनलोड कर रहा है, स्थापित कर रहा है, या इस्तेमाल करते हुए यह Amazon लोकेशन डेमो ऐप, आप सहमत हैं को यह ऐप्लिकेशन\'s **शर्तें & शर्तें** के लिए उपयोग करें। - शर्तें & शर्तेँ - एडब्ल्यूएस स्वीकार्य उपयोग करें पॉलिसी - एडब्ल्यूएस प्राइवेसी नोटिस - लीगल और प्राइवेसी वर्ज़न साइन इन करें बाहर पार्टनर एट्रिब्यूशन @@ -181,11 +170,6 @@ किमी फुट मील - प्रोवाइडर - गुण - टाइप करें - लागू करें फिल्टर - साफ़ करें चुनना नहीं मिलान शैलियों पाया बनाओ ज़रूर तुम्हारा तलाश है वर्तनी सही ढंग से और कोशिश करो फिर से, बनाना ज़रूर आप है लागू किया यह उचित फ़िल्टर करें या हटाना यह फ़िल्टर करें और कोशिश करो फिर से साफ़ करें फिल्टर diff --git a/app/src/main/res/values-it/string.xml b/app/src/main/res/values-it/string.xml index 48d90837..bc78d72d 100644 --- a/app/src/main/res/values-it/string.xml +++ b/app/src/main/res/values-it/string.xml @@ -30,9 +30,6 @@ Tu lattina eliminare questi risorse attraverso lo pila cancellazione opzione o \'Gestisci risorse» pagine nel lo menù sul lo sinistra. Connetti lo manifestazione app con lo recentemente creato AWS risorse da copiando nel ingresso campi. Da tuo Formazione sul cloud produzione sezione copia lo corrispondenti denominato valori come riflessa nel lo destra sezione modulo (ID del pool di identità) ecc.). **Impara altro**. - - Learn more - 1 2 Accedi utilizzando lo generato utente credenziali. @@ -44,7 +41,6 @@ Di collegando IO concordare a Amazon \n**Termini della sede & Condizioni** Termini & Condizioni Aiuto - Fare clic qui Dominio utente Entra Dominio utente Entra ID del pool di identità @@ -96,13 +92,11 @@ Elimina Modifica Geofence Mappa Stile - Cambiando dato fornitore anche colpisce Luoghi & Percorsi API Per favore inserire corretto identità piscina id Entrato utente dominio è sbagliato Entrato utente piscina cliente id è sbagliato Entrato utente piscina id è sbagliato Entrato web presa di corrente url è sbagliato - Dati fornitore Mappa stile Connetti tuo AWS Account Tu siamo connesso @@ -143,7 +137,6 @@ Connetti AWS Account Anteprima Posizione autorizzazione negato - Dare autorizzazione Distanza non posso essere calcolato se posizione autorizzazione è non concesso. Per favore abilitare posizione autorizzazione per Amazon Posizione da Impostazioni Attribuzione Disconnetti @@ -154,10 +147,6 @@ © 2024, Amazon Web Servizi, Inc. o la sua affiliati. Tutti diritti riservato. Di scaricamento, installazione, o utilizzando lo Amazon Posizione Dimostrazione App, voi concordare a lo App **Termini & Condizioni** per uso. Di scaricamento, installazione, o utilizzando lo Amazon Posizione Dimostrazione App, voi concordare a lo App **Termini & Condizioni** per uso. - Termini & Condizioni - AWS Accettabile Usa Politica - AWS Privacy Avviso - Legale e Privacy Versione Segno fuori Partner Attribuzione @@ -181,11 +170,6 @@ km piedi mi - Fornitore - Attributo - Tipo - Applica filtri - Trasparente selezione No accoppiamento stili trovato Marca sicuro tuo ricerca è scritto correttamente e provare ancora, fare sicuro voi avere applicata lo apposito filtro o rimuovere lo filtro e provare nuovamente Trasparente filtri diff --git a/app/src/main/res/values-iw/string.xml b/app/src/main/res/values-iw/string.xml index 923ad4eb..a35eb83d 100644 --- a/app/src/main/res/values-iw/string.xml +++ b/app/src/main/res/values-iw/string.xml @@ -30,9 +30,6 @@ אתה מסוגל למחוק אלו משאבים דרך ה ערימה מחיקה אפשרות או \'לנהל משאבים עמודים בתוך ה תפריט על ה שמאלה. התחבר ה דמו יישום עם ה לאחרונה נברא AWS משאבים על ידי להעתיק בתוך להזין שדות. מ שלך תצורת ענן פלט קטע העתק ה תואם בשם ערכים בתור משתקף בתוך ה ימין קטע טופס (זהותPoolid וכו \'). **למד יותר**. - - Learn more - 1 2 התחברות לנצל ה נוצר משתמש אישורים. @@ -44,7 +41,6 @@ על ידי מקשר אנוכי מסכים כדי Amazon תנאי\n** של המיקום & תנאים** תנאים & תנאים עזרה - לחץ פה דומיין משתמש הזן דומיין משתמש הזן זיהויPoolid @@ -96,13 +92,11 @@ מחק עריכה גיאופנס מפה סגנון - משתנה פרטים ספק וכן משפיע מקומות & מסלולים ממשק תכנות יישומים נא הכנס ראוי זהות בריכה מזהה נכנס משתמש תחום הווה שגוי נכנס משתמש בריכה לקוח מזהה הווה שגוי נכנס משתמש בריכה מזהה הווה שגוי נכנס אינטרנט שקע כתובת אתר הווה שגוי - נתונים ספק מפה סגנון התחבר שלך AWS חשבון אתה מהווים מחובר @@ -143,7 +137,6 @@ התחבר AWS חשבון תצוגה מקדימה מיקום רשות נדחה - תן רשות מרחק יכול\ לא להיות מחושב אם מקום רשות הווה לא הוענקה. נא להפעיל מקום רשות בשביל Amazon מיקום מ הגדרות ייחוס התנתק @@ -154,10 +147,6 @@ © 2024, Amazon אינטרנט שירותים, "בע""מ" או שלו שותפים. כל זכויות שמורה. על ידי הורדה, התקנה, או לנצל ה Amazon מיקום הדגמה אפליקציה, אתה מסכים כדי ה אפליקציות\ **תנאים & תנאים** בשביל להשתמש. על ידי הורדה, התקנה, או לנצל ה Amazon מיקום הדגמה אפליקציה, אתה מסכים כדי ה אפליקציות\ **תנאים & תנאים** בשביל להשתמש. - תנאים & תנאים - AWS מקובל השתמש מדיניות - AWS פרטיות שימו לב - משפטי ו פרטיות גרסה לחתום החוצה פרטנר ייחוס @@ -181,11 +170,6 @@ "ק""מ" רגל mi - ספק - תכונה - הקלד - הגש בקשה מסננים - ברור בחירה לא זיווג סגנונות נמצא לעשות בטח שלך חפש הווה מאוית נכון ו השתדל שוב, עשה בטח אתה יש הגיש בקשה ה ראוי מסנן או הסר ה מסנן ו השתדל שוב ברור מסננים diff --git a/app/src/main/res/values-ja/string.xml b/app/src/main/res/values-ja/string.xml index 450da437..d8ece57a 100644 --- a/app/src/main/res/values-ja/string.xml +++ b/app/src/main/res/values-ja/string.xml @@ -30,9 +30,6 @@ あなた できます 削除する これら リソース を通して その スタック 削除 オプション または \'管理 リソース \' ページ数 に その メニュー オン その 左。 接続 その デモ アプリ と その 最近です 作成した AWS リソース によって コピー に 入力 畑。 から きみの クラウド形成 出力 セクション コピーします その 対応する 名前付き 値 なので 反映 に その 右 セクション フォーム (ID プール ID など)。 **学習 もっと**。 - - Learn more - 1 2 ログイン を使用します その 生成された ユーザー 資格情報。 @@ -44,7 +41,6 @@ によって 接続する 私 同意する に Amazon 場所の\n**規約 & 条件** 規約 & 条件 ヘルプ - クリック ここに ユーザードメイン [入力] ユーザードメイン [入力] ID プール ID @@ -96,13 +92,11 @@ [削除] [編集] ジオフェンス マップ スタイル - 変更 データ プロバイダー また 影響する 場所 & ルート API お願いします 入る 適切な アイデンティティ プール ID 入力済み ユーザー ドメイン です 間違っています 入力済み ユーザー プール クライアント ID です 間違っています 入力済み ユーザー プール ID です 間違っています 入力済み ウェブ ソケット URL です 間違っています - [データ] プロバイダー マップ スタイル 接続 きみの AWS 口座 あなた です 接続されています @@ -143,7 +137,6 @@ 接続 AWS 口座 プレビュー ロケーション 許可 拒否されました - 与える 許可 距離 できない です 計算された もし ロケーション 許可 です じゃない 付与されました。 お願いします 有効にします ロケーション 許可 にとって Amazon ロケーション から [設定] アトリビューション 接続解除 @@ -154,10 +147,6 @@ © 2024, Amazon ウェブ サービス、 インコーポレイテッド または その アフィリエイト。 [すべて] 権利 予約済み。 によって ダウンロード中、 インストール、 または を使用します その Amazon ロケーション デモ アプリ、 あなた 同意する に その アプリ **規約 & 条件** にとって 使用。 によって ダウンロード中、 インストール、 または を使用します その Amazon ロケーション デモ アプリ、 あなた 同意する に その アプリ **規約 & 条件** にとって 使用。 - 規約 & 条件 - AWS 許容範囲内 使用 ポリシー - AWS プライバシー 通知 - リーガル そして プライバシー バージョン サイン アウト パートナー アトリビューション @@ -181,11 +170,6 @@ キロ フィート mi - プロバイダー - [属性] - タイプ - [適用] フィルター - クリア 選択 いいえ マッチング スタイル 見つけた 作る 承知しました きみの 検索 です 綴られた 正しく そして 試してみる もう一度、 作る 承知しました あなた 持っている 適用された その 適切な フィルタ または 削除する その フィルタ そして 試してみる 再び クリア フィルター diff --git a/app/src/main/res/values-ko/string.xml b/app/src/main/res/values-ko/string.xml index 95382f00..018c7869 100644 --- a/app/src/main/res/values-ko/string.xml +++ b/app/src/main/res/values-ko/string.xml @@ -30,9 +30,6 @@ 당신 양철통 지우다 이들 자원 를 통해 그 스택 삭제 선택권 또는 \'관리 리소스\' 페이지 에서 그 메뉴 ...에 그 왼쪽. 커넥트 그 데모 앱 와 그 최근에 생성되었습니다 AWS 자원 에 의해 복사 에서 입력 필드. 에서 당신의 클라우드 포메이션 출력 섹션 복사 그 동 이름이 지정되어 있습니다 가치 같이 반영 에서 그 오른쪽 섹션 형식 (아이덴티티 풀 ID) 등). **알아보기 더보기**. - - Learn more - 1 2 로그인 를 사용하여 그 생성 사용자 자격 증명. @@ -44,7 +41,6 @@ 에 의해 연결 나는 동의하다 에 Amazon 위치\n**약관 & 조건** 약관 & 조건 도움말 - 클릭 이리 사용자 도메인 들어가기 사용자 도메인 들어가기 아이덴티티 풀 ID @@ -96,13 +92,11 @@ 삭제 편집 지오펜스 지도 스타일 - 변경 데이터 공급자 또한 영향을 미친다 장소 & 노선 API 부디 를 입력합니다 적절한 신원을 확인합니다 풀 id 입력됨 사용자 도메인 입니다 잘못된 입력됨 사용자 풀 고객 id 입니다 잘못된 입력됨 사용자 풀 id 입니다 잘못된 입력됨 웹 소켓 url 입니다 잘못된 - 데이터 공급자 지도 스타일 커넥트 당신의 AWS 계정 당신 입니다 연결됨 @@ -143,7 +137,6 @@ 커넥트 AWS 계정 시사 위치 허가 거부되었습니다 - 주기 허가 거리 할 수 없습니다 있다 계획된 만약 위치 허가 입니다 아니 부여됩니다. 부디 활성화하십시오 위치 허가 ...에 대한 Amazon 위치 ...에서 설정 저작자 표시 연결 끊기 @@ -154,10 +147,6 @@ © 2024, Amazon 웹 서비스, 주식회사 또는 그것의 계열사. 모두 권한 예약되어 있습니다. 에 의해 다운로드, 설치, 또는 를 사용하여 그 Amazon 위치 데모 앱, 당신 동의하다 에 그 앱\ \'의 **약관 & 조건** ...에 대한 용도. 에 의해 다운로드, 설치, 또는 를 사용하여 그 Amazon 위치 데모 앱, 당신 동의하다 에 그 앱\ \'의 **약관 & 조건** ...에 대한 용도. - 약관 & 조건 - AWS 수용 가능 용도 정책 - AWS 프라이버시 공지 - 법률 과 프라이버시 버전 서명 밖으로 파트너 저작자 표시 @@ -181,11 +170,6 @@ km 피트 mi - 제공자 - 특성 - 타입 - 적용하기 필터 - 투명 선택 아니요 어울리는 스타일 녹이다 만들기 확실한 당신의 수색 입니다 철자 바르게 과 시도해 보십시오 다시 말하지만, 만들 확실한 당신 있다 적용된 그 적절한 필터 또는 제거 그 필터 과 시도해 보십시오 다시 투명 필터 diff --git a/app/src/main/res/values-pt/string.xml b/app/src/main/res/values-pt/string.xml index d1f04de3..f76c4371 100644 --- a/app/src/main/res/values-pt/string.xml +++ b/app/src/main/res/values-pt/string.xml @@ -30,9 +30,6 @@ Você lata deletar estes recursos através a pilha eliminação opção ou “Gerenciar recursos\' páginas em a cardápio em a esquerda. Conectar a demonstração aplicativo com a recentemente criada AWS recursos de copiando em entrada campos. De seu Formação de nuvem saída seção copiar a correspondente nomeado valores como refletido em a certo seção forma (ID do pool de identidade) etc.). **Aprenda mais**. - - Learn more - 1 2 Login usando a gerada usuária credenciais. @@ -44,7 +41,6 @@ Por conectando EU aceita para Amazon \n** Termos da localização & Condições** Termos & Condições Socorro - Clique aqui Domínio do usuário Entrar Domínio do usuário Entrar ID do pool de identidade @@ -96,13 +92,11 @@ Excluir Editar Geofence Mapa Estilo - Mudando dados fornecedor também afeta Lugares & Rotas API Por favor entrar apropriado identificação piscina id Entrou usuária dominar é incorreto Entrou usuária piscina cliente id é incorreto Entrou usuária piscina id é incorreto Entrou web soquete url é incorreto - Dados fornecedor Mapa estilizar Conectar seu AWS Conta Você está conectado @@ -143,7 +137,6 @@ Conectar AWS Conta prévia Localização permissão negado - Dê permissão Distância não posso ser calculado E se localização permissão é não concedido. Por favor habilitar localização permissão pelo Amazon Localização desde Configurações Atribuição Desconectar @@ -154,10 +147,6 @@ © 2024, Amazon Web Serviços, Inc. ou dela afiliados. Todos corretos reservado. Por baixando, instalando, ou usando a Amazon Localização Demo Aplicativo, você aceita para a Aplicativos **Termos & Condições** pelo usar. Por baixando, instalando, ou usando a Amazon Localização Demo Aplicativo, você aceita para a Aplicativos **Termos & Condições** pelo usar. - Termos & Condições - AWS Aceitável Uso Política - AWS Privacidade Aviso - Legal e Privacidade Versão Assinar fora Parceiro Atribuição @@ -181,11 +170,6 @@ quilômetro pés mi - Provedor - Atributo - Tipo - Aplique filtra - Claro seleção Não combinando estilos encontrado Faça com certeza seu procurar é soletrado corretamente e tentar novamente, fazer com certeza você ter aplicado a apropriado filtrar ou remover a filtrar e tentar de novo Claro filtra diff --git a/app/src/main/res/values-zh-rCN/string.xml b/app/src/main/res/values-zh-rCN/string.xml index 1c7ede57..b395b3b0 100644 --- a/app/src/main/res/values-zh-rCN/string.xml +++ b/app/src/main/res/values-zh-rCN/string.xml @@ -30,9 +30,6 @@ 你 能够 删除 这些 资源 通过 这 堆 删除 选项 要么 \'管理 资源\' 页面 在 这 菜单 上 这 左。 连接 这 演示 应用 和 这 最近 创造 AWS 资源 通过 复制 在 输入 字段。 来自 您的 云形成 输出 部分 复制 这 相应的 被命名 价值 如同 反映 在 这 权利 部分 表单 (identityPoolID 等等)。 **学习 更多**。 - - Learn more - 1 2 登录 使用 这 生成的 用户 证书。 @@ -44,7 +41,6 @@ 由 连接 我 同意 到 Amazon 地点的\n**条款 & 条件** 条款 & 条件 帮帮我 - 点击 这里 用户域 输入 用户域 输入 identitypoolID @@ -96,13 +92,11 @@ 删除 编辑 Geofence 地图 风格 - 正在改变 数据 提供者 也 影响 地方 & 路线 API 请 输入 正确的 身份 池 id 已输入 用户 域 是 错了 已输入 用户 池 客户 id 是 错了 已输入 用户 池 id 是 错了 已输入 网站 插座 网址 是 错了 - 数据 提供者 地图 风格 连接 您的 AWS 账户 你 是 连接的 @@ -143,7 +137,6 @@ 连接 AWS 账户 预览 地点 许可 否认 - 给 许可 距离 不能 是 已计算 如果 位置 许可 是 不 授予。 请 启用 位置 许可 为了 Amazon 地点 从 设置 归因 断开连接 @@ -154,10 +147,6 @@ © 2024年, Amazon 网页 服务, 公司 要么 它的 附属公司。 全部 权利 保留的。 由 正在下载, 正在安装, 要么 使用 这 Amazon 地点 演示 应用程序, 你 同意 到 这 应用程序 **条款 & 条件** 为了 使用。 由 正在下载, 正在安装, 要么 使用 这 Amazon 地点 演示 应用程序, 你 同意 到 这 应用程序 **条款 & 条件** 为了 使用。 - 条款 & 条件 - AWS 可以接受 使用 政策 - AWS 隐私 通知 - 合法 和 隐私 版本 标志 出 合作伙伴 归因 @@ -181,11 +170,6 @@ 公里 英尺 mi - 提供商 - 属性 - 键入 - 申请 过滤器 - 清除 选择 没有 匹配 风格 找到 制作 当然 您的 搜索 是 拼出的 正确地 和 尝试 再说一遍, 使 当然 你 有 应用的 这 适当 过滤 要么 去除 这 过滤 和 尝试 再次 清除 过滤器 diff --git a/app/src/main/res/values-zh-rTW/string.xml b/app/src/main/res/values-zh-rTW/string.xml index 0cd67b83..298577fe 100644 --- a/app/src/main/res/values-zh-rTW/string.xml +++ b/app/src/main/res/values-zh-rTW/string.xml @@ -30,9 +30,6 @@ 你 可以 刪除 這些 資源 通過 該 堆 刪除 選項 或者 \'管理 資源 頁面 在 該 菜單 上 該 左。 連接 該 演示 應用程式 與 該 最近 已建立 亞馬遜網路服務公司 資源 由 複製 在 輸入 欄位。 從 你的 雲形成 產量 區段 複製 該 相應的 命名 值 如 反映 在 該 對 區段 形式 (身份類型 等)。 ** 學習 更多 **。 - - Learn more - 1 2 登入 運用 該 產生 用戶 認證。 @@ -44,7 +41,6 @@ 通過 連線 我 同意 至 Amazon 地點\n** 條款 & 條件 ** 條款 & 條件 幫助 - 按一下 這裡 使用者網域 輸入 使用者網域 輸入 身份類型 @@ -96,13 +92,11 @@ 刪除 編輯 地理圍欄 地圖 風格 - 改變 資料 供應商 也 影響 地方 & 路線 應用程式編程介面 求你了 輸入 正確的 身份 池 身份證 已輸入 用戶 域 是 錯了 已輸入 用戶 池 客戶 身份證 是 錯了 已輸入 用戶 池 身份證 是 錯了 已輸入 網路 插座 網址 是 錯了 - 數據 供應商 地圖 風格 連接 你的 亞馬遜網路服務公司 帳號 你 是 連線 @@ -143,7 +137,6 @@ 連接 亞馬遜網路服務公司 帳號 預覽 位置 允許 否認 - 給 允許 距離 不能\ 是 計算 如果 地點 允許 是 不 授予。 求你了 啟用 地點 允許 為了 Amazon 位置 從 設定 歸因 斷開 @@ -154,10 +147,6 @@ © 2024, Amazon 網頁 服務, 公司 或者 它的 附屬機構。 所有 權利 保留。 通過 下載, 安裝, 或者 運用 該 Amazon 位置 演示 應用程序, 您 同意 至 該 應用\ 的 ** 條款 & 條件 ** 為了 使用。 通過 下載, 安裝, 或者 運用 該 Amazon 位置 演示 應用程序, 您 同意 至 該 應用\ 的 ** 條款 & 條件 ** 為了 使用。 - 條款 & 條件 - 亞馬遜網路服務公司 可接受 使用 政策 - 亞馬遜網路服務公司 隐私 通知 - 法律 和 隐私 版本 簽署 出 夥伴 歸因 @@ -181,11 +170,6 @@ 公里 英呎 英哩 - 供應商 - 屬性 - 类型 - 申請 過濾器 - 清除 選擇 沒有 匹配 款式 發現 製作 當然 你的 搜尋 是 拼寫 正確地 和 嘗試 再次, 做 當然 您 有 應用的 該 適當的 過濾器 或者 去掉 該 過濾器 和 嘗試 再次 清除 過濾器 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4068615e..d1638314 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -32,7 +32,6 @@ You can delete these resources through the stack deletion option or ‘Manage resources’ pages in the menu on the left. Connect the demo app with the recently created AWS resources by copying in input fields. From your CloudFormation output section copy the corresponding named values as reflected in the right section form (IdentityPoolId etc.). **Learn more**. - Learn more 1 2 Login using the generated user credentials. @@ -44,7 +43,6 @@ By connecting I agree to Amazon Location’s\n**Terms & Conditions** Terms & Conditions Help - Click here UserDomain Enter UserDomain Enter IdentityPoolId @@ -108,7 +106,6 @@ Delete Edit Geofence Map Style - Standard Monochrome Hybrid @@ -118,7 +115,6 @@ Entered user pool client id is wrong Entered user pool id is wrong Entered web socket url is wrong - Data provider Map style Connect your AWS Account You are connected @@ -159,7 +155,6 @@ Connect AWS Account Preview Location permission denied - Give permission Distance can\'t be calculated if location permission is not granted. Please enable location permission for Amazon Location from Settings Attribution Disconnect @@ -170,10 +165,6 @@ © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. By downloading, installing, or using the Amazon Location Demo App, you agree to the App\'s **Terms & Conditions** for use. By downloading, installing, or using the Amazon Location Demo App, you agree to the App\'s **Terms & Conditions** for use. - Terms & Conditions - AWS Acceptable Use Policy - AWS Privacy Notice - Legal and Privacy Version Sign out Partner Attribution @@ -197,11 +188,6 @@ km ft mi - Provider - Attribute - Type - Apply view - Clear selection No matching styles found Make sure your search is spelled correctly and try again, make sure you have applied the appropriate filter or remove the filter and try again Clear filters diff --git a/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMGetAddressLineFromLatLng.kt b/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMGetAddressLineFromLatLng.kt index 9b1cf6b6..f145c864 100644 --- a/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMGetAddressLineFromLatLng.kt +++ b/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMGetAddressLineFromLatLng.kt @@ -10,7 +10,6 @@ import com.aws.amazonlocation.domain.`interface`.SearchDataInterface import com.aws.amazonlocation.domain.usecase.LocationSearchUseCase import com.aws.amazonlocation.mock.* import com.aws.amazonlocation.ui.main.explore.ExploreViewModel -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Assert import org.junit.Rule diff --git a/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMGeofenceAddTest.kt b/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMGeofenceAddTest.kt index 8421945d..b97fd560 100644 --- a/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMGeofenceAddTest.kt +++ b/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMGeofenceAddTest.kt @@ -14,7 +14,6 @@ import com.aws.amazonlocation.mock.NO_DATA_FOUND import com.aws.amazonlocation.mock.TEST_DATA_9 import com.aws.amazonlocation.ui.main.geofence.GeofenceViewModel import com.aws.amazonlocation.utils.GeofenceCons -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Rule import org.junit.Test diff --git a/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMGeofenceDeleteTest.kt b/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMGeofenceDeleteTest.kt index 3b4bd452..b307950a 100644 --- a/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMGeofenceDeleteTest.kt +++ b/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMGeofenceDeleteTest.kt @@ -19,7 +19,6 @@ import com.aws.amazonlocation.mock.TEST_DATA_8 import com.aws.amazonlocation.mock.TEST_DATA_LAT_1 import com.aws.amazonlocation.mock.TEST_DATA_LNG_1 import com.aws.amazonlocation.ui.main.geofence.GeofenceViewModel -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Rule import org.junit.Test diff --git a/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMGeofenceListTest.kt b/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMGeofenceListTest.kt index 1b2523e4..a7e2cfa5 100644 --- a/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMGeofenceListTest.kt +++ b/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMGeofenceListTest.kt @@ -12,7 +12,6 @@ import com.aws.amazonlocation.mock.NO_DATA_FOUND import com.aws.amazonlocation.mock.Responses import com.aws.amazonlocation.ui.main.geofence.GeofenceViewModel import com.aws.amazonlocation.utils.GeofenceCons -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Rule import org.junit.Test diff --git a/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMSearchSuggestionTest.kt b/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMSearchSuggestionTest.kt index 24921478..eac0ffa0 100644 --- a/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMSearchSuggestionTest.kt +++ b/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMSearchSuggestionTest.kt @@ -12,7 +12,6 @@ import com.aws.amazonlocation.mock.DEFAULT_LOCATION import com.aws.amazonlocation.mock.Responses import com.aws.amazonlocation.mock.SEARCH_TEXT_RIO_TINTO import com.aws.amazonlocation.ui.main.geofence.GeofenceViewModel -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Rule import org.junit.Test diff --git a/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMSearchTest.kt b/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMSearchTest.kt index 2ab19e35..7de432c3 100644 --- a/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMSearchTest.kt +++ b/app/src/test/java/com/aws/amazonlocation/viewmodel/geofence/GeofenceVMSearchTest.kt @@ -14,7 +14,6 @@ import com.aws.amazonlocation.mock.NO_DATA_FOUND import com.aws.amazonlocation.mock.Responses import com.aws.amazonlocation.mock.SEARCH_TEXT_RIO_TINTO import com.aws.amazonlocation.ui.main.geofence.GeofenceViewModel -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Rule import org.junit.Test diff --git a/app/src/test/java/com/aws/amazonlocation/viewmodel/simulation/SimulationVMGetGeofenceList.kt b/app/src/test/java/com/aws/amazonlocation/viewmodel/simulation/SimulationVMGetGeofenceList.kt index 70921ccc..85c179c6 100644 --- a/app/src/test/java/com/aws/amazonlocation/viewmodel/simulation/SimulationVMGetGeofenceList.kt +++ b/app/src/test/java/com/aws/amazonlocation/viewmodel/simulation/SimulationVMGetGeofenceList.kt @@ -12,8 +12,6 @@ import com.aws.amazonlocation.mock.* import com.aws.amazonlocation.ui.main.simulation.SimulationViewModel import com.aws.amazonlocation.utils.GeofenceCons import com.aws.amazonlocation.utils.simulationCollectionName -import java.util.* -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Assert import org.junit.Rule diff --git a/app/src/test/java/com/aws/amazonlocation/viewmodel/tracking/TrackingVMGetGeofenceList.kt b/app/src/test/java/com/aws/amazonlocation/viewmodel/tracking/TrackingVMGetGeofenceList.kt index b0e4b796..098951f6 100644 --- a/app/src/test/java/com/aws/amazonlocation/viewmodel/tracking/TrackingVMGetGeofenceList.kt +++ b/app/src/test/java/com/aws/amazonlocation/viewmodel/tracking/TrackingVMGetGeofenceList.kt @@ -11,7 +11,6 @@ import com.aws.amazonlocation.domain.usecase.GeofenceUseCase import com.aws.amazonlocation.mock.* import com.aws.amazonlocation.ui.main.tracking.TrackingViewModel import com.aws.amazonlocation.utils.GeofenceCons -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Assert import org.junit.Rule @@ -21,7 +20,6 @@ import org.mockito.Mock import org.mockito.Mockito import org.mockito.kotlin.any import org.robolectric.RobolectricTestRunner -import java.util.* @RunWith(RobolectricTestRunner::class) class TrackingVMGetGeofenceList : BaseTest() { From 76e0db15335f7b7503553ec00219a1f1cac3588f Mon Sep 17 00:00:00 2001 From: shah Date: Fri, 29 Nov 2024 14:56:11 +0530 Subject: [PATCH 5/5] feat: Map language selection added in map style bottom sheet ALS-1916 --- .../com/aws/amazonlocation/ConstantTest.kt | 3 + .../MapStylesSettingAndExplorerFlowSuite.kt | 4 + .../ui/main/ExploreFragmentMapLanguageTest.kt | 106 ++++++++++++++++++ .../ui/main/SettingsMapLanguageTest.kt | 85 ++++++++++++++ .../data/response/LanguageData.kt | 7 ++ .../ui/main/explore/ExploreFragment.kt | 6 + .../ui/main/explore/ExploreViewModel.kt | 79 +++++++++++++ .../ui/main/explore/MapLanguageAdapter.kt | 75 +++++++++++++ .../map_style/MapStyleBottomSheetFragment.kt | 80 ++++++++++++- .../ui/main/map_style/MapStyleFragment.kt | 76 ++++++++++++- .../ui/main/map_style/MapStyleViewModel.kt | 79 +++++++++++++ .../com/aws/amazonlocation/utils/Constants.kt | 1 + .../com/aws/amazonlocation/utils/MapHelper.kt | 9 +- .../layout-sw600dp/bottom_sheet_map_style.xml | 86 +++++++++++++- .../res/layout-sw600dp/fragment_map_style.xml | 86 +++++++++++++- .../layout-sw720dp/bottom_sheet_map_style.xml | 86 +++++++++++++- .../res/layout-sw720dp/fragment_map_style.xml | 86 +++++++++++++- .../res/layout/bottom_sheet_map_style.xml | 86 +++++++++++++- .../main/res/layout/fragment_map_style.xml | 86 +++++++++++++- app/src/main/res/layout/item_map_language.xml | 50 +++++++++ app/src/main/res/values-ar/string.xml | 4 + app/src/main/res/values-de/string.xml | 4 + app/src/main/res/values-es/string.xml | 4 + app/src/main/res/values-fr/string.xml | 4 + app/src/main/res/values-hi/string.xml | 4 + app/src/main/res/values-it/string.xml | 4 + app/src/main/res/values-iw/string.xml | 4 + app/src/main/res/values-ja/string.xml | 4 + app/src/main/res/values-ko/string.xml | 4 + app/src/main/res/values-pt/string.xml | 4 + app/src/main/res/values-zh-rCN/string.xml | 4 + app/src/main/res/values-zh-rTW/string.xml | 4 + app/src/main/res/values/strings.xml | 4 + .../com/aws/amazonlocation/mock/Constants.kt | 1 + .../explore/ExploreVMSetLanguageListData.kt | 60 ++++++++++ .../mapstyle/MapStyleVMSetLanguageListData.kt | 56 +++++++++ 36 files changed, 1320 insertions(+), 25 deletions(-) create mode 100644 app/src/androidTest/java/com/aws/amazonlocation/ui/main/ExploreFragmentMapLanguageTest.kt create mode 100644 app/src/androidTest/java/com/aws/amazonlocation/ui/main/SettingsMapLanguageTest.kt create mode 100644 app/src/main/java/com/aws/amazonlocation/data/response/LanguageData.kt create mode 100644 app/src/main/java/com/aws/amazonlocation/ui/main/explore/MapLanguageAdapter.kt create mode 100644 app/src/main/res/layout/item_map_language.xml create mode 100644 app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMSetLanguageListData.kt create mode 100644 app/src/test/java/com/aws/amazonlocation/viewmodel/mapstyle/MapStyleVMSetLanguageListData.kt diff --git a/app/src/androidTest/java/com/aws/amazonlocation/ConstantTest.kt b/app/src/androidTest/java/com/aws/amazonlocation/ConstantTest.kt index 8eeb32e6..d34eba4a 100644 --- a/app/src/androidTest/java/com/aws/amazonlocation/ConstantTest.kt +++ b/app/src/androidTest/java/com/aws/amazonlocation/ConstantTest.kt @@ -42,6 +42,8 @@ const val TEST_WORD_GUOCO_MIDTOWN_SQUARE = "Guoco Midtown Square" const val TEST_WORD_KLUANG = "Kluang " const val TEST_WORD_ARG = "ARG" const val TEST_WORD_RUS = "RUS" +const val TEST_WORD_LANGUAGE_AR = "العربية" +const val TEST_WORD_LANGUAGE_BO = "Bosanski" const val ACCESS_FINE_LOCATION = "android.permission.ACCESS_FINE_LOCATION" const val ACCESS_COARSE_LOCATION = "android.permission.ACCESS_COARSE_LOCATION" const val TEST_FAILED = "Test failed" @@ -54,6 +56,7 @@ const val TEST_FAILED_SEARCH_DIRECTION = "Test failed due to search direction no const val TEST_FAILED_ZOOM_LEVEL = "Test failed due to zoom level not available" const val TEST_FAILED_LIST = "Test failed due to list not visible" const val TEST_FAILED_COUNTRY= "Test failed due to selected country doesn't match" +const val TEST_FAILED_LANGUAGE= "Test failed due to selected language doesn't match" const val TEST_FAILED_SETTINGS_ALL_OPTIONS_NOT_VISIBLE = "Test failed due to settings all options not visible" diff --git a/app/src/androidTest/java/com/aws/amazonlocation/ui/MapStylesSettingAndExplorerFlowSuite.kt b/app/src/androidTest/java/com/aws/amazonlocation/ui/MapStylesSettingAndExplorerFlowSuite.kt index e48dd728..e43caaf4 100644 --- a/app/src/androidTest/java/com/aws/amazonlocation/ui/MapStylesSettingAndExplorerFlowSuite.kt +++ b/app/src/androidTest/java/com/aws/amazonlocation/ui/MapStylesSettingAndExplorerFlowSuite.kt @@ -2,12 +2,14 @@ package com.aws.amazonlocation.ui import com.aws.amazonlocation.ui.main.CheckRouteMapAdjustedTest import com.aws.amazonlocation.ui.main.ExploreFragmentChangeStyleTest +import com.aws.amazonlocation.ui.main.ExploreFragmentMapLanguageTest import com.aws.amazonlocation.ui.main.ExploreFragmentPoliticalViewTest import com.aws.amazonlocation.ui.main.ExploreFragmentSearchLocationByAddressTest import com.aws.amazonlocation.ui.main.SearchResultComparisonTest import com.aws.amazonlocation.ui.main.SettingRouteOptionAvailableTest import com.aws.amazonlocation.ui.main.SettingsFragmentContentTest import com.aws.amazonlocation.ui.main.SettingsFragmentDefaultRouteTest +import com.aws.amazonlocation.ui.main.SettingsMapLanguageTest import com.aws.amazonlocation.ui.main.SettingsMapPoliticalViewTest import org.junit.runner.RunWith import org.junit.runners.Suite @@ -23,5 +25,7 @@ import org.junit.runners.Suite ExploreFragmentChangeStyleTest::class, ExploreFragmentPoliticalViewTest::class, SettingsMapPoliticalViewTest::class, + ExploreFragmentMapLanguageTest::class, + SettingsMapLanguageTest::class, ) class MapStylesSettingAndExplorerFlowSuite diff --git a/app/src/androidTest/java/com/aws/amazonlocation/ui/main/ExploreFragmentMapLanguageTest.kt b/app/src/androidTest/java/com/aws/amazonlocation/ui/main/ExploreFragmentMapLanguageTest.kt new file mode 100644 index 00000000..1400cbe9 --- /dev/null +++ b/app/src/androidTest/java/com/aws/amazonlocation/ui/main/ExploreFragmentMapLanguageTest.kt @@ -0,0 +1,106 @@ +package com.aws.amazonlocation.ui.main + +import androidx.test.core.app.ApplicationProvider +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.matcher.ViewMatchers.* +import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation +import androidx.test.uiautomator.By +import androidx.test.uiautomator.UiDevice +import androidx.test.uiautomator.UiSelector +import androidx.test.uiautomator.Until +import com.aws.amazonlocation.* +import com.aws.amazonlocation.di.AppModule +import com.aws.amazonlocation.utils.* +import dagger.hilt.android.testing.HiltAndroidTest +import dagger.hilt.android.testing.UninstallModules +import org.hamcrest.CoreMatchers.allOf +import org.junit.Assert +import org.junit.Test + +@UninstallModules(AppModule::class) +@HiltAndroidTest +class ExploreFragmentMapLanguageTest : BaseTestMainActivity() { + + private val uiDevice = UiDevice.getInstance(getInstrumentation()) + + private lateinit var preferenceManager: PreferenceManager + + @Throws(java.lang.Exception::class) + override fun before() { + preferenceManager = PreferenceManager(ApplicationProvider.getApplicationContext()) + preferenceManager.setValue(IS_APP_FIRST_TIME_OPENED, true) + preferenceManager.removeValue(KEY_MAP_NAME) + preferenceManager.removeValue(KEY_MAP_STYLE_NAME) + super.before() + } + + @Test + fun testMapLanguageChangeTest() { + try { + Thread.sleep(DELAY_2000) + val btnContinueToApp = uiDevice.findObject(UiSelector().resourceId("${BuildConfig.APPLICATION_ID}:id/btn_continue_to_app")) + if (btnContinueToApp.exists()) { + btnContinueToApp.click() + Thread.sleep(DELAY_2000) + } + uiDevice.findObject(By.text(WHILE_USING_THE_APP))?.click() + uiDevice.findObject(By.text(WHILE_USING_THE_APP_CAPS))?.click() + uiDevice.findObject(By.text(WHILE_USING_THE_APP_ALLOW))?.click() + uiDevice.findObject(By.text(ALLOW))?.click() + Thread.sleep(DELAY_2000) + enableGPS(ApplicationProvider.getApplicationContext()) + Thread.sleep(DELAY_2000) + uiDevice.wait(Until.hasObject(By.desc(AMAZON_MAP_READY)), DELAY_15000) + + Thread.sleep(DELAY_2000) + + goToMapStyles() + + val clMapLanguage = + onView(withId(R.id.cl_map_language)).check(matches(isDisplayed())) + clMapLanguage.perform(click()) + + Thread.sleep(DELAY_2000) + + val language = + waitForView(allOf(withText(TEST_WORD_LANGUAGE_AR), isDisplayed())) + language?.perform(click()) + + Thread.sleep(DELAY_2000) + + val description = uiDevice.findObject(UiSelector().resourceId("${BuildConfig.APPLICATION_ID}:id/tv_map_language_description")) + Assert.assertTrue(TEST_FAILED_LANGUAGE, description.text.contains(TEST_WORD_LANGUAGE_AR)) + } catch (e: Exception) { + failTest(147, e) + Assert.fail(TEST_FAILED) + } + } + + private fun goToMapStyles() { + val cardMap = waitForView(allOf(withId(R.id.card_map), isDisplayed())) + cardMap?.perform(click()) + + Thread.sleep(DELAY_2000) + swipeUp() + Thread.sleep(DELAY_2000) + } + + private fun swipeUp(): UiDevice? { + // Get the screen dimensions + val screenHeight = getInstrumentation().targetContext.resources.displayMetrics.heightPixels + + // Set the starting point for the swipe (bottom-center of the screen) + val startX = getInstrumentation().targetContext.resources.displayMetrics.widthPixels / 2f + val startY = screenHeight - 100 // Offset from the bottom of the screen + + // Set the ending point for the swipe (top-center of the screen) + val endY = 100 // Offset from the top of the screen + + // Perform the swipe action + val uiDevice = UiDevice.getInstance(getInstrumentation()) + uiDevice.swipe(startX.toInt(), startY, startX.toInt(), endY, 10) + return uiDevice + } +} diff --git a/app/src/androidTest/java/com/aws/amazonlocation/ui/main/SettingsMapLanguageTest.kt b/app/src/androidTest/java/com/aws/amazonlocation/ui/main/SettingsMapLanguageTest.kt new file mode 100644 index 00000000..ea91904a --- /dev/null +++ b/app/src/androidTest/java/com/aws/amazonlocation/ui/main/SettingsMapLanguageTest.kt @@ -0,0 +1,85 @@ +package com.aws.amazonlocation.ui.main + +import androidx.test.core.app.ApplicationProvider +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.matcher.ViewMatchers.* +import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation +import androidx.test.uiautomator.By +import androidx.test.uiautomator.UiDevice +import androidx.test.uiautomator.UiSelector +import androidx.test.uiautomator.Until +import com.aws.amazonlocation.* +import com.aws.amazonlocation.di.AppModule +import com.aws.amazonlocation.utils.* +import dagger.hilt.android.testing.HiltAndroidTest +import dagger.hilt.android.testing.UninstallModules +import org.hamcrest.CoreMatchers.allOf +import org.hamcrest.core.AllOf +import org.junit.Assert +import org.junit.Test + +@UninstallModules(AppModule::class) +@HiltAndroidTest +class SettingsMapLanguageTest : BaseTestMainActivity() { + + private val uiDevice = UiDevice.getInstance(getInstrumentation()) + + private lateinit var preferenceManager: PreferenceManager + + @Throws(java.lang.Exception::class) + override fun before() { + preferenceManager = PreferenceManager(ApplicationProvider.getApplicationContext()) + preferenceManager.setValue(IS_APP_FIRST_TIME_OPENED, true) + super.before() + } + + @Test + fun testSettingsMapPoliticalViewTest() { + Thread.sleep(DELAY_2000) + + uiDevice.wait(Until.hasObject(By.desc(AMAZON_MAP_READY)), DELAY_15000) + Thread.sleep(DELAY_2000) + + goToMapStyles() + + val clPoliticalView = + onView(withId(R.id.cl_map_language)).check(matches(isDisplayed())) + clPoliticalView.perform(click()) + + Thread.sleep(DELAY_2000) + + val language = + waitForView(allOf(withText(TEST_WORD_LANGUAGE_BO), isDisplayed())) + language?.perform(click()) + + Thread.sleep(DELAY_2000) + + val description = uiDevice.findObject(UiSelector().resourceId("${BuildConfig.APPLICATION_ID}:id/tv_map_language_description")) + Assert.assertTrue(TEST_FAILED_LANGUAGE, description.text.contains(TEST_WORD_LANGUAGE_BO)) + } + + private fun goToMapStyles() { + waitForView( + AllOf.allOf( + withText(mActivityRule.activity.getString(R.string.menu_setting)), + isDescendantOfA(withId(R.id.bottom_navigation_main)), + isDisplayed() + ) + ) + ?.perform(click()) + + Thread.sleep(DELAY_3000) + + waitForView( + AllOf.allOf( + withId(R.id.cl_map_style), + isDisplayed() + ) + ) + ?.perform(click()) + + Thread.sleep(DELAY_3000) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/aws/amazonlocation/data/response/LanguageData.kt b/app/src/main/java/com/aws/amazonlocation/data/response/LanguageData.kt new file mode 100644 index 00000000..ee8b81ad --- /dev/null +++ b/app/src/main/java/com/aws/amazonlocation/data/response/LanguageData.kt @@ -0,0 +1,7 @@ +package com.aws.amazonlocation.data.response + +data class LanguageData( + val value: String, + val label: String, + var isSelected: Boolean +) diff --git a/app/src/main/java/com/aws/amazonlocation/ui/main/explore/ExploreFragment.kt b/app/src/main/java/com/aws/amazonlocation/ui/main/explore/ExploreFragment.kt index 6fcf5066..32b30d2b 100644 --- a/app/src/main/java/com/aws/amazonlocation/ui/main/explore/ExploreFragment.kt +++ b/app/src/main/java/com/aws/amazonlocation/ui/main/explore/ExploreFragment.kt @@ -95,6 +95,7 @@ import com.aws.amazonlocation.utils.KEY_CLOUD_FORMATION_STATUS import com.aws.amazonlocation.utils.KEY_COLOR_SCHEMES import com.aws.amazonlocation.utils.KEY_MAP_STYLE_NAME import com.aws.amazonlocation.utils.KEY_POLITICAL_VIEW +import com.aws.amazonlocation.utils.KEY_SELECTED_MAP_LANGUAGE import com.aws.amazonlocation.utils.KEY_UNIT_SYSTEM import com.aws.amazonlocation.utils.KEY_URL import com.aws.amazonlocation.utils.KILOMETERS @@ -821,6 +822,7 @@ class ExploreFragment : private fun setMapStyleBottomSheet() { mViewModel.setMapListData(requireContext()) mViewModel.setPoliticalListData(requireContext()) + mViewModel.setMapLanguageData(requireContext()) mapStyleBottomSheetFragment = MapStyleBottomSheetFragment( mViewModel, @@ -865,6 +867,10 @@ class ExploreFragment : clearAllMapData() mMapHelper.updateStyle(mapStyleName, colorScheme) } + + override fun updateMapLanguage() { + mMapLibreMap?.style?.let { mMapHelper.setStyleLanguage(it)} + } }, ) } diff --git a/app/src/main/java/com/aws/amazonlocation/ui/main/explore/ExploreViewModel.kt b/app/src/main/java/com/aws/amazonlocation/ui/main/explore/ExploreViewModel.kt index 9bb73698..183f71c9 100644 --- a/app/src/main/java/com/aws/amazonlocation/ui/main/explore/ExploreViewModel.kt +++ b/app/src/main/java/com/aws/amazonlocation/ui/main/explore/ExploreViewModel.kt @@ -11,6 +11,7 @@ import com.aws.amazonlocation.R import com.aws.amazonlocation.data.common.DataSourceException import com.aws.amazonlocation.data.common.HandleResult import com.aws.amazonlocation.data.response.CalculateDistanceResponse +import com.aws.amazonlocation.data.response.LanguageData import com.aws.amazonlocation.data.response.MapStyleData import com.aws.amazonlocation.data.response.MapStyleInnerData import com.aws.amazonlocation.data.response.NavigationData @@ -63,6 +64,7 @@ class ExploreViewModel var mStyleList = ArrayList() var mPoliticalData = ArrayList() var mPoliticalSearchData = ArrayList() + var mMapLanguageData = ArrayList() private val _searchForSuggestionsResultList = Channel>(Channel.BUFFERED) @@ -610,4 +612,81 @@ class ExploreViewModel it.countryName.contains(query, ignoreCase = true) }) } + + fun setMapLanguageData(context: Context) { + mMapLanguageData.clear() + + mMapLanguageData = arrayListOf( + LanguageData(value = context.getString(R.string.label_no_map_language), label = context.getString(R.string.label_no_map_language), isSelected = false), + LanguageData(value = "ar", label = "العربية", isSelected = false), + LanguageData(value = "as", label = "অসমীয়া", isSelected = false), + LanguageData(value = "az", label = "Azərbaycan dili", isSelected = false), + LanguageData(value = "be", label = "Беларуская", isSelected = false), + LanguageData(value = "bg", label = "Български", isSelected = false), + LanguageData(value = "bn", label = "বাংলা", isSelected = false), + LanguageData(value = "bs", label = "Bosanski", isSelected = false), + LanguageData(value = "ca", label = "Català", isSelected = false), + LanguageData(value = "cs", label = "Čeština", isSelected = false), + LanguageData(value = "cy", label = "Cymraeg", isSelected = false), + LanguageData(value = "da", label = "Dansk", isSelected = false), + LanguageData(value = "de", label = "Deutsch", isSelected = false), + LanguageData(value = "el", label = "Ελληνικά", isSelected = false), + LanguageData(value = "en", label = "English", isSelected = false), + LanguageData(value = "es", label = "Español", isSelected = false), + LanguageData(value = "et", label = "Eesti", isSelected = false), + LanguageData(value = "eu", label = "Euskara", isSelected = false), + LanguageData(value = "fi", label = "Suomi", isSelected = false), + LanguageData(value = "fo", label = "Føroyskt", isSelected = false), + LanguageData(value = "fr", label = "Français", isSelected = false), + LanguageData(value = "ga", label = "Gaeilge", isSelected = false), + LanguageData(value = "gl", label = "Galego", isSelected = false), + LanguageData(value = "gn", label = "Avañe'ẽ", isSelected = false), + LanguageData(value = "gu", label = "ગુજરાતી", isSelected = false), + LanguageData(value = "he", label = "עברית", isSelected = false), + LanguageData(value = "hi", label = "हिन्दी", isSelected = false), + LanguageData(value = "hr", label = "Hrvatski", isSelected = false), + LanguageData(value = "hu", label = "Magyar", isSelected = false), + LanguageData(value = "hy", label = "Հայերեն", isSelected = false), + LanguageData(value = "id", label = "Bahasa Indonesia", isSelected = false), + LanguageData(value = "is", label = "Íslenska", isSelected = false), + LanguageData(value = "it", label = "Italiano", isSelected = false), + LanguageData(value = "ja", label = "日本語", isSelected = false), + LanguageData(value = "ka", label = "ქართული", isSelected = false), + LanguageData(value = "kk", label = "Қазақ тілі", isSelected = false), + LanguageData(value = "km", label = "ខ្មែរ", isSelected = false), + LanguageData(value = "kn", label = "ಕನ್ನಡ", isSelected = false), + LanguageData(value = "ko", label = "한국어", isSelected = false), + LanguageData(value = "ky", label = "Кыргызча", isSelected = false), + LanguageData(value = "lt", label = "Lietuvių", isSelected = false), + LanguageData(value = "lv", label = "Latviešu", isSelected = false), + LanguageData(value = "mk", label = "Македонски", isSelected = false), + LanguageData(value = "ml", label = "മലയാളം", isSelected = false), + LanguageData(value = "mr", label = "मराठी", isSelected = false), + LanguageData(value = "ms", label = "Bahasa Melayu", isSelected = false), + LanguageData(value = "mt", label = "Malti", isSelected = false), + LanguageData(value = "my", label = "မြန်မာစာ", isSelected = false), + LanguageData(value = "nl", label = "Nederlands", isSelected = false), + LanguageData(value = "no", label = "Norsk", isSelected = false), + LanguageData(value = "or", label = "ଓଡ଼ିଆ", isSelected = false), + LanguageData(value = "pa", label = "ਪੰਜਾਬੀ", isSelected = false), + LanguageData(value = "pl", label = "Polski", isSelected = false), + LanguageData(value = "pt", label = "Português", isSelected = false), + LanguageData(value = "ro", label = "Română", isSelected = false), + LanguageData(value = "ru", label = "Русский", isSelected = false), + LanguageData(value = "sk", label = "Slovenčina", isSelected = false), + LanguageData(value = "sl", label = "Slovenščina", isSelected = false), + LanguageData(value = "sq", label = "Shqip", isSelected = false), + LanguageData(value = "sr", label = "Српски", isSelected = false), + LanguageData(value = "sv", label = "Svenska", isSelected = false), + LanguageData(value = "ta", label = "தமிழ்", isSelected = false), + LanguageData(value = "te", label = "తెలుగు", isSelected = false), + LanguageData(value = "th", label = "ไทย", isSelected = false), + LanguageData(value = "tr", label = "Türkçe", isSelected = false), + LanguageData(value = "uk", label = "Українська", isSelected = false), + LanguageData(value = "uz", label = "Oʻzbek", isSelected = false), + LanguageData(value = "vi", label = "Tiếng Việt", isSelected = false), + LanguageData(value = "zh", label = "简体中文", isSelected = false), + LanguageData(value = "zh-Hant", label = "繁體中文", isSelected = false) + ) + } } diff --git a/app/src/main/java/com/aws/amazonlocation/ui/main/explore/MapLanguageAdapter.kt b/app/src/main/java/com/aws/amazonlocation/ui/main/explore/MapLanguageAdapter.kt new file mode 100644 index 00000000..73129b23 --- /dev/null +++ b/app/src/main/java/com/aws/amazonlocation/ui/main/explore/MapLanguageAdapter.kt @@ -0,0 +1,75 @@ +package com.aws.amazonlocation.ui.main.explore + +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.appcompat.widget.AppCompatRadioButton +import androidx.recyclerview.widget.RecyclerView +import com.aws.amazonlocation.R +import com.aws.amazonlocation.data.response.LanguageData +import com.aws.amazonlocation.databinding.ItemMapLanguageBinding + +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + +// SPDX-License-Identifier: MIT-0 +class MapLanguageAdapter( + private val languageData: ArrayList, + private val isRtl: Boolean, + var placeInterface: MapLanguageInterface, +) : + RecyclerView.Adapter() { + + inner class SearchPoliticalVH(private val binding: ItemMapLanguageBinding) : + RecyclerView.ViewHolder(binding.root) { + fun bind(data: LanguageData) { + binding.apply { + tvLanguage.text = data.label + clMain.setOnClickListener { + placeInterface.languageClick(adapterPosition) + } + if (data.isSelected) { + setRadioButtonIcon(rbLanguage, R.drawable.icon_checkmark) + } else { + setRadioButtonIcon(rbLanguage, R.drawable.ic_radio_button_unchecked) + } + } + } + } + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SearchPoliticalVH { + return SearchPoliticalVH( + ItemMapLanguageBinding.inflate(LayoutInflater.from(parent.context), parent, false), + ) + } + + override fun onBindViewHolder(holder: SearchPoliticalVH, position: Int) { + holder.bind(languageData[position]) + } + + override fun getItemCount() = languageData.size + + interface MapLanguageInterface { + fun languageClick(position: Int) + } + private fun setRadioButtonIcon( + rb: AppCompatRadioButton, + iconCheckmark: Int + ) { + rb.isChecked = true + if (isRtl) { + rb.setCompoundDrawablesWithIntrinsicBounds( + iconCheckmark, + 0, + 0, + 0 + ) + } else { + rb.setCompoundDrawablesWithIntrinsicBounds( + 0, + 0, + iconCheckmark, + 0 + ) + } + } + +} diff --git a/app/src/main/java/com/aws/amazonlocation/ui/main/map_style/MapStyleBottomSheetFragment.kt b/app/src/main/java/com/aws/amazonlocation/ui/main/map_style/MapStyleBottomSheetFragment.kt index 86546e87..1faa34a5 100644 --- a/app/src/main/java/com/aws/amazonlocation/ui/main/map_style/MapStyleBottomSheetFragment.kt +++ b/app/src/main/java/com/aws/amazonlocation/ui/main/map_style/MapStyleBottomSheetFragment.kt @@ -15,6 +15,7 @@ import com.aws.amazonlocation.R import com.aws.amazonlocation.databinding.BottomSheetMapStyleBinding import com.aws.amazonlocation.ui.base.BaseActivity import com.aws.amazonlocation.ui.main.explore.ExploreViewModel +import com.aws.amazonlocation.ui.main.explore.MapLanguageAdapter import com.aws.amazonlocation.ui.main.explore.MapStyleAdapter import com.aws.amazonlocation.ui.main.explore.PoliticalAdapter import com.aws.amazonlocation.utils.ATTRIBUTE_DARK @@ -24,6 +25,7 @@ import com.aws.amazonlocation.utils.DELAY_300 import com.aws.amazonlocation.utils.KEY_COLOR_SCHEMES import com.aws.amazonlocation.utils.KEY_MAP_STYLE_NAME import com.aws.amazonlocation.utils.KEY_POLITICAL_VIEW +import com.aws.amazonlocation.utils.KEY_SELECTED_MAP_LANGUAGE import com.aws.amazonlocation.utils.LANGUAGE_CODE_ARABIC import com.aws.amazonlocation.utils.LANGUAGE_CODE_HEBREW import com.aws.amazonlocation.utils.LANGUAGE_CODE_HEBREW_1 @@ -59,6 +61,7 @@ class MapStyleBottomSheetFragment( private var mMapStyleAdapter: MapStyleAdapter? = null private var mPoliticalAdapter: PoliticalAdapter? = null + private var mMapLanguageAdapter: MapLanguageAdapter? = null @Inject lateinit var mPreferenceManager: PreferenceManager @@ -134,7 +137,7 @@ class MapStyleBottomSheetFragment( dialog.behavior.state = BottomSheetBehavior.STATE_EXPANDED } else { dialog.behavior.state = BottomSheetBehavior.STATE_HALF_EXPANDED - dialog.behavior.halfExpandedRatio = 0.58f + dialog.behavior.halfExpandedRatio = 0.65f dialog.behavior.isFitToContents = false dialog.setCanceledOnTouchOutside(false) // Prevent collapse on outside click dialog.behavior.expandedOffset = @@ -251,6 +254,41 @@ class MapStyleBottomSheetFragment( ) rvPoliticalView.adapter = mPoliticalAdapter + val selectedMapLanguage = mPreferenceManager.getValue(KEY_SELECTED_MAP_LANGUAGE, "") ?: "" + selectedMapLanguage.takeIf { it.isNotEmpty() }?.let { language -> + mViewModel.mMapLanguageData.find { it.value == language }?.let { + it.isSelected = true + tvMapLanguageDescription.apply { + text = buildString{ + append(it.label) + append(context.getString(R.string.label_is_selected)) + } + setTextColor(ContextCompat.getColor(requireContext(), R.color.color_primary_green)) + } + + } + } + if (selectedMapLanguage.isEmpty()) { + mViewModel.mMapLanguageData[0].isSelected = true + } + rvMapLanguage.layoutManager = LinearLayoutManager(requireContext()) + mMapLanguageAdapter = MapLanguageAdapter( + mViewModel.mMapLanguageData, + isRtl, + object : MapLanguageAdapter.MapLanguageInterface { + override fun languageClick(position: Int) { + if (mViewModel.mMapLanguageData[position].isSelected) return + mViewModel.mMapLanguageData.forEach { + it.isSelected = false + } + mViewModel.mMapLanguageData[position].isSelected = true + mMapLanguageAdapter?.notifyDataSetChanged() + applyLanguage() + } + }, + ) + rvMapLanguage.adapter = mMapLanguageAdapter + rvMapStyle.apply { mViewModel.setMapListData(context) val mapStyleName = @@ -301,7 +339,7 @@ class MapStyleBottomSheetFragment( ivMapStyleClose.setOnClickListener { etSearchCountry.setText("") tvMapStyle.text = getString(R.string.label_map_style) - showViews(rvMapStyle, cardColorScheme, clPoliticalView) + showViews(rvMapStyle, cardColorScheme, clPoliticalView, clMapLanguage) hideViews(clSearchPolitical, ivBack) val selectedCountry = mPreferenceManager.getValue(KEY_POLITICAL_VIEW, "") ?: "" clearSelectionAndSetOriginalData(selectedCountry) @@ -341,15 +379,20 @@ class MapStyleBottomSheetFragment( ?: getString(R.string.map_standard) if (mapStyleName == getString(R.string.map_satellite)) return@setOnClickListener tvMapStyle.text = getString(R.string.label_political_view) - hideViews(rvMapStyle, cardColorScheme, clPoliticalView) + hideViews(rvMapStyle, cardColorScheme, clPoliticalView, clMapLanguage) showViews(clSearchPolitical, ivBack) } + clMapLanguage.setOnClickListener { + tvMapStyle.text = getString(R.string.label_map_language) + hideViews(rvMapStyle, cardColorScheme, clPoliticalView, clMapLanguage) + showViews(cardMapLanguage, ivBack) + } ivBack.setOnClickListener { etSearchCountry.setText("") tvMapStyle.text = getString(R.string.label_map_style) - showViews(rvMapStyle, cardColorScheme, clPoliticalView) - hideViews(clSearchPolitical, ivBack) + showViews(rvMapStyle, cardColorScheme, clPoliticalView, clMapLanguage) + hideViews(clSearchPolitical, cardMapLanguage, ivBack) val selectedCountry = mPreferenceManager.getValue(KEY_POLITICAL_VIEW, "") ?: "" clearSelectionAndSetOriginalData(selectedCountry) } @@ -419,7 +462,7 @@ class MapStyleBottomSheetFragment( } } tvMapStyle.text = getString(R.string.label_map_style) - showViews(rvMapStyle, cardColorScheme, clPoliticalView) + showViews(rvMapStyle, cardColorScheme, clPoliticalView, clMapLanguage) hideViews(clSearchPolitical, ivBack) val colorScheme = mPreferenceManager.getValue(KEY_COLOR_SCHEMES, ATTRIBUTE_LIGHT) ?: ATTRIBUTE_LIGHT @@ -430,6 +473,30 @@ class MapStyleBottomSheetFragment( mapInterface.mapColorScheme(colorScheme, mapStyleNameDisplay) } + private fun BottomSheetMapStyleBinding.applyLanguage() { + val selectedItem = mViewModel.mMapLanguageData.find { it.isSelected } + if (selectedItem != null && selectedItem.label != getString(R.string.label_no_map_language)) { + mPreferenceManager.setValue(KEY_SELECTED_MAP_LANGUAGE, selectedItem.value) + tvMapLanguageDescription.apply { + text = buildString { + append(selectedItem.label) + append(context.getString(R.string.label_is_selected)) + } + setTextColor(ContextCompat.getColor(requireContext(), R.color.color_primary_green)) + } + } else { + mPreferenceManager.setValue(KEY_SELECTED_MAP_LANGUAGE, "") + tvMapLanguageDescription.apply { + text = getString(R.string.label_change_map_language) + setTextColor(ContextCompat.getColor(requireContext(), R.color.color_hint_text)) + } + } + tvMapStyle.text = getString(R.string.label_map_style) + showViews(rvMapStyle, cardColorScheme, clPoliticalView, clMapLanguage) + hideViews(clSearchPolitical, cardMapLanguage, ivBack) + mapInterface.updateMapLanguage() + } + private fun BottomSheetMapStyleBinding.mapStyleShowList() { rvMapStyle.show() } @@ -520,5 +587,6 @@ class MapStyleBottomSheetFragment( interface MapInterface { fun mapStyleClick(position: Int, innerPosition: Int) fun mapColorScheme(colorScheme: String, mapStyleName: String) + fun updateMapLanguage() } } diff --git a/app/src/main/java/com/aws/amazonlocation/ui/main/map_style/MapStyleFragment.kt b/app/src/main/java/com/aws/amazonlocation/ui/main/map_style/MapStyleFragment.kt index 2c0ecc8e..ea1a6eac 100644 --- a/app/src/main/java/com/aws/amazonlocation/ui/main/map_style/MapStyleFragment.kt +++ b/app/src/main/java/com/aws/amazonlocation/ui/main/map_style/MapStyleFragment.kt @@ -17,6 +17,7 @@ import com.aws.amazonlocation.R import com.aws.amazonlocation.databinding.FragmentMapStyleBinding import com.aws.amazonlocation.ui.base.BaseFragment import com.aws.amazonlocation.ui.main.MainActivity +import com.aws.amazonlocation.ui.main.explore.MapLanguageAdapter import com.aws.amazonlocation.ui.main.explore.PoliticalAdapter import com.aws.amazonlocation.utils.ATTRIBUTE_DARK import com.aws.amazonlocation.utils.ATTRIBUTE_LIGHT @@ -24,6 +25,7 @@ import com.aws.amazonlocation.utils.DELAY_300 import com.aws.amazonlocation.utils.KEY_COLOR_SCHEMES import com.aws.amazonlocation.utils.KEY_MAP_STYLE_NAME import com.aws.amazonlocation.utils.KEY_POLITICAL_VIEW +import com.aws.amazonlocation.utils.KEY_SELECTED_MAP_LANGUAGE import com.aws.amazonlocation.utils.LANGUAGE_CODE_ARABIC import com.aws.amazonlocation.utils.LANGUAGE_CODE_HEBREW import com.aws.amazonlocation.utils.LANGUAGE_CODE_HEBREW_1 @@ -49,6 +51,7 @@ class MapStyleFragment : BaseFragment() { private var columnCount = 2 private var mMapStyleAdapter: SettingMapStyleAdapter? = null private var mPoliticalAdapter: PoliticalAdapter? = null + private var mMapLanguageAdapter: MapLanguageAdapter? = null override fun onCreateView( inflater: LayoutInflater, @@ -85,6 +88,7 @@ class MapStyleFragment : BaseFragment() { mBinding.apply { mViewModel.setMapListData(rvMapStyle.context) mViewModel.setPoliticalListData(rvPoliticalView.context) + mViewModel.setMapLanguageData(rvMapLanguage.context) val mapStyleName = mPreferenceManager.getValue(KEY_MAP_STYLE_NAME, getString(R.string.map_standard)) ?: getString(R.string.map_standard) @@ -240,12 +244,66 @@ class MapStyleFragment : BaseFragment() { } } appCompatTextView2.text = getString(R.string.label_map_style) - showViews(rvMapStyle, cardColorScheme, clPoliticalView) - hideViews(clSearchPolitical) + showViews(rvMapStyle, cardColorScheme, clPoliticalView, clMapLanguage) + hideViews(clSearchPolitical, cardMapLanguage) } }, ) rvPoliticalView.adapter = mPoliticalAdapter + + val selectedMapLanguage = mPreferenceManager.getValue(KEY_SELECTED_MAP_LANGUAGE, "") ?: "" + selectedMapLanguage.takeIf { it.isNotEmpty() }?.let { language -> + mViewModel.mMapLanguageData.find { it.value == language }?.let { + it.isSelected = true + tvMapLanguageDescription.apply { + text = buildString{ + append(it.label) + append(context.getString(R.string.label_is_selected)) + } + setTextColor(ContextCompat.getColor(requireContext(), R.color.color_primary_green)) + } + + } + } + if (selectedMapLanguage.isEmpty()) { + mViewModel.mMapLanguageData[0].isSelected = true + } + rvMapLanguage.layoutManager = LinearLayoutManager(requireContext()) + mMapLanguageAdapter = MapLanguageAdapter( + mViewModel.mMapLanguageData, + isRtl, + object : MapLanguageAdapter.MapLanguageInterface { + override fun languageClick(position: Int) { + if (mViewModel.mMapLanguageData[position].isSelected) return + mViewModel.mMapLanguageData.forEach { + it.isSelected = false + } + mViewModel.mMapLanguageData[position].isSelected = true + mMapLanguageAdapter?.notifyDataSetChanged() + val selectedItem = mViewModel.mMapLanguageData.find { it.isSelected } + if (selectedItem != null && selectedItem.label != getString(R.string.label_no_map_language)) { + mPreferenceManager.setValue(KEY_SELECTED_MAP_LANGUAGE, selectedItem.value) + tvMapLanguageDescription.apply { + text = buildString { + append(selectedItem.label) + append(context.getString(R.string.label_is_selected)) + } + setTextColor(ContextCompat.getColor(requireContext(), R.color.color_primary_green)) + } + } else { + mPreferenceManager.setValue(KEY_SELECTED_MAP_LANGUAGE, "") + tvMapLanguageDescription.apply { + text = getString(R.string.label_change_map_language) + setTextColor(ContextCompat.getColor(requireContext(), R.color.color_hint_text)) + } + } + appCompatTextView2.text = getString(R.string.label_map_style) + showViews(rvMapStyle, cardColorScheme, clPoliticalView, clMapLanguage) + hideViews(clSearchPolitical, cardMapLanguage) + } + }, + ) + rvMapLanguage.adapter = mMapLanguageAdapter } } @@ -329,11 +387,11 @@ class MapStyleFragment : BaseFragment() { private fun clickListener() { mBinding.apply { ivMapStyleBack.setOnClickListener { - if (clSearchPolitical.visibility == View.VISIBLE) { + if (clSearchPolitical.visibility == View.VISIBLE || cardMapLanguage.visibility == View.VISIBLE) { etSearchCountry.setText("") appCompatTextView2.text = getString(R.string.label_map_style) - showViews(rvMapStyle, cardColorScheme, clPoliticalView) - hideViews(clSearchPolitical) + showViews(rvMapStyle, cardColorScheme, clPoliticalView, clMapLanguage) + hideViews(clSearchPolitical, cardMapLanguage) val selectedCountry = mPreferenceManager.getValue(KEY_POLITICAL_VIEW, "") ?: "" clearSelectionAndSetOriginalData(selectedCountry) } else { @@ -361,9 +419,15 @@ class MapStyleFragment : BaseFragment() { ?: getString(R.string.map_standard) if (mapStyleName == getString(R.string.map_satellite)) return@setOnClickListener appCompatTextView2.text = getString(R.string.label_political_view) - hideViews(rvMapStyle, cardColorScheme, clPoliticalView) + hideViews(rvMapStyle, cardColorScheme, clPoliticalView, clMapLanguage) showViews(clSearchPolitical) } + clMapLanguage.setOnClickListener { + appCompatTextView2.text = getString(R.string.label_map_language) + hideViews(rvMapStyle, cardColorScheme, clPoliticalView, clMapLanguage) + showViews(cardMapLanguage) + } + etSearchCountry .textChanges() .debounce(DELAY_300) diff --git a/app/src/main/java/com/aws/amazonlocation/ui/main/map_style/MapStyleViewModel.kt b/app/src/main/java/com/aws/amazonlocation/ui/main/map_style/MapStyleViewModel.kt index 673415f2..0b582f3f 100644 --- a/app/src/main/java/com/aws/amazonlocation/ui/main/map_style/MapStyleViewModel.kt +++ b/app/src/main/java/com/aws/amazonlocation/ui/main/map_style/MapStyleViewModel.kt @@ -3,6 +3,7 @@ package com.aws.amazonlocation.ui.main.map_style import android.content.Context import androidx.lifecycle.ViewModel import com.aws.amazonlocation.R +import com.aws.amazonlocation.data.response.LanguageData import com.aws.amazonlocation.data.response.MapStyleData import com.aws.amazonlocation.data.response.MapStyleInnerData import com.aws.amazonlocation.data.response.PoliticalData @@ -15,6 +16,7 @@ class MapStyleViewModel @Inject constructor() : ViewModel() { var mStyleList = ArrayList() var mPoliticalData = ArrayList() var mPoliticalSearchData = ArrayList() + var mMapLanguageData = ArrayList() fun setMapListData(context: Context) { val items = @@ -135,4 +137,81 @@ class MapStyleViewModel @Inject constructor() : ViewModel() { it.countryName.contains(query, ignoreCase = true) }) } + + fun setMapLanguageData(context: Context) { + mMapLanguageData.clear() + + mMapLanguageData = arrayListOf( + LanguageData(value = context.getString(R.string.label_no_map_language), label = context.getString(R.string.label_no_map_language), isSelected = false), + LanguageData(value = "ar", label = "العربية", isSelected = false), + LanguageData(value = "as", label = "অসমীয়া", isSelected = false), + LanguageData(value = "az", label = "Azərbaycan dili", isSelected = false), + LanguageData(value = "be", label = "Беларуская", isSelected = false), + LanguageData(value = "bg", label = "Български", isSelected = false), + LanguageData(value = "bn", label = "বাংলা", isSelected = false), + LanguageData(value = "bs", label = "Bosanski", isSelected = false), + LanguageData(value = "ca", label = "Català", isSelected = false), + LanguageData(value = "cs", label = "Čeština", isSelected = false), + LanguageData(value = "cy", label = "Cymraeg", isSelected = false), + LanguageData(value = "da", label = "Dansk", isSelected = false), + LanguageData(value = "de", label = "Deutsch", isSelected = false), + LanguageData(value = "el", label = "Ελληνικά", isSelected = false), + LanguageData(value = "en", label = "English", isSelected = false), + LanguageData(value = "es", label = "Español", isSelected = false), + LanguageData(value = "et", label = "Eesti", isSelected = false), + LanguageData(value = "eu", label = "Euskara", isSelected = false), + LanguageData(value = "fi", label = "Suomi", isSelected = false), + LanguageData(value = "fo", label = "Føroyskt", isSelected = false), + LanguageData(value = "fr", label = "Français", isSelected = false), + LanguageData(value = "ga", label = "Gaeilge", isSelected = false), + LanguageData(value = "gl", label = "Galego", isSelected = false), + LanguageData(value = "gn", label = "Avañe'ẽ", isSelected = false), + LanguageData(value = "gu", label = "ગુજરાતી", isSelected = false), + LanguageData(value = "he", label = "עברית", isSelected = false), + LanguageData(value = "hi", label = "हिन्दी", isSelected = false), + LanguageData(value = "hr", label = "Hrvatski", isSelected = false), + LanguageData(value = "hu", label = "Magyar", isSelected = false), + LanguageData(value = "hy", label = "Հայերեն", isSelected = false), + LanguageData(value = "id", label = "Bahasa Indonesia", isSelected = false), + LanguageData(value = "is", label = "Íslenska", isSelected = false), + LanguageData(value = "it", label = "Italiano", isSelected = false), + LanguageData(value = "ja", label = "日本語", isSelected = false), + LanguageData(value = "ka", label = "ქართული", isSelected = false), + LanguageData(value = "kk", label = "Қазақ тілі", isSelected = false), + LanguageData(value = "km", label = "ខ្មែរ", isSelected = false), + LanguageData(value = "kn", label = "ಕನ್ನಡ", isSelected = false), + LanguageData(value = "ko", label = "한국어", isSelected = false), + LanguageData(value = "ky", label = "Кыргызча", isSelected = false), + LanguageData(value = "lt", label = "Lietuvių", isSelected = false), + LanguageData(value = "lv", label = "Latviešu", isSelected = false), + LanguageData(value = "mk", label = "Македонски", isSelected = false), + LanguageData(value = "ml", label = "മലയാളം", isSelected = false), + LanguageData(value = "mr", label = "मराठी", isSelected = false), + LanguageData(value = "ms", label = "Bahasa Melayu", isSelected = false), + LanguageData(value = "mt", label = "Malti", isSelected = false), + LanguageData(value = "my", label = "မြန်မာစာ", isSelected = false), + LanguageData(value = "nl", label = "Nederlands", isSelected = false), + LanguageData(value = "no", label = "Norsk", isSelected = false), + LanguageData(value = "or", label = "ଓଡ଼ିଆ", isSelected = false), + LanguageData(value = "pa", label = "ਪੰਜਾਬੀ", isSelected = false), + LanguageData(value = "pl", label = "Polski", isSelected = false), + LanguageData(value = "pt", label = "Português", isSelected = false), + LanguageData(value = "ro", label = "Română", isSelected = false), + LanguageData(value = "ru", label = "Русский", isSelected = false), + LanguageData(value = "sk", label = "Slovenčina", isSelected = false), + LanguageData(value = "sl", label = "Slovenščina", isSelected = false), + LanguageData(value = "sq", label = "Shqip", isSelected = false), + LanguageData(value = "sr", label = "Српски", isSelected = false), + LanguageData(value = "sv", label = "Svenska", isSelected = false), + LanguageData(value = "ta", label = "தமிழ்", isSelected = false), + LanguageData(value = "te", label = "తెలుగు", isSelected = false), + LanguageData(value = "th", label = "ไทย", isSelected = false), + LanguageData(value = "tr", label = "Türkçe", isSelected = false), + LanguageData(value = "uk", label = "Українська", isSelected = false), + LanguageData(value = "uz", label = "Oʻzbek", isSelected = false), + LanguageData(value = "vi", label = "Tiếng Việt", isSelected = false), + LanguageData(value = "zh", label = "简体中文", isSelected = false), + LanguageData(value = "zh-Hant", label = "繁體中文", isSelected = false) + ) + } } diff --git a/app/src/main/java/com/aws/amazonlocation/utils/Constants.kt b/app/src/main/java/com/aws/amazonlocation/utils/Constants.kt index 539d71a2..9ea35b22 100644 --- a/app/src/main/java/com/aws/amazonlocation/utils/Constants.kt +++ b/app/src/main/java/com/aws/amazonlocation/utils/Constants.kt @@ -50,6 +50,7 @@ const val KEY_MAP_NAME = "key_map_name" const val KEY_MAP_STYLE_NAME = "key_map_style_name" const val KEY_COLOR_SCHEMES = "key_color_schemes" const val KEY_POLITICAL_VIEW = "key_political_view" +const val KEY_SELECTED_MAP_LANGUAGE = "key_selected_map_language" const val KEY_END_POINT = "key_end_point" const val CLICK_DEBOUNCE = 1000L diff --git a/app/src/main/java/com/aws/amazonlocation/utils/MapHelper.kt b/app/src/main/java/com/aws/amazonlocation/utils/MapHelper.kt index c9615deb..1983577e 100644 --- a/app/src/main/java/com/aws/amazonlocation/utils/MapHelper.kt +++ b/app/src/main/java/com/aws/amazonlocation/utils/MapHelper.kt @@ -1522,13 +1522,8 @@ class MapHelper( fun mapLoadedSuccess() } - private fun setStyleLanguage(style: Style) { - var languageCode = getLanguageCode() - if (languageCode != null) { - if (languageCode.contains("-")) { - languageCode = languageCode.split("-")[0] - } - } + fun setStyleLanguage(style: Style) { + val languageCode = mPreferenceManager?.getValue(KEY_SELECTED_MAP_LANGUAGE, "en") ?: "en" val expression: Expression? = Expression.coalesce( Expression.get("name:$languageCode"), Expression.get("name:en"), diff --git a/app/src/main/res/layout-sw600dp/bottom_sheet_map_style.xml b/app/src/main/res/layout-sw600dp/bottom_sheet_map_style.xml index 29116a3d..518388e5 100644 --- a/app/src/main/res/layout-sw600dp/bottom_sheet_map_style.xml +++ b/app/src/main/res/layout-sw600dp/bottom_sheet_map_style.xml @@ -187,6 +187,66 @@ app:layout_constraintTop_toTopOf="parent" /> + + + + + + + + + + + + app:layout_constraintTop_toBottomOf="@+id/cl_map_language"> + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-sw600dp/fragment_map_style.xml b/app/src/main/res/layout-sw600dp/fragment_map_style.xml index 488146c5..ebe63064 100644 --- a/app/src/main/res/layout-sw600dp/fragment_map_style.xml +++ b/app/src/main/res/layout-sw600dp/fragment_map_style.xml @@ -171,6 +171,66 @@ app:layout_constraintTop_toTopOf="parent" /> + + + + + + + + + + + + app:layout_constraintTop_toBottomOf="@+id/cl_map_language"> + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-sw720dp/bottom_sheet_map_style.xml b/app/src/main/res/layout-sw720dp/bottom_sheet_map_style.xml index 29116a3d..518388e5 100644 --- a/app/src/main/res/layout-sw720dp/bottom_sheet_map_style.xml +++ b/app/src/main/res/layout-sw720dp/bottom_sheet_map_style.xml @@ -187,6 +187,66 @@ app:layout_constraintTop_toTopOf="parent" /> + + + + + + + + + + + + app:layout_constraintTop_toBottomOf="@+id/cl_map_language"> + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-sw720dp/fragment_map_style.xml b/app/src/main/res/layout-sw720dp/fragment_map_style.xml index 488146c5..ebe63064 100644 --- a/app/src/main/res/layout-sw720dp/fragment_map_style.xml +++ b/app/src/main/res/layout-sw720dp/fragment_map_style.xml @@ -171,6 +171,66 @@ app:layout_constraintTop_toTopOf="parent" /> + + + + + + + + + + + + app:layout_constraintTop_toBottomOf="@+id/cl_map_language"> + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/bottom_sheet_map_style.xml b/app/src/main/res/layout/bottom_sheet_map_style.xml index e9e0f4af..6fa477af 100644 --- a/app/src/main/res/layout/bottom_sheet_map_style.xml +++ b/app/src/main/res/layout/bottom_sheet_map_style.xml @@ -219,6 +219,66 @@ app:layout_constraintTop_toTopOf="parent" /> + + + + + + + + + + + + app:layout_constraintTop_toBottomOf="@+id/cl_map_language"> + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_map_style.xml b/app/src/main/res/layout/fragment_map_style.xml index 4a07bf93..aabf48f2 100644 --- a/app/src/main/res/layout/fragment_map_style.xml +++ b/app/src/main/res/layout/fragment_map_style.xml @@ -176,6 +176,66 @@ app:layout_constraintTop_toTopOf="parent" /> + + + + + + + + + + + + app:layout_constraintTop_toBottomOf="@+id/cl_map_language"> + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_map_language.xml b/app/src/main/res/layout/item_map_language.xml new file mode 100644 index 00000000..50adcd20 --- /dev/null +++ b/app/src/main/res/layout/item_map_language.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-ar/string.xml b/app/src/main/res/values-ar/string.xml index 89ceb2ee..ff2f317b 100644 --- a/app/src/main/res/values-ar/string.xml +++ b/app/src/main/res/values-ar/string.xml @@ -232,4 +232,8 @@ جدول تم نسخها إلى الحافظة لا سياسي منظر + خريطة لغة + تغيير خريطة لغة + لا خريطة لغة + « هو تم اختياره» \ No newline at end of file diff --git a/app/src/main/res/values-de/string.xml b/app/src/main/res/values-de/string.xml index 0bba5ce8..32521d5d 100644 --- a/app/src/main/res/values-de/string.xml +++ b/app/src/main/res/values-de/string.xml @@ -232,4 +232,8 @@ Zeitplan Kopiert zu Zwischenablage Nein politisch anzeigen + Landkarte Sprache + Änderung Karte Sprache + Nein Karte Sprache + „ ist ausgewählt“ \ No newline at end of file diff --git a/app/src/main/res/values-es/string.xml b/app/src/main/res/values-es/string.xml index 7b2a66b1..40e46052 100644 --- a/app/src/main/res/values-es/string.xml +++ b/app/src/main/res/values-es/string.xml @@ -232,4 +232,8 @@ Programar Copiado a portapapeles No política vista + Mapa lengua + Cambiar mapa lengua + No mapa lengua + « es seleccionado» \ No newline at end of file diff --git a/app/src/main/res/values-fr/string.xml b/app/src/main/res/values-fr/string.xml index a46c00f5..00243451 100644 --- a/app/src/main/res/values-fr/string.xml +++ b/app/src/main/res/values-fr/string.xml @@ -232,4 +232,8 @@ Calendrier Copié pour presse-papier Non politique voir + Carte langue + Changement carte langue + Non carte langue + « est sélectionné » \ No newline at end of file diff --git a/app/src/main/res/values-hi/string.xml b/app/src/main/res/values-hi/string.xml index 50d850e2..cbd0f136 100644 --- a/app/src/main/res/values-hi/string.xml +++ b/app/src/main/res/values-hi/string.xml @@ -232,4 +232,8 @@ शेड्यूल कॉपी किया गया को क्लिपबोर्ड नहीं राजनीतिक राय + नक्शा भाषा + बदलें नक्शा भाषा + नहीं नक्शा भाषा + “ है चयनित” \ No newline at end of file diff --git a/app/src/main/res/values-it/string.xml b/app/src/main/res/values-it/string.xml index bc78d72d..7ffa5dc3 100644 --- a/app/src/main/res/values-it/string.xml +++ b/app/src/main/res/values-it/string.xml @@ -232,4 +232,8 @@ Pianificazione Copiato a appunti No politico vista + Mappa lingua + Cambia mappa lingua + No mappa lingua + « è selezionato» \ No newline at end of file diff --git a/app/src/main/res/values-iw/string.xml b/app/src/main/res/values-iw/string.xml index a35eb83d..0fe52f65 100644 --- a/app/src/main/res/values-iw/string.xml +++ b/app/src/main/res/values-iw/string.xml @@ -232,4 +232,8 @@ לוח זמנים הועתק כדי הלוח לא מדיני מבט + מפה לשון + שינוי מפה לשון + לא מפה לשון + " הווה נבחר" \ No newline at end of file diff --git a/app/src/main/res/values-ja/string.xml b/app/src/main/res/values-ja/string.xml index d8ece57a..f2a8b1ff 100644 --- a/app/src/main/res/values-ja/string.xml +++ b/app/src/main/res/values-ja/string.xml @@ -232,4 +232,8 @@ スケジュール コピーされました に クリップボード いいえ 政治的 見る + マップ 言語 + 変更 地図 言語 + いいえ 地図 言語 + 「 です 選択済み」 \ No newline at end of file diff --git a/app/src/main/res/values-ko/string.xml b/app/src/main/res/values-ko/string.xml index 018c7869..6daa46f7 100644 --- a/app/src/main/res/values-ko/string.xml +++ b/app/src/main/res/values-ko/string.xml @@ -232,4 +232,8 @@ 스케줄 복사됨 에 클립보드 아니요 정치적 전망 + 지도 언어 + 변경 지도 언어 + 아니요 지도 언어 + “ 입니다 선택됨” \ No newline at end of file diff --git a/app/src/main/res/values-pt/string.xml b/app/src/main/res/values-pt/string.xml index f76c4371..9f244544 100644 --- a/app/src/main/res/values-pt/string.xml +++ b/app/src/main/res/values-pt/string.xml @@ -232,4 +232,8 @@ Cronograma Copiado para prancheta Não político olhar + Mapa linguagem + Mudança mapa linguagem + Não mapa linguagem + “ é selecionado” \ No newline at end of file diff --git a/app/src/main/res/values-zh-rCN/string.xml b/app/src/main/res/values-zh-rCN/string.xml index b395b3b0..031fa74e 100644 --- a/app/src/main/res/values-zh-rCN/string.xml +++ b/app/src/main/res/values-zh-rCN/string.xml @@ -232,4 +232,8 @@ 日程安排 已复制 到 剪贴板 没有 政治的 观点 + 地图 语言 + 改变 地图 语言 + 没有 地图 语言 + “ 是 已选择” \ No newline at end of file diff --git a/app/src/main/res/values-zh-rTW/string.xml b/app/src/main/res/values-zh-rTW/string.xml index 298577fe..f3a1b2d4 100644 --- a/app/src/main/res/values-zh-rTW/string.xml +++ b/app/src/main/res/values-zh-rTW/string.xml @@ -232,4 +232,8 @@ 時間表 已複製 至 剪貼板 否 政治 檢視 + 地圖 語言 + 變更 地圖 語言 + 否 地圖 語言 + 「 是 已選擇」 \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d1638314..a79a5c21 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -292,4 +292,8 @@ Schedule Copied to clipboard No political view + Map language + Change map language + No map language + " is selected" \ No newline at end of file diff --git a/app/src/test/java/com/aws/amazonlocation/mock/Constants.kt b/app/src/test/java/com/aws/amazonlocation/mock/Constants.kt index 692cded0..eb8786d4 100644 --- a/app/src/test/java/com/aws/amazonlocation/mock/Constants.kt +++ b/app/src/test/java/com/aws/amazonlocation/mock/Constants.kt @@ -55,6 +55,7 @@ const val TEST_FAILED_DUE_TO_INCORRECT_ERROR_MESSAGE = "Test failed due to incor const val TEST_FAILED_DUE_TO_INCORRECT_NO_INTERNET_ERROR = "Test failed due to incorrect no internet error" const val TEST_FAILED_DUE_TO_ROBOLECTRIC_TEST_RUNNING = "Test failed due to robolectric test running" +const val TEST_FAILED_DUE_TO_INCORRECT_NO_OF_LANGUAGE_LOADED = "Test failed due to incorrect no of language loaded" const val TEST_FAILED_DUE_TO_INCORRECT_NO_OF_PROVIDERS_LOADED = "Test failed due to incorrect no of providers loaded" const val TEST_FAILED_DUE_TO_INCORRECT_STYLE_NAME_FOR_STANDARD = "Test failed due to incorrect style name for Standard" const val TEST_FAILED_DUE_TO_INCORRECT_NO_OF_STYLES_LOADED_FOR_STANDARD = "Test failed due to incorrect no of styles loaded for Standard" diff --git a/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMSetLanguageListData.kt b/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMSetLanguageListData.kt new file mode 100644 index 00000000..0086de07 --- /dev/null +++ b/app/src/test/java/com/aws/amazonlocation/viewmodel/explore/ExploreVMSetLanguageListData.kt @@ -0,0 +1,60 @@ +package com.aws.amazonlocation.viewmodel.explore + +import android.content.Context +import androidx.arch.core.executor.testing.InstantTaskExecutorRule +import com.aws.amazonlocation.BaseTest +import com.aws.amazonlocation.data.response.LanguageData +import com.aws.amazonlocation.domain.usecase.LocationSearchUseCase +import com.aws.amazonlocation.mock.TEST_FAILED_DUE_TO_INCORRECT_NO_OF_LANGUAGE_LOADED +import com.aws.amazonlocation.ui.main.explore.ExploreViewModel +import kotlinx.coroutines.test.runTest +import org.junit.Assert +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.mockito.Mock +import org.robolectric.RobolectricTestRunner +import org.robolectric.RuntimeEnvironment + +@RunWith(RobolectricTestRunner::class) +class ExploreVMSetLanguageListData : BaseTest() { + + @get:Rule + val instantExecutorRule = InstantTaskExecutorRule() + + private val context: Context = RuntimeEnvironment.getApplication().applicationContext + + private lateinit var mExploreVM: ExploreViewModel + @Mock + private lateinit var locationSearchUseCase: LocationSearchUseCase + + override fun setUp() { + super.setUp() + mExploreVM = ExploreViewModel(locationSearchUseCase) + } + + @Test + fun setLanguageListDataSuccess() = runTest { + mExploreVM.mMapLanguageData = arrayListOf() + mExploreVM.setMapLanguageData(context) + + Assert.assertTrue( + TEST_FAILED_DUE_TO_INCORRECT_NO_OF_LANGUAGE_LOADED, + mExploreVM.mMapLanguageData.size == 70 + ) + val languageData = LanguageData("test", "test", false) + mExploreVM.mMapLanguageData.add(languageData) + + Assert.assertTrue( + TEST_FAILED_DUE_TO_INCORRECT_NO_OF_LANGUAGE_LOADED, + mExploreVM.mMapLanguageData.size == 71 + ) + + Assert.assertTrue( + TEST_FAILED_DUE_TO_INCORRECT_NO_OF_LANGUAGE_LOADED, + mExploreVM.mMapLanguageData.last().value == languageData.value && + mExploreVM.mMapLanguageData.last().label == languageData.label&& + mExploreVM.mMapLanguageData.last().isSelected == languageData.isSelected + ) + } +} diff --git a/app/src/test/java/com/aws/amazonlocation/viewmodel/mapstyle/MapStyleVMSetLanguageListData.kt b/app/src/test/java/com/aws/amazonlocation/viewmodel/mapstyle/MapStyleVMSetLanguageListData.kt new file mode 100644 index 00000000..9ba5ba66 --- /dev/null +++ b/app/src/test/java/com/aws/amazonlocation/viewmodel/mapstyle/MapStyleVMSetLanguageListData.kt @@ -0,0 +1,56 @@ +package com.aws.amazonlocation.viewmodel.mapstyle + +import android.content.Context +import androidx.arch.core.executor.testing.InstantTaskExecutorRule +import com.aws.amazonlocation.BaseTest +import com.aws.amazonlocation.data.response.LanguageData +import com.aws.amazonlocation.mock.TEST_FAILED_DUE_TO_INCORRECT_NO_OF_LANGUAGE_LOADED +import com.aws.amazonlocation.ui.main.map_style.MapStyleViewModel +import kotlinx.coroutines.test.runTest +import org.junit.Assert +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.RuntimeEnvironment + +@RunWith(RobolectricTestRunner::class) +class MapStyleVMSetLanguageListData : BaseTest() { + + @get:Rule + val instantExecutorRule = InstantTaskExecutorRule() + + private val context: Context = RuntimeEnvironment.getApplication().applicationContext + + private lateinit var mMapStyleViewModel: MapStyleViewModel + + override fun setUp() { + super.setUp() + mMapStyleViewModel = MapStyleViewModel() + } + + @Test + fun setLanguageListDataSuccess() = runTest { + mMapStyleViewModel.mMapLanguageData = arrayListOf() + mMapStyleViewModel.setMapLanguageData(context) + + Assert.assertTrue( + TEST_FAILED_DUE_TO_INCORRECT_NO_OF_LANGUAGE_LOADED, + mMapStyleViewModel.mMapLanguageData.size == 70 + ) + val languageData = LanguageData("test", "test", false) + mMapStyleViewModel.mMapLanguageData.add(languageData) + + Assert.assertTrue( + TEST_FAILED_DUE_TO_INCORRECT_NO_OF_LANGUAGE_LOADED, + mMapStyleViewModel.mMapLanguageData.size == 71 + ) + + Assert.assertTrue( + TEST_FAILED_DUE_TO_INCORRECT_NO_OF_LANGUAGE_LOADED, + mMapStyleViewModel.mMapLanguageData.last().value == languageData.value && + mMapStyleViewModel.mMapLanguageData.last().label == languageData.label&& + mMapStyleViewModel.mMapLanguageData.last().isSelected == languageData.isSelected + ) + } +}