| author | Tomas Zeman <tzeman@volny.cz> |
| Fri, 10 Jan 2014 13:18:36 +0100 | |
| changeset 8 | 16d857ba45c8 |
| parent 7 | 0454873af836 |
| permissions | -rw-r--r-- |
|
1
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
1 |
package tz.signaturecapture; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
2 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
3 |
import java.io.File; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
4 |
import java.io.FileOutputStream; |
|
3
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
5 |
import java.io.IOException; |
|
1
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
6 |
import java.util.Calendar; |
|
3
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
7 |
|
|
1
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
8 |
import android.app.Activity; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
9 |
import android.content.Context; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
10 |
import android.content.ContextWrapper; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
11 |
import android.content.Intent; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
12 |
import android.graphics.Color; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
13 |
import android.os.Bundle; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
14 |
import android.os.Environment; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
15 |
import android.util.Log; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
16 |
import android.view.Gravity; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
17 |
import android.view.MotionEvent; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
18 |
import android.view.View; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
19 |
import android.view.View.OnClickListener; |
|
3
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
20 |
import android.view.View.OnTouchListener; |
|
1
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
21 |
import android.view.ViewGroup.LayoutParams; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
22 |
import android.view.Window; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
23 |
import android.widget.Button; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
24 |
import android.widget.EditText; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
25 |
import android.widget.LinearLayout; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
26 |
import android.widget.Toast; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
27 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
28 |
public class CaptureSignature extends Activity {
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
29 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
30 |
LinearLayout mContent; |
|
3
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
31 |
SignatureWidget mSignature; |
|
1
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
32 |
Button mClear, mGetSign, mCancel; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
33 |
public static String tempDir; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
34 |
public int count = 1; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
35 |
public String current = null; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
36 |
View mView; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
37 |
File mypath; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
38 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
39 |
private String uniqueId; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
40 |
private EditText yourName; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
41 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
42 |
@Override |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
43 |
public void onCreate(Bundle savedInstanceState) |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
44 |
{
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
45 |
super.onCreate(savedInstanceState); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
46 |
this.requestWindowFeature(Window.FEATURE_NO_TITLE); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
47 |
setContentView(R.layout.signature); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
48 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
49 |
tempDir = Environment.getExternalStorageDirectory() + "/" + getResources().getString(R.string.external_dir) + "/"; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
50 |
ContextWrapper cw = new ContextWrapper(getApplicationContext()); |
|
7
0454873af836
CaptureSignature: save signatures to external dir.
Tomas Zeman <tzeman@volny.cz>
parents:
5
diff
changeset
|
51 |
//File directory = cw.getDir(getResources().getString(R.string.external_dir), Context.MODE_PRIVATE); |
|
0454873af836
CaptureSignature: save signatures to external dir.
Tomas Zeman <tzeman@volny.cz>
parents:
5
diff
changeset
|
52 |
File directory = new File(tempDir); |
|
1
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
53 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
54 |
prepareDirectory(); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
55 |
uniqueId = getTodaysDate() + "_" + getCurrentTime() + "_" + Math.random(); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
56 |
current = uniqueId + ".png"; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
57 |
mypath= new File(directory,current); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
58 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
59 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
60 |
mContent = (LinearLayout) findViewById(R.id.linearLayout); |
|
3
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
61 |
mSignature = new SignatureWidget(this, null); |
|
1
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
62 |
mSignature.setBackgroundColor(Color.WHITE); |
|
3
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
63 |
mSignature.setOnTouchListener(new OnTouchListener() {
|
|
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
64 |
@Override |
|
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
65 |
public boolean onTouch(View v, MotionEvent event) {
|
|
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
66 |
mGetSign.setEnabled(true); |
|
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
67 |
return false; |
|
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
68 |
} |
|
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
69 |
}); |
|
1
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
70 |
mContent.addView(mSignature, LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
71 |
mClear = (Button)findViewById(R.id.clear); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
72 |
mGetSign = (Button)findViewById(R.id.getsign); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
73 |
mGetSign.setEnabled(false); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
74 |
mCancel = (Button)findViewById(R.id.cancel); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
75 |
mView = mContent; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
76 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
77 |
yourName = (EditText) findViewById(R.id.yourName); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
78 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
79 |
mClear.setOnClickListener(new OnClickListener() |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
80 |
{
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
81 |
public void onClick(View v) |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
82 |
{
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
83 |
Log.v("log_tag", "Panel Cleared");
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
84 |
mSignature.clear(); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
85 |
mGetSign.setEnabled(false); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
86 |
} |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
87 |
}); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
88 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
89 |
mGetSign.setOnClickListener(new OnClickListener() |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
90 |
{
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
91 |
public void onClick(View v) |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
92 |
{
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
93 |
Log.v("log_tag", "Panel Saved");
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
94 |
boolean error = captureSignature(); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
95 |
if(!error){
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
96 |
mView.setDrawingCacheEnabled(true); |
|
3
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
97 |
try {
|
|
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
98 |
FileOutputStream os = new FileOutputStream(mypath); |
|
8
16d857ba45c8
SignatureWidget: no need to supply parent view; added getSignature(): Bitmap
Tomas Zeman <tzeman@volny.cz>
parents:
7
diff
changeset
|
99 |
mSignature.save(os); |
|
3
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
100 |
os.flush(); |
|
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
101 |
os.close(); |
|
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
102 |
setResult(RESULT_OK, new Intent().putExtra("status",
|
|
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
103 |
"done")); |
|
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
104 |
finish(); |
|
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
105 |
} catch (IOException e) {
|
|
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
106 |
Toast.makeText(CaptureSignature.this, String.format( |
|
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
107 |
"Failed to save signature: %", e.getMessage()), |
|
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
108 |
Toast.LENGTH_LONG).show(); |
|
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
109 |
} |
|
a41c0d4e533c
CaptureSignature: refactored signature into SignatureWidget (static inner class)
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
110 |
|
|
1
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
111 |
} |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
112 |
} |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
113 |
}); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
114 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
115 |
mCancel.setOnClickListener(new OnClickListener() |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
116 |
{
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
117 |
public void onClick(View v) |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
118 |
{
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
119 |
Log.v("log_tag", "Panel Canceled");
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
120 |
Bundle b = new Bundle(); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
121 |
b.putString("status", "cancel");
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
122 |
Intent intent = new Intent(); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
123 |
intent.putExtras(b); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
124 |
setResult(RESULT_OK,intent); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
125 |
finish(); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
126 |
} |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
127 |
}); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
128 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
129 |
} |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
130 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
131 |
@Override |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
132 |
protected void onDestroy() {
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
133 |
Log.w("GetSignature", "onDestory");
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
134 |
super.onDestroy(); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
135 |
} |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
136 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
137 |
private boolean captureSignature() {
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
138 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
139 |
boolean error = false; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
140 |
String errorMessage = ""; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
141 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
142 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
143 |
if(yourName.getText().toString().equalsIgnoreCase("")){
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
144 |
errorMessage = errorMessage + "Please enter your Name\n"; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
145 |
error = true; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
146 |
} |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
147 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
148 |
if(error){
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
149 |
Toast toast = Toast.makeText(this, errorMessage, Toast.LENGTH_SHORT); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
150 |
toast.setGravity(Gravity.TOP, 105, 50); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
151 |
toast.show(); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
152 |
} |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
153 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
154 |
return error; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
155 |
} |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
156 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
157 |
private String getTodaysDate() {
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
158 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
159 |
final Calendar c = Calendar.getInstance(); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
160 |
int todaysDate = (c.get(Calendar.YEAR) * 10000) + |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
161 |
((c.get(Calendar.MONTH) + 1) * 100) + |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
162 |
(c.get(Calendar.DAY_OF_MONTH)); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
163 |
Log.w("DATE:",String.valueOf(todaysDate));
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
164 |
return(String.valueOf(todaysDate)); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
165 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
166 |
} |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
167 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
168 |
private String getCurrentTime() {
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
169 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
170 |
final Calendar c = Calendar.getInstance(); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
171 |
int currentTime = (c.get(Calendar.HOUR_OF_DAY) * 10000) + |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
172 |
(c.get(Calendar.MINUTE) * 100) + |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
173 |
(c.get(Calendar.SECOND)); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
174 |
Log.w("TIME:",String.valueOf(currentTime));
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
175 |
return(String.valueOf(currentTime)); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
176 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
177 |
} |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
178 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
179 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
180 |
private boolean prepareDirectory() |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
181 |
{
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
182 |
try |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
183 |
{
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
184 |
if (makedirs()) |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
185 |
{
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
186 |
return true; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
187 |
} else {
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
188 |
return false; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
189 |
} |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
190 |
} catch (Exception e) |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
191 |
{
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
192 |
e.printStackTrace(); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
193 |
Toast.makeText(this, "Could not initiate File System.. Is Sdcard mounted properly?", 1000).show(); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
194 |
return false; |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
195 |
} |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
196 |
} |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
197 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
198 |
private boolean makedirs() |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
199 |
{
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
200 |
File tempdir = new File(tempDir); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
201 |
if (!tempdir.exists()) |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
202 |
tempdir.mkdirs(); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
203 |
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
204 |
if (tempdir.isDirectory()) |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
205 |
{
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
206 |
File[] files = tempdir.listFiles(); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
207 |
for (File file : files) |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
208 |
{
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
209 |
if (!file.delete()) |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
210 |
{
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
211 |
System.out.println("Failed to delete " + file);
|
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
212 |
} |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
213 |
} |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
214 |
} |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
215 |
return (tempdir.isDirectory()); |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
216 |
} |
|
c3780fcb8441
Imported code from the blog post (renamed namespace com.as400samplecode -> tz.signaturecapture).
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
217 |
} |