Skip to content

Commit

Permalink
Bug fixes and performance improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jainakshansh committed Jan 17, 2018
1 parent 4809b98 commit c2efae1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "me.akshanshjain.manage"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Binary file added app/release/Manage V1.1.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/release/output.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1},"path":"app-release.apk","properties":{"packageId":"me.akshanshjain.manage","split":"","minSdkVersion":"21"}}]
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":2},"path":"app-release.apk","properties":{"packageId":"me.akshanshjain.manage","split":"","minSdkVersion":"21"}}]
13 changes: 6 additions & 7 deletions app/src/main/java/me/akshanshjain/manage/LandingActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class LandingActivity extends AppCompatActivity implements LoaderManager.
private static final int PERMISSION_CALLBACK_CONSTANT = 9;
private static final int REQUEST_PERMISSION_SETTINGS = 7;
private String[] permissionsRequired = new String[]{
Manifest.permission.CAMERA,
//Manifest.permission.CAMERA,
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE
};
Expand Down Expand Up @@ -164,12 +164,11 @@ public void onClick(View v) {

private void permissionCodeLogic() {
if (ContextCompat.checkSelfPermission(LandingActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE)
+ ContextCompat.checkSelfPermission(LandingActivity.this, Manifest.permission.CAMERA)
+ ContextCompat.checkSelfPermission(LandingActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE)
!= PackageManager.PERMISSION_GRANTED) {
if (ActivityCompat.shouldShowRequestPermissionRationale(LandingActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE)
|| ActivityCompat.shouldShowRequestPermissionRationale(LandingActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE)
|| ActivityCompat.shouldShowRequestPermissionRationale(LandingActivity.this, Manifest.permission.CAMERA)) {
/*|| ActivityCompat.shouldShowRequestPermissionRationale(LandingActivity.this, Manifest.permission.CAMERA)*/) {
Snackbar.make(findViewById(android.R.id.content),
"Please Grant Permissions",
Snackbar.LENGTH_INDEFINITE).setAction("ENABLE",
Expand All @@ -178,7 +177,7 @@ private void permissionCodeLogic() {
public void onClick(View v) {
ActivityCompat.requestPermissions(LandingActivity.this,
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.CAMERA,
//Manifest.permission.CAMERA,
Manifest.permission.READ_EXTERNAL_STORAGE},
REQUEST_PERMISSIONS);
}
Expand All @@ -188,7 +187,7 @@ public void onClick(View v) {
ActivityCompat.requestPermissions(LandingActivity.this,
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.CAMERA},
/*Manifest.permission.CAMERA*/},
REQUEST_PERMISSIONS);
}
} else {
Expand Down Expand Up @@ -222,10 +221,10 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis
proceedAfterPermission();
} else if (ActivityCompat.shouldShowRequestPermissionRationale(LandingActivity.this, permissionsRequired[0])
|| ActivityCompat.shouldShowRequestPermissionRationale(LandingActivity.this, permissionsRequired[1])
|| ActivityCompat.shouldShowRequestPermissionRationale(LandingActivity.this, permissionsRequired[2])) {
/*|| ActivityCompat.shouldShowRequestPermissionRationale(LandingActivity.this, permissionsRequired[2])*/) {
AlertDialog.Builder builder = new AlertDialog.Builder(LandingActivity.this);
builder.setTitle("Need Multiple Permissions");
builder.setMessage("This app needs Camera and Storage Permissions.");
builder.setMessage("This app needs Storage Permissions.");
builder.setPositiveButton("Grant", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Expand Down

0 comments on commit c2efae1

Please sign in to comment.