Compare commits
4 Commits
9f5afc5aea
...
8aa1d7bac5
Author | SHA1 | Date |
---|---|---|
宣奇瑞 | 8aa1d7bac5 | 1 year ago |
宣奇瑞 | 2fd92a5a4c | 1 year ago |
宣奇瑞 | 0f1b8fdece | 1 year ago |
宣奇瑞 | a7358164e2 | 1 year ago |
@ -0,0 +1,4 @@
|
|||||||
|
.gradle/
|
||||||
|
.idea/
|
||||||
|
local.properties
|
||||||
|
app/build
|
@ -0,0 +1,2 @@
|
|||||||
|
# xqr
|
||||||
|
|
@ -0,0 +1,29 @@
|
|||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 33
|
||||||
|
buildToolsVersion "33.0.2"
|
||||||
|
useLibrary 'org.apache.http.legacy'
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "net.micode.notes"
|
||||||
|
minSdkVersion 14
|
||||||
|
targetSdkVersion 33
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
android {
|
||||||
|
packagingOptions {
|
||||||
|
exclude 'META-INF/DEPENDENCIES'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(dir: 'D:\\xyouyxiu(1)\\httpcomponents-client-4.5.14-bin\\lib', include: ['*.aar', '*.jar'], exclude: [])
|
||||||
|
implementation fileTree(dir: 'D:\\xyouyxiu(1)\\httpcomponents-client-4.5.14-bin\\lib', include: ['*.aar', '*.jar'], exclude: [])
|
||||||
|
}
|
@ -0,0 +1,165 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
package="net.micode.notes"
|
||||||
|
android:versionCode="1"
|
||||||
|
android:versionName="0.1" >
|
||||||
|
|
||||||
|
<uses-sdk android:minSdkVersion="14" />
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
||||||
|
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
|
||||||
|
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
|
||||||
|
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||||
|
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
|
||||||
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:icon="@drawable/icon_app"
|
||||||
|
android:label="@string/app_name" >
|
||||||
|
<activity
|
||||||
|
android:name=".ui.NotesListActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:launchMode="singleTop"
|
||||||
|
android:theme="@style/NoteTheme"
|
||||||
|
android:uiOptions="splitActionBarWhenNarrow"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".ui.pwdActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
|
android:launchMode="singleTop"
|
||||||
|
android:theme="@style/NoteTheme"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".ui.NoteEditActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
|
android:launchMode="singleTop"
|
||||||
|
android:theme="@style/NoteTheme"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
|
<intent-filter android:scheme="http"
|
||||||
|
tools:ignore="AppLinkUrlError">
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<data android:mimeType="vnd.android.cursor.item/text_note" />
|
||||||
|
<data android:mimeType="vnd.android.cursor.item/call_note" />
|
||||||
|
</intent-filter>
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.INSERT_OR_EDIT" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<data android:mimeType="vnd.android.cursor.item/text_note" />
|
||||||
|
<data android:mimeType="vnd.android.cursor.item/call_note" />
|
||||||
|
</intent-filter>
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.SEARCH" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
|
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.searchable"
|
||||||
|
android:resource="@xml/searchable" />
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<provider
|
||||||
|
android:name="net.micode.notes.data.NotesProvider"
|
||||||
|
android:authorities="micode_notes"
|
||||||
|
android:multiprocess="true"
|
||||||
|
android:exported="true"/>
|
||||||
|
|
||||||
|
<receiver
|
||||||
|
android:name=".widget.NoteWidgetProvider_2x"
|
||||||
|
android:label="@string/app_widget2x2"
|
||||||
|
android:exported="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||||
|
<action android:name="android.appwidget.action.APPWIDGET_DELETED" />
|
||||||
|
<action android:name="android.intent.action.PRIVACY_MODE_CHANGED" />
|
||||||
|
</intent-filter>
|
||||||
|
|
||||||
|
<meta-data
|
||||||
|
android:name="android.appwidget.provider"
|
||||||
|
android:resource="@xml/widget_2x_info" />
|
||||||
|
</receiver>
|
||||||
|
<receiver
|
||||||
|
android:name=".widget.NoteWidgetProvider_4x"
|
||||||
|
android:label="@string/app_widget4x4"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||||
|
<action android:name="android.appwidget.action.APPWIDGET_DELETED" />
|
||||||
|
<action android:name="android.intent.action.PRIVACY_MODE_CHANGED" />
|
||||||
|
</intent-filter>
|
||||||
|
|
||||||
|
<meta-data
|
||||||
|
android:name="android.appwidget.provider"
|
||||||
|
android:resource="@xml/widget_4x_info" />
|
||||||
|
</receiver>
|
||||||
|
|
||||||
|
<receiver android:name=".ui.AlarmInitReceiver"
|
||||||
|
android:exported="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
|
|
||||||
|
<receiver
|
||||||
|
android:name="net.micode.notes.ui.AlarmReceiver"
|
||||||
|
android:process=":remote" >
|
||||||
|
</receiver>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".ui.AlarmAlertActivity"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:launchMode="singleInstance"
|
||||||
|
android:theme="@android:style/Theme.Holo.Wallpaper.NoTitleBar" >
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name="net.micode.notes.ui.NotesPreferenceActivity"
|
||||||
|
android:label="@string/preferences_title"
|
||||||
|
android:launchMode="singleTop"
|
||||||
|
android:theme="@android:style/Theme.Holo.Light" >
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<service
|
||||||
|
android:name="net.micode.notes.gtask.remote.GTaskSyncService"
|
||||||
|
android:exported="false" >
|
||||||
|
</service>
|
||||||
|
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.default_searchable"
|
||||||
|
android:value=".ui.NoteEditActivity" />
|
||||||
|
</application>
|
||||||
|
</manifest>
|
@ -0,0 +1,19 @@
|
|||||||
|
package net.micode.notes.activityTool;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class ActivitysManager {
|
||||||
|
private static Map<String , Activity> activitys = new HashMap<>();
|
||||||
|
public static Map<String ,Activity> getActivitys() {
|
||||||
|
return activitys;
|
||||||
|
}
|
||||||
|
public static Activity getActivity(String key) {
|
||||||
|
return activitys.get(key);
|
||||||
|
}
|
||||||
|
public static void putActivity(Activity value,String key) {
|
||||||
|
activitys.put(key, value);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,253 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package net.micode.notes.model;
|
||||||
|
import android.content.ContentProviderOperation;
|
||||||
|
import android.content.ContentProviderResult;
|
||||||
|
import android.content.ContentUris;
|
||||||
|
import android.content.ContentValues;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.OperationApplicationException;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.RemoteException;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import net.micode.notes.data.Notes;
|
||||||
|
import net.micode.notes.data.Notes.CallNote;
|
||||||
|
import net.micode.notes.data.Notes.DataColumns;
|
||||||
|
import net.micode.notes.data.Notes.NoteColumns;
|
||||||
|
import net.micode.notes.data.Notes.TextNote;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
|
||||||
|
public class Note {
|
||||||
|
private ContentValues mNoteDiffValues;
|
||||||
|
private NoteData mNoteData;
|
||||||
|
private static final String TAG = "Note";
|
||||||
|
/**
|
||||||
|
* Create a new note id for adding a new note to databases
|
||||||
|
*/
|
||||||
|
public static synchronized long getNewNoteId(Context context, long folderId) {
|
||||||
|
// Create a new note in the database
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
long createdTime = System.currentTimeMillis();
|
||||||
|
values.put(NoteColumns.CREATED_DATE, createdTime);
|
||||||
|
values.put(NoteColumns.MODIFIED_DATE, createdTime);
|
||||||
|
values.put(NoteColumns.TYPE, Notes.TYPE_NOTE);
|
||||||
|
values.put(NoteColumns.LOCAL_MODIFIED, 1);
|
||||||
|
values.put(NoteColumns.PARENT_ID, folderId);
|
||||||
|
Uri uri = context.getContentResolver().insert(Notes.CONTENT_NOTE_URI, values);
|
||||||
|
|
||||||
|
long noteId = 0;
|
||||||
|
try {
|
||||||
|
noteId = Long.valueOf(uri.getPathSegments().get(1));
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
Log.e(TAG, "Get note id error :" + e.toString());
|
||||||
|
noteId = 0;
|
||||||
|
}
|
||||||
|
if (noteId == -1) {
|
||||||
|
throw new IllegalStateException("Wrong note id:" + noteId);
|
||||||
|
}
|
||||||
|
return noteId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Note() {
|
||||||
|
mNoteDiffValues = new ContentValues();
|
||||||
|
mNoteData = new NoteData();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoteValue(String key, String value) {
|
||||||
|
mNoteDiffValues.put(key, value);
|
||||||
|
mNoteDiffValues.put(NoteColumns.LOCAL_MODIFIED, 1);
|
||||||
|
mNoteDiffValues.put(NoteColumns.MODIFIED_DATE, System.currentTimeMillis());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTextData(String key, String value) {
|
||||||
|
mNoteData.setTextData(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTextDataId(long id) {
|
||||||
|
mNoteData.setTextDataId(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getTextDataId() {
|
||||||
|
return mNoteData.mTextDataId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCallDataId(long id) {
|
||||||
|
mNoteData.setCallDataId(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCallData(String key, String value) {
|
||||||
|
mNoteData.setCallData(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isLocalModified() {
|
||||||
|
return mNoteDiffValues.size() > 0 || mNoteData.isLocalModified();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean syncNote(Context context, long noteId) {
|
||||||
|
if (noteId <= 0) {
|
||||||
|
throw new IllegalArgumentException("Wrong note id:" + noteId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isLocalModified()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* In theory, once data changed, the note should be updated on {@link NoteColumns#LOCAL_MODIFIED} and
|
||||||
|
* {@link NoteColumns#MODIFIED_DATE}. For data safety, though update note fails, we also update the
|
||||||
|
* note data info
|
||||||
|
*/
|
||||||
|
if (context.getContentResolver().update(
|
||||||
|
ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, noteId), mNoteDiffValues, null,
|
||||||
|
null) == 0) {
|
||||||
|
Log.e(TAG, "Update note error, should not happen");
|
||||||
|
// Do not return, fall through
|
||||||
|
}
|
||||||
|
mNoteDiffValues.clear();
|
||||||
|
|
||||||
|
if (mNoteData.isLocalModified()
|
||||||
|
&& (mNoteData.pushIntoContentResolver(context, noteId) == null)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private class NoteData {
|
||||||
|
private long mTextDataId;
|
||||||
|
|
||||||
|
private ContentValues mTextDataValues;
|
||||||
|
|
||||||
|
private long mCallDataId;
|
||||||
|
|
||||||
|
private ContentValues mCallDataValues;
|
||||||
|
|
||||||
|
private static final String TAG = "NoteData";
|
||||||
|
|
||||||
|
public NoteData() {
|
||||||
|
mTextDataValues = new ContentValues();
|
||||||
|
mCallDataValues = new ContentValues();
|
||||||
|
mTextDataId = 0;
|
||||||
|
mCallDataId = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isLocalModified() {
|
||||||
|
return mTextDataValues.size() > 0 || mCallDataValues.size() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setTextDataId(long id) {
|
||||||
|
if(id <= 0) {
|
||||||
|
throw new IllegalArgumentException("Text data id should larger than 0");
|
||||||
|
}
|
||||||
|
mTextDataId = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setCallDataId(long id) {
|
||||||
|
if (id <= 0) {
|
||||||
|
throw new IllegalArgumentException("Call data id should larger than 0");
|
||||||
|
}
|
||||||
|
mCallDataId = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setCallData(String key, String value) {
|
||||||
|
mCallDataValues.put(key, value);
|
||||||
|
mNoteDiffValues.put(NoteColumns.LOCAL_MODIFIED, 1);
|
||||||
|
mNoteDiffValues.put(NoteColumns.MODIFIED_DATE, System.currentTimeMillis());
|
||||||
|
}
|
||||||
|
|
||||||
|
void setTextData(String key, String value) {
|
||||||
|
mTextDataValues.put(key, value);
|
||||||
|
mNoteDiffValues.put(NoteColumns.LOCAL_MODIFIED, 1);
|
||||||
|
mNoteDiffValues.put(NoteColumns.MODIFIED_DATE, System.currentTimeMillis());
|
||||||
|
}
|
||||||
|
|
||||||
|
Uri pushIntoContentResolver(Context context, long noteId) {
|
||||||
|
/**
|
||||||
|
* Check for safety
|
||||||
|
*/
|
||||||
|
if (noteId <= 0) {
|
||||||
|
throw new IllegalArgumentException("Wrong note id:" + noteId);
|
||||||
|
}
|
||||||
|
|
||||||
|
ArrayList<ContentProviderOperation> operationList = new ArrayList<ContentProviderOperation>();
|
||||||
|
ContentProviderOperation.Builder builder = null;
|
||||||
|
|
||||||
|
if(mTextDataValues.size() > 0) {
|
||||||
|
mTextDataValues.put(DataColumns.NOTE_ID, noteId);
|
||||||
|
if (mTextDataId == 0) {
|
||||||
|
mTextDataValues.put(DataColumns.MIME_TYPE, TextNote.CONTENT_ITEM_TYPE);
|
||||||
|
Uri uri = context.getContentResolver().insert(Notes.CONTENT_DATA_URI,
|
||||||
|
mTextDataValues);
|
||||||
|
try {
|
||||||
|
setTextDataId(Long.valueOf(uri.getPathSegments().get(1)));
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
Log.e(TAG, "Insert new text data fail with noteId" + noteId);
|
||||||
|
mTextDataValues.clear();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
builder = ContentProviderOperation.newUpdate(ContentUris.withAppendedId(
|
||||||
|
Notes.CONTENT_DATA_URI, mTextDataId));
|
||||||
|
builder.withValues(mTextDataValues);
|
||||||
|
operationList.add(builder.build());
|
||||||
|
}
|
||||||
|
mTextDataValues.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mCallDataValues.size() > 0) {
|
||||||
|
mCallDataValues.put(DataColumns.NOTE_ID, noteId);
|
||||||
|
if (mCallDataId == 0) {
|
||||||
|
mCallDataValues.put(DataColumns.MIME_TYPE, CallNote.CONTENT_ITEM_TYPE);
|
||||||
|
Uri uri = context.getContentResolver().insert(Notes.CONTENT_DATA_URI,
|
||||||
|
mCallDataValues);
|
||||||
|
try {
|
||||||
|
setCallDataId(Long.valueOf(uri.getPathSegments().get(1)));
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
Log.e(TAG, "Insert new call data fail with noteId" + noteId);
|
||||||
|
mCallDataValues.clear();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
builder = ContentProviderOperation.newUpdate(ContentUris.withAppendedId(
|
||||||
|
Notes.CONTENT_DATA_URI, mCallDataId));
|
||||||
|
builder.withValues(mCallDataValues);
|
||||||
|
operationList.add(builder.build());
|
||||||
|
}
|
||||||
|
mCallDataValues.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (operationList.size() > 0) {
|
||||||
|
try {
|
||||||
|
ContentProviderResult[] results = context.getContentResolver().applyBatch(
|
||||||
|
Notes.AUTHORITY, operationList);
|
||||||
|
return (results == null || results.length == 0 || results[0] == null) ? null
|
||||||
|
: ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, noteId);
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
Log.e(TAG, String.format("%s: %s", e.toString(), e.getMessage()));
|
||||||
|
return null;
|
||||||
|
} catch (OperationApplicationException e) {
|
||||||
|
Log.e(TAG, String.format("%s: %s", e.toString(), e.getMessage()));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package net.micode.notes.ui;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import net.micode.notes.R;
|
||||||
|
import net.micode.notes.activityTool.ActivitysManager;
|
||||||
|
|
||||||
|
public class pwdActivity extends Activity {
|
||||||
|
public Button mBtnpwd;
|
||||||
|
public Button cancell;
|
||||||
|
public EditText mEtpwd;
|
||||||
|
public String password = "123";
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_pwd);
|
||||||
|
|
||||||
|
mBtnpwd = findViewById(R.id.confirm);
|
||||||
|
mEtpwd = findViewById(R.id.password);
|
||||||
|
cancell = findViewById(R.id.cancell);
|
||||||
|
mBtnpwd.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
String pwd = mEtpwd.getText().toString();
|
||||||
|
if (pwd.equals(password)) {
|
||||||
|
finish();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(pwdActivity.this, "ERROR", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
cancell.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
ActivitysManager.getActivity("NotesListActivity").finish();
|
||||||
|
Intent intent = new Intent(pwdActivity.this, NotesListActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
ActivitysManager.getActivity("NotesListActivity").finish();
|
||||||
|
Intent intent = new Intent(pwdActivity.this, NotesListActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 245 B After Width: | Height: | Size: 245 B |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 443 B After Width: | Height: | Size: 443 B |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 554 KiB After Width: | Height: | Size: 554 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 701 KiB |
After Width: | Height: | Size: 1.5 MiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 87 KiB |
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |