Initial Upload

This commit is contained in:
admin
2020-05-02 20:35:54 -04:00
parent dba0798858
commit 0681cfaa52
256 changed files with 8948 additions and 0 deletions

19
TrackCovid19.iml Normal file
View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="TrackCovid19" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

BIN
app/.DS_Store vendored Normal file

Binary file not shown.

1
app/.gitignore vendored Executable file
View File

@@ -0,0 +1 @@
/build

175
app/app.iml Normal file
View File

@@ -0,0 +1,175 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":app" />
<option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" value="3.6.3" />
<option name="LAST_KNOWN_AGP_VERSION" value="3.6.3" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<afterSyncTasks>
<task>generateDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="TEST_RES_FOLDERS_RELATIVE_PATH" value="" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/build/intermediates/javac/debug/classes" />
<output-test url="file://$MODULE_DIR$/build/intermediates/javac/debugUnitTest/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/ap_generated_sources/debug/out" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/aidl_source_output_dir/debug/out" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/renderscript_source_output_dir/debug/out" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/ap_generated_sources/debugAndroidTest/out" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/aidl_source_output_dir/debugAndroidTest/out" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/renderscript_source_output_dir/debugAndroidTest/out" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/ap_generated_sources/debugUnitTest/out" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="TEST" name="Gradle: junit:junit:4.12@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-integration:1.3@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-library:1.3@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-core:1.3@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: net.sf.kxml:kxml2:2.3.0@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.squareup:javawriter:2.1.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: javax.inject:javax.inject:1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.google.code.findbugs:jsr305:2.0.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: androidx.test.ext:junit:1.1.1@aar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: androidx.test.espresso:espresso-core:3.2.0@aar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: androidx.test:rules:1.2.0@aar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: androidx.test:runner:1.2.0@aar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: androidx.test:core:1.2.0@aar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: androidx.test:monitor:1.2.0@aar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: androidx.test.espresso:espresso-idling-resource:3.2.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.collection:collection:1.1.0@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.arch.core:core-common:2.1.0-rc01@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-common:2.1.0-rc01@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.room:room-common:2.0.0@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.annotation:annotation:1.1.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.retrofit2:converter-gson:2.3.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.retrofit2:adapter-rxjava2:2.3.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.retrofit2:retrofit:2.3.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.okhttp3:okhttp:3.10.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.okio:okio:1.14.0@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.constraintlayout:constraintlayout-solver:1.1.3@jar" level="project" />
<orderEntry type="library" name="Gradle: com.google.code.gson:gson:2.8.2@jar" level="project" />
<orderEntry type="library" name="Gradle: io.reactivex.rxjava2:rxjava:2.1.6@jar" level="project" />
<orderEntry type="library" name="Gradle: org.reactivestreams:reactive-streams:1.0.1@jar" level="project" />
<orderEntry type="library" name="Gradle: com.fasterxml.jackson.core:jackson-databind:2.9.8@jar" level="project" />
<orderEntry type="library" name="Gradle: com.fasterxml.jackson.core:jackson-core:2.9.8@jar" level="project" />
<orderEntry type="library" name="Gradle: com.fasterxml.jackson.core:jackson-annotations:2.9.8@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.navigation:navigation-ui:2.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: com.google.android.material:material:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.preference:preference:1.1.0-rc01@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.appcompat:appcompat:1.1.0-rc01@aar" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.picasso:picasso:2.71828@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-extensions:2.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.legacy:legacy-support-v4:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.navigation:navigation-fragment:2.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.fragment:fragment:1.1.0-rc01@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.appcompat:appcompat-resources:1.1.0-rc01@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.recyclerview:recyclerview:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.legacy:legacy-support-core-ui:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.drawerlayout:drawerlayout:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.media:media:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.room:room-runtime:2.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.navigation:navigation-runtime:2.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.legacy:legacy-support-core-utils:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.transition:transition:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.viewpager:viewpager:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.loader:loader:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.activity:activity:1.0.0-rc01@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.vectordrawable:vectordrawable-animated:1.1.0-rc01@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.vectordrawable:vectordrawable:1.1.0-rc01@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.coordinatorlayout:coordinatorlayout:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.slidingpanelayout:slidingpanelayout:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.customview:customview:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.swiperefreshlayout:swiperefreshlayout:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.asynclayoutinflater:asynclayoutinflater:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.navigation:navigation-common:2.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.core:core:1.1.0-rc01@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-process:2.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-service:2.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-runtime:2.1.0-rc01@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.cursoradapter:cursoradapter:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.versionedparcelable:versionedparcelable:1.1.0-rc01@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.exifinterface:exifinterface:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.cardview:cardview:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-livedata:2.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-livedata-core:2.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.arch.core:core-runtime:2.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.savedstate:savedstate:1.0.0-rc01@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-viewmodel:2.1.0-rc01@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.sqlite:sqlite-framework:2.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.sqlite:sqlite:2.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.documentfile:documentfile:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.localbroadcastmanager:localbroadcastmanager:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.print:print:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.interpolator:interpolator:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.constraintlayout:constraintlayout:1.1.3@aar" level="project" />
<orderEntry type="library" name="Gradle: io.reactivex.rxjava2:rxandroid:2.0.1@aar" level="project" />
<orderEntry type="library" name="Gradle: com.evrencoskun.library:tableview:0.8.8@aar" level="project" />
<orderEntry type="library" name="Gradle: org.fabiomsr:moneytextview:1.1.0@aar" level="project" />
</component>
</module>

89
app/build.gradle Executable file
View File

@@ -0,0 +1,89 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.josh.trackcovid19v2"
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.navigation:navigation-fragment:2.0.0'
implementation 'androidx.navigation:navigation-ui:2.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation 'androidx.preference:preference:1.1.0-rc01'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation "androidx.appcompat:appcompat:$support_version"
implementation "androidx.legacy:legacy-support-v4:$legacy_support_version"
implementation "com.google.android.material:material:$legacy_support_version"
// Lifecycle
implementation "androidx.lifecycle:lifecycle-runtime:$room_version"
implementation "androidx.lifecycle:lifecycle-extensions:$room_version"
annotationProcessor "androidx.lifecycle:lifecycle-compiler:$room_version"
// Room
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
// Retrofit2
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofit_version"
// RxJava
implementation "io.reactivex.rxjava2:rxjava:$rxjava_version"
implementation "io.reactivex.rxjava2:rxandroid:$rxandroid_version"
implementation 'com.fasterxml.jackson.core:jackson-core:2.9.8'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.9.8'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.8'
// Gson
implementation "com.google.code.gson:gson:$gson_version"
// TableView
implementation "com.evrencoskun.library:tableview:$tableview_version"
// MoneyView
implementation "org.fabiomsr:moneytextview:$moneyview_version"
// Instrumentation dependencies use androidTestCompile"
// (as opposed to testCompile for local unit tests run in the JVM"
androidTestImplementation "junit:junit:$junit_version"
androidTestImplementation "androidx.annotation:annotation:$support_test_version"
androidTestImplementation "androidx.test:runner:$support_test_runner_version"
androidTestImplementation "androidx.test:rules:$support_test_runner_version"
androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_test_version"
}

21
app/proguard-rules.pro vendored Executable file
View File

@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

BIN
app/release/app-release.aab Normal file

Binary file not shown.

BIN
app/src/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,27 @@
package com.josh.trackcovid19v2;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.trackcovid19", appContext.getPackageName());
}
}

BIN
app/src/main/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.josh.trackcovid19v2"
android:versionCode="2">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
<activity android:name="com.josh.trackcovid19v2.HomeActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.josh.trackcovid19v2.SettingsActivity"
android:label="@string/title_activity_settings" />
<activity
android:name="com.josh.trackcovid19v2.MainActivity"
android:configChanges="orientation|keyboardHidden"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar">
</activity>
<meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" />
</application>
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 KiB

BIN
app/src/main/java/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,64 @@
package com.josh.trackcovid19v2;
import android.os.Handler;
import android.os.Looper;
import androidx.annotation.NonNull;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
/**
* Global executor pools for the whole application.
* <p>
* Grouping tasks like this avoids the effects of task starvation (e.g. disk reads don't wait behind
* webservice requests).
* <p>
* Creating a class like this is a way for android apps to handle non-trivial threading.
*/
public class AppExecutors {
// For Singleton instantiation
private static final Object LOCK = new Object();
private static AppExecutors sInstance;
private final Executor diskIO;
private final Executor mainThread;
private final Executor networkIO;
private AppExecutors(Executor diskIO, Executor networkIO, Executor mainThread) {
this.diskIO = diskIO;
this.networkIO = networkIO;
this.mainThread = mainThread;
}
public static AppExecutors getInstance() {
if (sInstance == null) {
synchronized (LOCK) {
sInstance = new AppExecutors(Executors.newSingleThreadExecutor(), Executors
.newFixedThreadPool(3), new MainThreadExecutor());
}
}
return sInstance;
}
public Executor diskIO() {
return diskIO;
}
public Executor mainThread() {
return mainThread;
}
public Executor networkIO() {
return networkIO;
}
private static class MainThreadExecutor implements Executor {
private Handler mainThreadHandler = new Handler(Looper.getMainLooper());
@Override
public void execute(@NonNull Runnable command) {
mainThreadHandler.post(command);
}
}
}

View File

@@ -0,0 +1,199 @@
package com.josh.trackcovid19v2;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import java.io.File;
public class HomeActivity extends AppCompatActivity {
private int SPLASH_SCREEN_TIME_OUT = 30000;
private Button button;
private Handler handler;
private int STORAGE_PERMISSION_CODE = 1;
private int INTERNET_PERMISSION_CODE = 1;
private Runnable myRunnable;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
if(ContextCompat.checkSelfPermission(HomeActivity.this,
Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
}
else{
requestStoragePermission();
}
if(ContextCompat.checkSelfPermission(HomeActivity.this,
Manifest.permission.INTERNET) == PackageManager.PERMISSION_GRANTED) {
}
else{
requestInternetPermission();
}
}
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
protected void onStart() {
super.onStart();
button = findViewById(R.id.magicbtn);
button.setOnClickListener(new View.OnClickListener() {
@SuppressLint("LongLogTag")
@Override
public void onClick(View v) {
Log.d("foasdfaosdfoasdfoasdfoasdfoasdofaosdfoasdfoasdf", "button thingy");
skipSplashScreen();
}
});
handler = new Handler();
Runnable myRunnable = new Runnable() {
public void run() {
Intent i= new Intent(HomeActivity.this,
MainActivity.class);
//Intent is used to switch from one activity to another.
startActivity(i);
//invoke the SecondActivity.
finish();
}
};
handler.postDelayed(myRunnable, SPLASH_SCREEN_TIME_OUT);
}
public void startNextActivity(){
startActivity(new Intent(getApplicationContext(), MainActivity.class));
}
@Override
public void onBackPressed() {
super.onBackPressed();
skipSplashScreen();
}
public void skipSplashScreen(){
if (handler != null)
handler.removeCallbacksAndMessages(null);
startNextActivity();
}
@Override
protected void onStop() {
super.onStop();
// clear handler on stop
if (handler != null)
handler.removeCallbacksAndMessages(null);
}
private void requestInternetPermission() {
if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.INTERNET)){
new AlertDialog.Builder(this)
.setTitle("Permission needed")
.setMessage("This permission is needed to store COVID data on your phone for offline usage")
.setPositiveButton("ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ActivityCompat.requestPermissions(HomeActivity.this, new String [] {Manifest.permission.INTERNET}, INTERNET_PERMISSION_CODE);
}
})
.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
})
.create().show();
} else{
ActivityCompat.requestPermissions(this, new String [] {Manifest.permission.INTERNET}, INTERNET_PERMISSION_CODE);
}
}
private void requestStoragePermission() {
if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)){
new AlertDialog.Builder(this)
.setTitle("Permission needed")
.setMessage("This permission is needed to access data")
.setPositiveButton("ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ActivityCompat.requestPermissions(HomeActivity.this, new String [] {Manifest.permission.WRITE_EXTERNAL_STORAGE}, STORAGE_PERMISSION_CODE);
}
})
.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
})
.create().show();
} else{
ActivityCompat.requestPermissions(this, new String [] {Manifest.permission.WRITE_EXTERNAL_STORAGE}, STORAGE_PERMISSION_CODE);
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
if (requestCode == STORAGE_PERMISSION_CODE) {
if(grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED){
}
else{
Toast.makeText(this, "Permission denied", Toast.LENGTH_SHORT).show();
}
}
if (requestCode == INTERNET_PERMISSION_CODE) {
if(grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED){
}
else{
Toast.makeText(this, "Permission denied", Toast.LENGTH_SHORT).show();
}
}
}
protected void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
}
public void clearApplicationData() {
File cache = getCacheDir();
File appDir = new File(cache.getParent());
if (appDir.exists()) {
String[] children = appDir.list();
for (String s : children) {
if (!s.equals("lib")) {
deleteDir(new File(appDir, s));
Log.i("EEEEEERRRRRROOOOOOORRRR", "**************** File /data/data/APP_PACKAGE/" + s + " DELETED *******************");
}
}
}
}
public static boolean deleteDir(File dir) {
if (dir != null && dir.isDirectory()) {
String[] children = dir.list();
int i = 0;
while (i < children.length) {
boolean success = deleteDir(new File(dir, children[i]));
if (!success) {
return false;
}
i++;
}
}
assert dir != null;
return dir.delete();
}
}

View File

@@ -0,0 +1,55 @@
package com.josh.trackcovid19v2;
import android.os.Bundle;
import android.view.Menu;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import com.google.android.material.navigation.NavigationView;
public class MainActivity extends AppCompatActivity {
private static int SPLASH_SCREEN_TIME_OUT=2000;
private AppBarConfiguration mAppBarConfiguration;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
DrawerLayout drawer = findViewById(R.id.drawer_layout);
NavigationView navigationView = findViewById(R.id.nav_view);
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
mAppBarConfiguration = new AppBarConfiguration.Builder(
R.id.nav_yourworld, R.id.nav_yourcountry,R.id.nav_yourrealcountry, R.id.nav_yourstate)
.setDrawerLayout(drawer)
.build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
NavigationUI.setupWithNavController(navigationView, navController);
Toast.makeText(getApplicationContext(), "Data Imported Successfully",Toast.LENGTH_SHORT).show();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onSupportNavigateUp() {
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
return NavigationUI.navigateUp(navController, mAppBarConfiguration)
|| super.onSupportNavigateUp();
}
}

View File

@@ -0,0 +1,31 @@
package com.josh.trackcovid19v2;
import android.os.Bundle;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.preference.PreferenceFragmentCompat;
public class SettingsActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.settings_activity);
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.settings, new SettingsFragment())
.commit();
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
public static class SettingsFragment extends PreferenceFragmentCompat {
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
setPreferencesFromResource(R.xml.root_preferences, rootKey);
}
}
}

View File

@@ -0,0 +1,64 @@
package com.josh.trackcovid19v2;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* A simple {@link Fragment} subclass.
* Use the {@link SettingsFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class SettingsFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
public SettingsFragment() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment SettingsFragment.
*/
// TODO: Rename and change types and number of parameters
public static SettingsFragment newInstance(String param1, String param2) {
SettingsFragment fragment = new SettingsFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_settings, container, false);
}
}

View File

@@ -0,0 +1,95 @@
package com.josh.trackcovid19v2.data;
import android.util.Log;
import androidx.lifecycle.LiveData;
import com.josh.trackcovid19v2.AppExecutors;
import com.josh.trackcovid19v2.data.database.CountriesDao;
import com.josh.trackcovid19v2.data.database.YesCountriesDao;
import com.josh.trackcovid19v2.data.database.entity.Countries;
import com.josh.trackcovid19v2.data.database.entity.YesCountries;
import com.josh.trackcovid19v2.data.network.UserNetworkDataSource;
import com.josh.trackcovid19v2.model.ServiceRequest;
import java.util.List;
/**
* This class responsible for handling data operations. This is the mediator between different
* data sources (persistent model, web service, cache, etc.)
*/
public class CountriesRepository {
private static final String LOG_TAG = CountriesRepository.class.getSimpleName();
private CountriesDao mCountriesDao;
private YesCountriesDao mYesCountriesDao;
private UserNetworkDataSource mNetworkDataSource;
// For Singleton instantiationz
private static final Object LOCK = new Object();
private static CountriesRepository sInstance;
public CountriesRepository(CountriesDao countriesDao,
YesCountriesDao yescountriesDao,
UserNetworkDataSource networkDataSource, AppExecutors
executors) {
this.mCountriesDao = countriesDao;
this.mYesCountriesDao = yescountriesDao;
this.mNetworkDataSource = networkDataSource;
// As long as the repository exists, observe the network LiveData.
// If that LiveData changes, update the database.
mNetworkDataSource.getCountriesList().observeForever(countries -> {
executors.diskIO().execute(() -> {
Log.d(LOG_TAG, "countries table is updating");
mCountriesDao.updateAll(countries);
});
});
mNetworkDataSource.getYesCountriesList().observeForever(yescountries -> {
executors.diskIO().execute(() -> {
Log.d(LOG_TAG, "yes countries table is updating");
mYesCountriesDao.updateAll(yescountries);
});
});
}
public static CountriesRepository getInstance(CountriesDao countriesDao,
YesCountriesDao yesCountriesDao,
UserNetworkDataSource
networkDataSource, AppExecutors executors) {
Log.d(LOG_TAG, "Getting the yes countries repository");
if (sInstance == null) {
synchronized (LOCK) {
sInstance = new CountriesRepository(countriesDao,
yesCountriesDao,
networkDataSource, executors);
Log.d(LOG_TAG, "Made new countries repository");
}
}
return sInstance;
}
public LiveData<List<Countries>> getCountriesList() {
LiveData<List<Countries>> foo = mCountriesDao.getCountriesList();
return foo;
}
public void postServiceRequest(ServiceRequest serviceRequest) {
mNetworkDataSource.fetchCountriesData(serviceRequest);
}
public LiveData<List<YesCountries>> getYesCountriesList() {
LiveData<List<YesCountries>> fie = mYesCountriesDao.getYesCountriesList();
return fie;
}
public void postServiceRequest1(ServiceRequest serviceRequest) {
mNetworkDataSource.fetchYesCountriesData(serviceRequest);
}
}

View File

@@ -0,0 +1,95 @@
package com.josh.trackcovid19v2.data;
import android.util.Log;
import androidx.lifecycle.LiveData;
import com.josh.trackcovid19v2.AppExecutors;
import com.josh.trackcovid19v2.data.database.StateDao;
import com.josh.trackcovid19v2.data.database.YesStateDao;
import com.josh.trackcovid19v2.data.database.entity.States;
import com.josh.trackcovid19v2.data.database.entity.YesStates;
import com.josh.trackcovid19v2.data.network.UserNetworkDataSource;
import com.josh.trackcovid19v2.model.ServiceRequest;
import java.util.List;
/**
* This class responsible for handling data operations. This is the mediator between different
* data sources (persistent model, web service, cache, etc.)
*/
public class StateRepository {
private static final String LOG_TAG = StateRepository.class.getSimpleName();
private StateDao mStatesDao;
private YesStateDao mYesStatesDao;
private UserNetworkDataSource mNetworkDataSource;
// For Singleton instantiationz
private static final Object LOCK = new Object();
private static StateRepository sInstance;
public StateRepository(StateDao stateDao,
YesStateDao yesstatesDao,
UserNetworkDataSource networkDataSource, AppExecutors
executors) {
this.mStatesDao = stateDao;
this.mYesStatesDao = yesstatesDao;
this.mNetworkDataSource = networkDataSource;
// As long as the repository exists, observe the network LiveData.
// If that LiveData changes, update the database.
mNetworkDataSource.getStatesList().observeForever(states -> {
executors.diskIO().execute(() -> {
Log.d(LOG_TAG, "states table is updating");
mStatesDao.updateAll(states);
});
});
mNetworkDataSource.getYesStatesList().observeForever(yesstates -> {
executors.diskIO().execute(() -> {
Log.d(LOG_TAG, "yes states table is updating");
mYesStatesDao.updateAll(yesstates);
});
});
}
public static StateRepository getInstance(StateDao stateDao,
YesStateDao yesStateDao,
UserNetworkDataSource
networkDataSource, AppExecutors executors) {
Log.d(LOG_TAG, "Getting the yes states repository");
if (sInstance == null) {
synchronized (LOCK) {
sInstance = new StateRepository(stateDao,
yesStateDao,
networkDataSource, executors);
Log.d(LOG_TAG, "Made new states repository");
}
}
return sInstance;
}
public LiveData<List<States>> getStatesList() {
LiveData<List<States>> foo = mStatesDao.getStatesList();
return foo;
}
public void postServiceRequest(ServiceRequest serviceRequest) {
mNetworkDataSource.fetchStatesData(serviceRequest);
}
public LiveData<List<YesStates>> getYesStatesList() {
LiveData<List<YesStates>> fie = mYesStatesDao.getYesStatesList();
return fie;
}
public void postServiceRequest1(ServiceRequest serviceRequest) {
mNetworkDataSource.fetchYesStatesData(serviceRequest);
}
}

View File

@@ -0,0 +1,85 @@
package com.josh.trackcovid19v2.data;
import android.util.Log;
import androidx.lifecycle.LiveData;
import com.josh.trackcovid19v2.AppExecutors;
import com.josh.trackcovid19v2.data.database.WorldDao;
import com.josh.trackcovid19v2.data.database.YesWorldDao;
import com.josh.trackcovid19v2.data.database.entity.World;
import com.josh.trackcovid19v2.data.database.entity.YesWorld;
import com.josh.trackcovid19v2.data.network.UserNetworkDataSource;
import com.josh.trackcovid19v2.model.ServiceRequest;
/**
* This class responsible for handling data operations. This is the mediator between different
* data sources (persistent model, web service, cache, etc.)
*/
public class WorldRepository {
private static final String LOG_TAG = WorldRepository.class.getSimpleName();
private WorldDao mWorldDao;
private YesWorldDao mYesWorldDao;
private UserNetworkDataSource mNetworkDataSource;
// For Singleton instantiation
private static final Object LOCK = new Object();
private static WorldRepository sInstance;
public WorldRepository(WorldDao worldDao, YesWorldDao yesworldDao, UserNetworkDataSource networkDataSource, AppExecutors
executors) {
this.mWorldDao = worldDao;
this.mYesWorldDao = yesworldDao;
this.mNetworkDataSource = networkDataSource;
// As long as the repository exists, observe the network LiveData.
// If that LiveData changes, update the database.
mNetworkDataSource.getWorld().observeForever(world -> {
executors.diskIO().execute(() -> {
Log.d(LOG_TAG, "world table is updating");
mWorldDao.updateAll(world);
});
});
mNetworkDataSource.getYesWorld().observeForever(yesworld -> {
executors.diskIO().execute(() -> {
Log.d(LOG_TAG, "yes world table is updating");
mYesWorldDao.updateAll(yesworld);
});
});
}
public static WorldRepository getInstance(WorldDao worldDao, YesWorldDao yesworldDao, UserNetworkDataSource
networkDataSource, AppExecutors executors) {
Log.d(LOG_TAG, "Getting the repository");
if (sInstance == null) {
synchronized (LOCK) {
sInstance = new WorldRepository(worldDao, yesworldDao, networkDataSource, executors);
Log.d(LOG_TAG, "Made new world repository");
}
}
return sInstance;
}
public LiveData<World> getWorld() {
LiveData<World> foo = mWorldDao.getWorld();
return foo;
}
public LiveData<YesWorld> getYesWorld() {
LiveData<YesWorld> foo = mYesWorldDao.getYesWorld();
return foo;
}
public void postServiceRequest(ServiceRequest serviceRequest) {
mNetworkDataSource.fetchWorldData(serviceRequest);
}
public void postServiceRequest1(ServiceRequest serviceRequest) {
mNetworkDataSource.fetchYesWorldData(serviceRequest);
}
}

View File

@@ -0,0 +1,33 @@
package com.josh.trackcovid19v2.data.database;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Transaction;
import com.josh.trackcovid19v2.data.database.entity.Countries;
import java.util.List;
@Dao
public abstract class CountriesDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
abstract void bulkInsert(List<Countries> countries);
@Query("DELETE FROM countries")
abstract void deleteAll();
@Query("Select * FROM countries ORDER BY country ASC")
public abstract LiveData<List<Countries>> getCountriesList();
@Transaction
public void updateAll(List<Countries> countries) {
deleteAll();
bulkInsert(countries);
}
}

View File

@@ -0,0 +1,38 @@
package com.josh.trackcovid19v2.data.database;
import android.content.Context;
import android.util.Log;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import com.josh.trackcovid19v2.data.database.entity.Countries;
//@Database(entities = { YourEntity.class }, version = 1, exportSchema = false)
@Database(entities = {Countries.class}, version = 1, exportSchema = false)
public abstract class CountriesDatabase extends RoomDatabase {
private static final String LOG_TAG = CountriesDatabase.class.getSimpleName();
private static final String DATABASE_NAME = "countries";
// For Singleton instantiation
private static final Object LOCK = new Object();
private static CountriesDatabase mInstance;
public static CountriesDatabase getInstance(Context context) {
Log.d(LOG_TAG, "Getting " + DATABASE_NAME + " database");
if (mInstance == null) {
synchronized (LOCK) {
mInstance = Room.databaseBuilder(context, CountriesDatabase.class, DATABASE_NAME).build();
Log.d(LOG_TAG, DATABASE_NAME + " database has been created.");
}
}
return mInstance;
}
// The associated DAOs for the database
public abstract CountriesDao countriesDao();
}

View File

@@ -0,0 +1,31 @@
package com.josh.trackcovid19v2.data.database;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Transaction;
import com.josh.trackcovid19v2.data.database.entity.States;
import java.util.List;
@Dao
public abstract class StateDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
abstract void bulkInsert(List<States> states);
@Query("DELETE FROM states")
abstract void deleteAll();
@Query("Select * FROM states ORDER BY state ASC")
public abstract LiveData<List<States>> getStatesList();
@Transaction
public void updateAll(List<States> states) {
deleteAll();
bulkInsert(states);
}
}

View File

@@ -0,0 +1,40 @@
package com.josh.trackcovid19v2.data.database;
import android.content.Context;
import android.util.Log;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import com.josh.trackcovid19v2.data.database.entity.States;
//@Database(entities = { YourEntity.class }, version = 1, exportSchema = false)
@Database(entities = {States.class}, version = 1, exportSchema = false)
public abstract class StatesDatabase extends RoomDatabase {
//public abstract class StatesDatabase {
private static final String LOG_TAG = StatesDatabase.class.getSimpleName();
private static final String DATABASE_NAME = "states";
// For Singleton instantiation
private static final Object LOCK = new Object();
private static StatesDatabase mInstance;
public static StatesDatabase getInstance(Context context) {
Log.d(LOG_TAG, "Getting " + DATABASE_NAME + " database");
if (mInstance == null) {
synchronized (LOCK) {
mInstance = Room.databaseBuilder(context, StatesDatabase.class, DATABASE_NAME).build();
Log.d(LOG_TAG, DATABASE_NAME + " database has been created.");
}
}
return mInstance;
}
// The associated DAOs for the database
public abstract StateDao stateDao();
}

View File

