Commit 9946f70e authored by Muhammad Suryono's avatar Muhammad Suryono

Merge sama iman

parents 4443b63a 4206e979
...@@ -75,7 +75,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -75,7 +75,7 @@ public class MainActivity extends AppCompatActivity {
ProductAdapter adapter = new ProductAdapter(); ProductAdapter adapter = new ProductAdapter();
binding.rvProduct.setAdapter(adapter); binding.rvProduct.setAdapter(adapter);
binding.appBarUpdate.setVisibility(View.GONE); // binding.appBarUpdate.setVisibility(View.GONE);
showLoading(true); showLoading(true);
categoryAdapter = new CategoryAdapter(); categoryAdapter = new CategoryAdapter();
...@@ -123,13 +123,13 @@ public class MainActivity extends AppCompatActivity { ...@@ -123,13 +123,13 @@ public class MainActivity extends AppCompatActivity {
status_update = true; status_update = true;
binding.topAppBar.setVisibility(View.GONE); binding.topAppBar.setVisibility(View.GONE);
binding.rvCategory.setVisibility(View.GONE); binding.rvCategory.setVisibility(View.GONE);
binding.appBarUpdate.setVisibility(View.VISIBLE); // binding.appBarUpdate.setVisibility(View.VISIBLE);
MaterialToolbar toolbars = findViewById(R.id.appBarUpdate); // MaterialToolbar toolbars = findViewById(R.id.appBarUpdate);
setSupportActionBar(toolbars); // setSupportActionBar(toolbars);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setTitle("Update Product"); getSupportActionBar().setTitle("Update Product");
toolbars.setNavigationOnClickListener(view -> updateFinish()); // toolbars.setNavigationOnClickListener(view -> updateFinish());
productAdapter.notifyDataSetChanged(); productAdapter.notifyDataSetChanged();
}else if (id == R.id.create) { }else if (id == R.id.create) {
...@@ -355,7 +355,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -355,7 +355,7 @@ public class MainActivity extends AppCompatActivity {
status_update = false; status_update = false;
binding.topAppBar.setVisibility(View.VISIBLE); binding.topAppBar.setVisibility(View.VISIBLE);
binding.rvCategory.setVisibility(View.VISIBLE); binding.rvCategory.setVisibility(View.VISIBLE);
binding.appBarUpdate.setVisibility(View.GONE); // binding.appBarUpdate.setVisibility(View.GONE);
productAdapter.notifyDataSetChanged(); productAdapter.notifyDataSetChanged();
} }
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout <RelativeLayout
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_width="match_parent" android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
...@@ -11,31 +11,23 @@ ...@@ -11,31 +11,23 @@
android:id="@+id/cAppBar" android:id="@+id/cAppBar"
layout="@layout/app_bar"/> layout="@layout/app_bar"/>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvCart" android:id="@+id/rvCart"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_above="@id/btCheckout"
android:layout_below="@id/cAppBar"
android:overScrollMode="never" android:overScrollMode="never"
android:padding="1sp"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:layout_constraintBottom_toTopOf="@id/btCheckout"
app:layout_constraintTop_toBottomOf="@id/cAppBar"
app:layout_constraintVertical_bias="0.0"
tools:layout_editor_absoluteX="0dp"
tools:listitem="@layout/item_cart" /> tools:listitem="@layout/item_cart" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/btCheckout" android:id="@+id/btCheckout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/title_checkout"
android:padding="15dp"
android:textSize="16sp"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
app:layout_constraintBottom_toBottomOf="parent" android:background="@color/colorPrimary"
app:layout_constraintStart_toStartOf="parent" android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"/> android:text="@string/title_checkout" />
</androidx.constraintlayout.widget.ConstraintLayout> </RelativeLayout>
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
type="com.yono.messeripos.models.MainViewModels" /> type="com.yono.messeripos.models.MainViewModels" />
</data> </data>
<androidx.constraintlayout.widget.ConstraintLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".MainActivity"> tools:context=".MainActivity">
...@@ -23,28 +23,16 @@ ...@@ -23,28 +23,16 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
android:paddingTop="20dp" android:paddingTop="20dp">
tools:ignore="RtlSymmetry">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/appBarUpdate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="0dp"
android:paddingTop="0dp"
android:background="@drawable/gradient"
style="@style/Widget.MaterialComponents.Toolbar.Primary"
xmlns:android="http://schemas.android.com/apk/res/android">
</com.google.android.material.appbar.MaterialToolbar>
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/topAppBar" android:id="@+id/topAppBar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/gradient"
app:menu="@menu/home" app:menu="@menu/home"
android:elevation="0dp" android:elevation="0dp"
app:navigationIcon="@mipmap/ic_meser_icon" app:navigationIcon="@drawable/logo"
style="@style/Widget.MaterialComponents.Toolbar.Primary" style="@style/Widget.MaterialComponents.Toolbar.Primary"
> >
...@@ -67,11 +55,10 @@ ...@@ -67,11 +55,10 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvCategory" android:id="@+id/rvCategory"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="60dp" android:layout_height="wrap_content"
android:layout_marginStart="5dp" tools:listitem="@layout/item_category"
app:layout_constraintTop_toBottomOf="@id/topBar" android:layout_below="@id/topBar"
android:layout_marginTop="10dp" android:layout_above="@id/imgEmpty"/>
tools:listitem="@layout/item_category" />
<ImageView <ImageView
android:id="@+id/imgEmpty" android:id="@+id/imgEmpty"
...@@ -79,20 +66,18 @@ ...@@ -79,20 +66,18 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone" android:visibility="gone"
android:src="@drawable/no" android:src="@drawable/no"
app:layout_constraintTop_toBottomOf="@id/rvCategory"/> android:layout_below="@id/topBar"
android:foregroundGravity="center"/>
<ProgressBar <ProgressBar
android:id="@+id/pbLoading" android:id="@+id/pbLoading"
android:indeterminateTint="@color/colorAccent"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:backgroundTint="@color/colorAccent" android:backgroundTint="@color/colorAccent"
app:layout_constraintTop_toTopOf="parent" android:indeterminateTint="@color/colorAccent"
app:layout_constraintBottom_toBottomOf="parent" android:layout_centerInParent="true"/>
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<!-- Scrollable content --> <!-- Scrollable content -->
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvProduct" android:id="@+id/rvProduct"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -101,11 +86,9 @@ ...@@ -101,11 +86,9 @@
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="2" app:spanCount="2"
android:layout_marginHorizontal="5dp" android:layout_marginHorizontal="5dp"
app:layout_constraintTop_toBottomOf="@id/rvCategory"
tools:listitem="@layout/item_list" tools:listitem="@layout/item_list"
app:layout_constraintStart_toStartOf="parent" android:layout_below="@id/rvCategory"/>
app:layout_constraintEnd_toEndOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout> </RelativeLayout>
</layout> </layout>
\ No newline at end of file
...@@ -10,59 +10,53 @@ ...@@ -10,59 +10,53 @@
</data> </data>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_height="40dp" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_marginEnd="5dp"> android:paddingVertical="10dp"
android:layout_marginHorizontal="3dp">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/cvCategory" android:id="@+id/cvCategory"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:backgroundTint="#2041B8" android:backgroundTint="#2041B8"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:checkable="true" android:checkable="true"
app:cardCornerRadius="40dp"> app:cardCornerRadius="50dp"
android:clipToPadding="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content"
android:paddingHorizontal="20dp">
<ImageView <ImageView
android:id="@+id/image_cat" android:id="@+id/image_cat"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:src="@drawable/ic_meser" android:src="@drawable/ic_meser"/>
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 <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="40dp"
android:fontFamily="@font/roboto" android:fontFamily="@font/roboto"
android:text="@{category.nameCategory}" android:text="@{category.nameCategory}"
android:textStyle="bold" android:textStyle="bold"
android:textSize="20sp" android:textSize="20sp"
android:textColor="#fff" android:textColor="#fff"
tools:text="@tools:sample/full_names" tools:text="elizabeth"
android:layout_toRightOf="@id/image_cat"
app:layout_constraintBottom_toBottomOf="parent" android:layout_centerInParent="true"/>
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/image_cat"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="MissingConstraints" />
</androidx.constraintlayout.widget.ConstraintLayout> </RelativeLayout>
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
......
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