Commit e1fb7923 authored by iman Fauzi's avatar iman Fauzi

Merge branch 'dev' into cart

parents fa2fe6d3 aeb47069
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<DBN-PSQL>
<case-options enabled="true">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false" />
</DBN-PSQL>
<DBN-SQL>
<case-options enabled="true">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false">
<option name="STATEMENT_SPACING" value="one_line" />
<option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" />
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings>
</DBN-SQL>
<codeStyleSettings language="XML">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
......
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
......@@ -25,6 +25,10 @@ android {
enabled = true
}
viewBinding {
enabled = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
......@@ -41,6 +45,11 @@ dependencies {
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'com.github.bumptech.glide:glide:4.3.1'
def room_version = "2.2.5"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
......
......@@ -10,7 +10,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme.appbar">
<activity android:name=".PaymentActivity" android:theme="@style/AppTheme.appbar"></activity>
<activity android:name=".CartActivity" android:theme="@style/AppTheme.appbar" />
<activity android:name=".SplashScreen">
......@@ -20,7 +20,7 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity">
<activity android:name=".MainActivity" android:theme="@style/AppTheme.appbar">
</activity>
......
......@@ -7,24 +7,26 @@ import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.ViewModelProviders;
import com.google.android.material.appbar.MaterialToolbar;
import com.yono.messeripos.models.MainViewModels;
public class MainActivity extends AppCompatActivity {
MaterialToolbar toolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window w = getWindow();
w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
w.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
......@@ -37,13 +39,17 @@ public class MainActivity extends AppCompatActivity {
@Override
public boolean onMenuItemClick(MenuItem item) {
int id = item.getItemId();
if (id == R.id.menu_cart){
startActivity(new Intent(getApplicationContext(), CartActivity.class));
}
return true;
}
});
MainViewModels mainViewModels = ViewModelProviders.of(this).get(MainViewModels.class);
mainViewModels.getProduct();
mainViewModels.getCategory();
}
}
\ No newline at end of file
......@@ -4,14 +4,22 @@ import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import androidx.appcompat.app.AppCompatActivity;
public class SplashScreen extends AppCompatActivity {
ImageView img;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
img = findViewById(R.id.image_splash);
Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.zoom_in);
img.startAnimation(animation);
new Handler(Looper.getMainLooper()).postDelayed(()->{
startActivity(new Intent(SplashScreen.this, MainActivity.class));
......
package com.yono.messeripos.adapter;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
public class CartAdapter extends RecyclerView.Adapter<CartAdapter.MyViewHolder> {
@NonNull
@Override
public CartAdapter.MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return null;
}
@Override
public void onBindViewHolder(@NonNull CartAdapter.MyViewHolder holder, int position) {
}
@Override
public int getItemCount() {
return 0;
}
public class MyViewHolder extends RecyclerView.ViewHolder {
public MyViewHolder(@NonNull View itemView) {
super(itemView);
}
}
}
package com.yono.messeripos.adapter;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
public class CategoryAdapter extends RecyclerView.Adapter<CategoryAdapter.MyViewHolder> {
@NonNull
@Override
public CategoryAdapter.MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return null;
}
@Override
public void onBindViewHolder(@NonNull CategoryAdapter.MyViewHolder holder, int position) {
}
@Override
public int getItemCount() {
return 0;
}
public class MyViewHolder extends RecyclerView.ViewHolder {
public MyViewHolder(@NonNull View itemView) {
super(itemView);
}
}
}
package com.yono.messeripos.adapter;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
public class ProductAdapter extends RecyclerView.Adapter<ProductAdapter.MyViewHolder> {
@NonNull
@Override
public ProductAdapter.MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return null;
}
@Override
public void onBindViewHolder(@NonNull ProductAdapter.MyViewHolder holder, int position) {
}
@Override
public int getItemCount() {
return 0;
}
public class MyViewHolder extends RecyclerView.ViewHolder {
public MyViewHolder(@NonNull View itemView) {
super(itemView);
}
}
}
package com.yono.messeripos.api;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class ApiHelper {
public static final String BASE_URL = "https://rest-api-meser.herokuapp.com/";
public static final String VERSI_API_1 = "api/v1/";
public static Retrofit request(String baseUrl){
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(baseUrl)
.addConverterFactory(GsonConverterFactory.create())
.build();
return retrofit;
}
}
package com.yono.messeripos.api.client;
import com.yono.messeripos.api.ApiHelper;
public class Client {
public <T> T Client(Class<T> service){
return ApiHelper.request(ApiHelper.BASE_URL).create(service);
}
}
package com.yono.messeripos.api.service;
import com.yono.messeripos.api.ApiHelper;
import com.yono.messeripos.models.CategoryModels;
import com.yono.messeripos.response.DataResponse;
import java.util.List;
import retrofit2.Call;
import retrofit2.http.GET;
public interface CategoryServise {
@GET(ApiHelper.VERSI_API_1+"categories")
Call<DataResponse<List<CategoryModels>>> getCategory();
}
package com.yono.messeripos.api.service;
import com.yono.messeripos.api.ApiHelper;
import com.yono.messeripos.models.CategoryModels;
import com.yono.messeripos.models.ProductModels;
import com.yono.messeripos.response.DataResponse;
import java.util.List;
import retrofit2.Call;
import retrofit2.http.GET;
public interface ProductService {
@GET(ApiHelper.VERSI_API_1+"products-join")
Call<DataResponse<List<ProductModels<CategoryModels>>>> getProducts();
}
package com.yono.messeripos.daos;
import androidx.room.Dao;
@Dao
public interface CartDaos {
}
package com.yono.messeripos.database;
import androidx.room.Database;
import androidx.room.RoomDatabase;
import com.yono.messeripos.daos.CartDaos;
import com.yono.messeripos.models.ProductCartModels;
@Database(entities = {ProductCartModels.class}, version = 1, exportSchema = false)
public abstract class LocalDatabase extends RoomDatabase {
public abstract CartDaos cartDaos();
private static volatile LocalDatabase INSTANCE;
private static final int NUMBER_OF_THREADS = 407;
}
package com.yono.messeripos.models;
import com.google.gson.annotations.SerializedName;
public class CartModels<T> {
@SerializedName("id")
private String idOrders;
@SerializedName("products")
private T dataOrders;
public String getIdOrders() {
return idOrders;
}
public void setIdOrders(String idOrders) {
this.idOrders = idOrders;
}
public T getDataOrders() {
return dataOrders;
}
public void setDataOrders(T dataOrders) {
this.dataOrders = dataOrders;
}
}
package com.yono.messeripos.models;
import com.google.gson.annotations.SerializedName;
public class CategoryModels {
@SerializedName("id")
private int idCategory;
@SerializedName("name")
private String nameCategory;
public int getIdCategory() {
return idCategory;
}
public void setIdCategory(int idCategory) {
this.idCategory = idCategory;
}
public String getNameCategory() {
return nameCategory;
}
public void setNameCategory(String nameCategory) {
this.nameCategory = nameCategory;
}
}
package com.yono.messeripos.models;
import android.util.Log;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.google.gson.Gson;
import com.yono.messeripos.api.client.Client;
import com.yono.messeripos.api.service.CategoryServise;
import com.yono.messeripos.api.service.ProductService;
import com.yono.messeripos.response.DataResponse;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class MainViewModels extends ViewModel {
MutableLiveData<DataResponse<List<ProductModels<List<CategoryModels>>>>> productList;
MutableLiveData<DataResponse<List<CategoryModels>>> categoryList;
Client client = new Client();
public MainViewModels(){ productList = new MutableLiveData<>();}
public MutableLiveData<DataResponse<List<ProductModels<List<CategoryModels>>>>> getProduct(){
getProductList();
return productList;
}
public MutableLiveData<DataResponse<List<CategoryModels>>> getCategory(){
getCategoryList();
return categoryList;
}
private void getProductList() {
ProductService productService = client.Client(ProductService.class);
productService.getProducts().enqueue(new Callback<DataResponse<List<ProductModels<CategoryModels>>>>() {
@Override
public void onResponse(Call<DataResponse<List<ProductModels<CategoryModels>>>> call,
Response<DataResponse<List<ProductModels<CategoryModels>>>> response) {
String js = new Gson().toJson(response.body());
Log.d("Get Data", "Response "+js);
}
@Override
public void onFailure(Call<DataResponse<List<ProductModels<CategoryModels>>>> call, Throwable t) {
Log.e("Error get product", "Response "+t.getMessage());
}
});
}
private void getCategoryList(){
CategoryServise categoryServise = client.Client(CategoryServise.class);
categoryServise.getCategory().enqueue(new Callback<DataResponse<List<CategoryModels>>>() {
@Override
public void onResponse(Call<DataResponse<List<CategoryModels>>> call, Response<DataResponse<List<CategoryModels>>> response) {
String js = new Gson().toJson(response.body());
Log.d("Get Data Category", "Response "+js);
}
@Override
public void onFailure(Call<DataResponse<List<CategoryModels>>> call, Throwable t) {
Log.e("Error get product", "Response "+t.getMessage());
}
});
}
}
package com.yono.messeripos.models;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import com.google.gson.annotations.SerializedName;
@Entity(tableName = "carts")
public class ProductCartModels implements Parcelable {
@PrimaryKey(autoGenerate = true)
@SerializedName("id")
private long id;
@SerializedName("id_orders")
private int id_orders;
@SerializedName("quantity")
private long quantity_orders;
@SerializedName("product_id")
private int id_product_orders;
@SerializedName("product_name")
private String product_name_orders;
@SerializedName("price")
private long price_orders;
@SerializedName("grand_total")
private int grand_total_orders;
public ProductCartModels(long id, int id_orders, long quantity_orders,
int id_product_orders, String product_name_orders, long price_orders,
int grand_total_orders) {
this.id = id;
this.id_orders = id_orders;
this.quantity_orders = quantity_orders;
this.id_product_orders = id_product_orders;
this.product_name_orders = product_name_orders;
this.price_orders = price_orders;
this.grand_total_orders = grand_total_orders;
}
protected ProductCartModels(Parcel in) {
id = in.readLong();
id_orders = in.readInt();
quantity_orders = in.readLong();
id_product_orders = in.readInt();
product_name_orders = in.readString();
price_orders = in.readLong();
grand_total_orders = in.readInt();
}
public static final Creator<ProductCartModels> CREATOR = new Creator<ProductCartModels>() {
@Override
public ProductCartModels createFromParcel(Parcel in) {
return new ProductCartModels(in);
}
@Override
public ProductCartModels[] newArray(int size) {
return new ProductCartModels[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel parcel, int i) {
parcel.writeLong(id);
parcel.writeInt(id_orders);
parcel.writeLong(quantity_orders);
parcel.writeLong(price_orders);
parcel.writeString(product_name_orders);
parcel.writeInt(grand_total_orders);
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public int getId_orders() {
return id_orders;
}
public void setId_orders(int id_orders) {
this.id_orders = id_orders;
}
public long getQuantity_orders() {
return quantity_orders;
}
public void setQuantity_orders(long quantity_orders) {
this.quantity_orders = quantity_orders;
}
public int getId_product_orders() {
return id_product_orders;
}
public void setId_product_orders(int id_product_orders) {
this.id_product_orders = id_product_orders;
}
public String getProduct_name_orders() {
return product_name_orders;
}
public void setProduct_name_orders(String product_name_orders) {
this.product_name_orders = product_name_orders;
}
public long getPrice_orders() {
return price_orders;
}
public void setPrice_orders(long price_orders) {
this.price_orders = price_orders;
}
public int getGrand_total_orders() {
return grand_total_orders;
}
public void setGrand_total_orders(int grand_total_orders) {
this.grand_total_orders = grand_total_orders;
}
}
......@@ -2,11 +2,11 @@ package com.yono.messeripos.models;
import com.google.gson.annotations.SerializedName;
public class ProductModels {
@SerializedName("id_product")
public class ProductModels<T> {
@SerializedName("id")
private int idProduct;
@SerializedName("product_name")
@SerializedName("name")
private String productName;
@SerializedName("price")
......@@ -14,4 +14,47 @@ public class ProductModels {
@SerializedName("stock")
private int stockProduct;
@SerializedName("category")
private T categoryProduct;
public int getIdProduct() {
return idProduct;
}
public void setIdProduct(int idProduct) {
this.idProduct = idProduct;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public int getPriceProduct() {
return priceProduct;
}
public void setPriceProduct(int priceProduct) {
this.priceProduct = priceProduct;
}
public int getStockProduct() {
return stockProduct;
}
public void setStockProduct(int stockProduct) {
this.stockProduct = stockProduct;
}
public T getCategoryProduct() {
return categoryProduct;
}
public void setCategoryProduct(T categoryProduct) {
this.categoryProduct = categoryProduct;
}
}
package com.yono.messeripos.models;
import com.google.gson.annotations.SerializedName;
public class UsersModels {
@SerializedName("username")
private String usernameUsers;
@SerializedName("password")
private String passwordUsers;
public String getUsernameUsers() {
return usernameUsers;
}
public void setUsernameUsers(String usernameUsers) {
this.usernameUsers = usernameUsers;
}
public String getPasswordUsers() {
return passwordUsers;
}
public void setPasswordUsers(String passwordUsers) {
this.passwordUsers = passwordUsers;
}
}
package com.yono.messeripos.response;
import androidx.appcompat.app.AppCompatActivity;
import com.google.gson.annotations.SerializedName;
public class DataResponse<T> {
......@@ -7,13 +9,12 @@ public class DataResponse<T> {
@SerializedName("status")
private Boolean statusData;
@SerializedName("messages")
@SerializedName("message")
private String messageData;
@SerializedName("data")
private T data;
public Boolean getStatusData() {
return statusData;
}
......
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fromXScale="2"
android:fromYScale="2"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="4"
android:toYScale="4" >
</scale>
</set>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimaryDark">
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -6,52 +6,35 @@
android:layout_height="match_parent"
tools:context=".MainActivity">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
<include
android:id="@+id/topBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="15dp">
layout="@layout/appbar_dashboard">
</include>
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/topAppBar"
<include
android:id="@+id/category"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:menu="@menu/home"
android:elevation="0dp"
app:navigationIcon="@drawable/ic_meser"
android:layout_marginTop="30dp"
style="@style/Widget.MaterialComponents.Toolbar.Primary"
>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#fff"
android:hint="Search"
android:paddingStart="10dp"
android:textColorHint="#fff"
android:outlineSpotShadowColor="#fff"
android:textColorHighlight="#fff"
android:drawableStart="@drawable/ic_baseline_search_24"/>
</com.google.android.material.appbar.MaterialToolbar>
app:layout_constraintTop_toBottomOf="@+id/topBar"
layout="@layout/item_category"/>
</com.google.android.material.appbar.AppBarLayout>
<!-- Note: A RecyclerView can also be used -->
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<!-- Scrollable content -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvProduct"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:overScrollMode="never"
android:padding="12sp"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="2"
app:layout_constraintTop_toBottomOf="@id/category"
tools:listitem="@layout/item_list" />
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -6,6 +6,7 @@
android:background="@color/colorPrimaryDark">
<ImageView
android:id="@+id/image_splash"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/ic_meser_icon"
......
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:paddingStart="15dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/topAppBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:menu="@menu/home"
android:elevation="0dp"
app:navigationIcon="@drawable/ic_meser"
android:layout_marginTop="30dp"
style="@style/Widget.MaterialComponents.Toolbar.Primary"
>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#fff"
android:hint="Search"
android:paddingStart="10dp"
android:textColorHint="#fff"
android:outlineSpotShadowColor="#fff"
android:textColorHighlight="#fff"
android:drawableStart="@drawable/ic_baseline_search_24"/>
</com.google.android.material.appbar.MaterialToolbar>
</com.google.android.material.appbar.AppBarLayout>
<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_height="60dp"
android:layout_width="match_parent"
android:scrollbars="none">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingStart="10dp"
android:paddingTop="5dp"
android:paddingEnd="10dp"
android:orientation="horizontal">
<com.google.android.material.card.MaterialCardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="@color/ic_launcher_background"
app:cardCornerRadius="15dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image_cat"
android:layout_width="30dp"
android:layout_height="50dp"
android:src="@drawable/ic_meser"
android:layout_marginStart="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.06"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
tools:ignore="MissingConstraints" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="Food"
android:textStyle="bold"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/image_cat"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="10dp"
android:layout_marginEnd="40dp"
tools:ignore="MissingConstraints" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="@color/ic_launcher_background"
android:layout_marginStart="20dp"
app:cardCornerRadius="15dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image_cat1"
android:layout_width="30dp"
android:layout_height="50dp"
android:src="@drawable/ic_meser"
android:layout_marginStart="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.06"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
tools:ignore="MissingConstraints" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="Food"
android:textStyle="bold"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/image_cat1"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="10dp"
android:layout_marginEnd="40dp"
tools:ignore="MissingConstraints" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="@color/ic_launcher_background"
android:layout_marginStart="20dp"
app:cardCornerRadius="15dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image_cat2"
android:layout_width="30dp"
android:layout_height="50dp"
android:src="@drawable/ic_meser"
android:layout_marginStart="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.06"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
tools:ignore="MissingConstraints" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="Food"
android:textStyle="bold"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/image_cat2"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="10dp"
android:layout_marginEnd="40dp"
tools:ignore="MissingConstraints" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
</HorizontalScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="product"
type="com.yono.messeripos.models.ProductModels" />
</data>
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/cardview_default_radius"
android:padding="@dimen/cardview_default_elevation"
app:cardCornerRadius="@dimen/cardview_default_radius">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/ivMeser"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
tools:src="@tools:sample/avatars" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvQuantity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/tvProduct"
android:layout_alignParentEnd="true"
android:background="#fff"
android:fontFamily="monospace"
android:padding="@dimen/material_emphasis_medium"
android:textColor="@android:color/white"
android:textSize="12sp"
android:textStyle="bold"
tools:text="10" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvProduct"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ivMeser"
android:fontFamily="@font/roboto"
android:gravity="center"
android:padding="@dimen/material_emphasis_high_type"
android:textAllCaps="true"
android:textColor="@color/ic_launcher_background"
android:textSize="12sp"
android:textStyle="bold"
tools:text="@tools:sample/full_names" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvPrice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tvProduct"
android:fontFamily="@font/roboto"
android:gravity="end"
android:paddingStart="@dimen/material_emphasis_medium"
android:paddingEnd="@dimen/material_emphasis_disabled"
android:textColor="@color/colorPrimary"
android:textSize="12sp" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tvPrice"
android:fontFamily="@font/roboto"
android:padding="@dimen/material_emphasis_high_type"
android:textColor="@android:color/darker_gray"
android:textSize="12sp"
tools:text="@tools:sample/lorem" />
</RelativeLayout>
</com.google.android.material.card.MaterialCardView>
</layout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment