From 5b42a09f7970d612ed25b5b057156832f745e663 Mon Sep 17 00:00:00 2001 From: Arafaat Ahmad Qureshi Date: Sun, 3 Apr 2022 22:30:15 +0500 Subject: [PATCH 1/2] version 1 - apr,3,2022 some functionalities disabled to lauch first version --- app/src/main/AndroidManifest.xml | 6 +- .../vacationdays/SettingsActivity.java | 424 +++++++++--------- 2 files changed, 212 insertions(+), 218 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index da9b529..72232a1 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,9 +2,9 @@ - - - + + + restoreData=new ArrayList<>(); - - int k=Helper.data.size(); - int counter; - if(k==0){ - counter=1; - } - else{ - counter=Helper.data.size(); - } - for(int i=0;i restoreData=new ArrayList<>(); +// +// int k=Helper.data.size(); +// int counter; +// if(k==0){ +// counter=1; +// } +// else{ +// counter=Helper.data.size(); +// } +// for(int i=0;i 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { - //permission granted - exportCSV(); - } else { - //permission denied - takePermission(); - Toast.makeText(this, "Storage permission required...", Toast.LENGTH_LONG).show(); - } - break; - } - case STORAGE_REQUEST_CODE_IMPORT: { - if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { - //permission granted - importCSV(); - } else { - //permission denied - Toast.makeText(this, "Storage permission required...", Toast.LENGTH_LONG).show(); - } - break; - } - - } - } - - private void takePermission() { - if(Build.VERSION.SDK_INT==Build.VERSION_CODES.R){ - Log.d("IntakePer","hello"); - try{ - Intent intent=new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION); - intent.addCategory("android.intent.category.DEFAULT"); - intent.setData(Uri.parse(String.format("package:%s",getApplicationContext().getPackageName()))); - startActivityForResult(intent,2000); - } catch (Exception e) { - Intent obj=new Intent(); - obj.setAction(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION); - startActivityForResult(obj,2000); - -// e.printStackTrace(); - } - } - else{ - Log.d("IntakePerelse","hello"); - - ActivityCompat.requestPermissions(SettingsActivity.this,new String[]{ - WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE},101); - } + Toast.makeText(this, "This functionality will be available in next version", Toast.LENGTH_SHORT).show(); + +// String text="Bismillah di barkat"; +//// savefile(file_name,text); +// if(checkStoragePermission()){ +// importCSV(); +// +// } +// else{ +// requestStoragePermissionImport(); +// } +// +// } +// +// +// @Override +// public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { +// //handle permission result +// super.onRequestPermissionsResult(requestCode, permissions, grantResults); +// switch (requestCode) { +// case STORAGE_REQUEST_CODE_EXPORT: { +// if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { +// //permission granted +// exportCSV(); +// } else { +// //permission denied +// takePermission(); +// Toast.makeText(this, "Storage permission required...", Toast.LENGTH_LONG).show(); +// } +// break; +// } +// case STORAGE_REQUEST_CODE_IMPORT: { +// if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { +// //permission granted +// importCSV(); +// } else { +// //permission denied +// Toast.makeText(this, "Storage permission required...", Toast.LENGTH_LONG).show(); +// } +// break; +// } +// +// } +// } +// +// private void takePermission() { +// if(Build.VERSION.SDK_INT==Build.VERSION_CODES.R){ +// Log.d("IntakePer","hello"); +// try{ +// Intent intent=new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION); +// intent.addCategory("android.intent.category.DEFAULT"); +// intent.setData(Uri.parse(String.format("package:%s",getApplicationContext().getPackageName()))); +// startActivityForResult(intent,2000); +// } catch (Exception e) { +// Intent obj=new Intent(); +// obj.setAction(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION); +// startActivityForResult(obj,2000); +// +//// e.printStackTrace(); +// } +// } +// else{ +// Log.d("IntakePerelse","hello"); +// +// ActivityCompat.requestPermissions(SettingsActivity.this,new String[]{ +// WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE},101); +// } +// } } \ No newline at end of file From 102b8267eaacfa13aba9e62e8b2d77daf7bdc8f2 Mon Sep 17 00:00:00 2001 From: CrazyMarvin Date: Mon, 4 Apr 2022 00:59:56 +0200 Subject: [PATCH 2/2] Vacation Days v4.0 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5b4a1dd..4cfb6de 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "rocks.poopjournal.vacationdays" minSdkVersion 21 targetSdkVersion 31 - versionCode 3 - versionName "3.0" + versionCode 4 + versionName "4.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" }