@@ -0,0 +1,30 @@
package com.josh.trackcovid19v2.data.database;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Transaction;
import com.josh.trackcovid19v2.data.database.entity.World;
@Dao
public abstract class WorldDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
abstract void bulkInsert(World all);
@Query("DELETE FROM world")
abstract void deleteAll();
@Query("Select * FROM world")
public abstract LiveData<World> getWorld();
@Transaction
public void updateAll(World world) {
deleteAll();
bulkInsert(world);
}
}

View File

@@ -0,0 +1,39 @@
package com.josh.trackcovid19v2.data.database;
import android.content.Context;
import android.util.Log;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import com.josh.trackcovid19v2.data.database.entity.World;
//@Database(entities = { YourEntity.class }, version = 1, exportSchema = false)
@Database(entities = {World.class}, version = 1, exportSchema = false)
public abstract class WorldDatabase extends RoomDatabase {
private static final String LOG_TAG = WorldDatabase.class.getSimpleName();
private static final String DATABASE_NAME = "all";
// For Singleton instantiation
private static final Object LOCK = new Object();
private static WorldDatabase mInstance;
public static WorldDatabase getInstance(Context context) {
Log.d(LOG_TAG, "Getting " + DATABASE_NAME + " database");
if (mInstance == null) {
synchronized (LOCK) {
mInstance = Room.databaseBuilder(context, WorldDatabase.class, DATABASE_NAME).build();
Log.d(LOG_TAG, DATABASE_NAME + " database has been created.");
}
}
return mInstance;
}
// The associated DAOs for the database
public abstract WorldDao worldDao();
}

View File

@@ -0,0 +1,32 @@
package com.josh.trackcovid19v2.data.database;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Transaction;
import com.josh.trackcovid19v2.data.database.entity.YesCountries;
import java.util.List;
@Dao
public abstract class YesCountriesDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
abstract void bulkInsert(List<YesCountries> yescountries);
@Query("DELETE FROM yescountries")
abstract void deleteAll();
@Query("Select * FROM yescountries ORDER BY country ASC")
public abstract LiveData<List<YesCountries>> getYesCountriesList();
@Transaction
public void updateAll(List<YesCountries> yescountries) {
deleteAll();
bulkInsert(yescountries);
}
}

View File

@@ -0,0 +1,38 @@
package com.josh.trackcovid19v2.data.database;
import android.content.Context;
import android.util.Log;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import com.josh.trackcovid19v2.data.database.entity.YesCountries;
//@Database(entities = { YourEntity.class }, version = 1, exportSchema = false)
@Database(entities = {YesCountries.class}, version = 1, exportSchema = false)
public abstract class YesCountriesDatabase extends RoomDatabase {
private static final String LOG_TAG = YesCountriesDatabase.class.getSimpleName();
private static final String DATABASE_NAME = "yescountries";
// For Singleton instantiation
private static final Object LOCK = new Object();
private static YesCountriesDatabase mInstance;
public static YesCountriesDatabase getInstance(Context context) {
Log.d(LOG_TAG, "Getting " + DATABASE_NAME + " database");
if (mInstance == null) {
synchronized (LOCK) {
mInstance = Room.databaseBuilder(context, YesCountriesDatabase.class, DATABASE_NAME).build();
Log.d(LOG_TAG, DATABASE_NAME + " database has been created.");
}
}
return mInstance;
}
// The associated DAOs for the database
public abstract YesCountriesDao yescountriesDao();
}

View File

@@ -0,0 +1,31 @@
package com.josh.trackcovid19v2.data.database;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Transaction;
import com.josh.trackcovid19v2.data.database.entity.YesStates;
import java.util.List;
@Dao
public abstract class YesStateDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
abstract void bulkInsert(List<YesStates> yesstates);
@Query("DELETE FROM yesstates")
abstract void deleteAll();
@Query("Select * FROM yesstates ORDER BY state ASC")
public abstract LiveData<List<YesStates>> getYesStatesList();
@Transaction
public void updateAll(List<YesStates> yesstates) {
deleteAll();
bulkInsert(yesstates);
}
}

View File

@@ -0,0 +1,41 @@
package com.josh.trackcovid19v2.data.database;
import android.content.Context;
import android.util.Log;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import com.josh.trackcovid19v2.data.database.entity.States;
import com.josh.trackcovid19v2.data.database.entity.YesStates;
//@Database(entities = { YourEntity.class }, version = 1, exportSchema = false)
@Database(entities = {YesStates.class}, version = 1, exportSchema = false)
public abstract class YesStatesDatabase extends RoomDatabase {
//public abstract class StatesDatabase {
private static final String LOG_TAG = YesStatesDatabase.class.getSimpleName();
private static final String DATABASE_NAME = "yesstates";
// For Singleton instantiation
private static final Object LOCK = new Object();
private static YesStatesDatabase mInstance;
public static YesStatesDatabase getInstance(Context context) {
Log.d(LOG_TAG, "Getting " + DATABASE_NAME + " database");
if (mInstance == null) {
synchronized (LOCK) {
mInstance = Room.databaseBuilder(context, YesStatesDatabase.class, DATABASE_NAME).build();
Log.d(LOG_TAG, DATABASE_NAME + " database has been created.");
}
}
return mInstance;
}
// The associated DAOs for the database
public abstract YesStateDao yesstateDao();
}

View File

@@ -0,0 +1,30 @@
package com.josh.trackcovid19v2.data.database;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Transaction;
import com.josh.trackcovid19v2.data.database.entity.YesWorld;
@Dao
public abstract class YesWorldDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
abstract void bulkInsert(YesWorld all);
@Query("DELETE FROM yesworld")
abstract void deleteAll();
@Query("Select * FROM yesworld")
public abstract LiveData<YesWorld> getYesWorld();
@Transaction
public void updateAll(YesWorld yesworld) {
deleteAll();
bulkInsert(yesworld);
}
}

View File

@@ -0,0 +1,39 @@
package com.josh.trackcovid19v2.data.database;
import android.content.Context;
import android.util.Log;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import com.josh.trackcovid19v2.data.database.entity.YesWorld;
//@Database(entities = { YourEntity.class }, version = 1, exportSchema = false)
@Database(entities = {YesWorld.class}, version = 1, exportSchema = false)
public abstract class YesWorldDatabase extends RoomDatabase {
private static final String LOG_TAG = YesWorldDatabase.class.getSimpleName();
private static final String DATABASE_NAME = "yesall";
// For Singleton instantiation
private static final Object LOCK = new Object();
private static YesWorldDatabase mInstance;
public static YesWorldDatabase getInstance(Context context) {
Log.d(LOG_TAG, "Getting " + DATABASE_NAME + " database");
if (mInstance == null) {
synchronized (LOCK) {
mInstance = Room.databaseBuilder(context, YesWorldDatabase.class, DATABASE_NAME).build();
Log.d(LOG_TAG, DATABASE_NAME + " database has been created.");
}
}
return mInstance;
}
// The associated DAOs for the database
public abstract YesWorldDao yesworldDao();
}

View File

@@ -0,0 +1,29 @@
package com.josh.trackcovid19v2.data.database.entity;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
/**
* Created by evrencoskun on 1.12.2017.
*/
@Entity(tableName = "countries")
public class Countries {
@PrimaryKey
@NonNull
public String country;
public int cases;
public int active;
public int todayCases;
public int deaths;
public int todayDeaths;
public int recovered;
public int tests;
public int testsPerMillion;
public String flag;
public int critical;
public long updated;
//@TypeConverters(CountryInfo.class)
//public List<CountryInfo> countryinfo;
}

View File

@@ -0,0 +1,22 @@
package com.josh.trackcovid19v2.data.database.entity;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
/**
* Created by evrencoskun on 1.12.2017.
*/
@Entity(tableName = "states")
public class States {
@PrimaryKey
@NonNull
public String state;
public int cases;
public int todayCases;
public int deaths;
public int todayDeaths;
public int active;
public int tests;
public int testsPerMillion;
}

View File

@@ -0,0 +1,21 @@
package com.josh.trackcovid19v2.data.database.entity;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
/**
* Created by evrencoskun on 1.12.2017.
*/
@Entity(tableName = "world")
public class World {
@PrimaryKey
@NonNull
public int cases;
public int deaths;
public int recovered;
public long updated;
public int active;
public int affectedCountries;
}

View File

@@ -0,0 +1,30 @@
package com.josh.trackcovid19v2.data.database.entity;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
/**
* Created by evrencoskun on 1.12.2017.
*/
@Entity(tableName = "yescountries")
public class YesCountries {
@PrimaryKey
@NonNull
public String country;
public int cases;
public int active;
public int todayCases;
public int deaths;
public int todayDeaths;
public int recovered;
public int tests;
public int testsPerMillion;
public String flag;
public int critical;
public long updated;
//@TypeConverters(CountryInfo.class)
//public List<CountryInfo> countryinfo;
}

View File

@@ -0,0 +1,22 @@
package com.josh.trackcovid19v2.data.database.entity;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
/**
* Created by evrencoskun on 1.12.2017.
*/
@Entity(tableName = "yesstates")
public class YesStates {
@PrimaryKey
@NonNull
public String state;
public int cases;
public int todayCases;
public int deaths;
public int todayDeaths;
public int active;
public int tests;
public int testsPerMillion;
}

View File

@@ -0,0 +1,21 @@
package com.josh.trackcovid19v2.data.database.entity;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
/**
* Created by evrencoskun on 1.12.2017.
*/
@Entity(tableName = "yesworld")
public class YesWorld {
@PrimaryKey
@NonNull
public int cases;
public int deaths;
public int recovered;
public long updated;
public int active;
public int affectedCountries;
}

View File

@@ -0,0 +1,322 @@
package com.josh.trackcovid19v2.data.network;
import android.util.Log;
import com.josh.trackcovid19v2.data.database.entity.Countries;
import com.josh.trackcovid19v2.data.database.entity.States;
import com.josh.trackcovid19v2.data.database.entity.World;
import com.josh.trackcovid19v2.data.database.entity.YesCountries;
import com.josh.trackcovid19v2.data.database.entity.YesStates;
import com.josh.trackcovid19v2.data.database.entity.YesWorld;
import com.josh.trackcovid19v2.data.network.pojo.CountriesPojo;
import com.josh.trackcovid19v2.data.network.pojo.StatesPojo;
import com.josh.trackcovid19v2.data.network.pojo.YesCountriesPojo;
import com.josh.trackcovid19v2.data.network.pojo.YesStatesPojo;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class NetworkUtils {
private static final String LOG_TAG = NetworkUtils.class.getSimpleName();
private static final String BASE_URL = "https://corona.lmao.ninja/";
private static Retrofit getRetrofit() {
return new Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(GsonConverterFactory
.create()).build();
}
// For getting states data -- create similar for countries
/*
public static Call<List<States>> getDataFromService() {
Log.d(LOG_TAG, "Getting data from the server");
List<States> foo = null;
RestApi service = getRetrofit().create(RestApi.class);
Call<List<States>> call = service.getStates();
return call;
}
*/
public static Call<List<StatesPojo>> getStatesDataFromService() {
Log.d(LOG_TAG, "Getting states data from the server");
RestApi service = getRetrofit().create(RestApi.class);
Call<List<StatesPojo>> call = service.getStates(0);
return call;
}
public static Call<List<YesStatesPojo>> getYesStatesDataFromService() {
Log.d(LOG_TAG, "Getting yes states data from the server");
RestApi service = getRetrofit().create(RestApi.class);
Call<List<YesStatesPojo>> call = service.getYesStates(1);
return call;
}
// For getting countries data
public static Call<List<CountriesPojo>> getCountriesDataFromService() {
Log.d(LOG_TAG, "Getting countries data from the server");
//List<Countries> foo = null;
RestApi service = getRetrofit().create(RestApi.class);
Call<List<CountriesPojo>> call = service.getCountries(0);
return call;
}
public static Call<List<YesCountriesPojo>> getYesCountriesDataFromService() {
Log.d(LOG_TAG, "Getting yesterdays countries data from the server");
//List<Countries> foo = null;
RestApi service = getRetrofit().create(RestApi.class);
Call<List<YesCountriesPojo>> call = service.getYesCountries(1);
return call;
}
public static List<Countries> convertToCountriesList(List<CountriesPojo> data) {
List<Countries> countries = new ArrayList<>();
Log.d(LOG_TAG, "Converting the response.");
try {
for (CountriesPojo ddd : data) {
Countries country_data = new Countries();
country_data.country = ddd.getCountry();
country_data.cases = Integer.parseInt(ddd.getCases());
country_data.active = Integer.parseInt(ddd.getActive());
country_data.deaths = Integer.parseInt(ddd.getDeaths());
country_data.todayCases = Integer.parseInt(ddd.getTodayCases());
country_data.todayDeaths = Integer.parseInt(ddd.getTodayDeaths());
country_data.recovered = Integer.parseInt(ddd.getRecovered());
//country_data.recovered = 0;
country_data.tests = Integer.parseInt(ddd.getTests());
country_data.testsPerMillion = Integer.parseInt(ddd.getTestsPerOneMillion());
country_data.flag = ddd.getCountryInfoPojo().getFlag();
country_data.critical = Integer.parseInt(ddd.getCritical());
country_data.updated = Long.parseLong(ddd.getUpdated());
// add
countries.add(country_data);
}
Log.d(LOG_TAG, "Converting the response process has been success. ");
} catch (Exception e) {
Log.d(LOG_TAG, "Converting the response process has been failed. ", e);
}
return countries;
}
public static List<States> convertToStatesList(List<StatesPojo> data) {
List<States> states = new ArrayList<>();
Log.d(LOG_TAG, "Converting the response.");
try {
for (StatesPojo ddd : data) {
States state_data = new States();
state_data.state = ddd.getState();
state_data.cases = Integer.parseInt(ddd.getCases());
state_data.active = Integer.parseInt(ddd.getActive());
state_data.deaths = Integer.parseInt(ddd.getDeaths());
state_data.todayCases = Integer.parseInt(ddd.getTodayCases());
state_data.todayDeaths = Integer.parseInt(ddd.getTodayDeaths());
state_data.tests = Integer.parseInt(ddd.getTests());
state_data.testsPerMillion = Integer.parseInt(ddd.getTestsPerOneMillion());
// add
states.add(state_data);
}
Log.d(LOG_TAG, "Converting the response process has been success. ");
} catch (Exception e) {
Log.d(LOG_TAG, "Converting the response process has been failed. ", e);
}
return states;
}
public static List<YesStates> convertToYesStatesList(List<YesStatesPojo> data) {
List<YesStates> yesstates = new ArrayList<>();
Log.d(LOG_TAG, "Converting the response.");
try {
for (YesStatesPojo ddd : data) {
YesStates state_data = new YesStates();
state_data.state = ddd.getState();
state_data.cases = Integer.parseInt(ddd.getCases());
state_data.active = Integer.parseInt(ddd.getActive());
state_data.deaths = Integer.parseInt(ddd.getDeaths());
state_data.todayCases = Integer.parseInt(ddd.getTodayCases());
state_data.todayDeaths = Integer.parseInt(ddd.getTodayDeaths());
state_data.tests = Integer.parseInt(ddd.getTests());
state_data.testsPerMillion = Integer.parseInt(ddd.getTestsPerOneMillion());
// add
yesstates.add(state_data);
}
Log.d(LOG_TAG, "Converting the response process has been success. ");
} catch (Exception e) {
Log.d(LOG_TAG, "Converting the response process has been failed. ", e);
}
return yesstates;
}
///
public static List<States> convertToStatesList1(List<States> data) {
List<States> states = new ArrayList<>();
Log.d(LOG_TAG, "Converting the response.");
try {
/*
for (States ddd : data) {
States state_data = new States();
state_data.state = ddd.state;
state_data.cases = ddd.cases;
state_data.todayCases = ddd.todayCases;
state_data.deaths = ddd.deaths;
state_data.todayDeaths = ddd.todayDeaths;
state_data.active = ddd.active;
// add
states.add(state_data);
}
*/
Log.d(LOG_TAG, "Converting the response process has been success. ");
} catch (Exception e) {
Log.d(LOG_TAG, "Converting the response process has been failed. ", e);
}
//return states;
return data;
}
//private static Date getDate(String stringData) throws ParseException {
// DateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss", Locale.getDefault());
// return format.parse(stringData);
//}
public static Call<World> getWorldDataFromService() {
Log.d(LOG_TAG, "Getting data from the server");
RestApi service = getRetrofit().create(RestApi.class);
Call<World> call = service.getWorld();
return call;
}
public static Call<YesWorld> getYesWorldDataFromService() {
Log.d(LOG_TAG, "Getting yesterdays data from the server");
RestApi service = getRetrofit().create(RestApi.class);
Call<YesWorld> call = service.getYesWorld();
return call;
}
public static List<YesCountries> convertToYesCountriesList(List<YesCountriesPojo> data) {
List<YesCountries> yescountries = new ArrayList<>();
Log.d(LOG_TAG, "Converting the response.");
try {
for (YesCountriesPojo ddd : data) {
YesCountries country_data = new YesCountries();
country_data.country = ddd.getCountry();
country_data.cases = Integer.parseInt(ddd.getCases());
country_data.active = Integer.parseInt(ddd.getActive());
country_data.deaths = Integer.parseInt(ddd.getDeaths());
country_data.todayCases = Integer.parseInt(ddd.getTodayCases());
country_data.todayDeaths = Integer.parseInt(ddd.getTodayDeaths());
country_data.recovered = Integer.parseInt(ddd.getRecovered());
//country_data.recovered = 0;
country_data.tests = Integer.parseInt(ddd.getTests());
country_data.testsPerMillion = Integer.parseInt(ddd.getTestsPerOneMillion());
country_data.flag = ddd.getCountryInfoPojo().getFlag();
country_data.critical = Integer.parseInt(ddd.getCritical());
country_data.updated = Long.parseLong(ddd.getUpdated());
// add
yescountries.add(country_data);
}
Log.d(LOG_TAG, "Converting the response process has been success. ");
} catch (Exception e) {
Log.d(LOG_TAG, "Converting the response process has been failed. ", e);
}
return yescountries;
}
/*
public static List<States> convertToStatesList(List<States> data) {
List<States> states = new ArrayList<>();
Log.d(LOG_TAG, "Converting the response.");
try {
for (States ddd : data) {
States state_data = new States();
state_data.state = ddd.state;
state_data.cases = ddd.cases;
state_data.todayCases = ddd.todayCases;
state_data.deaths = ddd.deaths;
state_data.todayDeaths = ddd.todayDeaths;
state_data.active = ddd.active;
// add
states.add(state_data);
}
//Log.d(LOG_TAG, "Converting the response process has been success. ");
} catch (Exception e) {
Log.d(LOG_TAG, "Converting the response process has been failed. ", e);
}
//return states;
return data;
}
*/
}

View File

@@ -0,0 +1,48 @@
package com.josh.trackcovid19v2.data.network;
import com.josh.trackcovid19v2.data.database.entity.States;
import com.josh.trackcovid19v2.data.database.entity.World;
import com.josh.trackcovid19v2.data.database.entity.YesWorld;
import com.josh.trackcovid19v2.data.network.pojo.CountriesPojo;
import com.josh.trackcovid19v2.data.network.pojo.StatesPojo;
import com.josh.trackcovid19v2.data.network.pojo.YesCountriesPojo;
import com.josh.trackcovid19v2.data.network.pojo.YesStatesPojo;
import java.util.List;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Query;
public interface RestApi {
@Headers("Content-Type: application/json")
@GET("v2/states")
Call<List<States>> getStatess();
@GET("v2/states")
Call<List<StatesPojo>> getStates(@Query("yesterday") int y);
@GET("v2/states")
Call<List<YesStatesPojo>> getYesStates(@Query("yesterday") int y);
@GET("/v2/countries")
Call<List<CountriesPojo>> getCountries(@Query("yesterday") int y);
@GET("/v2/countries")
Call<List<YesCountriesPojo>> getYesCountries(@Query("yesterday") int y);
@GET("v2/all")
Call<World> getWorld();
@GET("v2/all?yesterday=true")
Call<YesWorld> getYesWorld();
//countries/USA
//yesterday/USA
//
//Observable<List<ServiceResponse>> getStates();
}

View File

@@ -0,0 +1,24 @@
package com.josh.trackcovid19v2.data.network;
import com.josh.trackcovid19v2.data.database.entity.States;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.List;
class StatesWrapper {
@SerializedName("states")
@Expose
private List<States> states = null;
public List<States> getStates() {
return states;
}
public void setStates(List<States> states) {
this.states = states;
}
}

View File

@@ -0,0 +1,308 @@
package com.josh.trackcovid19v2.data.network;
import android.util.Log;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.josh.trackcovid19v2.AppExecutors;
import com.josh.trackcovid19v2.data.database.entity.Countries;
import com.josh.trackcovid19v2.data.database.entity.States;
import com.josh.trackcovid19v2.data.database.entity.World;
import com.josh.trackcovid19v2.data.database.entity.YesCountries;
import com.josh.trackcovid19v2.data.database.entity.YesStates;
import com.josh.trackcovid19v2.data.database.entity.YesWorld;
import com.josh.trackcovid19v2.data.network.pojo.CountriesPojo;
import com.josh.trackcovid19v2.data.network.pojo.StatesPojo;
import com.josh.trackcovid19v2.data.network.pojo.YesCountriesPojo;
import com.josh.trackcovid19v2.data.network.pojo.YesStatesPojo;
import com.josh.trackcovid19v2.model.ServiceRequest;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class UserNetworkDataSource {
private static final String LOG_TAG = UserNetworkDataSource.class.getSimpleName();
// For Singleton instantiation
private static UserNetworkDataSource sInstance;
private static final Object LOCK = new Object();
private AppExecutors mAppExecutors;
private final MutableLiveData<List<States>> mDownloadedStatesData;
private final MutableLiveData<List<YesStates>> mDownloadedYesStatesData;
private final MutableLiveData<List<Countries>> mDownloadedCountriesData;
private final MutableLiveData<List<YesCountries>> mDownloadedYesCountriesData;
private final MutableLiveData<World> mDownloadedWorldData;
private final MutableLiveData<YesWorld> mDownloadedYesWorldData;
public UserNetworkDataSource(AppExecutors mAppExecutors) {
this.mAppExecutors = mAppExecutors;
this.mDownloadedStatesData = new MutableLiveData<>();
this.mDownloadedYesStatesData = new MutableLiveData<>();
this.mDownloadedCountriesData = new MutableLiveData<>();
this.mDownloadedYesCountriesData = new MutableLiveData<>();
this.mDownloadedWorldData = new MutableLiveData<>();
this.mDownloadedYesWorldData = new MutableLiveData<>();
}
public static UserNetworkDataSource getInstance(AppExecutors executors) {
Log.d(LOG_TAG, "Getting the network data source");
if (sInstance == null) {
synchronized (LOCK) {
sInstance = new UserNetworkDataSource(executors);
Log.d(LOG_TAG, "Made new network data source");
}
}
return sInstance;
}
/*
public void fetchData(ServiceRequest serviceRequest) {
mAppExecutors.networkIO().execute(() -> {
try {
Call<List<States>> call = NetworkUtils.getDataFromService();
call.enqueue(new Callback<List<States>>() {
@Override
public void onResponse(Call<List<States>> call, Response<List<States>> response) {
//Toast.makeText(MainActivity.this,response.body().toString(),Toast.LENGTH_SHORT).show();
Log.e("Info", "got data");
//ArrayList<States> foo = new ArrayList<States>();
List<States> data = response.body();
setStatesList(NetworkUtils.convertToStatesList(data));
}
@Override
public void onFailure(Call<List<States>> call, Throwable t) {
Log.d(LOG_TAG, "fofofofofofof");
Log.d("Error",t.getMessage());
}
});
} catch (Exception ex) {
Log.e(LOG_TAG, "Getting data process has been failed.", ex);
}
});
}
*/
public void fetchStatesData(ServiceRequest serviceRequest) {
mAppExecutors.networkIO().execute(() -> {
try {
Call<List<StatesPojo>> call = NetworkUtils.getStatesDataFromService();
call.enqueue(new Callback<List<StatesPojo>>() {
@Override
public void onResponse(Call<List<StatesPojo>> call, Response<List<StatesPojo>> response) {
//Toast.makeText(MainActivity.this,response.body().toString(),Toast.LENGTH_SHORT).show();
Log.e("Info", "got states data");
//ArrayList<States> foo = new ArrayList<States>();
List<StatesPojo> data = response.body();
setStatesList(NetworkUtils.convertToStatesList(data));
}
@Override
public void onFailure(Call<List<StatesPojo>> call, Throwable t) {
Log.d(LOG_TAG, "states error");
Log.d("Error",t.getMessage());
}
});
} catch (Exception ex) {
Log.e(LOG_TAG, "Getting states data process has been failed.", ex);
}
});
}
public void fetchYesStatesData(ServiceRequest serviceRequest) {
mAppExecutors.networkIO().execute(() -> {
try {
Call<List<YesStatesPojo>> call = NetworkUtils.getYesStatesDataFromService();
call.enqueue(new Callback<List<YesStatesPojo>>() {
@Override
public void onResponse(Call<List<YesStatesPojo>> call, Response<List<YesStatesPojo>> response) {
//Toast.makeText(MainActivity.this,response.body().toString(),Toast.LENGTH_SHORT).show();
Log.e("Info", "got yes states data");
//ArrayList<States> foo = new ArrayList<States>();
List<YesStatesPojo> data = response.body();
setYesStatesList(NetworkUtils.convertToYesStatesList(data));
}
@Override
public void onFailure(Call<List<YesStatesPojo>> call, Throwable t) {
Log.d(LOG_TAG, "yes states error");
Log.d("Error",t.getMessage());
}
});
} catch (Exception ex) {
Log.e(LOG_TAG, "Getting states data process has been failed.", ex);
}
});
}
public void fetchCountriesData(ServiceRequest serviceRequest) {
mAppExecutors.networkIO().execute(() -> {
try {
Call<List<CountriesPojo>> call = NetworkUtils.getCountriesDataFromService();
call.enqueue(new Callback<List<CountriesPojo>>() {
@Override
public void onResponse(Call<List<CountriesPojo>> call, Response<List<CountriesPojo>> response) {
//Toast.makeText(MainActivity.this,response.body().toString(),Toast.LENGTH_SHORT).show();
Log.e("Info", "got countries data");
//ArrayList<States> foo = new ArrayList<States>();
List<CountriesPojo> data = response.body();
setCountriesList(NetworkUtils.convertToCountriesList(data));
}
@Override
public void onFailure(Call<List<CountriesPojo>> call, Throwable t) {
Log.d(LOG_TAG, "countries error");
Log.d("Error",t.getMessage());
}
});
} catch (Exception ex) {
Log.e(LOG_TAG, "Getting data process has been failed.", ex);
}
});
}
public void fetchYesCountriesData(ServiceRequest serviceRequest) {
mAppExecutors.networkIO().execute(() -> {
try {
Call<List<YesCountriesPojo>> call = NetworkUtils.getYesCountriesDataFromService();
call.enqueue(new Callback<List<YesCountriesPojo>>() {
@Override
public void onResponse(Call<List<YesCountriesPojo>> call, Response<List<YesCountriesPojo>> response) {
//Toast.makeText(MainActivity.this,response.body().toString(),Toast.LENGTH_SHORT).show();
Log.e("Info", "got yesterdays countries data");
//ArrayList<States> foo = new ArrayList<States>();
List<YesCountriesPojo> data = response.body();
setYesCountriesList(NetworkUtils.convertToYesCountriesList(data));
}
@Override
public void onFailure(Call<List<YesCountriesPojo>> call, Throwable t) {
Log.d(LOG_TAG, "yes countries error");
Log.d("Error",t.getMessage());
}
});
} catch (Exception ex) {
Log.e(LOG_TAG, "Getting data process has been failed.", ex);
}
});
}
public void fetchWorldData(ServiceRequest serviceRequest) {
mAppExecutors.networkIO().execute(() -> {
try {
Call<World> call = NetworkUtils.getWorldDataFromService();
call.enqueue(new Callback<World>() {
@Override
public void onResponse(Call<World> call, Response<World> response) {
//Toast.makeText(MainActivity.this,response.body().toString(),Toast.LENGTH_SHORT).show();
Log.e("Info", "got world data");
//ArrayList<States> foo = new ArrayList<States>();
World data = response.body();
//setWorld(NetworkUtils.convertToStatesList(data));
setWorld(data);
}
@Override
public void onFailure(Call<World> call, Throwable t) {
Log.d(LOG_TAG, "fofofofofofof");
Log.d("Error", t.getMessage());
}
});
} catch (Exception ex) {
Log.e(LOG_TAG, "Getting data process has been failed.", ex);
}
});
}
public void fetchYesWorldData(ServiceRequest serviceRequest) {
mAppExecutors.networkIO().execute(() -> {
try {
Call<YesWorld> call1 = NetworkUtils.getYesWorldDataFromService();
call1.enqueue(new Callback<YesWorld>() {
@Override
public void onResponse(Call<YesWorld> call, Response<YesWorld> response) {
//Toast.makeText(MainActivity.this,response.body().toString(),Toast.LENGTH_SHORT).show();
Log.e("Info", "got yesterday's world data");
//ArrayList<States> foo = new ArrayList<States>();
YesWorld data = response.body();
//setWorld(NetworkUtils.convertToStatesList(data));
setYesWorld(data);
}
@Override
public void onFailure(Call<YesWorld> call, Throwable t) {
Log.d(LOG_TAG, "fofofofofofof");
Log.d("Error", t.getMessage());
}
});
} catch (Exception ex) {
Log.e(LOG_TAG, "Getting data process has been failed.", ex);
}
});
}
// private void setStatesList(List<States> statesList){
// mDownloadedData.postValue(statesList);
// }
private void setWorld(World world) {
mDownloadedWorldData.postValue(world);
}
public LiveData<World> getWorld(){
return mDownloadedWorldData;
}
private void setYesWorld(YesWorld yesworld) {
mDownloadedYesWorldData.postValue(yesworld);
}
public LiveData<YesWorld> getYesWorld(){
return mDownloadedYesWorldData;
}
private void setStatesList(List<States> statesList){
mDownloadedStatesData.postValue(statesList);
}
public LiveData<List<States>> getStatesList(){
return mDownloadedStatesData;
}
private void setYesStatesList(List<YesStates> yesstatesList){
mDownloadedYesStatesData.postValue(yesstatesList);
}
public LiveData<List<YesStates>> getYesStatesList(){
return mDownloadedYesStatesData;
}
private void setCountriesList(List<Countries> countriesList){
mDownloadedCountriesData.postValue(countriesList);
}
public LiveData<List<Countries>> getCountriesList(){
return mDownloadedCountriesData;
}
private void setYesCountriesList(List<YesCountries> yescountriesList){
mDownloadedYesCountriesData.postValue(yescountriesList);
}
public LiveData<List<YesCountries>> getYesCountriesList(){
return mDownloadedYesCountriesData;
}
}

