Hello, everyone!! Is everything peaceful? It is with immense pleasure that I present to you this application that I developed from scratch this week. It is designed for the clothing company to have control over their cutting processes. The company for which I am providing services used to record all of this in a notebook, and I managed to bring it to life (literally).
[Moving on to a more technical part]
Last week, I told you that I created my first API. Along this journey, I found the JPA's CrudRepository pattern interesting, and I decided to implement the same for this application using generics. Doing this with the intention of code reuse was fantastic, as I need to deal with three objects that require implementations with this pattern. If I want something new and customized for a specific object, such as filtering models by date, all I have to do is add a new method to the responsible interface. For example:
interface ModelsRepository : CrudRepository {
fun getByStatus(status: String): List<ModelSew>
}
Speaking of filtering, I didn't use third-party libraries to save user preferences. I created my own structure for storing key-value pairs. With it, I also save the current date value that the user is navigating. So, if they switch between options using the BottomBarNav and return to the Cutting screen, the user will get the last date they were checking, for example.
I also use this structure to replace Android's SavedHandleState and retrieve the value of the ID the user wants to search for, for example.
https://www.linkedin.com/posts/rodrigooliveiracavalcante_ol%C3%A1-pessoal-tudo-em-paz[…]285852692481-2Jlx?utm_source=share&utm_medium=member_desktop