Giter Site home page Giter Site logo

patilshreyas / foodium Goto Github PK

View Code? Open in Web Editor NEW
2.3K 57.0 414.0 18.88 MB

🍲Foodium is a sample food blog Android application 📱 built to demonstrate the use of Modern Android development tools - (Kotlin, Coroutines, Flow, Dagger 2/Hilt, Architecture Components, MVVM, Room, Retrofit, Moshi, Material Components).

Home Page: https://patilshreyas.github.io/Foodium/

License: MIT License

Kotlin 100.00%
kotlin kotlin-android mvvm mvvm-android android-architecture-components livedata livedata-viewmodel viewbinding room room-persistence-library

foodium's Issues

Use room suspending functions

Use room inbuilt support for coroutines
Currently, the code does not use the functionality provided by the Room library. Instead, it uses Dispatchers.IO for threading purposes. I intend to remove this and add inbuilt support.

Proposed changes:
proposed PR

.idea and apk folders should be ignored by git

It seems .idea folder not ignored by git we need to add it to .gitignore.
Because it will always changes every time we open Android Studio.
It's should be ignored because we don't want to add changes that we are not making.

e.g. misc.xml
Screen Shot 2020-03-25 at 12 56 24

And also apk should not be in repo because if we build it again it will detect it as change. It is unnecessary to put apk in git repo. This will make repo size bigger to clone because we need to download the apk too.

Screen Shot 2020-03-25 at 13 07 34

Visitable Pattern RecyclerView

Hi @PatilShreyas how about we improve the PostListAdapter with Visitable Pattern? So we can add view items more dynamically in the app and create the factory for the ViewHolders.

And also I think setPosts function in PostListAdapter should not use notifyDataSetChanged to update the list, if we use that the DiffUtil.ItemCallback will become useless because the adapter will re-render the all items which resulted in blinking page.

Instead we could use submitList(items) provided by ListAdapter that PostListAdapter extends to only re-render the items which data have changed with the correct animation.

Thank you 🙏

Ref: https://proandroiddev.com/writing-better-adapters-1b09758407d2

Allways state is succesfull

Due to this code state always succesfull,

emitAll(fetchFromLocal().map {
           State.success<RESULT>(it)
       })

so after internet connection is back,

     ```
if (mViewModel.postsLiveData.value is State.Error || mAdapter.itemCount == 0) {
                    getPosts()
                }

this block of code does not work...
what i can do fetch new result when immediately the connection is back,

Add More Screens

Have to add more screens in this app (currently it's single screen app).

  • DetailView - On Clicking blog of MainActivity user should see this screen.

Crash happens when tapping on any item.

I am running the app on Nexus 5 android version 6.01 and when on I tap on any item in the food list, instead of showing the detail page, below crash happens:

07-03 21:58:10.930 2289-2289/dev.shreyaspatil.foodium E/AndroidRuntime: FATAL EXCEPTION: main
    Process: dev.shreyaspatil.foodium, PID: 2289
    android.content.res.Resources$NotFoundException: Resource ID #0x7f070080
        at android.content.res.Resources.getValue(Resources.java:1351)
        at androidx.appcompat.widget.ResourceManagerInternal.loadDrawableFromDelegates(ResourceManagerInternal.java:252)
        at androidx.appcompat.widget.ResourceManagerInternal.getDrawable(ResourceManagerInternal.java:139)
        at androidx.appcompat.widget.ResourceManagerInternal.getDrawable(ResourceManagerInternal.java:132)
        at androidx.appcompat.content.res.AppCompatResources.getDrawable(AppCompatResources.java:104)
        at androidx.appcompat.view.menu.MenuItemImpl.getIcon(MenuItemImpl.java:505)
        at androidx.appcompat.view.menu.ActionMenuItemView.initialize(ActionMenuItemView.java:126)
        at androidx.appcompat.widget.ActionMenuPresenter.bindItemView(ActionMenuPresenter.java:207)
        at androidx.appcompat.view.menu.BaseMenuPresenter.getItemView(BaseMenuPresenter.java:188)
        at androidx.appcompat.widget.ActionMenuPresenter.getItemView(ActionMenuPresenter.java:193)
        at androidx.appcompat.widget.ActionMenuPresenter.flagActionItems(ActionMenuPresenter.java:473)
        at androidx.appcompat.view.menu.MenuBuilder.flagActionItems(MenuBuilder.java:1182)
        at androidx.appcompat.view.menu.BaseMenuPresenter.updateMenuView(BaseMenuPresenter.java:96)
        at androidx.appcompat.widget.ActionMenuPresenter.updateMenuView(ActionMenuPresenter.java:226)
        at androidx.appcompat.view.menu.MenuBuilder.dispatchPresenterUpdate(MenuBuilder.java:298)
        at androidx.appcompat.view.menu.MenuBuilder.onItemsChanged(MenuBuilder.java:1069)
        at androidx.appcompat.view.menu.MenuBuilder.startDispatchingItemsChanged(MenuBuilder.java:1096)
        at androidx.appcompat.app.ToolbarActionBar.populateOptionsMenu(ToolbarActionBar.java:461)
        at androidx.appcompat.app.ToolbarActionBar$1.run(ToolbarActionBar.java:56)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:148)
        at android.app.ActivityThread.main(ActivityThread.java:5417)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Use the Android Sharesheet for a more modern looking share tray

Describe the bug/request
Use the Android Sharesheet to provide the share functionality, allowing for a more modern looking share menu on Android 10 (API level 29) and above. This will also add the ability to show rich content to previews.

So the UI for the share tray could something like this post this change:

Additional context
Essentially, the following change will be done:

For all types of sharing, create an intent and set its action to Intent.ACTION_SEND. In order to display the Android Sharesheet you need to call Intent.createChooser() , passing it your Intent object. It returns a version of your intent that will always display the Android Sharesheet.

Source: link

Update README.md

Describe the bug/request
Hi @PatilShreyas
There is a scope of improvements in the README.md file and i would like to update it .
For eg : "This makes it offline capable 😃." can be replaced with "This allows us to use it offline 😃".
Changes like this will be appealing to the readers and will explain the project in a better manner.
I would like to work on this issue so please can you assign this to me.

Additional context
Add any other context about the problem here.

Running dao tests runs forever

While running tests for PostsDaoTest the tests keeps running without completing. But if i test with normal flow builder emitting item and asserting inside run blocking it completes and tests pass.

    val flow =  flow {
        emit(1)
    }

    assertThat(1, equalTo(flow.first()))

The above works inside runBlocking.

I found nothing similar to this issue on internet. Running on latest android studio. Am i missing anything

1

dev branch missing

Hi,

Cool project thanks for sharing.

Just checked Contributions guidelines and you mention dev branch but
I guess you 've forgot to push it ?

EDIT: Unless you meant master ?

Deprecated JUnit AssertThat()

Describe the bug/request
JUnit "AssertThat" is deprecated use Google Truth instead of that.

Additional context
In FoodiumServiceTest class the JUnit assertThat is used.
Please use google truth instead of this.

DARK THEME ISSUE

I had converted ge the theme in to Dark..Then after reopen the theme again going to white.

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.