- default category index changed
- special category fix
This commit is contained in:
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
BIN
.idea/caches/gradle_models.ser
generated
BIN
.idea/caches/gradle_models.ser
generated
Binary file not shown.
@@ -437,7 +437,7 @@ public class MainActivity extends BaseActivity {
|
||||
|
||||
drawerLayout.closeDrawers();
|
||||
|
||||
if(clickedCategoryModel.isProduct()){
|
||||
if(clickedCategoryModel.isSpecialCategory()){
|
||||
|
||||
if(currentFragmentName.equals(ProductFragment.FRAGMENT_NAME) &&
|
||||
currentCategoryId == clickedCategoryModel.getId())
|
||||
|
||||
@@ -6,10 +6,7 @@ public class ApiConstants {
|
||||
//public static final String API_PATH = "http://www.pizzalink.ch/";
|
||||
public static final String API_PATH = "http://pizzaleu.ddns.net/";
|
||||
//public static final String API_PATH = "http://pizzamaxx.ch/";
|
||||
public static final int CATEGORY_ID_WUNSCHPIZZA = 9999;
|
||||
public static final int CATEGORY_ID_EKSTRA_KEBAP = 9998;
|
||||
public static final int PRODUCT_ID_WUNSCHPIZZA = 56;
|
||||
public static final int PRODUCT_ID_EKSTRA_KEBAP = 91;
|
||||
public static final String APP_TYPE_ID_ANDROID = "2";
|
||||
public static final int APP_ERROR_CODE_AUTHORIZATION = 1;
|
||||
|
||||
@@ -33,5 +30,5 @@ public class ApiConstants {
|
||||
public static final String ONESIGNAL_NOTIFICATION_TAG_KEY = "notificationAllowed";
|
||||
public static final String ONESIGNAL_NOTIFICATION_TAG_VALUE = "true";
|
||||
|
||||
public static final int NAVIGATION_MENU_DEFAULT_CATEGORY_INDEX = 6;
|
||||
public static final int NAVIGATION_MENU_DEFAULT_CATEGORY_INDEX = 4;
|
||||
}
|
||||
|
||||
@@ -150,10 +150,17 @@ public class ProductFragment extends BaseFragment {
|
||||
}
|
||||
|
||||
private int getProductIdByCategory(){
|
||||
if(categoryModel.getId() == ApiConstants.CATEGORY_ID_WUNSCHPIZZA)
|
||||
return ApiConstants.PRODUCT_ID_WUNSCHPIZZA;
|
||||
else
|
||||
return ApiConstants.PRODUCT_ID_EKSTRA_KEBAP;
|
||||
String productIdString = "";
|
||||
if(categoryModel.isSpecialCategory()){
|
||||
productIdString = categoryModel.getSpecialProductId();
|
||||
}
|
||||
int productIdInt;
|
||||
try{
|
||||
productIdInt = Integer.valueOf(productIdString);
|
||||
}catch (Exception e){
|
||||
productIdInt = 0;
|
||||
}
|
||||
return productIdInt;
|
||||
}
|
||||
|
||||
private void sortProductsByName(){
|
||||
|
||||
@@ -23,6 +23,14 @@ public class CategoryModel implements Serializable{
|
||||
@SerializedName("name")
|
||||
private String name;
|
||||
|
||||
@Expose
|
||||
@SerializedName("is_special")
|
||||
private boolean specialCategory;
|
||||
|
||||
@Expose
|
||||
@SerializedName("product_id")
|
||||
private String specialProductId;
|
||||
|
||||
@Expose
|
||||
@SerializedName("children")
|
||||
private ArrayList<CategoryModel> subCategoryList;
|
||||
@@ -52,10 +60,6 @@ public class CategoryModel implements Serializable{
|
||||
return String.valueOf(id);
|
||||
}
|
||||
|
||||
public boolean isProduct(){
|
||||
return id == ApiConstants.CATEGORY_ID_WUNSCHPIZZA || id == ApiConstants.CATEGORY_ID_EKSTRA_KEBAP;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -80,4 +84,22 @@ public class CategoryModel implements Serializable{
|
||||
this.subCategoryList = subCategoryList;
|
||||
}
|
||||
|
||||
public boolean isSpecialCategory() {
|
||||
return specialCategory;
|
||||
}
|
||||
|
||||
public void setSpecialCategory(boolean specialCategory) {
|
||||
this.specialCategory = specialCategory;
|
||||
}
|
||||
|
||||
public String getSpecialProductId() {
|
||||
if(specialProductId == null){
|
||||
specialProductId = "";
|
||||
}
|
||||
return specialProductId;
|
||||
}
|
||||
|
||||
public void setSpecialProductId(String specialProductId) {
|
||||
this.specialProductId = specialProductId;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user