View File

@@ -0,0 +1,166 @@
package com.josh.trackcovid19v2.data.network.pojo;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class CountriesPojo {
@SerializedName("country")
@Expose
private String country;
@SerializedName("updated")
@Expose
private String updated;
@SerializedName("cases")
@Expose
private String cases;
@SerializedName("todayCases")
@Expose
private String todayCases;
@SerializedName("deaths")
@Expose
private String deaths;
@SerializedName("todayDeaths")
@Expose
private String todayDeaths;
@SerializedName("recovered")
@Expose
private String recovered;
@SerializedName("active")
@Expose
private String active;
@SerializedName("critical")
@Expose
private String critical;
@SerializedName("casesPerOneMillion")
@Expose
private String casesPerOneMillion;
@SerializedName("deathsPerOneMillion")
@Expose
private String deathsPerOneMillion;
@SerializedName("tests")
@Expose
private String tests;
@SerializedName("testsPerOneMillion")
@Expose
private String testsPerOneMillion;
@SerializedName("countryInfo")
@Expose
private CountryInfoPojo countryInfoPojo = null;
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getUpdated() {
return updated;
}
public void setUpdated(String updated) {
this.updated = updated;
}
public String getCases() {
return cases;
}
public void setCases(String cases) {
this.cases = cases;
}
public String getTodayCases() {
return todayCases;
}
public void setTodayCases(String todayCases) {
this.todayCases = todayCases;
}
public String getDeaths() {
return deaths;
}
public void setDeaths(String deaths) {
this.deaths = deaths;
}
public String getTodayDeaths() {
return todayDeaths;
}
public void setTodayDeaths(String todayDeaths) {
this.todayDeaths = todayDeaths;
}
public String getRecovered() {
return recovered;
}
public void setRecovered(String recovered) {
this.recovered = recovered;
}
public String getActive() {
return active;
}
public void setActive(String active) {
this.active = active;
}
public String getCritical() {
return critical;
}
public void setCritical(String critical) {
this.critical = critical;
}
public String getCasesPerOneMillion() {
return casesPerOneMillion;
}
public void setCasesPerOneMillion(String casesPerOneMillion) {
this.casesPerOneMillion = casesPerOneMillion;
}
public String getDeathsPerOneMillion() {
return deathsPerOneMillion;
}
public void setDeathsPerOneMillion(String deathsPerOneMillion) {
this.deathsPerOneMillion = deathsPerOneMillion;
}
public String getTests() {
return tests;
}
public void setTests(String tests) {
this.tests = tests;
}
public String getTestsPerOneMillion() {
return testsPerOneMillion;
}
public void setTestsPerOneMillion(String testsPerOneMillion) {
this.testsPerOneMillion = testsPerOneMillion;
}
public CountryInfoPojo getCountryInfoPojo() {
return countryInfoPojo;
}
public void setCountryInfoPojo(CountryInfoPojo countryInfoPojo) {
this.countryInfoPojo = countryInfoPojo;
}
}

View File

@@ -0,0 +1,74 @@
package com.josh.trackcovid19v2.data.network.pojo;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class CountryInfoPojo {
@SerializedName("_id")
@Expose
private String _id;
@SerializedName("iso2")
@Expose
private String iso2;
@SerializedName("iso3")
@Expose
private String iso3;
@SerializedName("lat")
@Expose
private String lat;
@SerializedName("llong")
@Expose
private String llong;
@SerializedName("flag")
@Expose
private String flag;
public String get_id() {
return _id;
}
public void set_id(String _id) {
this._id = _id;
}
public String getIso2() {
return iso2;
}
public void setIso2(String iso2) {
this.iso2 = iso2;
}
public String getIso3() {
return iso3;
}
public void setIso3(String iso3) {
this.iso3 = iso3;
}
public String getLat() {
return lat;
}
public void setLat(String lat) {
this.lat = lat;
}
public String getLlong() {
return llong;
}
public void setLlong(String llong) {
this.llong = llong;
}
public String getFlag() {
return flag;
}
public void setFlag(String flag) {
this.flag = flag;
}
}

View File

@@ -0,0 +1,104 @@
package com.josh.trackcovid19v2.data.network.pojo;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class StatesPojo {
@SerializedName("state")
@Expose
public String state;
@SerializedName("cases")
@Expose
public String cases;
@SerializedName("todayCases")
@Expose
public String todayCases;
@SerializedName("deaths")
@Expose
public String deaths;
@SerializedName("todayDeaths")
@Expose
public String todayDeaths;
@SerializedName("active")
@Expose
public String active;
@SerializedName("tests")
private String tests;
@SerializedName("testsPerOneMillion")
@Expose
private String testsPerOneMillion;
public String getState() {
return state;
}
public void setCountry(String country) {
this.state = state;
}
public String getCases() {
return cases;
}
public void setCases(String cases) {
this.cases = cases;
}
public String getTodayCases() {
return todayCases;
}
public void setTodayCases(String todayCases) {
this.todayCases = todayCases;
}
public String getDeaths() {
return deaths;
}
public void setDeaths(String deaths) {
this.deaths = deaths;
}
public String getTodayDeaths() {
return todayDeaths;
}
public void setTodayDeaths(String todayDeaths) {
this.todayDeaths = todayDeaths;
}
public String getActive() {
return active;
}
public void setActive(String active) {
this.active = active;
}
public String getTests() {
return tests;
}
public void setTests(String tests) {
this.tests = tests;
}
public String getTestsPerOneMillion() {
return testsPerOneMillion;
}
public void setTestsPerOneMillion(String testsPerOneMillion) {
this.testsPerOneMillion = testsPerOneMillion;
}
//@SerializedName("group")
// @Expose
//public Group group;
//@SerializedName("address")
//@Expose
//public Address address;
}

View File

@@ -0,0 +1,166 @@
package com.josh.trackcovid19v2.data.network.pojo;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class YesCountriesPojo {
@SerializedName("country")
@Expose
private String country;
@SerializedName("updated")
@Expose
private String updated;
@SerializedName("cases")
@Expose
private String cases;
@SerializedName("todayCases")
@Expose
private String todayCases;
@SerializedName("deaths")
@Expose
private String deaths;
@SerializedName("todayDeaths")
@Expose
private String todayDeaths;
@SerializedName("recovered")
@Expose
private String recovered;
@SerializedName("active")
@Expose
private String active;
@SerializedName("critical")
@Expose
private String critical;
@SerializedName("casesPerOneMillion")
@Expose
private String casesPerOneMillion;
@SerializedName("deathsPerOneMillion")
@Expose
private String deathsPerOneMillion;
@SerializedName("tests")
@Expose
private String tests;
@SerializedName("testsPerOneMillion")
@Expose
private String testsPerOneMillion;
@SerializedName("countryInfo")
@Expose
private CountryInfoPojo countryInfoPojo = null;
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getUpdated() {
return updated;
}
public void setUpdated(String updated) {
this.updated = updated;
}
public String getCases() {
return cases;
}
public void setCases(String cases) {
this.cases = cases;
}
public String getTodayCases() {
return todayCases;
}
public void setTodayCases(String todayCases) {
this.todayCases = todayCases;
}
public String getDeaths() {
return deaths;
}
public void setDeaths(String deaths) {
this.deaths = deaths;
}
public String getTodayDeaths() {
return todayDeaths;
}
public void setTodayDeaths(String todayDeaths) {
this.todayDeaths = todayDeaths;
}
public String getRecovered() {
return recovered;
}
public void setRecovered(String recovered) {
this.recovered = recovered;
}
public String getActive() {
return active;
}
public void setActive(String active) {
this.active = active;
}
public String getCritical() {
return critical;
}
public void setCritical(String critical) {
this.critical = critical;
}
public String getCasesPerOneMillion() {
return casesPerOneMillion;
}
public void setCasesPerOneMillion(String casesPerOneMillion) {
this.casesPerOneMillion = casesPerOneMillion;
}
public String getDeathsPerOneMillion() {
return deathsPerOneMillion;
}
public void setDeathsPerOneMillion(String deathsPerOneMillion) {
this.deathsPerOneMillion = deathsPerOneMillion;
}
public String getTests() {
return tests;
}
public void setTests(String tests) {
this.tests = tests;
}
public String getTestsPerOneMillion() {
return testsPerOneMillion;
}
public void setTestsPerOneMillion(String testsPerOneMillion) {
this.testsPerOneMillion = testsPerOneMillion;
}
public CountryInfoPojo getCountryInfoPojo() {
return countryInfoPojo;
}
public void setCountryInfoPojo(CountryInfoPojo countryInfoPojo) {
this.countryInfoPojo = countryInfoPojo;
}
}

View File

@@ -0,0 +1,74 @@
package com.josh.trackcovid19v2.data.network.pojo;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class YesCountryInfoPojo {
@SerializedName("_id")
@Expose
private String _id;
@SerializedName("iso2")
@Expose
private String iso2;
@SerializedName("iso3")
@Expose
private String iso3;
@SerializedName("lat")
@Expose
private String lat;
@SerializedName("llong")
@Expose
private String llong;
@SerializedName("flag")
@Expose
private String flag;
public String get_id() {
return _id;
}
public void set_id(String _id) {
this._id = _id;
}
public String getIso2() {
return iso2;
}
public void setIso2(String iso2) {
this.iso2 = iso2;
}
public String getIso3() {
return iso3;
}
public void setIso3(String iso3) {
this.iso3 = iso3;
}
public String getLat() {
return lat;
}
public void setLat(String lat) {
this.lat = lat;
}
public String getLlong() {
return llong;
}
public void setLlong(String llong) {
this.llong = llong;
}
public String getFlag() {
return flag;
}
public void setFlag(String flag) {
this.flag = flag;
}
}

View File

@@ -0,0 +1,98 @@
package com.josh.trackcovid19v2.data.network.pojo;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class YesStatesPojo {
@SerializedName("state")
@Expose
public String state;
@SerializedName("cases")
@Expose
public String cases;
@SerializedName("todayCases")
@Expose
public String todayCases;
@SerializedName("deaths")
@Expose
public String deaths;
@SerializedName("todayDeaths")
@Expose
public String todayDeaths;
@SerializedName("active")
@Expose
public String active;
@SerializedName("tests")
private String tests;
@SerializedName("testsPerOneMillion")
@Expose
private String testsPerOneMillion;
public String getState() {
return state;
}
public void setCountry(String country) {
this.state = state;
}
public String getCases() {
return cases;
}
public void setCases(String cases) {
this.cases = cases;
}
public String getTodayCases() {
return todayCases;
}
public void setTodayCases(String todayCases) {
this.todayCases = todayCases;
}
public String getDeaths() {
return deaths;
}
public void setDeaths(String deaths) {
this.deaths = deaths;
}
public String getTodayDeaths() {
return todayDeaths;
}
public void setTodayDeaths(String todayDeaths) {
this.todayDeaths = todayDeaths;
}
public String getActive() {
return active;
}
public void setActive(String active) {
this.active = active;
}
public String getTests() {
return tests;
}
public void setTests(String tests) {
this.tests = tests;
}
public String getTestsPerOneMillion() {
return testsPerOneMillion;
}
public void setTestsPerOneMillion(String testsPerOneMillion) {
this.testsPerOneMillion = testsPerOneMillion;
}
}

View File

@@ -0,0 +1,11 @@
package com.josh.trackcovid19v2.model;
import java.util.List;
public class Countries {
public String Country;
public String flag;
public List<CountryData> CountryData;
}

View File

@@ -0,0 +1,9 @@
package com.josh.trackcovid19v2.model;
public class CountryData {
public int cases;
public int active;
}

View File

@@ -0,0 +1,10 @@
package com.josh.trackcovid19v2.model;
public class ServiceRequest {
public ServiceRequest() {
}
}

View File

@@ -0,0 +1,14 @@
package com.josh.trackcovid19v2.model;
import com.josh.trackcovid19v2.data.network.pojo.StatesPojo;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class ServiceResponse {
@SerializedName("data")
@Expose
public List<StatesPojo> data = null;
}

View File

@@ -0,0 +1,145 @@
package com.josh.trackcovid19v2.ui.tableview;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.evrencoskun.tableview.adapter.AbstractTableAdapter;
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractSorterViewHolder;
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder;
import com.josh.trackcovid19v2.R;
import com.josh.trackcovid19v2.data.database.entity.Countries;
import com.josh.trackcovid19v2.ui.tableview.holder.CellViewHolder;
import com.josh.trackcovid19v2.ui.tableview.holder.ColumnHeaderViewHolder;
import com.josh.trackcovid19v2.ui.tableview.holder.MoneyCellViewHolder;
import com.josh.trackcovid19v2.ui.tableview.holder.RowHeaderViewHolder;
import com.josh.trackcovid19v2.ui.tableview.model.CellModel;
import com.josh.trackcovid19v2.ui.tableview.model.ColumnHeaderModel;
import com.josh.trackcovid19v2.ui.tableview.model.RowHeaderModel;
import java.util.List;
/**
* Created by evrencoskun on 27.11.2017.
*/
public class CountriesTableAdapter extends AbstractTableAdapter<ColumnHeaderModel, RowHeaderModel,
CellModel> {
private CountriesTableViewModel myTableViewModel;
public CountriesTableAdapter(Context p_jContext) {
super(p_jContext);
this.myTableViewModel = new CountriesTableViewModel();
}
@Override
public AbstractViewHolder onCreateCellViewHolder(ViewGroup parent, int viewType) {
View layout;
switch (viewType) {
default:
// Get default Cell xml Layout
layout = LayoutInflater.from(mContext).inflate(R.layout.tableview_cell_layout,
parent, false);
// Create a Cell ViewHolder
return new CellViewHolder(layout);
}
}
@Override
public void onBindCellViewHolder(AbstractViewHolder holder, Object p_jValue, int
p_nXPosition, int p_nYPosition) {
CellModel cell = (CellModel) p_jValue;
if (holder instanceof CellViewHolder) {
// Get the holder to update cell item text
((CellViewHolder) holder).setCellModel(cell, p_nXPosition);
} else if (holder instanceof MoneyCellViewHolder) {
((MoneyCellViewHolder) holder).setCellModel(cell);
}
}
@Override
public AbstractSorterViewHolder onCreateColumnHeaderViewHolder(ViewGroup parent, int viewType) {
View layout = LayoutInflater.from(mContext).inflate(R.layout
.tableview_column_header_layout, parent, false);
return new ColumnHeaderViewHolder(layout, getTableView());
}
@Override
public void onBindColumnHeaderViewHolder(AbstractViewHolder holder, Object p_jValue, int
p_nXPosition) {
ColumnHeaderModel columnHeader = (ColumnHeaderModel) p_jValue;
// Get the holder to update cell item text
ColumnHeaderViewHolder columnHeaderViewHolder = (ColumnHeaderViewHolder) holder;
columnHeaderViewHolder.setColumnHeaderModel(columnHeader, p_nXPosition);
}
@Override
public AbstractViewHolder onCreateRowHeaderViewHolder(ViewGroup parent, int viewType) {
// Get Row Header xml Layout
View layout = LayoutInflater.from(mContext).inflate(R.layout.tableview_row_header_layout,
parent, false);
// Create a Row Header ViewHolder
return new RowHeaderViewHolder(layout);
}
@Override
public void onBindRowHeaderViewHolder(AbstractViewHolder holder, Object p_jValue, int
p_nYPosition) {
RowHeaderModel rowHeaderModel = (RowHeaderModel) p_jValue;
RowHeaderViewHolder rowHeaderViewHolder = (RowHeaderViewHolder) holder;
rowHeaderViewHolder.row_header_textview.setText(rowHeaderModel.getData());
}
@Override
public View onCreateCornerView() {
return LayoutInflater.from(mContext).inflate(R.layout.tableview_corner_layout, null, false);
}
@Override
public int getColumnHeaderItemViewType(int position) {
return 0;
}
@Override
public int getRowHeaderItemViewType(int position) {
return 0;
}
@Override
public int getCellItemViewType(int position) {
return myTableViewModel.getCellItemViewType(position);
}
/**
* This method is not a generic Adapter method. It helps to generate lists from single user
* list for this adapter.
*/
public void setCountriesList(List<Countries> countriesList) {
// Generate the lists that are used to TableViewAdapter
myTableViewModel.generateListForTableView(countriesList);
// Now we got what we need to show on TableView.
setAllItems(myTableViewModel.getColumHeaderModeList(), myTableViewModel
.getRowHeaderModelList(), myTableViewModel.getCellModelList());
}
}

View File

@@ -0,0 +1,203 @@
package com.josh.trackcovid19v2.ui.tableview;
import android.view.Gravity;
import com.josh.trackcovid19v2.data.database.entity.Countries;
import com.josh.trackcovid19v2.ui.tableview.model.CellModel;
import com.josh.trackcovid19v2.ui.tableview.model.ColumnHeaderModel;
import com.josh.trackcovid19v2.ui.tableview.model.RowHeaderModel;
import java.util.ArrayList;
import java.util.List;
/**
* Created by evrencoskun on 4.02.2018.
*/
public class CountriesTableViewModel {
private List<ColumnHeaderModel> mColumnHeaderModelList;
private List<RowHeaderModel> mRowHeaderModelList;
private List<List<CellModel>> mCellModelList;
public int getCellItemViewType(int column) {
switch (column) {
/*
case 5:
// 5. column header is gender.
return GENDER_TYPE;
case 8:
// 8. column header is Salary.
return MONEY_TYPE;
*/
default:
return 0;
}
}
/*
- Each of Column Header -
"Id"
"Name"
"Nickname"
"Email"
"Birthday"
"Gender"
"Age"
"Job"
"Salary"
"CreatedAt"
"UpdatedAt"
"Address"
"Zip Code"
"Phone"
"Fax"
*/
public int getColumnTextAlign(int column) {
switch (column) {
// Id
case 0:
return Gravity.CENTER;
// Name
case 1:
return Gravity.LEFT;
// Nickname
case 2:
return Gravity.LEFT;
// Email
case 3:
return Gravity.LEFT;
// BirthDay
case 4:
return Gravity.CENTER;
// Gender (Sex)
case 5:
return Gravity.CENTER;
// Age
case 6:
return Gravity.CENTER;
// Job
case 7:
return Gravity.LEFT;
// Salary
case 8:
return Gravity.CENTER;
// CreatedAt
case 9:
return Gravity.CENTER;
// UpdatedAt
case 10:
return Gravity.CENTER;
// Address
case 11:
return Gravity.LEFT;
// Zip Code
case 12:
return Gravity.RIGHT;
// Phone
case 13:
return Gravity.RIGHT;
// Fax
case 14:
return Gravity.RIGHT;
default:
return Gravity.CENTER;
}
}
private List<ColumnHeaderModel> createColumnHeaderModelList() {
List<ColumnHeaderModel> list = new ArrayList<>();
// Create Column Headers
list.add(new ColumnHeaderModel("Country"));
// list.add(new ColumnHeaderModel("Flag"));
list.add(new ColumnHeaderModel("Cases"));
list.add(new ColumnHeaderModel("Today's Cases"));
list.add(new ColumnHeaderModel("Deaths"));
list.add(new ColumnHeaderModel("Today's Deaths"));
list.add(new ColumnHeaderModel("Active"));
/*
list.add(new ColumnHeaderModel("Cases"));
list.add(new ColumnHeaderModel("Today's Cases"));
list.add(new ColumnHeaderModel("Deaths"));
list.add(new ColumnHeaderModel("Today's Deaths"));
list.add(new ColumnHeaderModel("Active Cases"));
*/
return list;
}
private List<List<CellModel>> createCellModelList(List<Countries> countriesList) {
List<List<CellModel>> lists = new ArrayList<>();
// Creating cell model list from User list for Cell Items
// In this example, State list is populated from web service
for (int i = 0; i < countriesList.size(); i++) {
Countries country_data = countriesList.get(i);
List<CellModel> list = new ArrayList<>();
// The order should be same with column header list;
list.add(new CellModel("1-" + i, country_data.country)); // "Id"
// list.add(new CellModel("1-" + i, Html.ImageGetter(country_data.flag);
list.add(new CellModel("2-" + i, country_data.cases));
list.add(new CellModel("3-" + i, country_data.todayCases));
list.add(new CellModel("4-" + i, country_data.deaths));
list.add(new CellModel("5-" + i, country_data.todayDeaths));
list.add(new CellModel("6-" + i, country_data.active));
/*
list.add(new CellModel("2-" + i, country_data.cases)); // "Name"
list.add(new CellModel("3-" + i, country_data.todayCases)); // "Nickname"
list.add(new CellModel("4-" + i, country_data.deaths)); // "Email"
list.add(new CellModel("5-" + i, country_data.todayDeaths)); // "BirthDay"
list.add(new CellModel("6-" + i, country_data.active));
*/
// Add
lists.add(list);
}
return lists;
}
private List<RowHeaderModel> createRowHeaderList(int size) {
List<RowHeaderModel> list = new ArrayList<>();
for (int i = 0; i < size; i++) {
// In this example, Row headers just shows the index of the TableView List.
list.add(new RowHeaderModel(String.valueOf(i + 1)));
}
return list;
}
public List<ColumnHeaderModel> getColumHeaderModeList() {
return mColumnHeaderModelList;
}
public List<RowHeaderModel> getRowHeaderModelList() {
return mRowHeaderModelList;
}
public List<List<CellModel>> getCellModelList() {
return mCellModelList;
}
public void generateListForTableView(List<Countries> countries) {
mColumnHeaderModelList = createColumnHeaderModelList();
mCellModelList = createCellModelList(countries);
mRowHeaderModelList = createRowHeaderList(countries.size());
}
}

View File

