path
stringlengths
4
297
contentHash
stringlengths
1
10
content
stringlengths
0
13M
callastro/app/src/main/java/com/callastro/viewModels/MyBookingsViewModel.kt
929462568
package com.callastro.viewModels import android.util.Log import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.callastro.data.MainRepository import com.callastro.model.MyBookingsUpcomingCompletedResponse import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch import javax.inject.Inject @HiltViewModel class MyBookingsViewModel @Inject constructor(private val mainRepository: MainRepository) : ViewModel() { val progressBarStatus = MutableLiveData<Boolean>() var upcomingCompletedBookingsResponse = MutableLiveData<MyBookingsUpcomingCompletedResponse>() fun upcomingCompletedBookingsApi( token: String, type:String ) { progressBarStatus.value = true viewModelScope.launch { val response = mainRepository.upcomingCompletedBookingsApi(token, type) if (response.isSuccessful) { progressBarStatus.value = false upcomingCompletedBookingsResponse.postValue(response.body()) } else { progressBarStatus.value = false Log.d("TAG", response.body().toString()) } } } }
callastro/app/src/main/java/com/callastro/viewModels/VideoCallViewModel.kt
1109998884
package com.callastro.viewModels import android.util.Log import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.callastro.data.MainRepository import com.callastro.model.AgoraGenerateTokenResponse import com.callastro.model.BannerResponse import com.callastro.model.CallChatStatusResponse import com.callastro.model.CallRingResponse import com.callastro.model.CallendbyuserResponse import com.callastro.model.CommonResponse import com.callastro.model.GiveReviewResponse import com.callastro.model.GoLiveResponse import com.callastro.model.LiveCommentsModelClass import com.callastro.model.call_ring_status_save_Response import com.maxtra.astrorahiastrologer.util.ApiException import com.maxtra.astrorahiastrologer.util.NoInternetException import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch import java.net.SocketTimeoutException import javax.inject.Inject @HiltViewModel class VideoCallViewModel @Inject constructor(private val mainRepository: MainRepository) : ViewModel(){ val error = MutableLiveData<Int>() val errorString = MutableLiveData<String>() val _progressBarVisibility = MutableLiveData<Boolean>() var call_ring_status_save_Response = MutableLiveData<call_ring_status_save_Response>() val agoraGenerateTokenResponse= MutableLiveData<AgoraGenerateTokenResponse>() val goLiveResponse= MutableLiveData<GoLiveResponse>() val callerendResponse= MutableLiveData<CallendbyuserResponse>() val progressBarStatus = MutableLiveData<Boolean>() val callchatstatusResponse= MutableLiveData<CallChatStatusResponse>() var commonResponse = MutableLiveData<CommonResponse>() val liveCommentsModelClass = MutableLiveData<LiveCommentsModelClass>() val bannerResponse = MutableLiveData<BannerResponse>() val callRingResponse= MutableLiveData<CallRingResponse>() val givereviewResponse = MutableLiveData<GiveReviewResponse>() fun agora_generate_tokenApi( token: String, astro_id: String, call_type: String ) { // _progressBarVisibility.value = true viewModelScope.launch { try { val response = mainRepository.agora_generate_tokenApi(token,astro_id,call_type) if (response.isSuccessful) { _progressBarVisibility.value = false agoraGenerateTokenResponse.postValue(response.body()) } _progressBarVisibility.value = false } catch (e: ApiException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: NoInternetException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: SocketTimeoutException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: Exception) { _progressBarVisibility.value = false e.printStackTrace() } } } fun add_comment( user_id: String, astro_id: String, message: String, type: String, ) { progressBarStatus.value = true viewModelScope.launch { val response = mainRepository.add_comment(user_id, astro_id, message, type) if (response.isSuccessful) { progressBarStatus.value = false commonResponse.postValue(response.body()) } else { progressBarStatus.value = false Log.d("TAG", response.body().toString()) } } } fun request_money( token: String, money: String ) { progressBarStatus.value = true viewModelScope.launch { val response = mainRepository.request_money(token, money) if (response.isSuccessful) { progressBarStatus.value = false commonResponse.postValue(response.body()) } else { progressBarStatus.value = false Log.d("TAG", response.body().toString()) } } } fun get_live_comments( token: String, channel_name: String, ) { progressBarStatus.value = true viewModelScope.launch { val response = mainRepository.get_live_comments( token, channel_name,) if (response.isSuccessful) { progressBarStatus.value = false liveCommentsModelClass.postValue(response.body()) } else { progressBarStatus.value = false Log.d("TAG", response.body().toString()) } } } fun call_end_by_status( token: String, caller_id: String ) { progressBarStatus.value = true viewModelScope.launch { try { val response = mainRepository.call_end_by_status(token, caller_id) if (response.isSuccessful) { progressBarStatus.value = false callerendResponse.postValue(response.body()) } else { progressBarStatus.value = false Log.d("TAG", response.body().toString()) } }catch (e:Exception){ e.printStackTrace() } } } fun call_end(token: String,timer: String,from_user: String,to_user: String,caller_id:String,type: String,fixed_session: String ) { // _progressBarVisibility.value = true viewModelScope.launch { try { val response = mainRepository.call_end(token,timer,from_user,to_user,caller_id,type,fixed_session) if (response.isSuccessful) { _progressBarVisibility.value = false commonResponse.postValue(response.body()) } _progressBarVisibility.value = false } catch (e: ApiException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: NoInternetException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: SocketTimeoutException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: Exception) { _progressBarVisibility.value = false e.printStackTrace() } } } fun live_end(token: String,timer: String,from_user: String,to_user: String,type: String ) { // _progressBarVisibility.value = true viewModelScope.launch { try { val response = mainRepository.live_end(token,timer,from_user,to_user,type) if (response.isSuccessful) { _progressBarVisibility.value = false commonResponse.postValue(response.body()) } _progressBarVisibility.value = false } catch (e: ApiException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: NoInternetException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: SocketTimeoutException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: Exception) { _progressBarVisibility.value = false e.printStackTrace() } } } fun live_agora_generate_token( token: String, topic: String ) { // _progressBarVisibility.value = true viewModelScope.launch { try { val response = mainRepository.live_agora_generate_token(token,topic) if (response.isSuccessful) { _progressBarVisibility.value = false goLiveResponse.postValue(response.body()) } _progressBarVisibility.value = false } catch (e: ApiException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: NoInternetException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: SocketTimeoutException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: Exception) { _progressBarVisibility.value = false e.printStackTrace() } } } fun astro_give_review( token: String, astro_id: String, rating: String, review: String, ) { viewModelScope.launch { val response = mainRepository.astro_give_review(token,astro_id,rating,review) if (response.isSuccessful) { givereviewResponse.postValue(response.body()) } else { Log.d("TAG", response.body().toString()) } } } fun delete_live_astro( token: String, ) { // _progressBarVisibility.value = true viewModelScope.launch { try { val response = mainRepository.delete_live_astro(token) if (response.isSuccessful) { _progressBarVisibility.value = false commonResponse.postValue(response.body()) } _progressBarVisibility.value = false } catch (e: ApiException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: NoInternetException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: SocketTimeoutException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: Exception) { _progressBarVisibility.value = false e.printStackTrace() } } } fun live_agora_topic( token: String, type: String, ) { // _progressBarVisibility.value = true viewModelScope.launch { try { val response = mainRepository.live_agora_topic(token,type) if (response.isSuccessful) { _progressBarVisibility.value = false goLiveResponse.postValue(response.body()) } _progressBarVisibility.value = false } catch (e: ApiException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: NoInternetException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: SocketTimeoutException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: Exception) { _progressBarVisibility.value = false e.printStackTrace() } } } fun astro_home( token: String, ) { // _progressBarVisibility.value = true viewModelScope.launch { try { val response = mainRepository.astro_home(token) if (response.isSuccessful) { _progressBarVisibility.value = false callchatstatusResponse.postValue(response.body()) } _progressBarVisibility.value = false } catch (e: ApiException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: NoInternetException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: SocketTimeoutException) { _progressBarVisibility.value = false errorString.postValue(e.message!!) } catch (e: Exception) { _progressBarVisibility.value = false e.printStackTrace() } } } fun Banner( token: String, ) { progressBarStatus.value = true viewModelScope.launch { try { val response = mainRepository.banner(token) if (response.isSuccessful) { progressBarStatus.value = false bannerResponse.postValue(response.body()) } else { progressBarStatus.value = false Log.d("TAG", response.body().toString()) } } catch (e: Exception) { e.printStackTrace() }catch (e: NoInternetException) { e.printStackTrace() } } } fun checkOnlineStatusModel( token: String, ) { progressBarStatus.value = true viewModelScope.launch { try { val response = mainRepository.checkOnlineStatusRepo(token) if (response.isSuccessful) { progressBarStatus.value = false commonResponse.postValue(response.body()) } else { progressBarStatus.value = false Log.d("TAG", response.body().toString()) } } catch (e: Exception) { e.printStackTrace() }catch (e: NoInternetException) { e.printStackTrace() } } } fun call_ring_status_save( token: String, channel_name: String ) { progressBarStatus.value = true viewModelScope.launch { val response = mainRepository.call_ring_status_save(token, channel_name) if (response.isSuccessful) { progressBarStatus.value = false call_ring_status_save_Response.postValue(response.body()) } else { progressBarStatus.value = false Log.d("TAG", response.body().toString()) } } } fun call_ring_end( token: String, channel_name: String ) { progressBarStatus.value = true viewModelScope.launch { val response = mainRepository.call_ring_end(token, channel_name) if (response.isSuccessful) { progressBarStatus.value = false commonResponse.postValue(response.body()) } else { progressBarStatus.value = false Log.d("TAG", response.body().toString()) } } } fun call_ring( token: String, astro_id: String, user_id: String, request_id: String ) { // progressBarStatus.value = true viewModelScope.launch { val response = mainRepository.call_ring(token, astro_id,user_id,request_id) if (response.isSuccessful) { // progressBarStatus.value = false callRingResponse.postValue(response.body()) } else { // progressBarStatus.value = false Log.d("TAG", response.body().toString()) } } } // fun dummy_audioVideoCallApi( // token:String, user_id: String, booking_id: String, type: String, channelName: String // ) { // _progressBarVisibility.value = true // // viewModelScope.launch { // try { // val response = // mainRepository.dummy_audioVideoCallApi(token, user_id, booking_id, type, channelName ) // if (response.isSuccessful) { // _progressBarVisibility.value = false // audioVideoCallResponse.postValue(response.body()) // } // _progressBarVisibility.value = false // } catch (e: ApiException) { // _progressBarVisibility.value = false // errorString.postValue(e.message!!) // } catch (e: NoInternetException) { // _progressBarVisibility.value = false // errorString.postValue(e.message!!) // } catch (e: SocketTimeoutException) { // _progressBarVisibility.value = false // errorString.postValue(e.message!!) // } catch (e: Exception) { // _progressBarVisibility.value = false // e.printStackTrace() // } // } // } }
callastro/app/src/main/java/com/callastro/MainActivity.kt
891852495
package com.callastro import android.Manifest import android.annotation.SuppressLint import android.app.ActivityManager import android.app.ActivityManager.RunningAppProcessInfo import android.content.Intent import android.content.pm.PackageManager import android.os.Build import android.os.Bundle import android.util.DisplayMetrics import android.view.MenuItem import android.view.View import android.widget.Button import android.widget.ImageView import android.widget.RelativeLayout import android.widget.TextView import android.widget.Toast import androidx.annotation.RequiresApi import androidx.core.app.ActivityCompat import androidx.core.content.ContextCompat import androidx.core.view.GravityCompat import androidx.databinding.DataBindingUtil import com.bumptech.glide.Glide import com.bumptech.glide.request.RequestOptions import com.callastro.databinding.ActivityMainBinding import com.callastro.ui.activities.* import com.callastro.ui.fragments.* import com.google.android.material.bottomnavigation.BottomNavigationView import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.navigation.NavigationView import com.maxtra.callastro.baseClass.BaseActivity import com.maxtra.callastro.prefs.UserPref import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint class MainActivity : BaseActivity(), NavigationView.OnNavigationItemSelectedListener, BottomNavigationView.OnNavigationItemSelectedListener { lateinit var binding: ActivityMainBinding lateinit var profilepic: ImageView lateinit var tvUserName: TextView lateinit var tv_email: TextView lateinit var bottomdialog: BottomSheetDialog var id:String = "" var otp:String = "" var is_new:String = "" var appRunningBackground:Boolean = false private val PERMISSION_REQ_ID = 22 @RequiresApi(Build.VERSION_CODES.KITKAT) override fun onStart() { super.onStart() //binding.bottomNav.menu.clear() setNavigationData() // setNavigationBar() // initializeUsersBnv() } val REQUESTED_PERMISSIONS = arrayOf( Manifest.permission.RECORD_AUDIO, Manifest.permission.CAMERA, Manifest.permission.READ_PHONE_STATE ) private fun checkSelfPermission(): Boolean { return !(ContextCompat.checkSelfPermission( this, REQUESTED_PERMISSIONS[0] ) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission( this, REQUESTED_PERMISSIONS[1] ) != PackageManager.PERMISSION_GRANTED) } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) binding = DataBindingUtil.setContentView(this@MainActivity,R.layout.activity_main) if (intent!=null){ id = intent.getStringExtra("id").toString() otp = intent.getStringExtra("otp").toString() is_new = intent.getStringExtra("is_new").toString() } // val runningAppProcessInfo = RunningAppProcessInfo() // ActivityManager.getMyMemoryState(runningAppProcessInfo) // appRunningBackground = // runningAppProcessInfo.importance != RunningAppProcessInfo.IMPORTANCE_FOREGROUND // if (appRunningBackground) { // Toast.makeText( // applicationContext, // "Your Android Application is Running in " + "Background", // Toast.LENGTH_SHORT // ).show() // } else { // Toast.makeText( // applicationContext, // "Your Android Application is not Running in " + "Foreground", // Toast.LENGTH_SHORT // ).show() // } binding.bottomNavigationView.setOnNavigationItemSelectedListener(this); replaceFragment(HomeFragment()) userPref= UserPref(this) binding.drawerToolbar.ivMenu.setOnClickListener { binding.drawerLayout.openDrawer(GravityCompat.START) } if (!checkSelfPermission()) { ActivityCompat.requestPermissions(this, REQUESTED_PERMISSIONS, PERMISSION_REQ_ID) } binding.drawerToolbar.ivHeaderpic.setOnClickListener { startActivity(Intent(this@MainActivity,ViewProfile::class.java)) } // if (userPref.get_is_new() == "1"){ // dashboardbottomsheet() // toast("1") // } // else if (userPref.get_is_new() == "0"){ // toast("0") // } /* val navView: NavigationView = binding.nvView val header: View = navView.getHeaderView(0) tvUserName =header.findViewById(R.id.tvUserName) profilepic =header.findViewById(R.id.iv_imgUser) tv_email= header.findViewById(R.id.tv_email) Glide.with(this).load(userPref.getProfileImage()) .apply(RequestOptions.placeholderOf(R.drawable.user_image_place_holder)) .apply(RequestOptions.errorOf(R.drawable.user_image_place_holder)) .into(profilepic) */ // Glide.with(this).load(userPref.getProfileImage()).into(profilepic) // Glide.with(this).load(userPref.getProfileImage()) // .apply(RequestOptions.placeholderOf(R.drawable.user_image_place_holder)) // .apply(RequestOptions.errorOf(R.drawable.user_image_place_holder)) // .into(profilepic) /* Glide.with(this).load(userPref.getProfileImage()) .apply(RequestOptions.placeholderOf(R.drawable.user_image_place_holder)) .apply(RequestOptions.errorOf(R.drawable.user_image_place_holder)) .into(profilepic)*/ /* if (!userPref.getProfileImage().isNullOrBlank()) { Glide.with(this).load(Uri.parse(userPref.getProfileImage())) .apply(RequestOptions.placeholderOf(R.drawable.user_image_place_holder)) .apply(RequestOptions.errorOf(R.drawable.user_image_place_holder)) .into(profilepic) }*/ // tv_email.setText(userPref.getEmail()) } // // override fun onStop() { // super.onStop() // Toast.makeText( // applicationContext, // "Your Android Application is Running in " + "Background", // Toast.LENGTH_SHORT // ).show() // } // override fun onDestroy() { // super.onDestroy() // // Toast.makeText( // applicationContext, // "Your Android Application is Running in " + "Background", // Toast.LENGTH_SHORT // ).show() // } @SuppressLint("SetTextI18n") private fun setNavigationData() { val navView: NavigationView = binding.nvView val header: View = navView.getHeaderView(0) tvUserName =header.findViewById(R.id.tvUserName) profilepic =header.findViewById(R.id.iv_imgUser) tv_email= header.findViewById(R.id.tv_email) Glide.with(this).load(userPref.getProfileImage()) .apply(RequestOptions.placeholderOf(R.drawable.user_image_place_holder)) .apply(RequestOptions.errorOf(R.drawable.user_image_place_holder)) .into(profilepic) // binding.header.tvUserName.text = userPref.getSubUserName() // binding.header.tvEmail.text = userPref.getEmail() // // if (!userPref.getUserProfileImage().isNullOrBlank()) { // Glide.with(this).load(Uri.parse(userPref.getUserProfileImage())) // .apply(RequestOptions.placeholderOf(R.drawable.user_image_place_holder)) // .apply(RequestOptions.errorOf(R.drawable.user_image_place_holder)) // .into(binding.header.imgUser) // } if(userPref.getName().equals(null)){ tvUserName.setText("...") } else{tvUserName.setText(userPref.getName())} if(userPref.getEmail().equals(null)){ tv_email.setText("...") } else{tv_email.setText(userPref.getEmail())} var nav_myprofile: RelativeLayout = header.findViewById(R.id.rl_myprofile) var nav_booking: RelativeLayout = header.findViewById(R.id.rl_mybookings) var nav_chatHistory: RelativeLayout = header.findViewById(R.id.rl_chatHistory) var nav_callHistory: RelativeLayout = header.findViewById(R.id.rl_callHistory) var nav_customersupport: RelativeLayout = header.findViewById(R.id.rl_customersupport) var nav_settings: RelativeLayout = header.findViewById(R.id.rl_settings) var nav_faq: RelativeLayout = header.findViewById(R.id.rl_faq) var nav_aboutus: RelativeLayout = header.findViewById(R.id.rl_aboutus) var nav_rateapp: RelativeLayout = header.findViewById(R.id.rl_rateapp) var nav_shareapp: RelativeLayout = header.findViewById(R.id.rl_shareapp) var nav_logout: RelativeLayout = header.findViewById(R.id.rl_logout) nav_aboutus.setOnClickListener { binding.drawerLayout.closeDrawer(GravityCompat.START) var intent = Intent(this,AboutusActivity::class.java) startActivity(intent) } nav_customersupport.setOnClickListener { binding.drawerLayout.closeDrawer(GravityCompat.START) var intent = Intent(this,Customer_Support::class.java) startActivity(intent) } nav_faq.setOnClickListener { val intent = Intent (this, FaqActivity::class.java) startActivity(intent) binding.drawerLayout.closeDrawer(GravityCompat.START); } nav_logout.setOnClickListener { logout() } nav_myprofile.setOnClickListener { val intent = Intent (this, ViewProfile::class.java) startActivity(intent) binding.drawerLayout.closeDrawer(GravityCompat.START); } nav_settings.setOnClickListener { val intent = Intent (this, SettingsActivity::class.java) startActivity(intent) binding.drawerLayout.closeDrawer(GravityCompat.START); } nav_booking.setOnClickListener { val intent = Intent (this, MyBookingsActivity::class.java) startActivity(intent) binding.drawerLayout.closeDrawer(GravityCompat.START); } nav_callHistory.setOnClickListener { val intent = Intent (this, CallHistoryActivity::class.java) startActivity(intent) binding.drawerLayout.closeDrawer(GravityCompat.START); } nav_chatHistory.setOnClickListener { val intent = Intent (this, ChatHistoryActivity::class.java) startActivity(intent) binding.drawerLayout.closeDrawer(GravityCompat.START); } } fun logout() { // on below line we are creating a new bottom sheet dialog. bottomdialog = BottomSheetDialog(this) // on below line we are inflating a layout file which we have created. val view = layoutInflater.inflate(R.layout.logout_bottomsheet, null) val metrics = DisplayMetrics() windowManager?.defaultDisplay?.getMetrics(metrics) bottomdialog.behavior.state = BottomSheetBehavior.STATE_EXPANDED bottomdialog.behavior.peekHeight = metrics.heightPixels var btnLogout = view.findViewById<Button>(R.id.btnLogout) var btnNo = view.findViewById<Button>(R.id.btnNo) btnLogout.setOnClickListener { userPref.clearPref() startActivity(Intent(this, LoginActivity::class.java)) finishAffinity() bottomdialog.dismiss() } btnNo.setOnClickListener { bottomdialog.dismiss() } // below line is use to set cancelable to avoid // closing of dialog box when clicking on the screen. bottomdialog.setCancelable(true) // on below line we are setting // content view to our view. bottomdialog.setContentView(view) // on below line we are calling // a show method to display a dialog. bottomdialog.show() } fun dashboardbottomsheet() { // on below line we are creating a new bottom sheet dialog. bottomdialog = BottomSheetDialog(this,R.style.AppBottomSheetDialogTheme) // on below line we are inflating a layout file which we have created. val view = layoutInflater.inflate(R.layout.fill_bank_bottomsheet, null) val metrics = DisplayMetrics() windowManager?.defaultDisplay?.getMetrics(metrics) bottomdialog.behavior.state = BottomSheetBehavior.STATE_EXPANDED bottomdialog.behavior.peekHeight = metrics.heightPixels var btnOtpSubmit = view.findViewById<TextView>(R.id.btnOtpSubmit) btnOtpSubmit.setOnClickListener { startActivity(Intent(this, FillDetailsActivity::class.java).putExtra( "token",userPref.getToken().toString() )) bottomdialog.dismiss() } // below line is use to set cancelable to avoid // closing of dialog box when clicking on the screen. bottomdialog.setCancelable(false) // on below line we are setting // content view to our view. bottomdialog.setContentView(view) // on below line we are calling // a show method to display a dialog. bottomdialog.show() } override fun onNavigationItemSelected(item: MenuItem): Boolean { when (item.itemId) { R.id.navigation_home -> { supportFragmentManager.beginTransaction().replace(R.id.flContent, HomeFragment()) .commit() return true } R.id.navigation_chat -> { supportFragmentManager.beginTransaction().replace(R.id.flContent, ChatFragment()) .commit() return true } R.id.navigation_call -> { supportFragmentManager.beginTransaction().replace(R.id.flContent, CallFragment()) .commit() return true } R.id.navigation_golive -> { supportFragmentManager.beginTransaction().replace(R.id.flContent, LiveWithTopicFragment()) .commit() return true } R.id.navigation_notification -> { supportFragmentManager.beginTransaction().replace(R.id.flContent, NotificationFragment()) .commit() return true } } return true } override fun onResume() { super.onResume() if (userPref.get_is_new() == "1"){ dashboardbottomsheet() // toast("1") } Glide.with(this).load(userPref.getProfileImage()) .apply(RequestOptions.placeholderOf(R.drawable.user_image_place_holder)) .apply(RequestOptions.errorOf(R.drawable.user_image_place_holder)) .into(binding.drawerToolbar.ivHeaderpic) } }
callastro/app/src/main/java/com/callastro/util/AppConstant.kt
2856408655
package com.maxtra.astrorahiastrologer.util object AppConstant { var DEVICE_ID = "device_id" var ISLOGIN = "is_login" var NOT_FIRST_TIME = "not_first_time" var IS_GUEST = "is_guest" var MOBILE_NO = "mobile_no" var DEVICE = "A" var USER_ID = "user_id" var NAME = "name" var EMAIL = "email" var LAT = "lat" var LONG = "long" var PROFILE_PIC = "profile_pic" var IS_NOTIFICATION = "is_notification" var tabIndex:Int = 0 }
callastro/app/src/main/java/com/callastro/util/Exceptions.kt
111654965
package com.maxtra.astrorahiastrologer.util import java.io.IOException import java.net.SocketTimeoutException class ApiException(message: String) : IOException(message) class NoInternetException(message: String) : IOException(message) class TimeOutException(message: String) : SocketTimeoutException(message)
callastro/app/src/main/java/com/callastro/util/PrefManager.kt
2869656234
package com.maxtra.astrorahiastrologer.util import android.content.Context import javax.inject.Singleton @Singleton class PrefManager( val _context: Context?, ) { // shared pref mode var PRIVATE_MODE = 0 // Shared preferences file name private val PREF_NAME = "intro-slider" var pref = _context?.getSharedPreferences(PREF_NAME, PRIVATE_MODE) var editor = pref!!.edit() private val IS_FIRST_TIME_LAUNCH = "intro-slider" fun setFirstTimeLaunch(isFirstTime: Boolean) { editor!!.putBoolean(IS_FIRST_TIME_LAUNCH, isFirstTime) editor!!.commit() } fun isFirstTimeLaunch(): Boolean { return pref!!.getBoolean(IS_FIRST_TIME_LAUNCH, true) } }
callastro/app/src/main/java/com/callastro/util/ViewUtils.kt
3360522651
package com.maxtra.astrorahiastrologer.util import android.content.Context import android.view.View import android.widget.ProgressBar import android.widget.Toast fun ProgressBar.show(){ visibility = View.VISIBLE } fun ProgressBar.hide(){ visibility = View.GONE } fun Context.toast(message: String){ Toast.makeText(this, message, Toast.LENGTH_LONG ).show() }
callastro/app/src/main/java/com/callastro/util/Utils.kt
3973262948
package com.maxtra.astrorahiastrologer.util import android.annotation.SuppressLint import android.app.Activity import android.app.AlertDialog import android.content.Context import android.media.MediaPlayer import android.net.ConnectivityManager import android.os.Vibrator import android.provider.Settings import android.text.Html import android.text.Spanned import android.util.Log import android.view.View import android.view.inputmethod.InputMethodManager import android.widget.Toast import com.callastro.R import dagger.Module import dagger.hilt.InstallIn import dagger.hilt.android.qualifiers.ApplicationContext import dagger.hilt.components.SingletonComponent import java.text.ParseException import java.text.SimpleDateFormat import java.util.* import javax.inject.Inject @Module @InstallIn(SingletonComponent::class) class Utils @Inject constructor(@ApplicationContext val context: Context) { fun toaster(message: String) { Toast.makeText(context, message, Toast.LENGTH_LONG).show() } fun logger(message: String) { Log.e("Win-Millionaire-Log", message) } fun simpleAlert(context: Context, title: String, message: String) { val builder = AlertDialog.Builder(context) builder.setTitle(title) builder.setMessage(message) builder.setPositiveButton(android.R.string.ok) { dialog, which -> dialog.dismiss() } builder.show() } fun hideKeyboard(view: View) { val imm = context.getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager imm.hideSoftInputFromWindow(view.windowToken, 0) } fun savedDate(date: Date): String { val sdf = SimpleDateFormat("yyyy-MM-dd") return sdf.format(date) } fun showDate(date: Date): String { val sdf = SimpleDateFormat("dd-MMM-yyyy") return sdf.format(date) } fun savedDate1(date: Date): String { val sdf = SimpleDateFormat("yyyy-MM-dd") return sdf.format(date) } fun showDate1(date: Date): String { val sdf = SimpleDateFormat("dd-MMM-yyyy") return sdf.format(date) } public fun fromHtml(html: String): Spanned { val result: Spanned if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) { result = Html.fromHtml(html, Html.FROM_HTML_MODE_LEGACY) } else { result = Html.fromHtml(html) } return result } /** * checking internet connection */ @SuppressLint("MissingPermission") fun isOnline(context: Context): Boolean { val cm = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager val netInfo = cm.activeNetworkInfo return netInfo != null && netInfo.isConnected } fun getFormattedDate(incomingDate: String): String { val fmt = SimpleDateFormat("yyyy-MM-dd") var date: Date? = null var formatedDate = "" try { date = fmt.parse(incomingDate) val fmtOut = SimpleDateFormat("dd-MMM-yyyy") formatedDate = fmtOut.format(date) } catch (e: ParseException) { e.printStackTrace() } return formatedDate } /* fun getDeviceToken(): String? { var token="" FirebaseInstanceId.getInstance().instanceId .addOnCompleteListener(OnCompleteListener { task -> if (!task.isSuccessful) { Log.e("", "getInstanceId failed", task.exception) return@OnCompleteListener } // Get new Instance ID token token = task.result!!.token // Log and toast // val msg = getString(R.string.msg_token_fmt, token) Log.d("", token) //Toast.makeText(baseContext, token, Toast.LENGTH_SHORT).show() }) return token } */ @SuppressLint("HardwareIds") fun getDeviceId() : String{ return Settings.Secure.getString(context.contentResolver, Settings.Secure.ANDROID_ID) } companion object { var userType: String? = null var serviceID: String? = null } }
callastro/app/src/main/java/com/callastro/util/Constant.kt
3652044325
package com.maxtra.u interface Constant { companion object { var check: Int = 0 //Local server url // val IS_NOTIFICATION = "is_notification" // var cartcount:Int? = 0 // var isItem:Boolean? = false // var cartAmount:String? = "" // var cartCurrency:String? = "" // const val MY_PREFERENCES = "prefs" val CHANNEL_NAME="CHANNEL_NAME" val TOKEN="TOKEN" val TYPE="TYPE" val NOTIFICATION_ID="NOTIFICATION_ID" val CONS_ID="CONS_ID" } }
callastro/app/src/main/java/com/callastro/util/DateFormat.kt
94303017
package com.maxtra.astrorahiastrologer.util import android.annotation.SuppressLint import android.os.Build import androidx.annotation.RequiresApi import java.text.ParseException import java.text.SimpleDateFormat import java.time.LocalDate import java.time.Year import java.util.* import java.util.concurrent.TimeUnit class DateFormat { companion object { @RequiresApi(Build.VERSION_CODES.O) @SuppressLint("SimpleDateFormat") fun orderDateTime(date: String?): String? { var result = "" val sourceFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") sourceFormat.timeZone = TimeZone.getTimeZone("UTC") var parsed: Date? = null // => Date is in UTC now parsed = try { sourceFormat.parse(date) } catch (e: ParseException) { e.printStackTrace() return "" } val destFormat = SimpleDateFormat("MM-dd-yyyy, h:mm") destFormat.timeZone = TimeZone.getDefault() result = destFormat.format(parsed) return result } fun getDateOfhourminute2(date: String?): String? { var result = "" val sourceFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") sourceFormat.timeZone = TimeZone.getTimeZone("UTC") var parsed: Date? = null // => Date is in UTC now parsed = try { sourceFormat.parse(date) } catch (e: ParseException) { e.printStackTrace() return "" } val destFormat = SimpleDateFormat("MMM dd, yyyy HH:mm:ss") destFormat.timeZone = TimeZone.getDefault() result = destFormat.format(parsed) return result } fun getDealDate(date: String?): String? { var result = "" val sourceFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") sourceFormat.timeZone = TimeZone.getTimeZone("UTC") var parsed: Date? = null // => Date is in UTC now parsed = try { sourceFormat.parse(date) } catch (e: ParseException) { e.printStackTrace() return "" } val destFormat = SimpleDateFormat("yyyy-MM-dd") destFormat.timeZone = TimeZone.getDefault() result = destFormat.format(parsed) return result } fun getDealTime(date: String?): String? { var result = "" val sourceFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") sourceFormat.timeZone = TimeZone.getTimeZone("UTC") var parsed: Date? = null // => Date is in UTC now parsed = try { sourceFormat.parse(date) } catch (e: ParseException) { e.printStackTrace() return "" } val destFormat = SimpleDateFormat("HH:mm:ss aa") destFormat.timeZone = TimeZone.getDefault() result = destFormat.format(parsed) return result } fun addDealsDate(date: String?): String? { var result = "" val sourceFormat = SimpleDateFormat("yyyy-MM-dd HH:mm") sourceFormat.timeZone = TimeZone.getTimeZone("UTC") var parsed: Date? = null // => Date is in UTC now parsed = try { sourceFormat.parse(date) } catch (e: ParseException) { e.printStackTrace() return "" } val destFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") destFormat.timeZone = TimeZone.getDefault() result = destFormat.format(parsed) return result } fun addServiceDealsDate(date: String?): String? { var result = "" val sourceFormat = SimpleDateFormat("dd-MM-yyyy") sourceFormat.timeZone = TimeZone.getTimeZone("UTC") var parsed: Date? = null // => Date is in UTC now parsed = try { sourceFormat.parse(date) } catch (e: ParseException) { e.printStackTrace() return "" } // val destFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") val destFormat = SimpleDateFormat("yyyy-MM-dd") destFormat.timeZone = TimeZone.getDefault() result = destFormat.format(parsed) return result } fun exobeAllScreenDateFormat(date: String?): String? { var result = "" val sourceFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") sourceFormat.timeZone = TimeZone.getTimeZone("UTC") var parsed: Date? = null // => Date is in UTC now parsed = try { sourceFormat.parse(date) } catch (e: ParseException) { e.printStackTrace() return "" } val destFormat = SimpleDateFormat("MMM dd, yyyy") destFormat.timeZone = TimeZone.getDefault() result = destFormat.format(parsed) return result } fun isBlank(s: String?): Boolean { return s == null || s.trim { it <= ' ' }.length == 0 } fun getMonth(dates: String?): String? { val inputFormat = SimpleDateFormat("MM") val outputFormat = SimpleDateFormat("MMM") var date: Date? = null try { date = inputFormat.parse(dates) } catch (e: ParseException) { e.printStackTrace() } val formattedDate = outputFormat.format(date) println(formattedDate) // prints 10-04-2018 return formattedDate } @SuppressLint("SuspiciousIndentation") fun firstdateofMonth(): String { var sdfn = SimpleDateFormat("yyyy-MM-dd", Locale.US) var _calendar = Calendar.getInstance(Locale.getDefault()) _calendar.add(Calendar.MONTH, 0) _calendar.set(Calendar.DATE, _calendar.getActualMinimum(Calendar.DAY_OF_MONTH)) val monthFirstDay = _calendar.getTime() var stringStartDate = sdfn.format(monthFirstDay) return stringStartDate } fun getMonthName(dates: String?): String? { val inputFormat = SimpleDateFormat("dd/mm/yyyy") val outputFormat = SimpleDateFormat("yyyy-mm-dd") var date: Date? = null try { date = inputFormat.parse(dates) } catch (e: ParseException) { e.printStackTrace() } val formattedDate = outputFormat.format(date) println(formattedDate) // prints 10-04-2018 return formattedDate } fun getFullMonthName(date: String?): String? { var result = "" val sourceFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") sourceFormat.timeZone = TimeZone.getTimeZone("UTC") var parsed: Date? = null // => Date is in UTC now parsed = try { sourceFormat.parse(date) } catch (e: ParseException) { e.printStackTrace() return "" } val destFormat = SimpleDateFormat("MMMM dd, yyyy") destFormat.timeZone = TimeZone.getDefault() result = destFormat.format(parsed) return result } fun getComplianceFullMonthName(date: String?): String? { var result = "" val sourceFormat = SimpleDateFormat("yyyy-MM-dd") sourceFormat.timeZone = TimeZone.getTimeZone("UTC") var parsed: Date? = null // => Date is in UTC now parsed = try { sourceFormat.parse(date) } catch (e: ParseException) { e.printStackTrace() return "" } val destFormat = SimpleDateFormat("MMMM dd, yyyy") destFormat.timeZone = TimeZone.getDefault() result = destFormat.format(parsed) return result } fun getCurrentDate(currentTime: Date):String{ val sdf = SimpleDateFormat("MMMM dd, yyyy") return sdf.format(Date()) } fun getCurrentDateformat(currentTime: Date):String{ val sdf = SimpleDateFormat("yyyy-MM-dd") return sdf.format(Date()) } fun dealsdate(date: String?): String? { var result = "" val sourceFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") sourceFormat.timeZone = TimeZone.getTimeZone("UTC") var parsed: Date? = null // => Date is in UTC now parsed = try { sourceFormat.parse(date) } catch (e: ParseException) { e.printStackTrace() return "" } val destFormat = SimpleDateFormat("yyyy-MM-dd") destFormat.timeZone = TimeZone.getDefault() result = destFormat.format(parsed) return result } fun proxyDateFormat(date: String?): String? { var result = "" val sourceFormat = SimpleDateFormat("dd-MM-yyyy") sourceFormat.timeZone = TimeZone.getTimeZone("UTC") var parsed: Date? = null // => Date is in UTC now parsed = try { sourceFormat.parse(date) } catch (e: ParseException) { e.printStackTrace() return "" } val destFormat = SimpleDateFormat("yyyy-MM-dd") destFormat.timeZone = TimeZone.getDefault() result = destFormat.format(parsed) return result } @RequiresApi(Build.VERSION_CODES.O) fun lastDayOfMonth(Y: Int, M: Int): Int { return LocalDate.of(Y, M, 1).month.length(Year.of(Y).isLeap) } fun periodFormat(date: String?): String? { var result = "" val sourceFormat = SimpleDateFormat("dd-MMM-yyyy") sourceFormat.timeZone = TimeZone.getTimeZone("UTC") var parsed: Date? = null // => Date is in UTC now parsed = try { sourceFormat.parse(date) } catch (e: ParseException) { e.printStackTrace() return "" } val destFormat = SimpleDateFormat("dd-MMM-yyyy") destFormat.timeZone = TimeZone.getDefault() result = destFormat.format(parsed) return result } fun overDue(date: String?): String? { var result = "" val sourceFormat = SimpleDateFormat("yyyy-MM-dd") sourceFormat.timeZone = TimeZone.getTimeZone("UTC") var parsed: Date? = null // => Date is in UTC now parsed = try { sourceFormat.parse(date) } catch (e: ParseException) { e.printStackTrace() return "" } val destFormat = SimpleDateFormat("dd-MMM-yyyy") destFormat.timeZone = TimeZone.getDefault() result = destFormat.format(parsed) return result } fun NotificationDate(date: String?): String? { var result = "" val sourceFormat = SimpleDateFormat("yyyy-MM-dd") sourceFormat.timeZone = TimeZone.getTimeZone("UTC") var parsed: Date? = null // => Date is in UTC now parsed = try { sourceFormat.parse(date) } catch (e: ParseException) { e.printStackTrace() return "" } val destFormat = SimpleDateFormat("MMM-dd-yyyy") destFormat.timeZone = TimeZone.getDefault() result = destFormat.format(parsed) return result } fun settlementDate(date: String?): String? { var result = "" val sourceFormat = SimpleDateFormat("yyyy-MM-dd") sourceFormat.timeZone = TimeZone.getTimeZone("UTC") var parsed: Date? = null // => Date is in UTC now parsed = try { sourceFormat.parse(date) } catch (e: ParseException) { e.printStackTrace() return "" } val destFormat = SimpleDateFormat("MMM dd,yyyy | HH:mm aa") destFormat.timeZone = TimeZone.getDefault() result = destFormat.format(parsed) return result } fun dealstime(date: String?): String? { var result = "" val sourceFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") sourceFormat.timeZone = TimeZone.getTimeZone("UTC") var parsed: Date? = null // => Date is in UTC now parsed = try { sourceFormat.parse(date) } catch (e: ParseException) { e.printStackTrace() return "" } val destFormat = SimpleDateFormat("hh:mm:ss aa") destFormat.timeZone = TimeZone.getDefault() result = destFormat.format(parsed) return result } fun dealstimeforedit(date: String?): String? { var result = "" val sourceFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") sourceFormat.timeZone = TimeZone.getTimeZone("UTC") var parsed: Date? = null // => Date is in UTC now parsed = try { sourceFormat.parse(date) } catch (e: ParseException) { e.printStackTrace() return "" } val destFormat = SimpleDateFormat("hh:mm") destFormat.timeZone = TimeZone.getDefault() result = destFormat.format(parsed) return result } fun getDaysBetweenDates(start: String?, end: String?): Long { //String dateStr = "04/09/2019"; var start = start var end = end val serverDate = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.ENGLISH) val endDate = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.ENGLISH) var dateObj: Date? = null var dateend: Date? = null try { dateObj = serverDate.parse(start) dateend = endDate.parse(end) } catch (e: ParseException) { e.printStackTrace() } val postFormater = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.ENGLISH) val newDateStr = postFormater.format(dateObj) start = newDateStr val dateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.ENGLISH) var endStr: String? = "" try { endStr = postFormater.format(dateend) } catch (e: Exception) { } end = endStr val startDate: Date val endDate1: Date var numberOfDays: Long = 0 try { startDate = dateFormat.parse(start) endDate1 = dateFormat.parse(end) numberOfDays = getUnitBetweenDates(startDate, endDate1, TimeUnit.DAYS) } catch (e: ParseException) { e.printStackTrace() } return numberOfDays } private fun getUnitBetweenDates( startDate: Date, endDate: Date, unit: TimeUnit ): Long { // return unit.convert(timeDiff, TimeUnit.MILLISECONDS); return endDate.time - startDate.time } } }
callastro/app/src/main/java/com/callastro/util/ApiConstant.kt
2488742901
package com.maxtra.astrorahiastrologer.util object ApiConstant { //Live server url // const val BASE_URL = "http://172.16.0.233/~maxdevcallastro/call_astro/api/" const val BASE_URL = "http://103.154.2.116/~maxdevcallastro/call_astro/api/" }
callastro/app/src/main/java/com/callastro/util/ConstantBottom.kt
450593149
package com.maxtra.astrorahiastrologer.util class ConstantBottom { object DeliveryDashboardBottomNavTab { const val HOME = 100 const val MOVIES = 101 const val TV = 102 const val LIST = 103 const val MORE = 104 } }
callastro/app/src/main/java/com/callastro/util/SoundUtil.kt
3734952535
package com.callastro.util import android.content.Context import android.media.MediaPlayer import android.os.Vibrator import com.callastro.R object SoundUtil { private var mMediaPlayer: MediaPlayer? = null private var vib: Vibrator? = null fun playSound(context: Context) { if (mMediaPlayer == null) { mMediaPlayer = MediaPlayer.create(context, R.raw.rington) vib = context.getSystemService(Context.VIBRATOR_SERVICE) as Vibrator vib!!.vibrate(1000) mMediaPlayer!!.isLooping = false mMediaPlayer!!.start() } else { mMediaPlayer!!.start() } } fun stopSound(context: Context) { mMediaPlayer?.apply { if (isPlaying) { stop() } release() } mMediaPlayer = null } }
callastro/app/src/main/java/com/callastro/util/CommonUtils.kt
2256381587
package com.maxtra.astrorahiastrologer.util import android.content.Context import android.net.ConnectivityManager import android.net.NetworkCapabilities import android.os.Build import android.util.Patterns import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity import java.text.ParseException import java.text.SimpleDateFormat import java.util.* object CommonUtils { // fun setFragment(fragment: Fragment, removeStack: Boolean, activity: FragmentActivity, mContainer: Int) { // val fragmentManager = activity.supportFragmentManager // val ftTransaction = fragmentManager.beginTransaction() // if (removeStack) { // fragmentManager.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE) // ftTransaction.setCustomAnimations(R.anim.enter, R.anim.exit, R.anim.pop_enter, R.anim.pop_exit) // ftTransaction.replace(mContainer, fragment) // //ftTransaction.addToBackStack(null) // } else { // ftTransaction.replace(mContainer, fragment) // //ftTransaction.addToBackStack(null) // } // ftTransaction.commit() // } /** * @return boolean * @description This method is used to check internet connection. */ @Suppress("DEPRECATION") fun isInternetAvailable(context: Context): Boolean { try { val cm = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager when { Build.VERSION.SDK_INT >= Build.VERSION_CODES.M -> { val network = cm.activeNetwork return when { network != null -> { val networkCapabilities = cm.getNetworkCapabilities(network) when { networkCapabilities != null -> { networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR) || networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET) || networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) } else -> { return false } } } else -> false } } else -> { val netInfo = cm.activeNetworkInfo return netInfo != null && netInfo.isConnectedOrConnecting } } } catch (e: Exception) { return false } } fun addFragment(fragment: Fragment,activity: FragmentActivity, mContainer: Int){ val fragmentManager = activity.supportFragmentManager val ftTransaction = fragmentManager.beginTransaction() ftTransaction.add(mContainer,fragment) ftTransaction.commit() } fun getNumberOfFragmentInContainer(activity: FragmentActivity) : Int{ val fragmentManager = activity.supportFragmentManager return fragmentManager.backStackEntryCount } /* fun getCurrentFragment(activity: FragmentActivity) : Fragment?{ val fragmentManager = activity.supportFragmentManager return fragmentManager.findFragmentById(R.id.frame_Container) }*/ /*To convert string date from one format to another format*/ fun getDate(currentFormat: String, requiredFormat: String, dateString: String): String? { var result = "" if (dateString.isNullOrEmpty()) { return result } val formatterOld = SimpleDateFormat(currentFormat, Locale.getDefault()) val formatterNew = SimpleDateFormat(requiredFormat, Locale.getDefault()) var date: Date? = null try { date = formatterOld.parse(dateString) } catch (e: ParseException) { e.printStackTrace() } if (date != null) { result = formatterNew.format(date) } return result } fun isValidMail(email: String): Boolean { return Patterns.EMAIL_ADDRESS.matcher(email).matches() } fun isPasswordConfirmPasswordSame(password : String,confirmPassword : String): Boolean { return password.equals(confirmPassword) } }
callastro/app/src/main/java/com/callastro/util/Constants.kt
1601481248
package com.maxtra.astrorahiastrologer.util object Constants { }
callastro/app/src/main/java/com/callastro/util/androidextentions.kt
2275715741
package com.maxtra.astrorahiastrologer.util import android.content.Context import android.net.ConnectivityManager object androidextentions { private lateinit var mContext: Context operator fun invoke(applicationContext: Context?) { mContext=applicationContext!! } fun phoneIsOnline(context: Context): Boolean { val cm = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager val netInfo = cm.activeNetworkInfo return netInfo != null && netInfo.isConnectedOrConnecting } }
callastro/app/src/main/java/com/callastro/DialogUtils.kt
1208832397
package com.callastro import android.R import android.app.Dialog import android.app.ProgressDialog import android.content.Context import android.graphics.Color import android.graphics.drawable.ColorDrawable import android.view.* class DialogUtils { private val dialogList: MutableList<Dialog> = ArrayList() private val progressDialog: ProgressDialog? = null fun createDialog(context: Context?, dialogLayout: View?, animationType: Int): Dialog? { val dialog = Dialog(context!!, R.style.Theme_Translucent_NoTitleBar) dialog.requestWindowFeature(Window.FEATURE_NO_TITLE) dialog.setCanceledOnTouchOutside(false) dialog.setCancelable(true) dialog.setContentView(dialogLayout!!) val layoutParams: WindowManager.LayoutParams = dialog.getWindow()!!.getAttributes() layoutParams.dimAmount = 0.7f dialog.getWindow()?.addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND) dialog.getWindow()?.setGravity(Gravity.CENTER) layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT dialog.getWindow()?.setAttributes(layoutParams) dialog.getWindow()?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT)) if (animationType == 0) { dialog.getWindow()?.getAttributes()?.windowAnimations = R.style.Animation_Dialog } else { // dialog.getWindow()?.getAttributes()?.windowAnimations = R.style.AnimationBottomPopUp } dialog.show() dialogList.add(dialog) return dialog } }
callastro/app/src/main/java/com/callastro/clicklistener/popupItemClickListenerCountry.kt
2607263570
package com.maxtra.astrorahiastrologer.clicklistener interface PopupItemClickListenerCountry { fun getCountry (name:String, flag:String, id: Int) }
callastro/app/src/main/java/com/callastro/module/RepositoriesModule.kt
562128702
package com.callastro.module import com.callastro.data.MainRepository import com.callastro.data.MainRepositoryImpl import dagger.Binds import dagger.Module import dagger.hilt.InstallIn import dagger.hilt.android.components.ViewModelComponent @Module @InstallIn(ViewModelComponent::class) interface RepositoriesModule { @Binds fun mainRepository(mainRepositoryImpl : MainRepositoryImpl) : MainRepository }
callastro/app/src/main/java/com/callastro/module/NetworkModule.kt
1825281730
package com.callastro.module import com.callastro.data.ApiService import com.google.gson.Gson import com.google.gson.GsonBuilder import com.maxtra.astrorahiastrologer.util.ApiConstant import dagger.Module import dagger.Provides import dagger.hilt.InstallIn import dagger.hilt.components.SingletonComponent import okhttp3.OkHttpClient import okhttp3.logging.HttpLoggingInterceptor import retrofit2.Retrofit import retrofit2.converter.gson.GsonConverterFactory import java.util.concurrent.TimeUnit import javax.inject.Named import javax.inject.Singleton @Module @InstallIn(SingletonComponent::class) object NetworkModule { @Singleton @Provides fun provideOkHttp() : OkHttpClient { val loggingInterceptor = HttpLoggingInterceptor() loggingInterceptor.level = HttpLoggingInterceptor.Level.BODY val builder = OkHttpClient.Builder() .connectTimeout((60 * 5).toLong(), TimeUnit.SECONDS) .readTimeout((60 * 5).toLong(), TimeUnit.SECONDS) .writeTimeout((60 * 5).toLong(), TimeUnit.SECONDS) .addInterceptor(loggingInterceptor) builder.addInterceptor { chain -> val original = chain.request() val requestBuilder = original.newBuilder() requestBuilder.header("Content-Type", "application/json; charset=utf-8") requestBuilder.method(original.method, original.body) val request = requestBuilder.build() chain.proceed(request) } return builder.build() } @Singleton @Provides @Named("loggingInterceptor") fun provideLoggingInterceptor(): HttpLoggingInterceptor { return HttpLoggingInterceptor().apply { this.level = HttpLoggingInterceptor.Level.BODY } } var gson: Gson = GsonBuilder().setLenient().create() @Provides fun provideRetrofit(okHttpClient: OkHttpClient): Retrofit { return Retrofit.Builder() .baseUrl(ApiConstant.BASE_URL) .addConverterFactory(GsonConverterFactory.create(gson)) .client(okHttpClient) .build() } @Provides fun provideApiClient(retrofit: Retrofit): ApiService { return retrofit.create(ApiService::class.java) } }
callastro/app/src/main/java/com/callastro/baseClass/BaseActivity.kt
3169002186
package com.maxtra.callastro.baseClass import android.app.Dialog import android.app.ProgressDialog import android.content.Context import android.content.res.Configuration import android.os.Bundle import android.os.PersistableBundle import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment import com.callastro.R import com.maxtra.astrorahiastrologer.util.Utils import com.google.android.material.snackbar.Snackbar import com.maxtra.callastro.prefs.UserPref //import com.razorpay.PaymentData import dagger.Module import dagger.hilt.InstallIn import dagger.hilt.components.SingletonComponent import java.util.* import javax.inject.Inject @Module @InstallIn(SingletonComponent::class) open class BaseActivity : AppCompatActivity() { @Inject lateinit var userPref: UserPref @Inject lateinit var utils: Utils // @Inject // lateinit var chooseLanguageViewModelFactory: ChooseLanguageViewModelFactory var dialog: Dialog?=null var progressDialog: ProgressDialog? = null val emailPattern = "[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+" override fun onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) { super.onCreate(savedInstanceState, persistentState) userPref=UserPref(this) } protected fun showProgressDialog() { if (dialog == null) dialog = Dialog(this) dialog!!.setContentView(R.layout.progress_dialog) dialog!!.setCancelable(false) if (dialog != null && !dialog!!.isShowing) dialog!!.show() } protected fun hideProgressDialog() { if (dialog != null && dialog!!.isShowing) dialog!!.dismiss() } override fun onDestroy() { super.onDestroy() if (dialog != null && dialog!!.isShowing) dialog!!.dismiss() } /*fun snackBar(message: String){ Snackbar.make(findViewById(R.id.content), message, Snackbar.LENGTH_SHORT).show() }*/ protected fun replaceFragment(fragment: Fragment) { val fragmentTransaction = supportFragmentManager.beginTransaction() fragmentTransaction.replace(R.id.flContent, fragment, fragment.javaClass.name).commit() } fun changeLanguage( prefLanguage:String) { val locale = Locale(prefLanguage) Locale.setDefault(locale) val config = Configuration() config.locale = locale resources.updateConfiguration(config, resources.getDisplayMetrics()) } fun snackbar(message: String){ Snackbar.make(findViewById(android.R.id.content), message, Snackbar.LENGTH_SHORT).show() } fun toast(context : Context, message: String){ Toast.makeText(context, message, Toast.LENGTH_SHORT).show() } // open fun onPaymentSuccess(p0: String?, p1: PaymentData?) {} }
callastro/app/src/main/java/com/callastro/baseClass/BaseFragment.kt
3779937731
package com.callastro.baseClass import android.app.Dialog import android.app.ProgressDialog import android.content.Context import android.os.Bundle import android.view.View import android.widget.Toast import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentManager import com.callastro.R import com.callastro.data.ApiService import com.maxtra.astrorahiastrologer.util.Utils import com.google.android.material.snackbar.Snackbar import com.maxtra.callastro.prefs.UserPref import dagger.Module import dagger.hilt.InstallIn import dagger.hilt.components.SingletonComponent import javax.inject.Inject @Module @InstallIn(SingletonComponent::class) open class BaseFragment : Fragment() { @Inject lateinit var userPref: UserPref @Inject lateinit var utils: Utils @Inject lateinit var apiService : ApiService var progressDialog: ProgressDialog? = null var dialog: Dialog?=null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) } /* protected fun replaceFragment(fragment: Fragment) { val fragmentTransaction = requireActivity().supportFragmentManager.beginTransaction() fragmentTransaction.setCustomAnimations(R.anim.enter, R.anim.exit, R.anim.pop_enter, R.anim.pop_exit) fragmentTransaction.replace(R.id.frame_Container, fragment, fragment.javaClass.name).commit() }*/ fun setFragment(fragment: Fragment, removeStack: Boolean, activity: FragmentActivity, mContainer: Int) { val fragmentManager = activity.supportFragmentManager val ftTransaction = fragmentManager.beginTransaction() if (removeStack) { fragmentManager.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE) ftTransaction.setCustomAnimations(R.anim.pop_enter, R.anim.pop_exit,R.anim.enter, R.anim.exit) ftTransaction.replace(mContainer, fragment) ftTransaction.addToBackStack(null) } else { ftTransaction.replace(mContainer, fragment) ftTransaction.addToBackStack(null) } ftTransaction.commit() } protected fun showProgressDialog() { if (dialog == null) dialog = Dialog(requireActivity()) dialog!!.setContentView(R.layout.progress_dialog) dialog!!.setCancelable(false) if (dialog != null && !dialog!!.isShowing) dialog!!.show() } protected fun hideProgressDialog() { if (dialog != null && dialog!!.isShowing) dialog!!.dismiss() } override fun onDestroy() { super.onDestroy() if (dialog != null && dialog!!.isShowing) dialog!!.dismiss() } fun snackBar(view : View, message: String){ Snackbar.make(view, message, Snackbar.LENGTH_SHORT).show() } fun toast(context : Context, message: String){ Toast.makeText(context, message, Toast.LENGTH_SHORT).show() } }
callastro/app/src/main/java/com/callastro/adapters/ChatAdapter2.kt
4265959490
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.os.Build import android.text.Html import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.databinding.RowChatwithusBinding import com.callastro.model.ChatListMessageData import com.maxtra.callastro.prefs.UserPref import java.lang.Long import java.text.SimpleDateFormat import java.util.* import kotlin.Exception import kotlin.Int import kotlin.String import kotlin.assert class ChatAdapter2( private val context: Context, messageList: List<ChatListMessageData> ) : RecyclerView.Adapter<ChatAdapter2.MyViewHolder>() { private val messageList: List<ChatListMessageData> private val userPref: UserPref override fun onCreateViewHolder( parent: ViewGroup, viewType: Int ): MyViewHolder { val itemView: View = LayoutInflater.from(parent.context).inflate(R.layout.row_chatwithus, parent, false) return MyViewHolder(itemView) } @SuppressLint("SimpleDateFormat") fun getTimeStampDate(str_date: String): String? { var str_date = str_date val format = SimpleDateFormat("dd-MMM-yy hh.mm a") if (str_date.length < 13) { str_date = (java.lang.Long.valueOf(str_date) * 1000).toString() + "" } var date: Date? = null try { date = Date(Long.valueOf(str_date)) } catch (e: Exception) { e.printStackTrace() } assert(date != null) var timestampValue: String? = "" try { timestampValue = format.format(date) } catch (e: Exception) { e.printStackTrace() } return timestampValue } override fun onBindViewHolder( holder: MyViewHolder, position: Int ) { if (messageList[position].type.equals("1") ) { holder.binding!!.cvMy.visibility = View.VISIBLE holder.binding.cvOther.visibility = View.GONE if (messageList[position].createdAt != null && !messageList[position].createdAt !!.equals("") ) { holder.binding.tvDateTimeMy.text = /*getTimeStampDate(*/ messageList[position].createdAt!!.toString() // ) } else { holder.binding.tvDateTimeMy.text = "" } // // holder.binding.tvMsgMy.text = messageList[position] // .message if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { holder.binding.tvMsgMy.setText(Html.fromHtml(messageList[position].message, Html.FROM_HTML_MODE_LEGACY)); } else holder.binding.tvMsgMy.setText(Html.fromHtml(messageList[position].message)); holder.binding.tvMsgMy.visibility = View.VISIBLE } else { holder.binding!!.cvMy.visibility = View.GONE holder.binding.cvOther.visibility = View.VISIBLE if (messageList[position].createdAt != null && !messageList[position].createdAt !!.equals("") ) { holder.binding.tvDateTimeOther.text = /* getTimeStampDate(*/messageList[position].createdAt!!.toString()/*)*/ } else { holder.binding.tvDateTimeOther.text = "" } // holder.binding.tvMsgOther.text = // if (messageList[position].message != null) messageList[position] // .message else "" if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { holder.binding.tvMsgOther.setText(Html.fromHtml(messageList[position].message, Html.FROM_HTML_MODE_LEGACY)); } else holder.binding.tvMsgOther.setText(Html.fromHtml(messageList[position].message)); holder.binding.tvMsgOther.visibility = View.VISIBLE } } override fun getItemCount(): Int { return messageList.size } inner class MyViewHolder(view: View?) : RecyclerView.ViewHolder(view!!) { val binding: RowChatwithusBinding? = DataBindingUtil.bind(view!!) } init { this.messageList = messageList userPref = UserPref(this.context) } }
callastro/app/src/main/java/com/callastro/adapters/ReviewRatingPinnedAdapter.kt
2800289393
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.callastro.R import com.callastro.databinding.RowPostprofileReviewsBinding import com.callastro.model.GetAstroRatingReviewPinData class ReviewRatingPinnedAdapter (val context : Context, var list: List<GetAstroRatingReviewPinData> //,var listener:OnClick ) : RecyclerView.Adapter<ReviewRatingPinnedAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowPostprofileReviewsBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ReviewRatingPinnedAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_postprofile_reviews, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: ReviewRatingPinnedAdapter.ViewHolder, position: Int) { val data = list[position] holder.binding.tvUserName.text = data.userName.toString() holder.binding.tvDetail.text = data.reveiw.toString() Glide.with(context).load(data.profile.toString()).into(holder.binding.ivImage) holder.binding.ratingByUser.setRating(data.rating!!.toFloat()); holder.binding.linearItem.setOnClickListener(View.OnClickListener { row_index = position // listener.onRatingItemClicked(data) }) } override fun getItemCount(): Int { return list.size } interface OnClick{ fun onRatingItemClicked(getAstroRatingReviewPinData: GetAstroRatingReviewPinData) } }
callastro/app/src/main/java/com/callastro/adapters/CityListAdapter.kt
2843800813
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.TextView import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.model.CityListData import com.maxtra.astrorahiastrologer.clicklistener.PopupItemClickListenerCountry class CityListAdapter ( var context: Context, var data: ArrayList<CityListData>, var flag: String, var click: PopupItemClickListenerCountry ) : RecyclerView.Adapter<CityListAdapter.ViewHolder>() { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val mInflater = LayoutInflater.from(context) val view = mInflater.inflate(R.layout.row_spinner_item, parent, false) return ViewHolder(view) } override fun onBindViewHolder(holder: ViewHolder, position: Int) { var ListData = data.get(position) if (flag == "City") { holder.Names.text = ListData.cityName holder.Names.setOnClickListener { ListData.cityName.let { it1 -> if (it1 != null) { ListData.id?.let { it2 -> click.getCountry(it1, flag, it2.toInt()) } } } } } } override fun getItemCount(): Int { return data.size } @SuppressLint("NotifyDataSetChanged") fun filterList(filteredCityList: ArrayList<CityListData>) { data = filteredCityList notifyDataSetChanged() } class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var Names: TextView init { Names = itemView.findViewById(R.id.tvName) } } } /* class CityListAdapter (val context : Context, var list: List<CityListData>, private val listener: OnClick) : RecyclerView.Adapter<CityListAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowSpinnerItemBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CityListAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_spinner_item, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: CityListAdapter.ViewHolder, position: Int) { val data = list[position] holder.binding.tvName.text = data.cityName.toString() holder.binding.linearItemSpinner.setOnClickListener(View.OnClickListener { row_index = position listener.onItemClicked(data) }) } override fun getItemCount(): Int { return list.size } interface OnClick{ fun onItemClicked(cityListData: CityListData) } }*/
callastro/app/src/main/java/com/callastro/adapters/FAQAdapter.kt
1782249070
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.databinding.RowFaqBinding import com.callastro.model.FAQResponseData class FAQAdapter (val context : Context, var data: ArrayList<FAQResponseData>) : RecyclerView.Adapter<FAQAdapter.ViewHolder>() { inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView){ var binding: RowFaqBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): FAQAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_faq, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: FAQAdapter.ViewHolder, position: Int) { val List = data[position] holder.binding.tvHead.text = List.questions.toString() holder.binding.tvSubhead.text = List.answers.toString() holder.binding.arrowright.setOnClickListener { holder.binding.arrowdown.visibility = View.VISIBLE holder.binding.arrowright.visibility = View.GONE holder.binding.tvSubhead.visibility =View.VISIBLE } holder.binding.arrowdown.setOnClickListener { holder.binding.arrowdown.visibility = View.GONE holder.binding.arrowright.visibility = View.VISIBLE holder.binding.tvSubhead.visibility =View.GONE } } override fun getItemCount(): Int { return data.size } }
callastro/app/src/main/java/com/callastro/adapters/TotalEarningsAdapter.kt
2227191451
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.databinding.RowEarningBinding import com.callastro.model.AstroEarningListResponseData import com.callastro.model.AstroEarningTransactionHistory class TotalEarningsAdapter (val context : Context, var list: List<AstroEarningListResponseData>) : RecyclerView.Adapter<TotalEarningsAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowEarningBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TotalEarningsAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_earning, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: TotalEarningsAdapter.ViewHolder, position: Int) { val data = list[position] holder.binding.tvPaymentType.text = data.content holder.binding.tvAmount.text = "₹"+data.amount // holder.binding.tvPaymentFrom.text = data.transaction holder.binding.tvPaymentDate.text = data.createdAt+" " + data.createdTime } override fun getItemCount(): Int { return list.size } }
callastro/app/src/main/java/com/callastro/adapters/ViewPagerConfirmationOnBooking.kt
1447421934
package com.callastro.adapters import android.os.Bundle import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentPagerAdapter import com.callastro.ui.fragments.ConfirmationBookingCallFragment import com.callastro.ui.fragments.ConfirmationBookingChatFragment import com.callastro.ui.fragments.ConfirmationBookingFixedSessionFragment import com.callastro.ui.fragments.ConfirmationBookingReportFragment class ViewPagerConfirmationOnBooking( fragmentManager: FragmentManager ) : FragmentPagerAdapter(fragmentManager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) { private val titles = arrayOf("Chat","Call","Fixed Session","Report") override fun getItem(position: Int): Fragment { val bundle = Bundle() val fragment : Fragment return when (position) { 0 -> { fragment = ConfirmationBookingChatFragment() bundle.putInt("type",0) fragment.arguments = bundle fragment } 1 -> { fragment = ConfirmationBookingCallFragment() bundle.putInt("type",1) fragment.arguments = bundle fragment } 2 -> { fragment = ConfirmationBookingFixedSessionFragment() bundle.putInt("type",2) fragment.arguments = bundle fragment } else -> { fragment = ConfirmationBookingReportFragment() bundle.putInt("type",3) fragment.arguments = bundle fragment } } } override fun getCount(): Int { return titles.size } override fun getPageTitle(position: Int): CharSequence? { return titles[position].toString() } }
callastro/app/src/main/java/com/callastro/adapters/PinCodeListAdapter.kt
3443450672
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.TextView import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.model.PincodeListData import com.maxtra.astrorahiastrologer.clicklistener.PopupItemClickListenerCountry class PinCodeListAdapter ( var context: Context, var data: ArrayList<PincodeListData>, var flag: String, var click: PopupItemClickListenerCountry ) : RecyclerView.Adapter<PinCodeListAdapter.ViewHolder>() { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val mInflater = LayoutInflater.from(context) val view = mInflater.inflate(R.layout.row_spinner_item, parent, false) return ViewHolder(view) } override fun onBindViewHolder(holder: ViewHolder, position: Int) { var ListData = data.get(position) if (flag == "Pincode") { holder.Names.text = ListData.pincode holder.Names.setOnClickListener { ListData.pincode.let { it1 -> if (it1 != null) { ListData.id?.let { it2 -> click.getCountry(it1, flag, it2.toInt()) } } } } } } override fun getItemCount(): Int { return data.size } @SuppressLint("NotifyDataSetChanged") fun filterList(filteredPincodeList: ArrayList<PincodeListData>) { data = filteredPincodeList notifyDataSetChanged() } class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var Names: TextView init { Names = itemView.findViewById(R.id.tvName) } } } /* class PinCodeListAdapter (val context : Context, var list: List<PincodeListData>, private val listener: OnClick) : RecyclerView.Adapter<PinCodeListAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowSpinnerItemBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PinCodeListAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_spinner_item, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: PinCodeListAdapter.ViewHolder, position: Int) { val data = list[position] holder.binding.tvName.text = data.pincode.toString() holder.binding.linearItemSpinner.setOnClickListener(View.OnClickListener { row_index = position listener.onItemClicked(data) }) } override fun getItemCount(): Int { return list.size } interface OnClick{ fun onItemClicked(pincodeListData: PincodeListData) } }*/
callastro/app/src/main/java/com/callastro/adapters/FixedSessionAdapter.kt
552504671
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.callastro.R import com.callastro.databinding.RowfixedsessionBinding import com.callastro.model.FixedsessionResponseListData class FixedSessionAdapter (val context : Context, var List: ArrayList<FixedsessionResponseListData>, private val listener: OnClick) : RecyclerView.Adapter<FixedSessionAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView){ var binding: RowfixedsessionBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): FixedSessionAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.rowfixedsession, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: FixedSessionAdapter.ViewHolder, position: Int) { val data = List[position] holder.binding.tvName.text = data.userName.toString() holder.binding.tvLanguage.text = data.language.toString() if (data.fix_session_type!!.equals(1)){ holder.binding.btntime.text = "Fixed session for 30 min" }else{ holder.binding.btntime.text = "Fixed session for 60 min" } if (data.type!!.equals(1)) { holder.binding.typeCall.text = "Chat" holder.binding.callchaticon.setImageResource(R.drawable.ic_chat) }else if (data.type!!.equals(2)){ holder.binding.typeCall.text = "Audio Call" holder.binding.callchaticon.setImageResource(R.drawable.ic_call1) }else{ holder.binding.typeCall.text = "Video Call" holder.binding.callchaticon.setImageResource(R.drawable.ic_call1) } Glide.with(context).load(data.profile.toString()).into(holder.binding.image) holder.binding.linearItem.setOnClickListener(View.OnClickListener { row_index = position listener.onCallItemClicked(data) }) holder.binding.llAccept.setOnClickListener(View.OnClickListener { row_index = position listener.onCallAcceptClicked(data) holder.binding.llCallHandler.visibility = View.GONE }) holder.binding.llCancel.setOnClickListener(View.OnClickListener { row_index = position listener.onCallCancelClicked(data) holder.binding.llCallHandler.visibility = View.GONE }) // holder.binding.llCall.visibility = View.GONE // holder.binding.llAudioCall.visibility = View.VISIBLE /* holder.binding.llStartChat.setOnClickListener(View.OnClickListener { row_index = position listener.onStartCallButtonClicked(data) })*/ // if(data.mobile.equals("")||data.mobile.equals(null)){ // holder.binding.llAudioCall.visibility = View.GONE // } // else{ // holder.binding.llAudioCall.visibility = View.VISIBLE // // } if(data.requestStatus!!.toString().equals("1")) { holder.binding.llCallHandler.visibility = View.VISIBLE } else if(data.requestStatus!!.toString().equals("7")) { holder.binding.llCallHandler.visibility = View.GONE } else if(data.requestStatus!!.toString().equals("3")) { holder.binding.llCallHandler.visibility = View.GONE } } override fun getItemCount(): Int { return List.size } interface OnClick{ fun onCallItemClicked(fixedsessionResponseListData: FixedsessionResponseListData) fun onCallAcceptClicked(fixedsessionResponseListData: FixedsessionResponseListData) fun onCallCancelClicked(fixedsessionResponseListData: FixedsessionResponseListData) fun onStartCallButtonClicked(fixedsessionResponseListData: FixedsessionResponseListData) } }
callastro/app/src/main/java/com/callastro/adapters/NotificationAdapter.kt
1841019302
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.databinding.RowNotificationItemBinding import com.callastro.model.NotificationData import com.callastro.model.NotificationListData class NotificationAdapter (val context : Context, var data: ArrayList<NotificationData>) : RecyclerView.Adapter<NotificationAdapter.ViewHolder>() { var row_index: Int = -1 var isread:Int = 0 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowNotificationItemBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): NotificationAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_notification_item, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: NotificationAdapter.ViewHolder, position: Int) { val List = data[position] holder.binding.tvHead.text = List.title.toString() holder.binding.tvDetail.text = List.message.toString() isread = List.isRead!!.toInt() holder.binding.tvDate.text = List.time if (isread.equals(1)){ holder.binding.tvCount.visibility = View.VISIBLE }else{ holder.binding.tvCount.visibility = View.GONE } } override fun getItemCount(): Int { return data.size } // interface OnClick{ // fun onNotificationItemClicked(notificationListData: NotificationListData) // } }
callastro/app/src/main/java/com/callastro/adapters/ConfirmationBookingReportAdapter.kt
4278216635
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.callastro.R import com.callastro.databinding.RowConfirmationbookingReportBinding import com.callastro.model.ConfirmationBookingData class ConfirmationBookingReportAdapter (val context : Context, var list: List<ConfirmationBookingData>, private val listener: OnClick) : RecyclerView.Adapter<ConfirmationBookingReportAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowConfirmationbookingReportBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ConfirmationBookingReportAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_confirmationbooking_report, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: ConfirmationBookingReportAdapter.ViewHolder, position: Int) { val data = list[position] holder.binding.tvName.text = data.userName holder.binding.tvLanguage.text = data.language holder.binding.tvPhn.text = data.mobileNo Glide.with(context).load(data.profile.toString()).into(holder.binding.ivUserPic) holder.binding.llReport.setOnClickListener(View.OnClickListener { // row_index = position // listener.onCallItemClicked(data) }) holder.binding.ivNext.setOnClickListener(View.OnClickListener { // row_index = position // listener.onCallItemClicked(data) }) holder.binding.linearItem.setOnClickListener(View.OnClickListener { row_index = position listener.onListItemClicked(data) }) /*if(data.requestStatus!!.toString().equals("1")) { holder.binding.llAccept.visibility = View.VISIBLE holder.binding.llCancel.visibility = View.VISIBLE holder.binding.llStartCall.visibility = View.GONE } else if(data.requestStatus!!.toString().equals("2")) { holder.binding.llAccept.visibility = View.GONE holder.binding.llCancel.visibility = View.GONE holder.binding.llStartCall.visibility = View.VISIBLE } else if(data.requestStatus!!.toString().equals("3")) { holder.binding.llAccept.visibility = View.GONE holder.binding.llCancel.visibility = View.GONE holder.binding.llStartCall.visibility = View.GONE } */ } override fun getItemCount(): Int { return list.size } interface OnClick{ fun onListItemClicked(confirmationBookingData: ConfirmationBookingData) } }
callastro/app/src/main/java/com/callastro/adapters/EarningsAdapter.kt
2070530558
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.databinding.RowEarningBinding import com.callastro.model.AstroEarningTransactionHistory class EarningsAdapter (val context : Context, var list: List<AstroEarningTransactionHistory>, private val listener: OnClick) : RecyclerView.Adapter<EarningsAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowEarningBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): EarningsAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_earning, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: EarningsAdapter.ViewHolder, position: Int) { val data = list[position] holder.binding.tvPaymentType.text = data.userName holder.binding.tvAmount.text = "₹"+data.amount holder.binding.tvPaymentFrom.text = data.transaction holder.binding.tvPaymentDate.text = data.payDate //Glide.with(context).load(data.profile.toString()).into(holder.binding.image) holder.binding.linearItem.setOnClickListener(View.OnClickListener { row_index = position listener.onCallItemClicked(data) }) /*if(data.requestStatus!!.toString().equals("1")) { holder.binding.llAccept.visibility = View.VISIBLE holder.binding.llCancel.visibility = View.VISIBLE holder.binding.llStartCall.visibility = View.GONE } else if(data.requestStatus!!.toString().equals("2")) { holder.binding.llAccept.visibility = View.GONE holder.binding.llCancel.visibility = View.GONE holder.binding.llStartCall.visibility = View.VISIBLE } else if(data.requestStatus!!.toString().equals("3")) { holder.binding.llAccept.visibility = View.GONE holder.binding.llCancel.visibility = View.GONE holder.binding.llStartCall.visibility = View.GONE } */ } override fun getItemCount(): Int { return list.size } interface OnClick{ fun onCallItemClicked(astroEarningTransactionHistory: AstroEarningTransactionHistory) } }
callastro/app/src/main/java/com/callastro/adapters/SuggestRemedyChosenProductsAdapter.kt
3746377929
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.os.Build import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.annotation.RequiresApi import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.callastro.R import com.callastro.databinding.RowChosenProductBinding import com.callastro.model.SuggestRemedyListProducts class SuggestRemedyChosenProductsAdapter (val context : Context, var data: ArrayList<SuggestRemedyListProducts>) : RecyclerView.Adapter<SuggestRemedyChosenProductsAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowChosenProductBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SuggestRemedyChosenProductsAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_chosen_product, parent, false) return ViewHolder(itemView) } @RequiresApi(Build.VERSION_CODES.O) @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: SuggestRemedyChosenProductsAdapter.ViewHolder, position: Int) { val List = data[position] holder.binding.tvProductName.text = List.name Glide.with(context).load(List.mainImage).into(holder.binding.ivImage) /*holder.binding.tvRemoveNew.setOnClickListener { row_index = position listener.onRemoveClicked(List) notifyDataSetChanged() }*/ } override fun getItemCount(): Int { return data.size } }
callastro/app/src/main/java/com/callastro/adapters/ChatCancelReasonAdapter.kt
3092850073
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.databinding.RowCancelReasonsBinding import com.callastro.model.ChatCallCancelReasonData import java.util.ArrayList class ChatCancelReasonAdapter (val context: Context, val list: List<ChatCallCancelReasonData>, // private val listener: OnClick ) : RecyclerView.Adapter<ChatCancelReasonAdapter.ViewHolder>() { inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView){ var binding: RowCancelReasonsBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_cancel_reasons, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: ViewHolder, position: Int) { val data = list[position] holder.binding.cbReason.text = data.reason /*holder.binding.llViewdetails.setOnClickListener(View.OnClickListener { val intent = Intent(context, TripDetailsActivity::class.java) intent.putExtra("orderType", "4") context.startActivity(intent) })*/ var listreasonType = ArrayList<String>() var listreasonType_id = ArrayList<String>() /*holder.binding.cbReason.setOnClickListener(View.OnClickListener { view -> if ((view as CompoundButton).isChecked) { val reasonvalue = data.reason val reasonvalue_id = data.id.toString() listreasonType.add(data.reason!!) listreasonType_id.add(data.id.toString()) TripDetailsActivity().checkBox(data.id) // Toast.makeText(context, "Selected CheckBox ID" + data.id, Toast.LENGTH_SHORT).show(); } else { listreasonType.remove(data.reason) listreasonType_id.remove(data.id.toString()) println("Un-Checked") } })*/ } override fun getItemCount(): Int { return list.size } }
callastro/app/src/main/java/com/callastro/adapters/GoLiveAdapter.kt
3750763480
package com.callastro.adapters import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.callastro.R import com.callastro.databinding.LivecommentBinding import com.callastro.model.LiveCommentsModelClassData import com.maxtra.callastro.prefs.UserPref class GoLiveAdapter ( var context: Context, var arrayList:ArrayList<LiveCommentsModelClassData> ) : RecyclerView.Adapter<GoLiveAdapter.Holder>() { lateinit var thelastmessage:String lateinit var userPref: UserPref var lastmessage="" class Holder(view: View) : RecyclerView.ViewHolder(view) { var binding: LivecommentBinding = DataBindingUtil.bind(itemView)!! // var card_item_click = itemView.card_item_click // var tv_name_person = itemView.tv_name_person // var person_image = itemView.person_image // var message = itemView.message } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): Holder { val view = LayoutInflater.from(parent.context) .inflate(R.layout.livecomment, parent, false) return Holder(view) } override fun onBindViewHolder(holder: Holder, position: Int) { val list=arrayList[position] holder.binding.tvNamePerson.text=list.name Glide.with(context).load(list.profile).into(holder.binding.personImage) if (list.type!!.equals(1)){ holder.binding.message.visibility = View.VISIBLE holder.binding.giftImage.visibility = View.GONE holder.binding.message.text=list.message }else if (list.type!!.equals(2)){ holder.binding.giftImage.visibility = View.VISIBLE holder.binding.message.visibility = View.GONE Glide.with(context).load(list.image).into(holder.binding.giftImage) } } override fun getItemCount(): Int { return arrayList.size } interface onItemClick { fun OnItemClick(position: Int, title: String,id:String,image:String) } }
callastro/app/src/main/java/com/callastro/adapters/ViewPagerMyBookingsAdapter.kt
2181983218
package com.callastro.adapters import android.os.Bundle import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentPagerAdapter import com.callastro.ui.fragments.MyBookingsCompletedFragment import com.callastro.ui.fragments.MyBookingsUpcomingFragment class ViewPagerMyBookingsAdapter( fragmentManager: FragmentManager ) : FragmentPagerAdapter(fragmentManager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) { private val titles = arrayOf("Upcoming","Completed") override fun getItem(position: Int): Fragment { val bundle = Bundle() val fragment : Fragment return when (position) { 0 -> { fragment = MyBookingsUpcomingFragment() bundle.putInt("type",0) fragment.arguments = bundle fragment } else -> { fragment = MyBookingsCompletedFragment() bundle.putInt("type",1) fragment.arguments = bundle fragment } } } override fun getCount(): Int { return titles.size } override fun getPageTitle(position: Int): CharSequence? { return titles[position] } }
callastro/app/src/main/java/com/callastro/adapters/SuggestRemedyTextAdapter.kt
3286654802
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.os.Build import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.annotation.RequiresApi import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.databinding.RowSpinnerItemBinding import com.callastro.model.SuggestRemedyListSuggestedMsgt class SuggestRemedyTextAdapter (val context : Context, var data: ArrayList<SuggestRemedyListSuggestedMsgt>) : RecyclerView.Adapter<SuggestRemedyTextAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowSpinnerItemBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SuggestRemedyTextAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_spinner_item, parent, false) return ViewHolder(itemView) } @RequiresApi(Build.VERSION_CODES.O) @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: SuggestRemedyTextAdapter.ViewHolder, position: Int) { val List = data[position] holder.binding.tvName.text = List.suggest.toString() /*holder.binding.tvRemoveNew.setOnClickListener { row_index = position listener.onRemoveClicked(List) notifyDataSetChanged() }*/ } override fun getItemCount(): Int { return data.size } }
callastro/app/src/main/java/com/callastro/adapters/StateListAdapter.kt
189762234
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import android.widget.TextView import com.callastro.R import com.callastro.model.StateListData import com.maxtra.astrorahiastrologer.clicklistener.PopupItemClickListenerCountry class StateListAdapter ( var context: Context, var data: ArrayList<StateListData>, var flag: String, var click: PopupItemClickListenerCountry ) : RecyclerView.Adapter<StateListAdapter.ViewHolder>() { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val mInflater = LayoutInflater.from(context) val view = mInflater.inflate(R.layout.row_spinner_item, parent, false) return ViewHolder(view) } override fun onBindViewHolder(holder: ViewHolder, position: Int) { var ListData = data.get(position) if (flag == "State") { holder.Names.text = ListData.stateName holder.Names.setOnClickListener { ListData.stateName.let { it1 -> if (it1 != null) { ListData.id?.let { it2 -> click.getCountry(it1, flag, it2.toInt()) } } } } } } override fun getItemCount(): Int { return data.size } @SuppressLint("NotifyDataSetChanged") fun filterList(filteredStateList: ArrayList<StateListData>) { data = filteredStateList notifyDataSetChanged() } class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var Names: TextView init { Names = itemView.findViewById(R.id.tvName) } } } /* class StateListAdapter (val context : Context, var list: List<StateListData>, private val listener: OnClick) : RecyclerView.Adapter<StateListAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowSpinnerItemBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): StateListAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_spinner_item, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: StateListAdapter.ViewHolder, position: Int) { val data = list[position] holder.binding.tvName.text = data.stateName.toString() holder.binding.linearItemSpinner.setOnClickListener(View.OnClickListener { row_index = position listener.onItemClicked(data) }) } override fun getItemCount(): Int { return list.size } interface OnClick{ fun onItemClicked(stateListData: StateListData) } }*/
callastro/app/src/main/java/com/callastro/adapters/ChatFragmentAdapter.kt
837690576
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.graphics.Color import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.callastro.R import com.callastro.databinding.RowHomeChatItemBinding import com.callastro.model.ChatUserListData class ChatFragmentAdapter (val context : Context, var list: List<ChatUserListData>, private val listener: OnClick) : RecyclerView.Adapter<ChatFragmentAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowHomeChatItemBinding= DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ChatFragmentAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_home_chat_item, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: ChatFragmentAdapter.ViewHolder, position: Int) { val data = list[position] holder.binding.tvName.text = data.name // holder.binding.tv.text = data.lastOnlineTime Glide.with(context).load(data.profile.toString()).into(holder.binding.ivPict) if(data.isLive!!.toString().equals("1")){ holder.binding.ivDot.visibility = View.VISIBLE holder.binding.tvOnlineStatus.text = "Online" holder.binding.tvOnlineStatus.setTextColor(Color.parseColor("#145901")) //holder.binding.ivVideoCall.setImageDrawable(AppCompatResources.getDrawable(context, R.drawable.ic_video_call1)) // holder.binding.ivAudioCall.setImageDrawable(AppCompatResources.getDrawable(context, R.drawable.ic_call1)) //holder.binding.ivVideoCall.setColorFilter(ContextCompat.getColor(context, R.color.theme_red), android.graphics.PorterDuff.Mode.MULTIPLY); // holder.binding.ivAudioCall.setColorFilter(ContextCompat.getColor(context, R.color.theme_red), android.graphics.PorterDuff.Mode.MULTIPLY); } else if(data.isLive!!.toString().equals("0")){ holder.binding.ivDot.visibility = View.GONE holder.binding.tvOnlineStatus.text = "Online Time " + data.lastOnlineTime holder.binding.tvOnlineStatus.setTextColor(Color.parseColor("#B3B3B3")) // holder.binding.ivVideoCall.setImageDrawable(AppCompatResources.getDrawable(context, R.drawable.ic_video_call1_gray)) // holder.binding.ivAudioCall.setImageDrawable(AppCompatResources.getDrawable(context, R.drawable.ic_call1_gray)) // holder.binding.ivVideoCall.setColorFilter(ContextCompat.getColor(context, R.color.light_gray), android.graphics.PorterDuff.Mode.SRC); // holder.binding.ivAudioCall.setColorFilter(ContextCompat.getColor(context, R.color.light_gray), android.graphics.PorterDuff.Mode.MULTIPLY); } holder.binding.linearItem.setOnClickListener(View.OnClickListener { row_index = position listener.onChatItemClicked(data) }) } override fun getItemCount(): Int { return list.size } interface OnClick{ fun onChatItemClicked(chatUserListData: ChatUserListData) } }
callastro/app/src/main/java/com/callastro/adapters/CallHomeAdapter.kt
2544941100
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.callastro.R import com.callastro.databinding.RowCallRequestBinding import com.callastro.model.Chat_Call_ResponseData class CallHomeAdapter (val context : Context, var list: List<Chat_Call_ResponseData>, private val listener: OnClick) : RecyclerView.Adapter<CallHomeAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowCallRequestBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CallHomeAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_call_request, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: CallHomeAdapter.ViewHolder, position: Int) { val data = list[position] holder.binding.tvName.text = data.userName.toString() holder.binding.tvLanguage.text = data.language.toString() Glide.with(context).load(data.profile.toString()).into(holder.binding.image) if (data.type == 2){ holder.binding.calltype.text = "Audio Call" }else{ holder.binding.calltype.text = "Video Call" } holder.binding.linearItem.setOnClickListener(View.OnClickListener { row_index = position listener.onCallItemClicked(data) }) holder.binding.llAccept.setOnClickListener(View.OnClickListener { row_index = position listener.onCallAcceptClicked(data) }) holder.binding.llCancel.setOnClickListener(View.OnClickListener { row_index = position listener.onCallCancelClicked(data) }) holder.binding.llCall.visibility = View.GONE holder.binding.llAudioCall.visibility = View.VISIBLE holder.binding.llStartCall.setOnClickListener(View.OnClickListener { row_index = position listener.onStartCallButtonClicked(data) }) // if(data.mobile.equals("")||data.mobile.equals(null)){ // holder.binding.llAudioCall.visibility = View.GONE // } // else{ // holder.binding.llAudioCall.visibility = View.VISIBLE // // } if(data.requestStatus!!.toString().equals("1")) { holder.binding.llAccept.visibility = View.VISIBLE holder.binding.llCancel.visibility = View.VISIBLE holder.binding.llStartCall.visibility = View.GONE } else if(data.requestStatus!!.toString().equals("2")) { holder.binding.llAccept.visibility = View.GONE holder.binding.llCancel.visibility = View.GONE holder.binding.llStartCall.visibility = View.VISIBLE } else if(data.requestStatus!!.toString().equals("3")) { holder.binding.llAccept.visibility = View.GONE holder.binding.llCancel.visibility = View.GONE holder.binding.llStartCall.visibility = View.GONE } } override fun getItemCount(): Int { return list.size } interface OnClick{ fun onCallItemClicked(chat_Call_ResponseData: Chat_Call_ResponseData) fun onCallAcceptClicked(chat_Call_ResponseData: Chat_Call_ResponseData) fun onCallCancelClicked(chat_Call_ResponseData: Chat_Call_ResponseData) fun onStartCallButtonClicked(chat_Call_ResponseData: Chat_Call_ResponseData) } }
callastro/app/src/main/java/com/callastro/adapters/GetProfileLanguageAdapter.kt
3054425796
package com.callastro.adapters import android.annotation.SuppressLint import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.databinding.RowExpertiseItemBinding import com.callastro.model.GetAddedLanguageData class GetProfileLanguageAdapter (val list: List<GetAddedLanguageData>, private val listener: OnClick ) : RecyclerView.Adapter<GetProfileLanguageAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView){ var binding: RowExpertiseItemBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_expertise_item, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: ViewHolder, position: Int) { val data = list[position] holder.binding.tvHead.text = data.languageName holder.binding.ivCross.setOnClickListener(View.OnClickListener { row_index = position listener.onLanguageItemDeleteClicked(data) }) } override fun getItemCount(): Int { return list.size } interface OnClick{ fun onLanguageItemDeleteClicked(getAddedLanguageData: GetAddedLanguageData) } }
callastro/app/src/main/java/com/callastro/adapters/GetProfileSkillsAdapter.kt
3415751101
package com.callastro.adapters import android.annotation.SuppressLint import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.databinding.RowExpertiseItemBinding import com.callastro.model.GetAddedSkillsData class GetProfileSkillsAdapter (val list: List<GetAddedSkillsData>, private val listener: OnClick ) : RecyclerView.Adapter<GetProfileSkillsAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView){ var binding: RowExpertiseItemBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_expertise_item, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: ViewHolder, position: Int) { val data = list[position] holder.binding.tvHead.text = data.skillName holder.binding.ivCross.setOnClickListener(View.OnClickListener { row_index = position listener.onSkillsItemDeleteClicked(data) }) } override fun getItemCount(): Int { return list.size } interface OnClick{ fun onSkillsItemDeleteClicked(getAddedSkillsData: GetAddedSkillsData) } }
callastro/app/src/main/java/com/callastro/adapters/CallFragmentAdapter.kt
3722263797
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.graphics.Color import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.appcompat.content.res.AppCompatResources import androidx.core.content.ContextCompat import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.callastro.R import com.callastro.databinding.RowHomeCallItemBinding import com.callastro.model.CallUserListData class CallFragmentAdapter (val context : Context, var list: List<CallUserListData>, private val listener: getId) : RecyclerView.Adapter<CallFragmentAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowHomeCallItemBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CallFragmentAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_home_call_item, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n", "ResourceAsColor") override fun onBindViewHolder(holder: CallFragmentAdapter.ViewHolder, position: Int) { val data = list[position] holder.binding.tvName.text = data.name // holder.binding.tv.text = data.lastOnlineTime Glide.with(context).load(data.profile.toString()).into(holder.binding.ivPict) if(data.isLive!!.toString().equals("1")){ // holder.binding.llButtons.visibility = View.VISIBLE holder.binding.tvOnlineStatus.text = "Online" holder.binding.tvOnlineStatus.setTextColor(Color.parseColor("#145901")) //holder.binding.ivVideoCall.setImageDrawable(AppCompatResources.getDrawable(context, R.drawable.ic_video_call1)) // holder.binding.ivAudioCall.setImageDrawable(AppCompatResources.getDrawable(context, R.drawable.ic_call1)) holder.binding.ivVideoCall.setColorFilter(ContextCompat.getColor(context, R.color.theme_purple), android.graphics.PorterDuff.Mode.MULTIPLY); holder.binding.ivAudioCall.setColorFilter(ContextCompat.getColor(context, R.color.theme_purple), android.graphics.PorterDuff.Mode.MULTIPLY); } else if(data.isLive!!.toString().equals("0")){ // holder.binding.llButtons.visibility = View.GONE holder.binding.tvOnlineStatus.text = "Online Time " + data.lastOnlineTime holder.binding.tvOnlineStatus.setTextColor(Color.parseColor("#B3B3B3")) // holder.binding.ivVideoCall.setImageDrawable(AppCompatResources.getDrawable(context, R.drawable.ic_video_call1_gray)) // holder.binding.ivAudioCall.setImageDrawable(AppCompatResources.getDrawable(context, R.drawable.ic_call1_gray)) holder.binding.ivVideoCall.setColorFilter(ContextCompat.getColor(context, R.color.theme_purple), android.graphics.PorterDuff.Mode.MULTIPLY); holder.binding.ivAudioCall.setColorFilter(ContextCompat.getColor(context, R.color.theme_purple), android.graphics.PorterDuff.Mode.MULTIPLY); } holder.binding.linearItem.setOnClickListener(View.OnClickListener { row_index = position listener.userId(data.userId.toString(),data.name.toString(),"1") }) holder.binding.ivVideoCall.setOnClickListener(View.OnClickListener { row_index = position listener.userId(data.userId.toString(),data.name.toString(),"2") }) holder.binding.ivAudioCall.setOnClickListener(View.OnClickListener { row_index = position listener.userId(data.userId.toString(),data.name.toString(),"3") }) } override fun getItemCount(): Int { return list.size } // // // interface OnClick{ // fun onCallItemClicked(callUserListData: CallUserListData) // fun onVideoItemClicked(callUserListData: CallUserListData) // fun onAudioItemClicked(callUserListData: CallUserListData) // } interface getId{ fun userId(id:String,username:String,type:String) } }
callastro/app/src/main/java/com/callastro/adapters/ConfirmationBookingCallAdapter.kt
255375989
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.Toast import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.callastro.R import com.callastro.databinding.RowConfirmationbookingCallBinding import com.callastro.model.ConfirmationBookingData class ConfirmationBookingCallAdapter (val context : Context, var list: List<ConfirmationBookingData>, private val listener: getUserid) : RecyclerView.Adapter<ConfirmationBookingCallAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowConfirmationbookingCallBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ConfirmationBookingCallAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_confirmationbooking_call, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: ConfirmationBookingCallAdapter.ViewHolder, position: Int) { val data = list[position] holder.binding.tvName.text = data.userName holder.binding.tvLanguage.text = data.language holder.binding.tvPhn.text = data.mobileNo Glide.with(context).load(data.profile.toString()).into(holder.binding.ivUserPic) holder.binding.llStartCall.setOnClickListener(View.OnClickListener { listener.Userid(data.userId.toString(),data.id.toString(),data.userName.toString()) Toast.makeText(context, data.userId.toString(), Toast.LENGTH_SHORT).show() }) // holder.binding.ivNext.setOnClickListener(View.OnClickListener { // row_index = position // listener.onCallItemClicked(data) // }) // // holder.binding.llChat.setOnClickListener(View.OnClickListener { // row_index = position // listener.onCallItemClicked(data) // }) // // holder.binding.linearItem.setOnClickListener(View.OnClickListener { // row_index = position // listener.onListItemClicked(data) // }) /*if(data.requestStatus!!.toString().equals("1")) { holder.binding.llAccept.visibility = View.VISIBLE holder.binding.llCancel.visibility = View.VISIBLE holder.binding.llStartCall.visibility = View.GONE } else if(data.requestStatus!!.toString().equals("2")) { holder.binding.llAccept.visibility = View.GONE holder.binding.llCancel.visibility = View.GONE holder.binding.llStartCall.visibility = View.VISIBLE } else if(data.requestStatus!!.toString().equals("3")) { holder.binding.llAccept.visibility = View.GONE holder.binding.llCancel.visibility = View.GONE holder.binding.llStartCall.visibility = View.GONE } */ } override fun getItemCount(): Int { return list.size } // interface OnClick{ // fun onCallItemClicked(confirmationBookingData: ConfirmationBookingData) // fun onListItemClicked(confirmationBookingData: ConfirmationBookingData) // // } interface getUserid{ fun Userid(id:String,mainid:String,username:String) } }
callastro/app/src/main/java/com/callastro/adapters/ConfirmationBookingChatAdapter.kt
1602426247
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.callastro.R import com.callastro.databinding.RowConfirmationbookingChatBinding import com.callastro.model.ConfirmationBookingData class ConfirmationBookingChatAdapter (val context : Context, var list: List<ConfirmationBookingData>, private val listener: OnClick) : RecyclerView.Adapter<ConfirmationBookingChatAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowConfirmationbookingChatBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ConfirmationBookingChatAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_confirmationbooking_chat, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: ConfirmationBookingChatAdapter.ViewHolder, position: Int) { val data = list[position] holder.binding.tvName.text = data.userName holder.binding.tvLanguage.text = data.language holder.binding.tvPhn.text = data.mobileNo Glide.with(context).load(data.profile.toString()).into(holder.binding.ivUserPic) holder.binding.llStartChat.setOnClickListener(View.OnClickListener { row_index = position listener.onChatItemClicked(data) }) holder.binding.ivNext.setOnClickListener(View.OnClickListener { // row_index = position // listener.onCallItemClicked(data) }) /* holder.binding.llChat.setOnClickListener(View.OnClickListener { //row_index = position // listener.onChatItemClicked(data) })*/ holder.binding.linearItem.setOnClickListener(View.OnClickListener { row_index = position listener.onListItemClicked(data) }) } override fun getItemCount(): Int { return list.size } interface OnClick{ fun onChatItemClicked(confirmationBookingData: ConfirmationBookingData) fun onListItemClicked(confirmationBookingData: ConfirmationBookingData) } }
callastro/app/src/main/java/com/callastro/adapters/SuggestRemedyProductsAdapter.kt
2682829360
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.callastro.R import com.callastro.databinding.RowProductBinding import com.callastro.model.ProductListData class SuggestRemedyProductsAdapter (val context : Context, var list: List<ProductListData>, private val listener: OnClick) : RecyclerView.Adapter<SuggestRemedyProductsAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowProductBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SuggestRemedyProductsAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_product, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: SuggestRemedyProductsAdapter.ViewHolder, position: Int) { val data = list[position] holder.binding.tvProductName.text = data.name Glide.with(context).load(data.mainImage.toString()).into(holder.binding.ivProduct) /*holder.binding.cbTick.setOnClickListener(View.OnClickListener { row_index = position listener.onProductItemClicked(data) })*/ holder.binding.cbTick.setOnCheckedChangeListener { buttonView, isChecked -> if (isChecked) { // show toast , check box is checked row_index = position listener.onProductItemAddClicked(data) } else { // show toast , check box is not checked row_index = position listener.onProductItemRemoveClicked(data) } } /*if(data.requestStatus!!.toString().equals("1")) { holder.binding.llAccept.visibility = View.VISIBLE holder.binding.llCancel.visibility = View.VISIBLE holder.binding.llStartCall.visibility = View.GONE } else if(data.requestStatus!!.toString().equals("2")) { holder.binding.llAccept.visibility = View.GONE holder.binding.llCancel.visibility = View.GONE holder.binding.llStartCall.visibility = View.VISIBLE } else if(data.requestStatus!!.toString().equals("3")) { holder.binding.llAccept.visibility = View.GONE holder.binding.llCancel.visibility = View.GONE holder.binding.llStartCall.visibility = View.GONE } */ } override fun getItemCount(): Int { return list.size } interface OnClick{ fun onProductItemAddClicked(productListData: ProductListData) fun onProductItemRemoveClicked(productListData: ProductListData) } }
callastro/app/src/main/java/com/callastro/adapters/MyBookingsUpcomingAdapter.kt
2863794325
package com.callastro.adapters import android.annotation.SuppressLint import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.databinding.RowConfirmationbookingChatBinding import com.callastro.model.MyBookingsUpcomingCompletedData class MyBookingsUpcomingAdapter (val list: List<MyBookingsUpcomingCompletedData>, private val listener: OnClick ) : RecyclerView.Adapter<MyBookingsUpcomingAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView){ var binding: RowConfirmationbookingChatBinding= DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_confirmationbooking_chat, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: ViewHolder, position: Int) { val data = list[position] holder.binding.tvName.text = data.userName holder.binding.linearItem.setOnClickListener(View.OnClickListener { row_index = position listener.onChatlItemClicked(data) }) } override fun getItemCount(): Int { return list.size } interface OnClick{ fun onChatlItemClicked(myBookingsUpcomingCompletedData: MyBookingsUpcomingCompletedData) } }
callastro/app/src/main/java/com/callastro/adapters/CancellationByUserAdapter.kt
760287201
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.callastro.R import com.callastro.databinding.RowCancellationByUserBinding import com.callastro.model.CancellationByUserData class CancellationByUserAdapter (val context : Context, var list: List<CancellationByUserData>) : RecyclerView.Adapter<CancellationByUserAdapter.ViewHolder>() { inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowCancellationByUserBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_cancellation_by_user, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: ViewHolder, position: Int) { val data = list[position] holder.binding.tvName.text = data.toString() holder.binding.tvLanguage.text = data.language.toString() Glide.with(context).load(data.profile.toString()).into(holder.binding.ivUser) /*holder.binding.linearItem.setOnClickListener(View.OnClickListener { row_index = position listener.onCallItemClicked(data) })*/ /* holder.binding.llAccept.setOnClickListener(View.OnClickListener { row_index = position listener.onCallAcceptClicked(data) }) holder.binding.llCancel.setOnClickListener(View.OnClickListener { row_index = position listener.onCallCancelClicked(data) })*/ /* holder.binding.llCall.visibility = View.GONE holder.binding.llAudioCall.visibility = View.VISIBLE holder.binding.llStartCall.setOnClickListener(View.OnClickListener { row_index = position listener.onStartCallButtonClicked(data) })*/ // if(data.mobile.equals("")||data.mobile.equals(null)){ // holder.binding.llAudioCall.visibility = View.GONE // } // else{ // holder.binding.llAudioCall.visibility = View.VISIBLE // // } //1-Chat Requests,2-Call Requests, 3-Video Call Requests if(data.type!!.toString().equals("1")) { holder.binding.llChat.visibility = View.VISIBLE holder.binding.llAudioCall.visibility = View.GONE holder.binding.llVideoCall.visibility = View.GONE } else if(data.type!!.toString().equals("2")) { holder.binding.llChat.visibility = View.GONE holder.binding.llAudioCall.visibility = View.VISIBLE holder.binding.llVideoCall.visibility = View.GONE } else if(data.type!!.toString().equals("3")) { holder.binding.llChat.visibility = View.GONE holder.binding.llAudioCall.visibility = View.GONE holder.binding.llVideoCall.visibility = View.VISIBLE } } override fun getItemCount(): Int { return list.size } interface OnClick{ // fun onCallItemClicked(chat_Call_ResponseData: Chat_Call_ResponseData) // fun onCallAcceptClicked(chat_Call_ResponseData: Chat_Call_ResponseData) // fun onCallCancelClicked(chat_Call_ResponseData: Chat_Call_ResponseData) // fun onStartCallButtonClicked(chat_Call_ResponseData: Chat_Call_ResponseData) } }
callastro/app/src/main/java/com/callastro/adapters/ReviewRatingSelectAdapter.kt
2319766148
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.Toast import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.callastro.R import com.callastro.databinding.RowSelectRatingReviewBinding import com.callastro.model.GetAstroRatingReviewReviewRatings class ReviewRatingSelectAdapter (val context : Context, var list: List<GetAstroRatingReviewReviewRatings>, private val listener: OnClick) : RecyclerView.Adapter<ReviewRatingSelectAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowSelectRatingReviewBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ReviewRatingSelectAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_select_rating_review, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: ReviewRatingSelectAdapter.ViewHolder, position: Int) { val data = list[position] holder.binding.tvUserName.text = data.userName.toString()+data.id holder.binding.tvDetail.text = data.reveiw.toString() Glide.with(context).load(data.profile.toString()).into(holder.binding.ivImage) holder.binding.ratingByUser.setRating(data.rating!!.toFloat()); if(data.pin!! == 1){ holder.binding.cbReview.isChecked = true //notifyDataSetChanged() Log.d("CheckBoxInfo_adap","str_got1__"+ data.id!! ) } else if(data.pin!! == 0){ holder.binding.cbReview.isChecked = false // notifyDataSetChanged() Log.d("CheckBoxInfo","str_got0__"+ data.id!! ) } holder.binding.cbReview.setOnClickListener(View.OnClickListener { row_index = position var checkAdd: String? ="" if(holder.binding.cbReview.isChecked){ Toast.makeText(context, "checked", Toast.LENGTH_SHORT).show() checkAdd = "1" } else if(!holder.binding.cbReview.isChecked) { Toast.makeText(context, "unchecked", Toast.LENGTH_SHORT).show() checkAdd = "0" } listener.onRatingItemClicked(data,checkAdd.toString()) }) } override fun getItemCount(): Int { return list.size } override fun getItemViewType(position: Int): Int { return position } override fun getItemId(position: Int): Long { return position.toLong() } interface OnClick{ fun onRatingItemClicked(getAstroRatingReviewReviewRatings: GetAstroRatingReviewReviewRatings, checkAdd :String) } }
callastro/app/src/main/java/com/callastro/adapters/CustomerSupportChat.kt
3871929776
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.os.Build import android.text.Html import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.databinding.RowChatwithusBinding import com.callastro.model.ChatListMessageData import com.callastro.model.GetCustomerSupportChatData import com.maxtra.callastro.prefs.UserPref import java.lang.Long import java.text.SimpleDateFormat import java.util.Date class CustomerSupportChat( private val context: Context, messageList: List<GetCustomerSupportChatData> ) : RecyclerView.Adapter<CustomerSupportChat.MyViewHolder>() { private val messageList: List<GetCustomerSupportChatData> private val userPref: UserPref override fun onCreateViewHolder( parent: ViewGroup, viewType: Int ): MyViewHolder { val itemView: View = LayoutInflater.from(parent.context).inflate(R.layout.row_chatwithus, parent, false) return MyViewHolder(itemView) } @SuppressLint("SimpleDateFormat") fun getTimeStampDate(str_date: String): String? { var str_date = str_date val format = SimpleDateFormat("dd-MMM-yy hh.mm a") if (str_date.length < 13) { str_date = (java.lang.Long.valueOf(str_date) * 1000).toString() + "" } var date: Date? = null try { date = Date(Long.valueOf(str_date)) } catch (e: Exception) { e.printStackTrace() } assert(date != null) var timestampValue: String? = "" try { timestampValue = format.format(date) } catch (e: Exception) { e.printStackTrace() } return timestampValue } override fun onBindViewHolder( holder: MyViewHolder, position: Int ) { if (messageList[position].type.toString().equals("1") ) { holder.binding!!.cvMy.visibility = View.VISIBLE holder.binding.cvOther.visibility = View.GONE if (messageList[position].createdAt != null && !messageList[position].createdAt !!.equals("") ) { holder.binding.tvDateTimeMy.text = /*getTimeStampDate(*/ messageList[position].createdAt!!.toString() // ) } else { holder.binding.tvDateTimeMy.text = "" } // // holder.binding.tvMsgMy.text = messageList[position] // .message if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { holder.binding.tvMsgMy.setText(Html.fromHtml(messageList[position].message, Html.FROM_HTML_MODE_LEGACY)); } else holder.binding.tvMsgMy.setText(Html.fromHtml(messageList[position].message)); holder.binding.tvMsgMy.visibility = View.VISIBLE } else { holder.binding!!.cvMy.visibility = View.GONE holder.binding.cvOther.visibility = View.VISIBLE if (messageList[position].createdAt != null && !messageList[position].createdAt !!.equals("") ) { holder.binding.tvDateTimeOther.text = /* getTimeStampDate(*/messageList[position].createdAt!!.toString()/*)*/ } else { holder.binding.tvDateTimeOther.text = "" } // holder.binding.tvMsgOther.text = // if (messageList[position].message != null) messageList[position] // .message else "" if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { holder.binding.tvMsgOther.setText(Html.fromHtml(messageList[position].message, Html.FROM_HTML_MODE_LEGACY)); } else holder.binding.tvMsgOther.setText(Html.fromHtml(messageList[position].message)); holder.binding.tvMsgOther.visibility = View.VISIBLE } } override fun getItemCount(): Int { return messageList.size } inner class MyViewHolder(view: View?) : RecyclerView.ViewHolder(view!!) { val binding: RowChatwithusBinding? = DataBindingUtil.bind(view!!) } init { this.messageList = messageList userPref = UserPref(this.context) } }
callastro/app/src/main/java/com/callastro/adapters/CallHistoryListAdapter.kt
1660063010
package com.callastro.adapters import android.annotation.SuppressLint import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.databinding.RowCallHistoryBinding import com.callastro.model.CallHistoryListData import com.callastro.model.ChatHistoryListData class CallHistoryListAdapter (val list: List<CallHistoryListData>, private val listener: OnClick ) : RecyclerView.Adapter<CallHistoryListAdapter.ViewHolder>() { inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView){ var binding: RowCallHistoryBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_call_history, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: ViewHolder, position: Int) { val data = list[position] // holder.binding.tvNationality.text = data.nationality // holder.binding.tvSessionType.text = data.session_type holder.binding.tvOrderId.text = "Order id: ${data.orderId.toString()}" holder.binding.tvUserName.text = data.userName holder.binding.tvDateTime.text = data.date + " ," + data.time holder.binding.tvDuration.text = data.duration holder.binding.tvCallRate.text = "Calling Charge: ₹ "+data.rate holder.binding.Earned.text = "Earned: ₹ "+data.amount if (data.feedback == ""){ }else{ holder.binding.tvFeedback.text = data.feedback.toString() } if (data.refund_status!!.equals(1)){ holder.binding.llRefundAmount.visibility = View.GONE }else{ holder.binding.llRefundAmount.visibility = View.VISIBLE } holder.binding.ratingUser.setRating(data.rating!!.toFloat()); holder.binding.tvStatus.text = data.status holder.binding.llSuggestRemedy.setOnClickListener(View.OnClickListener { listener.onSuggestRemedyClicked(data) }) holder.binding.llRefundAmount.setOnClickListener(View.OnClickListener { listener.onRefundAmountClicked(data) }) } override fun getItemCount(): Int { return list.size } interface OnClick{ fun onSuggestRemedyClicked(callHistoryListData: CallHistoryListData) fun onRefundAmountClicked(callHistoryListData: CallHistoryListData) } }
callastro/app/src/main/java/com/callastro/adapters/ReviewRatingAllAdapter.kt
2547997242
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.callastro.R import com.callastro.databinding.RowPostprofileReviewsBinding import com.callastro.model.GetAstroRatingReviewReviewRatings class ReviewRatingAllAdapter (val context : Context, var list: List<GetAstroRatingReviewReviewRatings>, private val listener: OnClick) : RecyclerView.Adapter<ReviewRatingAllAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowPostprofileReviewsBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ReviewRatingAllAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_postprofile_reviews, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: ReviewRatingAllAdapter.ViewHolder, position: Int) { val data = list[position] holder.binding.tvUserName.text = data.userName.toString() holder.binding.tvDetail.text = data.reveiw.toString() Glide.with(context).load(data.profile.toString()).into(holder.binding.ivImage) holder.binding.ratingByUser.setRating(data.rating!!.toFloat()); holder.binding.linearItem.setOnClickListener(View.OnClickListener { row_index = position listener.onRatingItemClicked(data) }) } override fun getItemCount(): Int { return list.size } interface OnClick{ fun onRatingItemClicked(getAstroRatingReviewReviewRatings: GetAstroRatingReviewReviewRatings) } }
callastro/app/src/main/java/com/callastro/adapters/ChatHomeAdapter.kt
2032935096
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.callastro.R import com.callastro.databinding.RowChatRequestBinding import com.callastro.model.Chat_Call_ResponseData class ChatHomeAdapter (val context : Context, var list: List<Chat_Call_ResponseData>, private val listener:OnClick) : RecyclerView.Adapter<ChatHomeAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowChatRequestBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ChatHomeAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_chat_request, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: ChatHomeAdapter.ViewHolder, position: Int) { val data = list[position] holder.binding.tvName.text = data.userName.toString() holder.binding.tvLanguage.text = data.language.toString() // Glide.with(context).load(data.toString()).into(holder.binding.image) Glide.with(context).load(data.profile.toString()).into(holder.binding.image) holder.binding.linearItem.setOnClickListener(View.OnClickListener { row_index = position listener.onChatItemClicked(data) }) holder.binding.llAccept.setOnClickListener(View.OnClickListener { row_index = position listener.onChatAcceptClicked(data) }) holder.binding.llCancel.setOnClickListener(View.OnClickListener { row_index = position listener.onChatCancelClicked(data) }) holder.binding.llStartChat.setOnClickListener(View.OnClickListener { row_index = position listener.onStartChatButtonClicked(data) }) if(data.requestStatus!!.toString().equals("1")) { holder.binding.llAccept.visibility = View.VISIBLE holder.binding.llCancel.visibility = View.VISIBLE holder.binding.llStartChat.visibility = View.GONE } else if(data.requestStatus!!.toString().equals("2")) { holder.binding.llAccept.visibility = View.GONE holder.binding.llCancel.visibility = View.GONE holder.binding.llStartChat.visibility = View.VISIBLE } else if(data.requestStatus!!.toString().equals("3")) { holder.binding.llAccept.visibility = View.GONE holder.binding.llCancel.visibility = View.GONE holder.binding.llStartChat.visibility = View.GONE } } override fun getItemCount(): Int { return list.size } interface OnClick{ fun onChatItemClicked(chat_Call_ResponseData: Chat_Call_ResponseData) fun onChatAcceptClicked(chat_Call_ResponseData: Chat_Call_ResponseData) fun onChatCancelClicked(chat_Call_ResponseData: Chat_Call_ResponseData) fun onStartChatButtonClicked(chat_Call_ResponseData: Chat_Call_ResponseData) } }
callastro/app/src/main/java/com/callastro/adapters/CalenderScheduleAdapter.kt
1167193890
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.databinding.RowSelectTimeBinding import com.callastro.model.CalenderListData class CalenderScheduleAdapter (val context : Context, var data: ArrayList<CalenderListData>, private val listener: OnClick) : RecyclerView.Adapter<CalenderScheduleAdapter.ViewHolder>() { inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowSelectTimeBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CalenderScheduleAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_select_time, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: CalenderScheduleAdapter.ViewHolder, position: Int) { val List = data[position] holder.binding.tvTimeFrom.text = List.fromTime.toString() holder.binding.tvTimeTo.text = List.toTime.toString() holder.binding.tvDateView.text = List.date.toString() // Log.d(TAG, "onBindViewHolde6r:AG, "onBindViewHolde6r: "+DateFormat.dealstimeforedit(List.fromTime.toString())) // Log.d(TAG, "onBindViewHolde6r: "+DateFormat.getDealTime(List.fromTime.toString())) // Log.d(TAG, "onBindViewHolde6r: "+DateFormat.dealstime(List.fromTime.toString())) // Log.d(TAG, "onBindViewHolde6r: "+DateFormat.dealstimeforedit(List.fromTime.toString())) "+DateFormat.getDealTime(List.fromTime.toString())) // Log.d(TAG, "onBindViewHolde6r: "+DateFormat.dealstime(List.fromTime.toString())) // Log.d(TAG, "onBindViewHolde6r: "+DateFormat.dealstimeforedit(List.fromTime.toString())) holder.binding.tvRemove.setOnClickListener(View.OnClickListener { listener.onRemovedFromApiClicked(List) }) } override fun getItemCount(): Int { return data.size } interface OnClick{ fun onRemovedFromApiClicked(calenderListData: CalenderListData) } }
callastro/app/src/main/java/com/callastro/adapters/ConfirmationBookingFSAdapter.kt
888747154
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.Toast import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.callastro.R import com.callastro.databinding.RowConfirmationbookingFixedsessionBinding import com.callastro.model.ConfirmationBookingData class ConfirmationBookingFSAdapter( val context: Context, var list: List<ConfirmationBookingData>, private val listener: OnClick ) : RecyclerView.Adapter<ConfirmationBookingFSAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowConfirmationbookingFixedsessionBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder( parent: ViewGroup, viewType: Int ): ConfirmationBookingFSAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context) .inflate(R.layout.row_confirmationbooking_fixedsession, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: ConfirmationBookingFSAdapter.ViewHolder, position: Int) { val data = list[position] holder.binding.tvName.text = data.userName holder.binding.tvLanguage.text = data.language holder.binding.tvPhn.text = data.mobileNo holder.binding.tvFixedSessionTime.text = "Fixed Session: " + data.fix_session Glide.with(context).load(data.profile.toString()).into(holder.binding.ivUserPic) if (data.active_status == 1) { holder.binding.start.text = "Active" } else { holder.binding.start.text = "Waiting" } holder.binding.llStartCall.setOnClickListener(View.OnClickListener { if (data.active_status == 1) { row_index = position listener.onListItemClicked(data) } else { Toast.makeText(context, "session not start", Toast.LENGTH_SHORT).show() } } ) holder.binding.ivNext.setOnClickListener(View.OnClickListener { // row_index = position // listener.onCallItemClicked(data) }) holder.binding.llAudioCall.setOnClickListener(View.OnClickListener { // row_index = position // listener.onCallItemClicked(data) }) holder.binding.linearItem.setOnClickListener(View.OnClickListener { row_index = position listener.onListItemClicked(data) }) /*if(data.requestStatus!!.toString().equals("1")) { holder.binding.llAccept.visibility = View.VISIBLE holder.binding.llCancel.visibility = View.VISIBLE holder.binding.llStartCall.visibility = View.GONE } else if(data.requestStatus!!.toString().equals("2")) { holder.binding.llAccept.visibility = View.GONE holder.binding.llCancel.visibility = View.GONE holder.binding.llStartCall.visibility = View.VISIBLE } else if(data.requestStatus!!.toString().equals("3")) { holder.binding.llAccept.visibility = View.GONE holder.binding.llCancel.visibility = View.GONE holder.binding.llStartCall.visibility = View.GONE } */ } override fun getItemCount(): Int { return list.size } interface OnClick { fun onListItemClicked(confirmationBookingData: ConfirmationBookingData) } }
callastro/app/src/main/java/com/callastro/adapters/ChatHistoryListAdapter.kt
1432224468
package com.callastro.adapters import android.annotation.SuppressLint import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.databinding.RowCallHistoryBinding import com.callastro.model.ChatHistoryListData class ChatHistoryListAdapter (val list: List<ChatHistoryListData>, private val listener: OnClick ) : RecyclerView.Adapter<ChatHistoryListAdapter.ViewHolder>() { inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView){ var binding: RowCallHistoryBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_call_history, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: ViewHolder, position: Int) { val data = list[position] // holder.binding.tvNationality.text = data.nationality // holder.binding.tvSessionType.text = data.session_type holder.binding.tvOrderId.text = "Order id: ${data.orderId.toString()}" holder.binding.tvUserName.text = data.userName holder.binding.tvDateTime.text = data.date + " ," + data.time holder.binding.tvDuration.text = data.duration holder.binding.tvCallRate.text = "Calling Charge: ₹ "+data.rate holder.binding.Earned.text = "Earned: ₹ "+data.amount holder.binding.tvFeedback.text = data.feedback holder.binding.ratingUser.setRating(data.rating!!.toFloat()); holder.binding.tvStatus.text = data.status if (data.refund_status!!.equals(1)){ holder.binding.llRefundAmount.visibility = View.GONE }else{ holder.binding.llRefundAmount.visibility = View.VISIBLE } holder.binding.llSuggestRemedy.setOnClickListener(View.OnClickListener { listener.onSuggestRemedyClicked(data) }) holder.binding.llRefundAmount.setOnClickListener(View.OnClickListener { listener.onRefundAmountClicked(data) }) } override fun getItemCount(): Int { return list.size } interface OnClick{ fun onSuggestRemedyClicked(chatHistoryListData: ChatHistoryListData) fun onRefundAmountClicked(chatHistoryListData: ChatHistoryListData) } }
callastro/app/src/main/java/com/callastro/adapters/MyBookingsCompletedAdapter.kt
3027185452
package com.callastro.adapters import android.annotation.SuppressLint import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.CompoundButton import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.databinding.RowMyBookingsCompletedBinding import com.callastro.model.MyBookingsUpcomingCompletedData import java.util.ArrayList class MyBookingsCompletedAdapter (val list: List<MyBookingsUpcomingCompletedData> ) : RecyclerView.Adapter<MyBookingsCompletedAdapter.ViewHolder>() { inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView){ var binding: RowMyBookingsCompletedBinding= DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_my_bookings_completed, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: ViewHolder, position: Int) { val data = list[position] holder.binding.tvName.text = data.userName /*holder.binding.llViewdetails.setOnClickListener(View.OnClickListener { val intent = Intent(context, TripDetailsActivity::class.java) intent.putExtra("orderType", "4") context.startActivity(intent) })*/ var listreasonType = ArrayList<String>() var listreasonType_id = ArrayList<String>() /*holder.binding.cbReason.setOnClickListener(View.OnClickListener { view -> if ((view as CompoundButton).isChecked) { val reasonvalue = data.reason val reasonvalue_id = data.id.toString() listreasonType.add(data.reason!!) listreasonType_id.add(data.id.toString()) TripDetailsActivity().checkBox(data.id) // Toast.makeText(context, "Selected CheckBox ID" + data.id, Toast.LENGTH_SHORT).show(); } else { listreasonType.remove(data.reason) listreasonType_id.remove(data.id.toString()) println("Un-Checked") } })*/ } override fun getItemCount(): Int { return list.size } }
callastro/app/src/main/java/com/callastro/adapters/BannerAdapter.kt
167519802
package com.callastro.adapters import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.ImageView import com.bumptech.glide.Glide import com.callastro.R import com.callastro.model.BannerResponseData import com.smarteist.autoimageslider.SliderViewAdapter class BannerAdapter ( private val sliderDataArrayList: ArrayList<BannerResponseData>) : SliderViewAdapter<BannerAdapter.BannerAdapterViewHolder>() { class BannerAdapterViewHolder(itemView: View) : ViewHolder(itemView) { var imageViewBackground: ImageView init { imageViewBackground = itemView.findViewById(R.id.iv_auto_image_slider) } } override fun onCreateViewHolder(parent: ViewGroup): BannerAdapter.BannerAdapterViewHolder { val inflate: View = LayoutInflater.from(parent.context).inflate(R.layout.slider_layout, null) return BannerAdapterViewHolder(inflate) } override fun onBindViewHolder(viewHolder: BannerAdapter.BannerAdapterViewHolder, position: Int) { val sliderItem = sliderDataArrayList[position] Glide.with(viewHolder.itemView) .load(sliderItem.image) .fitCenter() .into(viewHolder.imageViewBackground) } override fun getCount(): Int { return sliderDataArrayList.size } }
callastro/app/src/main/java/com/callastro/adapters/CalenderScheduleNewAppAdapter.kt
1140495283
package com.callastro.adapters import android.annotation.SuppressLint import android.content.Context import android.os.Build import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.annotation.RequiresApi import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.databinding.RowSelectTimeNewBinding import com.callastro.model.CreateCalendarSchedule class CalenderScheduleNewAppAdapter (val context : Context, var data: ArrayList<CreateCalendarSchedule>, private val listener: OnClick) : RecyclerView.Adapter<CalenderScheduleNewAppAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var binding: RowSelectTimeNewBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CalenderScheduleNewAppAdapter.ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_select_time_new, parent, false) return ViewHolder(itemView) } @RequiresApi(Build.VERSION_CODES.O) @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: CalenderScheduleNewAppAdapter.ViewHolder, position: Int) { val List = data[position] holder.binding.tvTimeFromNew.text = List.slottime1Show holder.binding.tvTimeToNew.text = List.slottime2Show holder.binding.tvDateViewNew.text = List.slotDate holder.binding.tvRemoveNew.setOnClickListener { row_index = position listener.onRemoveClicked(List) notifyDataSetChanged() } // holder.binding.tvTimeDate.text = List.slotDate // holder.binding.tvTime1.text = DateFormat.orderDateTime(List.slottime1) // holder.binding.tvTime2.text = DateFormat.orderDateTime(List.slottime2) } override fun getItemCount(): Int { return data.size } interface OnClick{ fun onRemoveClicked(createCalendarSchedule: CreateCalendarSchedule) } }
callastro/app/src/main/java/com/callastro/model/ReviewPinUpdateResponse.kt
680911485
package com.callastro.model import com.google.gson.annotations.SerializedName data class ReviewPinUpdateResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : String? = null )
callastro/app/src/main/java/com/callastro/model/AddSkillsItemResponse.kt
397048723
package com.callastro.model import com.google.gson.annotations.SerializedName data class AddSkillsItemResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ArrayList<AddSkillsItemData> = arrayListOf() ) data class AddSkillsItemData ( @SerializedName("id" ) var id : Int? = null, @SerializedName("skill_name" ) var skillName : String? = null )
callastro/app/src/main/java/com/callastro/model/CreateCalendarSchedule.kt
3742203769
package com.callastro.model class CreateCalendarSchedule( var slottime1: String = "", var slottime2: String = "", var slotDate: String = "", var slottime1Show: String = "", var slottime2Show: String = "", var removeSlot: String = "" ) { }
callastro/app/src/main/java/com/callastro/model/GetCustomerSupportChat.kt
1851591579
package com.callastro.model import com.google.gson.annotations.SerializedName data class GetCustomerSupportChat( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ArrayList<GetCustomerSupportChatData> = arrayListOf() ) data class GetCustomerSupportChatData( @SerializedName("id" ) var id : Int? = null, @SerializedName("user_id" ) var userId : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("is_read" ) var isRead : Int? = null, @SerializedName("type" ) var type : Int? = null, @SerializedName("created_at" ) var createdAt : String? = null, @SerializedName("updated_at" ) var updatedAt : String? = null, @SerializedName("time" ) var time : String? = null, @SerializedName("timetwo" ) var timetwo : String? = null, @SerializedName("datetwo" ) var datetwo : String? = null )
callastro/app/src/main/java/com/callastro/model/CallendbyuserResponse.kt
1521346557
package com.callastro.model import com.google.gson.annotations.SerializedName data class CallendbyuserResponse( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : CallendbyuserResponseData? = CallendbyuserResponseData() ) data class CallendbyuserResponseData( @SerializedName("call_end_status" ) var callEndStatus : Int? = null )
callastro/app/src/main/java/com/callastro/model/ChatRequestCancelResponse.kt
1186496974
package com.callastro.model import com.google.gson.annotations.SerializedName data class ChatRequestCancelResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ChatRequestCancelResponseData = ChatRequestCancelResponseData() ) data class ChatRequestCancelResponseData ( @SerializedName("unique_id" ) var unique_id : String? = null, )
callastro/app/src/main/java/com/callastro/model/BankDetailResponse.kt
2046539206
package com.callastro.model import com.google.gson.annotations.SerializedName data class BankDetailResponse( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : BankDetailResponseData? = BankDetailResponseData() ) data class BankDetailResponseData( @SerializedName("id" ) var id : Int? = null, @SerializedName("astro_id" ) var astroId : Int? = null, @SerializedName("bank_name" ) var bankName : String? = null, @SerializedName("account_no" ) var accountNo : String? = null, @SerializedName("holder_name" ) var holderName : String? = null, @SerializedName("ifsc_code" ) var ifscCode : String? = null, @SerializedName("branch" ) var branch : String? = null, @SerializedName("created_at" ) var createdAt : String? = null, @SerializedName("updated_at" ) var updatedAt : String? = null )
callastro/app/src/main/java/com/callastro/model/ChatHistoryListResponse.kt
2395663506
package com.callastro.model import com.google.gson.annotations.SerializedName data class ChatHistoryListResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ArrayList<ChatHistoryListData> = arrayListOf() ) data class ChatHistoryListData ( @SerializedName("id" ) var id : Int? = null, @SerializedName("order_id" ) var orderId : Int? = null, @SerializedName("user_name" ) var userName : String? = null, @SerializedName("userid" ) var userid : String? = null, @SerializedName("date" ) var date : String? = null, @SerializedName("time" ) var time : String? = null, @SerializedName("duration" ) var duration : String? = null, @SerializedName("amount" ) var amount : String? = null, @SerializedName("rate" ) var rate : String? = null, @SerializedName("feedback" ) var feedback : String? = null, @SerializedName("rating" ) var rating : Float? = null, @SerializedName("refund_money" ) var refund_status : Int? = null, @SerializedName("status" ) var status : String? = null, @SerializedName("nationality" ) var nationality : String? = null, @SerializedName("session_type" ) var session_type : String? = null )
callastro/app/src/main/java/com/callastro/model/GetBankDetail.kt
3246795287
package com.callastro.model import com.google.gson.annotations.SerializedName data class GetBankDetail( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : GetBankDetailData? = GetBankDetailData() ) data class GetBankDetailData( @SerializedName("id" ) var id : Int? = null, @SerializedName("astro_id" ) var astroId : Int? = null, @SerializedName("bank_name" ) var bankName : String? = null, @SerializedName("account_no" ) var accountNo : String? = null, @SerializedName("holder_name" ) var holderName : String? = null, @SerializedName("ifsc_code" ) var ifscCode : String? = null, @SerializedName("branch" ) var branch : String? = null, @SerializedName("created_at" ) var createdAt : String? = null, @SerializedName("updated_at" ) var updatedAt : String? = null )
callastro/app/src/main/java/com/callastro/model/CallChatStatusResponse.kt
2993310454
package com.callastro.model import com.google.gson.annotations.SerializedName data class CallChatStatusResponse( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : CallChatStatusResponseData? = CallChatStatusResponseData() ) data class CallChatStatusResponseData( @SerializedName("chat_req" ) var chatReq : Int? = null, @SerializedName("call_req" ) var callReq : Int? = null, @SerializedName("fix_req" ) var fix_req : Int? = null )
callastro/app/src/main/java/com/callastro/model/AstroEarningListResponse.kt
1914443961
package com.callastro.model import com.google.gson.annotations.SerializedName data class AstroEarningListResponse( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ArrayList<AstroEarningListResponseData> = arrayListOf() ) data class AstroEarningListResponseData( @SerializedName("id" ) var id : Int? = null, @SerializedName("type" ) var type : Int? = null, @SerializedName("user_id" ) var userId : Int? = null, @SerializedName("amount" ) var amount : String? = null, @SerializedName("created_at" ) var createdAt : String? = null, @SerializedName("created_time" ) var createdTime : String? = null, @SerializedName("user_name" ) var userName : String? = null, @SerializedName("content" ) var content : String? = null )
callastro/app/src/main/java/com/callastro/model/call_ring_status_save_Response.kt
3480871250
package com.callastro.model import com.google.gson.annotations.SerializedName data class call_ring_status_save_Response( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : call_ring_status_save_ResponseData? = call_ring_status_save_ResponseData() ) data class call_ring_status_save_ResponseData( @SerializedName("status" ) var status : Int? = null )
callastro/app/src/main/java/com/callastro/model/StateListResponse.kt
1650319109
package com.callastro.model import com.google.gson.annotations.SerializedName data class StateListResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ArrayList<StateListData> = arrayListOf() ) data class StateListData ( @SerializedName("id" ) var id : Int? = null, @SerializedName("state_name" ) var stateName : String? = null )
callastro/app/src/main/java/com/callastro/model/GetAstroRatingReviewListResponse.kt
1348855552
package com.callastro.model import com.google.gson.annotations.SerializedName data class GetAstroRatingReviewListResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : GetAstroRatingReviewData? = GetAstroRatingReviewData() ) data class GetAstroRatingReviewReviewRatings ( @SerializedName("id" ) var id : Int? = null, @SerializedName("rating" ) var rating : String? = null, @SerializedName("reveiw" ) var reveiw : String? = null, @SerializedName("user_name" ) var userName : String? = null, @SerializedName("profile" ) var profile : String? = null, @SerializedName("pin" ) var pin : Int? = null ) data class GetAstroRatingReviewCounts ( @SerializedName("total_pin" ) var totalPin : Int? = null, @SerializedName("total_review" ) var totalReview : Int? = null ) data class GetAstroRatingReviewData ( @SerializedName("astro_rating" ) var astroRating : AstroRating? = AstroRating(), @SerializedName("review_ratings" ) var reviewRatings : ArrayList<GetAstroRatingReviewReviewRatings> = arrayListOf(), @SerializedName("counts" ) var counts : GetAstroRatingReviewCounts? = GetAstroRatingReviewCounts() ) data class AstroRating ( @SerializedName("avg_rating" ) var avgRating : String? = null, @SerializedName("total" ) var total : Int? = null, @SerializedName("five" ) var five : Int? = null, @SerializedName("four" ) var four : Int? = null, @SerializedName("three" ) var three : Int? = null, @SerializedName("two" ) var two : Int? = null, @SerializedName("one" ) var one : Int? = null )
callastro/app/src/main/java/com/callastro/model/AgoraGenerateTokenResponse.kt
672284147
package com.callastro.model import com.google.gson.annotations.SerializedName data class AgoraGenerateTokenResponse( @SerializedName("status") var status: Int? = null, @SerializedName("message") var message: String? = null, @SerializedName("data") var data: AgoraGenerateTokenData? = AgoraGenerateTokenData() ) data class AgoraGenerateTokenData( @SerializedName("id") var id: Int? = null, @SerializedName("user_id") var userId: Int? = null, @SerializedName("other_user") var otherUser: Int? = null, @SerializedName("agora_token") var agoraToken: String? = null, @SerializedName("expire_time") var expireTime: String? = null, @SerializedName("channel_name") var channelName: String? = null, @SerializedName("app_id") var appId: String? = null, @SerializedName("from_name") var from_name: String? = null, @SerializedName("from_profile") var from_profile: String? = null, @SerializedName("caller_id") var caller_id: String? = null, @SerializedName("to_name") var to_name: String? = null, @SerializedName("to_profile") var to_profile: String? = null, @SerializedName("created_at") var createdAt: String? = null, @SerializedName("updated_at") var updatedAt: String? = null )
callastro/app/src/main/java/com/callastro/model/ChatListMessageResponse.kt
1530243855
package com.callastro.model import com.google.gson.annotations.SerializedName data class ChatListMessageResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ArrayList<ChatListMessageData> = arrayListOf() ) data class ChatListMessageData ( @SerializedName("id" ) var id : Int? = null, @SerializedName("user_id" ) var userId : Int? = null, @SerializedName("to_userid" ) var toUserid : Int? = null, @SerializedName("from_id" ) var fromId : Int? = null, @SerializedName("to_id" ) var toId : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("type" ) var type : String? = null, @SerializedName("token" ) var token : String? = null, @SerializedName("created_at" ) var createdAt : String? = null, @SerializedName("updated" ) var updated : String? = null )
callastro/app/src/main/java/com/callastro/model/PostProfileUpdateResponse.kt
3808528483
package com.callastro.model import com.google.gson.annotations.SerializedName data class PostProfileUpdateResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : PostProfileUpdateData? = PostProfileUpdateData() ) data class PostProfileUpdateData ( @SerializedName("id" ) var id : Int? = null, @SerializedName("name" ) var name : String? = null, @SerializedName("email" ) var email : String? = null, @SerializedName("profile" ) var profile : String? = null, @SerializedName("is_new" ) var isNew : Int? = null )
callastro/app/src/main/java/com/callastro/model/ChatRequestDetailResponse.kt
2635636050
package com.callastro.model import com.google.gson.annotations.SerializedName data class ChatRequestDetailResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ChatRequestDetailData? = ChatRequestDetailData() ) data class ChatRequestDetailProfileDetail ( @SerializedName("type" ) var type : Int? = null, @SerializedName("username" ) var username : String? = null, @SerializedName("language" ) var language : String? = null, @SerializedName("mobile" ) var mobile : String? = null, @SerializedName("profile_image" ) var profileImage : String? = null ) data class ChatRequestDetailReports ( // @SerializedName("name" ) var name : String? = null, // @SerializedName("dob" ) var dob : String? = null, // @SerializedName("time_birth" ) var timeBirth : String? = null, // @SerializedName("place_birth" ) var placeBirth : String? = null, // @SerializedName("occupation" ) var occupation : String? = null, // @SerializedName("maritial_status" ) var maritialStatus : String? = null, // @SerializedName("topic_consultant" ) var topicConsultant : String? = null @SerializedName("name" ) var name : String? = null, @SerializedName("dob" ) var dob : String? = null, @SerializedName("time_birth" ) var timeBirth : String? = null, @SerializedName("place_birth" ) var placeBirth : String? = null, @SerializedName("occupation" ) var occupation : String? = null, @SerializedName("maritial_status" ) var maritialStatus : String? = null, @SerializedName("topic_consultant" ) var topicConsultant : String? = null, @SerializedName("boy_name" ) var boyName : String? = null, @SerializedName("dob_boy" ) var dobBoy : String? = null, @SerializedName("birth_time_boy" ) var birthTimeBoy : String? = null, @SerializedName("place_birth_boy" ) var placeBirthBoy : String? = null, @SerializedName("occupation_boy" ) var occupationBoy : String? = null, @SerializedName("maritial_status_boy" ) var maritialStatusBoy : String? = null, @SerializedName("topic_consultation_boy" ) var topicConsultationBoy : String? = null, @SerializedName("girl_name" ) var girlName : String? = null, @SerializedName("dob_girl" ) var dobGirl : String? = null, @SerializedName("birth_time_girl" ) var birthTimeGirl : String? = null, @SerializedName("place_birth_girl" ) var placeBirthGirl : String? = null, @SerializedName("occupation_girl" ) var occupationGirl : String? = null, @SerializedName("maritial_status_girl" ) var maritialStatusGirl : String? = null, @SerializedName("topic_consultation_girl" ) var topicConsultationGirl : String? = null, @SerializedName("state" ) var state : String? = null, @SerializedName("city" ) var city : String? = null, @SerializedName("fixed_session" ) var fixedSession : String? = null, @SerializedName("fixed_session_type" ) var fixedSessionType : String? = null, @SerializedName("calendar_schedules_id" ) var calendarSchedulesId : String? = null ) data class ChatRequestDetailData ( @SerializedName("profile_detail" ) var profileDetail : ChatRequestDetailProfileDetail? = ChatRequestDetailProfileDetail(), @SerializedName("reports" ) var reports : ChatRequestDetailReports? = ChatRequestDetailReports() )
callastro/app/src/main/java/com/callastro/model/BannerResponse.kt
3189620757
package com.callastro.model import com.google.gson.annotations.SerializedName data class BannerResponse( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ArrayList<BannerResponseData> = arrayListOf() ) data class BannerResponseData( @SerializedName("id" ) var id : Int? = null, @SerializedName("image" ) var image : String? = null, // @SerializedName("status" ) var status : Int? = null, // @SerializedName("created_at" ) var createdAt : String? = null, // @SerializedName("updated_at" ) var updatedAt : String? = null )
callastro/app/src/main/java/com/callastro/model/SuggestRemedyListResponse.kt
515419246
package com.callastro.model import com.google.gson.annotations.SerializedName data class SuggestRemedyListResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : SuggestRemedyListData? = SuggestRemedyListData() ) data class SuggestRemedyListSuggestedMsgt ( @SerializedName("id" ) var id : Int? = null, @SerializedName("suggest" ) var suggest : String? = null ) data class SuggestRemedyListProducts ( @SerializedName("id" ) var id : Int? = null, @SerializedName("main_image" ) var mainImage : String? = null, @SerializedName("name" ) var name : String? = null ) data class SuggestRemedyListData ( @SerializedName("suggested_msgt" ) var suggestedMsgt : ArrayList<SuggestRemedyListSuggestedMsgt> = arrayListOf(), @SerializedName("products" ) var products : ArrayList<SuggestRemedyListProducts> = arrayListOf() )
callastro/app/src/main/java/com/callastro/model/ExperienceListResponse.kt
1461494489
package com.callastro.model import com.google.gson.annotations.SerializedName data class ExperienceListResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ArrayList<ExperienceListData> = arrayListOf() ) data class ExperienceListData ( @SerializedName("id" ) var id : Int? = null, @SerializedName("experience" ) var experience : String? = null )
callastro/app/src/main/java/com/callastro/model/ManageCalendarScheduleResponse.kt
4171933896
package com.callastro.model import com.google.gson.annotations.SerializedName data class ManageCalendarScheduleResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : String? = null )
callastro/app/src/main/java/com/callastro/model/DeleteLanguageItemResponse.kt
3982620461
package com.callastro.model import com.google.gson.annotations.SerializedName data class DeleteLanguageItemResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : String? = null )
callastro/app/src/main/java/com/callastro/model/Chat_Call_Response.kt
449829967
package com.callastro.model import com.google.gson.annotations.SerializedName data class Chat_Call_Response( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ArrayList<Chat_Call_ResponseData> = arrayListOf() ) data class Chat_Call_ResponseData( @SerializedName("id" ) var id : Int? = null, @SerializedName("type" ) var type : Int? = null, @SerializedName("user_id" ) var userId : Int? = null, @SerializedName("astro_id" ) var astroId : Int? = null, @SerializedName("request_status" ) var requestStatus : Int? = null, @SerializedName("created_at" ) var createdAt : String? = null, @SerializedName("updated_at" ) var updatedAt : String? = null, @SerializedName("user_name" ) var userName : String? = null, @SerializedName("unique_id" ) var unique_id : String? = null, @SerializedName("language" ) var language : String? = null, @SerializedName("profile" ) var profile : String? = null, @SerializedName("mobile" ) var mobile : String? = null )
callastro/app/src/main/java/com/callastro/model/CancellationByUserResponse.kt
3429010720
package com.callastro.model import com.google.gson.annotations.SerializedName data class CancellationByUserResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ArrayList<CancellationByUserData> = arrayListOf() ) data class CancellationByUserData ( @SerializedName("id" ) var id : Int? = null, @SerializedName("user_detail_id" ) var userDetailId : String? = null, @SerializedName("type" ) var type : Int? = null, @SerializedName("user_id" ) var userId : Int? = null, @SerializedName("astro_id" ) var astroId : Int? = null, @SerializedName("language_id" ) var languageId : Int? = null, @SerializedName("request_status" ) var requestStatus : Int? = null, @SerializedName("reason" ) var reason : Int? = null, @SerializedName("comment" ) var comment : String? = null, @SerializedName("created_at" ) var createdAt : String? = null, @SerializedName("updated_at" ) var updatedAt : String? = null, @SerializedName("user_name" ) var userName : String? = null, @SerializedName("language" ) var language : String? = null, @SerializedName("profile" ) var profile : String? = null )
callastro/app/src/main/java/com/callastro/model/NotificationListResponse.kt
1884759158
package com.callastro.model import com.google.gson.annotations.SerializedName data class NotificationListResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ArrayList<NotificationListData> = arrayListOf() ) data class NotificationListData ( @SerializedName("id" ) var id : Int? = null, @SerializedName("is_read" ) var isRead : Int? = null, @SerializedName("created_at" ) var createdAt : String? = null, @SerializedName("time" ) var time : String? = null, @SerializedName("title" ) var title : String? = null, )
callastro/app/src/main/java/com/callastro/model/AddAstroDetailResponse.kt
1313656799
package com.callastro.model import com.google.gson.annotations.SerializedName data class AddAstroDetailResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : AddAstroDetailData? = AddAstroDetailData() ) data class AddAstroDetailData ( @SerializedName("id" ) var id : Int? = null, @SerializedName("name" ) var name : String? = null, @SerializedName("email" ) var email : String? = null, @SerializedName("profile" ) var profile : String? = null, @SerializedName("is_new" ) var isNew : Int? = null )
callastro/app/src/main/java/com/callastro/model/AddLanguageItemResponse.kt
1040290567
package com.callastro.model import com.google.gson.annotations.SerializedName data class AddLanguageItemResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ArrayList<AddLanguageItemData> = arrayListOf() ) data class AddLanguageItemData ( @SerializedName("id" ) var id : Int? = null, @SerializedName("language_name" ) var languageName : String? = null )
callastro/app/src/main/java/com/callastro/model/ChatAgoraResponse.kt
2720289751
package com.callastro.model import com.google.gson.annotations.SerializedName data class ChatAgoraResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ChatAgoraData? = ChatAgoraData() ) /*data class ChatAgoraSubData ( @SerializedName("22" ) var 22 : String? = null )*/ // // @SerializedName("data" ) var data : ChatAgoraSubData? = ChatAgoraSubData(), data class ChatAgoraData ( @SerializedName("path" ) var path : String? = null, @SerializedName("uri" ) var uri : String? = null, @SerializedName("timestamp" ) var timestamp : Long? = null, @SerializedName("organization" ) var organization : String? = null, @SerializedName("application" ) var application : String? = null, @SerializedName("caller_id" ) var caller_id : String? = null, @SerializedName("action" ) var action : String? = null, @SerializedName("duration" ) var duration : Int? = null, @SerializedName("applicationName" ) var applicationName : String? = null )
callastro/app/src/main/java/com/callastro/model/CallRequestDetailResponse.kt
3003936998
package com.callastro.model import com.google.gson.annotations.SerializedName data class CallRequestDetailResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : CallRequestDetailData? = CallRequestDetailData() ) data class CallRequestDetailProfileDetail ( @SerializedName("username" ) var username : String? = null, @SerializedName("language" ) var language : String? = null, @SerializedName("type" ) var type : Int? = null, @SerializedName("mobile" ) var mobile : String? = null, @SerializedName("profile_image" ) var profileImage : String? = null ) data class CallRequestDetailReports ( // @SerializedName("name" ) var name : String? = null, // @SerializedName("dob" ) var dob : String? = null, // @SerializedName("time_birth" ) var timeBirth : String? = null, // @SerializedName("place_birth" ) var placeBirth : String? = null, // @SerializedName("occupation" ) var occupation : String? = null, // @SerializedName("maritial_status" ) var maritialStatus : String? = null, // @SerializedName("topic_consultant" ) var topicConsultant : String? = null @SerializedName("name" ) var name : String? = null, @SerializedName("dob" ) var dob : String? = null, @SerializedName("time_birth" ) var timeBirth : String? = null, @SerializedName("place_birth" ) var placeBirth : String? = null, @SerializedName("occupation" ) var occupation : String? = null, @SerializedName("maritial_status" ) var maritialStatus : String? = null, @SerializedName("topic_consultant" ) var topicConsultant : String? = null, @SerializedName("boy_name" ) var boyName : String? = null, @SerializedName("dob_boy" ) var dobBoy : String? = null, @SerializedName("birth_time_boy" ) var birthTimeBoy : String? = null, @SerializedName("place_birth_boy" ) var placeBirthBoy : String? = null, @SerializedName("occupation_boy" ) var occupationBoy : String? = null, @SerializedName("maritial_status_boy" ) var maritialStatusBoy : String? = null, @SerializedName("topic_consultation_boy" ) var topicConsultationBoy : String? = null, @SerializedName("girl_name" ) var girlName : String? = null, @SerializedName("dob_girl" ) var dobGirl : String? = null, @SerializedName("birth_time_girl" ) var birthTimeGirl : String? = null, @SerializedName("place_birth_girl" ) var placeBirthGirl : String? = null, @SerializedName("occupation_girl" ) var occupationGirl : String? = null, @SerializedName("maritial_status_girl" ) var maritialStatusGirl : String? = null, @SerializedName("topic_consultation_girl" ) var topicConsultationGirl : String? = null, @SerializedName("state" ) var state : String? = null, @SerializedName("city" ) var city : String? = null, @SerializedName("created_at" ) var createdAt : String? = null, @SerializedName("updated_at" ) var updatedAt : String? = null, @SerializedName("fixed_session" ) var fixedSession : String? = null, @SerializedName("fixed_session_type" ) var fixedSessionType : String? = null, @SerializedName("calendar_schedules_id" ) var calendarSchedulesId : String? = null ) data class CallRequestDetailData ( @SerializedName("profile_detail" ) var profileDetail : CallRequestDetailProfileDetail? = CallRequestDetailProfileDetail(), @SerializedName("intak" ) var intak : CallRequestDetailReports? = CallRequestDetailReports() )
callastro/app/src/main/java/com/callastro/model/PincodeListResponse.kt
3755686765
package com.callastro.model import com.google.gson.annotations.SerializedName data class PincodeListResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ArrayList<PincodeListData> = arrayListOf() ) data class PincodeListData ( @SerializedName("id" ) var id : Int? = null, @SerializedName("city_id" ) var cityId : Int? = null, @SerializedName("pincode" ) var pincode : String? = null, @SerializedName("created_at" ) var createdAt : String? = null, @SerializedName("updated_at" ) var updatedAt : String? = null )
callastro/app/src/main/java/com/callastro/model/ExpertizeResponse.kt
1677530338
package com.callastro.model import com.google.gson.annotations.SerializedName data class ExpertizeResponse( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ArrayList<ExpertizeResponseData> = arrayListOf() ) data class ExpertizeResponseData( @SerializedName("id" ) var id : Int? = null, @SerializedName("name" ) var name : String? = null )
callastro/app/src/main/java/com/callastro/model/FixedsessionResponseList.kt
3385171914
package com.callastro.model import com.google.gson.annotations.SerializedName data class FixedsessionResponseList( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ArrayList<FixedsessionResponseListData> = arrayListOf() ) data class FixedsessionResponseListData( @SerializedName("id" ) var id : Int? = null, @SerializedName("user_detail_id" ) var userDetailId : Int? = null, @SerializedName("type" ) var type : Int? = null, @SerializedName("user_id" ) var userId : Int? = null, @SerializedName("astro_id" ) var astroId : Int? = null, @SerializedName("language_id" ) var languageId : Int? = null, @SerializedName("request_status" ) var requestStatus : Int? = null, @SerializedName("reason" ) var reason : String? = null, @SerializedName("comment" ) var comment : String? = null, @SerializedName("unique_id" ) var uniqueId : String? = null, @SerializedName("action_by" ) var actionBy : String? = null, @SerializedName("created_at" ) var createdAt : String? = null, @SerializedName("updated_at" ) var updatedAt : String? = null, @SerializedName("user_name" ) var userName : String? = null, @SerializedName("mobile" ) var mobile : String? = null, @SerializedName("language" ) var language : String? = null, @SerializedName("profile" ) var profile : String? = null, @SerializedName("fix_session" ) var fix_session : String? = null, @SerializedName("fixed_session_type" ) var fix_session_type : Int? = null, @SerializedName("session_type" ) var sessionType : Int? = null )
callastro/app/src/main/java/com/callastro/model/EmailUs_Response.kt
1683192118
package com.callastro.model import com.google.gson.annotations.SerializedName data class EmailUs_Response( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : EmailUs_ResponseData? = EmailUs_ResponseData() ) data class EmailUs_ResponseData( @SerializedName("id" ) var id : Int? = null, @SerializedName("email" ) var email : String? = null )
callastro/app/src/main/java/com/callastro/model/CallHistoryListResponse.kt
150840310
package com.callastro.model import com.google.gson.annotations.SerializedName data class CallHistoryListResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ArrayList<CallHistoryListData> = arrayListOf() ) data class CallHistoryListData ( @SerializedName("id" ) var id : Int? = null, @SerializedName("order_id" ) var orderId : Int? = null, @SerializedName("user_name" ) var userName : String? = null, @SerializedName("date" ) var date : String? = null, @SerializedName("userid" ) var userid : String? = null, @SerializedName("time" ) var time : String? = null, @SerializedName("duration" ) var duration : String? = null, @SerializedName("rate" ) var rate : String? = null, @SerializedName("amount" ) var amount : String? = null, @SerializedName("feedback" ) var feedback : String? = null, @SerializedName("refund_money" ) var refund_status : Int? = null, @SerializedName("rating" ) var rating : Double? = null, @SerializedName("status" ) var status : String? = null, @SerializedName("nationality" ) var nationality : String? = null, @SerializedName("session_type" ) var session_type : String? = null )
callastro/app/src/main/java/com/callastro/model/GetProfileExpertiseAdapter.kt
3021369361
package com.callastro.model import android.annotation.SuppressLint import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.RecyclerView import com.callastro.R import com.callastro.databinding.RowExpertiseItemBinding class GetProfileExpertiseAdapter (val list: List<GetAddedExpertiseData>, private val listener: OnClick ) : RecyclerView.Adapter<GetProfileExpertiseAdapter.ViewHolder>() { var row_index: Int = -1 inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView){ var binding: RowExpertiseItemBinding = DataBindingUtil.bind(itemView)!! } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val itemView = LayoutInflater.from(parent.context).inflate(R.layout.row_expertise_item, parent, false) return ViewHolder(itemView) } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: ViewHolder, position: Int) { val data = list[position] holder.binding.tvHead.text = data.expertiseName holder.binding.ivCross.setOnClickListener(View.OnClickListener { row_index = position listener.onExpertiseItemDeleteClicked(data) }) } override fun getItemCount(): Int { return list.size } interface OnClick{ fun onExpertiseItemDeleteClicked(getAddedExpertiseData: GetAddedExpertiseData) } }
callastro/app/src/main/java/com/callastro/model/ProductListResponse.kt
2053429162
package com.callastro.model import com.google.gson.annotations.SerializedName data class ProductListResponse ( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ArrayList<ProductListData> = arrayListOf() ) data class ProductListData ( @SerializedName("id" ) var id : Int? = null, @SerializedName("name" ) var name : String? = null, @SerializedName("main_image" ) var mainImage : String? = null )
callastro/app/src/main/java/com/callastro/model/CallRingResponse.kt
170951658
package com.callastro.model import com.google.gson.annotations.SerializedName data class CallRingResponse( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : CallRingResponseData? = CallRingResponseData() ) data class CallRingResponseData( @SerializedName("ring_status" ) var ringStatus : Int? = null )
callastro/app/src/main/java/com/callastro/model/GoLiveResponse.kt
1092275384
package com.callastro.model import com.google.gson.annotations.SerializedName data class GoLiveResponse( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : GoLiveResponseData? = GoLiveResponseData() ) data class GoLiveResponseData( @SerializedName("id" ) var id : Int? = null, @SerializedName("user_id" ) var userId : Int? = null, @SerializedName("topic" ) var topic : String? = null, @SerializedName("agora_token" ) var agoraToken : String? = null, @SerializedName("channel_name" ) var channelName : String? = null, @SerializedName("appId" ) var appId : String? = null, @SerializedName("expire_time" ) var expireTime : String? = null, @SerializedName("created_at" ) var createdAt : String? = null, @SerializedName("updated_at" ) var updatedAt : String? = null )
callastro/app/src/main/java/com/callastro/model/NotificationResponse.kt
2027780598
package com.callastro.model import com.google.gson.annotations.SerializedName data class NotificationResponse( @SerializedName("status" ) var status : Int? = null, @SerializedName("message" ) var message : String? = null, @SerializedName("data" ) var data : ArrayList<NotificationData> = arrayListOf() ) data class NotificationData( @SerializedName("id" ) var id : Int? = null, @SerializedName("is_read" ) var isRead : Int? = null, @SerializedName("created_at" ) var createdAt : String? = null, @SerializedName("time" ) var time : String? = null, @SerializedName("title" ) var title : String? = null, @SerializedName("message" ) var message : String? = null, )