Coder Social home page Coder Social logo

sidhuparas / coronavirus-tracker Goto Github PK

View Code? Open in Web Editor NEW
169.0 15.0 40.0 16.96 MB

An Android Application written in Kotlin :iphone: with MVVM Architecture using latest Android Development tools like Dagger Hilt, Room, ViewModel, LiveData, Retrofit and Coroutines to display CoVID-19 Data

License: MIT License

Kotlin 97.48% Java 2.52%
android-application kotlin-android coronavirus-tracking coronavirus-info covid-19

coronavirus-tracker's People

Contributors

anant00 avatar priyansh-kedia avatar sidhuparas avatar way2jatin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coronavirus-tracker's Issues

Write some Unit & UI Tests

Hi,

We already have Dagger as dependency injection here and the next great thing would be to write some unit tests & UI tests. If you're looking to contibute, you can make a PR regarding the same and I will be happy to merge that and meanwhile I will also start adding the tests.

Crash on particular country's tab

And for the log I got this

java.lang.NullPointerException: Attempt to invoke virtual method 'long com.parassidhu.coronavirusapp.network.response.Delta.getConfirmed()' on a null object reference
	at com.parassidhu.coronavirusapp.ui.main.adapter.StandardListAdapter$StateViewHolder.bind(StandardListAdapter.kt:141)
	at com.parassidhu.coronavirusapp.ui.main.adapter.StandardListAdapter.onBindViewHolder(StandardListAdapter.kt:75)
	at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7065)
	at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7107)
	at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6012)
	at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6279)
	at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6118)
	at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6114)
	at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2303)
	at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1627)
	at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1587)
	at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:665)
	at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4134)
	at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3851)
	at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4404)
	at android.view.View.layout(View.java:20699)
	at android.view.ViewGroup.layout(ViewGroup.java:6198)
	at com.google.android.material.appbar.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:148)
	at com.google.android.material.appbar.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:43)
	at com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1996)
	at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:918)
	at android.view.View.layout(View.java:20699)
	at android.view.ViewGroup.layout(ViewGroup.java:6198)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
	at android.view.View.layout(View.java:20699)
	at android.view.ViewGroup.layout(ViewGroup.java:6198)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
	at android.view.View.layout(View.java:20699)
	at android.view.ViewGroup.layout(ViewGroup.java:6198)
	at androidx.constraintlayout.widget.ConstraintLayout.onLayout(ConstraintLayout.java:1915)
	at android.view.View.layout(View.java:20699)
	at android.view.ViewGroup.layout(ViewGroup.java:6198)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
	at android.view.View.layout(View.java:20699)
	at android.view.ViewGroup.layout(ViewGroup.java:6198)
	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
	at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
	at android.view.View.layout(View.java:20699)
	at android.view.ViewGroup.layout(ViewGroup.java:6198)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
	at android.view.View.layout(View.java:20699)
	at android.view.ViewGroup.layout(ViewGroup.java:6198)
	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
	at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
	at android.view.View.layout(View.java:20699)
	at android.view.ViewGroup.layout(ViewGroup.java:6198)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
	at com.android.internal.policy.DecorView.onLayout(DecorView.java:757)
	at android.view.View.layout(View.java:20699)
	at android.view.ViewGroup.layout(ViewGroup.java:6198)
	at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2870)
	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2397)
	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1532)
	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7419)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1092)
	at android.view.Choreographer.doCallbacks(Choreographer.java:888)
	at android.view.Choreographer.doFrame(Choreographer.java:819)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1078)
	at android.os.Handler.handleCallback(Handler.java:873)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:201)
	at android.app.ActivityThread.main(ActivityThread.java:6810)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

OnBackPressed is not handled.

Problem: App does NOT exit when pressed back button in Overview fragment.

fun handleBackPress(): Boolean {
        if (`searchEditText.isVisible`) {
            showSearch(false)
            return true
        }

        return false
    }

This method inside Overview Fragment always returns true.

Therefore,

override fun onBackPressed() {
        if (activeFragment == overviewFragment) {
            if (overviewFragment.handleBackPress()) {

            } else {
                finish()
            }
        } else if (activeFragment == indiaFragment) {
            handleOverviewAction()
        } else {
            super.onBackPressed()
        }
    }

The above method does not do anything.

To solve this,
searchEditText.isVisible should be changed to searchEditText.isFocused

I think the problem is that inside overview_fragment.xml the searchEditText is always visible, as it doesn't have android:visibility="invisible" before user clicks on search icon. It always is visible.

Another ways to fix this.
Make searchEditText visible and invisible to make searchEditText.isVisible work.
Or, since searchBar already has android:visibility="gone", it would work perfectly fine.
Replace searchEditText.isVisible. with just searchBar.isVisible

Freezing

This is a very wonderful app. Just exactly what I wanted to work on. Thanks
My observation is that the app freezes after using the Search view.

STEPS:

  1. Press the SEARCH button
    (No need to search for anything)
  2. Scroll DOWN through the existing data for few seconds.
    (When the “search country” EditText is no more visible)
  3. Press the BACK button(using the phone back button) to exit the search page.
  4. Try scrolling through the main data... It would freeze until the bottom tab(Overview) is pressed.

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.