Commit 2c5e12f3 authored by Muhammad Suryono's avatar Muhammad Suryono

Merge branch 'dashboard' into dev

parents 931c1480 00c671c1
<component name="ProjectCodeStyleConfiguration"> <component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173"> <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>
<DBN-PSQL> <DBN-PSQL>
<case-options enabled="true"> <case-options enabled="true">
<option name="KEYWORD_CASE" value="lower" /> <option name="KEYWORD_CASE" value="lower" />
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <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" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">
......
...@@ -118,6 +118,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -118,6 +118,7 @@ public class MainActivity extends AppCompatActivity {
} }
}); });
mainViewModels = ViewModelProviders.of(this).get(MainViewModels.class); mainViewModels = ViewModelProviders.of(this).get(MainViewModels.class);
mainViewModels.getProduct().observe(this, new Observer<DataResponse<List<ProductModels<CategoryModels>>>>() { mainViewModels.getProduct().observe(this, new Observer<DataResponse<List<ProductModels<CategoryModels>>>>() {
@Override @Override
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<corners android:bottomRightRadius="100dp" android:bottomLeftRadius="100dp" />
<gradient android:endColor="#3028A1" android:startColor="#1B76D6" />
<size android:height="120sp" />
</shape>
</item>
</selector>
\ No newline at end of file
...@@ -12,123 +12,16 @@ ...@@ -12,123 +12,16 @@
layout="@layout/app_bar"/> layout="@layout/app_bar"/>
<com.google.android.material.card.MaterialCardView <androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent" android:id="@+id/rvCart"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/cAppBar">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingVertical="15dp" app:layout_constraintTop_toBottomOf="@id/cAppBar"
android:paddingHorizontal="20dp"> android:overScrollMode="never"
android:padding="12sp"
<com.google.android.material.textview.MaterialTextView app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
android:id="@+id/tvProductName" tools:listitem="@layout/item_cart"
android:layout_width="wrap_content" />
android:layout_height="wrap_content"
android:text="@string/hint_product_name"
android:fontFamily="@font/roboto"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hint_price"
android:fontFamily="@font/roboto"
android:textSize="16sp"
app:layout_constraintTop_toBottomOf="@+id/tvProductName"
app:layout_constraintStart_toStartOf="@id/tvProductName"/>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/cross"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="x"
android:fontFamily="@font/roboto"
android:textSize="16sp"
android:layout_marginStart="10dp"
app:layout_constraintStart_toEndOf="@id/tvPrice"
app:layout_constraintBottom_toBottomOf="@id/tvPrice"/>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvQuantity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:fontFamily="@font/roboto"
android:textSize="16sp"
android:layout_marginStart="10dp"
app:layout_constraintStart_toEndOf="@id/cross"
app:layout_constraintBottom_toBottomOf="@id/cross"/>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvTotal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hint_price"
android:fontFamily="@font/roboto"
android:textSize="16sp"
android:textFontWeight="600"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="@id/tvQuantity"/>
<ImageButton
android:id="@+id/btMinus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:layout_marginTop="20dp"
android:src="@drawable/ic_baseline_minus_24"
android:background="@drawable/ic_rounded_circle"
app:layout_constraintTop_toBottomOf="@id/tvPrice"
app:layout_constraintStart_toStartOf="parent"/>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tiQty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:boxBackgroundColor="#fff"
app:layout_constraintBottom_toBottomOf="@id/btMinus"
app:layout_constraintStart_toEndOf="@id/btMinus">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/etQty"
android:enabled="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:textColor="#333"/>
</com.google.android.material.textfield.TextInputLayout>
<ImageButton
android:id="@+id/btPlus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:src="@drawable/ic_baseline_plus_24"
android:background="@drawable/ic_rounded_circle"
app:layout_constraintStart_toEndOf="@id/tiQty"
app:layout_constraintBottom_toBottomOf="@id/tiQty"/>
<ImageButton
android:id="@+id/btDelete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="#00FFFFFF"
android:src="@drawable/ic_baseline_delete_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="@id/btPlus"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/btCheckout" android:id="@+id/btCheckout"
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/bg_add"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:fitsSystemWindows="true"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar
...@@ -47,6 +49,7 @@ ...@@ -47,6 +49,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="10dp" android:layout_margin="10dp"
android:hint="@string/name" android:hint="@string/name"
android:textColor="#fff"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
app:layout_constraintTop_toBottomOf="@+id/cvProduct" app:layout_constraintTop_toBottomOf="@+id/cvProduct"
tools:ignore="MissingConstraints"> tools:ignore="MissingConstraints">
...@@ -65,6 +68,7 @@ ...@@ -65,6 +68,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="10dp" android:layout_margin="10dp"
android:hint="@string/price" android:hint="@string/price"
android:textColor="#fff"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
app:layout_constraintTop_toBottomOf="@id/tfName"> app:layout_constraintTop_toBottomOf="@id/tfName">
...@@ -82,6 +86,7 @@ ...@@ -82,6 +86,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="10dp" android:layout_margin="10dp"
android:hint="@string/stock" android:hint="@string/stock"
android:textColor="#fff"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
app:layout_constraintTop_toBottomOf="@id/tfPrice"> app:layout_constraintTop_toBottomOf="@id/tfPrice">
...@@ -89,6 +94,7 @@ ...@@ -89,6 +94,7 @@
android:id="@+id/etStock" android:id="@+id/etStock"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="#fff"
/> />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
...@@ -111,4 +117,15 @@ ...@@ -111,4 +117,15 @@
android:text="@string/add" android:text="@string/add"
tools:ignore="MissingConstraints" /> tools:ignore="MissingConstraints" />
<ImageView
android:id="@+id/ivLogin"
android:layout_width="191dp"
android:layout_height="166dp"
android:layout_marginTop="68dp"
android:src="@drawable/ic_launcher_new_icon_foreground"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnAdd" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ 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="carts"
type="com.yono.messeripos.models.ProductCartModels" />
<variable
name="quantity"
type="String" />
<variable
name="price"
type="String" />
<variable
name="product_name"
type="String" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="12dp">
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:ignore="MissingConstraints">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="20dp"
android:paddingVertical="15dp">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvProductName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="@{carts.product_name_orders}"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
tools:text="@string/hint_product_name"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="@{price}"
tools:text="@string/hint_price"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="@id/tvProductName"
app:layout_constraintTop_toBottomOf="@+id/tvProductName" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/cross"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:fontFamily="@font/roboto"
android:text="x"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="@id/tvPrice"
app:layout_constraintStart_toEndOf="@id/tvPrice" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvQuantity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:fontFamily="@font/roboto"
android:text="1"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="@id/cross"
app:layout_constraintStart_toEndOf="@id/cross" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvTotal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="@string/hint_price"
android:textFontWeight="600"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="@id/tvQuantity"
app:layout_constraintEnd_toEndOf="parent" />
<ImageButton
android:id="@+id/btMinus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:background="@drawable/ic_rounded_circle"
android:padding="10dp"
android:src="@drawable/ic_baseline_minus_24"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPrice" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tiQty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:boxBackgroundColor="#fff"
app:layout_constraintBottom_toBottomOf="@id/btMinus"
app:layout_constraintStart_toEndOf="@id/btMinus">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/etQty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="1"
android:textColor="#333" />
</com.google.android.material.textfield.TextInputLayout>
<ImageButton
android:id="@+id/btPlus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_rounded_circle"
android:padding="10dp"
android:src="@drawable/ic_baseline_plus_24"
app:layout_constraintBottom_toBottomOf="@id/tiQty"
app:layout_constraintStart_toEndOf="@id/tiQty" />
<ImageButton
android:id="@+id/btDelete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="#00FFFFFF"
android:src="@drawable/ic_baseline_delete_24"
app:layout_constraintBottom_toBottomOf="@id/btPlus"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
</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