@@ -0,0 +1,145 @@
package com.josh.trackcovid19v2.ui.tableview;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.evrencoskun.tableview.adapter.AbstractTableAdapter;
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractSorterViewHolder;
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder;
import com.josh.trackcovid19v2.R;
import com.josh.trackcovid19v2.data.database.entity.States;
import com.josh.trackcovid19v2.ui.tableview.holder.CellViewHolder;
import com.josh.trackcovid19v2.ui.tableview.holder.ColumnHeaderViewHolder;
import com.josh.trackcovid19v2.ui.tableview.holder.MoneyCellViewHolder;
import com.josh.trackcovid19v2.ui.tableview.holder.RowHeaderViewHolder;
import com.josh.trackcovid19v2.ui.tableview.model.CellModel;
import com.josh.trackcovid19v2.ui.tableview.model.ColumnHeaderModel;
import com.josh.trackcovid19v2.ui.tableview.model.RowHeaderModel;
import java.util.List;
/**
* Created by evrencoskun on 27.11.2017.
*/
public class MyTableAdapter extends AbstractTableAdapter<ColumnHeaderModel, RowHeaderModel,
CellModel> {
private MyTableViewModel myTableViewModel;
public MyTableAdapter(Context p_jContext) {
super(p_jContext);
this.myTableViewModel = new MyTableViewModel();
}
@Override
public AbstractViewHolder onCreateCellViewHolder(ViewGroup parent, int viewType) {
View layout;
switch (viewType) {
default:
// Get default Cell xml Layout
layout = LayoutInflater.from(mContext).inflate(R.layout.tableview_cell_layout,
parent, false);
// Create a Cell ViewHolder
return new CellViewHolder(layout);
}
}
@Override
public void onBindCellViewHolder(AbstractViewHolder holder, Object p_jValue, int
p_nXPosition, int p_nYPosition) {
CellModel cell = (CellModel) p_jValue;
if (holder instanceof CellViewHolder) {
// Get the holder to update cell item text
((CellViewHolder) holder).setCellModel(cell, p_nXPosition);
} else if (holder instanceof MoneyCellViewHolder) {
((MoneyCellViewHolder) holder).setCellModel(cell);
}
}
@Override
public AbstractSorterViewHolder onCreateColumnHeaderViewHolder(ViewGroup parent, int viewType) {
View layout = LayoutInflater.from(mContext).inflate(R.layout
.tableview_column_header_layout, parent, false);
return new ColumnHeaderViewHolder(layout, getTableView());
}
@Override
public void onBindColumnHeaderViewHolder(AbstractViewHolder holder, Object p_jValue, int
p_nXPosition) {
ColumnHeaderModel columnHeader = (ColumnHeaderModel) p_jValue;
// Get the holder to update cell item text
ColumnHeaderViewHolder columnHeaderViewHolder = (ColumnHeaderViewHolder) holder;
columnHeaderViewHolder.setColumnHeaderModel(columnHeader, p_nXPosition);
}
@Override
public AbstractViewHolder onCreateRowHeaderViewHolder(ViewGroup parent, int viewType) {
// Get Row Header xml Layout
View layout = LayoutInflater.from(mContext).inflate(R.layout.tableview_row_header_layout,
parent, false);
// Create a Row Header ViewHolder
return new RowHeaderViewHolder(layout);
}
@Override
public void onBindRowHeaderViewHolder(AbstractViewHolder holder, Object p_jValue, int
p_nYPosition) {
RowHeaderModel rowHeaderModel = (RowHeaderModel) p_jValue;
RowHeaderViewHolder rowHeaderViewHolder = (RowHeaderViewHolder) holder;
rowHeaderViewHolder.row_header_textview.setText(rowHeaderModel.getData());
}
@Override
public View onCreateCornerView() {
return LayoutInflater.from(mContext).inflate(R.layout.tableview_corner_layout, null, false);
}
@Override
public int getColumnHeaderItemViewType(int position) {
return 0;
}
@Override
public int getRowHeaderItemViewType(int position) {
return 0;
}
@Override
public int getCellItemViewType(int position) {
return myTableViewModel.getCellItemViewType(position);
}
/**
* This method is not a generic Adapter method. It helps to generate lists from single user
* list for this adapter.
*/
public void setStatesList(List<States> statesList) {
// Generate the lists that are used to TableViewAdapter
myTableViewModel.generateListForTableView(statesList);
// Now we got what we need to show on TableView.
setAllItems(myTableViewModel.getColumHeaderModeList(), myTableViewModel
.getRowHeaderModelList(), myTableViewModel.getCellModelList());
}
}

View File

@@ -0,0 +1,65 @@
package com.josh.trackcovid19v2.ui.tableview;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.evrencoskun.tableview.ITableView;
import com.evrencoskun.tableview.listener.ITableViewListener;
import com.josh.trackcovid19v2.ui.tableview.holder.ColumnHeaderViewHolder;
import com.josh.trackcovid19v2.ui.tableview.popup.ColumnHeaderLongPressPopup;
/**
* Created by evrencoskun on 2.12.2017.
*/
public class MyTableViewListener implements ITableViewListener {
private static final String LOG_TAG = MyTableViewListener.class.getSimpleName();
private ITableView mTableView;
public MyTableViewListener(ITableView pTableView) {
this.mTableView = pTableView;
}
@Override
public void onCellClicked(@NonNull RecyclerView.ViewHolder cellView, int column, int row) {
Log.d(LOG_TAG, "onCellClicked has been clicked for x= " + column + " y= " + row);
}
@Override
public void onCellLongPressed(@NonNull RecyclerView.ViewHolder cellView, int column, int row) {
Log.d(LOG_TAG, "onCellLongPressed has been clicked for " + row);
}
@Override
public void onColumnHeaderClicked(@NonNull RecyclerView.ViewHolder columnHeaderView, int
column) {
Log.d(LOG_TAG, "onColumnHeaderClicked has been clicked for " + column);
}
@Override
public void onColumnHeaderLongPressed(@NonNull RecyclerView.ViewHolder columnHeaderView, int
column) {
if (columnHeaderView != null && columnHeaderView instanceof ColumnHeaderViewHolder) {
// Create Long Press Popup
ColumnHeaderLongPressPopup popup = new ColumnHeaderLongPressPopup(
(ColumnHeaderViewHolder) columnHeaderView, mTableView);
// Show
popup.show();
}
}
@Override
public void onRowHeaderClicked(@NonNull RecyclerView.ViewHolder rowHeaderView, int row) {
Log.d(LOG_TAG, "onRowHeaderClicked has been clicked for " + row);
}
@Override
public void onRowHeaderLongPressed(@NonNull RecyclerView.ViewHolder owHeaderView, int row) {
Log.d(LOG_TAG, "onRowHeaderLongPressed has been clicked for " + row);
}
}

View File

@@ -0,0 +1,188 @@
package com.josh.trackcovid19v2.ui.tableview;
import android.view.Gravity;
import com.josh.trackcovid19v2.data.database.entity.States;
import com.josh.trackcovid19v2.ui.tableview.model.CellModel;
import com.josh.trackcovid19v2.ui.tableview.model.ColumnHeaderModel;
import com.josh.trackcovid19v2.ui.tableview.model.RowHeaderModel;
import java.util.ArrayList;
import java.util.List;
/**
* Created by evrencoskun on 4.02.2018.
*/
public class MyTableViewModel {
// View Types
public static final int GENDER_TYPE = 1;
public static final int MONEY_TYPE = 2;
private List<ColumnHeaderModel> mColumnHeaderModelList;
private List<RowHeaderModel> mRowHeaderModelList;
private List<List<CellModel>> mCellModelList;
public int getCellItemViewType(int column) {
switch (column) {
/*
case 5:
// 5. column header is gender.
return GENDER_TYPE;
case 8:
// 8. column header is Salary.
return MONEY_TYPE;
*/
default:
return 0;
}
}
/*
- Each of Column Header -
"Id"
"Name"
"Nickname"
"Email"
"Birthday"
"Gender"
"Age"
"Job"
"Salary"
"CreatedAt"
"UpdatedAt"
"Address"
"Zip Code"
"Phone"
"Fax"
*/
public int getColumnTextAlign(int column) {
switch (column) {
// Id
case 0:
return Gravity.CENTER;
// Name
case 1:
return Gravity.LEFT;
// Nickname
case 2:
return Gravity.LEFT;
// Email
case 3:
return Gravity.LEFT;
// BirthDay
case 4:
return Gravity.CENTER;
// Gender (Sex)
case 5:
return Gravity.CENTER;
// Age
case 6:
return Gravity.CENTER;
// Job
case 7:
return Gravity.LEFT;
// Salary
case 8:
return Gravity.CENTER;
// CreatedAt
case 9:
return Gravity.CENTER;
// UpdatedAt
case 10:
return Gravity.CENTER;
// Address
case 11:
return Gravity.LEFT;
// Zip Code
case 12:
return Gravity.RIGHT;
// Phone
case 13:
return Gravity.RIGHT;
// Fax
case 14:
return Gravity.RIGHT;
default:
return Gravity.CENTER;
}
}
private List<ColumnHeaderModel> createColumnHeaderModelList() {
List<ColumnHeaderModel> list = new ArrayList<>();
// Create Column Headers
list.add(new ColumnHeaderModel("State"));
list.add(new ColumnHeaderModel("Cases"));
list.add(new ColumnHeaderModel("Today's Cases"));
list.add(new ColumnHeaderModel("Deaths"));
list.add(new ColumnHeaderModel("Today's Deaths"));
list.add(new ColumnHeaderModel("Active Cases"));
return list;
}
private List<List<CellModel>> createCellModelList(List<States> stateList) {
List<List<CellModel>> lists = new ArrayList<>();
// Creating cell model list from User list for Cell Items
// In this example, State list is populated from web service
for (int i = 0; i < stateList.size(); i++) {
States state_data = stateList.get(i);
List<CellModel> list = new ArrayList<>();
// The order should be same with column header list;
list.add(new CellModel("1-" + i, state_data.state)); // "Id"
list.add(new CellModel("2-" + i, state_data.cases)); // "Name"
list.add(new CellModel("3-" + i, state_data.todayCases)); // "Nickname"
list.add(new CellModel("4-" + i, state_data.deaths)); // "Email"
list.add(new CellModel("5-" + i, state_data.todayDeaths)); // "BirthDay"
list.add(new CellModel("6-" + i, state_data.active));
// Add
lists.add(list);
}
return lists;
}
private List<RowHeaderModel> createRowHeaderList(int size) {
List<RowHeaderModel> list = new ArrayList<>();
for (int i = 0; i < size; i++) {
// In this example, Row headers just shows the index of the TableView List.
list.add(new RowHeaderModel(String.valueOf(i + 1)));
}
return list;
}
public List<ColumnHeaderModel> getColumHeaderModeList() {
return mColumnHeaderModelList;
}
public List<RowHeaderModel> getRowHeaderModelList() {
return mRowHeaderModelList;
}
public List<List<CellModel>> getCellModelList() {
return mCellModelList;
}
public void generateListForTableView(List<States> states) {
mColumnHeaderModelList = createColumnHeaderModelList();
mCellModelList = createCellModelList(states);
mRowHeaderModelList = createRowHeaderList(states.size());
}
}

View File

@@ -0,0 +1,54 @@
package com.josh.trackcovid19v2.ui.tableview.holder;
import android.view.Gravity;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder;
import com.josh.trackcovid19v2.R;
import com.josh.trackcovid19v2.ui.tableview.model.CellModel;
/**
* Created by evrencoskun on 1.12.2017.
*/
public class CellViewHolder extends AbstractViewHolder {
public final TextView cell_textview;
public final LinearLayout cell_container;
public CellViewHolder(View itemView) {
super(itemView);
cell_textview = itemView.findViewById(R.id.cell_data);
cell_container = itemView.findViewById(R.id.cell_container);
}
public void setCellModel(CellModel p_jModel, int pColumnPosition) {
// Change textView align by column
cell_textview.setGravity(ColumnHeaderViewHolder.COLUMN_TEXT_ALIGNS[pColumnPosition] |
Gravity.CENTER_VERTICAL);
// Set text
cell_textview.setText(String.valueOf(p_jModel.getData()));
// It is necessary to remeasure itself.
cell_container.getLayoutParams().width = LinearLayout.LayoutParams.WRAP_CONTENT;
cell_textview.requestLayout();
}
@Override
public void setSelected(SelectionState p_nSelectionState) {
super.setSelected(p_nSelectionState);
if (p_nSelectionState == SelectionState.SELECTED) {
cell_textview.setTextColor(ContextCompat.getColor(cell_textview.getContext(), R.color
.selected_text_color));
} else {
cell_textview.setTextColor(ContextCompat.getColor(cell_textview.getContext(), R.color
.unselected_text_color));
}
}
}

View File

@@ -0,0 +1,154 @@
package com.josh.trackcovid19v2.ui.tableview.holder;
import android.view.Gravity;
import android.view.View;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import com.evrencoskun.tableview.ITableView;
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractSorterViewHolder;
import com.evrencoskun.tableview.sort.SortState;
import com.josh.trackcovid19v2.R;
import com.josh.trackcovid19v2.ui.tableview.model.ColumnHeaderModel;
/**
* Created by evrencoskun on 1.12.2017.
*/
public class ColumnHeaderViewHolder extends AbstractSorterViewHolder {
final LinearLayout column_header_container;
final TextView column_header_textview;
final ImageButton column_header_sort_button;
final ITableView tableView;
public ColumnHeaderViewHolder(View itemView, ITableView pTableView) {
super(itemView);
tableView = pTableView;
column_header_textview = itemView.findViewById(R.id.column_header_textView);
column_header_container = itemView.findViewById(R.id.column_header_container);
column_header_sort_button = itemView.findViewById(R.id.column_header_sort_imageButton);
// Set click listener to the sort button
column_header_sort_button.setOnClickListener(mSortButtonClickListener);
}
public void setColumnHeaderModel(ColumnHeaderModel pColumnHeaderModel, int pColumnPosition) {
// Change alignment of textView
column_header_textview.setGravity(COLUMN_TEXT_ALIGNS[pColumnPosition] | Gravity
.CENTER_VERTICAL);
// Set text data
column_header_textview.setText(pColumnHeaderModel.getData());
// It is necessary to remeasure itself.
column_header_container.getLayoutParams().width = LinearLayout.LayoutParams.WRAP_CONTENT;
column_header_textview.requestLayout();
}
@Override
public void setSelected(SelectionState p_nSelectionState) {
super.setSelected(p_nSelectionState);
int nBackgroundColorId;
int nForegroundColorId;
if (p_nSelectionState == SelectionState.SELECTED) {
nBackgroundColorId = R.color.selected_background_color;
nForegroundColorId = R.color.selected_text_color;
} else if (p_nSelectionState == SelectionState.UNSELECTED) {
nBackgroundColorId = R.color.unselected_header_background_color;
nForegroundColorId = R.color.unselected_text_color;
} else { // SelectionState.SHADOWED
nBackgroundColorId = R.color.shadow_background_color;
nForegroundColorId = R.color.unselected_text_color;
}
column_header_container.setBackgroundColor(ContextCompat.getColor(column_header_container
.getContext(), nBackgroundColorId));
column_header_textview.setTextColor(ContextCompat.getColor(column_header_container
.getContext(), nForegroundColorId));
}
@Override
public void onSortingStatusChanged(SortState pSortState) {
super.onSortingStatusChanged(pSortState);
// It is necessary to remeasure itself.
column_header_container.getLayoutParams().width = LinearLayout.LayoutParams.WRAP_CONTENT;
controlSortState(pSortState);
column_header_textview.requestLayout();
column_header_sort_button.requestLayout();
column_header_container.requestLayout();
itemView.requestLayout();
}
private void controlSortState(SortState pSortState) {
if (pSortState == SortState.ASCENDING) {
column_header_sort_button.setVisibility(View.VISIBLE);
column_header_sort_button.setImageResource(R.drawable.ic_down);
} else if (pSortState == SortState.DESCENDING) {
column_header_sort_button.setVisibility(View.VISIBLE);
column_header_sort_button.setImageResource(R.drawable.ic_up);
} else {
column_header_sort_button.setVisibility(View.GONE);
}
}
private View.OnClickListener mSortButtonClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
if (getSortState() == SortState.ASCENDING) {
tableView.sortColumn(getAdapterPosition(), SortState.DESCENDING);
} else if (getSortState() == SortState.DESCENDING) {
tableView.sortColumn(getAdapterPosition(), SortState.ASCENDING);
} else {
// Default one
tableView.sortColumn(getAdapterPosition(), SortState.DESCENDING);
}
}
};
public static final int[] COLUMN_TEXT_ALIGNS = {
// Id
Gravity.CENTER,
// Name
Gravity.LEFT,
// Nickname
Gravity.LEFT,
// Email
Gravity.LEFT,
// BirthDay
Gravity.CENTER,
// Gender (Sex)
Gravity.CENTER,
// Age
Gravity.CENTER,
// Job
Gravity.LEFT,
// Salary
Gravity.CENTER,
// CreatedAt
Gravity.CENTER,
// UpdatedAt
Gravity.CENTER,
// Address
Gravity.LEFT,
// Zip Code
Gravity.RIGHT,
// Phone
Gravity.RIGHT,
// Fax
Gravity.RIGHT};
}

View File

@@ -0,0 +1,57 @@
package com.josh.trackcovid19v2.ui.tableview.holder;
import android.view.View;
import android.widget.LinearLayout;
import androidx.annotation.ColorRes;
import androidx.core.content.ContextCompat;
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder;
import com.josh.trackcovid19v2.R;
import com.josh.trackcovid19v2.ui.tableview.model.CellModel;
import org.fabiomsr.moneytextview.MoneyTextView;
/**
* Created by evrencoskun on 22.12.2017.
*/
public class MoneyCellViewHolder extends AbstractViewHolder {
public final MoneyTextView cell_textview;
public final LinearLayout cell_container;
public MoneyCellViewHolder(View itemView) {
super(itemView);
cell_textview = itemView.findViewById(R.id.money_cell_data);
cell_container = itemView.findViewById(R.id.cell_container);
}
public void setCellModel(CellModel p_jModel) {
// Set text
cell_textview.setAmount(Float.parseFloat((String) p_jModel.getData()));
// It is necessary to remeasure itself.
cell_container.getLayoutParams().width = LinearLayout.LayoutParams.WRAP_CONTENT;
cell_textview.requestLayout();
}
@Override
public void setSelected(SelectionState p_nSelectionState) {
super.setSelected(p_nSelectionState);
if (p_nSelectionState == SelectionState.SELECTED) {
changeColorOfMoneyTextView(R.color.selected_text_color);
} else {
changeColorOfMoneyTextView(R.color.unselected_text_color);
}
}
private void changeColorOfMoneyTextView(@ColorRes int id) {
int color = ContextCompat.getColor(cell_textview.getContext(), id);
cell_textview.setBaseColor(color);
cell_textview.setDecimalsColor(color);
cell_textview.setSymbolColor(color);
}
}

View File

@@ -0,0 +1,49 @@
package com.josh.trackcovid19v2.ui.tableview.holder;
import android.view.View;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder;
import com.josh.trackcovid19v2.R;
/**
* Created by evrencoskun on 1.12.2017.
*/
public class RowHeaderViewHolder extends AbstractViewHolder {
public final TextView row_header_textview;
public RowHeaderViewHolder(View p_jItemView) {
super(p_jItemView);
row_header_textview = p_jItemView.findViewById(R.id.row_header_textview);
}
@Override
public void setSelected(SelectionState p_nSelectionState) {
super.setSelected(p_nSelectionState);
int nBackgroundColorId;
int nForegroundColorId;
if (p_nSelectionState == SelectionState.SELECTED) {
nBackgroundColorId = R.color.selected_background_color;
nForegroundColorId = R.color.selected_text_color;
} else if (p_nSelectionState == SelectionState.UNSELECTED) {
nBackgroundColorId = R.color.unselected_header_background_color;
nForegroundColorId = R.color.unselected_text_color;
} else { // SelectionState.SHADOWED
nBackgroundColorId = R.color.shadow_background_color;
nForegroundColorId = R.color.unselected_text_color;
}
itemView.setBackgroundColor(ContextCompat.getColor(itemView.getContext(),
nBackgroundColorId));
row_header_textview.setTextColor(ContextCompat.getColor(row_header_textview.getContext(),
nForegroundColorId));
}
}

View File

@@ -0,0 +1,32 @@
package com.josh.trackcovid19v2.ui.tableview.model;
import com.evrencoskun.tableview.sort.ISortableModel;
/**
* Created by evrencoskun on 27.11.2017.
*/
public class CellModel implements ISortableModel {
private String mId;
private Object mData;
public CellModel(String pId, Object mData) {
this.mId = pId;
this.mData = mData;
}
public Object getData() {
return mData;
}
@Override
public String getId() {
return mId;
}
@Override
public Object getContent() {
return mData;
}
}

View File

@@ -0,0 +1,18 @@
package com.josh.trackcovid19v2.ui.tableview.model;
/**
* Created by evrencoskun on 27.11.2017.
*/
public class ColumnHeaderModel {
private String mData;
public ColumnHeaderModel(String mData) {
this.mData = mData;
}
public String getData() {
return mData;
}
}

View File

@@ -0,0 +1,17 @@
package com.josh.trackcovid19v2.ui.tableview.model;
/**
* Created by evrencoskun on 27.11.2017.
*/
public class RowHeaderModel {
private String mData;
public RowHeaderModel(String mData) {
this.mData = mData;
}
public String getData() {
return mData;
}
}

View File

@@ -0,0 +1,121 @@
package com.josh.trackcovid19v2.ui.tableview.popup;
import android.content.Context;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.PopupMenu;
import com.evrencoskun.tableview.ITableView;
import com.evrencoskun.tableview.sort.SortState;
import com.josh.trackcovid19v2.R;
import com.josh.trackcovid19v2.ui.tableview.holder.ColumnHeaderViewHolder;
/**
* Created by evrencoskun on 26.12.2017.
*/
public class ColumnHeaderLongPressPopup extends PopupMenu implements PopupMenu
.OnMenuItemClickListener {
private static final String LOG_TAG = ColumnHeaderLongPressPopup.class.getSimpleName();
// Sort states
private static final int ASCENDING = 1;
private static final int DESCENDING = 2;
private static final int CLEAR = 3;
// Test menu items for showing / hiding row
private static final int ROW_HIDE = 4;
private static final int ROW_SHOW = 3;
//
private static final int TEST_ROW_INDEX = 4;
private ColumnHeaderViewHolder m_iViewHolder;
private ITableView m_iTableView;
private Context mContext;
private int mXPosition;
public ColumnHeaderLongPressPopup(ColumnHeaderViewHolder p_iViewHolder, ITableView
p_jTableView) {
super(p_iViewHolder.itemView.getContext(), p_iViewHolder.itemView);
this.m_iViewHolder = p_iViewHolder;
this.m_iTableView = p_jTableView;
this.mContext = p_iViewHolder.itemView.getContext();
this.mXPosition = m_iViewHolder.getAdapterPosition();
// find the view holder
m_iViewHolder = (ColumnHeaderViewHolder) m_iTableView.getColumnHeaderRecyclerView()
.findViewHolderForAdapterPosition(mXPosition);
initialize();
}
private void initialize() {
createMenuItem();
changeMenuItemVisibility();
this.setOnMenuItemClickListener(this);
}
private void createMenuItem() {
this.getMenu().add(Menu.NONE, ASCENDING, 0, mContext.getString(R.string.sort_ascending));
this.getMenu().add(Menu.NONE, DESCENDING, 1, mContext.getString(R.string.sort_descending));
this.getMenu().add(Menu.NONE, ROW_HIDE, 2, mContext.getString(R.string.row_hide));
this.getMenu().add(Menu.NONE, ROW_SHOW, 3, mContext.getString(R.string.row_show));
// add new one ...
}
private void changeMenuItemVisibility() {
// Determine which one shouldn't be visible
SortState sortState = m_iTableView.getSortingStatus(mXPosition);
if (sortState == SortState.UNSORTED) {
// Show others
} else if (sortState == SortState.DESCENDING) {
// Hide DESCENDING menu item
getMenu().getItem(1).setVisible(false);
} else if (sortState == SortState.ASCENDING) {
// Hide ASCENDING menu item
getMenu().getItem(0).setVisible(false);
}
// Control whether 5. row is visible or not.
if (m_iTableView.isRowVisible(TEST_ROW_INDEX)) {
// Show row menu item will be invisible
getMenu().getItem(3).setVisible(false);
} else {
// Hide row menu item will be invisible
getMenu().getItem(2).setVisible(false);
}
}
@Override
public boolean onMenuItemClick(MenuItem menuItem) {
// Note: item id is index of menu item..
switch (menuItem.getItemId()) {
case ASCENDING:
m_iTableView.sortColumn(mXPosition, SortState.ASCENDING);
break;
case DESCENDING:
m_iTableView.sortColumn(mXPosition, SortState.DESCENDING);
break;
case ROW_HIDE:
// Hide 5. row for testing process
// index starts from 0. That's why TEST_ROW_INDEX is 4.
m_iTableView.hideRow(TEST_ROW_INDEX);
break;
case ROW_SHOW:
// Show 5. row for testing process
// index starts from 0. That's why TEST_ROW_INDEX is 4.
m_iTableView.showRow(TEST_ROW_INDEX);
break;
}
// Recalculate of the width values of the columns
m_iTableView.remeasureColumnWidth(mXPosition);
return true;
}
}

View File

@@ -0,0 +1,38 @@
package com.josh.trackcovid19v2.ui.viewmodel;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModel;
import com.josh.trackcovid19v2.data.CountriesRepository;
import com.josh.trackcovid19v2.data.database.entity.Countries;
import com.josh.trackcovid19v2.data.database.entity.YesCountries;
import com.josh.trackcovid19v2.model.ServiceRequest;
import java.util.List;
public class YourcountriesViewModel extends ViewModel {
private final CountriesRepository mRepository;
private final LiveData<List<Countries>> mCountriesData;
private final LiveData<List<YesCountries>> mYesCountriesData;
public YourcountriesViewModel(CountriesRepository mRepository) {
this.mRepository = mRepository;
this.mCountriesData = mRepository.getCountriesList();
this.mYesCountriesData = mRepository.getYesCountriesList();
}
public LiveData<List<Countries>> getCountriesList() {
return mCountriesData;
}
public LiveData<List<YesCountries>> getYesCountriesList() {
return mYesCountriesData;
}
public void postRequest(ServiceRequest serviceRequest) {
mRepository.postServiceRequest(serviceRequest);
mRepository.postServiceRequest1(serviceRequest);
}
}

View File

@@ -0,0 +1,38 @@
package com.josh.trackcovid19v2.ui.viewmodel;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModel;
import com.josh.trackcovid19v2.data.CountriesRepository;
import com.josh.trackcovid19v2.data.database.entity.Countries;
import com.josh.trackcovid19v2.data.database.entity.YesCountries;
import com.josh.trackcovid19v2.model.ServiceRequest;
import java.util.List;
public class YourrealcountryViewModel extends ViewModel {
private final CountriesRepository mRepository;
private final LiveData<List<Countries>> mCountriesData;
private final LiveData<List<YesCountries>> mYesCountriesData;
public YourrealcountryViewModel(CountriesRepository mRepository) {
this.mRepository = mRepository;
this.mCountriesData = mRepository.getCountriesList();
this.mYesCountriesData = mRepository.getYesCountriesList();
}
public LiveData<List<Countries>> getCountriesList() {
return mCountriesData;
}
public LiveData<List<YesCountries>> getYesCountriesList() {
return mYesCountriesData;
}
public void postRequest(ServiceRequest serviceRequest) {
mRepository.postServiceRequest(serviceRequest);
mRepository.postServiceRequest1(serviceRequest);
}
}

View File

@@ -0,0 +1,41 @@
package com.josh.trackcovid19v2.ui.viewmodel;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModel;
import com.josh.trackcovid19v2.data.CountriesRepository;
import com.josh.trackcovid19v2.data.StateRepository;
import com.josh.trackcovid19v2.data.database.entity.Countries;
import com.josh.trackcovid19v2.data.database.entity.States;
import com.josh.trackcovid19v2.data.database.entity.YesCountries;
import com.josh.trackcovid19v2.data.database.entity.YesStates;
import com.josh.trackcovid19v2.model.ServiceRequest;
import java.util.List;
public class YourstateViewModel extends ViewModel {
private final StateRepository mRepository;
private final LiveData<List<States>> mStatesData;
private final LiveData<List<YesStates>> mYesStatesData;
public YourstateViewModel(StateRepository mRepository) {
this.mRepository = mRepository;
this.mStatesData = mRepository.getStatesList();
this.mYesStatesData = mRepository.getYesStatesList();
}
public LiveData<List<States>> getStatesList() {
return mStatesData;
}
public LiveData<List<YesStates>> getYesStatesList() {
return mYesStatesData;
}
public void postRequest(ServiceRequest serviceRequest) {
mRepository.postServiceRequest(serviceRequest);
mRepository.postServiceRequest1(serviceRequest);
}
}

View File

