Skip to content

Commit 0f62036

Browse files
committed
Merged latest changes with master
2 parents 3dfa3b0 + 6ae0162 commit 0f62036

File tree

4 files changed

+29
-28
lines changed

4 files changed

+29
-28
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ Check out [helpstack.io](http://www.helpstack.io) for more information.
2727
<img src="Images/hs_preview.png" alt="HelpStackthemes" title="screenshots">
2828
</p>
2929

30-
## HelpStack Android Users
31-
If you use HelpStack in your app, please let us know by adding yourself to this Wiki page: [HelpStack Android users](https://github.com/happyfoxinc/helpstack-android/wiki/HelpStack-Android-users)
30+
## App Showcase
31+
Have you made something awesome with HelpStack? Add yourself here: [App Showcase](https://github.com/happyfoxinc/helpstack-android/wiki/App-Showcase)
3232

3333
## Installation
3434

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ buildscript {
44
mavenCentral()
55
}
66
dependencies {
7-
classpath 'com.android.tools.build:gradle:1.0.0'
7+
classpath 'com.android.tools.build:gradle:1.0.0+'
88
}
99
}

helpstack/src/com/tenmiles/helpstack/activities/DrawingView.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
public class DrawingView extends View {
1818

19-
private Path drawPath;
20-
private Paint drawPaint;
21-
private Canvas drawCanvas;
19+
private Path mPath;
20+
private Paint mPaint;
21+
private Canvas mCanvas;
2222

2323
private Paint canvasPaint;
2424
private Bitmap canvasBitmap;
@@ -36,46 +36,46 @@ public class DrawingView extends View {
3636
public DrawingView(Context context, AttributeSet attrs) {
3737
super(context, attrs);
3838

39-
drawPath = new Path();
40-
drawPaint = new Paint();
39+
mPath = new Path();
40+
mPaint = new Paint();
4141

42-
drawPaint.setColor(paintColor);
42+
mPaint.setColor(paintColor);
4343

44-
drawPaint.setAntiAlias(true);
45-
drawPaint.setStrokeWidth(brushSize);
46-
drawPaint.setStyle(Paint.Style.STROKE);
47-
drawPaint.setStrokeJoin(Paint.Join.ROUND);
48-
drawPaint.setStrokeCap(Paint.Cap.ROUND);
44+
mPaint.setAntiAlias(true);
45+
mPaint.setStrokeWidth(brushSize);
46+
mPaint.setStyle(Paint.Style.STROKE);
47+
mPaint.setStrokeJoin(Paint.Join.ROUND);
48+
mPaint.setStrokeCap(Paint.Cap.ROUND);
4949

5050
canvasPaint = new Paint(Paint.DITHER_FLAG);
5151
}
5252

5353
public void setCanvasBitmap(Bitmap bitmap) {
5454
cachedBitmap = bitmap;
55-
drawCanvas.drawColor(Color.BLACK);
55+
mCanvas.drawColor(Color.BLACK);
5656
Bitmap mutableBitmap = bitmap.copy(Bitmap.Config.ARGB_8888, true);
5757

58-
calculateResizeRatio(bitmap, drawCanvas);
58+
calculateResizeRatio(bitmap, mCanvas);
5959
Bitmap resizedBitmap = Bitmap.createScaledBitmap(mutableBitmap, resizedWidth, resizedHeight, false);
6060

6161
int leftStart = getLeftStart(resizedWidth);
6262
int topStart = getTopStart(resizedHeight);
6363

64-
drawCanvas.drawBitmap(resizedBitmap, leftStart, topStart, drawPaint);
64+
mCanvas.drawBitmap(resizedBitmap, leftStart, topStart, mPaint);
6565
}
6666

6767
@Override
6868
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
6969
super.onSizeChanged(w, h, oldw, oldh);
7070

7171
canvasBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
72-
drawCanvas = new Canvas(canvasBitmap);
72+
mCanvas = new Canvas(canvasBitmap);
7373
}
7474

7575
@Override
7676
protected void onDraw(Canvas canvas) {
7777
canvas.drawBitmap(canvasBitmap, 0, 0, canvasPaint);
78-
canvas.drawPath(drawPath, drawPaint);
78+
canvas.drawPath(mPath, mPaint);
7979
}
8080

8181
@Override
@@ -85,15 +85,15 @@ public boolean onTouchEvent(MotionEvent event) {
8585

8686
switch (event.getAction()) {
8787
case MotionEvent.ACTION_DOWN:
88-
drawPath.moveTo(touchX, touchY);
88+
mPath.moveTo(touchX, touchY);
8989
break;
9090
case MotionEvent.ACTION_MOVE:
91-
drawPath.lineTo(touchX, touchY);
91+
mPath.lineTo(touchX, touchY);
9292
break;
9393
case MotionEvent.ACTION_UP:
94-
drawCanvas.drawPath(drawPath, drawPaint);
94+
mCanvas.drawPath(mPath, mPaint);
9595
setIsEdited(true);
96-
drawPath.reset();
96+
mPath.reset();
9797
activateClearOptionInActivity(true);
9898
break;
9999
default:
@@ -108,11 +108,11 @@ public void setColor(String newColor) {
108108
invalidate();
109109

110110
paintColor = Color.parseColor(newColor);
111-
drawPaint.setColor(paintColor);
111+
mPaint.setColor(paintColor);
112112
}
113113

114114
public void clearChanges() {
115-
drawPath.reset();
115+
mPath.reset();
116116
setCanvasBitmap(cachedBitmap);
117117
setIsEdited(false);
118118
activateClearOptionInActivity(false);

helpstack/src/com/tenmiles/helpstack/activities/EditAttachmentActivity.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import android.net.Uri;
3333
import android.os.Bundle;
3434
import android.provider.MediaStore;
35+
import android.support.v7.app.ActionBarActivity;
3536
import android.view.Menu;
3637
import android.view.MenuInflater;
3738
import android.view.MenuItem;
@@ -46,7 +47,7 @@
4647
import java.io.FileNotFoundException;
4748
import java.util.UUID;
4849

49-
public class EditAttachmentActivity extends Activity {
50+
public class EditAttachmentActivity extends ActionBarActivity {
5051

5152
private final int REQUEST_CODE_PHOTO_PICKER = 100;
5253

@@ -62,8 +63,8 @@ protected void onCreate(Bundle savedInstanceState) {
6263
super.onCreate(savedInstanceState);
6364
setContentView(R.layout.hs_activity_edit_attachment);
6465

65-
getActionBar().setDisplayHomeAsUpEnabled(true);
66-
getActionBar().setTitle(R.string.hs_attachment_edit);
66+
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
67+
getSupportActionBar().setTitle(R.string.hs_attachment_edit);
6768

6869
drawView = (DrawingView)findViewById(R.id.drawing);
6970
drawView.setObserver(new DrawingView.ObserverInterface() {

0 commit comments

Comments
 (0)