openfoodfacts-androidapp icon indicating copy to clipboard operation
openfoodfacts-androidapp copied to clipboard

feat: Added ability to add products to any of the project (Open Beauty Facts, Open Products Facts…)

Open jaindiv26 opened this issue 6 years ago • 9 comments

Description

When the user scans the barcode I've made a bottom sheet so that when the product unavailable in the database user is asked to select the type of product. Then the selected flavor is saved and then, according to the product type I've made changes to the apiService. Even when the internet is available and the product is stored locally, I've made the same changes to the OfflineEditFragment apiService so that the local product will be uploaded to their selected product type. So now all the flavors have the ability to add the product in any of the flavors.

Related issues and discussion

  • fixes #1900

Screenshots

https://drive.google.com/file/d/1KhxGifYvj9mBinBZMN6RWKiPoWRQUabC/view?usp=sharing

jaindiv26 avatar Feb 17 '19 05:02 jaindiv26

@teolemon I've made the requested changes.

jaindiv26 avatar Feb 17 '19 12:02 jaindiv26

Android resource linking failed
Output:  warn: removing resource org.openpetfoodfacts.scanner:array/lang_array without required default value.
warn: removing resource org.openpetfoodfacts.scanner:string/txtDialogsContentSend without required default value.
/Users/pierre/Desktop/Android builds/tuttifrutti/openfoodfacts-androidapp-0291c570c155f09ed30f6807a6342444f938df7e/app/src/main/res/layout/fragment_select_flavor_bottom_sheet.xml:28: error: resource mipmap/food_category_icon (aka org.openpetfoodfacts.scanner:mipmap/food_category_icon) not found.
/Users/pierre/Desktop/Android builds/tuttifrutti/openfoodfacts-androidapp-0291c570c155f09ed30f6807a6342444f938df7e/app/src/main/res/layout/fragment_select_flavor_bottom_sheet.xml:57: error: resource mipmap/beauty_category_icon (aka org.openpetfoodfacts.scanner:mipmap/beauty_category_icon) not found.
/Users/pierre/Desktop/Android builds/tuttifrutti/openfoodfacts-androidapp-0291c570c155f09ed30f6807a6342444f938df7e/app/src/main/res/layout/fragment_select_flavor_bottom_sheet.xml:86: error: resource mipmap/pet_category_icon (aka org.openpetfoodfacts.scanner:mipmap/pet_category_icon) not found.
/Users/pierre/Desktop/Android builds/tuttifrutti/openfoodfacts-androidapp-0291c570c155f09ed30f6807a6342444f938df7e/app/src/main/res/layout/fragment_select_flavor_bottom_sheet.xml:116: error: resource mipmap/product_category_icon (aka org.openpetfoodfacts.scanner:mipmap/product_category_icon) not found.
error: failed linking file resources.

teolemon avatar Feb 18 '19 14:02 teolemon

Working:

  • the images seem to go to the right project Ko:
  • suggestions are still from Open Food Facts
  • the layout hasn't changed (still the layout of Open Food Facts)

teolemon avatar Feb 18 '19 15:02 teolemon

Small merge conflict @jaindiv26

teolemon avatar Mar 01 '19 16:03 teolemon

Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
Output:  warn: removing resource org.openpetfoodfacts.scanner:array/lang_array without required default value.
warn: removing resource org.openpetfoodfacts.scanner:string/txtDialogsContentSend without required default value.
/home/travis/build/openfoodfacts/openfoodfacts-androidapp/app/src/main/res/layout/fragment_select_flavor_bottom_sheet.xml:28: error: resource mipmap/food_category_icon (aka org.openpetfoodfacts.scanner:mipmap/food_category_icon) not found.
/home/travis/build/openfoodfacts/openfoodfacts-androidapp/app/src/main/res/layout/fragment_select_flavor_bottom_sheet.xml:57: error: resource mipmap/beauty_category_icon (aka org.openpetfoodfacts.scanner:mipmap/beauty_category_icon) not found.
/home/travis/build/openfoodfacts/openfoodfacts-androidapp/app/src/main/res/layout/fragment_select_flavor_bottom_sheet.xml:86: error: resource mipmap/pet_category_icon (aka org.openpetfoodfacts.scanner:mipmap/pet_category_icon) not found.
/home/travis/build/openfoodfacts/openfoodfacts-androidapp/app/src/main/res/layout/fragment_select_flavor_bottom_sheet.xml:116: error: resource mipmap/product_category_icon (aka org.openpetfoodfacts.scanner:mipmap/product_category_icon) not found.
error: failed linking file resources.

teolemon avatar Mar 10 '19 11:03 teolemon

can you rebase @jaindiv26 ?

teolemon avatar Apr 25 '19 10:04 teolemon

Closing due to inactivity

Karljoones avatar Aug 16 '19 08:08 Karljoones

@Karljoones @jaindiv26 @deniger I'd very much like to see if we can save this PR by rebasing it.

teolemon avatar Oct 20 '19 19:10 teolemon

I can look on it after #4214 I often want to add dog food but it is too lazy to download separate app for it :)

naivekook avatar Sep 09 '21 08:09 naivekook