Commit f26fc380 authored by satya's avatar satya

update service

parent 38c27d8c
#Mon Dec 18 11:22:54 ICT 2023
gradle.version=7.2
# Default ignored files
/shelf/
/workspace.xml
seatel
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="17" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="1.6.20" />
</component>
</project>
\ No newline at end of file
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="navEditor-manualLayoutAlgorithm2">
<option name="myPositions">
<map>
<entry key="mobile_navigation.xml">
<value>
<LayoutPositions>
<option name="myPositions">
<map>
<entry key="navigation_home">
<value>
<LayoutPositions>
<option name="myPosition">
<Point>
<option name="x" value="12" />
<option name="y" value="12" />
</Point>
</option>
</LayoutPositions>
</value>
</entry>
<entry key="navigation_package">
<value>
<LayoutPositions>
<option name="myPosition">
<Point>
<option name="x" value="256" />
<option name="y" value="12" />
</Point>
</option>
</LayoutPositions>
</value>
</entry>
<entry key="navigation_profile">
<value>
<LayoutPositions>
<option name="myPosition">
<Point>
<option name="x" value="256" />
<option name="y" value="368" />
</Point>
</option>
</LayoutPositions>
</value>
</entry>
<entry key="navigation_usage">
<value>
<LayoutPositions>
<option name="myPosition">
<Point>
<option name="x" value="12" />
<option name="y" value="368" />
</Point>
</option>
</LayoutPositions>
</value>
</entry>
</map>
</option>
</LayoutPositions>
</value>
</entry>
</map>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
...@@ -4,7 +4,7 @@ plugins { ...@@ -4,7 +4,7 @@ plugins {
id 'kotlin-android-extensions' id 'kotlin-android-extensions'
id 'org.jetbrains.kotlin.kapt' id 'org.jetbrains.kotlin.kapt'
id 'com.google.gms.google-services' id 'com.google.gms.google-services'
id 'dagger.hilt.android.plugin' //id 'dagger.hilt.android.plugin'
} }
apply plugin: "realm-android" apply plugin: "realm-android"
...@@ -157,22 +157,22 @@ dependencies { ...@@ -157,22 +157,22 @@ dependencies {
// implementation 'io.realm.kotlin:library-sync:1.8.0' // implementation 'io.realm.kotlin:library-sync:1.8.0'
// Hilt // Hilt
implementation "com.google.dagger:hilt-android:$hilt_version" // implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-android-compiler:$hilt_version" // kapt "com.google.dagger:hilt-android-compiler:$hilt_version"
// Coroutines // Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9' // implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9' // implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'
// Coroutine Lifecycle Scopes // Coroutine Lifecycle Scopes
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0" // implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0" // implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0"
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1' // implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
// Retrofit // Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0' // implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0' // implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation "com.squareup.okhttp3:logging-interceptor:4.7.2" // implementation "com.squareup.okhttp3:logging-interceptor:4.7.2"
// implementation("com.google.android.play:app-update:2.1.0") // implementation("com.google.android.play:app-update:2.1.0")
// implementation("com.google.android.play:app-update-ktx:2.1.0") // implementation("com.google.android.play:app-update-ktx:2.1.0")
......
...@@ -31,6 +31,11 @@ ...@@ -31,6 +31,11 @@
<uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<queries>
<!-- Explicit apps you know in advance about: -->
<package android:name="com.wingmoney.wingpay.uat" />
</queries>
<application <application
android:name=".ui.application.MyApplication" android:name=".ui.application.MyApplication"
android:allowBackup="true" android:allowBackup="true"
......
package com.seatel.mobilehall.data.network
import com.seatel.mobilehall.util.Resource
import retrofit2.Response
abstract class BaseApiResponse {
suspend fun <T> safeApiCall(apiCall: suspend () -> Response<T>): Resource<T> {
try {
val response = apiCall()
if (response.isSuccessful) {
val body = response.body()
body?.let {
return Resource.Success(body)
}
}
return error("${response.code()} ${response.message()}")
} catch (e: Exception) {
return error(e.message ?: e.toString())
}
}
private fun <T> error(errorMessage: String): Resource<T> =
Resource.Error("Api Call Failed $errorMessage")
}
\ No newline at end of file
package com.seatel.mobilehall.data.network.repository
import com.seatel.mobilehall.data.network.BaseApiResponse
import com.seatel.mobilehall.data.network.retrofit.RetrofitInstance
import com.seatel.mobilehall.ui.home.model.BannersModel
import com.seatel.mobilehall.util.Resource
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
class HomeRepository : BaseApiResponse() {
suspend fun getBanners(lang: String) = RetrofitInstance.seatelApi.getBanners(lang)
suspend fun requestBanners(lang: String): Flow<Resource<List<BannersModel>>> {
return flow {
emit(Resource.Loading())
emit(safeApiCall {
RetrofitInstance.seatelApi.getBanners(lang)
})
}.flowOn(Dispatchers.IO)
}
}
\ No newline at end of file
package com.seatel.mobilehall.data.network.repository
import android.app.Application
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.seatel.mobilehall.data.network.viewmodel.HomeViewModel
class ViewModelProviderFactory(
val app: Application, val repository: HomeRepository
) : ViewModelProvider.Factory {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
// if (modelClass.isAssignableFrom())
return HomeViewModel(app, repository) as T
}
}
\ No newline at end of file
package com.seatel.mobilehall.data.network.retrofit
import com.seatel.mobilehall.ui.home.model.BannersModel
import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Query
interface API {
@GET("app-promotions/banners")
suspend fun getBanners(
@Query("lang") lang: String
): Response<List<BannersModel>>
}
\ No newline at end of file
package com.seatel.mobilehall.data.network.retrofit
import com.seatel.mobilehall.BuildConfig
import com.seatel.mobilehall.data.network.Devices
import com.seatel.mobilehall.ui.application.MyApplication
import okhttp3.Interceptor
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import java.util.concurrent.TimeUnit
class RetrofitInstance {
companion object {
private val interceptor: HttpLoggingInterceptor =
HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY)
private val client = OkHttpClient.Builder().readTimeout(60, TimeUnit.SECONDS)
.connectTimeout(60, TimeUnit.SECONDS).writeTimeout(60, TimeUnit.SECONDS)
.addInterceptor(Interceptor { chain ->
val request = chain.request().newBuilder()
.addHeader("X-App-Version", Devices.getAppVersionName(MyApplication.appContext))
.addHeader("X-Language", "en").addHeader("X-Latitude", "")
.addHeader("X-Longitude", "").addHeader("X-Timestamp", "")
.addHeader("X-Timezone", "").addHeader("X-Platform", "Android")
.addHeader("X-OS-Version", "1.1.1").addHeader("X-UDID", "")
.addHeader("X-App-Signature", "")
.addHeader("Content-Type", "application/json; charset=utf-8")
.addHeader("x-api-key", BuildConfig.CLIENT_ID).build()
chain.proceed(request)
}).addInterceptor(interceptor).build()
private val retrofit = Retrofit.Builder().baseUrl(BuildConfig.BASE_URL)
.addConverterFactory(GsonConverterFactory.create()).client(client).build()
val seatelApi by lazy {
retrofit.create(API::class.java)
}
}
}
\ No newline at end of file
package com.seatel.mobilehall.data.network.viewmodel
import android.app.Application
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.seatel.mobilehall.data.network.repository.HomeRepository
import com.seatel.mobilehall.ui.home.model.BannersModel
import com.seatel.mobilehall.util.Resource
import kotlinx.coroutines.launch
class HomeViewModel(
app: Application, private val homeRepository: HomeRepository
) : AndroidViewModel(app) {
private val _bannerResponse = MutableLiveData<Resource<List<BannersModel>>>()
val bannersResponse: LiveData<Resource<List<BannersModel>>> = _bannerResponse
fun fetchBanners(lang: String) = viewModelScope.launch {
homeRepository.requestBanners(lang).collect {
_bannerResponse.value = it
}
}
}
\ No newline at end of file
...@@ -5,11 +5,10 @@ import android.os.StrictMode ...@@ -5,11 +5,10 @@ import android.os.StrictMode
import androidx.multidex.MultiDex import androidx.multidex.MultiDex
import androidx.multidex.MultiDexApplication import androidx.multidex.MultiDexApplication
import com.facebook.drawee.backends.pipeline.Fresco import com.facebook.drawee.backends.pipeline.Fresco
import dagger.hilt.android.HiltAndroidApp
import io.realm.Realm import io.realm.Realm
import io.realm.RealmConfiguration import io.realm.RealmConfiguration
@HiltAndroidApp
class MyApplication : MultiDexApplication() { class MyApplication : MultiDexApplication() {
......
...@@ -11,22 +11,27 @@ import android.text.style.StyleSpan ...@@ -11,22 +11,27 @@ import android.text.style.StyleSpan
import android.util.Log import android.util.Log
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.Toast
import com.android.volley.VolleyError import com.android.volley.VolleyError
import com.google.gson.Gson import com.google.gson.Gson
import com.seatel.mobilehall.R import com.seatel.mobilehall.R
import com.seatel.mobilehall.data.network.SeatelSuperRequest import com.seatel.mobilehall.data.network.SeatelSuperRequest
import com.seatel.mobilehall.data.prefs.LanguagePreference
import com.seatel.mobilehall.data.prefs.SeatelSharePreferences
import com.seatel.mobilehall.ui.base.activity.BaseActivity import com.seatel.mobilehall.ui.base.activity.BaseActivity
import com.seatel.mobilehall.ui.home.interactor.BuyDataPackFreedomInteractor import com.seatel.mobilehall.ui.home.interactor.BuyDataPackFreedomInteractor
import com.seatel.mobilehall.ui.home.model.ValuePackSectionModel
import com.seatel.mobilehall.ui.home.model.ValuePackTableModel import com.seatel.mobilehall.ui.home.model.ValuePackTableModel
import com.seatel.mobilehall.ui.home.presenter.BuyDataPackFreedomPresenter import com.seatel.mobilehall.ui.home.presenter.BuyDataPackFreedomPresenter
import com.seatel.mobilehall.util.Constant import com.seatel.mobilehall.util.Constant
import com.seatel.mobilehall.util.SeatelAlertDialog import com.seatel.mobilehall.util.SeatelAlertDialog
import com.seatel.mobilehall.util.SeatelUtils import com.seatel.mobilehall.util.SeatelUtils
import com.seatel.mobilehall.util.customview.ErrorHandleView import com.seatel.mobilehall.util.customview.ErrorHandleView
import kotlinx.android.synthetic.main.activity_confirm_buy_data_pack.* import kotlinx.android.synthetic.main.activity_confirm_buy_data_pack.button_ok
import kotlinx.android.synthetic.main.activity_confirm_buy_data_pack.ctv_buy_data
import kotlinx.android.synthetic.main.activity_confirm_buy_data_pack.ctv_deduct
import kotlinx.android.synthetic.main.activity_confirm_buy_data_pack.cv_data_buy
import kotlinx.android.synthetic.main.activity_confirm_buy_data_pack.cv_data_valid_value_pack
import kotlinx.android.synthetic.main.activity_confirm_buy_data_pack.error_view
import kotlinx.android.synthetic.main.activity_confirm_buy_data_pack.image_view_back
import kotlinx.android.synthetic.main.activity_confirm_buy_data_pack.tv_phone_number
import java.text.DecimalFormat import java.text.DecimalFormat
class ConfirmBuyDataPackActivity : BaseActivity(), BuyDataPackFreedomInteractor.View { class ConfirmBuyDataPackActivity : BaseActivity(), BuyDataPackFreedomInteractor.View {
...@@ -56,6 +61,8 @@ class ConfirmBuyDataPackActivity : BaseActivity(), BuyDataPackFreedomInteractor. ...@@ -56,6 +61,8 @@ class ConfirmBuyDataPackActivity : BaseActivity(), BuyDataPackFreedomInteractor.
private var pricePlanCode: String = "" private var pricePlanCode: String = ""
private var requestTime: String? = null private var requestTime: String? = null
// private var valuePackSectionModel: ValuePackSectionModel? = null
override fun onBuyDataSucceed() { override fun onBuyDataSucceed() {
SuccessBuyDataPackActivity.launch(this, name, data, isAddON)/* if (isValuePack || isFortunePlan || isVipFortunePlan) mDataValuePack?.let { SuccessBuyDataPackActivity.launch(this, name, data, isAddON)/* if (isValuePack || isFortunePlan || isVipFortunePlan) mDataValuePack?.let {
...@@ -92,7 +99,12 @@ class ConfirmBuyDataPackActivity : BaseActivity(), BuyDataPackFreedomInteractor. ...@@ -92,7 +99,12 @@ class ConfirmBuyDataPackActivity : BaseActivity(), BuyDataPackFreedomInteractor.
} else mBuyDataPackFreedomPresenter.onBuyData( } else mBuyDataPackFreedomPresenter.onBuyData(
getPhoneLogin(), type, fee.substring(1).toDouble(), isAddON, pricePlanCode, requestTime!! getPhoneLogin(),
type,
fee.substring(1).toDouble(),
isAddON,
pricePlanCode,
requestTime!!
) )
//note: if amount 0.5 then change it to 0.1 for CRM(do it for CRM) //note: if amount 0.5 then change it to 0.1 for CRM(do it for CRM)
/*if (mAmountPost == 0.5 && !isValuePack && !isFortunePlan) { /*if (mAmountPost == 0.5 && !isValuePack && !isFortunePlan) {
...@@ -433,6 +445,12 @@ class ConfirmBuyDataPackActivity : BaseActivity(), BuyDataPackFreedomInteractor. ...@@ -433,6 +445,12 @@ class ConfirmBuyDataPackActivity : BaseActivity(), BuyDataPackFreedomInteractor.
else ctv_buy_data.text = SeatelUtils.translatForDialog(this, "Buy $name") else ctv_buy_data.text = SeatelUtils.translatForDialog(this, "Buy $name")
cv_data_buy.text = SeatelUtils.translatForDialog(this, "$fee") cv_data_buy.text = SeatelUtils.translatForDialog(this, "$fee")
tv_phone_number.text = getPhoneLogin() tv_phone_number.text = getPhoneLogin()
// valuePackSectionModel = intent.getSerializableExtra("valuePackSectionModel") as ValuePackSectionModel
// ctv_buy_data.text = SeatelUtils.translatForDialog(this,"Buy ${valuePackSectionModel!!.name}")
// cv_data_buy.text = SeatelUtils.translatForDialog(this, "${valuePackSectionModel!!.valuePackSecTwoModel.table[0].valuePrice}")
// Log.d("TAG::>>>", "init: $valuePackSectionModel")
ctv_deduct.text = "${ ctv_deduct.text = "${
SeatelUtils.translatForDialog( SeatelUtils.translatForDialog(
this, getString(R.string.we_will_deduct) this, getString(R.string.we_will_deduct)
...@@ -477,6 +495,12 @@ class ConfirmBuyDataPackActivity : BaseActivity(), BuyDataPackFreedomInteractor. ...@@ -477,6 +495,12 @@ class ConfirmBuyDataPackActivity : BaseActivity(), BuyDataPackFreedomInteractor.
context.startActivity(intent) context.startActivity(intent)
} }
fun launchData(context: Context, valuePackSectionModel: ValuePackSectionModel) {
val intent = Intent(context, ConfirmBuyDataPackActivity::class.java)
intent.putExtra("valuePackSectionModel", valuePackSectionModel)
context.startActivity(intent)
}
fun launch( fun launch(
context: Context, context: Context,
name: String, name: String,
......
...@@ -3,32 +3,33 @@ package com.seatel.mobilehall.ui.home.activity ...@@ -3,32 +3,33 @@ package com.seatel.mobilehall.ui.home.activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.util.Log
import android.view.View import android.view.View
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager
import com.android.volley.NoConnectionError import com.android.volley.NoConnectionError
import com.android.volley.TimeoutError import com.android.volley.TimeoutError
import com.android.volley.VolleyError import com.android.volley.VolleyError
import com.seatel.mobilehall.R import com.seatel.mobilehall.R
import com.seatel.mobilehall.ui.base.activity.BaseActivity import com.seatel.mobilehall.ui.base.activity.BaseActivity
import com.seatel.mobilehall.ui.home.adapter.LoyKobAdapter
import com.seatel.mobilehall.ui.home.adapter.LoyKobAddOnAdapter
import com.seatel.mobilehall.ui.home.adapter.TermAndServiceFooterAdapter
import com.seatel.mobilehall.ui.home.interactor.ProductServiceButtonClick import com.seatel.mobilehall.ui.home.interactor.ProductServiceButtonClick
import com.seatel.mobilehall.ui.home.interactor.ProductServiceDetailInteractor import com.seatel.mobilehall.ui.home.interactor.ProductServiceDetailInteractor
import com.seatel.mobilehall.ui.home.model.ValuePackSectionModel import com.seatel.mobilehall.ui.home.model.ValuePackSectionModel
import com.seatel.mobilehall.ui.home.model.ValuePackTableModel import com.seatel.mobilehall.ui.home.model.ValuePackTableModel
import com.seatel.mobilehall.ui.home.presenter.ProductServiceDetailPrsenter import com.seatel.mobilehall.ui.home.presenter.ProductServiceDetailPrsenter
import com.seatel.mobilehall.ui.packages.adapter.LoyKobsAdapter
import com.seatel.mobilehall.util.Constant
import com.seatel.mobilehall.util.customview.ErrorHandleView import com.seatel.mobilehall.util.customview.ErrorHandleView
import kotlinx.android.synthetic.main.activity_loykob.* import kotlinx.android.synthetic.main.activity_loykob.error_view
import kotlinx.android.synthetic.main.activity_loykob.recyclerItemLoyKob
class LoyKobActivity : BaseActivity(), ProductServiceDetailInteractor.View, View.OnClickListener, class LoyKobActivity : BaseActivity(), ProductServiceDetailInteractor.View,
ProductServiceButtonClick { ProductServiceButtonClick {
private var TAG = "LoyKobActivity::>>>"
private var mPlanCode: String? = null private var mPlanCode: String? = null
private var canSubscribe: Boolean = false private var canSubscribe: Boolean = false
private var valueData: String? = null private var valueData: String? = null
private var name: String? = null private var name: String? = null
private var planType: String? = null
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
...@@ -42,62 +43,26 @@ class LoyKobActivity : BaseActivity(), ProductServiceDetailInteractor.View, View ...@@ -42,62 +43,26 @@ class LoyKobActivity : BaseActivity(), ProductServiceDetailInteractor.View, View
private fun getDataIntent() { private fun getDataIntent() {
canSubscribe = intent.getBooleanExtra("CAN_SUBSCRIBE", false) canSubscribe = intent.getBooleanExtra("CAN_SUBSCRIBE", false)
mPlanCode = intent.getStringExtra("PLAN_CODE") mPlanCode = intent.getStringExtra("PLAN_CODE")
planType = intent.getStringExtra("planType")
} }
private fun init() { private fun init() {
ProductServiceDetailPrsenter(this, this).onProServiceDetail(mPlanCode!!,getPhoneLogin()) ProductServiceDetailPrsenter(this, this).onProServiceDetail(mPlanCode!!, getPhoneLogin())
btn_benefit.setOnClickListener(this)
btn_term_condition.setOnClickListener(this)
} }
override fun onProServiceDetailSucceed(valuePackSectionModel: ValuePackSectionModel) { override fun onProServiceDetailSucceed(valuePackSectionModel: ValuePackSectionModel) {
Log.d(TAG, "responseData:>>> $valuePackSectionModel")
error_view.visibility = View.GONE error_view.visibility = View.GONE
if (valuePackSectionModel.valuePackSecTwoModel.addon.size > 0) if (planType.equals(Constant.LoyKob)) {
addon_frame.visibility = View.VISIBLE recyclerItemLoyKob.adapter =
else LoyKobsAdapter(this, Constant.LoyKob, canSubscribe, valuePackSectionModel)
addon_frame.visibility = View.GONE } else
valueData = valuePackSectionModel.type recyclerItemLoyKob.adapter =
name = valuePackSectionModel.name LoyKobsAdapter(this, "Any", canSubscribe, valuePackSectionModel)
tv_add_on_term_condition.text = "Add-on Terms & Conditions"
setupTitle(valuePackSectionModel)
setupDataList(valuePackSectionModel)
}
private fun setupTitle(valuePackSectionModel: ValuePackSectionModel) {
mainTitle.text = valuePackSectionModel.valuePackSecTwoModel.title
subTitle.text = valuePackSectionModel.valuePackSecTwoModel.subTitle
}
private fun setupDataList(valuePackSectionModel: ValuePackSectionModel) {
mRecyclerLoyKob.adapter =
LoyKobAdapter(
this,
canSubscribe,
valuePackSectionModel.valuePackSecTwoModel.table, this, getMainPhoneLogin()
)
mRecyclerLoyKobAddOn.apply {
layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
adapter = LoyKobAddOnAdapter(
context,
canSubscribe,
valuePackSectionModel.valuePackSecTwoModel.addon,
this@LoyKobActivity,
getMainPhoneLogin()
)
} }
mRecyclerTermCondition.adapter = TermAndServiceFooterAdapter(
this, getTermAndServiceEn(valuePackSectionModel.valuePackSecThreeModel.description),
true
)
mRecyclerAddOnTermCondition.adapter = TermAndServiceFooterAdapter(
this,
getTermAndServiceEn(valuePackSectionModel.valuePackSecThreeModel.description2),
true
)
}
private fun getTermAndServiceEn(str: String): List<String> { private fun getTermAndServiceEn(str: String): List<String> {
val data = ArrayList<String>() val data = ArrayList<String>()
...@@ -111,10 +76,12 @@ class LoyKobActivity : BaseActivity(), ProductServiceDetailInteractor.View, View ...@@ -111,10 +76,12 @@ class LoyKobActivity : BaseActivity(), ProductServiceDetailInteractor.View, View
error_view.errorMessage = getString(R.string.connection_timeout) error_view.errorMessage = getString(R.string.connection_timeout)
error_view.setViewMode(ErrorHandleView.Mode.TIME_OUT) error_view.setViewMode(ErrorHandleView.Mode.TIME_OUT)
} }
is NoConnectionError -> { is NoConnectionError -> {
error_view.errorMessage = getString(R.string.message_no_internet) error_view.errorMessage = getString(R.string.message_no_internet)
error_view.setViewMode(ErrorHandleView.Mode.NO_INTERNET) error_view.setViewMode(ErrorHandleView.Mode.NO_INTERNET)
} }
else -> { else -> {
error_view.errorMessage = getString(R.string.no_data) error_view.errorMessage = getString(R.string.no_data)
error_view.setViewMode(ErrorHandleView.Mode.NO_DATA) error_view.setViewMode(ErrorHandleView.Mode.NO_DATA)
...@@ -123,45 +90,23 @@ class LoyKobActivity : BaseActivity(), ProductServiceDetailInteractor.View, View ...@@ -123,45 +90,23 @@ class LoyKobActivity : BaseActivity(), ProductServiceDetailInteractor.View, View
} }
override fun getToolbarTitle(): String { override fun getToolbarTitle(): String {
return "Loy Kob" mPlanCode = intent.getStringExtra("PLAN_CODE")
return when (mPlanCode) {
Constant.LoyKob -> "Loy Kob"
"internet-pack" -> "Data Pack"
else -> mPlanCode.toString()
} }
override fun onClick(view: View?) {
when (view?.tag) {
"BUTTON_BENEFIT" -> {
frame_benefit.visibility = View.VISIBLE
btn_benefit.setTextColor(ContextCompat.getColor(this, R.color.colorPrimary))
btn_benefit.setBackgroundResource(R.drawable.bg_button_cart)
btn_benefit.isAllCaps = true
//term condition button
frame_term_condition.visibility = View.GONE
btn_term_condition.setTextColor(ContextCompat.getColor(this, R.color.black))
btn_term_condition.setBackgroundColor(resources.getColor(R.color.colorItemDataPack))
} }
"BUTTON_TERM_CONDITION" -> {
frame_term_condition.visibility = View.VISIBLE
btn_term_condition.setTextColor(ContextCompat.getColor(this, R.color.colorPrimary))
btn_term_condition.setBackgroundResource(R.drawable.bg_button_cart)
btn_term_condition.isAllCaps = true
//Benefit button
frame_benefit.visibility = View.GONE
btn_benefit.setTextColor(ContextCompat.getColor(this, R.color.black))
btn_benefit.setBackgroundColor(resources.getColor(R.color.colorItemDataPack))
}
}
}
companion object { companion object {
fun launch( fun launch(
context: Context, canSubscribe: Boolean, planCode: String context: Context, canSubscribe: Boolean, planCode: String, planType: String
) { ) {
val intent = Intent(context, LoyKobActivity::class.java) val intent = Intent(context, LoyKobActivity::class.java)
intent.putExtra("PLAN_CODE", planCode) intent.putExtra("PLAN_CODE", planCode)
intent.putExtra("CAN_SUBSCRIBE", canSubscribe) intent.putExtra("CAN_SUBSCRIBE", canSubscribe)
intent.putExtra("planType", planType)
context.startActivity(intent) context.startActivity(intent)
} }
...@@ -196,6 +141,7 @@ class LoyKobActivity : BaseActivity(), ProductServiceDetailInteractor.View, View ...@@ -196,6 +141,7 @@ class LoyKobActivity : BaseActivity(), ProductServiceDetailInteractor.View, View
pricePlanCode, pricePlanCode,
true true
) )
else -> ConfirmBuyDataPackActivity.launch( else -> ConfirmBuyDataPackActivity.launch(
this, this,
name!!, name!!,
......
...@@ -17,6 +17,7 @@ import com.seatel.mobilehall.ui.base.activity.BaseActivity ...@@ -17,6 +17,7 @@ import com.seatel.mobilehall.ui.base.activity.BaseActivity
import com.seatel.mobilehall.ui.home.interactor.AppProductsInteractor import com.seatel.mobilehall.ui.home.interactor.AppProductsInteractor
import com.seatel.mobilehall.ui.home.model.AppProductsResponseModel import com.seatel.mobilehall.ui.home.model.AppProductsResponseModel
import com.seatel.mobilehall.ui.home.presenter.AppProductsPresenter import com.seatel.mobilehall.ui.home.presenter.AppProductsPresenter
import com.seatel.mobilehall.util.Constant
import com.seatel.mobilehall.util.customview.ErrorHandleView import com.seatel.mobilehall.util.customview.ErrorHandleView
import kotlinx.android.synthetic.main.activity_product_service.* import kotlinx.android.synthetic.main.activity_product_service.*
...@@ -46,15 +47,19 @@ class ProductServiceActivity : BaseActivity(), AppProductsInteractor.View { ...@@ -46,15 +47,19 @@ class ProductServiceActivity : BaseActivity(), AppProductsInteractor.View {
"one-plan" -> { "one-plan" -> {
OnePlanDetailActivity.lunch(this) OnePlanDetailActivity.lunch(this)
} }
"international-call" -> { "international-call" -> {
error_view.setViewMode(ErrorHandleView.Mode.LOADING) error_view.setViewMode(ErrorHandleView.Mode.LOADING)
InternationalCallDetailActivity.lunch(this) InternationalCallDetailActivity.lunch(this)
} }
"loy-kobs" -> LoyKobActivity.launch(this, it.canSubscribe!!, it.code!!)
else -> {
ProductServiceDetailActivity.launch(
this, it.canSubscribe!!, it.code!!, it.name!!
"loy-kobs" -> LoyKobActivity.launch(
this, it.canSubscribe!!, it.code!!, Constant.LoyKob
)
else -> {
LoyKobActivity.launch(
this, it.canSubscribe!!, it.code!!, "Any"
) )
} }
} }
...@@ -75,10 +80,12 @@ class ProductServiceActivity : BaseActivity(), AppProductsInteractor.View { ...@@ -75,10 +80,12 @@ class ProductServiceActivity : BaseActivity(), AppProductsInteractor.View {
error_view.errorMessage = getString(R.string.connection_timeout) error_view.errorMessage = getString(R.string.connection_timeout)
error_view.setViewMode(ErrorHandleView.Mode.TIME_OUT) error_view.setViewMode(ErrorHandleView.Mode.TIME_OUT)
} }
is NoConnectionError -> { is NoConnectionError -> {
error_view.errorMessage = getString(R.string.message_no_internet) error_view.errorMessage = getString(R.string.message_no_internet)
error_view.setViewMode(ErrorHandleView.Mode.NO_INTERNET) error_view.setViewMode(ErrorHandleView.Mode.NO_INTERNET)
} }
else -> { else -> {
error_view.errorMessage = getString(R.string.no_data) error_view.errorMessage = getString(R.string.no_data)
error_view.setViewMode(ErrorHandleView.Mode.NO_DATA) error_view.setViewMode(ErrorHandleView.Mode.NO_DATA)
......
...@@ -125,7 +125,7 @@ class ProductServiceDetailActivity : BaseActivity(), View.OnClickListener, ...@@ -125,7 +125,7 @@ class ProductServiceDetailActivity : BaseActivity(), View.OnClickListener,
valueData = valuePackSectionModel.type valueData = valuePackSectionModel.type
name = valuePackSectionModel.name name = valuePackSectionModel.name
setupTitle(valuePackSectionModel) setupTitle(valuePackSectionModel)
setupDataList(valuePackSectionModel) (valuePackSectionModel)
} }
private fun setupTitle(valuePackSectionModel: ValuePackSectionModel) { private fun setupTitle(valuePackSectionModel: ValuePackSectionModel) {
......
...@@ -9,10 +9,8 @@ import com.seatel.mobilehall.databinding.ItemHomeImageSliderBinding ...@@ -9,10 +9,8 @@ import com.seatel.mobilehall.databinding.ItemHomeImageSliderBinding
import com.seatel.mobilehall.ui.home.model.BannersModel import com.seatel.mobilehall.ui.home.model.BannersModel
import com.seatel.mobilehall.ui.login.activity.TermsAndConditionsActivity import com.seatel.mobilehall.ui.login.activity.TermsAndConditionsActivity
import com.smarteist.autoimageslider.SliderViewAdapter import com.smarteist.autoimageslider.SliderViewAdapter
import dagger.hilt.android.qualifiers.ActivityContext
import javax.inject.Inject
class HomeImageSliderAdapter @Inject constructor(@ActivityContext var context: Context) : class HomeImageSliderAdapter(var context: Context) :
SliderViewAdapter<HomeImageSliderAdapter.SliderAdapterVH>() { SliderViewAdapter<HomeImageSliderAdapter.SliderAdapterVH>() {
private var mSliderItems = mutableListOf<BannersModel>() private var mSliderItems = mutableListOf<BannersModel>()
......
...@@ -56,7 +56,7 @@ class LoyKobAddOnAdapter( ...@@ -56,7 +56,7 @@ class LoyKobAddOnAdapter(
callSmsData = it.toString() callSmsData = it.toString()
} }
holder.mData.text = mAddOnList.priceChange.toString() + callSmsData holder.mData.text = mAddOnList.priceChange.toString() + callSmsData
holder.mValidity.text = mAddOnList.validityDate // holder.mValidity.text = mAddOnList.validityDate
holder.mActivateCode.text = mAddOnList.activation holder.mActivateCode.text = mAddOnList.activation
/*if (mAddOnList.callsmsList != null && mAddOnList.callsmsList.size > 0) { /*if (mAddOnList.callsmsList != null && mAddOnList.callsmsList.size > 0) {
if (mAddOnList.callsmsList.size == 1) { if (mAddOnList.callsmsList.size == 1) {
......
package com.seatel.mobilehall.ui.home.adapter
import android.content.Context
import android.graphics.Typeface
import android.os.Build
import android.text.Html
import android.text.method.LinkMovementMethod
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.seatel.mobilehall.databinding.ItemTermsAndServiceFooterBinding
import com.seatel.mobilehall.ui.home.model.ValuePackSectionModel
/**
* Created by mac on 8/27/2018 AD.
*/
class TermAndServiceFooter2Adapter(
private val mContext: Context,
private var mTermAndServiceList: ValuePackSectionModel,
private val mIsHTMLStyle: Boolean
) : RecyclerView.Adapter<RecyclerView.ViewHolder?>() {
// private var mTermAndServiceList: List<String>? = null
companion object {
private const val HEADER = 0
private const val FOOTER = 1
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
return when (viewType) {
HEADER -> {
val binding = ItemTermsAndServiceFooterBinding.inflate(
LayoutInflater.from(parent.context), parent, false
)
HeaderHolder(binding)
}
FOOTER -> {
val binding = ItemTermsAndServiceFooterBinding.inflate(
LayoutInflater.from(parent.context), parent, false
)
FooterHolder(binding)
}
else -> {
val binding = ItemTermsAndServiceFooterBinding.inflate(
LayoutInflater.from(parent.context), parent, false
)
TitleHolder(binding)
}
}
}
override fun getItemCount(): Int {
return 3
}
override fun getItemViewType(position: Int): Int {
return position
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
when (holder.itemViewType) {
HEADER -> {
val text = mTermAndServiceList.valuePackSecThreeModel.description2
val customTextView: TextView = holder.itemView as TextView
if (mIsHTMLStyle) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
customTextView.text = Html.fromHtml(text, Html.FROM_HTML_MODE_COMPACT)
customTextView.movementMethod = LinkMovementMethod.getInstance()
} else {
customTextView.text = Html.fromHtml(text)
customTextView.movementMethod = LinkMovementMethod.getInstance()
}
} else customTextView.text = text
}
FOOTER -> {
val customTextView: TextView = holder.itemView as TextView
customTextView.setTypeface(customTextView.typeface, Typeface.BOLD)
if (mTermAndServiceList.valuePackSecTwoModel.addon.size > 0)
customTextView.text = "Add-on Terms & Conditions"
}
else -> {
val text = mTermAndServiceList.valuePackSecThreeModel.description
val customTextView: TextView = holder.itemView as TextView
if (mIsHTMLStyle) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
customTextView.text = Html.fromHtml(text, Html.FROM_HTML_MODE_COMPACT)
customTextView.movementMethod = LinkMovementMethod.getInstance()
} else {
customTextView.text = Html.fromHtml(text)
customTextView.movementMethod = LinkMovementMethod.getInstance()
}
} else customTextView.text = text
}
}
}
class HeaderHolder(var itemView: ItemTermsAndServiceFooterBinding) :
RecyclerView.ViewHolder(itemView.root)
class TitleHolder(var itemView: ItemTermsAndServiceFooterBinding) :
RecyclerView.ViewHolder(itemView.root)
class FooterHolder(var itemView: ItemTermsAndServiceFooterBinding) :
RecyclerView.ViewHolder(itemView.root)
}
\ No newline at end of file
...@@ -11,7 +11,6 @@ import android.view.View ...@@ -11,7 +11,6 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.RelativeLayout import android.widget.RelativeLayout
import android.widget.Toast import android.widget.Toast
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import coil.load import coil.load
import coil.transform.CircleCropTransformation import coil.transform.CircleCropTransformation
...@@ -30,7 +29,6 @@ import com.seatel.mobilehall.R ...@@ -30,7 +29,6 @@ import com.seatel.mobilehall.R
import com.seatel.mobilehall.data.network.SeatelJSONArrayRequest import com.seatel.mobilehall.data.network.SeatelJSONArrayRequest
import com.seatel.mobilehall.data.network.SeatelJSONObjectRequest import com.seatel.mobilehall.data.network.SeatelJSONObjectRequest
import com.seatel.mobilehall.data.network.SeatelSuperRequest import com.seatel.mobilehall.data.network.SeatelSuperRequest
import com.seatel.mobilehall.data.network.viewmodel.HomeViewModel
import com.seatel.mobilehall.data.prefs.SeatelSharePreferences import com.seatel.mobilehall.data.prefs.SeatelSharePreferences
import com.seatel.mobilehall.databinding.FragmentHomeBinding import com.seatel.mobilehall.databinding.FragmentHomeBinding
import com.seatel.mobilehall.ui.application.MyApplication import com.seatel.mobilehall.ui.application.MyApplication
...@@ -72,26 +70,22 @@ import com.seatel.mobilehall.util.SeatelAlertDialog ...@@ -72,26 +70,22 @@ import com.seatel.mobilehall.util.SeatelAlertDialog
import com.seatel.mobilehall.util.SeatelUtils import com.seatel.mobilehall.util.SeatelUtils
import com.seatel.mobilehall.util.lang.FirstLoginPreference import com.seatel.mobilehall.util.lang.FirstLoginPreference
import com.seatel.mobilehall.util.manager.OrderingManager import com.seatel.mobilehall.util.manager.OrderingManager
import com.seatel.mobilehall.util.observe
import com.seatel.mobilehall.util.request.GetMainData import com.seatel.mobilehall.util.request.GetMainData
import com.seatel.mobilehall.util.viewFragmentBinding import com.seatel.mobilehall.util.viewFragmentBinding
import com.smarteist.autoimageslider.IndicatorView.animation.type.IndicatorAnimationType import com.smarteist.autoimageslider.IndicatorView.animation.type.IndicatorAnimationType
import com.smarteist.autoimageslider.SliderAnimations import com.smarteist.autoimageslider.SliderAnimations
import com.smarteist.autoimageslider.SliderView import com.smarteist.autoimageslider.SliderView
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.android.synthetic.main.fragment_home.homeImageSlider
import org.json.JSONArray import org.json.JSONArray
import org.json.JSONObject import org.json.JSONObject
import javax.inject.Inject
@AndroidEntryPoint
class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.View, class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.View,
CategoryInteractor.View, BadgesCountInteractor.View { CategoryInteractor.View, BadgesCountInteractor.View {
private var TAG = javaClass.simpleName private var TAG = javaClass.simpleName
private val binding by viewFragmentBinding(
private lateinit var viewModel: HomeViewModel FragmentHomeBinding::inflate
)
private var cartCount = MyApplication.badgeCartCount private var cartCount = MyApplication.badgeCartCount
private var dataMainScreen: MainDataModel? = null private var dataMainScreen: MainDataModel? = null
...@@ -106,11 +100,6 @@ class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.Vie ...@@ -106,11 +100,6 @@ class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.Vie
private var token: String = "" private var token: String = ""
private val binding by viewFragmentBinding(
FragmentHomeBinding::inflate
)
@Inject
lateinit var homeImageSliderAdapter: HomeImageSliderAdapter lateinit var homeImageSliderAdapter: HomeImageSliderAdapter
lateinit var categoryAdapter: CategoryAdapter lateinit var categoryAdapter: CategoryAdapter
...@@ -139,13 +128,6 @@ class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.Vie ...@@ -139,13 +128,6 @@ class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.Vie
return binding.root return binding.root
} }
private fun setupViewModel() {
viewModel = ViewModelProvider(requireActivity()).get(HomeViewModel::class.java)
viewModel.fetchBanners("en")
viewModel.run {
observe(bannersResponse, ::handleBanner)
}
}
private fun handleBanner(resource: Resource<List<BannersModel>>) { private fun handleBanner(resource: Resource<List<BannersModel>>) {
when (resource) { when (resource) {
...@@ -502,6 +484,7 @@ class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.Vie ...@@ -502,6 +484,7 @@ class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.Vie
binding.run { binding.run {
bannersList.let { bannersList.let {
it.run { it.run {
homeImageSliderAdapter = HomeImageSliderAdapter(requireContext())
homeImageSliderAdapter.addItem(it) homeImageSliderAdapter.addItem(it)
homeImageSlider.setSliderAdapter(homeImageSliderAdapter) homeImageSlider.setSliderAdapter(homeImageSliderAdapter)
homeImageSlider.setIndicatorAnimation(IndicatorAnimationType.WORM) homeImageSlider.setIndicatorAnimation(IndicatorAnimationType.WORM)
...@@ -515,7 +498,8 @@ class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.Vie ...@@ -515,7 +498,8 @@ class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.Vie
} }
override fun onGetBannersFailed(error: VolleyError) { override fun onGetBannersFailed(error: VolleyError) {
SeatelAlertDialog.with(requireContext(), SeatelSuperRequest.getErrorMessageFrom(error))
.show()
} }
...@@ -578,7 +562,7 @@ class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.Vie ...@@ -578,7 +562,7 @@ class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.Vie
} }
override fun onGetCategoryFailed(error: VolleyError) { override fun onGetCategoryFailed(error: VolleyError) {
// SeatelAlertDialog.with(requireContext(), SeatelSuperRequest.getErrorMessageFrom(error)).show()
} }
...@@ -664,7 +648,8 @@ class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.Vie ...@@ -664,7 +648,8 @@ class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.Vie
} }
override fun responseCountFail(error: VolleyError) { override fun responseCountFail(error: VolleyError) {
SeatelAlertDialog.with(requireContext(), SeatelSuperRequest.getErrorMessageFrom(error))
.show()
} }
private fun setBadgesCount(notificationCount: Int, cartCount: Int) { private fun setBadgesCount(notificationCount: Int, cartCount: Int) {
......
...@@ -3,7 +3,9 @@ package com.seatel.mobilehall.ui.home.model; ...@@ -3,7 +3,9 @@ package com.seatel.mobilehall.ui.home.model;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
public class DataPackSecThreeModel { import java.io.Serializable;
public class DataPackSecThreeModel implements Serializable {
@SerializedName("description") @SerializedName("description")
@Expose @Expose
private String description; private String description;
......
package com.seatel.mobilehall.ui.home.model; package com.seatel.mobilehall.ui.home.model;
public class OnePlanDetailSecOneModel { import java.io.Serializable;
public class OnePlanDetailSecOneModel implements Serializable {
private String mobileImageUrl; private String mobileImageUrl;
private String desktopImageUrl; private String desktopImageUrl;
private String imageUrl; private String imageUrl;
......
...@@ -3,9 +3,10 @@ package com.seatel.mobilehall.ui.home.model; ...@@ -3,9 +3,10 @@ package com.seatel.mobilehall.ui.home.model;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.List; import java.util.List;
public class ValuePackSecTwoModel { public class ValuePackSecTwoModel implements Serializable {
@SerializedName("title") @SerializedName("title")
@Expose @Expose
private String title; private String title;
......
...@@ -3,7 +3,9 @@ package com.seatel.mobilehall.ui.home.model; ...@@ -3,7 +3,9 @@ package com.seatel.mobilehall.ui.home.model;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
public class ValuePackSectionModel { import java.io.Serializable;
public class ValuePackSectionModel implements Serializable {
@SerializedName("section1") @SerializedName("section1")
@Expose @Expose
private OnePlanDetailSecOneModel dataPackDetailSecOneModel; private OnePlanDetailSecOneModel dataPackDetailSecOneModel;
......
...@@ -3,9 +3,10 @@ package com.seatel.mobilehall.ui.home.model; ...@@ -3,9 +3,10 @@ package com.seatel.mobilehall.ui.home.model;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.List; import java.util.List;
public class ValuePackTableModel { public class ValuePackTableModel implements Serializable {
@SerializedName("valuePrice") @SerializedName("valuePrice")
@Expose @Expose
......
...@@ -3,49 +3,30 @@ package com.seatel.mobilehall.ui.main ...@@ -3,49 +3,30 @@ package com.seatel.mobilehall.ui.main
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.NavController import androidx.navigation.NavController
import androidx.navigation.findNavController import androidx.navigation.findNavController
import androidx.navigation.ui.setupWithNavController import androidx.navigation.ui.setupWithNavController
import com.google.android.material.bottomnavigation.BottomNavigationView import com.google.android.material.bottomnavigation.BottomNavigationView
import com.seatel.mobilehall.R import com.seatel.mobilehall.R
import com.seatel.mobilehall.databinding.ActivityMainBinding import com.seatel.mobilehall.databinding.ActivityMainBinding
import com.seatel.mobilehall.ui.base.activity.BaseActivity
import com.seatel.mobilehall.util.SeatelUtils.Companion.translatForDialog import com.seatel.mobilehall.util.SeatelUtils.Companion.translatForDialog
import com.seatel.mobilehall.util.viewBinding import com.seatel.mobilehall.util.viewBinding
import dagger.hilt.android.AndroidEntryPoint
@AndroidEntryPoint class MainActivity : BaseActivity() {
class
MainActivity : AppCompatActivity() {
private val binding by viewBinding( private val binding by viewBinding(
ActivityMainBinding::inflate ActivityMainBinding::inflate
) )
/* private lateinit var appUpdateManager: AppUpdateManager
private val updateAvailable = MutableLiveData<Boolean>().apply { value = false }
private var updateInfo: AppUpdateInfo? = null
private var updateListener = InstallStateUpdatedListener { state: InstallState ->
commonLog("update01:$state")
if (state.installStatus() == InstallStatus.DOWNLOADED) {
showUpdateSnackbar()
}
}
*/
private lateinit var navController: NavController private lateinit var navController: NavController
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(binding.root) setContentView(binding.root)
setupBottomNav() setupBottomNav()
/*try {
appUpdateManager = AppUpdateManagerFactory.create(this)
appUpdateManager.registerListener(updateListener)
checkForUpdate()
} catch (e: Exception) {
commonLog("update01:Update e1 ${e.message}")
}*/
} }
private fun setupBottomNav() { private fun setupBottomNav() {
...@@ -63,50 +44,9 @@ MainActivity : AppCompatActivity() { ...@@ -63,50 +44,9 @@ MainActivity : AppCompatActivity() {
translatForDialog(this, getString(R.string.nav_profile)) translatForDialog(this, getString(R.string.nav_profile))
} }
//Check for update availability
/* private fun checkForUpdate() {
appUpdateManager.appUpdateInfo.addOnSuccessListener {
if (it.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE && it.isUpdateTypeAllowed(
AppUpdateType.FLEXIBLE
)
) {
updateInfo = it
updateAvailable.value = true
commonLog("update01:Version code available ${it.availableVersionCode()}")
startForInAppUpdate(updateInfo)
} else {
updateAvailable.value = false
commonLog("update01:Update not available")
}
}
}
private fun startForInAppUpdate(it: AppUpdateInfo?) {
appUpdateManager.startUpdateFlowForResult(it!!, AppUpdateType.FLEXIBLE, this, 1101)
}
private fun showUpdateSnackbar() {
try {
val snackbar = Snackbar.make(
binding.container, "An update has just been downloaded.", Snackbar.LENGTH_INDEFINITE
).setAction("RESTART") { appUpdateManager.completeUpdate() }
//snackbar.anchorView = binding.appBarMain.contentMain.bottomNav
snackbar.setActionTextColor(Color.parseColor("#ffff4444"))
snackbar.show()
} catch (e: java.lang.Exception) {
}
}
private fun commonLog(message: String) {
Log.d("tag001", message)
}*/
override fun onBackPressed() { override fun onBackPressed() {
/* try {
appUpdateManager.unregisterListener(updateListener)
} catch (e: Exception) {
commonLog("update01:Update e2 ${e.message}")
}*/
when { when {
R.id.navigation_home == navController.currentDestination?.id -> { R.id.navigation_home == navController.currentDestination?.id -> {
finish() finish()
......
package com.seatel.mobilehall.ui.packages.adapter
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.seatel.mobilehall.databinding.ItemLoyKobListBinding
import com.seatel.mobilehall.ui.base.adapter.BaseAdapter
import com.seatel.mobilehall.ui.home.model.ValuePackTableModel
import com.seatel.mobilehall.util.Constant
import kotlinx.android.synthetic.main.item_loy_kob_list.view.btnActivation
import kotlinx.android.synthetic.main.item_loy_kob_list.view.btnBenefit
import kotlinx.android.synthetic.main.item_loy_kob_list.view.btnFee
import kotlinx.android.synthetic.main.item_loy_kob_list.view.btnValidity
import kotlinx.android.synthetic.main.item_loy_kob_list.view.btn_click
class LoyKobListAdapter(
private val tableList: List<ValuePackTableModel>,
private var type: String,
private var isData: String,
private var canSubscribe: Boolean,
private val rowClick: (ValuePackTableModel) -> Unit
) : BaseAdapter<LoyKobListAdapter.ViewHolder>() {
class ViewHolder(var itemView: ItemLoyKobListBinding) : RecyclerView.ViewHolder(itemView.root)
override fun onCreateViewHolder(
parent: ViewGroup, viewType: Int
): ViewHolder {
val binding = ItemLoyKobListBinding.inflate(
LayoutInflater.from(parent.context), parent, false
)
return ViewHolder(binding)
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
when (type) {
"Table" -> {
when (isData) {
Constant.LoyKob -> {
holder.itemView.btnFee.text = tableList[position].valuePrice
holder.itemView.btnBenefit.text = tableList[position].benefitOffer
holder.itemView.btnValidity.text = tableList[position].validityDate
holder.itemView.btnActivation.text = tableList[position].activation
}
else -> {
holder.itemView.btnFee.text = tableList[position].valuePrice
holder.itemView.btnBenefit.text = tableList[position].priceChange
holder.itemView.btnValidity.text = tableList[position].validityDate
holder.itemView.btnActivation.text = tableList[position].activation
}
}
holder.itemView.run {
if (canSubscribe) btn_click.visibility =
View.VISIBLE else btn_click.visibility = View.GONE
btn_click.setOnClickListener {
val data = tableList[position]
rowClick.invoke(data)
}
}
}
"Addon" -> {
holder.itemView.run {
var callSmsData = ""
tableList[position].callsmsList.forEach {
callSmsData = it
}
btnFee.text = tableList[position].valuePrice
btnBenefit.text = tableList[position].priceChange + callSmsData
btnActivation.text = tableList[position].activation
if (tableList[position].activateBtn) btn_click.visibility =
View.VISIBLE else btn_click.visibility = View.GONE
btn_click.setOnClickListener {
val data = tableList[position]
rowClick.invoke(data)
}
}
}
}
}
override fun getItemCount(): Int {
return tableList.size
}
}
\ No newline at end of file
package com.seatel.mobilehall.ui.packages.adapter
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.seatel.mobilehall.R
import com.seatel.mobilehall.databinding.ItemLayoutLoyKobTabBinding
import com.seatel.mobilehall.databinding.ItemLayoutLoyKobTitleBinding
import com.seatel.mobilehall.ui.base.adapter.BaseAdapter
import com.seatel.mobilehall.ui.home.activity.ConfirmBuyDataPackActivity
import com.seatel.mobilehall.ui.home.adapter.TermAndServiceFooter2Adapter
import com.seatel.mobilehall.ui.home.model.ValuePackSectionModel
import com.seatel.mobilehall.util.Constant
import kotlinx.android.synthetic.main.item_layout_loy_kob_tab.view.baseValidity
import kotlinx.android.synthetic.main.item_layout_loy_kob_tab.view.btn_addon
import kotlinx.android.synthetic.main.item_layout_loy_kob_tab.view.btn_data
import kotlinx.android.synthetic.main.item_layout_loy_kob_tab.view.btn_package
import kotlinx.android.synthetic.main.item_layout_loy_kob_tab.view.btn_plan
import kotlinx.android.synthetic.main.item_layout_loy_kob_tab.view.container_benefit
import kotlinx.android.synthetic.main.item_layout_loy_kob_tab.view.recyclerItemLoyKob
import kotlinx.android.synthetic.main.item_layout_loy_kob_tab.view.recyclerItemLoyKobAddon
import kotlinx.android.synthetic.main.item_layout_loy_kob_tab.view.recyclerTermCondition
import kotlinx.android.synthetic.main.item_layout_loy_kob_title.view.loyKobDescription
import kotlinx.android.synthetic.main.item_layout_loy_kob_title.view.loyKobTitle
class LoyKobsAdapter(
private var mContext: Context,
private var type: String,
private var canSubscribe: Boolean,
private var appProductsDetail: ValuePackSectionModel
) : BaseAdapter<RecyclerView.ViewHolder>() {
companion object {
private const val HEADER_TITLE = 0
private const val HEADER_TAB = 1
}
private var selectedButton = 1
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
return when (viewType) {
HEADER_TITLE -> {
val binding = ItemLayoutLoyKobTitleBinding.inflate(
LayoutInflater.from(parent.context), parent, false
)
HeaderTitleHolder(binding)
}
else -> {
val binding = ItemLayoutLoyKobTabBinding.inflate(
LayoutInflater.from(parent.context), parent, false
)
HeaderTabHolder(binding)
}
/*else -> {
val binding = ItemLayoutLoyKobDataBinding.inflate(
LayoutInflater.from(parent.context), parent, false
)
DataHolder(binding)
}*/
}
}
override fun getItemCount(): Int {
return 2
}
override fun getItemViewType(position: Int): Int {
return position
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
when (holder.itemViewType) {
HEADER_TITLE -> {
holder.itemView.loyKobTitle.text = appProductsDetail.valuePackSecTwoModel.title
holder.itemView.loyKobDescription.text =
appProductsDetail.valuePackSecTwoModel.subTitle
}
HEADER_TAB -> {
when (type) {
Constant.LoyKob -> {
holder.itemView.btn_data.text = "Benefit offer"
}
else -> holder.itemView.btn_data.text = "Data"
}
updateTabLayout(holder)
holder.itemView.btn_plan.setOnClickListener {
selectedButton = 1
updateTabLayout(holder)
holder.itemView.container_benefit.visibility = View.VISIBLE
holder.itemView.recyclerTermCondition.visibility = View.GONE
}
holder.itemView.btn_package.setOnClickListener {
selectedButton = 2
updateTabLayout(holder)
holder.itemView.container_benefit.visibility = View.GONE
holder.itemView.recyclerTermCondition.visibility = View.VISIBLE
holder.itemView.recyclerTermCondition.adapter = TermAndServiceFooter2Adapter(
mContext, appProductsDetail, true
)
}
holder.itemView.recyclerItemLoyKob.adapter = LoyKobListAdapter(
appProductsDetail.valuePackSecTwoModel.table, "Table", type, canSubscribe
) {
ConfirmBuyDataPackActivity.launch(
mContext,
appProductsDetail.name,
appProductsDetail.type,
it.validityDate,
it.valuePrice,
it.priceChange,
it.code,
false
)
}
holder.itemView.recyclerItemLoyKobAddon.adapter = LoyKobListAdapter(
appProductsDetail.valuePackSecTwoModel.addon, "Addon", type, canSubscribe
) {
ConfirmBuyDataPackActivity.launch(
mContext,
appProductsDetail.name,
appProductsDetail.type,
it.validityDate,
it.valuePrice,
it.priceChange,
it.code,
true
)
}
if (appProductsDetail.valuePackSecTwoModel.addon.size > 0) {
holder.itemView.btn_addon.visibility = View.VISIBLE
if (type == Constant.LoyKob) {
holder.itemView.baseValidity.text =
appProductsDetail.valuePackSecTwoModel.addon[0].validityDate
}
}
}
}
}
class HeaderTitleHolder(var itemView: ItemLayoutLoyKobTitleBinding) :
RecyclerView.ViewHolder(itemView.root)
class HeaderTabHolder(var itemView: ItemLayoutLoyKobTabBinding) :
RecyclerView.ViewHolder(itemView.root)
/* class DataHolder(var itemView: ItemLayoutLoyKobDataBinding) :
RecyclerView.ViewHolder(itemView.root)*/
private fun updateTabLayout(holder: RecyclerView.ViewHolder) {
val defaultColor = ContextCompat.getColor(mContext, R.color.white)
val selectedColor = ContextCompat.getDrawable(mContext, R.drawable.bg_button_round_service)
holder.itemView.btn_plan.setBackgroundColor(defaultColor)
holder.itemView.btn_plan.setTextColor(
ContextCompat.getColor(
mContext, R.color.black
)
)
holder.itemView.btn_package.setBackgroundColor(defaultColor)
holder.itemView.btn_package.setTextColor(
ContextCompat.getColor(
mContext, R.color.black
)
)
when (selectedButton) {
1 -> {
holder.itemView.btn_plan.setBackgroundDrawable(selectedColor)
holder.itemView.btn_plan.setTextColor(
ContextCompat.getColor(
mContext, R.color.white
)
)
}
2 -> {
holder.itemView.btn_package.setBackgroundDrawable(selectedColor)
holder.itemView.btn_package.setTextColor(
ContextCompat.getColor(
mContext, R.color.white
)
)
}
}
}
}
\ No newline at end of file
...@@ -13,11 +13,12 @@ import com.bumptech.glide.Glide ...@@ -13,11 +13,12 @@ import com.bumptech.glide.Glide
import com.seatel.mobilehall.R import com.seatel.mobilehall.R
import com.seatel.mobilehall.ui.base.adapter.BaseAdapter import com.seatel.mobilehall.ui.base.adapter.BaseAdapter
import com.seatel.mobilehall.ui.home.model.AppProductsResponseModel import com.seatel.mobilehall.ui.home.model.AppProductsResponseModel
import kotlinx.android.synthetic.main.item_package_product_service.view.frame_parent
class ProductServicePackageAdapter( class ProductServicePackageAdapter(
private var mContext: Context, private var mContext: Context,
private var productsList: ArrayList<AppProductsResponseModel>, private var productsList: ArrayList<AppProductsResponseModel>,
private var rowClick: (index: AppProductsResponseModel) -> Unit, private var rowClick: (index: AppProductsResponseModel) -> Unit
) : BaseAdapter<ProductServicePackageAdapter.ProductServiceViewHolder>() { ) : BaseAdapter<ProductServicePackageAdapter.ProductServiceViewHolder>() {
private var selectedItemPosition: Int = 0 private var selectedItemPosition: Int = 0
...@@ -42,7 +43,7 @@ class ProductServicePackageAdapter( ...@@ -42,7 +43,7 @@ class ProductServicePackageAdapter(
val serviceModel = productsList[position] val serviceModel = productsList[position]
holder.mTitle.text = serviceModel.name holder.mTitle.text = serviceModel.name
Glide.with(mContext).load(serviceModel.icon).into(holder.mIcon) Glide.with(mContext).load(serviceModel.icon).into(holder.mIcon)
holder.itemView.setOnClickListener { holder.itemView.frame_parent.setOnClickListener {
serviceModel.let(rowClick) serviceModel.let(rowClick)
selectedItemPosition = holder.adapterPosition selectedItemPosition = holder.adapterPosition
notifyDataSetChanged() notifyDataSetChanged()
......
package com.seatel.mobilehall.ui.packages.adapter
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import coil.load
import com.seatel.mobilehall.databinding.LayoutRikReayBinding
import com.seatel.mobilehall.ui.base.adapter.BaseAdapter
import com.seatel.mobilehall.ui.packages.model.RikReayModel
import kotlinx.android.synthetic.main.layout_rik_reay.view.iv_header_banner
import kotlinx.android.synthetic.main.layout_rik_reay.view.iv_sub_header
import kotlinx.android.synthetic.main.layout_rik_reay.view.last_sub_title
import kotlinx.android.synthetic.main.layout_rik_reay.view.last_title
import kotlinx.android.synthetic.main.layout_rik_reay.view.mRecyclerTable
import kotlinx.android.synthetic.main.layout_rik_reay.view.mWebView
import kotlinx.android.synthetic.main.layout_rik_reay.view.tv_content_title
import kotlinx.android.synthetic.main.layout_rik_reay.view.tv_header_description
import kotlinx.android.synthetic.main.layout_rik_reay.view.tv_header_subTitle
import kotlinx.android.synthetic.main.layout_rik_reay.view.tv_header_title
import kotlinx.android.synthetic.main.layout_rik_reay.view.tv_sub_header_subTitle
import kotlinx.android.synthetic.main.layout_rik_reay.view.tv_table_title
class RikReayAdapter(private var rikReayModel: RikReayModel) :
BaseAdapter<RikReayAdapter.ViewHolder>() {
class ViewHolder(var itemView: LayoutRikReayBinding) : RecyclerView.ViewHolder(itemView.root)
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RikReayAdapter.ViewHolder {
val binding = LayoutRikReayBinding.inflate(
LayoutInflater.from(parent.context), parent, false
)
return ViewHolder(binding)
}
override fun onBindViewHolder(holder: RikReayAdapter.ViewHolder, position: Int) {
holder.itemView.run {
iv_header_banner.load(rikReayModel.backgroundImg) {
crossfade(true)
}
tv_header_title.text = rikReayModel.mainTitle
tv_header_subTitle.text = rikReayModel.mainContent[0].title
tv_header_description.settings.javaScriptEnabled = true
tv_header_description.loadDataWithBaseURL(
null, rikReayModel.mainContent[0].content, "text/html", "UTF-8", null
)
tv_header_description.settings.defaultFontSize = 12
iv_sub_header.load(rikReayModel.mainContent[1].imgurl) {
crossfade(true)
}
tv_sub_header_subTitle.settings.javaScriptEnabled = true
tv_sub_header_subTitle.loadDataWithBaseURL(
null, rikReayModel.mainContent[1].content, "text/html", "UTF-8", null
)
tv_sub_header_subTitle.settings.defaultFontSize = 12
tv_content_title.text = rikReayModel.mainContent[2].title
val htmString = rikReayModel.mainContent[2].content
mWebView.settings.javaScriptEnabled = true
mWebView.loadDataWithBaseURL(null, htmString, "text/html", "UTF-8", null)
mWebView.settings.defaultFontSize = 12
tv_table_title.text = rikReayModel.mainContent[2].tableTitle
mRecyclerTable.adapter = RikReakDetailAdapter(context, rikReayModel)
last_title.text = rikReayModel.mainContent[3].title
last_sub_title.settings.javaScriptEnabled = true
last_sub_title.loadDataWithBaseURL(
null, rikReayModel.mainContent[3].content, "text/html", "UTF-8", null
)
last_sub_title.settings.defaultFontSize = 12
}
}
override fun getItemCount(): Int {
return 1
}
override fun getItemViewType(position: Int): Int {
return position
}
}
\ No newline at end of file
...@@ -53,6 +53,7 @@ import com.seatel.mobilehall.util.SeatelUtils ...@@ -53,6 +53,7 @@ import com.seatel.mobilehall.util.SeatelUtils
import com.seatel.mobilehall.util.customview.ErrorHandleView import com.seatel.mobilehall.util.customview.ErrorHandleView
import com.seatel.mobilehall.util.lang.LanguageManager import com.seatel.mobilehall.util.lang.LanguageManager
import kotlinx.android.synthetic.main.activity_product_service_detail.addon_frame import kotlinx.android.synthetic.main.activity_product_service_detail.addon_frame
import kotlinx.android.synthetic.main.activity_product_service_detail.base_validity
import kotlinx.android.synthetic.main.activity_product_service_detail.btn_benefit import kotlinx.android.synthetic.main.activity_product_service_detail.btn_benefit
import kotlinx.android.synthetic.main.activity_product_service_detail.btn_data_header import kotlinx.android.synthetic.main.activity_product_service_detail.btn_data_header
import kotlinx.android.synthetic.main.activity_product_service_detail.btn_term_condition import kotlinx.android.synthetic.main.activity_product_service_detail.btn_term_condition
...@@ -1719,6 +1720,8 @@ class PackageFragment : BaseFragment(), AppProductsInteractor.View, ...@@ -1719,6 +1720,8 @@ class PackageFragment : BaseFragment(), AppProductsInteractor.View,
adapter = when (valuePackSectionModel.type) { adapter = when (valuePackSectionModel.type) {
"loy-kobs" -> { "loy-kobs" -> {
base_validity.text = valuePackSectionModel.valuePackSecTwoModel.addon[0].validityDate
layoutManager = layoutManager =
LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false) LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
LoyKobAddOnAdapter( LoyKobAddOnAdapter(
......
...@@ -25,6 +25,7 @@ import com.seatel.mobilehall.ui.home.presenter.AppProductsPresenter ...@@ -25,6 +25,7 @@ import com.seatel.mobilehall.ui.home.presenter.AppProductsPresenter
import com.seatel.mobilehall.util.SeatelUtils import com.seatel.mobilehall.util.SeatelUtils
import com.google.gson.Gson import com.google.gson.Gson
import com.seatel.mobilehall.ui.home.activity.LoyKobActivity import com.seatel.mobilehall.ui.home.activity.LoyKobActivity
import com.seatel.mobilehall.util.Constant
import com.seatel.mobilehall.util.customview.ErrorHandleView import com.seatel.mobilehall.util.customview.ErrorHandleView
import kotlinx.android.synthetic.main.activity_get_more_data.* import kotlinx.android.synthetic.main.activity_get_more_data.*
...@@ -39,7 +40,6 @@ class GetMoreDataActivity : BaseActivity(), AppProductsInteractor.View { ...@@ -39,7 +40,6 @@ class GetMoreDataActivity : BaseActivity(), AppProductsInteractor.View {
var canSubscribe: Boolean = false var canSubscribe: Boolean = false
override fun onGetAppProductsSucceed(appProductsList: ArrayList<AppProductsResponseModel>) { override fun onGetAppProductsSucceed(appProductsList: ArrayList<AppProductsResponseModel>) {
Log.d("---appProductsList", "onGetAppProductsSucceed: ${Gson().toJson(appProductsList)}")
if (appProductsList.size == 0) { if (appProductsList.size == 0) {
isOnlyDisplay = true isOnlyDisplay = true
productService.add( productService.add(
...@@ -65,10 +65,12 @@ class GetMoreDataActivity : BaseActivity(), AppProductsInteractor.View { ...@@ -65,10 +65,12 @@ class GetMoreDataActivity : BaseActivity(), AppProductsInteractor.View {
error_view.errorMessage = getString(R.string.connection_timeout) error_view.errorMessage = getString(R.string.connection_timeout)
error_view.setViewMode(ErrorHandleView.Mode.TIME_OUT) error_view.setViewMode(ErrorHandleView.Mode.TIME_OUT)
} }
is NoConnectionError -> { is NoConnectionError -> {
error_view.errorMessage = getString(R.string.message_no_internet) error_view.errorMessage = getString(R.string.message_no_internet)
error_view.setViewMode(ErrorHandleView.Mode.NO_INTERNET) error_view.setViewMode(ErrorHandleView.Mode.NO_INTERNET)
} }
else -> { else -> {
error_view.errorMessage = getString(R.string.no_data) error_view.errorMessage = getString(R.string.no_data)
error_view.setViewMode(ErrorHandleView.Mode.NO_DATA) error_view.setViewMode(ErrorHandleView.Mode.NO_DATA)
...@@ -89,24 +91,28 @@ class GetMoreDataActivity : BaseActivity(), AppProductsInteractor.View { ...@@ -89,24 +91,28 @@ class GetMoreDataActivity : BaseActivity(), AppProductsInteractor.View {
"one-plan" -> { "one-plan" -> {
OnePlanDetailActivity.lunch(this) OnePlanDetailActivity.lunch(this)
} }
"free-internet-promotion" -> { "free-internet-promotion" -> {
/* FreePromotionDetailActivity.lunch( /* FreePromotionDetailActivity.lunch(
this, this,
getString(R.string.free_internet_promotion) getString(R.string.free_internet_promotion)
)*/ )*/
} }
"international-call" -> { "international-call" -> {
error_view.setViewMode(ErrorHandleView.Mode.LOADING) error_view.setViewMode(ErrorHandleView.Mode.LOADING)
InternationalCallDetailActivity.lunch(this) InternationalCallDetailActivity.lunch(this)
} }
"loy-kobs" -> LoyKobActivity.launch(this, it.canSubscribe!!, it.code!!)
else -> { "loy-kobs" -> LoyKobActivity.launch(
ProductServiceDetailActivity.launch(
this, this,
it.canSubscribe!!, it.canSubscribe!!,
it.code!!,it.name!! it.code!!,
Constant.LoyKob
) )
else -> {
LoyKobActivity.launch(this, it.canSubscribe!!, it.code!!, "Any")
} }
} }
......
...@@ -14,7 +14,6 @@ import com.android.volley.TimeoutError ...@@ -14,7 +14,6 @@ import com.android.volley.TimeoutError
import com.android.volley.VolleyError import com.android.volley.VolleyError
import com.seatel.mobilehall.R import com.seatel.mobilehall.R
import com.seatel.mobilehall.data.network.SeatelSuperRequest import com.seatel.mobilehall.data.network.SeatelSuperRequest
import com.seatel.mobilehall.data.prefs.SeatelSharePreferences
import com.seatel.mobilehall.databinding.FragmentInternetBinding import com.seatel.mobilehall.databinding.FragmentInternetBinding
import com.seatel.mobilehall.ui.base.fragment.BaseFragment import com.seatel.mobilehall.ui.base.fragment.BaseFragment
import com.seatel.mobilehall.ui.login.activity.LoginActivity import com.seatel.mobilehall.ui.login.activity.LoginActivity
...@@ -27,11 +26,12 @@ import com.seatel.mobilehall.util.Constant ...@@ -27,11 +26,12 @@ import com.seatel.mobilehall.util.Constant
import com.seatel.mobilehall.util.SeatelUtils import com.seatel.mobilehall.util.SeatelUtils
import com.seatel.mobilehall.util.customview.ErrorHandleView import com.seatel.mobilehall.util.customview.ErrorHandleView
import com.seatel.mobilehall.util.viewFragmentBinding import com.seatel.mobilehall.util.viewFragmentBinding
import kotlinx.android.synthetic.main.fragment_internet.* import kotlinx.android.synthetic.main.fragment_internet.ctv_min
import kotlinx.android.synthetic.main.fragment_voice.ctv_filter_from import kotlinx.android.synthetic.main.fragment_voice.ctv_filter_from
import kotlinx.android.synthetic.main.fragment_voice.ctv_filter_to import kotlinx.android.synthetic.main.fragment_voice.ctv_filter_to
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.Calendar
import java.util.Locale
class InternetFragment : BaseFragment(), BilingDetailListInteractor.View, View.OnClickListener { class InternetFragment : BaseFragment(), BilingDetailListInteractor.View, View.OnClickListener {
......
package com.seatel.mobilehall.ui.usage package com.seatel.mobilehall.ui.usage.fragement
import android.content.Context import android.content.Context
import android.os.Build import android.os.Build
...@@ -9,14 +9,9 @@ import android.view.ViewGroup ...@@ -9,14 +9,9 @@ import android.view.ViewGroup
import androidx.annotation.RequiresApi import androidx.annotation.RequiresApi
import androidx.viewpager.widget.ViewPager import androidx.viewpager.widget.ViewPager
import com.seatel.mobilehall.R import com.seatel.mobilehall.R
import com.seatel.mobilehall.data.prefs.SeatelSharePreferences
import com.seatel.mobilehall.databinding.FragmentUsageBinding import com.seatel.mobilehall.databinding.FragmentUsageBinding
import com.seatel.mobilehall.ui.base.fragment.BaseFragment import com.seatel.mobilehall.ui.base.fragment.BaseFragment
import com.seatel.mobilehall.ui.main.MainActivity
import com.seatel.mobilehall.ui.usage.adapter.UsageAdapter import com.seatel.mobilehall.ui.usage.adapter.UsageAdapter
import com.seatel.mobilehall.ui.usage.fragement.InternetFragment
import com.seatel.mobilehall.ui.usage.fragement.SMSFragment
import com.seatel.mobilehall.ui.usage.fragement.VoiceFragment
import com.seatel.mobilehall.util.viewFragmentBinding import com.seatel.mobilehall.util.viewFragmentBinding
import kotlinx.android.synthetic.main.fragment_usage.* import kotlinx.android.synthetic.main.fragment_usage.*
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
......
...@@ -101,7 +101,7 @@ class BilingDetailListPresenter( ...@@ -101,7 +101,7 @@ class BilingDetailListPresenter(
if (data.optJSONObject(i).has("duration")) if (data.optJSONObject(i).has("duration"))
notificationModel.duration = data.optJSONObject(i).optDouble("duration", 0.0) notificationModel.duration = data.optJSONObject(i).optDouble("duration", 0.0)
if (data.optJSONObject(i).has("cost")) if (data.optJSONObject(i).has("cost"))
notificationModel.cost = data.optJSONObject(i).optDouble("cost", 0.0) notificationModel.cost = data.optJSONObject(i).optDouble("cost")
if (data.optJSONObject(i).has("used")) if (data.optJSONObject(i).has("used"))
notificationModel.used = data.optJSONObject(i).optDouble("used", 0.0) notificationModel.used = data.optJSONObject(i).optDouble("used", 0.0)
......
...@@ -260,6 +260,15 @@ object Constant { ...@@ -260,6 +260,15 @@ object Constant {
const val INTERNET = "internet" const val INTERNET = "internet"
const val SMS = "sms" const val SMS = "sms"
/**
* Plans & packages
*/
const val LoyKob = "loy-kobs"
const val RikReay = "rik-reay"
const val OnePlan = "one-plan"
const val InternationalCall = "international-call"
/** /**
* MySubscription * MySubscription
*/ */
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/colorPrimary" />
<corners
android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white" />
<stroke
android:width="3dp"
android:color="@color/button_behind" />
</shape>
\ No newline at end of file
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:text="@string/buy_data_pack"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="@dimen/large_text_size" /> android:textSize="@dimen/large_text_size" />
...@@ -45,7 +44,6 @@ ...@@ -45,7 +44,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:text="$5.00"
android:textAlignment="center" android:textAlignment="center"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="@dimen/xxx_large_text_size" /> android:textSize="@dimen/xxx_large_text_size" />
...@@ -77,7 +75,6 @@ ...@@ -77,7 +75,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:text="018 902 0709"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="@dimen/xxx_large_text_size" /> android:textSize="@dimen/xxx_large_text_size" />
...@@ -89,7 +86,6 @@ ...@@ -89,7 +86,6 @@
android:layout_marginStart="25dp" android:layout_marginStart="25dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:layout_marginEnd="25dp" android:layout_marginEnd="25dp"
android:text="We'll deduct $10 USD from your main balance"
android:textAlignment="center" android:textAlignment="center"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="@dimen/large_text_size" /> android:textSize="@dimen/large_text_size" />
......
This diff is collapsed.
...@@ -223,6 +223,18 @@ ...@@ -223,6 +223,18 @@
android:nestedScrollingEnabled="false" android:nestedScrollingEnabled="false"
android:paddingBottom="@dimen/margin_1x_size" /> android:paddingBottom="@dimen/margin_1x_size" />
<com.seatel.mobilehall.util.customview.CustomTextView
android:id="@+id/base_validity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/mRecyclerAddOn"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:textStyle="bold"
/>
</RelativeLayout> </RelativeLayout>
......
...@@ -374,13 +374,13 @@ ...@@ -374,13 +374,13 @@
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="2" android:layout_weight="2"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/view_balance_total" app:layout_constraintStart_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
<RelativeLayout <RelativeLayout
...@@ -423,6 +423,19 @@ ...@@ -423,6 +423,19 @@
</RelativeLayout> </RelativeLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_alignParentEnd="true"
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:background="@drawable/bg_button_primary"
android:padding="5dp"
android:text="Click Here"
android:textColor="@color/white"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
...@@ -469,23 +482,61 @@ ...@@ -469,23 +482,61 @@
app:layout_constraintBottom_toBottomOf="@+id/view2" app:layout_constraintBottom_toBottomOf="@+id/view2"
app:layout_constraintStart_toEndOf="@+id/view2" /> app:layout_constraintStart_toEndOf="@+id/view2" />
<RelativeLayout
android:id="@+id/frame_topup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view2">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="10dp"
app:cardBackgroundColor="@color/colorPrimary"
app:cardCornerRadius="10dp"
app:cardPreventCornerOverlap="true"
app:cardUseCompatPadding="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_alignParentEnd="true"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:background="@drawable/bg_box_white_stroke_primary"
android:padding="5dp"
android:text="Click Here"
android:textColor="@color/colorPrimary"
android:textSize="10sp" />
<ImageView <ImageView
android:id="@+id/imageBuyTopup" android:id="@+id/imageBuyTopup"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="100dp" android:layout_height="100dp"
android:padding="3dp"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:tag="BUYTOPUPCARD" android:tag="BUYTOPUPCARD" />
app:layout_constraintEnd_toEndOf="parent" </RelativeLayout>
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view2" />
</androidx.cardview.widget.CardView>
</RelativeLayout>
<FrameLayout <FrameLayout
android:id="@+id/frame_video_view" android:id="@+id/frame_video_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="@dimen/margin_1x_size" android:padding="@dimen/margin_1x_size"
app:layout_constraintTop_toBottomOf="@+id/imageBuyTopup"> app:layout_constraintTop_toBottomOf="@+id/frame_topup">
<com.google.android.exoplayer2.ui.PlayerView <com.google.android.exoplayer2.ui.PlayerView
...@@ -530,15 +581,51 @@ ...@@ -530,15 +581,51 @@
app:layout_constraintBottom_toBottomOf="@+id/view4" app:layout_constraintBottom_toBottomOf="@+id/view4"
app:layout_constraintStart_toEndOf="@+id/view4" /> app:layout_constraintStart_toEndOf="@+id/view4" />
<RelativeLayout
android:id="@+id/frame_buyNumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view4">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="10dp"
app:cardBackgroundColor="@color/colorPrimary"
app:cardCornerRadius="10dp"
app:cardPreventCornerOverlap="true"
app:cardUseCompatPadding="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_alignParentEnd="true"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:background="@drawable/bg_box_white_stroke_primary"
android:padding="5dp"
android:text="Click Here"
android:textColor="@color/colorPrimary"
android:textSize="10sp" />
<ImageView <ImageView
android:id="@+id/image_buy_number" android:id="@+id/image_buy_number"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="100dp" android:layout_height="100dp"
android:padding="3dp" android:padding="3dp"
android:tag="BUYYESNUMBER" android:tag="BUYYESNUMBER"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintTop_toBottomOf="@+id/view4" /> </RelativeLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".ui.packages.fragment.PackageFragment"> >
<androidx.appcompat.widget.Toolbar <androidx.appcompat.widget.Toolbar
android:id="@+id/mToolbar" android:id="@+id/mToolbar"
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/mToolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimaryDark"
app:layout_constraintTop_toTopOf="parent">
<com.seatel.mobilehall.util.customview.CustomTextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/product_and_service"
android:textColor="@color/white"
android:textSize="@dimen/large_text_size"
android:textStyle="bold" />
</androidx.appcompat.widget.Toolbar>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimaryDark"
android:padding="10dp"
app:layout_constraintTop_toBottomOf="@+id/mToolbar">
<com.seatel.mobilehall.util.customview.CustomTextView
android:id="@+id/find"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/find"
android:textColor="@color/white"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.seatel.mobilehall.util.customview.CustomTextView
android:id="@+id/the_best"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/one_for_you"
android:textColor="@color/white"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/find" />
<com.seatel.mobilehall.util.customview.CustomTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/yes_you_ll_love_it"
android:textColor="@color/white"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/the_best" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/mTabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_button_service"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/layout_header">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:orientation="horizontal"
android:padding="@dimen/margin_1x_size">
<Button
android:id="@+id/btn_plan"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Price Plans"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="12sp" />
<Button
android:id="@+id/btn_package"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Packages"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/mRecyclerCategory"
android:layout_width="70dp"
android:layout_height="0dp"
android:background="@color/colorBgWhiteGray"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/mTabLayout" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/mRecyclerDetail"
android:layout_width="0dp"
android:layout_height="0dp"
android:nestedScrollingEnabled="false"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@+id/button_switch_plan"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/mRecyclerCategory"
app:layout_constraintTop_toBottomOf="@+id/mTabLayout"
app:layout_constraintVertical_bias="0.519" />
<Button
android:id="@+id/button_switch_plan"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginStart="70dp"
android:background="@color/colorPrimary"
android:text="Switch to this plan"
android:textColor="@color/white"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -24,9 +21,7 @@ ...@@ -24,9 +21,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@+id/img_international_call_detail" android:layout_below="@+id/img_international_call_detail"
android:layout_marginStart="20dp"
android:layout_marginTop="@dimen/top_padding" android:layout_marginTop="@dimen/top_padding"
android:layout_marginEnd="20dp"
android:layout_marginBottom="30dp" android:layout_marginBottom="30dp"
android:orientation="vertical"> android:orientation="vertical">
...@@ -126,7 +121,7 @@ ...@@ -126,7 +121,7 @@
</RelativeLayout> </RelativeLayout>
</ScrollView>
<com.seatel.mobilehall.util.customview.ErrorHandleView <com.seatel.mobilehall.util.customview.ErrorHandleView
android:id="@+id/error_view" android:id="@+id/error_view"
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
<LinearLayout
android:id="@+id/mTabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_button_service"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:orientation="horizontal"
android:padding="@dimen/margin_1x_size">
<Button
android:id="@+id/btn_plan"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Benefits"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="12sp" />
<Button
android:id="@+id/btn_package"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Terms &amp; Conditions"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerTermCondition"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintTop_toBottomOf="@+id/mTabLayout" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/container_benefit"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintTop_toBottomOf="@+id/mTabLayout">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/tabHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="@color/button_behind"
android:orientation="horizontal"
android:padding="3dp"
app:layout_constraintTop_toTopOf="parent">
<com.seatel.mobilehall.util.customview.CustomButton
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="3dp"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:orientation="vertical"
android:text="Fee"
android:textColor="@color/white"
android:textSize="12sp"
android:textStyle="bold">
</com.seatel.mobilehall.util.customview.CustomButton>
<com.seatel.mobilehall.util.customview.CustomButton
android:id="@+id/btn_data"
android:layout_width="400dp"
android:layout_height="match_parent"
android:layout_marginEnd="3dp"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:orientation="vertical"
android:text="Benefit offer"
android:textColor="@color/white"
android:textSize="12sp"
android:textStyle="bold">
</com.seatel.mobilehall.util.customview.CustomButton>
<com.seatel.mobilehall.util.customview.CustomButton
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="3dp"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:orientation="vertical"
android:text="Validity"
android:textColor="@color/white"
android:textSize="12sp"
android:textStyle="bold">
</com.seatel.mobilehall.util.customview.CustomButton>
<com.seatel.mobilehall.util.customview.CustomButton
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:orientation="vertical"
android:text="Activation"
android:textColor="@color/white"
android:textSize="12sp"
android:textStyle="bold">
</com.seatel.mobilehall.util.customview.CustomButton>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerItemLoyKob"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:nestedScrollingEnabled="true"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintTop_toBottomOf="@+id/tabHeader" />
<com.seatel.mobilehall.util.customview.CustomButton
android:id="@+id/btn_addon"
android:layout_width="200dp"
android:layout_height="40sp"
android:layout_marginTop="5dp"
android:background="@drawable/bg_button_round_service"
android:gravity="center"
android:padding="10dp"
android:text="Add-on Package"
android:textAllCaps="false"
android:textColor="@color/white"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/recyclerItemLoyKob" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerItemLoyKobAddon"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:nestedScrollingEnabled="true"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintTop_toBottomOf="@+id/btn_addon" />
<com.seatel.mobilehall.util.customview.CustomTextView
android:id="@+id/baseValidity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="10dp"
android:textColor="@color/colorPrimary"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/recyclerItemLoyKobAddon" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/loyKobTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Hello World"
android:textColor="@color/colorPink"
android:textSize="25sp"
android:textStyle="bold" />
<TextView
android:id="@+id/loyKobDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="5dp"
android:text="Hello World" />
</LinearLayout>
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:id="@+id/ln_table"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?actionBarSize" android:layout_height="?actionBarSize"
android:background="#5BE91E63" android:background="#5BE91E63"
...@@ -51,8 +52,8 @@ ...@@ -51,8 +52,8 @@
android:layout_weight="1" android:layout_weight="1"
android:background="@color/white" android:background="@color/white"
android:gravity="center" android:gravity="center"
android:visibility="gone" android:orientation="vertical"
android:orientation="vertical"> android:visibility="gone">
<com.seatel.mobilehall.util.customview.CustomButton <com.seatel.mobilehall.util.customview.CustomButton
android:id="@+id/btn_call_min" android:id="@+id/btn_call_min"
...@@ -135,4 +136,5 @@ ...@@ -135,4 +136,5 @@
</LinearLayout> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/button_behind"
android:orientation="horizontal"
android:padding="2dp"
app:layout_constraintTop_toTopOf="parent">
<com.seatel.mobilehall.util.customview.CustomButton
android:id="@+id/btnFee"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical"
android:textColor="@color/colorPrimary"
android:textSize="10sp"
android:textStyle="bold">
</com.seatel.mobilehall.util.customview.CustomButton>
<com.seatel.mobilehall.util.customview.CustomButton
android:id="@+id/btnBenefit"
android:layout_width="400dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical"
android:textColor="@color/colorPrimary"
android:textSize="10sp"
android:textStyle="bold">
</com.seatel.mobilehall.util.customview.CustomButton>
<com.seatel.mobilehall.util.customview.CustomButton
android:id="@+id/btnValidity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical"
android:textColor="@color/colorPrimary"
android:textSize="10sp"
android:textStyle="bold">
</com.seatel.mobilehall.util.customview.CustomButton>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical">
<com.seatel.mobilehall.util.customview.CustomButton
android:id="@+id/btn_click"
android:layout_width="match_parent"
android:layout_height="15dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/bg_button_primary"
android:gravity="center"
android:text="Click"
android:textColor="@color/white"
android:textSize="10sp"
android:textStyle="bold"
android:visibility="gone" />
<com.seatel.mobilehall.util.customview.CustomTextView
android:id="@+id/btnActivation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center"
android:text="hello"
android:textColor="@color/colorPrimary"
android:textSize="10sp"
android:textStyle="bold">
</com.seatel.mobilehall.util.customview.CustomTextView>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -4,9 +4,7 @@ ...@@ -4,9 +4,7 @@
android:id="@+id/frame_parent" android:id="@+id/frame_parent"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground">
android:padding="@dimen/margin_1x_size">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -15,9 +13,10 @@ ...@@ -15,9 +13,10 @@
<ImageView <ImageView
android:id="@+id/ivIcon" android:id="@+id/ivIcon"
android:layout_width="40dp" android:layout_width="50dp"
android:layout_height="40dp" android:layout_height="50dp"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
...@@ -25,7 +24,7 @@ ...@@ -25,7 +24,7 @@
<com.seatel.mobilehall.util.customview.CustomTextView <com.seatel.mobilehall.util.customview.CustomTextView
android:id="@+id/tvTitle" android:id="@+id/tvTitle"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/ivIcon" android:layout_below="@+id/ivIcon"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
......
...@@ -3,24 +3,21 @@ ...@@ -3,24 +3,21 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView <ImageView
android:scaleType="centerCrop"
android:id="@+id/iv_header_banner" android:id="@+id/iv_header_banner"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="200dp" /> android:layout_height="200dp"
android:scaleType="centerCrop" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -181,8 +178,7 @@ ...@@ -181,8 +178,7 @@
<WebView <WebView
android:id="@+id/last_sub_title" android:id="@+id/last_sub_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
/>
</LinearLayout> </LinearLayout>
...@@ -193,6 +189,4 @@ ...@@ -193,6 +189,4 @@
</LinearLayout> </LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
<fragment <fragment
android:id="@+id/navigation_package" android:id="@+id/navigation_package"
android:name="com.seatel.mobilehall.ui.packages.fragment.PackageFragment" android:name="com.seatel.mobilehall.ui.packages.fragment.TestFragment"
android:label="@string/nav_package" android:label="@string/nav_package"
tools:layout="@layout/fragment_package" /> tools:layout="@layout/fragment_package" />
<fragment <fragment
android:id="@+id/navigation_usage" android:id="@+id/navigation_usage"
android:name="com.seatel.mobilehall.ui.usage.UsageFragment" android:name="com.seatel.mobilehall.ui.usage.fragement.UsageFragment"
android:label="@string/nav_usage" android:label="@string/nav_usage"
tools:layout="@layout/fragment_usage" /> tools:layout="@layout/fragment_usage" />
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
<color name="colorValentineTransparent">#66000000</color> <color name="colorValentineTransparent">#66000000</color>
<color name="color_claim_gray">#BFBFBF</color> <color name="color_claim_gray">#BFBFBF</color>
<color name="color_ang_pao_bg">#FBC3E5</color> <color name="color_ang_pao_bg">#FBC3E5</color>
<color name="button_behind">#FACCE8</color>
</resources> </resources>
\ No newline at end of file
...@@ -10,7 +10,7 @@ buildscript { ...@@ -10,7 +10,7 @@ buildscript {
dependencies { dependencies {
classpath "io.realm:realm-gradle-plugin:10.11.1" classpath "io.realm:realm-gradle-plugin:10.11.1"
classpath 'com.google.gms:google-services:4.3.15' classpath 'com.google.gms:google-services:4.3.15'
classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version" // classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment