Giter Club home page Giter Club logo

Comments (13)

dominiczedler avatar dominiczedler commented on July 27, 2024 1

Thanks for the kind words and your proposal. :)

We will think about how we can implement that. A hurdle can be that the app has to run in background and perform server requests in the background from time to time. For that, we have to experiment and try things out, because we didn't work with such parts yet.

But please be patient – I'm currently working on an internal redesign of the app, so this feature will come after that.
Next month I'm going to start working in a company and my brother too (we have just become adults), so we will sadly have less time to work on our app.

from grocy-android.

igor-cali avatar igor-cali commented on July 27, 2024 1

@MrJohnZoidberg no offence at all. If you like, I can upload the draft in my fork (I implemented the whole setting structure and permissions fr a service notification).

from grocy-android.

igor-cali avatar igor-cali commented on July 27, 2024 1

Oh that would be great :) You can create a pull request if you want.

Just issued the PR. It does not include the modules I changed to handle the boot and the notifications, following your comments.
If you provide me with any hints on the modules you would process that in, I can rework and share.

from grocy-android.

dominiczedler avatar dominiczedler commented on July 27, 2024 1

@igor-cali About the upcoming or next week I hope :)

from grocy-android.

igor-cali avatar igor-cali commented on July 27, 2024

@MrJohnZoidberg What's the best way to get the expiring items from the app code (better if an array with the expiring date?
Thanks!

from grocy-android.

dominiczedler avatar dominiczedler commented on July 27, 2024

@igor-cali How do you mean "from the app code"? Do you want to implement something?

from grocy-android.

igor-cali avatar igor-cali commented on July 27, 2024

@MrJohnZoidberg Yes. I drafted some structure, but I am not familiar with the 'database code' and API. That's why I am asking for hints.

from grocy-android.

dominiczedler avatar dominiczedler commented on July 27, 2024

@igor-cali Okay nice, you can look in the StockOverviewViewModel file, there is

  • the repository which loads volatile items from database. VolatileItem is an object where productId and volatileType is stored, and when iterating over the VolatileItems you can check for "volatileType == expiring" and look the corresponding stockItem up with the productId (stockitems are loaded in a separate array from the repository).
  • the DownloadHelper which updates the database after loading. dlHelper.updateData() takes class types of Models which should be updated with the call.

I hope this helps you to understand the code. :-)

from grocy-android.

igor-cali avatar igor-cali commented on July 27, 2024

@MrJohnZoidberg I am trying to get items with no success, from MainActivity.java.
It looks like I cannot access VolitileItems nor the repository since they are local or private.

Here's is my code:

    [...]
    StockOverviewViewModel viewModel = new ViewModelProvider(this).get(StockOverviewViewModel.class);
    viewModel.setOfflineLive(! isOnline());
    viewModel.loadFromDatabase(true);
    viewModel.downloadData();
    //viewModel.updateFilteredStockItems();
    MutableLiveData<ArrayList<StockItem>> StockItems = viewModel.getFilteredStockItemsLive();
    ArrayList<StockItem> items = StockItems.getValue();
    [...]

I always get a null items list. Any hint?

from grocy-android.

dominiczedler avatar dominiczedler commented on July 27, 2024

@igor-cali Mmh thanks for trying to implement that feature, but I think you have not enough Android and/or Java knowledge to have a good implementation in the end (no offense). The MainActivity is not the right place to add such lines there and the way how you load the StockItems is also not right, sorry. And I can't explain how you can/should make it instead because then I can also do it myself... :)
I think it would be better if I implement this in the near future.

from grocy-android.

dominiczedler avatar dominiczedler commented on July 27, 2024

@igor-cali Oh that would be great :) You can create a pull request if you want.

from grocy-android.

dominiczedler avatar dominiczedler commented on July 27, 2024

Thanks for your work on it, I almost finished the feature yesterday. Only the time picker is missing and I will improve the notification text.

from grocy-android.

igor-cali avatar igor-cali commented on July 27, 2024

@MrJohnZoidberg is there a plan for a new release including this?

from grocy-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.