This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private fun translateText(sourceText: String, fromLang: String, toLang: String, mTextView:TextView?) { | |
| val setting: MLRemoteTranslateSetting = | |
| MLRemoteTranslateSetting.Factory() | |
| .setSourceLangCode(fromLang) | |
| .setTargetLangCode(toLang) | |
| .create() | |
| val mlRemoteTranslator: MLRemoteTranslator = | |
| MLTranslatorFactory.getInstance().getRemoteTranslator(setting) | |
| if(!TextUtils.isEmpty(sourceText)){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dependencies{ | |
| implementation 'com.huawei.hms:ml-computer-translate:2.1.0.300' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Location permission. This permission is sensitive and needs to be dynamically applied for in the code after being declared. --> | |
| <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // HMS Awareness Kit | |
| implementation 'com.huawei.hms:awareness:1.0.8.301' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:orientation="vertical" | |
| android:background="@drawable/gradient_white" | |
| tools:context=".ui.weather.ViewPagerWeatherFragment"> | |
| <FrameLayout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:orientation="vertical" | |
| tools:context=".ui.weather.WeeklyWeatherDetailFragment"> | |
| <TextView | |
| android:id="@+id/detail_high_textview" | |
| android:layout_height="wrap_content" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| app:cardElevation="2dp" | |
| android:elevation="10dp" | |
| app:cardBackgroundColor="@color/colorEditTextBackground"> | |
| <LinearLayout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:orientation="vertical" | |
| tools:context=".ui.weather.WeeklyWeatherDetailFragment"> | |
| <TextView | |
| android:id="@+id/detail_high_weekly_textview" | |
| android:layout_height="wrap_content" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| app:cardElevation="2dp" | |
| android:elevation="10dp" | |
| app:cardBackgroundColor="@color/colorEditTextBackground"> | |
| <LinearLayout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private fun initialize() { | |
| val fragmentList = arrayListOf<Fragment>( | |
| HourlyWeatherDetailFragment(), WeeklyWeatherDetailFragment() | |
| ) | |
| val tabTitles = arrayListOf( | |
| "Hourly Weather", "Weekly Weather" | |
| ) | |
| val adapter = ViewPagerWeatherAdapter( | |
| fragmentList, |