mirror of
https://github.com/SoPat712/TrackCovid19.git
synced 2025-08-22 02:38:45 -04:00
Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
21f9caf4a0 | |||
7dee5e4d9d | |||
d7efe2315f | |||
29363e4669 | |||
7ae426429a | |||
a937032b52 | |||
a813eae57c | |||
b79607a31f | |||
47cc3da7dd | |||
36d94bad94 | |||
c141340b29 | |||
92f329841a | |||
9575e10f22 | |||
1e9f512afc | |||
cee2747a97 | |||
80ce3b8106 | |||
a51fe4092d | |||
4a11aeb7fe | |||
d413538daa | |||
4889a52cac | |||
6c1d03f314 | |||
ba5127ecc8 | |||
5a256d94e0 | |||
472a441dbd | |||
1338ca9965 |
39
.gitignore
vendored
Normal file
39
.gitignore
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
# Created by https://www.gitignore.io/api/java,gradle
|
||||
|
||||
### Java ###
|
||||
*.class
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
|
||||
### Gradle ###
|
||||
.gradle
|
||||
/build/
|
||||
|
||||
# Ignore Gradle GUI config
|
||||
gradle-app.setting
|
||||
|
||||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
|
||||
!gradle-wrapper.jar
|
||||
|
||||
# Cache of project
|
||||
.gradletasknamecache
|
||||
|
||||
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
|
||||
# gradle/wrapper/gradle-wrapper.properties
|
||||
|
||||
# End of https://www.gitignore.io/api/java,gradle
|
||||
.gradle/5.6.4/executionHistory/executionHistory.lock
|
||||
.gradle/5.6.4/executionHistory/executionHistory.bin
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
1
.idea/markdown-navigator.xml
generated
1
.idea/markdown-navigator.xml
generated
@@ -30,6 +30,7 @@
|
||||
<option name="COMMONMARK_LISTS" value="true" />
|
||||
<option name="EMOJI_SHORTCUTS" value="true" />
|
||||
<option name="GFM_TABLE_RENDERING" value="true" />
|
||||
<option name="JEKYLL_FRONT_MATTER" value="true" />
|
||||
<option name="PRODUCTION_SPEC_PARSER" value="true" />
|
||||
<option name="SIM_TOC_BLANK_LINE_SPACER" value="true" />
|
||||
</ParserOptions>
|
||||
|
@@ -5,14 +5,14 @@ If it is needed, feel free to submit an issue on this Github page, and the issue
|
||||
|
||||
# Downloading the app onto your own (Android)phone
|
||||
|
||||
In order to download the app on your own, you will need to navigate to my release apk download page, [which I will link here](https://github.com/souravp712/TrackCovid19/releases/download/v1.2/TrackCovid19.apk), or you can wait for the approval of the app to the Google Play Store.
|
||||
In order to download the app on your own, you will need to navigate to my release apk download page, [which I will link here](https://github.com/souravp712/TrackCovid19/releases/download/v1.3/TrackCovid19.apk), or you can wait for the approval of the app to the Google Play Store.
|
||||
|
||||
You may need to accept some permissions in order for the app to be installed. Then click install, and the app will be installed onto your own Android device for your own usages.
|
||||
|
||||
# Editing the app on your own
|
||||
|
||||
Code Rating: 
|
||||
Gradle check: 
|
||||
Gradle check: 
|
||||
|
||||
In a terminal on MacOS or Linux, run ```git clone https://github.com/souravp712/TrackCovid19``` if you have git installed and then open the folder in Android Studio or another similar code editor, or [go to this link for an easier download process on any OS.](https://github.com/souravp712/TrackCovid19/archive/master.zip)
|
||||
|
||||
|
BIN
app/.DS_Store
vendored
BIN
app/.DS_Store
vendored
Binary file not shown.
@@ -30,15 +30,15 @@
|
||||
<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/ap_generated_sources/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/ap_generated_sources/debugAndroidTest/out" 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/source/buildConfig/androidTest/debug" 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" />
|
||||
|
30
app/src/main/java/com/josh/trackcovid19v2/LogsUtil.java
Normal file
30
app/src/main/java/com/josh/trackcovid19v2/LogsUtil.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.josh.trackcovid19v2;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
/**
|
||||
* This class will provide utility to read logs.
|
||||
*
|
||||
* @author Chintan Rathod (http://chintanrathod.com)
|
||||
*/
|
||||
public class LogsUtil {
|
||||
|
||||
public static StringBuilder readLogs() {
|
||||
StringBuilder logBuilder = new StringBuilder();
|
||||
try {
|
||||
Process process = Runtime.getRuntime().exec("logcat -d");
|
||||
BufferedReader bufferedReader = new BufferedReader(
|
||||
new InputStreamReader(process.getInputStream()));
|
||||
|
||||
String line;
|
||||
while ((line = bufferedReader.readLine()) != null) {
|
||||
logBuilder.append(line + "\n");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
}
|
||||
return logBuilder;
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,11 @@
|
||||
package com.josh.trackcovid19v2;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
@@ -24,6 +28,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
hideKeyboardFrom(this);
|
||||
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
|
||||
@@ -38,6 +43,16 @@ public class MainActivity extends AppCompatActivity {
|
||||
|
||||
Toast.makeText(getApplicationContext(), "Data Imported Successfully",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
public static void hideKeyboardFrom(Activity activity) {
|
||||
InputMethodManager imm = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
|
||||
//Find the currently focused view, so we can grab the correct window token from it.
|
||||
View view = activity.getCurrentFocus();
|
||||
//If no view currently has focus, create a new one, just so we can grab a window token from it
|
||||
if (view == null) {
|
||||
view = new View(activity);
|
||||
}
|
||||
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
|
@@ -4,6 +4,7 @@ import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -79,6 +80,10 @@ public class SendFeedbackFragment extends Fragment {
|
||||
sendE.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(android.view.View v) {
|
||||
message.setCursorVisible(false);
|
||||
message.clearFocus();
|
||||
subject.setCursorVisible(false);
|
||||
subject.clearFocus();
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
|
||||
builder.setTitle("Data");
|
||||
@@ -87,10 +92,6 @@ public class SendFeedbackFragment extends Fragment {
|
||||
builder.setPositiveButton("YES", new DialogInterface.OnClickListener() {
|
||||
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
String toS = "joshpatra12@protonmail.com";
|
||||
String subS = subject.getText().toString();
|
||||
String mesS = message.getText().toString();
|
||||
String system = System.getProperty("os.version");
|
||||
Integer API = Build.VERSION.SDK_INT;
|
||||
String device = Build.DEVICE;
|
||||
@@ -105,17 +106,44 @@ public class SendFeedbackFragment extends Fragment {
|
||||
.getMetrics(displayMetrics);
|
||||
int height = displayMetrics.heightPixels + getNavigationBarHeight();
|
||||
int width = displayMetrics.widthPixels;
|
||||
String toS = "joshpatra12@protonmail.com";
|
||||
String subS = subject.getText().toString();
|
||||
String mesS = message.getText().toString() + "\n\n\n\n\n\n" + "\nAPI: " + API + "\nDevice: "
|
||||
+ device + "\nModel: "+ model +"\nType:" + type +"\nUser:" + user +
|
||||
"\nDisplay height: " + height + "\nDisplay width: " + width;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Intent emailIntent = new Intent(Intent.ACTION_SENDTO);
|
||||
emailIntent.putExtra(Intent.EXTRA_EMAIL, toS);
|
||||
emailIntent.putExtra(Intent.EXTRA_SUBJECT, subS);
|
||||
emailIntent.putExtra(Intent.EXTRA_TEXT, mesS + "\n\n\n\n\n\n" + "\nAPI: " + API + "\nDevice: "
|
||||
+ device + "\nModel: " + model + "\nType:" + type + "\nUser:" + user +
|
||||
"\nDisplay height: " + height + "\nDisplay width: " + width);
|
||||
startActivity(Intent.createChooser(emailIntent, "Choose an app to sdend the email with ⬇️"));
|
||||
|
||||
*/
|
||||
/*
|
||||
Intent email = new Intent(Intent.ACTION_SEND);
|
||||
|
||||
email.putExtra(Intent.EXTRA_EMAIL , new String [] {toS});
|
||||
email.putExtra(Intent.EXTRA_SUBJECT , subS);
|
||||
email.putExtra(Intent.EXTRA_TEXT , mesS + "\n\n\n\n\n\n" + "\nAPI: " + API + "\nDevice: "
|
||||
+ device + "\nModel: "+ model +"\nType:" + type +"\nUser:" + user +
|
||||
"\nDisplay height: " + height + "\nDisplay width: " + width);
|
||||
|
||||
email.putExtra(Intent.EXTRA_SUBJECT , subS);
|
||||
email.putExtra(Intent.EXTRA_TEXT , mesS);
|
||||
email.setType("message/rfc822");
|
||||
startActivity(Intent.createChooser(email, "Choose an app to send the email with"));
|
||||
startActivity(Intent.createChooser(email, "Choose an app to send the email with ⬇"));
|
||||
*
|
||||
|
||||
*/
|
||||
Intent intent = new Intent(Intent.ACTION_SENDTO);
|
||||
intent.setData(Uri.parse("mailto:")); // only email apps should handle this
|
||||
intent.putExtra(Intent.EXTRA_EMAIL, new String [] {toS});
|
||||
intent.putExtra(Intent.EXTRA_SUBJECT, subS);
|
||||
intent.putExtra(Intent.EXTRA_TEXT, mesS);
|
||||
startActivity(Intent.createChooser(intent, "Choose an app to send the email with ⬇"));
|
||||
dialog.dismiss();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -135,6 +163,7 @@ public class SendFeedbackFragment extends Fragment {
|
||||
});
|
||||
return view;
|
||||
}
|
||||
|
||||
private int getNavigationBarHeight() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.josh.trackcovid19v2.ui.yourworld;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ClipDrawable;
|
||||
import android.os.Build;
|
||||
@@ -14,6 +15,7 @@ import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -42,6 +44,7 @@ public class YourworldFragment extends Fragment {
|
||||
ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
View view = inflater.inflate(R.layout.fragment_yourworld, container, false);
|
||||
hideKeyboardFrom(getActivity());
|
||||
SwipeRefreshLayout mSwipeRefreshLayout = view.findViewById(R.id.swiperefresh);
|
||||
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
@@ -196,8 +199,16 @@ public class YourworldFragment extends Fragment {
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
public static void hideKeyboardFrom(Activity activity) {
|
||||
InputMethodManager imm = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
|
||||
//Find the currently focused view, so we can grab the correct window token from it.
|
||||
View view = activity.getCurrentFocus();
|
||||
//If no view currently has focus, create a new one, just so we can grab a window token from it
|
||||
if (view == null) {
|
||||
view = new View(activity);
|
||||
}
|
||||
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||
}
|
||||
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.
|
||||
|
5
app/src/main/res/drawable-mdpi/btn_rounded_darker.xml
Normal file
5
app/src/main/res/drawable-mdpi/btn_rounded_darker.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="#B4B4B4"/>
|
||||
<corners android:radius="128dp"/>
|
||||
</shape>
|
5
app/src/main/res/drawable/btn_rounded.xml
Normal file
5
app/src/main/res/drawable/btn_rounded.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="#A3A3A3"/>
|
||||
<corners android:radius="128dp"/>
|
||||
</shape>
|
@@ -31,8 +31,9 @@
|
||||
|
||||
<Button
|
||||
android:id="@+id/magicbtn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="192dp"
|
||||
android:layout_height="44dp"
|
||||
android:background="@drawable/btn_rounded"
|
||||
android:text="I Understand"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/imageView3"
|
||||
app:layout_constraintEnd_toStartOf="@+id/imageView3"
|
||||
|
@@ -11,8 +11,9 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:gravity="center"
|
||||
android:inputType="textEmailAddress"
|
||||
android:text="joshpatra12@protonmail.com"
|
||||
android:text="To: joshpatra12@protonmail.com"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
@@ -27,6 +28,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:hint="Enter a subject for the email here"
|
||||
android:gravity="center"
|
||||
android:maxLength="30"
|
||||
android:inputType="textPersonName"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -41,9 +44,10 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:gravity="start|top"
|
||||
android:gravity="center"
|
||||
android:hint="Please highlight what the bug was."
|
||||
android:inputType="textMultiLine"
|
||||
android:maxLength="429"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
@@ -57,6 +61,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Send"
|
||||
android:background="@drawable/btn_rounded_darker"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
|
@@ -263,7 +263,7 @@
|
||||
android:textSize="20dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/text_totalCases"
|
||||
app:layout_constraintEnd_toEndOf="@+id/text_totalCases"
|
||||
app:layout_constraintHorizontal_bias="0.2"
|
||||
app:layout_constraintHorizontal_bias="0.1"
|
||||
app:layout_constraintStart_toStartOf="@+id/text_totalCases"
|
||||
app:layout_constraintTop_toTopOf="@+id/text_totalCases"
|
||||
app:layout_constraintVertical_bias="0.115" />
|
||||
|
@@ -210,7 +210,7 @@
|
||||
android:textSize="20dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/text_totalCases"
|
||||
app:layout_constraintEnd_toEndOf="@+id/text_totalCases"
|
||||
app:layout_constraintHorizontal_bias="0.2"
|
||||
app:layout_constraintHorizontal_bias="0.1"
|
||||
app:layout_constraintStart_toStartOf="@+id/text_totalCases"
|
||||
app:layout_constraintTop_toTopOf="@+id/text_totalCases"
|
||||
app:layout_constraintVertical_bias="0.115" />
|
||||
|
Reference in New Issue
Block a user