Commit 67c8bcb8 authored by Ahmad Abi Mulya's avatar Ahmad Abi Mulya
parents d9b7029d bea907b3
...@@ -99,8 +99,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -99,8 +99,8 @@ public class MainActivity extends AppCompatActivity {
popupMenu.show(); popupMenu.show();
}); });
binding.rvCategory.setLayoutManager(new LinearLayoutManager(MainActivity.this, LinearLayoutManager.HORIZONTAL, false)); // binding.rvCategory.setLayoutManager(new LinearLayoutManager(MainActivity.this, LinearLayoutManager.HORIZONTAL, false));
binding.rvProducts.setAdapter(adapter); // binding.rvProducts.setAdapter(adapter);
viewModel = new ViewModelProvider(this).get(ProductViewModel.class); viewModel = new ViewModelProvider(this).get(ProductViewModel.class);
viewModel.getProducts().observe(this, adapter::setProducts); viewModel.getProducts().observe(this, adapter::setProducts);
......
...@@ -113,22 +113,22 @@ ...@@ -113,22 +113,22 @@
android:imeOptions="actionSearch" android:imeOptions="actionSearch"
android:inputType="textCapWords" android:inputType="textCapWords"
android:textSize="@dimen/text_default" /> android:textSize="@dimen/text_default" />
<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="0dp" <!-- android:layout_height="0dp"-->
tools:listitem="@layout/category_item" <!-- tools:listitem="@layout/category_item"-->
app:layout_constraintStart_toStartOf="parent" <!-- app:layout_constraintStart_toStartOf="parent"-->
app:layout_constraintEnd_toEndOf="parent" <!-- app:layout_constraintEnd_toEndOf="parent"-->
app:layout_constraintTop_toBottomOf="@id/rectangle_4" <!-- app:layout_constraintTop_toBottomOf="@id/rectangle_4"-->
app:layout_constraintBottom_toTopOf="@id/rvProducts" <!-- app:layout_constraintBottom_toTopOf="@id/rvProducts"-->
/> <!-- />-->
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvProducts" android:id="@+id/rvProducts"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginVertical="15dp" android:layout_marginVertical="15dp"
app:layout_constraintTop_toBottomOf="@id/rvCategory" app:layout_constraintTop_toBottomOf="@id/rectangle_4"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
......
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