sidsharma2002 / PracticeApp

A "must-have a look" project for newcomers in android.
47 stars 20 forks source link

introduce MVVM - inject repository into Viewmodel using DI #10

Closed azimsidd closed 3 years ago

azimsidd commented 3 years ago

MVVM and Hilt implementation done. I have make an empty repository and inject it into ViewModelA using Hilt. i also have mentioned the comment for the hilt annotations

work proof

PractiseApp_by_Azim .

sidsharma2002 commented 3 years ago

Can you also show an example of injection maybe as simple as providing application context? Just to show a gist of how to make app module and use basic @Provides and @Inject annotation.

azimsidd commented 3 years ago

Yes i can make appModule file, but for that i need to remove the code from API service and place it in the App Module class.

If you want I can do that in another PR.

On Tue, 5 Oct 2021, 20:46 Siddharth sharma, @.***> wrote:

Can you also show an example of injection maybe as simple as providing application context? Just to show a gist of how to make app module and use basic @provides https://github.com/provides and @Inject https://github.com/Inject annotation.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sidsharma2002/PracticeApp/pull/10#issuecomment-934503493, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJTKGGWWJNMO7GKP3CUVQ7TUFMJFVANCNFSM5FLDKMCQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

sidsharma2002 commented 3 years ago

yeah that is if you want to show how to inject retrofit instance.. you can do so.

azimsidd commented 3 years ago

Have you merge my PR?

sidsharma2002 commented 3 years ago

please make a pr for api service also. and don't merge it until i give a green flag

azimsidd commented 3 years ago

This project is not showing in hacktoberFest. please add this tag "hacktoberfest-accepted" in PR.

azimsidd commented 3 years ago

this PR is not showing in hacktoberfest site. can you please mark this Accepted

azimsidd commented 3 years ago

Please add hacktoberfest Accepted tag in this PR also.