From df0cfc561af4e91bc210214b083a33ed5f6f86d3 Mon Sep 17 00:00:00 2001 From: Robert Montefusco Date: Mon, 19 Sep 2016 01:53:39 -0500 Subject: [PATCH] Cleaned up a few tiny things, changed the support email, and added a texture to the about page --- app/build.gradle | 2 +- .../java/cs371m/chromavision/MainMenuActivity.java | 12 ++++++------ .../java/cs371m/chromavision/ResultActivity.java | 11 ++++++++++- app/src/main/res/layout/activity_about.xml | 5 +++-- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index db85b8a..6d63863 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,7 +13,7 @@ android { } buildTypes { release { - minifyEnabled false + minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } diff --git a/app/src/main/java/cs371m/chromavision/MainMenuActivity.java b/app/src/main/java/cs371m/chromavision/MainMenuActivity.java index 6c4c339..1ad2ca2 100644 --- a/app/src/main/java/cs371m/chromavision/MainMenuActivity.java +++ b/app/src/main/java/cs371m/chromavision/MainMenuActivity.java @@ -369,12 +369,12 @@ private Bitmap resizeImageToScreen(Bitmap scale) { double screenWidth = dm.widthPixels; double screenHeight = dm.heightPixels; - if (screenWidth >= 1440) { - screenWidth = 1080; - double bigScreenScale = screenHeight / screenWidth; - screenHeight = bigScreenScale * 1080; - screenWidth = 1080; - } +// // Enables strict scaling of images +// if (screenWidth >= 720) { +// screenWidth = 720; +// double bigScreenScale = screenHeight / screenWidth; +// screenHeight = bigScreenScale * 720; +// } int width = scale.getWidth(); int height = scale.getHeight(); diff --git a/app/src/main/java/cs371m/chromavision/ResultActivity.java b/app/src/main/java/cs371m/chromavision/ResultActivity.java index 8833749..51429e3 100644 --- a/app/src/main/java/cs371m/chromavision/ResultActivity.java +++ b/app/src/main/java/cs371m/chromavision/ResultActivity.java @@ -149,10 +149,19 @@ public boolean onTouch(View view, MotionEvent motionEvent){ mImageView.setImageURI(pictureUri); } + InputStream cameraInput = null; + try { + cameraInput = getContentResolver().openInputStream(pictureUri); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + Bitmap scale = BitmapFactory.decodeStream(cameraInput); + + System.out.println(scale.getWidth() + " " + scale.getHeight()); + mTextView = (TextView)findViewById(R.id.colorDataView); mRunPicture = new GenerateColorDataAsync(); - // generateColorData(picture); mRunPicture.execute(pictureUri); } diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 701949f..f5e134c 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -2,7 +2,8 @@ + android:layout_height="match_parent" + android:background="@drawable/grey_squares_repeating" >