@@ -0,0 +1,36 @@
package com.josh.trackcovid19v2.ui.viewmodel;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModel;
import com.josh.trackcovid19v2.data.WorldRepository;
import com.josh.trackcovid19v2.data.database.entity.World;
import com.josh.trackcovid19v2.data.database.entity.YesWorld;
import com.josh.trackcovid19v2.model.ServiceRequest;
public class YourworldViewModel extends ViewModel {
private final WorldRepository mRepository;
private final LiveData<World> mWorldData;
private final LiveData<YesWorld> mYesWorldData;
public YourworldViewModel(WorldRepository mRepository) {
this.mRepository = mRepository;
this.mWorldData = mRepository.getWorld();
this.mYesWorldData = mRepository.getYesWorld();
}
public LiveData<World> getWorld() {
return mWorldData;
}
public void postRequest(ServiceRequest serviceRequest) {
mRepository.postServiceRequest(serviceRequest);
mRepository.postServiceRequest1(serviceRequest);
}
public LiveData<YesWorld> getYesWorld() {
return mYesWorldData;
}
}

View File

@@ -0,0 +1,26 @@
package com.josh.trackcovid19v2.ui.viewmodel;
import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;
import com.josh.trackcovid19v2.data.CountriesRepository;
/**
* Factory method that allows us to create a ViewModel with a constructor that takes a
* {@link CountriesRepository}
*/
public class yourCountriesViewModelFactory extends ViewModelProvider.NewInstanceFactory {
private final CountriesRepository countriesRepository;
public yourCountriesViewModelFactory(CountriesRepository countriesRepository) {
this.countriesRepository = countriesRepository;
}
@NonNull
@Override
public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
//noinspection unchecked
return (T) new YourcountriesViewModel(countriesRepository);
}
}

View File

@@ -0,0 +1,26 @@
package com.josh.trackcovid19v2.ui.viewmodel;
import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;
import com.josh.trackcovid19v2.data.StateRepository;
/**
* Factory method that allows us to create a ViewModel with a constructor that takes a
* {@link StateRepository}
*/
public class yourStateViewModelFactory extends ViewModelProvider.NewInstanceFactory {
private final StateRepository stateRepository;
public yourStateViewModelFactory(StateRepository stateRepository) {
this.stateRepository = stateRepository;
}
@NonNull
@Override
public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
//noinspection unchecked
return (T) new YourstateViewModel(stateRepository);
}
}

View File

@@ -0,0 +1,27 @@
package com.josh.trackcovid19v2.ui.viewmodel;
import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;
import com.josh.trackcovid19v2.data.WorldRepository;
import com.josh.trackcovid19v2.data.StateRepository;
/**
* Factory method that allows us to create a ViewModel with a constructor that takes a
* {@link StateRepository}
*/
public class yourWorldViewModelFactory extends ViewModelProvider.NewInstanceFactory {
private final WorldRepository worldRepository;
public yourWorldViewModelFactory(WorldRepository worldRepository) {
this.worldRepository = worldRepository;
}
@NonNull
@Override
public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
//noinspection unchecked
return (T) new YourworldViewModel(worldRepository);
}
}

View File

@@ -0,0 +1,26 @@
package com.josh.trackcovid19v2.ui.viewmodel;
import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;
import com.josh.trackcovid19v2.data.CountriesRepository;
/**
* Factory method that allows us to create a ViewModel with a constructor that takes a
* {@link CountriesRepository}
*/
public class yourrealcountryViewModelFactory extends ViewModelProvider.NewInstanceFactory {
private final CountriesRepository countriesRepository;
public yourrealcountryViewModelFactory(CountriesRepository countriesRepository) {
this.countriesRepository = countriesRepository;
}
@NonNull
@Override
public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
//noinspection unchecked
return (T) new YourrealcountryViewModel(countriesRepository);
}
}

View File

@@ -0,0 +1,132 @@
package com.josh.trackcovid19v2.ui.yourcountries;
import android.os.Build;
import android.os.Bundle;
import android.text.Html;
import android.text.SpannableString;
import android.text.Spanned;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProviders;
import com.evrencoskun.tableview.TableView;
import com.josh.trackcovid19v2.R;
import com.josh.trackcovid19v2.model.ServiceRequest;
import com.josh.trackcovid19v2.ui.tableview.CountriesTableAdapter;
import com.josh.trackcovid19v2.ui.tableview.MyTableViewListener;
import com.josh.trackcovid19v2.ui.viewmodel.YourcountriesViewModel;
import com.josh.trackcovid19v2.ui.viewmodel.yourCountriesViewModelFactory;
import com.josh.trackcovid19v2.utility.InjectorUtils;
public class YourcountriesFragment extends Fragment {
private YourcountriesViewModel yourcountryViewModel;
private TableView mTableView;
private CountriesTableAdapter mTableAdapter;
private ProgressBar mProgressBar;
private YourcountriesViewModel vYourcountriesViewModel;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
/*
homeViewModel =
ViewModelProviders.of(this).get(HomeViewModel.class);
View root = inflater.inflate(R.layout.fragment_yourworld, container, false);
final TextView textView = root.findViewById(R.id.text_home);
homeViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
textView.setText(s);
}
});
return root;
*/
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_yourcountry, container, false);
mProgressBar = view.findViewById(R.id.countries_progressBar);
mTableView = view.findViewById(R.id.countries_TableView);
initializeTableView(mTableView);
// initialize ViewModel
yourCountriesViewModelFactory factory = InjectorUtils.getCountriesViewModelFactory(getActivity().getApplicationContext());
vYourcountriesViewModel = ViewModelProviders.of(this, factory).get(YourcountriesViewModel.class);
vYourcountriesViewModel.getCountriesList().observe(this, countries -> {
if(countries != null && countries.size()>0){
// set the list on TableViewModel
mTableAdapter.setCountriesList(countries);
hideProgressBar();
}
});
// Let's post a request to get the User data from a web server.
postRequest();
return view;
}
private void initializeTableView(TableView tableView){
// Create TableView Adapter
mTableAdapter = new CountriesTableAdapter(getContext());
tableView.setAdapter(mTableAdapter);
// Create listener
tableView.setTableViewListener(new MyTableViewListener(tableView));
}
private void postRequest(){
int size = 100; // this is the count of the data items.
int page = 1; // Which page do we want to get from the server.
ServiceRequest serviceRequest = new ServiceRequest();
vYourcountriesViewModel.postRequest(serviceRequest);
showProgressBar();
}
public void showProgressBar() {
mProgressBar.setVisibility(View.VISIBLE);
mTableView.setVisibility(View.INVISIBLE);
}
public void hideProgressBar() {
mProgressBar.setVisibility(View.INVISIBLE);
mTableView.setVisibility(View.VISIBLE);
}
@SuppressWarnings("deprecation")
public static Spanned fromHtml(String html){
if(html == null){
// return an empty spannable if the html is null
return new SpannableString("");
}else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
// FROM_HTML_MODE_LEGACY is the behaviour that was used for versions below android N
// we are using this flag to give a consistent behaviour
return Html.fromHtml(html, Html.FROM_HTML_MODE_LEGACY);
} else {
return Html.fromHtml(html);
}
}
}

View File

@@ -0,0 +1,29 @@
package com.josh.trackcovid19v2.ui.yourcountries;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModel;
import com.josh.trackcovid19v2.data.CountriesRepository;
import com.josh.trackcovid19v2.data.database.entity.Countries;
import com.josh.trackcovid19v2.model.ServiceRequest;
import java.util.List;
public class YourcountriesViewModel extends ViewModel {
private final CountriesRepository mRepository;
private final LiveData<List<Countries>> mCountriesData;
public YourcountriesViewModel(CountriesRepository mRepository) {
this.mRepository = mRepository;
this.mCountriesData = mRepository.getCountriesList();
}
public LiveData<List<Countries>> getCountriesList() {
return mCountriesData;
}
public void postRequest(ServiceRequest serviceRequest) {
mRepository.postServiceRequest(serviceRequest);
}
}

View File

@@ -0,0 +1,262 @@
package com.josh.trackcovid19v2.ui.yourrealcountry;
import android.annotation.SuppressLint;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.Html;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.Spinner;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProviders;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.josh.trackcovid19v2.R;
import com.josh.trackcovid19v2.model.ServiceRequest;
import com.josh.trackcovid19v2.ui.viewmodel.YourcountriesViewModel;
import com.josh.trackcovid19v2.ui.viewmodel.YourrealcountryViewModel;
import com.josh.trackcovid19v2.ui.viewmodel.yourCountriesViewModelFactory;
import com.josh.trackcovid19v2.ui.viewmodel.yourrealcountryViewModelFactory;
import com.josh.trackcovid19v2.utility.InjectorUtils;
import com.squareup.picasso.Picasso;
import java.text.NumberFormat;
import java.util.Date;
import java.util.Locale;
public class YourrealcountryFragment extends Fragment {
private ProgressBar mProgressBar;
private YourrealcountryViewModel vYourrealcountryViewModel;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater,
@Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_yourrealcountry, container, false);
SwipeRefreshLayout mSwipeRefreshLayout = view.findViewById(R.id.swiperefresh);
final int[] rememberLocation = {-1};
final int[] j = {0};
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
Log.v("REFRESHING", "************** APP - SWIPE REFRESH EVENT TRIGGERED!!!!!");
postRequest();
new Handler().postDelayed(new Runnable() {
@Override public void run() {
// Stop animation (This will be after 3 seconds)
mSwipeRefreshLayout.setRefreshing(false);
}
}, 1000); // Delay in millis
}
});
yourrealcountryViewModelFactory factory = InjectorUtils.getRealCountryViewModelFactory(getActivity().getApplicationContext());
vYourrealcountryViewModel = ViewModelProviders.of(this, factory).get(YourrealcountryViewModel.class);
vYourrealcountryViewModel.getCountriesList().observe(this, countries -> {
if (countries != null && countries.size() > 0) {
// set the list on TableViewModel
String[] country_list = new String[countries.size()];
for (int i = 0; i < countries.size(); i++) {
country_list[i] = countries.get(i).country;
if (countries.get(i).country.equalsIgnoreCase("USA")) {
j[0] = i;
}
}
final int[] cases = {0};
final int[] ycases = {0};
final int[] yACases = {0};
final int[] ACases = {0};
final int[] yRecovered = {0};
final int[] recovered = {0};
final int[] yDeaths = {0};
final int[] Toddeaths = {0};
final int[] critical = {0};
final int[] yCritical = {0};
final int[] yTests = {0};
final int[] tests = {0};
vYourrealcountryViewModel.getYesCountriesList().observe(this, yescountries -> {
if (yescountries != null && yescountries.size() > 0) {
String[] yescountry_list = new String[yescountries.size()];
//String[] users = { "Suresh Dasari", "Trishika Dasari", "Rohini Alavala", "Praveen Kumar", "Madhav Sai" };
Spinner spin = view.findViewById(R.id.spinner1);
final TextView textView = view.findViewById(R.id.text_totalCasesData);
final TextView textView1 = view.findViewById(R.id.text_activeCasesData);
final TextView textView2 = view.findViewById(R.id.text_RecoveredData);
final TextView textView3 = view.findViewById(R.id.text_deathsData);
final TextView textView4 = view.findViewById(R.id.text_CriticalData);
final TextView textView5 = view.findViewById(R.id.text_CriticalDataIncriment);
final TextView textView6 = view.findViewById(R.id.text_deathsDataIncriment);
final TextView textView7 = view.findViewById(R.id.text_RealRecoveredDataIncriment);
final TextView textView8 = view.findViewById(R.id.text_dailyIncriment);
final TextView textView9 = view.findViewById(R.id.text_activeCasesIncriment);
final TextView textView10 = view.findViewById(R.id.textView2);
final TextView textView11 = view.findViewById(R.id.text_totalTestsData);
final TextView textView12 = view.findViewById(R.id.text_testsPerOneMillionData);
final TextView textView13 = view.findViewById(R.id.text_updated);
final ImageView imageView = view.findViewById(R.id.htmlImageGetter);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), R.layout.my_spinner_style, country_list);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spin.setAdapter(adapter);
spin.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
Picasso.get().load(countries.get(position).flag).into(imageView);
Log.d("foo", country_list[position]);
cases[0] = countries.get(position).cases;
ycases[0] = yescountries.get(position).cases;
ACases[0] = countries.get(position).active;
yACases[0] = yescountries.get(position).active;
recovered[0] = countries.get(position).recovered;
yRecovered[0] = yescountries.get(position).recovered;
Toddeaths[0] = countries.get(position).deaths;
yDeaths[0] = yescountries.get(position).deaths;
recovered[0] = countries.get(position).recovered;
yRecovered[0] = yescountries.get(position).recovered;
tests[0] = countries.get(position).tests;
yTests[0] = yescountries.get(position).tests;
critical[0] = countries.get(position).critical;
yCritical[0] = yescountries.get(position).critical;
NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.US);
textView10.setText(Html.fromHtml("<b>Pick a country from the dropdown below</b>"));
String totalCasesWithCommas = numberFormat.format(countries.get(position).cases);
String activeCasesWithCommas = numberFormat.format(countries.get(position).active);
String recoveredWithCommas = numberFormat.format(countries.get(position).recovered);
String deathWithCommas = numberFormat.format(countries.get(position).deaths);
String criticalWithCommas = numberFormat.format(countries.get(position).critical);
String ToddeathsWithCommas = numberFormat.format(countries.get(position).todayDeaths);
String TodCasesWithCommas = numberFormat.format(countries.get(position).todayCases);
String testsWithCommas = numberFormat.format(countries.get(position).tests);
String testsMilWithcommas = numberFormat.format(countries.get(position).testsPerMillion);
Date date = new Date(countries.get(position).updated);
textView13.setText(Html.fromHtml("Updated on "+ date));
textView.setText(Html.fromHtml("<center><b>" + totalCasesWithCommas + "</b></center>"));
textView3.setText(Html.fromHtml("<b>" + deathWithCommas + "</b>"));
textView2.setText(Html.fromHtml("<b>" + recoveredWithCommas + "</b>"));
textView1.setText(Html.fromHtml("<b>" + activeCasesWithCommas + "</b>"));
textView4.setText(Html.fromHtml("<b>" + criticalWithCommas + "</b>"));
textView6.setText(Html.fromHtml("<b>" + ToddeathsWithCommas + "</b>"));
textView8.setText(Html.fromHtml("<b>" + TodCasesWithCommas + "</b>"));
textView11.setText(Html.fromHtml("<b>" + testsWithCommas + "</b>"));
textView12.setText(Html.fromHtml("<b>" + testsMilWithcommas + "</b>"));
String dailyActWithCommas = numberFormat.format(ACases[0] - yACases[0]);
String dailyRecoveredWithCommas = numberFormat.format(recovered[0] - yRecovered[0]);
String dailyTestWithCommas = numberFormat.format(tests[0] - yTests[0]);
String todCritWithCommas = numberFormat.format(critical[0] - yCritical[0]);
if ((cases[0] - ycases[0]) >= 0) {
Spanned text = Html.fromHtml("<i>Daily Increment: " + "<b>" + "+" + TodCasesWithCommas + "</i></b>");
SpannableString ss = new SpannableString(text);
ForegroundColorSpan fcsWhite = new ForegroundColorSpan(Color.WHITE);
@SuppressLint("ResourceAsColor") ForegroundColorSpan fcsGreen = new ForegroundColorSpan(R.color.just_cuz);
ss.setSpan(fcsWhite, 0, 16, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
textView8.setText(ss);
} else {
Spanned text = Html.fromHtml("<i>Daily Increment: " + "<b>" + "-" + TodCasesWithCommas + "</i></b>");
SpannableString ss = new SpannableString(text);
ForegroundColorSpan fcsWhite = new ForegroundColorSpan(Color.WHITE);
@SuppressLint("ResourceAsColor") ForegroundColorSpan fcsGreen = new ForegroundColorSpan(R.color.just_cuz);
ss.setSpan(fcsWhite, 0, 16, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
textView8.setText(ss);
}
if ((ACases[0] - yACases[0]) >= 0) {
textView9.setText(Html.fromHtml("<b><i>" + "+" + dailyActWithCommas + "</i></b>"));
} else {
textView9.setText(Html.fromHtml("<b><i>" + dailyActWithCommas + "</i></b>"));
}
if ((recovered[0] - yRecovered[0]) >= 0) {
textView7.setText(Html.fromHtml("<b><i>" + "+" + dailyRecoveredWithCommas + "</i></b>"));
} else {
textView7.setText(Html.fromHtml("<b><i>" + dailyRecoveredWithCommas + "</i></b>"));
}
if ((Toddeaths[0] - yDeaths[0]) >= 0) {
textView6.setText(Html.fromHtml("<b><i>" + "+" + ToddeathsWithCommas + "</i></b>"));
} else {
textView6.setText(Html.fromHtml("<b><i>" + ToddeathsWithCommas + "</i></b>"));
}
if ((critical[0] - yCritical[0]) >= 0) {
textView5.setText(Html.fromHtml("<b><i>" + "+" + todCritWithCommas + "</i></b>"));
} else {
textView5.setText(Html.fromHtml("<b><i>" + todCritWithCommas + "</i></b>"));
}
/*
if((Toddeaths[0] - yDeaths[0]) >= 0){
textView6.setText(Html.fromHtml("<b><i>" + "+" + ToddeathsWithCommas + "</i></b>"));
}
else {
textView6.setText(Html.fromHtml("<b><i>" + "-" + ToddeathsWithCommas + "</i></b>"));
}
*/
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
else{
Log.d("lol", "didn't work something broken inside one." + ", name: "+"not found at all");
}
});
}
else{
Log.d("lol", "didn't work something broken outside one." + ", name: "+"not found at all");
}
});
postRequest();
return view;
//return inflater.inflate(R.layout.fragment_yourrealcountry,container,false);
}
@SuppressWarnings("deprecation")
public static Spanned fromHtml(String html) {
if (html == null) {
// return an empty spannable if the html is null
return new SpannableString("");
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
// FROM_HTML_MODE_LEGACY is the behaviour that was used for versions below android N
// we are using this flag to give a consistent behaviour
return Html.fromHtml(html, Html.FROM_HTML_MODE_LEGACY);
} else {
return Html.fromHtml(html);
}
}
private void postRequest() {
int size = 100; // this is the count of the data items.
int page = 1; // Which page do we want to get from the server.
ServiceRequest serviceRequest = new ServiceRequest();
vYourrealcountryViewModel.postRequest(serviceRequest);
}
}

View File

@@ -0,0 +1,29 @@
package com.josh.trackcovid19v2.ui.yourrealcountry;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModel;
import com.josh.trackcovid19v2.data.CountriesRepository;
import com.josh.trackcovid19v2.data.database.entity.Countries;
import com.josh.trackcovid19v2.model.ServiceRequest;
import java.util.List;
public class YourrealcountryViewModel extends ViewModel {
private final CountriesRepository mRepository;
private final LiveData<List<Countries>> mCountriesData;
public YourrealcountryViewModel(CountriesRepository mRepository) {
this.mRepository = mRepository;
this.mCountriesData = mRepository.getCountriesList();
}
public LiveData<List<Countries>> getCountriesList() {
return mCountriesData;
}
public void postRequest(ServiceRequest serviceRequest) {
mRepository.postServiceRequest(serviceRequest);
}
}

View File

@@ -0,0 +1,228 @@
package com.josh.trackcovid19v2.ui.yourstate;
import android.annotation.SuppressLint;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.Html;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.Spinner;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProviders;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.josh.trackcovid19v2.R;
import com.josh.trackcovid19v2.model.ServiceRequest;
import com.josh.trackcovid19v2.ui.viewmodel.YourstateViewModel;
import com.josh.trackcovid19v2.ui.viewmodel.yourStateViewModelFactory;
import com.josh.trackcovid19v2.utility.InjectorUtils;
import java.text.NumberFormat;
import java.util.Locale;
public class YourstateFragment extends Fragment {
private ProgressBar mProgressBar;
private YourstateViewModel vYourstateViewModel;
@SuppressWarnings("deprecation")
public static Spanned fromHtml(String html) {
if (html == null) {
// return an empty spannable if the html is null
return new SpannableString("");
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
// FROM_HTML_MODE_LEGACY is the behaviour that was used for versions below android N
// we are using this flag to give a consistent behaviour
return Html.fromHtml(html, Html.FROM_HTML_MODE_LEGACY);
} else {
return Html.fromHtml(html);
}
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater,
@Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_yourstate, container, false);
SwipeRefreshLayout mSwipeRefreshLayout = view.findViewById(R.id.swiperefresh);
final int[] rememberLocation = {-1};
final int[] j = {0};
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
Log.v("REFRESHING", "************** APP - SWIPE REFRESH EVENT TRIGGERED!!!!!");
postRequest();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
// Stop animation (This will be after 3 seconds)
mSwipeRefreshLayout.setRefreshing(false);
}
}, 1000); // Delay in millis
}
});
yourStateViewModelFactory factory = InjectorUtils.getStateViewModelFactory(getActivity().getApplicationContext());
vYourstateViewModel = ViewModelProviders.of(this, factory).get(YourstateViewModel.class);
vYourstateViewModel.getStatesList().observe(this, states -> {
if (states != null && states.size() > 0) {
// set the list on TableViewModel
String[] state_list = new String[states.size()];
for (int i = 0; i < states.size(); i++) {
state_list[i] = states.get(i).state;
if (states.get(i).state.equalsIgnoreCase("New York")) {
j[0] = i;
}
}
final int[] cases = {0};
final int[] ycases = {0};
final int[] yACases = {0};
final int[] ACases = {0};
final int[] yDeaths = {0};
final int[] Toddeaths = {0};
final int[] yTests = {0};
final int[] tests = {0};
vYourstateViewModel.getYesStatesList().observe(this, yesstates -> {
if (yesstates != null && yesstates.size() > 0) {
String[] yesstate_list = new String[yesstates.size()];
//String[] users = { "Suresh Dasari", "Trishika Dasari", "Rohini Alavala", "Praveen Kumar", "Madhav Sai" };
Spinner spin = view.findViewById(R.id.spinner1);
final TextView textView = view.findViewById(R.id.text_totalCasesData);
final TextView textView1 = view.findViewById(R.id.text_activeCasesData);
final TextView textView2 = view.findViewById(R.id.text_RecoveredData);
final TextView textView3 = view.findViewById(R.id.text_deathsData);
final TextView textView4 = view.findViewById(R.id.text_CriticalData);
final TextView textView5 = view.findViewById(R.id.text_CriticalDataIncriment);
final TextView textView6 = view.findViewById(R.id.text_deathsDataIncriment);
final TextView textView7 = view.findViewById(R.id.text_RealRecoveredDataIncriment);
final TextView textView8 = view.findViewById(R.id.text_dailyIncriment);
final TextView textView9 = view.findViewById(R.id.text_activeCasesIncriment);
final TextView textView10 = view.findViewById(R.id.textView2);
final TextView textView11 = view.findViewById(R.id.text_totalTestsData);
final TextView textView12 = view.findViewById(R.id.text_testsPerOneMillionData);
final TextView textView13 = view.findViewById(R.id.text_updated);
final ImageView imageView = view.findViewById(R.id.htmlImageGetter);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), R.layout.my_spinner_style, state_list);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spin.setAdapter(adapter);
spin.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
Log.d("foo", state_list[position]);
cases[0] = states.get(position).cases;
ycases[0] = yesstates.get(position).cases;
ACases[0] = states.get(position).active;
yACases[0] = yesstates.get(position).active;
Toddeaths[0] = states.get(position).deaths;
yDeaths[0] = yesstates.get(position).deaths;
tests[0] = states.get(position).tests;
yTests[0] = yesstates.get(position).tests;
NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.US);
//setData(vYourworldViewModel,world);
textView10.setText(Html.fromHtml("<b>Pick a state from the dropdown below</b>"));
String totalCasesWithCommas = numberFormat.format(states.get(position).cases);
String activeCasesWithCommas = numberFormat.format(states.get(position).active);
String deathWithCommas = numberFormat.format(states.get(position).deaths);
String ToddeathsWithCommas = numberFormat.format(states.get(position).todayDeaths);
String TodCasesWithCommas = numberFormat.format(states.get(position).todayCases);
String testsWithCommas = numberFormat.format(states.get(position).tests);
String testsMilWithcommas = numberFormat.format(states.get(position).testsPerMillion);
textView.setText(Html.fromHtml("<center><b>" + totalCasesWithCommas + "</b></center>"));
textView3.setText(Html.fromHtml("<b>" + deathWithCommas + "</b>"));
textView1.setText(Html.fromHtml("<b>" + activeCasesWithCommas + "</b>"));
textView6.setText(Html.fromHtml("<b>" + ToddeathsWithCommas + "</b>"));
textView8.setText(Html.fromHtml("<b>" + TodCasesWithCommas + "</b>"));
textView11.setText(Html.fromHtml("<b>" + testsWithCommas + "</b>"));
textView12.setText(Html.fromHtml("<b>" + testsMilWithcommas + "</b>"));
String dailyActWithCommas = numberFormat.format(ACases[0] - yACases[0]);
String dailyTestWithCommas = numberFormat.format(tests[0] - yTests[0]);
if ((cases[0] - ycases[0]) >= 0) {
Spanned text = Html.fromHtml("<i>Daily Increment: " + "<b>" + "+" + TodCasesWithCommas + "</i></b>");
SpannableString ss = new SpannableString(text);
ForegroundColorSpan fcsWhite = new ForegroundColorSpan(Color.WHITE);
@SuppressLint("ResourceAsColor") ForegroundColorSpan fcsGreen = new ForegroundColorSpan(R.color.just_cuz);
ss.setSpan(fcsWhite, 0, 16, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
textView8.setText(ss);
} else {
Spanned text = Html.fromHtml("<i>Daily Increment: " + "<b>" + "-" + TodCasesWithCommas + "</i></b>");
SpannableString ss = new SpannableString(text);
ForegroundColorSpan fcsWhite = new ForegroundColorSpan(Color.WHITE);
@SuppressLint("ResourceAsColor") ForegroundColorSpan fcsGreen = new ForegroundColorSpan(R.color.just_cuz);
ss.setSpan(fcsWhite, 0, 16, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
textView8.setText(ss);
}
if ((ACases[0] - yACases[0]) >= 0) {
textView9.setText(Html.fromHtml("<b><i>" + "+" + dailyActWithCommas + "</i></b>"));
} else {
textView9.setText(Html.fromHtml("<b><i>" + dailyActWithCommas + "</i></b>"));
}
if ((Toddeaths[0] - yDeaths[0]) >= 0) {
textView6.setText(Html.fromHtml("<b><i>" + "+" + ToddeathsWithCommas + "</i></b>"));
} else {
textView6.setText(Html.fromHtml("<b><i>" + ToddeathsWithCommas + "</i></b>"));
}
/*
if((Toddeaths[0] - yDeaths[0]) >= 0){
textView6.setText(Html.fromHtml("<b><i>" + "+" + ToddeathsWithCommas + "</i></b>"));
}
else {
textView6.setText(Html.fromHtml("<b><i>" + "-" + ToddeathsWithCommas + "</i></b>"));
}
*/
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
else{
Log.d("lol", "didn't work something broken inside one." + ", name: "+"not found at all");
}
});
}
else{
Log.d("lol", "didn't work something broken outside one." + ", name: "+"not found at all");
}
});
postRequest();
return view;
}
private void postRequest() {
int size = 100; // this is the count of the data items.
int page = 1; // Which page do we want to get from the server.
ServiceRequest serviceRequest = new ServiceRequest();
vYourstateViewModel.postRequest(serviceRequest);
}
}

