diff --git a/.DS_Store b/.DS_Store index d33de4e..9f14535 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/APK/.DS_Store b/APK/.DS_Store index 83d0cf9..06b3c26 100644 Binary files a/APK/.DS_Store and b/APK/.DS_Store differ diff --git a/R6S/app/build.gradle b/R6S/app/build.gradle index b129577..01a7353 100644 --- a/R6S/app/build.gradle +++ b/R6S/app/build.gradle @@ -9,14 +9,15 @@ android { keyPassword "Ek09iG2aB_XMlMe3kQ4mynrnPLi!PXkC" } } - compileSdkVersion 24 - buildToolsVersion "24.0.1" + compileSdkVersion 25 + buildToolsVersion "25.0.0" defaultConfig { applicationId "io.nicco.r6s" minSdkVersion 19 - targetSdkVersion 24 - versionCode 8 - versionName '1.2' + targetSdkVersion 25 + versionCode 13 + versionName '1.4' + signingConfig signingConfigs.release } buildTypes { release { diff --git a/R6S/app/src/main/assets/Maps/Chalet/1 (1).jpg b/R6S/app/src/main/assets/Maps/Chalet/1 (1).jpg deleted file mode 100644 index 4c9f538..0000000 Binary files a/R6S/app/src/main/assets/Maps/Chalet/1 (1).jpg and /dev/null differ diff --git a/R6S/app/src/main/assets/Maps/Favela/0.jpg b/R6S/app/src/main/assets/Maps/Favela/0.jpg index 31d0742..ecd3e80 100644 Binary files a/R6S/app/src/main/assets/Maps/Favela/0.jpg and b/R6S/app/src/main/assets/Maps/Favela/0.jpg differ diff --git a/R6S/app/src/main/assets/Maps/Favela/1.jpg b/R6S/app/src/main/assets/Maps/Favela/1.jpg new file mode 100644 index 0000000..a2ff1c4 Binary files /dev/null and b/R6S/app/src/main/assets/Maps/Favela/1.jpg differ diff --git a/R6S/app/src/main/assets/Maps/Favela/2.jpg b/R6S/app/src/main/assets/Maps/Favela/2.jpg new file mode 100644 index 0000000..9a2104e Binary files /dev/null and b/R6S/app/src/main/assets/Maps/Favela/2.jpg differ diff --git a/R6S/app/src/main/assets/Maps/Favela/3.jpg b/R6S/app/src/main/assets/Maps/Favela/3.jpg new file mode 100644 index 0000000..fc96584 Binary files /dev/null and b/R6S/app/src/main/assets/Maps/Favela/3.jpg differ diff --git a/R6S/app/src/main/assets/Maps/House/1 (1).jpg b/R6S/app/src/main/assets/Maps/House/1 (1).jpg deleted file mode 100644 index added60..0000000 Binary files a/R6S/app/src/main/assets/Maps/House/1 (1).jpg and /dev/null differ diff --git a/R6S/app/src/main/assets/Maps/Skyscraper/0.jpg b/R6S/app/src/main/assets/Maps/Skyscraper/0.jpg new file mode 100644 index 0000000..ff409ca Binary files /dev/null and b/R6S/app/src/main/assets/Maps/Skyscraper/0.jpg differ diff --git a/R6S/app/src/main/assets/Maps/Skyscraper/1.jpg b/R6S/app/src/main/assets/Maps/Skyscraper/1.jpg new file mode 100644 index 0000000..e0347c3 Binary files /dev/null and b/R6S/app/src/main/assets/Maps/Skyscraper/1.jpg differ diff --git a/R6S/app/src/main/assets/Maps/Skyscraper/2.jpg b/R6S/app/src/main/assets/Maps/Skyscraper/2.jpg new file mode 100644 index 0000000..96931cb Binary files /dev/null and b/R6S/app/src/main/assets/Maps/Skyscraper/2.jpg differ diff --git a/R6S/app/src/main/assets/Maps/Skyscraper/3.jpg b/R6S/app/src/main/assets/Maps/Skyscraper/3.jpg new file mode 100644 index 0000000..b0217b1 Binary files /dev/null and b/R6S/app/src/main/assets/Maps/Skyscraper/3.jpg differ diff --git a/R6S/app/src/main/assets/Maps/Yacht/0 (1).jpg b/R6S/app/src/main/assets/Maps/Yacht/0 (1).jpg deleted file mode 100644 index e81960d..0000000 Binary files a/R6S/app/src/main/assets/Maps/Yacht/0 (1).jpg and /dev/null differ diff --git a/R6S/app/src/main/assets/Maps/Yacht/1 (1).jpg b/R6S/app/src/main/assets/Maps/Yacht/1 (1).jpg deleted file mode 100644 index 39d25b5..0000000 Binary files a/R6S/app/src/main/assets/Maps/Yacht/1 (1).jpg and /dev/null differ diff --git a/R6S/app/src/main/assets/OPs/0.jpg b/R6S/app/src/main/assets/OPs/0.jpg new file mode 100644 index 0000000..96d847a Binary files /dev/null and b/R6S/app/src/main/assets/OPs/0.jpg differ diff --git a/R6S/app/src/main/assets/OPs/1.jpg b/R6S/app/src/main/assets/OPs/1.jpg index 173d9d7..2be7fa6 100644 Binary files a/R6S/app/src/main/assets/OPs/1.jpg and b/R6S/app/src/main/assets/OPs/1.jpg differ diff --git a/R6S/app/src/main/assets/OPs/10.jpg b/R6S/app/src/main/assets/OPs/10.jpg index c8a1036..3e112d8 100644 Binary files a/R6S/app/src/main/assets/OPs/10.jpg and b/R6S/app/src/main/assets/OPs/10.jpg differ diff --git a/R6S/app/src/main/assets/OPs/11.jpg b/R6S/app/src/main/assets/OPs/11.jpg index 6b43d2c..8d120b5 100644 Binary files a/R6S/app/src/main/assets/OPs/11.jpg and b/R6S/app/src/main/assets/OPs/11.jpg differ diff --git a/R6S/app/src/main/assets/OPs/12.jpg b/R6S/app/src/main/assets/OPs/12.jpg index 80271a7..ae0d755 100644 Binary files a/R6S/app/src/main/assets/OPs/12.jpg and b/R6S/app/src/main/assets/OPs/12.jpg differ diff --git a/R6S/app/src/main/assets/OPs/13.jpg b/R6S/app/src/main/assets/OPs/13.jpg index 643f2d8..648ba26 100644 Binary files a/R6S/app/src/main/assets/OPs/13.jpg and b/R6S/app/src/main/assets/OPs/13.jpg differ diff --git a/R6S/app/src/main/assets/OPs/14.jpg b/R6S/app/src/main/assets/OPs/14.jpg index 68e7d83..6523ec7 100644 Binary files a/R6S/app/src/main/assets/OPs/14.jpg and b/R6S/app/src/main/assets/OPs/14.jpg differ diff --git a/R6S/app/src/main/assets/OPs/15.jpg b/R6S/app/src/main/assets/OPs/15.jpg index 352472c..89c671e 100644 Binary files a/R6S/app/src/main/assets/OPs/15.jpg and b/R6S/app/src/main/assets/OPs/15.jpg differ diff --git a/R6S/app/src/main/assets/OPs/16.jpg b/R6S/app/src/main/assets/OPs/16.jpg index 37ca127..8a3a3c2 100644 Binary files a/R6S/app/src/main/assets/OPs/16.jpg and b/R6S/app/src/main/assets/OPs/16.jpg differ diff --git a/R6S/app/src/main/assets/OPs/17.jpg b/R6S/app/src/main/assets/OPs/17.jpg index 6523ec7..29bbd96 100644 Binary files a/R6S/app/src/main/assets/OPs/17.jpg and b/R6S/app/src/main/assets/OPs/17.jpg differ diff --git a/R6S/app/src/main/assets/OPs/18.jpg b/R6S/app/src/main/assets/OPs/18.jpg index 8a3a3c2..d1ca8cd 100644 Binary files a/R6S/app/src/main/assets/OPs/18.jpg and b/R6S/app/src/main/assets/OPs/18.jpg differ diff --git a/R6S/app/src/main/assets/OPs/19.jpg b/R6S/app/src/main/assets/OPs/19.jpg index d1ca8cd..352472c 100644 Binary files a/R6S/app/src/main/assets/OPs/19.jpg and b/R6S/app/src/main/assets/OPs/19.jpg differ diff --git a/R6S/app/src/main/assets/OPs/2.jpg b/R6S/app/src/main/assets/OPs/2.jpg index 6f7fb48..173d9d7 100644 Binary files a/R6S/app/src/main/assets/OPs/2.jpg and b/R6S/app/src/main/assets/OPs/2.jpg differ diff --git a/R6S/app/src/main/assets/OPs/20.jpg b/R6S/app/src/main/assets/OPs/20.jpg index 96d847a..c6cd49f 100644 Binary files a/R6S/app/src/main/assets/OPs/20.jpg and b/R6S/app/src/main/assets/OPs/20.jpg differ diff --git a/R6S/app/src/main/assets/OPs/21.jpg b/R6S/app/src/main/assets/OPs/21.jpg index 648ba26..68e7d83 100644 Binary files a/R6S/app/src/main/assets/OPs/21.jpg and b/R6S/app/src/main/assets/OPs/21.jpg differ diff --git a/R6S/app/src/main/assets/OPs/22.jpg b/R6S/app/src/main/assets/OPs/22.jpg index c6cd49f..6f7fb48 100644 Binary files a/R6S/app/src/main/assets/OPs/22.jpg and b/R6S/app/src/main/assets/OPs/22.jpg differ diff --git a/R6S/app/src/main/assets/OPs/23.jpg b/R6S/app/src/main/assets/OPs/23.jpg index 2be7fa6..c8a1036 100644 Binary files a/R6S/app/src/main/assets/OPs/23.jpg and b/R6S/app/src/main/assets/OPs/23.jpg differ diff --git a/R6S/app/src/main/assets/OPs/24.jpg b/R6S/app/src/main/assets/OPs/24.jpg index 42d96e3..771a67b 100644 Binary files a/R6S/app/src/main/assets/OPs/24.jpg and b/R6S/app/src/main/assets/OPs/24.jpg differ diff --git a/R6S/app/src/main/assets/OPs/25.jpg b/R6S/app/src/main/assets/OPs/25.jpg index e1a1551..d21ce98 100644 Binary files a/R6S/app/src/main/assets/OPs/25.jpg and b/R6S/app/src/main/assets/OPs/25.jpg differ diff --git a/R6S/app/src/main/assets/OPs/26.jpg b/R6S/app/src/main/assets/OPs/26.jpg index 771a67b..c34a06c 100644 Binary files a/R6S/app/src/main/assets/OPs/26.jpg and b/R6S/app/src/main/assets/OPs/26.jpg differ diff --git a/R6S/app/src/main/assets/OPs/27.jpg b/R6S/app/src/main/assets/OPs/27.jpg new file mode 100644 index 0000000..5ffcbbf Binary files /dev/null and b/R6S/app/src/main/assets/OPs/27.jpg differ diff --git a/R6S/app/src/main/assets/OPs/3.jpg b/R6S/app/src/main/assets/OPs/3.jpg index 8d120b5..42d96e3 100644 Binary files a/R6S/app/src/main/assets/OPs/3.jpg and b/R6S/app/src/main/assets/OPs/3.jpg differ diff --git a/R6S/app/src/main/assets/OPs/4.jpg b/R6S/app/src/main/assets/OPs/4.jpg index 522d417..e1a1551 100644 Binary files a/R6S/app/src/main/assets/OPs/4.jpg and b/R6S/app/src/main/assets/OPs/4.jpg differ diff --git a/R6S/app/src/main/assets/OPs/5.jpg b/R6S/app/src/main/assets/OPs/5.jpg index 3e112d8..37ca127 100644 Binary files a/R6S/app/src/main/assets/OPs/5.jpg and b/R6S/app/src/main/assets/OPs/5.jpg differ diff --git a/R6S/app/src/main/assets/OPs/6.jpg b/R6S/app/src/main/assets/OPs/6.jpg index ae0d755..80271a7 100644 Binary files a/R6S/app/src/main/assets/OPs/6.jpg and b/R6S/app/src/main/assets/OPs/6.jpg differ diff --git a/R6S/app/src/main/assets/OPs/7.jpg b/R6S/app/src/main/assets/OPs/7.jpg index 89c671e..6b43d2c 100644 Binary files a/R6S/app/src/main/assets/OPs/7.jpg and b/R6S/app/src/main/assets/OPs/7.jpg differ diff --git a/R6S/app/src/main/assets/OPs/8.jpg b/R6S/app/src/main/assets/OPs/8.jpg index d21ce98..522d417 100644 Binary files a/R6S/app/src/main/assets/OPs/8.jpg and b/R6S/app/src/main/assets/OPs/8.jpg differ diff --git a/R6S/app/src/main/assets/OPs/9.jpg b/R6S/app/src/main/assets/OPs/9.jpg index 29bbd96..643f2d8 100644 Binary files a/R6S/app/src/main/assets/OPs/9.jpg and b/R6S/app/src/main/assets/OPs/9.jpg differ diff --git a/R6S/app/src/main/assets/Operators/Attacker/Hibana.png b/R6S/app/src/main/assets/Operators/Attacker/Hibana.png new file mode 100644 index 0000000..fe8484d Binary files /dev/null and b/R6S/app/src/main/assets/Operators/Attacker/Hibana.png differ diff --git a/R6S/app/src/main/assets/Operators/Defender/Echo.png b/R6S/app/src/main/assets/Operators/Defender/Echo.png new file mode 100644 index 0000000..cd2b6ed Binary files /dev/null and b/R6S/app/src/main/assets/Operators/Defender/Echo.png differ diff --git a/R6S/app/src/main/assets/R6S.sqlite b/R6S/app/src/main/assets/R6S.sqlite index c3084be..8f87272 100644 Binary files a/R6S/app/src/main/assets/R6S.sqlite and b/R6S/app/src/main/assets/R6S.sqlite differ diff --git a/R6S/app/src/main/java/io/nicco/r6s/OpsListAdapter.java b/R6S/app/src/main/java/io/nicco/r6s/OpsListAdapter.java index c9ab01e..b3c9a57 100644 --- a/R6S/app/src/main/java/io/nicco/r6s/OpsListAdapter.java +++ b/R6S/app/src/main/java/io/nicco/r6s/OpsListAdapter.java @@ -1,5 +1,6 @@ package io.nicco.r6s; +import android.app.Activity; import android.app.Fragment; import android.content.Context; import android.graphics.drawable.Drawable; @@ -18,6 +19,8 @@ import java.util.List; public class OpsListAdapter extends RecyclerView.Adapter { + private Activity root; + public static class ViewHolder extends RecyclerView.ViewHolder { public TextView txt_n; @@ -37,8 +40,9 @@ public class OpsListAdapter extends RecyclerView.Adapter data; - public OpsListAdapter(List d) { + public OpsListAdapter(List d, Activity r) { data = d; + root = r; } @Override @@ -55,7 +59,7 @@ public class OpsListAdapter extends RecyclerView.Adapter maxTrans) + return -trans + maxTrans; + return 0; + } + + private float getFixDragTrans(float delta, float viewSize, float contentSize) { + if (contentSize <= viewSize) { + return 0; + } + return delta; + } + + private float getImageWidth() { + return matchViewWidth * normalizedScale; + } + + private float getImageHeight() { + return matchViewHeight * normalizedScale; + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + Drawable drawable = getDrawable(); + if (drawable == null || drawable.getIntrinsicWidth() == 0 || drawable.getIntrinsicHeight() == 0) { + setMeasuredDimension(0, 0); + return; + } + + int drawableWidth = drawable.getIntrinsicWidth(); + int drawableHeight = drawable.getIntrinsicHeight(); + int widthSize = MeasureSpec.getSize(widthMeasureSpec); + int widthMode = MeasureSpec.getMode(widthMeasureSpec); + int heightSize = MeasureSpec.getSize(heightMeasureSpec); + int heightMode = MeasureSpec.getMode(heightMeasureSpec); + viewWidth = setViewSize(widthMode, widthSize, drawableWidth); + viewHeight = setViewSize(heightMode, heightSize, drawableHeight); + + // + // Set view dimensions + // + setMeasuredDimension(viewWidth, viewHeight); + + // + // Fit content within view + // + fitImageToView(); + } + + /** + * If the normalizedScale is equal to 1, then the image is made to fit the screen. Otherwise, + * it is made to fit the screen according to the dimensions of the previous image matrix. This + * allows the image to maintain its zoom after rotation. + */ + private void fitImageToView() { + Drawable drawable = getDrawable(); + if (drawable == null || drawable.getIntrinsicWidth() == 0 || drawable.getIntrinsicHeight() == 0) { + return; + } + if (matrix == null || prevMatrix == null) { + return; + } + + int drawableWidth = drawable.getIntrinsicWidth(); + int drawableHeight = drawable.getIntrinsicHeight(); + + // + // Scale image for view + // + float scaleX = (float) viewWidth / drawableWidth; + float scaleY = (float) viewHeight / drawableHeight; + + switch (mScaleType) { + case CENTER: + scaleX = scaleY = 1; + break; + + case CENTER_CROP: + scaleX = scaleY = Math.max(scaleX, scaleY); + break; + + case CENTER_INSIDE: + scaleX = scaleY = Math.min(1, Math.min(scaleX, scaleY)); + + case FIT_CENTER: + scaleX = scaleY = Math.min(scaleX, scaleY); + break; + + case FIT_XY: + break; + + default: + // + // FIT_START and FIT_END not supported + // + throw new UnsupportedOperationException("TouchImageView does not support FIT_START or FIT_END"); + + } + + // + // Center the image + // + float redundantXSpace = viewWidth - (scaleX * drawableWidth); + float redundantYSpace = viewHeight - (scaleY * drawableHeight); + matchViewWidth = viewWidth - redundantXSpace; + matchViewHeight = viewHeight - redundantYSpace; + if (!isZoomed() && !imageRenderedAtLeastOnce) { + // + // Stretch and center image to fit view + // + matrix.setScale(scaleX, scaleY); + matrix.postTranslate(redundantXSpace / 2, redundantYSpace / 2); + normalizedScale = 1; + + } else { + // + // These values should never be 0 or we will set viewWidth and viewHeight + // to NaN in translateMatrixAfterRotate. To avoid this, call savePreviousImageValues + // to set them equal to the current values. + // + if (prevMatchViewWidth == 0 || prevMatchViewHeight == 0) { + savePreviousImageValues(); + } + + prevMatrix.getValues(m); + + // + // Rescale Matrix after rotation + // + m[Matrix.MSCALE_X] = matchViewWidth / drawableWidth * normalizedScale; + m[Matrix.MSCALE_Y] = matchViewHeight / drawableHeight * normalizedScale; + + // + // TransX and TransY from previous matrix + // + float transX = m[Matrix.MTRANS_X]; + float transY = m[Matrix.MTRANS_Y]; + + // + // Width + // + float prevActualWidth = prevMatchViewWidth * normalizedScale; + float actualWidth = getImageWidth(); + translateMatrixAfterRotate(Matrix.MTRANS_X, transX, prevActualWidth, actualWidth, prevViewWidth, viewWidth, drawableWidth); + + // + // Height + // + float prevActualHeight = prevMatchViewHeight * normalizedScale; + float actualHeight = getImageHeight(); + translateMatrixAfterRotate(Matrix.MTRANS_Y, transY, prevActualHeight, actualHeight, prevViewHeight, viewHeight, drawableHeight); + + // + // Set the matrix to the adjusted scale and translate values. + // + matrix.setValues(m); + } + fixTrans(); + setImageMatrix(matrix); + } + + /** + * Set view dimensions based on layout params + * + * @param mode + * @param size + * @param drawableWidth + * @return + */ + private int setViewSize(int mode, int size, int drawableWidth) { + int viewSize; + switch (mode) { + case MeasureSpec.EXACTLY: + viewSize = size; + break; + + case MeasureSpec.AT_MOST: + viewSize = Math.min(drawableWidth, size); + break; + + case MeasureSpec.UNSPECIFIED: + viewSize = drawableWidth; + break; + + default: + viewSize = size; + break; + } + return viewSize; + } + + /** + * After rotating, the matrix needs to be translated. This function finds the area of image + * which was previously centered and adjusts translations so that is again the center, post-rotation. + * + * @param axis Matrix.MTRANS_X or Matrix.MTRANS_Y + * @param trans the value of trans in that axis before the rotation + * @param prevImageSize the width/height of the image before the rotation + * @param imageSize width/height of the image after rotation + * @param prevViewSize width/height of view before rotation + * @param viewSize width/height of view after rotation + * @param drawableSize width/height of drawable + */ + private void translateMatrixAfterRotate(int axis, float trans, float prevImageSize, float imageSize, int prevViewSize, int viewSize, int drawableSize) { + if (imageSize < viewSize) { + // + // The width/height of image is less than the view's width/height. Center it. + // + m[axis] = (viewSize - (drawableSize * m[Matrix.MSCALE_X])) * 0.5f; + + } else if (trans > 0) { + // + // The image is larger than the view, but was not before rotation. Center it. + // + m[axis] = -((imageSize - viewSize) * 0.5f); + + } else { + // + // Find the area of the image which was previously centered in the view. Determine its distance + // from the left/top side of the view as a fraction of the entire image's width/height. Use that percentage + // to calculate the trans in the new view width/height. + // + float percentage = (Math.abs(trans) + (0.5f * prevViewSize)) / prevImageSize; + m[axis] = -((percentage * imageSize) - (viewSize * 0.5f)); + } + } + + private void setState(State state) { + this.state = state; + } + + public boolean canScrollHorizontallyFroyo(int direction) { + return canScrollHorizontally(direction); + } + + @Override + public boolean canScrollHorizontally(int direction) { + matrix.getValues(m); + float x = m[Matrix.MTRANS_X]; + + if (getImageWidth() < viewWidth) { + return false; + + } else if (x >= -1 && direction < 0) { + return false; + + } else if (Math.abs(x) + viewWidth + 1 >= getImageWidth() && direction > 0) { + return false; + } + + return true; + } + + /** + * Gesture Listener detects a single click or long click and passes that on + * to the view's listener. + * + * @author Ortiz + */ + private class GestureListener extends GestureDetector.SimpleOnGestureListener { + + @Override + public boolean onSingleTapConfirmed(MotionEvent e) { + if (doubleTapListener != null) { + return doubleTapListener.onSingleTapConfirmed(e); + } + return performClick(); + } + + @Override + public void onLongPress(MotionEvent e) { + performLongClick(); + } + + @Override + public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { + if (fling != null) { + // + // If a previous fling is still active, it should be cancelled so that two flings + // are not run simultaenously. + // + fling.cancelFling(); + } + fling = new Fling((int) velocityX, (int) velocityY); + compatPostOnAnimation(fling); + return super.onFling(e1, e2, velocityX, velocityY); + } + + @Override + public boolean onDoubleTap(MotionEvent e) { + boolean consumed = false; + if (doubleTapListener != null) { + consumed = doubleTapListener.onDoubleTap(e); + } + if (state == State.NONE) { + float targetZoom = (normalizedScale == minScale) ? maxScale : minScale; + DoubleTapZoom doubleTap = new DoubleTapZoom(targetZoom, e.getX(), e.getY(), false); + compatPostOnAnimation(doubleTap); + consumed = true; + } + return consumed; + } + + @Override + public boolean onDoubleTapEvent(MotionEvent e) { + if (doubleTapListener != null) { + return doubleTapListener.onDoubleTapEvent(e); + } + return false; + } + } + + public interface OnTouchImageViewListener { + public void onMove(); + } + + /** + * Responsible for all touch events. Handles the heavy lifting of drag and also sends + * touch events to Scale Detector and Gesture Detector. + * + * @author Ortiz + */ + private class PrivateOnTouchListener implements OnTouchListener { + + // + // Remember last point position for dragging + // + private PointF last = new PointF(); + + @Override + public boolean onTouch(View v, MotionEvent event) { + mScaleDetector.onTouchEvent(event); + mGestureDetector.onTouchEvent(event); + PointF curr = new PointF(event.getX(), event.getY()); + + if (state == State.NONE || state == State.DRAG || state == State.FLING) { + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + last.set(curr); + if (fling != null) + fling.cancelFling(); + setState(State.DRAG); + break; + + case MotionEvent.ACTION_MOVE: + if (state == State.DRAG) { + float deltaX = curr.x - last.x; + float deltaY = curr.y - last.y; + float fixTransX = getFixDragTrans(deltaX, viewWidth, getImageWidth()); + float fixTransY = getFixDragTrans(deltaY, viewHeight, getImageHeight()); + matrix.postTranslate(fixTransX, fixTransY); + fixTrans(); + last.set(curr.x, curr.y); + } + break; + + case MotionEvent.ACTION_UP: + case MotionEvent.ACTION_POINTER_UP: + setState(State.NONE); + break; + } + } + + setImageMatrix(matrix); + + // + // User-defined OnTouchListener + // + if (userTouchListener != null) { + userTouchListener.onTouch(v, event); + } + + // + // OnTouchImageViewListener is set: TouchImageView dragged by user. + // + if (touchImageViewListener != null) { + touchImageViewListener.onMove(); + } + + // + // indicate event was handled + // + return true; + } + } + + /** + * ScaleListener detects user two finger scaling and scales image. + * + * @author Ortiz + */ + private class ScaleListener extends ScaleGestureDetector.SimpleOnScaleGestureListener { + @Override + public boolean onScaleBegin(ScaleGestureDetector detector) { + setState(State.ZOOM); + return true; + } + + @Override + public boolean onScale(ScaleGestureDetector detector) { + scaleImage(detector.getScaleFactor(), detector.getFocusX(), detector.getFocusY(), true); + + // + // OnTouchImageViewListener is set: TouchImageView pinch zoomed by user. + // + if (touchImageViewListener != null) { + touchImageViewListener.onMove(); + } + return true; + } + + @Override + public void onScaleEnd(ScaleGestureDetector detector) { + super.onScaleEnd(detector); + setState(State.NONE); + boolean animateToZoomBoundary = false; + float targetZoom = normalizedScale; + if (normalizedScale > maxScale) { + targetZoom = maxScale; + animateToZoomBoundary = true; + + } else if (normalizedScale < minScale) { + targetZoom = minScale; + animateToZoomBoundary = true; + } + + if (animateToZoomBoundary) { + DoubleTapZoom doubleTap = new DoubleTapZoom(targetZoom, viewWidth / 2, viewHeight / 2, true); + compatPostOnAnimation(doubleTap); + } + } + } + + private void scaleImage(double deltaScale, float focusX, float focusY, boolean stretchImageToSuper) { + + float lowerScale, upperScale; + if (stretchImageToSuper) { + lowerScale = superMinScale; + upperScale = superMaxScale; + + } else { + lowerScale = minScale; + upperScale = maxScale; + } + + float origScale = normalizedScale; + normalizedScale *= deltaScale; + if (normalizedScale > upperScale) { + normalizedScale = upperScale; + deltaScale = upperScale / origScale; + } else if (normalizedScale < lowerScale) { + normalizedScale = lowerScale; + deltaScale = lowerScale / origScale; + } + + matrix.postScale((float) deltaScale, (float) deltaScale, focusX, focusY); + fixScaleTrans(); + } + + /** + * DoubleTapZoom calls a series of runnables which apply + * an animated zoom in/out graphic to the image. + * + * @author Ortiz + */ + private class DoubleTapZoom implements Runnable { + + private long startTime; + private static final float ZOOM_TIME = 500; + private float startZoom, targetZoom; + private float bitmapX, bitmapY; + private boolean stretchImageToSuper; + private AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator(); + private PointF startTouch; + private PointF endTouch; + + DoubleTapZoom(float targetZoom, float focusX, float focusY, boolean stretchImageToSuper) { + setState(State.ANIMATE_ZOOM); + startTime = System.currentTimeMillis(); + this.startZoom = normalizedScale; + this.targetZoom = targetZoom; + this.stretchImageToSuper = stretchImageToSuper; + PointF bitmapPoint = transformCoordTouchToBitmap(focusX, focusY, false); + this.bitmapX = bitmapPoint.x; + this.bitmapY = bitmapPoint.y; + + // + // Used for translating image during scaling + // + startTouch = transformCoordBitmapToTouch(bitmapX, bitmapY); + endTouch = new PointF(viewWidth / 2, viewHeight / 2); + } + + @Override + public void run() { + float t = interpolate(); + double deltaScale = calculateDeltaScale(t); + scaleImage(deltaScale, bitmapX, bitmapY, stretchImageToSuper); + translateImageToCenterTouchPosition(t); + fixScaleTrans(); + setImageMatrix(matrix); + + // + // OnTouchImageViewListener is set: double tap runnable updates listener + // with every frame. + // + if (touchImageViewListener != null) { + touchImageViewListener.onMove(); + } + + if (t < 1f) { + // + // We haven't finished zooming + // + compatPostOnAnimation(this); + + } else { + // + // Finished zooming + // + setState(State.NONE); + } + } + + /** + * Interpolate between where the image should start and end in order to translate + * the image so that the point that is touched is what ends up centered at the end + * of the zoom. + * + * @param t + */ + private void translateImageToCenterTouchPosition(float t) { + float targetX = startTouch.x + t * (endTouch.x - startTouch.x); + float targetY = startTouch.y + t * (endTouch.y - startTouch.y); + PointF curr = transformCoordBitmapToTouch(bitmapX, bitmapY); + matrix.postTranslate(targetX - curr.x, targetY - curr.y); + } + + /** + * Use interpolator to get t + * + * @return + */ + private float interpolate() { + long currTime = System.currentTimeMillis(); + float elapsed = (currTime - startTime) / ZOOM_TIME; + elapsed = Math.min(1f, elapsed); + return interpolator.getInterpolation(elapsed); + } + + /** + * Interpolate the current targeted zoom and get the delta + * from the current zoom. + * + * @param t + * @return + */ + private double calculateDeltaScale(float t) { + double zoom = startZoom + t * (targetZoom - startZoom); + return zoom / normalizedScale; + } + } + + /** + * This function will transform the coordinates in the touch event to the coordinate + * system of the drawable that the imageview contain + * + * @param x x-coordinate of touch event + * @param y y-coordinate of touch event + * @param clipToBitmap Touch event may occur within view, but outside image content. True, to clip return value + * to the bounds of the bitmap size. + * @return Coordinates of the point touched, in the coordinate system of the original drawable. + */ + private PointF transformCoordTouchToBitmap(float x, float y, boolean clipToBitmap) { + matrix.getValues(m); + float origW = getDrawable().getIntrinsicWidth(); + float origH = getDrawable().getIntrinsicHeight(); + float transX = m[Matrix.MTRANS_X]; + float transY = m[Matrix.MTRANS_Y]; + float finalX = ((x - transX) * origW) / getImageWidth(); + float finalY = ((y - transY) * origH) / getImageHeight(); + + if (clipToBitmap) { + finalX = Math.min(Math.max(finalX, 0), origW); + finalY = Math.min(Math.max(finalY, 0), origH); + } + + return new PointF(finalX, finalY); + } + + /** + * Inverse of transformCoordTouchToBitmap. This function will transform the coordinates in the + * drawable's coordinate system to the view's coordinate system. + * + * @param bx x-coordinate in original bitmap coordinate system + * @param by y-coordinate in original bitmap coordinate system + * @return Coordinates of the point in the view's coordinate system. + */ + private PointF transformCoordBitmapToTouch(float bx, float by) { + matrix.getValues(m); + float origW = getDrawable().getIntrinsicWidth(); + float origH = getDrawable().getIntrinsicHeight(); + float px = bx / origW; + float py = by / origH; + float finalX = m[Matrix.MTRANS_X] + getImageWidth() * px; + float finalY = m[Matrix.MTRANS_Y] + getImageHeight() * py; + return new PointF(finalX, finalY); + } + + /** + * Fling launches sequential runnables which apply + * the fling graphic to the image. The values for the translation + * are interpolated by the Scroller. + * + * @author Ortiz + */ + private class Fling implements Runnable { + + CompatScroller scroller; + int currX, currY; + + Fling(int velocityX, int velocityY) { + setState(State.FLING); + scroller = new CompatScroller(context); + matrix.getValues(m); + + int startX = (int) m[Matrix.MTRANS_X]; + int startY = (int) m[Matrix.MTRANS_Y]; + int minX, maxX, minY, maxY; + + if (getImageWidth() > viewWidth) { + minX = viewWidth - (int) getImageWidth(); + maxX = 0; + + } else { + minX = maxX = startX; + } + + if (getImageHeight() > viewHeight) { + minY = viewHeight - (int) getImageHeight(); + maxY = 0; + + } else { + minY = maxY = startY; + } + + scroller.fling(startX, startY, (int) velocityX, (int) velocityY, minX, + maxX, minY, maxY); + currX = startX; + currY = startY; + } + + public void cancelFling() { + if (scroller != null) { + setState(State.NONE); + scroller.forceFinished(true); + } + } + + @Override + public void run() { + + // + // OnTouchImageViewListener is set: TouchImageView listener has been flung by user. + // Listener runnable updated with each frame of fling animation. + // + if (touchImageViewListener != null) { + touchImageViewListener.onMove(); + } + + if (scroller.isFinished()) { + scroller = null; + return; + } + + if (scroller.computeScrollOffset()) { + int newX = scroller.getCurrX(); + int newY = scroller.getCurrY(); + int transX = newX - currX; + int transY = newY - currY; + currX = newX; + currY = newY; + matrix.postTranslate(transX, transY); + fixTrans(); + setImageMatrix(matrix); + compatPostOnAnimation(this); + } + } + } + + @TargetApi(Build.VERSION_CODES.GINGERBREAD) + private class CompatScroller { + Scroller scroller; + OverScroller overScroller; + boolean isPreGingerbread; + + public CompatScroller(Context context) { + if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) { + isPreGingerbread = true; + scroller = new Scroller(context); + + } else { + isPreGingerbread = false; + overScroller = new OverScroller(context); + } + } + + public void fling(int startX, int startY, int velocityX, int velocityY, int minX, int maxX, int minY, int maxY) { + if (isPreGingerbread) { + scroller.fling(startX, startY, velocityX, velocityY, minX, maxX, minY, maxY); + } else { + overScroller.fling(startX, startY, velocityX, velocityY, minX, maxX, minY, maxY); + } + } + + public void forceFinished(boolean finished) { + if (isPreGingerbread) { + scroller.forceFinished(finished); + } else { + overScroller.forceFinished(finished); + } + } + + public boolean isFinished() { + if (isPreGingerbread) { + return scroller.isFinished(); + } else { + return overScroller.isFinished(); + } + } + + public boolean computeScrollOffset() { + if (isPreGingerbread) { + return scroller.computeScrollOffset(); + } else { + overScroller.computeScrollOffset(); + return overScroller.computeScrollOffset(); + } + } + + public int getCurrX() { + if (isPreGingerbread) { + return scroller.getCurrX(); + } else { + return overScroller.getCurrX(); + } + } + + public int getCurrY() { + if (isPreGingerbread) { + return scroller.getCurrY(); + } else { + return overScroller.getCurrY(); + } + } + } + + @TargetApi(Build.VERSION_CODES.JELLY_BEAN) + private void compatPostOnAnimation(Runnable runnable) { + if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) { + postOnAnimation(runnable); + + } else { + postDelayed(runnable, 1000 / 60); + } + } + + private class ZoomVariables { + public float scale; + public float focusX; + public float focusY; + public ScaleType scaleType; + + public ZoomVariables(float scale, float focusX, float focusY, ScaleType scaleType) { + this.scale = scale; + this.focusX = focusX; + this.focusY = focusY; + this.scaleType = scaleType; + } + } + + private void printMatrixInfo() { + float[] n = new float[9]; + matrix.getValues(n); + Log.d(DEBUG, "Scale: " + n[Matrix.MSCALE_X] + " TransX: " + n[Matrix.MTRANS_X] + " TransY: " + n[Matrix.MTRANS_Y]); + } +} \ No newline at end of file diff --git a/R6S/app/src/main/java/io/nicco/r6s/WeaponsListAdapter.java b/R6S/app/src/main/java/io/nicco/r6s/WeaponsListAdapter.java index b476874..bdec8cf 100644 --- a/R6S/app/src/main/java/io/nicco/r6s/WeaponsListAdapter.java +++ b/R6S/app/src/main/java/io/nicco/r6s/WeaponsListAdapter.java @@ -1,5 +1,6 @@ package io.nicco.r6s; +import android.app.Activity; import android.app.Fragment; import android.content.Context; import android.os.Bundle; @@ -14,6 +15,8 @@ import java.util.List; public class WeaponsListAdapter extends RecyclerView.Adapter { + private Activity root; + public static class ViewHolder extends RecyclerView.ViewHolder { public TextView txt_l; @@ -31,8 +34,9 @@ public class WeaponsListAdapter extends RecyclerView.Adapter data; - public WeaponsListAdapter(List d) { + public WeaponsListAdapter(List d, Activity r) { data = d; + root = r; } @Override @@ -54,7 +58,7 @@ public class WeaponsListAdapter extends RecyclerView.Adapter maps_sel_cont = new ArrayList<>(); @@ -113,6 +116,14 @@ public class maps_view extends Fragment { } }); + img.resetZoom(); + + int showed_toast = Integer.parseInt(root.getPreferences(MODE_PRIVATE).getString(PREF_A, "0")); + if (showed_toast < 5) { + Toast.makeText(root, "Pinch the Map, You can ZOOM!", Toast.LENGTH_LONG).show(); + root.getPreferences(MODE_PRIVATE).edit().putString(PREF_A, String.valueOf(++showed_toast)).apply(); + } + return view; } diff --git a/R6S/app/src/main/java/io/nicco/r6s/op_view.java b/R6S/app/src/main/java/io/nicco/r6s/op_view.java index ab1c043..eb9ecaa 100644 --- a/R6S/app/src/main/java/io/nicco/r6s/op_view.java +++ b/R6S/app/src/main/java/io/nicco/r6s/op_view.java @@ -1,6 +1,7 @@ package io.nicco.r6s; +import android.app.Activity; import android.app.Fragment; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; @@ -9,30 +10,34 @@ import android.graphics.BitmapFactory; import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Bundle; -import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.widget.ImageView; import android.widget.LinearLayout; -import android.widget.RelativeLayout; import android.widget.TextView; +import android.widget.Toast; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.Map; +import static android.content.Context.MODE_PRIVATE; + public class op_view extends Fragment { public op_view() { } + private Activity root; + private final static String PREF_A = "op_view_show_toast"; + private LinearLayout mkItem(String s) { - LinearLayout frame = new LinearLayout(home.root()); - TextView tmp = new TextView(home.root()); + LinearLayout frame = new LinearLayout(root); + TextView tmp = new TextView(root); LinearLayout.LayoutParams fp = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1); fp.setMargins(8, 8, 8, 8); @@ -59,6 +64,8 @@ public class op_view extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + root = getActivity(); + final View v = inflater.inflate(R.layout.fragment_op_view, container, false); //Get Operator Info @@ -98,7 +105,7 @@ public class op_view extends Fragment { b.putInt("id", cur_id); Fragment f = new weapon_view(); f.setArguments(b); - home.ChangeFragment(f); + home.ChangeFragment(f, root); } }); if (w.getString(w.getColumnIndex("class")).equals("Secondary")) { @@ -117,7 +124,8 @@ public class op_view extends Fragment { //Setting Images try { - InputStream ims = home.root().getAssets().open("Operators/" + c.getString(c.getColumnIndex("type")) + "/" + c.getString(c.getColumnIndex("name")) + ".png"); + + InputStream ims = root.getAssets().open("Operators/" + c.getString(c.getColumnIndex("type")) + "/" + c.getString(c.getColumnIndex("name")) + ".png"); ((ImageView) v.findViewById(R.id.op_img)).setImageDrawable(Drawable.createFromStream(ims, null)); } catch (IOException e) { e.printStackTrace(); @@ -126,38 +134,37 @@ public class op_view extends Fragment { v.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { - Log.i("Trelelele", "ok"); try { - //Drawable d = Drawable.createFromStream(home.root().getAssets().open("OPs/" + String.valueOf(id) + ".jpg"), null); + //Drawable d = Drawable.createFromStream(c.getAssets().open("OPs/" + String.valueOf(id) + ".jpg"), null); ImageView op_bg = (ImageView) v.findViewById(R.id.op_bg); - RelativeLayout img_cont = (RelativeLayout) v.findViewById(R.id.img_cont); - Bitmap bitmap = BitmapFactory.decodeStream(home.root().getAssets().open("OPs/" + String.valueOf(id) + ".jpg")); + Bitmap bitmap = BitmapFactory.decodeStream(root.getAssets().open("OPs/" + String.valueOf(id) + ".jpg")); int b_h = bitmap.getHeight(); int b_w = bitmap.getWidth(); - //float ratio = op_bg.getHeight() / op_bg.getWidth(); - Log.i("W & H: ", op_bg.getMeasuredHeight() + " - " + op_bg.getHeight()); - /* - if (ratio > 1) { - // BG is portrait - if (b_h > b_w) { - //img is portrait - bitmap = Bitmap.createBitmap(bitmap, 0, 0, b_h, (int) (b_h * ratio)); - } else { - //img is landscape - bitmap = Bitmap.createBitmap(bitmap, 0, 0, (int) (b_w / ratio), b_w); - } - } else { - //BG is landscape - if (b_h > b_w) { - //img is portrait - bitmap = Bitmap.createBitmap(bitmap, 0, 0, (int) (b_w / ratio), b_w); - } else { - //img is landscape - bitmap = Bitmap.createBitmap(bitmap, 0, 0, b_h, (int) (b_h * ratio)); - } - }*/ + int bg_h = op_bg.getHeight(); + int bg_w = op_bg.getWidth(); + float ratio = (float) bg_h / bg_w; + + try { + if (ratio > 1) { + // BG is portrait + if (b_h > b_w) { + bitmap = Bitmap.createBitmap(bitmap, 0, 0, b_w, Math.min((int) (b_w * ratio), b_h)); + } else { + bitmap = Bitmap.createBitmap(bitmap, 0, 0, Math.min((int) (b_w / ratio), b_h), b_w); + } + } else { + // BG is landscape + if (b_h > b_w) { + bitmap = Bitmap.createBitmap(bitmap, 0, 0, b_w, (int) (b_w * ratio)); + } else { + bitmap = Bitmap.createBitmap(bitmap, 0, 0, b_h, (int) (b_h * ratio)); + } + } + } finally { + + } //Crop op_bg.setImageBitmap(bitmap); @@ -169,6 +176,12 @@ public class op_view extends Fragment { db.close(); + int showed_toast = Integer.parseInt(root.getPreferences(MODE_PRIVATE).getString(PREF_A, "0")); + if (showed_toast < 5) { + Toast.makeText(root, "Scroll down to see more!", Toast.LENGTH_LONG).show(); + root.getPreferences(MODE_PRIVATE).edit().putString(PREF_A, String.valueOf(++showed_toast)).apply(); + } + return v; } diff --git a/R6S/app/src/main/java/io/nicco/r6s/ops_view.java b/R6S/app/src/main/java/io/nicco/r6s/ops_view.java index 6ebbe99..be00f94 100644 --- a/R6S/app/src/main/java/io/nicco/r6s/ops_view.java +++ b/R6S/app/src/main/java/io/nicco/r6s/ops_view.java @@ -1,7 +1,9 @@ package io.nicco.r6s; +import android.app.Activity; import android.app.Fragment; +import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; @@ -19,10 +21,14 @@ public class ops_view extends Fragment { public ops_view() { } + private Activity root; + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + root = getActivity(); + View v = inflater.inflate(R.layout.fragment_ops_view, container, false); RecyclerView op_a_list = (RecyclerView) v.findViewById(R.id.ops_list_a); RecyclerView op_d_list = (RecyclerView) v.findViewById(R.id.ops_list_d); @@ -54,10 +60,10 @@ public class ops_view extends Fragment { } db.close(); - op_a_list.setAdapter(new OpsListAdapter(data_a)); - op_a_list.setLayoutManager(new LinearLayoutManager(home.root())); - op_d_list.setAdapter(new OpsListAdapter(data_d)); - op_d_list.setLayoutManager(new LinearLayoutManager(home.root())); + op_a_list.setAdapter(new OpsListAdapter(data_a, root)); + op_a_list.setLayoutManager(new LinearLayoutManager(root)); + op_d_list.setAdapter(new OpsListAdapter(data_d, root)); + op_d_list.setLayoutManager(new LinearLayoutManager(root)); return v; } diff --git a/R6S/app/src/main/java/io/nicco/r6s/weapon_view.java b/R6S/app/src/main/java/io/nicco/r6s/weapon_view.java index d1c84d1..bb842e8 100644 --- a/R6S/app/src/main/java/io/nicco/r6s/weapon_view.java +++ b/R6S/app/src/main/java/io/nicco/r6s/weapon_view.java @@ -62,7 +62,7 @@ public class weapon_view extends Fragment { //Setting Images try { - InputStream ims = home.root().getAssets().open("Weapons/" + String.valueOf(id) + ".png"); + InputStream ims = getActivity().getAssets().open("Weapons/" + String.valueOf(id) + ".png"); ((ImageView) v.findViewById(R.id.weapon_image)).setImageDrawable(Drawable.createFromStream(ims, null)); } catch (IOException e) { e.printStackTrace(); diff --git a/R6S/app/src/main/java/io/nicco/r6s/weapons_view.java b/R6S/app/src/main/java/io/nicco/r6s/weapons_view.java index f33d06b..c32b636 100644 --- a/R6S/app/src/main/java/io/nicco/r6s/weapons_view.java +++ b/R6S/app/src/main/java/io/nicco/r6s/weapons_view.java @@ -1,6 +1,7 @@ package io.nicco.r6s; +import android.app.Activity; import android.app.Fragment; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; @@ -19,8 +20,12 @@ public class weapons_view extends Fragment { public weapons_view() { } + private Activity root; + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + root = getActivity(); + View v = inflater.inflate(R.layout.fragment_weapons_view, container, false); RecyclerView weapon_list = (RecyclerView) v.findViewById(R.id.weapons_list); List data = new ArrayList<>(); @@ -40,8 +45,8 @@ public class weapons_view extends Fragment { } db.close(); - weapon_list.setAdapter(new WeaponsListAdapter(data)); - weapon_list.setLayoutManager(new LinearLayoutManager(home.root())); + weapon_list.setAdapter(new WeaponsListAdapter(data, root)); + weapon_list.setLayoutManager(new LinearLayoutManager(root)); return v; } diff --git a/R6S/app/src/main/res/layout/fragment_maps_view.xml b/R6S/app/src/main/res/layout/fragment_maps_view.xml index 3b99eb6..4a6ae15 100644 --- a/R6S/app/src/main/res/layout/fragment_maps_view.xml +++ b/R6S/app/src/main/res/layout/fragment_maps_view.xml @@ -5,15 +5,14 @@ android:orientation="vertical" tools:context="io.nicco.r6s.maps_view"> - - + android:layout_weight="1" + android:layout_height="0dp" /> - + android:layout_height="match_parent" + android:adjustViewBounds="false" + android:foregroundGravity="top" + android:scaleType="centerCrop" /> - + - + android:layout_height="wrap_content" + android:orientation="vertical"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + android:layout_height="1dp" + android:background="@android:color/background_light"> - - - - - - - - - - - + android:orientation="vertical" + android:padding="16dp" + android:background="@android:color/background_light"> - + + + + + + + + + + android:baselineAligned="false" + android:orientation="vertical" + android:padding="16dp" + android:background="@android:color/background_light"> + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/R6S/app/src/main/res/layout/fragment_ops_view.xml b/R6S/app/src/main/res/layout/fragment_ops_view.xml index cd8d14a..0c08c79 100644 --- a/R6S/app/src/main/res/layout/fragment_ops_view.xml +++ b/R6S/app/src/main/res/layout/fragment_ops_view.xml @@ -11,9 +11,9 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#ffffffff" - android:layout_marginLeft="8dp" - android:layout_marginTop="8dp" - android:layout_marginRight="8dp"> + android:layout_marginLeft="@dimen/default_spacing" + android:layout_marginTop="@dimen/default_spacing" + android:layout_marginRight="@dimen/default_spacing"> + android:layout_marginLeft="@dimen/default_spacing" + android:layout_marginTop="@dimen/default_spacing" + android:layout_marginBottom="@dimen/default_spacing" /> + android:layout_marginTop="@dimen/default_spacing" + android:layout_marginRight="@dimen/default_spacing" + android:layout_marginBottom="@dimen/default_spacing" /> diff --git a/R6S/app/src/main/res/values/dimens.xml b/R6S/app/src/main/res/values/dimens.xml index 05cdb95..100f5f5 100644 --- a/R6S/app/src/main/res/values/dimens.xml +++ b/R6S/app/src/main/res/values/dimens.xml @@ -5,4 +5,6 @@ 16dp 16dp + + 8dp diff --git a/R6S/app/src/main/res/values/strings.xml b/R6S/app/src/main/res/values/strings.xml index 0d0ba48..4a7d794 100644 --- a/R6S/app/src/main/res/values/strings.xml +++ b/R6S/app/src/main/res/values/strings.xml @@ -1,5 +1,5 @@ - R6S + R6S Open navigation drawer Close navigation drawer diff --git a/R6S/build.gradle b/R6S/build.gradle index a3330d4..c20bca1 100644 --- a/R6S/build.gradle +++ b/R6S/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:2.2.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/R6S/gradlew b/R6S/gradlew old mode 100755 new mode 100644