UI updates to supports liquor store example
This commit is contained in:
parent
688433d9e6
commit
48e747cce3
@ -12,6 +12,7 @@ import me.gilo.wc.adapter.CategoryAdapter
|
||||
import me.gilo.wc.common.Status
|
||||
import me.gilo.wc.viewmodels.CategoryViewModel
|
||||
import me.gilo.woodroid.models.Category
|
||||
import me.gilo.woodroid.models.filters.ProductCategoryFilter
|
||||
import java.util.*
|
||||
|
||||
|
||||
@ -60,8 +61,10 @@ class CategoryFragment : Fragment() {
|
||||
|
||||
private fun categories() {
|
||||
|
||||
//TODO ('Exclude the uncategorized category')
|
||||
viewModel.categories().observe(this, android.arch.lifecycle.Observer { response ->
|
||||
val filter = ProductCategoryFilter()
|
||||
filter.per_page = 50
|
||||
|
||||
viewModel.categories(filter).observe(this, android.arch.lifecycle.Observer { response ->
|
||||
when (response!!.status()) {
|
||||
Status.LOADING -> {
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ public final class CategoryViewModel extends ViewModel {
|
||||
}
|
||||
|
||||
public WooLiveData<List<Category>> categories(ProductCategoryFilter productCategoryFilter) {
|
||||
return categoryRepository.categories();
|
||||
return categoryRepository.categories(productCategoryFilter);
|
||||
}
|
||||
|
||||
public WooLiveData<Category> update(int id, Category category) {
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="320dp"
|
||||
android:layout_height="400dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
|
||||
|
||||
@ -14,13 +14,15 @@
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="160dp">
|
||||
android:layout_height="180dp"
|
||||
android:layout_marginTop="8dp"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:scaleType="center"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@ -46,6 +48,7 @@
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:gravity="left"
|
||||
android:lines="2"
|
||||
android:textColor="@color/text"
|
||||
android:textSize="18sp"/>
|
||||
|
||||
@ -59,6 +62,7 @@
|
||||
android:layout_marginRight="16dp"
|
||||
android:gravity="left"
|
||||
android:maxLines="2"
|
||||
android:lines="2"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:textColor="@color/text_black_5"
|
||||
android:textSize="14sp"/>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp">
|
||||
android:layout_height="280dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivImage"
|
||||
@ -46,6 +46,7 @@
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:gravity="left"
|
||||
android:lines="2"
|
||||
android:textColor="@color/text"
|
||||
android:textSize="18sp"/>
|
||||
|
||||
@ -59,6 +60,7 @@
|
||||
android:layout_marginRight="16dp"
|
||||
android:gravity="left"
|
||||
android:maxLines="2"
|
||||
android:lines="2"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:textColor="@color/text_black_5"
|
||||
android:textSize="14sp"/>
|
||||
|
||||
@ -21,22 +21,16 @@ public class Woocommerce {
|
||||
final AttributeRepository attributeRepository;
|
||||
final AttributeTermRepository attributeTermRepository;
|
||||
final CategoryRepository categoryRepository;
|
||||
|
||||
final ShippingClassRepository shippingClassRepository;
|
||||
final TagRepository tagRepository;
|
||||
final VariationRepository variationRepository;
|
||||
final CouponRepository couponRepository;
|
||||
final CustomerRepository customerRepository;
|
||||
|
||||
final OrderRepository orderRepository;
|
||||
final ProductRepository productRepository;
|
||||
|
||||
final ReviewRepository reviewRepository;
|
||||
|
||||
final ReportsRepository reportsRepository;
|
||||
|
||||
final CartRepository cartRepository;
|
||||
|
||||
final PaymentGatewayRepository paymentGatewayRepository;
|
||||
final SettingsRepository settingsRepository;
|
||||
final ShippingMethodRepository shippingMethodRepository;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user