View File

@@ -0,0 +1,29 @@
package com.josh.trackcovid19v2.ui.yourstate;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModel;
import com.josh.trackcovid19v2.data.StateRepository;
import com.josh.trackcovid19v2.data.database.entity.States;
import com.josh.trackcovid19v2.model.ServiceRequest;
import java.util.List;
public class YourstateViewModel extends ViewModel {
private final StateRepository mRepository;
private final LiveData<List<States>> mStatesData;
public YourstateViewModel(StateRepository mRepository) {
this.mRepository = mRepository;
this.mStatesData = mRepository.getStatesList();
}
public LiveData<List<States>> getStatesList() {
return mStatesData;
}
public void postRequest(ServiceRequest serviceRequest) {
mRepository.postServiceRequest(serviceRequest);
}
}

View File

@@ -0,0 +1,245 @@
package com.josh.trackcovid19v2.ui.yourworld;
import android.annotation.SuppressLint;
import android.graphics.Color;
import android.graphics.drawable.ClipDrawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.Html;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProviders;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.josh.trackcovid19v2.R;
import com.josh.trackcovid19v2.model.ServiceRequest;
import com.josh.trackcovid19v2.ui.viewmodel.yourWorldViewModelFactory;
import com.josh.trackcovid19v2.utility.InjectorUtils;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Date;
import java.util.Locale;
public class YourworldFragment extends Fragment {
private static YourworldFragment BdTimeUtils;
private YourworldViewModel yourworldViewModel;
private com.josh.trackcovid19v2.ui.viewmodel.YourworldViewModel vYourworldViewModel;
private static DecimalFormat df = new DecimalFormat("0.00");
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_yourworld, container, false);
SwipeRefreshLayout mSwipeRefreshLayout = view.findViewById(R.id.swiperefresh);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
Log.v("REFRESHING", "************** APP - SWIPE REFRESH EVENT TRIGGERED!!!!!");
postRequest();
new Handler().postDelayed(new Runnable() {
@Override public void run() {
// Stop animation (This will be after 3 seconds)
mSwipeRefreshLayout.setRefreshing(false);
}
}, 1000); // Delay in millis
}
});
yourWorldViewModelFactory factory = InjectorUtils.getWorldViewModelFactory(getActivity().getApplicationContext());
vYourworldViewModel = ViewModelProviders.of(this, factory).get(com.josh.trackcovid19v2.ui.viewmodel.YourworldViewModel.class);
final int[] cases = {0};
final int[] ycases = {0};
final int[] yACases = {0};
final int[] ACases = {0};
final int[] yRecovered = {0};
final int[] recovered = {0};
final int[] yDeaths = {0};
final int[] Toddeaths = {0};
vYourworldViewModel.getWorld().observe(this, world -> {
if (world != null) {
Log.d("foooo", String.valueOf(world.cases));
cases[0] = world.cases;
ACases[0] = world.active;
recovered[0] = world.recovered;
Toddeaths[0] = world.deaths;
Log.d("foooo", "I am here");
NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.US);
//setData(vYourworldViewModel,world);
TextView textView = view.findViewById(R.id.text_totalCasesData);
TextView textViewa = view.findViewById(R.id.text_totalCasesName);
TextView textView2 = view.findViewById(R.id.text_deathsData);
TextView textView3 = view.findViewById(R.id.text_recoveredData);
//unneeded for now
TextView textView4 = view.findViewById(R.id.text_updated);
TextView textView5 = view.findViewById(R.id.text_activeCasesData);
TextView textView6 = view.findViewById(R.id.text_affectedCountriesData);
TextView textView7 = view.findViewById(R.id.textView2);
TextView textView123 = view.findViewById(R.id.textView4);
//commas to large numbers
String totalCasesWithCommas = numberFormat.format(world.cases);
String activeCasesWithCommas = numberFormat.format(world.active);
String recoveredWithCommas = numberFormat.format(world.recovered);
String deathWithCommas = numberFormat.format(world.deaths);
//yesworld data goes above
String affectedCountriesData = Integer.toString(world.affectedCountries);
Date date = new Date(world.updated);
textView.setText(Html.fromHtml("<center><b>" + totalCasesWithCommas + "</b></center>"));
textViewa.setText(Html.fromHtml("Total Confirmed Cases"));
textView7.setText(Html.fromHtml("<b>COVID-19 Statistics</b>"));
textView2.setText(Html.fromHtml("<b>" + deathWithCommas + "</b>"));
textView3.setText(Html.fromHtml("<b>" + recoveredWithCommas + "</b>"));
textView5.setText(Html.fromHtml("<b>" + activeCasesWithCommas + "</b>"));
textView6.setText(Html.fromHtml("<b><sup>" + affectedCountriesData + "</sup>" + "/<sub>251</sub></b>"));
textView4.setText(Html.fromHtml("Updated on "+ date));
ImageView img1 = view.findViewById(R.id.image_level);
double recov = world.recovered;
double tcases = world.cases;
double percent = (recov/tcases)*100;
String percentlegible = df.format(percent);
textView123.setText(Html.fromHtml("<b><i>" + percentlegible + "%</i></b>"));
Log.d("dfdF", String.valueOf(world.recovered));
Log.d("dfdF", String.valueOf(world.cases));
Log.d("dfdF", String.valueOf(percent));
int x= (int)percent;
ClipDrawable drawable = (ClipDrawable) img1.getDrawable();
drawable.setLevel(100 * x);
}
vYourworldViewModel.getYesWorld().observe(this, yesworld -> {
if (yesworld != null) {
Log.d("foooo", String.valueOf(yesworld.cases));
ycases[0] = yesworld.cases;
yACases[0] = yesworld.active;
yRecovered[0] = yesworld.recovered;
yDeaths[0] = yesworld.deaths;
Log.d("foooo", "I am in yesworld here");
NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.US);
TextView textView8 = view.findViewById(R.id.text_dailyIncriment);
TextView textView9 = view.findViewById(R.id.text_activeCasesIncriment);
TextView textView10 = view.findViewById(R.id.text_recoveredDataIncriment);
TextView textView11 = view.findViewById(R.id.text_deathsDataIncriment);
String dailyIncWithCommas = numberFormat.format(cases[0] - ycases[0]);
String dailyActWithCommas = numberFormat.format(ACases[0] - yACases[0]);
String dailyDeathWithCommas = numberFormat.format(Toddeaths[0] - yDeaths[0]);
String dailyRecoveredWithCommas = numberFormat.format(recovered[0] - yRecovered[0]);
Log.d("foo", "I got here");
if ((cases[0] - ycases[0]) >= 0){
Spanned text = Html.fromHtml("<i>Daily Increment: " + "<b>" + "+" + dailyIncWithCommas + "</i></b>");
SpannableString ss = new SpannableString(text);
ForegroundColorSpan fcsWhite = new ForegroundColorSpan(Color.WHITE);
@SuppressLint("ResourceAsColor") ForegroundColorSpan fcsGreen = new ForegroundColorSpan(R.color.just_cuz);
ss.setSpan(fcsWhite, 0, 16, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
textView8.setText(ss);
}
else {
Spanned text = Html.fromHtml("<i>Daily Increment: " + "<b>" + "-" + dailyIncWithCommas + "</i></b>"); SpannableString ss = new SpannableString(text);
ForegroundColorSpan fcsWhite = new ForegroundColorSpan(Color.WHITE);
@SuppressLint("ResourceAsColor") ForegroundColorSpan fcsGreen = new ForegroundColorSpan(R.color.just_cuz);
ss.setSpan(fcsWhite, 0, 16, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
textView8.setText(ss);
}
if((ACases[0] - yACases[0]) >= 0){
textView9.setText(Html.fromHtml("<b><i>" + "+" + dailyActWithCommas + "</i></b>"));
}
else {
textView9.setText(Html.fromHtml("<b><i>" + "-" + dailyActWithCommas + "</i></b>"));
}
if((recovered[0] - yRecovered[0]) >= 0){
textView10.setText(Html.fromHtml("<b><i>" + "+" + dailyRecoveredWithCommas + "</i></b>"));
}
else {
textView10.setText(Html.fromHtml("<b><i>" + "-" + dailyRecoveredWithCommas + "</i></b>"));
}
if((Toddeaths[0] - yDeaths[0]) >= 0){
textView11.setText(Html.fromHtml("<b><i>" + "+" + dailyDeathWithCommas + "</i></b>"));
}
else {
textView11.setText(Html.fromHtml("<b><i>" + "-" + dailyDeathWithCommas + "</i></b>"));
}
//setData(vYourworldViewModel,world);
//final TextView textView5 = view.findViewById(R.id.text_activeCases);
//String totalCases = Integer.toString(yesworld.cases);
//textView5.setText(Html.fromHtml("<p><u>Yerterday cases</u></p>"+totalCases));
}
});
});
postRequest();
return view;
}
private void postRequest() {
int size = 100; // this is the count of the data items.
int page = 1; // Which page do we want to get from the server.
ServiceRequest serviceRequest = new ServiceRequest();
vYourworldViewModel.postRequest(serviceRequest);
}
@SuppressWarnings("deprecation")
public static Spanned fromHtml(String html){
if(html == null){
// return an empty spannable if the html is null
return new SpannableString("");
}else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
// FROM_HTML_MODE_LEGACY is the behaviour that was used for versions below android N
// we are using this flag to give a consistent behaviour
return Html.fromHtml(html, Html.FROM_HTML_MODE_LEGACY);
} else {
return Html.fromHtml(html);
}
}
}

View File

@@ -0,0 +1,24 @@
package com.josh.trackcovid19v2.ui.yourworld;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class YourworldViewModel extends ViewModel {
private MutableLiveData<String> mText;
public YourworldViewModel() {
mText = new MutableLiveData<>();
mText.setValue("World Fragment");
}
public LiveData<String> getText() {
return mText;
}
public void setText(String str) {
mText.setValue(str);
}
}

View File

@@ -0,0 +1,81 @@
package com.josh.trackcovid19v2.utility;
import android.content.Context;
import com.josh.trackcovid19v2.AppExecutors;
import com.josh.trackcovid19v2.data.CountriesRepository;
import com.josh.trackcovid19v2.data.StateRepository;
import com.josh.trackcovid19v2.data.WorldRepository;
import com.josh.trackcovid19v2.data.database.CountriesDao;
import com.josh.trackcovid19v2.data.database.CountriesDatabase;
import com.josh.trackcovid19v2.data.database.StateDao;
import com.josh.trackcovid19v2.data.database.StatesDatabase;
import com.josh.trackcovid19v2.data.database.WorldDao;
import com.josh.trackcovid19v2.data.database.WorldDatabase;
import com.josh.trackcovid19v2.data.database.YesCountriesDao;
import com.josh.trackcovid19v2.data.database.YesCountriesDatabase;
import com.josh.trackcovid19v2.data.database.YesStateDao;
import com.josh.trackcovid19v2.data.database.YesStatesDatabase;
import com.josh.trackcovid19v2.data.database.YesWorldDao;
import com.josh.trackcovid19v2.data.database.YesWorldDatabase;
import com.josh.trackcovid19v2.data.network.UserNetworkDataSource;
import com.josh.trackcovid19v2.ui.viewmodel.yourCountriesViewModelFactory;
import com.josh.trackcovid19v2.ui.viewmodel.yourStateViewModelFactory;
import com.josh.trackcovid19v2.ui.viewmodel.yourWorldViewModelFactory;
import com.josh.trackcovid19v2.ui.viewmodel.yourrealcountryViewModelFactory;
public class InjectorUtils {
public static StateRepository getStateRepository(Context context) {
// Get all we need
StateDao stateDao = StatesDatabase.getInstance(context).stateDao();
YesStateDao yesStateDao = YesStatesDatabase.getInstance(context).yesstateDao();
AppExecutors executors = AppExecutors.getInstance();
UserNetworkDataSource networkDataSource = UserNetworkDataSource.getInstance(executors);
return StateRepository.getInstance(stateDao, yesStateDao, networkDataSource, executors);
}
public static CountriesRepository getCountriesRepository(Context context) {
// Get all we need
CountriesDao countriesDao = CountriesDatabase.getInstance(context).countriesDao();
YesCountriesDao yescountriesDao = YesCountriesDatabase.getInstance(context).yescountriesDao();
AppExecutors executors = AppExecutors.getInstance();
UserNetworkDataSource networkDataSource = UserNetworkDataSource.getInstance(executors);
return CountriesRepository.getInstance(countriesDao,
yescountriesDao,
networkDataSource, executors);
}
public static WorldRepository getWorldRepository(Context context) {
// Get all we need
WorldDao worldDao = WorldDatabase.getInstance(context).worldDao();
YesWorldDao yesworldDao = YesWorldDatabase.getInstance(context).yesworldDao();
AppExecutors executors = AppExecutors.getInstance();
UserNetworkDataSource networkDataSource = UserNetworkDataSource.getInstance(executors);
return WorldRepository.getInstance(worldDao, yesworldDao, networkDataSource, executors);
}
public static yourWorldViewModelFactory getWorldViewModelFactory(Context context){
WorldRepository repository = getWorldRepository(context);
return new yourWorldViewModelFactory(repository);
}
public static yourStateViewModelFactory getStateViewModelFactory(Context context){
StateRepository repository = getStateRepository(context);
return new yourStateViewModelFactory(repository);
}
public static yourCountriesViewModelFactory getCountriesViewModelFactory(Context context){
CountriesRepository repository = getCountriesRepository(context);
return new yourCountriesViewModelFactory(repository);
}
public static yourrealcountryViewModelFactory getRealCountryViewModelFactory(Context context){
CountriesRepository repository = getCountriesRepository(context);
return new yourrealcountryViewModelFactory(repository);
}
}

BIN
app/src/main/res/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF"
android:alpha="0.8">
<path
android:fillColor="#FF000000"
android:pathData="M10.18,9"/>
<path
android:fillColor="#FF000000"
android:pathData="M21,16v-2l-8,-5V3.5c0,-0.83 -0.67,-1.5 -1.5,-1.5S10,2.67 10,3.5V9l-8,5v2l8,-2.5V19l-2,1.5V22l3.5,-1 3.5,1v-1.5L13,19v-5.5l8,2.5z"/>
</vector>

View File

@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#4CAF50"
android:alpha="0.8">
<path
android:fillColor="#FF000000"
android:pathData="M17,5L3,5c-1.1,0 -2,0.89 -2,2v9h2c0,1.65 1.34,3 3,3s3,-1.35 3,-3h5.5c0,1.65 1.34,3 3,3s3,-1.35 3,-3L23,16v-5l-6,-6zM3,11L3,7h4v4L3,11zM6,17.5c-0.83,0 -1.5,-0.67 -1.5,-1.5s0.67,-1.5 1.5,-1.5 1.5,0.67 1.5,1.5 -0.67,1.5 -1.5,1.5zM13,11L9,11L9,7h4v4zM17.5,17.5c-0.83,0 -1.5,-0.67 -1.5,-1.5s0.67,-1.5 1.5,-1.5 1.5,0.67 1.5,1.5 -0.67,1.5 -1.5,1.5zM15,11L15,7h1l4,4h-5z"/>
</vector>

View File

@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF"
android:alpha="0.8">
<path
android:fillColor="#FF000000"
android:pathData="M19.1,12.9a2.8,2.8 0,0 0,0.1 -0.9,2.8 2.8,0 0,0 -0.1,-0.9l2.1,-1.6a0.7,0.7 0,0 0,0.1 -0.6L19.4,5.5a0.7,0.7 0,0 0,-0.6 -0.2l-2.4,1a6.5,6.5 0,0 0,-1.6 -0.9l-0.4,-2.6a0.5,0.5 0,0 0,-0.5 -0.4H10.1a0.5,0.5 0,0 0,-0.5 0.4L9.3,5.4a5.6,5.6 0,0 0,-1.7 0.9l-2.4,-1a0.4,0.4 0,0 0,-0.5 0.2l-2,3.4c-0.1,0.2 0,0.4 0.2,0.6l2,1.6a2.8,2.8 0,0 0,-0.1 0.9,2.8 2.8,0 0,0 0.1,0.9L2.8,14.5a0.7,0.7 0,0 0,-0.1 0.6l1.9,3.4a0.7,0.7 0,0 0,0.6 0.2l2.4,-1a6.5,6.5 0,0 0,1.6 0.9l0.4,2.6a0.5,0.5 0,0 0,0.5 0.4h3.8a0.5,0.5 0,0 0,0.5 -0.4l0.3,-2.6a5.6,5.6 0,0 0,1.7 -0.9l2.4,1a0.4,0.4 0,0 0,0.5 -0.2l2,-3.4c0.1,-0.2 0,-0.4 -0.2,-0.6ZM12,15.6A3.6,3.6 0,1 1,15.6 12,3.6 3.6,0 0,1 12,15.6Z"/>
</vector>

View File

@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF"
android:alpha="0.8">
<path
android:fillColor="#FF000000"
android:pathData="M20,2L4,2c-1.1,0 -1.99,0.9 -1.99,2L2,22l4,-4h14c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM13,14h-2v-2h2v2zM13,10h-2L11,6h2v4z"/>
</vector>

View File

@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFEB3B"
android:alpha="0.8">
<path
android:fillColor="#FF000000"
android:pathData="M19,3L5,3c-1.1,0 -1.99,0.9 -1.99,2L3,19c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM18,14h-4v4h-4v-4L6,14v-4h4L10,6h4v4h4v4z"/>
</vector>

View File

@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#1B96F8"
android:alpha="0.8">
<path
android:fillColor="#FF000000"
android:pathData="M13.5,5.5c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM9.8,8.9L7,23h2.1l1.8,-8 2.1,2v6h2v-7.5l-2.1,-2 0.6,-3C14.8,12 16.8,13 19,13v-2c-1.9,0 -3.5,-1 -4.3,-2.4l-1,-1.6c-0.4,-0.6 -1,-1 -1.7,-1 -0.3,0 -0.5,0.1 -0.8,0.1L6,8.3V13h2V9.6l1.8,-0.7"/>
</vector>

View File

@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF"
android:alpha="0.8">
<path
android:fillColor="#FF000000"
android:pathData="M13.5,5.5c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM9.8,8.9L7,23h2.1l1.8,-8 2.1,2v6h2v-7.5l-2.1,-2 0.6,-3C14.8,12 16.8,13 19,13v-2c-1.9,0 -3.5,-1 -4.3,-2.4l-1,-1.6c-0.4,-0.6 -1,-1 -1.7,-1 -0.3,0 -0.5,0.1 -0.8,0.1L6,8.3V13h2V9.6l1.8,-0.7"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 728 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

BIN
app/src/main/res/drawable-v24/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 870 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 655 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 880 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1016 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 771 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<clip xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/round_rect_shape_blue_clip"
android:clipOrientation="horizontal"
android:gravity="left" />

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/shadow_background_color" android:state_pressed="true"/>
<item android:color="@color/separator_color" android:state_focused="true"/>
<item android:color="@color/popup_menu_item_text_color"/>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#00ffffff" />
<padding android:left="6dp"
android:top="6dp"
android:right="6dp"
android:bottom="6dp" />
<corners android:radius="12dp" />
<stroke android:width="6dp" android:color="#ffffffff" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#44E372"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>
</vector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="512.0"
android:viewportWidth="512.0">
<path
android:fillColor="@color/unselected_text_color"
android:pathData="M396.6,160l19.4,20.7l-160,171.3l-160,-171.3l19.3,-20.7l140.7,150.5z"/>
</vector>

View File

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="5400"
android:viewportHeight="5400">
<group android:translateX="2646"
android:translateY="2646">
<path android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</group>
</vector>

View File

@@ -0,0 +1,34 @@
<vector xmlns:aapt="http://schemas.android.com/aapt"
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0"/>
<item
android:color="#00000000"
android:offset="1.0"/>
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1"/>
</vector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M20.5,3l-0.16,0.03L15,5.1 9,3 3.36,4.9c-0.21,0.07 -0.36,0.25 -0.36,0.48V20.5c0,0.28 0.22,0.5 0.5,0.5l0.16,-0.03L9,18.9l6,2.1 5.64,-1.9c0.21,-0.07 0.36,-0.25 0.36,-0.48V3.5c0,-0.28 -0.22,-0.5 -0.5,-0.5zM15,19l-6,-2.11V5l6,2.11V19z"/>
</vector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="512.0"
android:viewportWidth="512.0">
<path
android:fillColor="@color/unselected_text_color"
android:pathData="M396.6,352l19.4,-20.7l-160,-171.3l-160,171.3l19.3,20.7l140.7,-150.5z"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

View File

@@ -0,0 +1,12 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="#353333" />
<corners
android:bottomLeftRadius="8dp"
android:bottomRightRadius="8dp"
android:topLeftRadius="8dp"
android:topRightRadius="8dp" />
</shape>

View File

@@ -0,0 +1,12 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="#286FAE" />
<corners
android:bottomLeftRadius="8dp"
android:bottomRightRadius="8dp"
android:topLeftRadius="8dp"
android:topRightRadius="8dp" />
</shape>

View File

@@ -0,0 +1,12 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="#B6B0B0" />
<corners
android:bottomLeftRadius="8dp"
android:bottomRightRadius="8dp"
android:topLeftRadius="8dp"
android:topRightRadius="8dp" />
</shape>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<stroke
android:width="1dp"
android:color="@color/colorPrimary" />
<solid android:color="#ffffff" />
<padding
android:left="1dp"
android:right="1dp"
android:bottom="1dp"
android:top="1dp" />
<corners android:radius="5dp" />
</shape>

View File

@@ -0,0 +1,9 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="135"
android:centerColor="#009688"
android:endColor="#00695C"
android:startColor="#4DB6AC"
android:type="linear" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
app:fontProviderAuthority="com.google.android.gms.fonts"
app:fontProviderPackage="com.google.android.gms"
app:fontProviderQuery="Alice"
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
</font-family>

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
app:fontProviderAuthority="com.google.android.gms.fonts"
app:fontProviderPackage="com.google.android.gms"
app:fontProviderQuery="name=Montserrat&amp;weight=700"
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
</font-family>

View File

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".HomeActivity">
<ImageView
android:id="@+id/imageView3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#4942B7" />
<TextView
android:id="@+id/textView5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="This app is for educational and informative purposes only, this is not intended to harm anyone nor is it indended to spread misinformation. For more information, please go to reputable sources such as WHO and JHU for further information regarding sensitive topics such as these."
android:textColor="#ffffff"
android:textSize="25dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.487"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.302"
app:layout_constraintWidth_percent=".90" />
<Button
android:id="@+id/magicbtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="I Understand"
app:layout_constraintBottom_toBottomOf="@+id/imageView3"
app:layout_constraintEnd_toStartOf="@+id/imageView3"
app:layout_constraintStart_toEndOf="@+id/imageView3"
app:layout_constraintTop_toBottomOf="@+id/textView5" />
<ImageView
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/virus"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintHeight_percent=".12"
app:layout_constraintWidth_percent=".20"/>
<ImageView
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/virus"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/imageView3"
app:layout_constraintHeight_percent=".12"
app:layout_constraintWidth_percent=".20"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout 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"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/logout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#423E3E"
android:textSize="13sp"
android:gravity="center"
android:text="Sources: JHU, WHO, corona.lmao.ninja" />
</LinearLayout>
</com.google.android.material.navigation.NavigationView>
</androidx.drawerlayout.widget.DrawerLayout>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.josh.trackcovid19v2.MainActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#353333"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_main" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/app_bar_main">
<fragment
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/mobile_navigation" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.josh.trackcovid19v2.SettingsFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>

View File

@@ -0,0 +1,29 @@
<FrameLayout 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"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.josh.trackcovid19v2.ui.yourcountries.YourcountriesFragment">
<com.evrencoskun.tableview.TableView
android:id="@+id/countries_TableView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:column_header_height="@dimen/table_view_cell_height"
app:row_header_width="@dimen/table_view_row_header_width"
app:selected_color="@color/selected_background_color"
app:separator_color="@color/separator_color"
app:shadow_color="@color/shadow_background_color"
app:unselected_color="@color/unselected_background_color" />
<ProgressBar
android:id="@+id/countries_progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
</FrameLayout>

View File

