https://api.covidtracking.com/v1/us/daily.json
[
{
"date": 20201006,
"states": 56,
"positive": 7460634,
"negative": 97932855,
"pending": 8680,
"hospitalizedCurrently": 31346,
"hospitalizedCumulative": 414461,
"inIcuCurrently": 6438,
"inIcuCumulative": 20973,
"onVentilatorCurrently": 1609,
"onVentilatorCumulative": 2388,
"recovered": 2952390,
"dateChecked": "2020-10-06T00:00:00Z",
"death": 202675,
"hospitalized": 414461,
"totalTestResults": 110226302,
"lastModified": "2020-10-06T00:00:00Z",
"total": 0,
"posNeg": 0,
"deathIncrease": 634,
"hospitalizedIncrease": -624,
"negativeIncrease": 722475,
"positiveIncrease": 38661,
"totalTestResultsIncrease": 823419,
"hash": "521257bd43a9127505142433642b7987cd42eb37"
},
...
]
https://api.covidtracking.com/v1/states/current.json
[
{
"date": 20201007,
"state": "AK",
"positive": 9861,
"probableCases": null,
"negative": 480213,
"pending": null,
"totalTestResults": 490074,
"hospitalizedCurrently": 46,
"hospitalizedCumulative": null,
"inIcuCurrently": null,
"inIcuCumulative": null,
"onVentilatorCurrently": 6,
"onVentilatorCumulative": null,
"recovered": 5626,
"dataQualityGrade": "A",
"lastUpdateEt": "10/7/2020 03:59",
"dateModified": "2020-10-07T03:59:00Z",
"checkTimeEt": "10/06 23:59",
"death": 59,
"hospitalized": null,
"dateChecked": "2020-10-07T03:59:00Z",
"totalTestsViral": 490074,
"positiveTestsViral": 9099,
"negativeTestsViral": 480682,
"positiveCasesViral": 9861,
"deathConfirmed": 59,
"deathProbable": null,
"totalTestEncountersViral": null,
"totalTestsPeopleViral": null,
"totalTestsAntibody": null,
"positiveTestsAntibody": null,
"negativeTestsAntibody": null,
"totalTestsPeopleAntibody": null,
"positiveTestsPeopleAntibody": null,
"negativeTestsPeopleAntibody": null,
"totalTestsPeopleAntigen": null,
"positiveTestsPeopleAntigen": null,
"totalTestsAntigen": null,
"positiveTestsAntigen": null,
"fips": "02",
"positiveIncrease": 274,
"negativeIncrease": 10426,
"total": 490074,
"totalTestResultsSource": "posNeg",
"totalTestResultsIncrease": 10700,
"posNeg": 490074,
"deathIncrease": 1,
"hospitalizedIncrease": 0,
"hash": "1a883e2869ef7b3a3c422abb9a41a55364b84ae5",
"commercialScore": 0,
"negativeRegularScore": 0,
"negativeScore": 0,
"positiveScore": 0,
"score": 0,
"grade": ""
},
...
]
<com.sap.cloud.mobile.fiori.chartcard.ChartCardView
android:id="@+id/chartCardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layoutStyle="baseCard"/>
<com.sap.cloud.mobile.fiori.chartcard.ChartCardView
android:id="@+id/chartCardViewScrollable"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layoutStyle="scrollableCard"/>
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
sdkVersion=3.1.3
The sample app supports both live network and offline modes that can be toggled in the Settings by clicking on the icon.
allprojects {
repositories {
google()
jcenter()
}
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
😞 View? {
setHasOptionsMenu(true)
binding = FragmentBaseCardsBinding.inflate(inflater, container, false)
binding.lifecycleOwner = viewLifecycleOwner
binding.chartCardsViewModel = viewModel
mChartCardView = binding.root.findViewById(R.id.chartCardView)
viewModel.covidUsChartCards.observe(viewLifecycleOwner,
Observer<MutableList<ChartCardDataModel>> {
if (it.isNotEmpty())
setChartCardView(it)
})
viewModel.xLabels4UsData.observe(viewLifecycleOwner,
Observer { if (it.isNotEmpty()) origXLabels = it})
// Observer for the network error.
viewModel.eventNetworkError.observe(viewLifecycleOwner, Observer<Boolean> { isNetworkError ->
if (isNetworkError) onNetworkError()
})
return binding.root
}
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
app:startDestination="@id/home_view_pager_fragment">
<fragment
android:id="@+id/home_view_pager_fragment"
android:name="com.example.fiorichartcardsapp.HomeViewPagerFragment"
tools:layout="@layout/fragment_home_view_pager">
<action
android:id="@+id/action_view_pager_fragment_to_card_detail_fragment"
app:destination="@id/card_details_fragment"
app:enterAnim="@anim/slide_in_right"
app:exitAnim="@anim/slide_out_left"
app:popEnterAnim="@anim/slide_in_left"
app:popExitAnim="@anim/slide_out_right" />
</fragment>
<fragment
android:id="@+id/card_details_fragment"
android:name="com.example.fiorichartcardsapp.CardDetailsFragment"
android:label="@string/card_details_title"
tools:layout="@layout/fragment_card_details">
<argument
android:name="chartViewData"
app:argType="com.example.fiorichartcardsapp.domain.DetailChartData"
/>
</fragment>
<fragment
android:id="@+id/settings_dest"
android:name="com.example.fiorichartcardsapp.SettingsFragment"
android:label="@string/settings"
tools:layout="@layout/fragment_settings" />
<activity
android:id="@+id/settingsActivity"
android:name="com.example.fiorichartcardsapp.SettingsActivity"
android:label="SettingsActivity" />
</navigation>
private fun setChartCardView(usChartCards: MutableList<ChartCardDataModel>) {
val layoutType = binding.chartCardView.layoutType
(binding.chartCardView).setViewLayoutManager()
val chartCardViewAdapter = this.activity?.let {
ChartCardViewAdapter(it, usChartCards, layoutType)
}
(binding.chartCardView).setViewAdapter(chartCardViewAdapter)
mChartCardView?.setItemClickListener(object : FioriItemClickListener {
override fun onClick(view: View, position: Int) {
val card = usChartCards[position]
val chartData = DetailChartData(
card.plotType, card.chartCardTitle!!, card.chartCardTimestamp!!,
origXLabels, card.plotDataSet!!)
val action = HomeViewPagerFragmentDirections.actionViewPagerFragmentToCardDetailFragment(chartData)
findNavController().navigate(action)
}
})
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
35 | |
25 | |
13 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |