Add to cart function
This commit is contained in:
parent
6b94ee730d
commit
e8fc0899ca
10
app/src/main/java/me/gilo/wc/Config.java
Normal file
10
app/src/main/java/me/gilo/wc/Config.java
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package me.gilo.wc;
|
||||||
|
|
||||||
|
public class Config {
|
||||||
|
public static String currencySymbol = "Ksh.";
|
||||||
|
|
||||||
|
public static String siteUrl = "http://192.168.100.61/shop/index.php";
|
||||||
|
public static String consumerKey = "ck_da34628a4a69128001876492b842be4cd3c76bf8";
|
||||||
|
public static String consumerSecret = "cs_c3c70248288a60bc21a0cddc81acdc018df1632d";
|
||||||
|
|
||||||
|
}
|
||||||
@ -2,6 +2,7 @@ package me.gilo.wc.di;
|
|||||||
|
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
import dagger.Provides;
|
import dagger.Provides;
|
||||||
|
import me.gilo.wc.Config;
|
||||||
import me.gilo.wc.WcApp;
|
import me.gilo.wc.WcApp;
|
||||||
import me.gilo.woodroid.Woocommerce;
|
import me.gilo.woodroid.Woocommerce;
|
||||||
|
|
||||||
@ -26,10 +27,10 @@ public class AppModule {
|
|||||||
@Singleton
|
@Singleton
|
||||||
Woocommerce providesWoocommerce() {
|
Woocommerce providesWoocommerce() {
|
||||||
Woocommerce woocommerce = Woocommerce.Builder()
|
Woocommerce woocommerce = Woocommerce.Builder()
|
||||||
.setSiteUrl("http://157.230.131.179")
|
.setSiteUrl(Config.siteUrl)
|
||||||
.setApiVersion(Woocommerce.API_V3)
|
.setApiVersion(Woocommerce.API_V3)
|
||||||
.setConsumerKey("ck_26c61abd7eeff238d87dc56585bf26cb2d1a1ec3")
|
.setConsumerKey(Config.consumerKey)
|
||||||
.setConsumerSecret("cs_062e8e3a7ae0ce08fdebc0c39f8f834d5e87598e")
|
.setConsumerSecret(Config.consumerSecret)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return woocommerce;
|
return woocommerce;
|
||||||
|
|||||||
@ -38,6 +38,11 @@ public class FirebaseUserRepository extends FirebaseRepository {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void logout() {
|
||||||
|
FirebaseAuth auth = FirebaseAuth.getInstance();
|
||||||
|
auth.signOut();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public CompletionGenericLiveData<AuthResult> anonymousSignIn() {
|
public CompletionGenericLiveData<AuthResult> anonymousSignIn() {
|
||||||
final CompletionGenericLiveData<AuthResult> completion = new CompletionGenericLiveData();
|
final CompletionGenericLiveData<AuthResult> completion = new CompletionGenericLiveData();
|
||||||
|
|||||||
@ -14,10 +14,6 @@ class CheckoutActivity : AppCompatActivity() {
|
|||||||
setContentView(R.layout.activity_checkout)
|
setContentView(R.layout.activity_checkout)
|
||||||
setSupportActionBar(toolbar)
|
setSupportActionBar(toolbar)
|
||||||
|
|
||||||
fab.setOnClickListener { view ->
|
|
||||||
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
|
||||||
.setAction("Action", null).show()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,8 @@ class BasicCustomerDetailsActivity : WooDroidActivity<CustomerViewModel>() {
|
|||||||
private var matcher: Matcher? = null
|
private var matcher: Matcher? = null
|
||||||
lateinit var customer: Customer
|
lateinit var customer: Customer
|
||||||
|
|
||||||
|
var newCustomer = false
|
||||||
|
|
||||||
override fun attachBaseContext(newBase: Context) {
|
override fun attachBaseContext(newBase: Context) {
|
||||||
super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase))
|
super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase))
|
||||||
}
|
}
|
||||||
@ -40,14 +42,19 @@ class BasicCustomerDetailsActivity : WooDroidActivity<CustomerViewModel>() {
|
|||||||
|
|
||||||
customer()
|
customer()
|
||||||
|
|
||||||
flSave.setOnClickListener{save()}
|
flSave.setOnClickListener {
|
||||||
|
if (newCustomer) {
|
||||||
|
create()
|
||||||
|
} else {
|
||||||
|
save()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun customer() {
|
private fun customer() {
|
||||||
viewModel.currentCustomer().observe(this, Observer {
|
viewModel.currentCustomer().observe(this, Observer { response ->
|
||||||
response->
|
|
||||||
when (response!!.status()) {
|
when (response!!.status()) {
|
||||||
Status.LOADING -> {
|
Status.LOADING -> {
|
||||||
showLoading("Retrieve customer details", "This will only take a short while")
|
showLoading("Retrieve customer details", "This will only take a short while")
|
||||||
@ -62,6 +69,7 @@ class BasicCustomerDetailsActivity : WooDroidActivity<CustomerViewModel>() {
|
|||||||
etLastName.setText(customer.lastName)
|
etLastName.setText(customer.lastName)
|
||||||
etUsername.setText(customer.username)
|
etUsername.setText(customer.username)
|
||||||
|
|
||||||
|
newCustomer = false
|
||||||
}
|
}
|
||||||
|
|
||||||
Status.ERROR -> {
|
Status.ERROR -> {
|
||||||
@ -71,6 +79,8 @@ class BasicCustomerDetailsActivity : WooDroidActivity<CustomerViewModel>() {
|
|||||||
|
|
||||||
Status.EMPTY -> {
|
Status.EMPTY -> {
|
||||||
stopShowingLoading()
|
stopShowingLoading()
|
||||||
|
|
||||||
|
newCustomer = true
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -90,8 +100,7 @@ class BasicCustomerDetailsActivity : WooDroidActivity<CustomerViewModel>() {
|
|||||||
customer.lastName = lastName
|
customer.lastName = lastName
|
||||||
customer.username = username
|
customer.username = username
|
||||||
|
|
||||||
viewModel.update(customer.id, customer).observe(this, Observer {
|
viewModel.update(customer.id, customer).observe(this, Observer { response ->
|
||||||
response->
|
|
||||||
when (response!!.status()) {
|
when (response!!.status()) {
|
||||||
Status.LOADING -> {
|
Status.LOADING -> {
|
||||||
showLoading("Uploading account details", "This will only take a short while")
|
showLoading("Uploading account details", "This will only take a short while")
|
||||||
@ -115,6 +124,47 @@ class BasicCustomerDetailsActivity : WooDroidActivity<CustomerViewModel>() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, "Please correct the information entered", Toast.LENGTH_SHORT).show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun create() {
|
||||||
|
if (validates()) {
|
||||||
|
val email = etEmail.text.toString()
|
||||||
|
val firstName = etFirstName.text.toString()
|
||||||
|
val lastName = etLastName.text.toString()
|
||||||
|
val username = etUsername.text.toString()
|
||||||
|
|
||||||
|
var customer = Customer()
|
||||||
|
customer.email = email
|
||||||
|
customer.firstName = firstName
|
||||||
|
customer.lastName = lastName
|
||||||
|
customer.username = username
|
||||||
|
|
||||||
|
viewModel.create(customer).observe(this, Observer { response ->
|
||||||
|
when (response!!.status()) {
|
||||||
|
Status.LOADING -> {
|
||||||
|
showLoading("Uploading account details", "This will only take a short while")
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.SUCCESS -> {
|
||||||
|
stopShowingLoading()
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.ERROR -> {
|
||||||
|
stopShowingLoading()
|
||||||
|
Toast.makeText(baseContext, response.error().message.toString(), Toast.LENGTH_LONG).show()
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.EMPTY -> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(this, "Please correct the information entered", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, "Please correct the information entered", Toast.LENGTH_SHORT).show()
|
||||||
@ -160,7 +210,8 @@ class BasicCustomerDetailsActivity : WooDroidActivity<CustomerViewModel>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val EMAIL_PATTERN = "^[a-zA-Z0-9#_~!$&'()*+,;=:.\"(),:;<>@\\[\\]\\\\]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*$"
|
private const val EMAIL_PATTERN =
|
||||||
|
"^[a-zA-Z0-9#_~!$&'()*+,;=:.\"(),:;<>@\\[\\]\\\\]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*$"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,12 +12,13 @@ import me.gilo.raison.ui.user.onboarding.SignUpActivity
|
|||||||
import me.gilo.wc.R
|
import me.gilo.wc.R
|
||||||
import me.gilo.wc.ui.customer.ProfileActivity
|
import me.gilo.wc.ui.customer.ProfileActivity
|
||||||
import me.gilo.wc.viewmodels.ProductViewModel
|
import me.gilo.wc.viewmodels.ProductViewModel
|
||||||
|
import me.gilo.wc.viewmodels.UserViewModel
|
||||||
|
|
||||||
|
|
||||||
class ProfileFragment : Fragment() {
|
class ProfileFragment : Fragment() {
|
||||||
|
|
||||||
|
|
||||||
lateinit var viewModel: ProductViewModel
|
lateinit var viewModel: UserViewModel
|
||||||
val TAG = "ProfileFragment"
|
val TAG = "ProfileFragment"
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
@ -37,6 +38,8 @@ class ProfileFragment : Fragment() {
|
|||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
|
viewModel = (activity as HomeActivity).getViewModel(UserViewModel::class.java)
|
||||||
|
|
||||||
llMyProfile.setOnClickListener{
|
llMyProfile.setOnClickListener{
|
||||||
if (FirebaseAuth.getInstance().currentUser != null) {
|
if (FirebaseAuth.getInstance().currentUser != null) {
|
||||||
startActivity(Intent(activity, ProfileActivity::class.java))
|
startActivity(Intent(activity, ProfileActivity::class.java))
|
||||||
@ -45,6 +48,11 @@ class ProfileFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
llLogout.setOnClickListener{
|
||||||
|
viewModel.logout()
|
||||||
|
startActivity(Intent(activity, SignUpActivity::class.java))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,16 +1,21 @@
|
|||||||
package me.gilo.wc.ui.product
|
package me.gilo.wc.ui.product
|
||||||
|
|
||||||
|
import android.arch.lifecycle.Observer
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.support.v7.widget.LinearLayoutManager
|
import android.support.v7.widget.LinearLayoutManager
|
||||||
import android.text.SpannableString
|
import android.text.SpannableString
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.widget.Toast
|
||||||
import com.google.common.primitives.UnsignedBytes.toInt
|
import com.google.common.primitives.UnsignedBytes.toInt
|
||||||
import io.github.inflationx.viewpump.ViewPumpContextWrapper
|
import io.github.inflationx.viewpump.ViewPumpContextWrapper
|
||||||
import kotlinx.android.synthetic.main.activity_cart.*
|
import kotlinx.android.synthetic.main.activity_cart.*
|
||||||
import kotlinx.android.synthetic.main.content_cart.*
|
import kotlinx.android.synthetic.main.content_cart.*
|
||||||
|
import kotlinx.android.synthetic.main.content_profile.*
|
||||||
import kotlinx.android.synthetic.main.single_cart_item.*
|
import kotlinx.android.synthetic.main.single_cart_item.*
|
||||||
import kotlinx.android.synthetic.main.state_empty.*
|
import kotlinx.android.synthetic.main.state_empty.*
|
||||||
|
import me.gilo.raison.ui.user.onboarding.SignUpActivity
|
||||||
import me.gilo.wc.R
|
import me.gilo.wc.R
|
||||||
import me.gilo.wc.adapter.CartAdapter
|
import me.gilo.wc.adapter.CartAdapter
|
||||||
import me.gilo.wc.common.Status
|
import me.gilo.wc.common.Status
|
||||||
@ -20,6 +25,9 @@ import me.gilo.wc.events.ProductEvent
|
|||||||
import me.gilo.wc.models.CartLineItem
|
import me.gilo.wc.models.CartLineItem
|
||||||
import me.gilo.wc.ui.WooDroidActivity
|
import me.gilo.wc.ui.WooDroidActivity
|
||||||
import me.gilo.wc.viewmodels.CartViewModel
|
import me.gilo.wc.viewmodels.CartViewModel
|
||||||
|
import me.gilo.woodroid.models.Customer
|
||||||
|
import me.gilo.woodroid.models.LineItem
|
||||||
|
import me.gilo.woodroid.models.Order
|
||||||
import org.greenrobot.eventbus.EventBus
|
import org.greenrobot.eventbus.EventBus
|
||||||
import org.greenrobot.eventbus.Subscribe
|
import org.greenrobot.eventbus.Subscribe
|
||||||
import org.greenrobot.eventbus.ThreadMode
|
import org.greenrobot.eventbus.ThreadMode
|
||||||
@ -31,6 +39,7 @@ class CartActivity : WooDroidActivity<CartViewModel>() {
|
|||||||
var cartItems: ArrayList<CartLineItem> = ArrayList()
|
var cartItems: ArrayList<CartLineItem> = ArrayList()
|
||||||
|
|
||||||
lateinit var adapter: CartAdapter
|
lateinit var adapter: CartAdapter
|
||||||
|
lateinit var customer: Customer
|
||||||
|
|
||||||
override fun attachBaseContext(newBase: Context) {
|
override fun attachBaseContext(newBase: Context) {
|
||||||
super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase))
|
super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase))
|
||||||
@ -55,10 +64,13 @@ class CartActivity : WooDroidActivity<CartViewModel>() {
|
|||||||
rvCart.adapter = adapter
|
rvCart.adapter = adapter
|
||||||
|
|
||||||
cart()
|
cart()
|
||||||
|
customer()
|
||||||
|
|
||||||
llEmptyState_layout.visibility = View.GONE
|
llEmptyState_layout.visibility = View.GONE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun cart() {
|
private fun cart() {
|
||||||
@ -97,6 +109,33 @@ class CartActivity : WooDroidActivity<CartViewModel>() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private fun createOrder(order : Order) {
|
||||||
|
viewModel.createOrder(order).observe(this, android.arch.lifecycle.Observer { response ->
|
||||||
|
when (response!!.status()) {
|
||||||
|
Status.LOADING -> {
|
||||||
|
showLoading()
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.SUCCESS -> {
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.ERROR -> {
|
||||||
|
stopShowingLoading()
|
||||||
|
|
||||||
|
toast("Something went wrong!")
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.EMPTY -> {
|
||||||
|
stopShowingLoading()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private fun setUpPage() {
|
private fun setUpPage() {
|
||||||
var itemCount = cartItems.size
|
var itemCount = cartItems.size
|
||||||
var total = 0
|
var total = 0
|
||||||
@ -120,8 +159,34 @@ class CartActivity : WooDroidActivity<CartViewModel>() {
|
|||||||
tvTotalItemCountTitle.text = "Items ($itemCount)"
|
tvTotalItemCountTitle.text = "Items ($itemCount)"
|
||||||
}
|
}
|
||||||
|
|
||||||
tvTotalItemCost.text = "$$total"
|
tvTotalItemCost.text = "Ksh$total"
|
||||||
tvTotal.text = "$$total"
|
tvTotal.text = "Ksh$total"
|
||||||
|
|
||||||
|
flSave.setOnClickListener{
|
||||||
|
prepOrder()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun prepOrder() {
|
||||||
|
var order = Order()
|
||||||
|
|
||||||
|
var lineitems = ArrayList<LineItem>()
|
||||||
|
|
||||||
|
for (cartitem in cartItems){
|
||||||
|
var lineItem = LineItem()
|
||||||
|
lineItem.price = cartitem.getPrice().toString()
|
||||||
|
lineItem.productId = cartitem.productId
|
||||||
|
lineItem.quantity = cartitem.quantity
|
||||||
|
|
||||||
|
lineitems.add(lineItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
order.setLineItems(lineitems);
|
||||||
|
order.setBillingAddress(customer.billingAddress)
|
||||||
|
order.setShippingAddress(customer.shippingAddress)
|
||||||
|
order.setCustomer(customer)
|
||||||
|
|
||||||
|
createOrder(order)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -205,5 +270,32 @@ class CartActivity : WooDroidActivity<CartViewModel>() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun customer() {
|
||||||
|
viewModel.currentCustomer().observe(this, Observer {
|
||||||
|
response->
|
||||||
|
when (response!!.status()){
|
||||||
|
Status.LOADING ->{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.SUCCESS ->{
|
||||||
|
customer = response.data()[0]
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.ERROR ->{
|
||||||
|
Toast.makeText(baseContext, response.error().message.toString(), Toast.LENGTH_LONG).show()
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.EMPTY ->{
|
||||||
|
startActivity(Intent(baseContext, SignUpActivity::class.java))
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,11 +8,10 @@ import me.gilo.wc.common.QueryLiveData;
|
|||||||
import me.gilo.wc.common.WooLiveData;
|
import me.gilo.wc.common.WooLiveData;
|
||||||
import me.gilo.wc.models.CartLineItem;
|
import me.gilo.wc.models.CartLineItem;
|
||||||
import me.gilo.wc.repo.CartRepository;
|
import me.gilo.wc.repo.CartRepository;
|
||||||
|
import me.gilo.wc.repo.CustomerRepository;
|
||||||
import me.gilo.wc.repo.OrderRepository;
|
import me.gilo.wc.repo.OrderRepository;
|
||||||
import me.gilo.wc.repo.ProductRepository;
|
import me.gilo.wc.repo.ProductRepository;
|
||||||
import me.gilo.woodroid.models.LineItem;
|
import me.gilo.woodroid.models.*;
|
||||||
import me.gilo.woodroid.models.Product;
|
|
||||||
import me.gilo.woodroid.models.ProductReview;
|
|
||||||
import me.gilo.woodroid.models.filters.ProductFilter;
|
import me.gilo.woodroid.models.filters.ProductFilter;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@ -23,10 +22,14 @@ import java.util.Map;
|
|||||||
public final class CartViewModel extends ViewModel {
|
public final class CartViewModel extends ViewModel {
|
||||||
|
|
||||||
private final CartRepository cartRepository;
|
private final CartRepository cartRepository;
|
||||||
|
private final OrderRepository orderRepository;
|
||||||
|
private final CustomerRepository customerRepository;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
CartViewModel(CartRepository cartRepository) {
|
CartViewModel(CartRepository cartRepository, OrderRepository orderRepository, CustomerRepository customerRepository) {
|
||||||
this.cartRepository = cartRepository;
|
this.cartRepository = cartRepository;
|
||||||
|
this.orderRepository = orderRepository;
|
||||||
|
this.customerRepository = customerRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompletionGenericLiveData<DocumentReference> addToCart(Product product) {
|
public CompletionGenericLiveData<DocumentReference> addToCart(Product product) {
|
||||||
@ -53,4 +56,12 @@ public final class CartViewModel extends ViewModel {
|
|||||||
return cartRepository.cart(context);
|
return cartRepository.cart(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public WooLiveData<Order> createOrder(Order order) {
|
||||||
|
return orderRepository.create(order);
|
||||||
|
}
|
||||||
|
|
||||||
|
public WooLiveData<List<Customer>> currentCustomer() {
|
||||||
|
return customerRepository.currentCustomer();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -29,6 +29,10 @@ public final class UserViewModel extends ViewModel {
|
|||||||
return firebaseUserRepository.login(username, password);
|
return firebaseUserRepository.login(username, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void logout() {
|
||||||
|
firebaseUserRepository.logout();
|
||||||
|
}
|
||||||
|
|
||||||
public CompletionGenericLiveData<AuthResult> anonymousSignIn() {
|
public CompletionGenericLiveData<AuthResult> anonymousSignIn() {
|
||||||
return firebaseUserRepository.anonymousSignIn();
|
return firebaseUserRepository.anonymousSignIn();
|
||||||
}
|
}
|
||||||
|
|||||||
10
app/src/main/res/drawable/baseline_cancel_24.xml
Executable file
10
app/src/main/res/drawable/baseline_cancel_24.xml
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
|
<path
|
||||||
|
android:fillColor="#ffffff"
|
||||||
|
android:pathData="M12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2zM17,15.59L15.59,17 12,13.41 8.41,17 7,15.59 10.59,12 7,8.41 8.41,7 12,10.59 15.59,7 17,8.41 13.41,12 17,15.59z"/>
|
||||||
|
</vector>
|
||||||
@ -47,7 +47,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:background="@color/colorPrimary"
|
android:background="@color/colorPrimary"
|
||||||
android:text="Proceed to checkout"
|
android:text="Place Order"
|
||||||
android:padding="12dp"
|
android:padding="12dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
|
|||||||
@ -320,6 +320,65 @@
|
|||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:elevation="2dp"
|
||||||
|
android:background="@drawable/rect_white"
|
||||||
|
android:orientation="vertical"
|
||||||
|
>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/llLogout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:src="@drawable/baseline_cancel_24"
|
||||||
|
android:tint="@color/text_black_5"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
fontPath="@string/font_regular"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="left"
|
||||||
|
android:text="Logout"
|
||||||
|
android:layout_marginRight="18dp"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:textColor="@color/text_black_5"
|
||||||
|
android:textSize="18sp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="@color/bg"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="@color/bg"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="@color/bg"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</android.support.v4.widget.NestedScrollView>
|
</android.support.v4.widget.NestedScrollView>
|
||||||
Loading…
Reference in New Issue
Block a user