@@ -0,0 +1,545 @@
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
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"
android:id="@+id/swiperefresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.josh.trackcovid19v2.ui.yourrealcountry.YourrealcountryFragment">
<ImageView
android:id="@+id/text_testsPerOneMillion"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintHeight_percent=".165"
android:src="@drawable/round_rect_shape"
android:adjustViewBounds="true"
android:contentDescription="@string/todo"
android:gravity="center"
android:scaleType="fitXY"
app:layout_constraintWidth_percent=".45"
android:textAlignment="center"
android:textColor="@color/unselected_header_background_color"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="@+id/text_affectedCountries"
app:layout_constraintTop_toTopOf="@+id/text_totalTests" />
<TextView
android:id="@+id/text_testsPerOneMillionData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="end"
android:textColor="#FFEB3B"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@+id/text_testsPerOneMillion"
app:layout_constraintEnd_toEndOf="@+id/text_testsPerOneMillion"
app:layout_constraintHorizontal_bias="0.734"
app:layout_constraintStart_toStartOf="@+id/text_testsPerOneMillion"
app:layout_constraintTop_toTopOf="@+id/text_testsPerOneMillion"
app:layout_constraintVertical_bias="0.67" />
<ImageView
android:id="@+id/text_totalTests"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintHeight_percent=".165"
android:layout_marginTop="16dp"
android:src="@drawable/round_rect_shape"
android:adjustViewBounds="true"
android:contentDescription="@string/todo"
android:gravity="center"
android:scaleType="fitXY"
app:layout_constraintWidth_percent=".45"
android:textAlignment="center"
android:textColor="@color/unselected_header_background_color"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="@+id/text_deaths"
app:layout_constraintTop_toBottomOf="@+id/text_deaths" />
<TextView
android:id="@+id/text_activeCasesName3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:text="Total Tests"
android:textAlignment="gravity"
android:textColor="#2196F3"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="@+id/text_totalTests"
app:layout_constraintStart_toStartOf="@+id/text_activeCasesName6"
app:layout_constraintTop_toTopOf="@+id/text_totalTests"
app:layout_constraintVertical_bias="0.114" />
<Spinner
android:id="@+id/spinner1"
android:layout_width="0dp"
android:layout_height="40dp"
android:background="@drawable/round_rect_shape_little_lighter"
android:gravity="center"
android:adjustViewBounds="true"
android:textAlignment="center"
android:scaleType="fitXY"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.076"
app:layout_constraintWidth_percent=".95" />
<ImageView
android:id="@+id/text_totalCases"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="16dp"
android:src="@drawable/round_rect_shape"
android:scaleType="fitXY"
android:adjustViewBounds="true"
android:contentDescription="@string/todo"
android:gravity="center"
android:textAlignment="center"
android:textColor="@color/unselected_header_background_color"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spinner1"
app:layout_constraintVertical_bias="0.007"
app:layout_constraintWidth_percent="0.95"
app:layout_constraintHeight_percent=".165"/>
<ImageView
android:id="@+id/text_recovered"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/round_rect_shape"
android:adjustViewBounds="true"
android:contentDescription="@string/todo"
android:gravity="center"
android:scaleType="fitXY"
android:textAlignment="center"
android:textColor="@color/unselected_header_background_color"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="@+id/text_totalCases"
app:layout_constraintTop_toTopOf="@+id/text_activeCases"
app:layout_constraintWidth_percent=".45"
app:layout_constraintHeight_percent=".165"/>
<ImageView
android:id="@+id/text_activeCases"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="16dp"
android:src="@drawable/round_rect_shape"
android:adjustViewBounds="true"
android:contentDescription="@string/todo"
android:gravity="center"
android:textAlignment="center"
android:textColor="@color/unselected_header_background_color"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/text_totalCases"
app:layout_constraintTop_toBottomOf="@+id/text_totalCases"
app:layout_constraintVertical_bias="0.0"
app:layout_constraintWidth_percent=".43"
app:layout_constraintHeight_percent=".165"/>
<ImageView
android:id="@+id/text_affectedCountries"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/round_rect_shape"
android:adjustViewBounds="true"
android:contentDescription="@string/todo"
android:gravity="center"
android:scaleType="fitXY"
android:textAlignment="center"
android:textColor="@color/unselected_background_color"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/text_totalCases"
app:layout_constraintTop_toTopOf="@+id/text_deaths"
app:layout_constraintVertical_bias="0.0"
tools:ignore="DuplicateIds"
app:layout_constraintWidth_percent=".45"
app:layout_constraintHeight_percent=".165"/>
<ImageView
android:id="@+id/text_deaths"
android:layout_width="0dp"
app:layout_constraintWidth_percent=".45"
android:layout_height="0dp"
android:layout_marginTop="16dp"
android:src="@drawable/round_rect_shape"
android:adjustViewBounds="true"
android:contentDescription="@string/todo"
android:gravity="center"
android:scaleType="fitXY"
android:textAlignment="center"
android:textColor="@color/unselected_header_background_color"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/text_totalCases"
app:layout_constraintTop_toBottomOf="@+id/text_activeCases"
app:layout_constraintVertical_bias="0.00"
app:layout_constraintHeight_percent=".165"/>
<ImageView
android:id="@+id/htmlImageGetter"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="90dp"
android:layout_marginBottom="26dp"
android:contentDescription="@string/todo"
app:layout_constraintBottom_toBottomOf="@+id/text_totalCases"
app:layout_constraintStart_toStartOf="@+id/text_totalCasesName"
app:layout_constraintTop_toTopOf="@+id/text_totalCases"
app:layout_constraintVertical_bias="0.7"
app:layout_constraintWidth_percent=".1"
app:layout_constraintHeight_percent=".05"/>
<TextView
android:id="@+id/text_activeCasesName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="start"
android:text="@string/active_cases"
android:textColor="#FFEB3B"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="@+id/text_activeCases"
app:layout_constraintStart_toStartOf="@+id/text_totalCasesName"
app:layout_constraintTop_toTopOf="@+id/text_activeCases"
app:layout_constraintVertical_bias="0.115" />
<TextView
android:id="@+id/text_totalCasesData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:textColor="#44E372"
android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="@+id/text_totalCases"
app:layout_constraintEnd_toEndOf="@+id/text_totalCases"
app:layout_constraintHorizontal_bias="0.87"
app:layout_constraintStart_toStartOf="@+id/text_totalCases"
app:layout_constraintTop_toTopOf="@+id/text_totalCases"
app:layout_constraintVertical_bias="0.67" />
<TextView
android:id="@+id/text_dailyIncriment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="end"
android:textColor="#44E372"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="@+id/text_totalCases"
app:layout_constraintEnd_toEndOf="@+id/text_totalCases"
app:layout_constraintHorizontal_bias="0.86"
app:layout_constraintStart_toStartOf="@+id/text_totalCases"
app:layout_constraintTop_toTopOf="@+id/text_totalCases"
app:layout_constraintVertical_bias=".92" />
<TextView
android:id="@+id/text_totalCasesName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:text="@string/total_confirmed_cases"
android:textColor="#FFFFFF"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@+id/text_totalCases"
app:layout_constraintEnd_toEndOf="@+id/text_totalCases"
app:layout_constraintHorizontal_bias="0.2"
app:layout_constraintStart_toStartOf="@+id/text_totalCases"
app:layout_constraintTop_toTopOf="@+id/text_totalCases"
app:layout_constraintVertical_bias="0.115" />
<TextView
android:id="@+id/text_activeCasesName6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:text="@string/total_deceased"
android:textAlignment="gravity"
android:textColor="#ff0000"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="@+id/text_deaths"
app:layout_constraintStart_toStartOf="@+id/text_activeCasesName"
app:layout_constraintTop_toTopOf="@+id/text_deaths"
app:layout_constraintVertical_bias="0.115" />
<TextView
android:id="@+id/text_activeCasesName2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:text="Tests Per Million"
android:textAlignment="gravity"
android:textColor="#FFEB3B"
android:textSize="13sp"
app:layout_constraintBottom_toBottomOf="@+id/text_testsPerOneMillion"
app:layout_constraintStart_toStartOf="@+id/text_RecoveredName"
app:layout_constraintTop_toTopOf="@+id/text_testsPerOneMillion"
app:layout_constraintVertical_bias="0.111" />
<TextView
android:id="@+id/text_RecoveredName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="start"
android:text="@string/recoveredName"
android:textColor="#ffffff"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="@+id/text_affectedCountries"
app:layout_constraintStart_toStartOf="@+id/text_CriticalName"
app:layout_constraintTop_toTopOf="@+id/text_affectedCountries"
app:layout_constraintVertical_bias="0.115" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:textColor="#000000"
android:textSize="15sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_percent=".90" />
<TextView
android:id="@+id/text_CriticalData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="end"
android:textAlignment="center"
android:textColor="#4CAF50"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@+id/text_recovered"
app:layout_constraintEnd_toEndOf="@+id/text_totalCasesData"
app:layout_constraintTop_toTopOf="@+id/text_recovered"
app:layout_constraintVertical_bias="0.67"
tools:ignore="RtlCompat" />
<TextView
android:id="@+id/text_CriticalName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="center"
android:text="@string/critical"
android:textAlignment="center"
android:textColor="#4CAF50"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="@+id/text_recovered"
app:layout_constraintEnd_toEndOf="@+id/text_recovered"
app:layout_constraintHorizontal_bias="0.2"
app:layout_constraintStart_toStartOf="@+id/text_recovered"
app:layout_constraintTop_toTopOf="@+id/text_recovered"
app:layout_constraintVertical_bias="0.115" />
<TextView
android:id="@+id/text_deathsData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="end"
android:textColor="#ff0000"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@+id/text_deaths"
app:layout_constraintEnd_toEndOf="@+id/text_deaths"
app:layout_constraintHorizontal_bias="0.734"
app:layout_constraintStart_toStartOf="@+id/text_deaths"
app:layout_constraintTop_toTopOf="@+id/text_deaths"
app:layout_constraintVertical_bias="0.67" />
<TextView
android:id="@+id/text_activeCasesIncriment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="end"
android:textColor="#FFEB3B"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="@+id/text_activeCases"
app:layout_constraintEnd_toEndOf="@+id/text_activeCases"
app:layout_constraintHorizontal_bias="0.8"
app:layout_constraintStart_toStartOf="@+id/text_activeCases"
app:layout_constraintTop_toTopOf="@+id/text_activeCases"
app:layout_constraintVertical_bias="0.9" />
<TextView
android:id="@+id/text_deathsDataIncriment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="end"
android:textColor="#ff0000"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="@+id/text_deaths"
app:layout_constraintEnd_toEndOf="@+id/text_deaths"
app:layout_constraintHorizontal_bias="0.8"
app:layout_constraintStart_toStartOf="@+id/text_deaths"
app:layout_constraintTop_toTopOf="@+id/text_deaths"
app:layout_constraintVertical_bias=".9" />
<TextView
android:id="@+id/text_totalTestsData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="end"
android:textColor="#2196F3"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@+id/text_totalTests"
app:layout_constraintEnd_toEndOf="@+id/text_totalTests"
app:layout_constraintHorizontal_bias="0.734"
app:layout_constraintStart_toStartOf="@+id/text_totalTests"
app:layout_constraintTop_toTopOf="@+id/text_totalTests"
app:layout_constraintVertical_bias="0.67" />
<TextView
android:id="@+id/text_CriticalDataIncriment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="end"
android:textColor="#4CAF50"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="@+id/text_recovered"
app:layout_constraintEnd_toEndOf="@+id/text_recovered"
app:layout_constraintHorizontal_bias=".8"
app:layout_constraintStart_toStartOf="@+id/text_recovered"
app:layout_constraintTop_toTopOf="@+id/text_recovered"
app:layout_constraintVertical_bias=".9" />
<TextView
android:id="@+id/text_activeCasesData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="end"
android:textColor="#FFEB3B"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@+id/text_activeCases"
app:layout_constraintEnd_toEndOf="@+id/text_activeCases"
app:layout_constraintHorizontal_bias="0.734"
app:layout_constraintStart_toStartOf="@+id/text_activeCases"
app:layout_constraintTop_toTopOf="@+id/text_activeCases"
app:layout_constraintVertical_bias=".67" />
<TextView
android:id="@+id/text_RecoveredData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@+id/text_affectedCountries"
app:layout_constraintEnd_toEndOf="@+id/text_CriticalData"
app:layout_constraintTop_toTopOf="@+id/text_affectedCountries"
app:layout_constraintVertical_bias=".67" />
<TextView
android:id="@+id/text_RealRecoveredDataIncriment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="start"
android:textColor="#ffffff"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="@+id/text_affectedCountries"
app:layout_constraintEnd_toEndOf="@+id/text_affectedCountries"
app:layout_constraintHorizontal_bias="0.8"
app:layout_constraintStart_toStartOf="@+id/text_affectedCountries"
app:layout_constraintTop_toTopOf="@+id/text_affectedCountries"
app:layout_constraintVertical_bias="0.9" />
<TextView
android:id="@+id/text_updated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:gravity="center"
android:textAlignment="center"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="DuplicateIds" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/hospital"
app:layout_constraintStart_toStartOf="@+id/text_activeCasesName"
app:layout_constraintTop_toTopOf="@+id/text_activeCasesData"
app:layout_constraintWidth_percent=".07"
app:layout_constraintHeight_percent=".035"/>
<ImageView
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/asdfasdfsadfasdfasdfas"
app:layout_constraintStart_toStartOf="@+id/text_activeCasesName6"
app:layout_constraintTop_toTopOf="@+id/text_deathsData"
app:layout_constraintWidth_percent=".07"
app:layout_constraintHeight_percent=".035"/>
<ImageView
android:id="@+id/Idunno"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/recoveredwhite"
app:layout_constraintStart_toStartOf="@+id/text_RecoveredName"
app:layout_constraintTop_toTopOf="@+id/text_RecoveredData"
app:layout_constraintWidth_percent=".07"
app:layout_constraintHeight_percent=".035"/>
<ImageView
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/crits"
app:layout_constraintStart_toStartOf="@+id/text_CriticalName"
app:layout_constraintTop_toTopOf="@+id/text_CriticalData"
app:layout_constraintWidth_percent=".07"
app:layout_constraintHeight_percent=".035"/>
<ImageView
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/syr"
app:layout_constraintStart_toStartOf="@+id/text_activeCasesName3"
app:layout_constraintTop_toTopOf="@+id/text_totalTestsData"
app:layout_constraintWidth_percent=".07"
app:layout_constraintHeight_percent=".035"/>
<ImageView
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/syryell"
app:layout_constraintStart_toStartOf="@+id/text_activeCasesName2"
app:layout_constraintTop_toTopOf="@+id/text_testsPerOneMillionData"
app:layout_constraintWidth_percent=".07"
app:layout_constraintHeight_percent=".035"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View File

@@ -0,0 +1,395 @@
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
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"
android:id="@+id/swiperefresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.josh.trackcovid19v2.ui.yourrealcountry.YourrealcountryFragment">
<ImageView
android:id="@+id/text_totalTests"
android:layout_width="0dp"
android:layout_height="0dp"
android:adjustViewBounds="true"
android:contentDescription="@string/todo"
android:gravity="center"
android:scaleType="fitXY"
android:src="@drawable/round_rect_shape"
android:textAlignment="center"
android:textColor="@color/unselected_header_background_color"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="@+id/text_totalCases"
app:layout_constraintHeight_percent=".2"
app:layout_constraintTop_toTopOf="@+id/text_activeCases"
app:layout_constraintWidth_percent=".45" />
<ImageView
android:id="@+id/text_testsPerOneMillion"
android:layout_width="0dp"
android:layout_height="0dp"
android:adjustViewBounds="true"
android:contentDescription="@string/todo"
android:gravity="center"
android:scaleType="fitXY"
android:src="@drawable/round_rect_shape"
android:textAlignment="center"
android:textColor="@color/unselected_header_background_color"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="@+id/text_totalTests"
app:layout_constraintHeight_percent=".2"
app:layout_constraintTop_toTopOf="@+id/text_deaths"
app:layout_constraintWidth_percent=".45" />
<TextView
android:id="@+id/text_testsPerOneMillionData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="end"
android:textColor="#FFEB3B"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@+id/text_testsPerOneMillion"
app:layout_constraintEnd_toEndOf="@+id/text_testsPerOneMillion"
app:layout_constraintHorizontal_bias="0.734"
app:layout_constraintStart_toStartOf="@+id/text_testsPerOneMillion"
app:layout_constraintTop_toTopOf="@+id/text_testsPerOneMillion"
app:layout_constraintVertical_bias="0.67" />
<TextView
android:id="@+id/text_activeCasesName3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:text="Total Tests"
android:textAlignment="gravity"
android:textColor="#2196F3"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="@+id/text_totalTests"
app:layout_constraintEnd_toEndOf="@+id/text_totalTests"
app:layout_constraintHorizontal_bias="0.22"
app:layout_constraintStart_toStartOf="@+id/text_totalTests"
app:layout_constraintTop_toTopOf="@+id/text_totalTests"
app:layout_constraintVertical_bias="0.115" />
<Spinner
android:id="@+id/spinner1"
android:layout_width="0dp"
android:layout_height="0dp"
android:adjustViewBounds="true"
android:background="@drawable/round_rect_shape_little_lighter"
android:gravity="center"
android:scaleType="fitXY"
android:textAlignment="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHeight_percent=".08"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.1"
app:layout_constraintWidth_percent=".95" />
<ImageView
android:id="@+id/text_totalCases"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="30dp"
android:adjustViewBounds="true"
android:contentDescription="@string/todo"
android:gravity="center"
android:scaleType="fitXY"
android:src="@drawable/round_rect_shape"
android:textAlignment="center"
android:textColor="@color/unselected_header_background_color"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHeight_percent=".165"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spinner1"
app:layout_constraintVertical_bias="0.007"
app:layout_constraintWidth_percent="0.95" />
<ImageView
android:id="@+id/text_activeCases"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="30dp"
android:adjustViewBounds="true"
android:contentDescription="@string/todo"
android:gravity="center"
android:src="@drawable/round_rect_shape"
android:textAlignment="center"
android:textColor="@color/unselected_header_background_color"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHeight_percent=".2"
app:layout_constraintStart_toStartOf="@+id/text_totalCases"
app:layout_constraintTop_toBottomOf="@+id/text_totalCases"
app:layout_constraintVertical_bias="0.0"
app:layout_constraintWidth_percent=".43" />
<ImageView
android:id="@+id/text_deaths"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="30dp"
android:adjustViewBounds="true"
android:contentDescription="@string/todo"
android:gravity="center"
android:scaleType="fitXY"
android:src="@drawable/round_rect_shape"
android:textAlignment="center"
android:textColor="@color/unselected_header_background_color"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHeight_percent=".2"
app:layout_constraintStart_toStartOf="@+id/text_totalCases"
app:layout_constraintTop_toBottomOf="@+id/text_activeCases"
app:layout_constraintVertical_bias="0.00"
app:layout_constraintWidth_percent=".45" />
<TextView
android:id="@+id/text_activeCasesName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="start"
android:text="@string/active_cases"
android:textColor="#FFEB3B"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="@+id/text_activeCases"
app:layout_constraintStart_toStartOf="@+id/text_totalCasesName"
app:layout_constraintTop_toTopOf="@+id/text_activeCases"
app:layout_constraintVertical_bias="0.115" />
<TextView
android:id="@+id/text_totalCasesData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:textColor="#44E372"
android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="@+id/text_totalCases"
app:layout_constraintEnd_toEndOf="@+id/text_totalCases"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="@+id/text_totalCases"
app:layout_constraintTop_toTopOf="@+id/text_totalCases"
app:layout_constraintVertical_bias="0.67" />
<TextView
android:id="@+id/text_dailyIncriment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="end"
android:textColor="#44E372"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="@+id/text_totalCases"
app:layout_constraintEnd_toEndOf="@+id/text_totalCases"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="@+id/text_totalCases"
app:layout_constraintTop_toTopOf="@+id/text_totalCases"
app:layout_constraintVertical_bias=".92" />
<TextView
android:id="@+id/text_totalCasesName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:text="@string/total_confirmed_cases"
android:textColor="#FFFFFF"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@+id/text_totalCases"
app:layout_constraintEnd_toEndOf="@+id/text_totalCases"
app:layout_constraintHorizontal_bias="0.2"
app:layout_constraintStart_toStartOf="@+id/text_totalCases"
app:layout_constraintTop_toTopOf="@+id/text_totalCases"
app:layout_constraintVertical_bias="0.115" />
<TextView
android:id="@+id/text_activeCasesName6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:text="@string/total_deceased"
android:textAlignment="gravity"
android:textColor="#ff0000"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="@+id/text_deaths"
app:layout_constraintStart_toStartOf="@+id/text_activeCasesName"
app:layout_constraintTop_toTopOf="@+id/text_deaths"
app:layout_constraintVertical_bias="0.115" />
<TextView
android:id="@+id/text_activeCasesName2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginBottom="113dp"
android:fontFamily="sans-serif-light"
android:text="Tests Per Million"
android:textAlignment="gravity"
android:textColor="#FFEB3B"
android:textSize="13sp"
app:layout_constraintBottom_toBottomOf="@+id/text_testsPerOneMillion"
app:layout_constraintVertical_bias="0.115"
app:layout_constraintStart_toStartOf="@+id/text_activeCasesName3"
app:layout_constraintTop_toTopOf="@+id/text_testsPerOneMillion" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:gravity="center"
android:textColor="#000000"
android:textSize="15sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_percent=".90" />
<TextView
android:id="@+id/text_deathsData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="end"
android:textColor="#ff0000"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@+id/text_deaths"
app:layout_constraintEnd_toEndOf="@+id/text_deaths"
app:layout_constraintHorizontal_bias="0.734"
app:layout_constraintStart_toStartOf="@+id/text_deaths"
app:layout_constraintTop_toTopOf="@+id/text_deaths"
app:layout_constraintVertical_bias="0.67" />
<TextView
android:id="@+id/text_activeCasesIncriment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="end"
android:textColor="#FFEB3B"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="@+id/text_activeCases"
app:layout_constraintEnd_toEndOf="@+id/text_activeCases"
app:layout_constraintHorizontal_bias="0.8"
app:layout_constraintStart_toStartOf="@+id/text_activeCases"
app:layout_constraintTop_toTopOf="@+id/text_activeCases"
app:layout_constraintVertical_bias="0.9" />
<TextView
android:id="@+id/text_deathsDataIncriment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="end"
android:textColor="#ff0000"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="@+id/text_deaths"
app:layout_constraintEnd_toEndOf="@+id/text_deaths"
app:layout_constraintHorizontal_bias="0.8"
app:layout_constraintStart_toStartOf="@+id/text_deaths"
app:layout_constraintTop_toTopOf="@+id/text_deaths"
app:layout_constraintVertical_bias=".9" />
<TextView
android:id="@+id/text_totalTestsData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="end"
android:textColor="#2196F3"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@+id/text_totalTests"
app:layout_constraintEnd_toEndOf="@+id/text_totalTests"
app:layout_constraintHorizontal_bias="0.734"
app:layout_constraintStart_toStartOf="@+id/text_totalTests"
app:layout_constraintTop_toTopOf="@+id/text_totalTests"
app:layout_constraintVertical_bias="0.67" />
<TextView
android:id="@+id/text_activeCasesData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="end"
android:textColor="#FFEB3B"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@+id/text_activeCases"
app:layout_constraintEnd_toEndOf="@+id/text_activeCases"
app:layout_constraintHorizontal_bias="0.734"
app:layout_constraintStart_toStartOf="@+id/text_activeCases"
app:layout_constraintTop_toTopOf="@+id/text_activeCases"
app:layout_constraintVertical_bias=".67" />
<TextView
android:id="@+id/text_updated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:gravity="center"
android:textAlignment="center"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="DuplicateIds" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/hospital"
app:layout_constraintHeight_percent=".035"
app:layout_constraintStart_toStartOf="@+id/text_activeCasesName"
app:layout_constraintTop_toTopOf="@+id/text_activeCasesData"
app:layout_constraintWidth_percent=".07" />
<ImageView
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/asdfasdfsadfasdfasdfas"
app:layout_constraintHeight_percent=".035"
app:layout_constraintStart_toStartOf="@+id/text_activeCasesName6"
app:layout_constraintTop_toTopOf="@+id/text_deathsData"
app:layout_constraintWidth_percent=".07" />
<ImageView
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/syr"
app:layout_constraintHeight_percent=".035"
app:layout_constraintStart_toStartOf="@+id/text_activeCasesName3"
app:layout_constraintTop_toTopOf="@+id/text_totalTestsData"
app:layout_constraintWidth_percent=".07" />
<ImageView
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/syryell"
app:layout_constraintHeight_percent=".035"
app:layout_constraintStart_toStartOf="@+id/text_activeCasesName2"
app:layout_constraintTop_toTopOf="@+id/text_testsPerOneMillionData"
app:layout_constraintWidth_percent=".07" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View File

