Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions app/objectbox-models/default.json.bak
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,9 @@
{
"id": "3:2880955115990580488",
"name": "cardNumber",
"type": 9
"indexId": "24:5078945634884132146",
"type": 9,
"flags": 2080
},
{
"id": "4:3076818549596311869",
Expand Down Expand Up @@ -472,7 +474,7 @@
}
],
"lastEntityId": "31:6910879426788537457",
"lastIndexId": "23:2893800455538585981",
"lastIndexId": "24:5078945634884132146",
"lastRelationId": "11:5984758523878906706",
"lastSequenceId": "0:0",
"modelVersion": 5,
Expand Down
46 changes: 46 additions & 0 deletions app/src/main/java/com/checkin/app/checkin/Shop/Utilitiesext.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.checkin.app.checkin.Shop

import android.content.Context
import android.graphics.Color
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.checkin.app.checkin.R
import com.checkin.app.checkin.home.epoxy.NearbyRestaurantModelHolder
import com.checkin.app.checkin.restaurant.activities.PublicRestaurantProfileActivity
import io.objectbox.BoxStore
import io.objectbox.BoxStore.context




fun NearbyRestaurantModelHolder.changerating(ratings:Double, tvRating :TextView){
rate(ratings.toFloat(),tvRating)
}

fun PublicRestaurantProfileActivity.changerating(ratings:Float, tvRating :TextView){
rate(ratings,tvRating)

}

fun rate(ratings:Float, tvrating :TextView){
when(ratings){
in 4.0..5.0 -> tvrating.setBackgroundResource(R.color.apple_green)
in 3.0..4.0 -> tvrating.setBackgroundResource(R.color.orange_red)
else -> tvrating.setBackgroundResource(R.color.primary_red)

}
}

/*fun ratingvalue(rating: Float,color: Int): Int {

when(rating){
in 4.0..5.0 -> color== R.color.apple_green
in 3.0..4.0 -> color==R.color.orange_red
else -> color == R.color.primary_red
}
return color
}

*/


Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ object RemoteConfig {
const val SUPPORT_YOUTUBE_CHANNEL_ID = "checkin_support_youtube_channel_id"
const val HOME_TOP_BANNERS_AD = "checkin_home_banners_top"
const val KEY_RAZORPAY = "checkin_key_razorpay"
const val ENABLED_REWARDS = "checkin_enable_rewards"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import butterknife.BindView
import com.airbnb.epoxy.EpoxyAttribute
import com.airbnb.epoxy.EpoxyModelClass
import com.airbnb.epoxy.EpoxyModelWithHolder
import com.checkin.app.checkin.R
import com.checkin.app.checkin.Shop.changerating
import com.checkin.app.checkin.home.model.NearbyRestaurantModel
import com.checkin.app.checkin.misc.epoxy.BaseEpoxyHolder
import com.checkin.app.checkin.restaurant.activities.openPublicRestaurantProfile
Expand Down Expand Up @@ -65,6 +67,9 @@ abstract class NearbyRestaurantModelHolder : EpoxyModelWithHolder<NearbyRestaura
}

tvRating.text = data.formatRating

changerating(data.ratings,tvRating)

tvDistance.text = data.formatDistance

imDistance.setImageResource(if (data.distance > 1.5) R.drawable.ic_distance_vehicle else R.drawable.ic_distance_walking)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import butterknife.BindView
import butterknife.ButterKnife
import butterknife.OnClick
import com.checkin.app.checkin.R
import com.checkin.app.checkin.Shop.changerating
import com.checkin.app.checkin.auth.exceptions.InvalidOTPException
import com.checkin.app.checkin.auth.fragments.OtpVerificationDialog
import com.checkin.app.checkin.auth.fragments.PhoneEditDialog
Expand Down Expand Up @@ -393,6 +394,9 @@ class PublicRestaurantProfileActivity : BaseActivity(), AppBarLayout.OnOffsetCha
} else "-"
} ?: "-"
tvRating.text = restaurantModel.formatRating()

changerating(restaurantModel.rating,tvRating)

tvDistance.text = restaurantModel.formatDistance

imDistance.setImageResource(if (restaurantModel.distance > 1.5) R.drawable.ic_distance_vehicle else R.drawable.ic_distance_walking)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import butterknife.OnClick
import com.airbnb.epoxy.EpoxyRecyclerView
import com.checkin.app.checkin.R
import com.checkin.app.checkin.accounts.AccountUtil
import com.checkin.app.checkin.data.config.RemoteConfig
import com.checkin.app.checkin.data.resource.ProblemModel
import com.checkin.app.checkin.data.resource.Resource
import com.checkin.app.checkin.menu.controllers.CartOrderedItemController
Expand Down Expand Up @@ -78,6 +79,8 @@ class ScheduledSessionCartView @JvmOverloads constructor(
internal lateinit var tvRestaurantName: TextView
@BindView(R.id.tv_cart_header_restaurant_locality)
internal lateinit var tvRestaurantLocality: TextView
@BindView(R.id.container_cart_referral)
internal lateinit var checkinrewards: ViewGroup

lateinit var activity: FragmentActivity
lateinit var viewModel: ScheduledCartViewModel
Expand All @@ -96,7 +99,11 @@ class ScheduledSessionCartView @JvmOverloads constructor(
}
billHolder = BillHolder(this)
setupUi()

}
private val supportrewards by lazy { RemoteConfig[RemoteConfig.Constants.ENABLED_REWARDS].asBoolean() }



private fun setupUi() {
nestedSvCart.setOnTouchListener { v, event ->
Expand All @@ -110,6 +117,7 @@ class ScheduledSessionCartView @JvmOverloads constructor(
}
epoxyRvCartOrders.setHasFixedSize(false)
epoxyRvCartOrders.setControllerAndBuildModels(ordersController)

}

fun isExpanded() = bottomSheetBehavior.state == BottomSheetBehavior.STATE_EXPANDED
Expand Down Expand Up @@ -142,6 +150,7 @@ class ScheduledSessionCartView @JvmOverloads constructor(
@OnClick(R.id.container_cart_footer_pay_button)
fun onClickPayment() {
listener.onStartPayment()

}

fun setup(activity: FragmentActivity) {
Expand Down Expand Up @@ -260,6 +269,11 @@ class ScheduledSessionCartView @JvmOverloads constructor(
tvAppliedPromoDetails.text = data.details
}

private fun enablerewards(){
if (supportrewards)
checkinrewards.visibility = View.GONE
}

private fun resetPromoCards() {
containerRemovePromo.visibility = View.GONE
containerApplyPromo.visibility = View.GONE
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/xml/remote_config_defaults.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@
<key>checkin_support_youtube_channel_id</key>
<value>UCdQcZz5zv7zJZscHKL5-ZOw</value>
</entry>
<entry>
<key>checkin_enable_rewards</key>
<value>false</value>
</entry>
</defaultsMap>