mirror of
				https://github.com/SoPat712/TrackCovid19.git
				synced 2025-10-30 12:23:58 -04:00 
			
		
		
		
	| @@ -1,30 +0,0 @@ | ||||
| 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; | ||||
|     } | ||||
| } | ||||
|  | ||||
| @@ -4,7 +4,6 @@ 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; | ||||
|  | ||||
| @@ -88,6 +87,10 @@ 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; | ||||
| @@ -102,44 +105,17 @@ 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); | ||||
|                         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.setType("message/rfc822"); | ||||
|                         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 ⬇")); | ||||
|                         startActivity(Intent.createChooser(email, "Choose an app to send the email with")); | ||||
|                         dialog.dismiss(); | ||||
|  | ||||
|                     } | ||||
|                 }); | ||||
|  | ||||
| @@ -159,7 +135,6 @@ 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,5 +0,0 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> | ||||
|     <solid android:color="#794A4949"/> | ||||
|     <corners android:radius="64dp"/> | ||||
| </shape> | ||||
| @@ -1,5 +0,0 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> | ||||
|     <solid android:color="#79DFCFCF"/> | ||||
|     <corners android:radius="64dp"/> | ||||
| </shape> | ||||
| @@ -31,9 +31,8 @@ | ||||
|  | ||||
|     <Button | ||||
|         android:id="@+id/magicbtn" | ||||
|         android:layout_width="192dp" | ||||
|         android:layout_height="44dp" | ||||
|         android:background="@drawable/btn_rounded" | ||||
|         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" | ||||
|   | ||||
| @@ -57,7 +57,6 @@ | ||||
|         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" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user