@@ -0,0 +1,448 @@
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout 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"
android:id="@+id/swiperefresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.josh.trackcovid19v2.ui.yourworld.YourworldFragment">
<ImageView
android:id="@+id/text_recovered"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintHeight_percent=".20"
android:src="@drawable/round_rect_shape"
android:scaleType="fitXY"
android:adjustViewBounds="true"
android:gravity="center"
android:textAlignment="center"
android:textColor="@color/unselected_header_background_color"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="@+id/text_totalCases"
app:layout_constraintTop_toTopOf="@+id/text_activeCases"
app:layout_constraintWidth_percent=".45"/>
<ImageView
android:id="@+id/text_activeCases"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintHeight_percent=".20"
android:scaleType="fitXY"
android:layout_marginTop="20dp"
android:src="@drawable/round_rect_shape"
android:adjustViewBounds="true"
android:gravity="center"
android:textAlignment="center"
android:textColor="@color/unselected_header_background_color"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/text_totalCases"
app:layout_constraintTop_toBottomOf="@+id/text_totalCases"
app:layout_constraintVertical_bias="0.0"
app:layout_constraintWidth_percent=".45"/>
<TextView
android:id="@+id/text_activeCasesName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="left"
android:text="@string/active_cases"
android:textColor="#FFEB3B"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="@+id/text_activeCases"
app:layout_constraintStart_toStartOf="@+id/text_totalCasesName"
app:layout_constraintTop_toTopOf="@+id/text_activeCases"
app:layout_constraintVertical_bias="0.115" />
<ImageView
android:id="@+id/text_totalCases"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/round_rect_shape"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:gravity="center"
android:textAlignment="center"
android:textColor="@color/unselected_header_background_color"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.123"
app:layout_constraintWidth_percent="0.95"
app:layout_constraintHeight_percent=".20"/>
<ImageView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="90dp"
android:layout_marginBottom="26dp"
android:src="@drawable/virusasdfasdfasdf"
android:adjustViewBounds="true"
app:layout_constraintHeight_percent=".07"
app:layout_constraintWidth_percent=".07"
app:layout_constraintBottom_toBottomOf="@+id/text_totalCases"
app:layout_constraintStart_toStartOf="@+id/text_totalCasesName"
app:layout_constraintTop_toTopOf="@+id/text_totalCases"
app:layout_constraintVertical_bias="0.588" />
<TextView
android:id="@+id/text_totalCasesData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:textColor="#44E372"
android:textSize="40sp"
app:layout_constraintBottom_toBottomOf="@+id/text_totalCases"
app:layout_constraintEnd_toEndOf="@+id/text_totalCases"
app:layout_constraintHorizontal_bias="0.87"
app:layout_constraintStart_toStartOf="@+id/text_totalCases"
app:layout_constraintTop_toTopOf="@+id/text_totalCases"
app:layout_constraintVertical_bias="0.67" />
<TextView
android:id="@+id/text_dailyIncriment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="right"
android:textColor="#44E372"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="@+id/text_totalCases"
app:layout_constraintEnd_toEndOf="@+id/text_totalCases"
app:layout_constraintHorizontal_bias="0.86"
app:layout_constraintStart_toStartOf="@+id/text_totalCases"
app:layout_constraintTop_toTopOf="@+id/text_totalCases"
app:layout_constraintVertical_bias=".9" />
<TextView
android:id="@+id/text_totalCasesName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:text="Total Confirmed Cases"
android:textColor="#FFFFFF"
android:textSize="25sp"
app:layout_constraintBottom_toBottomOf="@+id/text_totalCases"
app:layout_constraintEnd_toEndOf="@+id/text_totalCases"
app:layout_constraintHorizontal_bias="0.200"
app:layout_constraintStart_toStartOf="@+id/text_totalCases"
app:layout_constraintTop_toTopOf="@+id/text_totalCases"
app:layout_constraintVertical_bias="0.115" />
<TextView
android:id="@+id/text_updated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center"
android:textAlignment="center"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/image_level"
tools:ignore="DuplicateIds" />
<ImageView
android:id="@+id/text_affectedCountries"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintHeight_percent=".20"
android:layout_marginTop="18dp"
android:src="@drawable/round_rect_shape"
android:adjustViewBounds="true"
android:gravity="center"
android:scaleType="fitXY"
android:textAlignment="center"
android:textColor="@color/unselected_background_color"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/text_totalCases"
app:layout_constraintTop_toBottomOf="@+id/text_recovered"
app:layout_constraintVertical_bias="0.0"
tools:ignore="DuplicateIds"
app:layout_constraintWidth_percent=".45"/>
<ImageView
android:id="@+id/text_deaths"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintHeight_percent=".20"
android:layout_marginTop="20dp"
android:src="@drawable/round_rect_shape"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:gravity="center"
android:textAlignment="center"
android:textColor="@color/unselected_header_background_color"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/text_totalCases"
app:layout_constraintTop_toBottomOf="@+id/text_activeCases"
app:layout_constraintVertical_bias="0.0"
app:layout_constraintWidth_percent=".45"/>
<ImageView
android:id="@+id/imageView2"
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/hospital"
android:adjustViewBounds="true"
app:layout_constraintStart_toStartOf="@+id/text_activeCasesName"
app:layout_constraintTop_toTopOf="@+id/text_activeCasesData" />
<TextView
android:id="@+id/text_activeCasesName6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:text="@string/total_deceased"
android:textAlignment="gravity"
android:textColor="#ff0000"
android:textSize="17dp"
app:layout_constraintBottom_toBottomOf="@+id/text_deaths"
app:layout_constraintStart_toStartOf="@+id/text_activeCasesName"
app:layout_constraintTop_toTopOf="@+id/text_deaths"
app:layout_constraintVertical_bias="0.115" />
<TextView
android:id="@+id/text_affectedCountriesName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="center"
android:text="@string/affected_countries"
android:textColor="#ffffff"
android:textSize="17dp"
app:layout_constraintBottom_toBottomOf="@+id/text_affectedCountries"
app:layout_constraintEnd_toEndOf="@+id/text_affectedCountries"
app:layout_constraintHorizontal_bias="0.7"
app:layout_constraintStart_toStartOf="@+id/text_affectedCountries"
app:layout_constraintTop_toTopOf="@+id/text_affectedCountries"
app:layout_constraintVertical_bias="0.115" />
<TextView
android:id="@+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:fontFamily="@font/cutive"
android:gravity="center"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.500"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_percent=".95" />
<TextView
android:id="@+id/text_recoveredData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="right"
android:textAlignment="center"
android:textColor="#1B96F8"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@+id/text_recovered"
app:layout_constraintEnd_toEndOf="@+id/text_totalCasesData"
app:layout_constraintTop_toTopOf="@+id/text_recovered"
app:layout_constraintVertical_bias="0.67"
tools:ignore="RtlCompat" />
<TextView
android:id="@+id/text_recoveredName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="center"
android:text="@string/recoveredName"
android:textAlignment="center"
android:textColor="#1B96F8"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="@+id/text_recovered"
app:layout_constraintEnd_toEndOf="@+id/text_recovered"
app:layout_constraintHorizontal_bias="0.22"
app:layout_constraintStart_toStartOf="@+id/text_recovered"
app:layout_constraintTop_toTopOf="@+id/text_recovered"
app:layout_constraintVertical_bias="0.115" />
<TextView
android:id="@+id/text_affectedCountriesData"
android:layout_width="108dp"
android:layout_height="40dp"
android:fontFamily="sans-serif-light"
android:gravity="center"
android:textColor="#ffffff"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@+id/text_affectedCountries"
app:layout_constraintEnd_toEndOf="@+id/text_affectedCountries"
app:layout_constraintHorizontal_bias="0.8"
app:layout_constraintStart_toStartOf="@+id/text_affectedCountries"
app:layout_constraintTop_toTopOf="@+id/text_affectedCountries"
app:layout_constraintVertical_bias="0.8" />
<TextView
android:id="@+id/text_deathsData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="right"
android:textColor="#ff0000"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@+id/text_deaths"
app:layout_constraintEnd_toEndOf="@+id/text_deaths"
app:layout_constraintHorizontal_bias="0.734"
app:layout_constraintStart_toStartOf="@+id/text_deaths"
app:layout_constraintTop_toTopOf="@+id/text_deaths"
app:layout_constraintVertical_bias="0.67" />
<TextView
android:id="@+id/text_activeCasesIncriment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="right"
android:textColor="#FFEB3B"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="@+id/text_activeCases"
app:layout_constraintEnd_toEndOf="@+id/text_activeCases"
app:layout_constraintHorizontal_bias="0.8"
app:layout_constraintStart_toStartOf="@+id/text_activeCases"
app:layout_constraintTop_toTopOf="@+id/text_activeCases"
app:layout_constraintVertical_bias="0.9" />
<TextView
android:id="@+id/text_deathsDataIncriment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="right"
android:textColor="#ff0000"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="@+id/text_deaths"
app:layout_constraintEnd_toEndOf="@+id/text_deaths"
app:layout_constraintHorizontal_bias="0.8"
app:layout_constraintStart_toStartOf="@+id/text_deaths"
app:layout_constraintTop_toTopOf="@+id/text_deaths"
app:layout_constraintVertical_bias=".9" />
<TextView
android:id="@+id/text_recoveredDataIncriment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:textColor="#1B96F8"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="@+id/text_recovered"
app:layout_constraintEnd_toEndOf="@+id/text_recovered"
app:layout_constraintHorizontal_bias=".8"
app:layout_constraintStart_toStartOf="@+id/text_recovered"
app:layout_constraintTop_toTopOf="@+id/text_recovered"
app:layout_constraintVertical_bias=".9" />
<TextView
android:id="@+id/text_activeCasesData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="right"
android:textColor="#FFEB3B"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@+id/text_activeCases"
app:layout_constraintEnd_toEndOf="@+id/text_activeCases"
app:layout_constraintHorizontal_bias="0.734"
app:layout_constraintStart_toStartOf="@+id/text_activeCases"
app:layout_constraintTop_toTopOf="@+id/text_activeCases"
app:layout_constraintVertical_bias=".67" />
<ImageView
android:id="@+id/image_level"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginTop="20dp"
android:background="@drawable/round_rect_shape_little_lighter"
android:src="@drawable/clip"
android:adjustViewBounds="true"
android:scaleType="fitXY"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_deaths"
app:layout_constraintVertical_bias="0.0"
app:layout_constraintWidth_percent=".95" />
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginTop="1dp"
android:src="@drawable/affcountries"
android:adjustViewBounds="true"
app:layout_constraintStart_toStartOf="@+id/text_affectedCountriesName"
app:layout_constraintTop_toTopOf="@+id/text_affectedCountriesData" />
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/asdfasdfsadfasdfasdfas"
android:adjustViewBounds="true"
app:layout_constraintStart_toStartOf="@+id/text_activeCasesName6"
app:layout_constraintTop_toTopOf="@+id/text_deathsData" />
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/recovered"
android:adjustViewBounds="true"
app:layout_constraintStart_toStartOf="@+id/text_recoveredName"
app:layout_constraintTop_toTopOf="@+id/text_recoveredData" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="26dp"
android:layout_marginLeft="26dp"
android:gravity="left"
android:text="Recovered"
android:textColor="#000000"
android:textSize="25dp"
app:layout_constraintBottom_toBottomOf="@+id/image_level"
app:layout_constraintStart_toStartOf="@+id/image_level"
app:layout_constraintTop_toTopOf="@+id/image_level"
app:layout_constraintVertical_bias="0.5" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="26dp"
android:layout_marginRight="26dp"
android:gravity="right"
android:textColor="#000000"
android:textSize="25dp"
app:layout_constraintBottom_toBottomOf="@+id/image_level"
app:layout_constraintEnd_toEndOf="@+id/image_level"
app:layout_constraintTop_toTopOf="@+id/image_level"
app:layout_constraintVertical_bias="0.5" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:gravity="center"
android:textSize="18sp"
android:scaleType="fitXY"
android:textColor="#000000"
android:textStyle="bold"
android:text="Sample Text"
android:paddingBottom="3dp"
android:paddingTop="3dp"></TextView>

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:layout_width="match_parent"
android:layout_height="@dimen/nav_header_height"
android:background="#353333"
android:gravity="bottom"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<ImageView
android:id="@+id/imageView"
android:layout_width="95dp"
android:layout_height="86dp"
android:contentDescription="TODO"
app:srcCompat="@drawable/uccovid" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/nav_header_vertical_spacing"
android:text="@string/trackcorona2020"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/joshpatra12_protonmail_com" />
</LinearLayout>

View File

@@ -0,0 +1,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/settings"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/cell_container"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="@dimen/table_view_cell_height"
android:background="@color/unselected_background_color"
android:orientation="vertical">
<TextView
android:id="@+id/cell_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:gravity="center"
android:maxLines="1"
android:textColor="@color/unselected_text_color"
android:textSize="@dimen/table_view_default_text_size"
tools:text="Cell Data"/>
</LinearLayout>

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/column_header_container"
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"
android:layout_width="wrap_content"
android:layout_height="@dimen/table_view_cell_height"
android:background="@color/unselected_header_background_color"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:orientation="horizontal">
<TextView
android:id="@+id/column_header_textView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="4"
android:gravity="center"
android:textColor="@color/unselected_text_color"
android:textSize="@dimen/table_view_default_text_size"
tools:text="Header Data"/>
<ImageButton
android:id="@+id/column_header_sort_imageButton"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_gravity="end|center"
android:layout_marginLeft="4dp"
android:background="@android:color/transparent"
android:paddingRight="-5dp"
android:scaleType="fitXY"
android:visibility="gone"
app:srcCompat="@drawable/ic_down"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_gravity="bottom"
android:background="@color/separator_color"/>
</FrameLayout>
</LinearLayout>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/table_view_row_header_width"
android:layout_height="@dimen/table_view_cell_height"
android:background="@color/unselected_header_background_color">
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="@color/separator_color"/>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_alignParentBottom="true"
android:background="@color/separator_color"/>
</RelativeLayout>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="@dimen/table_view_cell_height"
android:background="@color/unselected_background_color">
<ImageButton
android:id="@+id/cell_image_button"
android:layout_width="13dp"
android:layout_height="13dp"
android:layout_gravity="center"
android:background="@android:color/transparent"
android:gravity="center"
android:scaleType="fitXY"
app:srcCompat="@drawable/female"/>
</FrameLayout>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/cell_container"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="@dimen/table_view_cell_height"
android:background="@color/unselected_background_color"
android:orientation="vertical">
<org.fabiomsr.moneytextview.MoneyTextView
android:id="@+id/money_cell_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:gravity="center"
android:maxLines="1"
android:textColor="@color/unselected_text_color"
app:amount="1256.56"
app:baseTextColor="@color/unselected_text_color"
app:baseTextSize="@dimen/table_view_default_text_size"
app:decimalDigitsTextSize="@dimen/table_view_default_text_size"
app:decimalTextColor="@color/unselected_text_color"
app:symbol="$"
app:symbolTextColor="@color/unselected_text_color"
app:symbolTextSize="@dimen/table_view_default_text_size"
/>
</LinearLayout>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/root"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/table_view_row_header_width"
android:layout_height="@dimen/table_view_cell_height"
android:background="@color/unselected_header_background_color">
<LinearLayout
android:id="@+id/row_header_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/row_header_textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:textColor="@color/unselected_text_color"
android:textSize="@dimen/table_view_default_text_size"
tools:text="Row Data"/>
</LinearLayout>
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="@color/separator_color"
android:layout_alignParentEnd="true" />
</RelativeLayout>

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_yourworld"
android:icon="@drawable/globe"
android:title="@string/world_data" />
<!--
<item
android:id="@+id/nav_yourcountry"
android:icon="@drawable/ic_map_black_24dp"
android:title="@string/your_country" />
-->
<item
android:id="@+id/nav_yourrealcountry"
android:icon="@drawable/iconus"
android:title="@string/your_real_country" />
<item
android:id="@+id/nav_yourstate"
android:icon="@drawable/stateiconfinal"
android:title="@string/your_state" />
</group>
<!--
<group
android:id="@+id/menu_bottom"
android:checkableBehavior="none">
<item
android:id="@+id/nav_yoursettings"
android:icon="@drawable/ic_action_name"
android:title="@string/item" />
<item
android:id="@+id/nav_sendFeedback"
android:icon="@drawable/ic_action_name2"
android:title="@string/send_feedback"
/>
</group>
-->
</menu>

3
app/src/main/res/menu/main.xml Executable file
View File

@@ -0,0 +1,3 @@
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android" >
</menu>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View File

@@ -0,0 +1,33 @@
<?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"
android:id="@+id/mobile_navigation"
app:startDestination="@+id/nav_yourworld">
<fragment
android:id="@+id/nav_yourworld"
android:name="com.josh.trackcovid19v2.ui.yourworld.YourworldFragment"
android:label="@string/menu_yourworld"
tools:layout="@layout/fragment_yourworld" />
<fragment
android:id="@+id/nav_yourcountry"
android:name="com.josh.trackcovid19v2.ui.yourcountries.YourcountriesFragment"
android:label="@string/menu_yourcountry"
tools:layout="@layout/fragment_yourcountry" />
<fragment
android:id="@+id/nav_yourrealcountry"
android:name="com.josh.trackcovid19v2.ui.yourrealcountry.YourrealcountryFragment"
android:label="@string/menu_yourrealcountry"
tools:layout="@layout/fragment_yourrealcountry" />
<fragment
android:id="@+id/nav_yourstate"
android:name="com.josh.trackcovid19v2.ui.yourstate.YourstateFragment"
android:label="@string/menu_yourstate"
tools:layout="@layout/fragment_yourstate" />
<fragment
android:id="@+id/nav_yoursettings"
android:name="com.josh.trackcovid19v2.SettingsActivity$SettingsFragment"
android:label="@string/menu_yoursettings"
tools:layout="@layout/fragment_settings" />
</navigation>

BIN
app/src/main/res/res/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,34 @@
<vector xmlns:aapt="http://schemas.android.com/aapt"
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0"/>
<item
android:color="#00000000"
android:offset="1.0"/>
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1"/>
</vector>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/shadow_background_color" android:state_pressed="true"/>
<item android:color="@color/separator_color" android:state_focused="true"/>
<item android:color="@color/popup_menu_item_text_color"/>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="512.0"
android:viewportWidth="512.0">
<path
android:fillColor="@color/unselected_text_color"
android:pathData="M396.6,160l19.4,20.7l-160,171.3l-160,-171.3l19.3,-20.7l140.7,150.5z"/>
</vector>

View File

@@ -0,0 +1,171 @@
<?xml version="1.0" encoding="utf-8"?>
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillColor="#26A69A"
android:pathData="M0,0h108v108h-108z"/>
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
</vector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="512.0"
android:viewportWidth="512.0">
<path
android:fillColor="@color/unselected_text_color"
android:pathData="M396.6,352l19.4,-20.7l-160,-171.3l-160,171.3l19.3,20.7l140.7,-150.5z"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/unselected_background_color"
android:focusableInTouchMode="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.android.com/apk/res/android ">
<FrameLayout
android:id="@+id/activity_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>

View File

@@ -0,0 +1,29 @@
<FrameLayout 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"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.josh.trackcovid19v2.ui.MainFragment">
<com.evrencoskun.tableview.TableView
android:id="@+id/my_TableView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:column_header_height="@dimen/table_view_cell_height"
app:row_header_width="@dimen/table_view_row_header_width"
app:selected_color="@color/selected_background_color"
app:shadow_color="@color/shadow_background_color"
app:unselected_color="@color/unselected_background_color"
app:separator_color="@color/separator_color"/>
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
</FrameLayout>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/cell_container"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="@dimen/table_view_cell_height"
android:background="@color/unselected_background_color"
android:orientation="vertical">
<TextView
android:id="@+id/cell_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:gravity="center"
android:maxLines="1"
android:textColor="@color/unselected_text_color"
android:textSize="@dimen/table_view_default_text_size"
tools:text="Cell Data"/>
</LinearLayout>

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/column_header_container"
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"
android:layout_width="wrap_content"
android:layout_height="@dimen/table_view_cell_height"
android:background="@color/unselected_header_background_color"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:orientation="horizontal">
<TextView
android:id="@+id/column_header_textView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="4"
android:gravity="center"
android:textColor="@color/unselected_text_color"
android:textSize="@dimen/table_view_default_text_size"
tools:text="Header Data"/>
<ImageButton
android:id="@+id/column_header_sort_imageButton"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_gravity="end|center"
android:layout_marginLeft="4dp"
android:background="@android:color/transparent"
android:paddingRight="-5dp"
android:scaleType="fitXY"
android:visibility="gone"
app:srcCompat="@drawable/ic_down"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_gravity="bottom"
android:background="@color/separator_color"/>
</FrameLayout>
</LinearLayout>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/table_view_row_header_width"
android:layout_height="@dimen/table_view_cell_height"
android:background="@color/unselected_header_background_color">
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="@color/separator_color"/>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_alignParentBottom="true"
android:background="@color/separator_color"/>
</RelativeLayout>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="@dimen/table_view_cell_height"
android:background="@color/unselected_background_color">
<ImageButton
android:id="@+id/cell_image_button"
android:layout_width="13dp"
android:layout_height="13dp"
android:layout_gravity="center"
android:background="@android:color/transparent"
android:gravity="center"
android:scaleType="fitXY"
app:srcCompat="@drawable/female"/>
</FrameLayout>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/cell_container"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="@dimen/table_view_cell_height"
android:background="@color/unselected_background_color"
android:orientation="vertical">
<org.fabiomsr.moneytextview.MoneyTextView
android:id="@+id/money_cell_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:gravity="center"
android:maxLines="1"
android:textColor="@color/unselected_text_color"
app:amount="1256.56"
app:baseTextColor="@color/unselected_text_color"
app:baseTextSize="@dimen/table_view_default_text_size"
app:decimalDigitsTextSize="@dimen/table_view_default_text_size"
app:decimalTextColor="@color/unselected_text_color"
app:symbol="$"
app:symbolTextColor="@color/unselected_text_color"
app:symbolTextSize="@dimen/table_view_default_text_size"
/>
</LinearLayout>

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/root"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/table_view_row_header_width"
android:layout_height="@dimen/table_view_cell_height"
android:background="@color/unselected_header_background_color">
<LinearLayout
android:id="@+id/row_header_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/row_header_textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:textColor="@color/unselected_text_color"
android:textSize="@dimen/table_view_default_text_size"
tools:text="Row Data"/>
</LinearLayout>
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="@color/separator_color"/>
</RelativeLayout>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#15a4fa</color>
<color name="selected_background_color">#15a4fa</color>
<color name="unselected_background_color">#1c324a</color>
<color name="shadow_background_color">#28415f</color>
<color name="unselected_header_background_color">#1f3650</color>
<color name="unselected_text_color">#537095</color>
<color name="selected_text_color">#ffffff</color>
<color name="separator_color">#273e5b</color>
<color name="popup_menu_item_text_color">#88a5c9</color>
<color name="female_icon_color">#e9515f</color>
<color name="male_icon_color">#f28944</color>
</resources>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="table_view_cell_height">28dp</dimen>
<dimen name="table_view_row_header_width">28dp</dimen>
<dimen name="table_view_default_text_size">11sp</dimen>
</resources>

View File

@@ -0,0 +1,11 @@
<resources>
<string name="app_name">TableViewSample2</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="sort_ascending">Sort Ascending</string>
<string name="sort_descending">Sort Descending</string>
<string name="clear_sorting">Clear</string>
<string name="row_show">Show 5. Row</string>
<string name="row_hide">Hide 5. Row</string>
</resources>

View File

@@ -0,0 +1,22 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/selected_background_color</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@color/unselected_background_color</item>
<item name="android:popupMenuStyle">@style/PopupMenu</item>
<item name="android:itemTextAppearance">@style/itemTextStyle.AppTheme</item>
</style>
<style name="PopupMenu" parent="@android:style/Widget.PopupMenu">
<item name="android:popupBackground">@color/shadow_background_color</item>
</style>
<style name="itemTextStyle.AppTheme" parent="@android:style/TextAppearance.Widget.IconMenu.Item">
<item name="android:textColor">@drawable/color_item_popup</item>
<item name="android:textSize">11sp</item>
</style>
</resources>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">localhost</domain>
</domain-config>
</network-security-config>

View File

@@ -0,0 +1,8 @@
<resources>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>

View File

@@ -0,0 +1,12 @@
<resources>
<!-- Reply Preference -->
<string-array name="reply_entries">
<item>Reply</item>
<item>Reply to all</item>
</string-array>
<string-array name="reply_values">
<item>reply</item>
<item>reply_all</item>
</string-array>
</resources>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#000000</color>
<color name="colorPrimaryDark">#000000</color>
<color name="colorAccent">#B30909</color>
<color name="selected_background_color">#3C71B3</color>
<color name="unselected_background_color">#FFFFFF</color>
<color name="shadow_background_color">#2D69B5</color>
<color name="unselected_header_background_color">#FFFFFF</color>
<color name="unselected_text_color">#000000</color>
<color name="selected_text_color">#000000</color>
<color name="separator_color">#000000</color>
<color name="just_cuz">#44E372</color>
<color name="popup_menu_item_text_color">#000000</color>
<color name="myBlueColor">#286FAE</color>
</resources>

View File

@@ -0,0 +1,12 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="nav_header_vertical_spacing">8dp</dimen>
<dimen name="nav_header_height">176dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="table_view_cell_height">28dp</dimen>
<dimen name="table_view_row_header_width">28dp</dimen>
<dimen name="table_view_default_text_size">11sp</dimen>z
</resources>

View File

@@ -0,0 +1,5 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<item name="ic_menu_manage" type="drawable">@android:drawable/ic_menu_manage</item>
<item name="ic_menu_share" type="drawable">@android:drawable/ic_menu_share</item>
<item name="ic_menu_send" type="drawable">@android:drawable/ic_menu_send</item>
</resources>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="com_google_android_gms_fonts_certs">
<item>@array/com_google_android_gms_fonts_certs_dev</item>
<item>@array/com_google_android_gms_fonts_certs_prod</item>
</array>
<string-array name="com_google_android_gms_fonts_certs_dev">
<item>
MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAeFw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVyxW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8XW8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC69EH6kWr22ijx4OKXlSIx2xT1AsSHee70w5iDBiK4aph27yH3TxkXy9V89TDdexAcKk/cVHYNnDBapcavl7y0RiQ4biu8ymM8Ga/nmzhRKya6G0cGw8CAQOjgfwwgfkwHQYDVR0OBBYEFI0cxb6VTEM8YYY6FbBMvAPyT+CyMIHJBgNVHSMEgcEwgb6AFI0cxb6VTEM8YYY6FbBMvAPyT+CyoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJANWFuGx90071MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBABnTDPEF+3iSP0wNfdIjIz1AlnrPzgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXclaXjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05aIskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+aayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUWEv9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs=
</item>
</string-array>
<string-array name="com_google_android_gms_fonts_certs_prod">
<item>
MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtWLgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKkedxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjAsb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/CxURaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJEqO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/Tgt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/yzKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCEyj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1SKMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK
</item>
</string-array>
</resources>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="magicbtn" type="id" />
</resources>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="preloaded_fonts" translatable="false">
<item>@font/alice</item>
<item>@font/montserrat_bold</item>
</array>
</resources>

View File

@@ -0,0 +1,58 @@
<resources>
<string name="app_name">TrackCovid19</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
<string name="nav_header_title">Android Studio</string>
<string name="nav_header_subtitle">android.studio@android.com</string>
<string name="nav_header_desc">Navigation header</string>
<string name="action_settings">Settings</string>
<string name="menu_yourworld">World Data</string>
<string name="menu_yourcountry">Countries</string>
<string name="menu_yourstate">United States</string>
<string name="home_second">Home Second</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="sort_ascending">Sort Ascending</string>
<string name="sort_descending">Sort Descending</string>
<string name="clear_sorting">Clear</string>
<string name="row_show">Show 5. Row</string>
<string name="row_hide">Hide 5. Row</string>
<string name="trackcorona2020">TrackCorona2020</string>
<string name="joshpatra12_protonmail_com">joshpatra12@protonmail.com</string>
<string name="covid_19_worldwide_statistics">COVID-19 Worldwide Statistics</string>
<string name="world_data">World Data</string>
<string name="your_country">Countries</string>
<string name="your_state">United States</string>
<string name="active_cases">Active Cases</string>
<string name="recoveredName">Recovered</string>
<string name="total_deceased">Total Deceased</string>
<string name="affected_countries">Affected Countries</string>
<string name="your_real_country">Your Country</string>
<string name="menu_yourrealcountry">Your Country</string>
<string name="todo">TODO</string>
<string name="critical">Critical</string>
<string name="total_confirmed_cases">Total Confirmed Cases</string>
<string name="title_activity_settings">Settings</string>
<!-- Preference Titles -->
<string name="messages_header">Messages</string>
<string name="sync_header">Sync</string>
<!-- Messages Preferences -->
<string name="signature_title">Your signature</string>
<string name="reply_title">Default reply action</string>
<!-- Sync Preferences -->
<string name="sync_title">Sync email periodically</string>
<string name="attachment_title">Download incoming attachments</string>
<string name="attachment_summary_on">Automatically download attachments for incoming emails
</string>
<string name="attachment_summary_off">Only download attachments when manually requested</string>
<string name="item">Settings</string>
<string name="menu_yoursettings">Settings</string>
<string name="menu_refresh">Refresh</string>
<string name="send_feedback">Send Feedback</string>
</resources>

View File

@@ -0,0 +1,30 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">#272626</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@color/unselected_background_color</item>
<item name="android:popupMenuStyle">@style/PopupMenu</item>
<item name="android:itemTextAppearance">@style/itemTextStyle.AppTheme</item>
</style>
<style name="PopupMenu" parent="@android:style/Widget.PopupMenu">
<item name="android:popupBackground">@color/shadow_background_color</item>
</style>
<style name="itemTextStyle.AppTheme" parent="@android:style/TextAppearance.Widget.IconMenu.Item">
<item name="android:textColor">@drawable/color_item_popup</item>
<item name="android:textSize">11sp</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />z
</resources>

View File

@@ -0,0 +1,35 @@
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory app:title="@string/messages_header">
<EditTextPreference
app:key="signature"
app:title="@string/signature_title"
app:useSimpleSummaryProvider="true" />
<ListPreference
app:defaultValue="reply"
app:entries="@array/reply_entries"
app:entryValues="@array/reply_values"
app:key="reply"
app:title="@string/reply_title"
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
<PreferenceCategory app:title="@string/sync_header">
<SwitchPreferenceCompat
app:key="sync"
app:title="@string/sync_title" />
<SwitchPreferenceCompat
app:dependency="sync"
app:key="attachment"
app:summaryOff="@string/attachment_summary_off"
app:summaryOn="@string/attachment_summary_on"
app:title="@string/attachment_title" />
</PreferenceCategory>
</PreferenceScreen>

BIN
app/src/test/.DS_Store vendored Normal file

Binary file not shown.

BIN
app/src/test/java/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,17 @@
package com.josh.trackcovid19v2;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

47
build.gradle Executable file
View File

@@ -0,0 +1,47 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.evrencoskun.library:tableview:0.8.9'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext.support_version = "1.0.2"
ext.legacy_support_version = "1.0.0"
ext.arch_version = "1.1.1"
ext.room_version = "2.0.0"
ext.retrofit_version = "2.3.0"
ext.gson_version = "2.8.2"
ext.rxjava_version = "2.1.6"
ext.rxandroid_version="2.0.1"
ext.tableview_version="0.8.8"
ext.moneyview_version="1.1.0"
ext.junit_version = "4.12"
ext.support_test_version = "1.1.0"
ext.support_test_runner_version = "1.2.0"
ext.espresso_test_version = "3.2.0"

23
gradle.properties Executable file
View File

@@ -0,0 +1,23 @@
# 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
android.enableSeparateAnnotationProcessing=true
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureondemand=true

BIN
gradle/wrapper/gradle-wrapper.jar vendored Executable file

Binary file not shown.

6
gradle/wrapper/gradle-wrapper.properties vendored Executable file
View File

@@ -0,0 +1,6 @@
#Wed Mar 25 19:38:52 EDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

172
gradlew vendored Executable file
View File

@@ -0,0 +1,172 @@
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

84
gradlew.bat vendored Executable file
View File

@@ -0,0 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

8
local.properties Executable file
View File

@@ -0,0 +1,8 @@
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Sat Apr 25 19:51:47 EDT 2020
sdk.dir=/Users/admin/Library/Android/sdk

2
settings.gradle Executable file
View File

@@ -0,0 +1,2 @@
rootProject.name='TrackCovid19'
include ':app'