Revision 61b66389 app/src/info/guardianproject/notepadbot/NoteCipher.java
app/src/info/guardianproject/notepadbot/NoteCipher.java | ||
---|---|---|
49 | 49 |
import info.guardianproject.cacheword.CacheWordActivityHandler; |
50 | 50 |
import info.guardianproject.cacheword.ICacheWordSubscriber; |
51 | 51 |
|
52 |
import net.simonvt.numberpicker.NumberPicker; |
|
53 | 52 |
import net.sqlcipher.database.SQLiteDatabase; |
54 | 53 |
|
55 | 54 |
import java.io.FileNotFoundException; |
... | ... | |
57 | 56 |
import java.io.InputStream; |
58 | 57 |
|
59 | 58 |
public class NoteCipher extends SherlockFragmentActivity implements ICacheWordSubscriber { |
59 |
|
|
60 | 60 |
private static final int ACTIVITY_CREATE = 0; |
61 | 61 |
private static final int ACTIVITY_EDIT = 1; |
62 | 62 |
|
... | ... | |
89 | 89 |
if (getIntent() != null) { |
90 | 90 |
if (getIntent().hasExtra(Intent.EXTRA_STREAM)) { |
91 | 91 |
dataStream = (Uri) getIntent().getExtras().get(Intent.EXTRA_STREAM); |
92 |
} else |
|
92 |
} else {
|
|
93 | 93 |
dataStream = getIntent().getData(); |
94 |
|
|
94 |
} |
|
95 | 95 |
} |
96 | 96 |
|
97 | 97 |
SQLiteDatabase.loadLibs(this); |
... | ... | |
236 | 236 |
mCacheWord.manuallyLock(); |
237 | 237 |
return true; |
238 | 238 |
case SETTINGS_ID: |
239 |
//changeTimeoutPrompt(); |
|
240 | 239 |
startActivity(new Intent(this, Settings.class)); |
241 | 240 |
return true; |
242 | 241 |
} |
... | ... | |
478 | 477 |
b.show(); |
479 | 478 |
} |
480 | 479 |
|
481 |
void changeTimeoutPrompt() { |
|
482 |
AlertDialog.Builder builder = new AlertDialog.Builder(this); |
|
483 |
builder.setTitle(R.string.change_timeout_prompt_title); |
|
484 |
builder.setMessage(R.string.change_timeout_prompt); |
|
485 |
final NumberPicker input = new NumberPicker(this); |
|
486 |
input.setMinValue(1); |
|
487 |
input.setMaxValue(60); |
|
488 |
input.setValue( mCacheWord.getTimeoutMinutes() ); |
|
489 |
builder.setView(input); |
|
490 |
|
|
491 |
builder.setPositiveButton("OK", |
|
492 |
new DialogInterface.OnClickListener() { |
|
493 |
@Override |
|
494 |
public void onClick(DialogInterface dialog, int which) { |
|
495 |
int timeout = input.getValue(); |
|
496 |
mCacheWord.setTimeoutMinutes(timeout); |
|
497 |
dialog.dismiss(); |
|
498 |
} |
|
499 |
}); |
|
500 |
builder.setNegativeButton("Cancel", |
|
501 |
new DialogInterface.OnClickListener() { |
|
502 |
@Override |
|
503 |
public void onClick(DialogInterface dialog, int which) { |
|
504 |
dialog.cancel(); |
|
505 |
} |
|
506 |
}); |
|
507 |
|
|
508 |
builder.show(); |
|
509 |
} |
|
510 |
|
|
511 | 480 |
void showLockScreen() { |
512 | 481 |
Intent intent = new Intent(this, LockScreenActivity.class); |
513 | 482 |
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); |
Also available in: Unified diff