Merge pull request '修改' (#5) from zhoushiyu_br into Develop

Develop
prmlf8pou 2 years ago
commit 1ef2cca949

Binary file not shown.

@ -36,12 +36,12 @@
android:icon="@drawable/icon_app"
android:label="@string/app_name" >
<activity
android:name=".ui.NotesListActivity"
android:name=".ui.LoginView"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTop"
android:theme="@style/NoteTheme"
android:uiOptions="splitActionBarWhenNarrow"
android:theme="@style/NoteTheme"
android:windowSoftInputMode="adjustPan" >
<intent-filter>
@ -50,6 +50,36 @@
</intent-filter>
</activity>
<activity
android:name=".ui.LoginActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTop"
android:uiOptions="splitActionBarWhenNarrow"
android:theme="@style/NoteTheme"
android:windowSoftInputMode="adjustPan" >
</activity>
<activity
android:name=".ui.ChangeLoginPasswordActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTop"
android:uiOptions="splitActionBarWhenNarrow"
android:theme="@style/NoteTheme"
android:windowSoftInputMode="adjustPan" >
</activity>
<activity
android:name=".ui.NotesListActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTop"
android:uiOptions="splitActionBarWhenNarrow"
android:theme="@style/NoteTheme"
android:windowSoftInputMode="adjustPan" >
</activity>
<activity
android:name=".ui.NoteEditActivity"
android:configChanges="keyboardHidden|orientation|screenSize"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -41,6 +41,7 @@ public class Notes {
public static final String INTENT_EXTRA_WIDGET_TYPE = "net.micode.notes.widget_type";
public static final String INTENT_EXTRA_FOLDER_ID = "net.micode.notes.folder_id";
public static final String INTENT_EXTRA_CALL_DATE = "net.micode.notes.call_date";
public static final String INTENT_EXTRA_TEMPLE_TEXT="net.micode.notes.temple_text";
public static final int TYPE_WIDGET_INVALIDE = -1;
public static final int TYPE_WIDGET_2X = 0;
@ -165,6 +166,8 @@ public class Notes {
* <P> Type : INTEGER (long) </P>
*/
public static final String VERSION = "version";
public static final String PASSWORD= "password";
}
public interface DataColumns {

@ -30,7 +30,7 @@ import net.micode.notes.data.Notes.NoteColumns;
public class NotesDatabaseHelper extends SQLiteOpenHelper {
private static final String DB_NAME = "note.db";
private static final int DB_VERSION = 4;
private static final int DB_VERSION = 5;
public interface TABLE {
public static final String NOTE = "note";
@ -60,7 +60,8 @@ public class NotesDatabaseHelper extends SQLiteOpenHelper {
NoteColumns.LOCAL_MODIFIED + " INTEGER NOT NULL DEFAULT 0," +
NoteColumns.ORIGIN_PARENT_ID + " INTEGER NOT NULL DEFAULT 0," +
NoteColumns.GTASK_ID + " TEXT NOT NULL DEFAULT ''," +
NoteColumns.VERSION + " INTEGER NOT NULL DEFAULT 0" +
NoteColumns.VERSION + " INTEGER NOT NULL DEFAULT 0," +
NoteColumns.PASSWORD + " TEXT DEFAULT NULL " +
")";
private static final String CREATE_DATA_TABLE_SQL =
@ -321,6 +322,10 @@ public class NotesDatabaseHelper extends SQLiteOpenHelper {
upgradeToV4(db);
oldVersion++;
}
if(oldVersion == 4){
upgradeToV5(db);
oldVersion++;
}
if (reCreateTriggers) {
reCreateNoteTableTriggers(db);
@ -359,4 +364,9 @@ public class NotesDatabaseHelper extends SQLiteOpenHelper {
db.execSQL("ALTER TABLE " + TABLE.NOTE + " ADD COLUMN " + NoteColumns.VERSION
+ " INTEGER NOT NULL DEFAULT 0");
}
private void upgradeToV5(SQLiteDatabase db){
db.execSQL("ALTER TABLE " + TABLE.NOTE + " ADD COLUMN " + NoteColumns.PASSWORD
+ " TEXT DEFAULT NULL ");
}
}

@ -77,8 +77,8 @@ public class GTaskASyncTask extends AsyncTask<Void, String, Integer> {
pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext,
NotesListActivity.class), 0);
}
notification.setLatestEventInfo(mContext, mContext.getString(R.string.app_name), content,
pendingIntent);
// notification.setLatestEventInfo(mContext, mContext.getString(R.string.app_name), content,
// pendingIntent);
mNotifiManager.notify(GTASK_SYNC_NOTIFICATION_ID, notification);
}

@ -31,10 +31,28 @@ import net.micode.notes.data.Notes.NoteColumns;
import net.micode.notes.data.Notes.TextNote;
import net.micode.notes.tool.ResourceParser.NoteBgResources;
/**
*
* @ProjectName: xiaomibianqian
* @Package: model
* @ClassName: WorkingNote
* @Description: 便
* 便便
* NoteEditActivitiesNotesfrom dataNote NoteListActivity SqlData
* NoteSettingChangedListenerNoteEditActivities
*
* @Author: zhoushiyu_br
* @CreateDate: 2023.12.16
* @UpdateUser:
* @UpdateDate: 2023.12.21
* @UpdateRemark:
* @Version: PickupRAIN
*/
public class WorkingNote {
// Note for the working note
private Note mNote;
private String mPassword;
private Note mNote;//这个在Note里面定义了Note类的基本类型
// Note Id
private long mNoteId;
// Note content
@ -44,26 +62,34 @@ public class WorkingNote {
private long mAlertDate;
private long mModifiedDate;
private long mModifiedDate;//最后的修改日期
private int mBgColorId;
private int mBgColorId;//定义的颜色的ID
private int mWidgetId;
private int mWidgetId;//定义了一个int类型用来定位到哪一个小组件被使用
private int mWidgetType;
private int mWidgetType;//定义了一个int类型用来区分使用了什么类型的小组件
private long mFolderId;
private long mFolderId;//用来定位便签放在哪个文件夹
private Context mContext;
private static final String TAG = "WorkingNote";
public boolean PRIVATE_MODE = false;
private static final String TAG = "WorkingNote"; //定义为静态变量,保证不能再被更改。防止数据出现异常
private boolean mIsDeleted;
private NoteSettingChangedListener mNoteSettingStatusListener;
private boolean mIsDeleted; //定义一个布尔变量,用来保存是否要被删除。通过查看用法,发现在后面保存|修改的时候要进行判断。
private NoteSettingChangedListener mNoteSettingStatusListener;//定义了一个接口具体是在NoteEditActivities中实现实现对于便签是否修改的监听
/**
* DataColumnDataColumn
* DataColumn便
* loadNoteData
* 12.22getContentResolver()
* getContentResolverProjection
* 访访
*/
public static final String[] DATA_PROJECTION = new String[] {
DataColumns.ID,
DataColumns.ID,//在Note里面定义一个接口类型
DataColumns.CONTENT,
DataColumns.MIME_TYPE,
DataColumns.DATA1,
@ -71,7 +97,7 @@ public class WorkingNote {
DataColumns.DATA3,
DataColumns.DATA4,
};
//这里的用法基本同上方,不过这些接口最后使用在数据库中
public static final String[] NOTE_PROJECTION = new String[] {
NoteColumns.PARENT_ID,
NoteColumns.ALERTED_DATE,
@ -80,7 +106,9 @@ public class WorkingNote {
NoteColumns.WIDGET_TYPE,
NoteColumns.MODIFIED_DATE
};
/**
*
*/
private static final int DATA_ID_COLUMN = 0;
private static final int DATA_CONTENT_COLUMN = 1;
@ -101,11 +129,15 @@ public class WorkingNote {
private static final int NOTE_MODIFIED_DATE_COLUMN = 5;
// New note construct
//初始化一个新的操作的Note
private WorkingNote(Context context, long folderId) {
mContext = context;
mAlertDate = 0;
mModifiedDate = System.currentTimeMillis();
mAlertDate = 0;//这里为什么是0还存疑
mModifiedDate = System.currentTimeMillis();//获取系统时间,保存给最后修改时间
mFolderId = folderId;
mNote = new Note();
mNoteId = 0;
@ -113,7 +145,8 @@ public class WorkingNote {
mMode = 0;
mWidgetType = Notes.TYPE_WIDGET_INVALIDE;
}
//由于传入了noteId,所以是对一个已经存在的便签进行操作。
//由于一些基本的已经定义,所以传入的变量很少。
// Existing note construct
private WorkingNote(Context context, long noteId, long folderId) {
mContext = context;
@ -124,11 +157,24 @@ public class WorkingNote {
loadNote();
}
/**
* @author: zhoushiyu_PickupRAIN
* @methodsName: loadNote
* @description: URI
* @param:
* ->Notes.CONTENT_NOTE_URI:URI
* ->NOTE_PROJECTION :
* ->NOTE_PROJECTION
* @return: String
* @throws: Nopes
*
*/
private void loadNote() {
//定义一个cursor游标用来操作数据。这里传入了很多量如URI、Id、和来自Projection的一系列。
Cursor cursor = mContext.getContentResolver().query(
ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, mNoteId), NOTE_PROJECTION, null,
null, null);
//设置一个cursor按行提取各种信息保存到对应的变量中
if (cursor != null) {
if (cursor.moveToFirst()) {
mFolderId = cursor.getLong(NOTE_PARENT_ID_COLUMN);
@ -145,7 +191,7 @@ public class WorkingNote {
}
loadNoteData();
}
//基本同上一个函数。值得注意的是这里对数据进行了筛选通过selection,还对MIME进行了判断后加载
private void loadNoteData() {
Cursor cursor = mContext.getContentResolver().query(Notes.CONTENT_DATA_URI, DATA_PROJECTION,
DataColumns.NOTE_ID + "=?", new String[] {
@ -160,6 +206,7 @@ public class WorkingNote {
mContent = cursor.getString(DATA_CONTENT_COLUMN);
mMode = cursor.getInt(DATA_MODE_COLUMN);
mNote.setTextDataId(cursor.getLong(DATA_ID_COLUMN));
} else if (DataConstants.CALL_NOTE.equals(type)) {
mNote.setCallDataId(cursor.getLong(DATA_ID_COLUMN));
} else {
@ -173,7 +220,7 @@ public class WorkingNote {
throw new IllegalArgumentException("Unable to find note's data with id " + mNoteId);
}
}
//简单的初始化函数,一会看一下用法
public static WorkingNote createEmptyNote(Context context, long folderId, int widgetId,
int widgetType, int defaultBgColorId) {
WorkingNote note = new WorkingNote(context, folderId);
@ -186,7 +233,7 @@ public class WorkingNote {
public static WorkingNote load(Context context, long id) {
return new WorkingNote(context, id, 0);
}
//这里涉及了多线程的操作。
public synchronized boolean saveNote() {
if (isWorthSaving()) {
if (!existInDatabase()) {
@ -195,12 +242,14 @@ public class WorkingNote {
return false;
}
}
//由于没有这个便签所以报错并返回false
mNote.syncNote(mContext, mNoteId);
mNote.syncNote(mContext, mNoteId);//这一行是同步信息的操作
/**
* Update widget content if there exist any widget of this note
*/
//对小组件的各种属性进行判断,来确定是否有组件,进行保存
if (mWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID
&& mWidgetType != Notes.TYPE_WIDGET_INVALIDE
&& mNoteSettingStatusListener != null) {
@ -212,6 +261,10 @@ public class WorkingNote {
}
}
/**
*
*
*/
public boolean existInDatabase() {
return mNoteId > 0;
}
@ -224,7 +277,7 @@ public class WorkingNote {
return true;
}
}
//这个变量设置是用来记录状态设定是否有发生过更改。
public void setOnSettingStatusChangedListener(NoteSettingChangedListener l) {
mNoteSettingStatusListener = l;
}
@ -256,7 +309,7 @@ public class WorkingNote {
mNote.setNoteValue(NoteColumns.BG_COLOR_ID, String.valueOf(id));
}
}
//在EditActivities中使用用来设定在list时的状态
public void setCheckListMode(int mode) {
if (mMode != mode) {
if (mNoteSettingStatusListener != null) {
@ -288,11 +341,23 @@ public class WorkingNote {
}
}
/**
*
*
* 使onOptionsItemSelected NoteEditActivities
*/
//这里的callNote我没有搞懂
public void convertToCallNote(String phoneNumber, long callDate) {
mNote.setCallData(CallNote.CALL_DATE, String.valueOf(callDate));
mNote.setCallData(CallNote.PHONE_NUMBER, phoneNumber);
mNote.setNoteValue(NoteColumns.PARENT_ID, String.valueOf(Notes.ID_CALL_RECORD_FOLDER));
}
public void setPassword(String password){
// mPassword=password;
mNote.setNoteValue(NoteColumns.PASSWORD,password);
}
public boolean hasClockAlert() {
return (mAlertDate > 0 ? true : false);
@ -342,6 +407,8 @@ public class WorkingNote {
return mWidgetType;
}
public String getPassword() { return mPassword; }
//声明了一个接口具体都在EditActivies中进行实现。主要是一个监听listener来设置各个量的改变
public interface NoteSettingChangedListener {
/**
* Called when the background color of current note has just changed

@ -30,6 +30,8 @@ public class ResourceParser {
public static final int GREEN = 3;
public static final int RED = 4;
public static final int DUCK = 5;
public static final int BG_DEFAULT_COLOR = YELLOW;
public static final int TEXT_SMALL = 0;
@ -45,7 +47,10 @@ public class ResourceParser {
R.drawable.edit_blue,
R.drawable.edit_white,
R.drawable.edit_green,
R.drawable.edit_red
R.drawable.edit_red,
R.drawable.note_bg_photo_wangyi
};
private final static int [] BG_EDIT_TITLE_RESOURCES = new int [] {
@ -53,7 +58,9 @@ public class ResourceParser {
R.drawable.edit_title_blue,
R.drawable.edit_title_white,
R.drawable.edit_title_green,
R.drawable.edit_title_red
R.drawable.edit_title_red,
R.drawable.note_bg_photo_wangyi
};
public static int getNoteBgResource(int id) {
@ -80,7 +87,8 @@ public class ResourceParser {
R.drawable.list_blue_up,
R.drawable.list_white_up,
R.drawable.list_green_up,
R.drawable.list_red_up
R.drawable.list_red_up,
R.drawable.note_bg_photo_wangyi
};
private final static int [] BG_NORMAL_RESOURCES = new int [] {
@ -88,7 +96,8 @@ public class ResourceParser {
R.drawable.list_blue_middle,
R.drawable.list_white_middle,
R.drawable.list_green_middle,
R.drawable.list_red_middle
R.drawable.list_red_middle,
R.drawable.note_bg_photo_wangyi
};
private final static int [] BG_LAST_RESOURCES = new int [] {
@ -97,6 +106,7 @@ public class ResourceParser {
R.drawable.list_white_down,
R.drawable.list_green_down,
R.drawable.list_red_down,
R.drawable.note_bg_photo_wangyi
};
private final static int [] BG_SINGLE_RESOURCES = new int [] {
@ -104,7 +114,8 @@ public class ResourceParser {
R.drawable.list_blue_single,
R.drawable.list_white_single,
R.drawable.list_green_single,
R.drawable.list_red_single
R.drawable.list_red_single,
R.drawable.note_bg_photo_wangyi
};
public static int getNoteBgFirstRes(int id) {

@ -0,0 +1,127 @@
package net.micode.notes.ui;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.AlertDialog;
import android.app.PendingIntent;
import android.app.SearchManager;
import android.appwidget.AppWidgetManager;
import android.content.ContentUris;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Paint;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.text.style.BackgroundColorSpan;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import net.micode.notes.R;
import net.micode.notes.data.Notes;
import net.micode.notes.data.Notes.TextNote;
import net.micode.notes.model.WorkingNote;
import net.micode.notes.model.WorkingNote.NoteSettingChangedListener;
import net.micode.notes.tool.DataUtils;
import net.micode.notes.tool.ResourceParser;
import net.micode.notes.tool.ResourceParser.TextAppearanceResources;
import net.micode.notes.ui.DateTimePickerDialog.OnDateTimeSetListener;
import net.micode.notes.ui.NoteEditText.OnTextViewChangeListener;
import net.micode.notes.widget.NoteWidgetProvider_2x;
import net.micode.notes.widget.NoteWidgetProvider_4x;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class ChangeLoginPasswordActivity extends Activity {
EditText OldPassword;
EditText NewPassword;
EditText ReWritePassword;
Button Acknowledged;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.change_login_password_activity);
getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE
| WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
OldPassword=(EditText) findViewById(R.id.old_password);
NewPassword=(EditText) findViewById(R.id.new_password);
ReWritePassword=(EditText) findViewById(R.id.ack_password);
Acknowledged=(Button)findViewById(R.id.Bt_Acknowledged);
Acknowledged.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String old_password = OldPassword.getText().toString();
String new_password = NewPassword.getText().toString();
String ack_password = ReWritePassword.getText().toString();
SharedPreferences pref=getSharedPreferences("user management",MODE_PRIVATE);
String login_password=pref.getString("password","");
if(old_password.equals("")==true || new_password.equals("")==true || ack_password.equals("")==true) {
Toast.makeText(ChangeLoginPasswordActivity.this, "密码不能为空", Toast.LENGTH_SHORT).show();
}else if (new_password.equals(ack_password) == false) {
Toast.makeText(ChangeLoginPasswordActivity.this, "新建密码与重复密码不匹配,请重新输入密码", Toast.LENGTH_SHORT).show();
ReWritePassword.setText("");
}else if(old_password.equals(login_password) == false){
Toast.makeText(ChangeLoginPasswordActivity.this, "原有密码错误,请重新输入密码", Toast.LENGTH_SHORT).show();
OldPassword.setText("");
}
else if (new_password.equals(ack_password) == true && old_password.equals(login_password) == true){
SharedPreferences.Editor editor=getSharedPreferences("user management", MODE_PRIVATE).edit();
editor.putString("password",new_password);
editor.apply();
Toast.makeText(ChangeLoginPasswordActivity.this, "修改密码成功", Toast.LENGTH_SHORT).show();
Intent intent=new Intent(ChangeLoginPasswordActivity.this, LoginActivity.class);
startActivity(intent);
finish();
}
}
});
}
@Override
public void onBackPressed() {
Intent intent=new Intent(ChangeLoginPasswordActivity.this, LoginActivity.class);
startActivity(intent);
finish();
}
}

@ -0,0 +1,163 @@
package net.micode.notes.ui;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.AlertDialog;
import android.app.PendingIntent;
import android.app.ProgressDialog;
import android.app.SearchManager;
import android.appwidget.AppWidgetManager;
import android.content.ContentUris;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Paint;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.text.style.BackgroundColorSpan;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import net.micode.notes.R;
import net.micode.notes.data.Notes;
import net.micode.notes.data.Notes.TextNote;
import net.micode.notes.model.WorkingNote;
import net.micode.notes.model.WorkingNote.NoteSettingChangedListener;
import net.micode.notes.tool.DataUtils;
import net.micode.notes.tool.ResourceParser;
import net.micode.notes.tool.ResourceParser.TextAppearanceResources;
import net.micode.notes.ui.DateTimePickerDialog.OnDateTimeSetListener;
import net.micode.notes.ui.NoteEditText.OnTextViewChangeListener;
import net.micode.notes.widget.NoteWidgetProvider_2x;
import net.micode.notes.widget.NoteWidgetProvider_4x;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class LoginActivity extends Activity{
private EditText accountEdit;
private EditText passwordEdit;
private Button login;
private Button cancel;
private Button change;
private long last_login_time = 0 ;
public static final long MAX_LOGIN_TIME = 9999999;
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
SharedPreferences pref=getSharedPreferences("user management",MODE_PRIVATE);
boolean user_boolean = pref.getBoolean("user",false);//获取用户是否设置了密码
if(!user_boolean) //User_boolean = false时没有设置密码直接跳转到便签主界面
{
SharedPreferences.Editor editor=getSharedPreferences("user management", MODE_PRIVATE).edit();
editor.putString("password","123456");
editor.putBoolean("user",true);
editor.apply();
}
SharedPreferences login_time_get = getSharedPreferences("login time",MODE_PRIVATE);
boolean is_first_login = login_time_get.getBoolean("is_first_login",false);
setContentView(R.layout.login_activity);
accountEdit = (EditText) findViewById(R.id.account);
passwordEdit = (EditText) findViewById(R.id.password);
login = (Button) findViewById(R.id.login);
cancel = (Button) findViewById(R.id.cancel);
change = (Button) findViewById(R.id.change_password);
long current_time = System.currentTimeMillis();
cancel.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Toast.makeText(LoginActivity.this, R.string.app_already_quit, Toast.LENGTH_LONG).show();
finish();
}
});
Long current_login_time = login_time_get.getLong("current login time",0);
if((is_first_login)&&(current_time - current_login_time <= MAX_LOGIN_TIME)){
SharedPreferences.Editor editor=getSharedPreferences("login time", MODE_PRIVATE).edit();
editor.putLong("current login time",System.currentTimeMillis());
editor.apply();
Intent intent = new Intent(LoginActivity.this,NotesListActivity.class);
startActivity(intent);
finish();
}
else{
if(!is_first_login){
SharedPreferences.Editor editor=getSharedPreferences("login time", MODE_PRIVATE).edit();
editor.putLong("current login time",System.currentTimeMillis());
editor.putBoolean("is_first_login",true);
editor.apply();
}
login.setOnClickListener(new View.OnClickListener(){
public void onClick(View v) {
String account = accountEdit.getText().toString();
String password = passwordEdit.getText().toString();
SharedPreferences pref=getSharedPreferences("user management",MODE_PRIVATE);
String share_password=pref.getString("password","");
if(account.equals("hei") && password.equals(share_password)){
ProgressDialog progressDialog = new ProgressDialog(LoginActivity.this);
progressDialog.setTitle(R.string.Loading);
progressDialog.setMessage("Loading...");
progressDialog.setCancelable(true);
progressDialog.show();;
Intent intent = new Intent(LoginActivity.this,NotesListActivity.class);
startActivity(intent);
finish();
}else {
Toast.makeText(LoginActivity.this, R.string.invalid,Toast.LENGTH_SHORT).show();
}
}
});
change.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
Intent intent = new Intent(LoginActivity.this,ChangeLoginPasswordActivity.class);
startActivity(intent);
finish();
}
});
}
}
}

@ -0,0 +1,76 @@
package net.micode.notes.ui;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.AlertDialog;
import android.app.PendingIntent;
import android.app.SearchManager;
import android.appwidget.AppWidgetManager;
import android.content.ContentUris;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Paint;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.text.style.BackgroundColorSpan;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import net.micode.notes.R;
import net.micode.notes.data.Notes;
import net.micode.notes.data.Notes.TextNote;
import net.micode.notes.model.WorkingNote;
import net.micode.notes.model.WorkingNote.NoteSettingChangedListener;
import net.micode.notes.tool.DataUtils;
import net.micode.notes.tool.ResourceParser;
import net.micode.notes.tool.ResourceParser.TextAppearanceResources;
import net.micode.notes.ui.DateTimePickerDialog.OnDateTimeSetListener;
import net.micode.notes.ui.NoteEditText.OnTextViewChangeListener;
import net.micode.notes.widget.NoteWidgetProvider_2x;
import net.micode.notes.widget.NoteWidgetProvider_4x;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class LoginView extends Activity
{
Handler mHandler=new Handler();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.login_view);
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(LoginView.this, LoginActivity.class);
startActivity(intent);
finish();
}
},2000);
}
}

@ -19,6 +19,7 @@ package net.micode.notes.ui;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.PendingIntent;
import android.app.SearchManager;
import android.appwidget.AppWidgetManager;
@ -27,7 +28,9 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.AssetManager;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.Spannable;
@ -43,6 +46,7 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
@ -68,6 +72,7 @@ import net.micode.notes.widget.NoteWidgetProvider_4x;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -91,6 +96,8 @@ public class NoteEditActivity extends Activity implements OnClickListener,
sBgSelectorBtnsMap.put(R.id.iv_bg_blue, ResourceParser.BLUE);
sBgSelectorBtnsMap.put(R.id.iv_bg_green, ResourceParser.GREEN);
sBgSelectorBtnsMap.put(R.id.iv_bg_white, ResourceParser.WHITE);
sBgSelectorBtnsMap.put(R.id.iv_ph_duck, ResourceParser.DUCK);
}
private static final Map<Integer, Integer> sBgSelectorSelectionMap = new HashMap<Integer, Integer>();
@ -100,8 +107,10 @@ public class NoteEditActivity extends Activity implements OnClickListener,
sBgSelectorSelectionMap.put(ResourceParser.BLUE, R.id.iv_bg_blue_select);
sBgSelectorSelectionMap.put(ResourceParser.GREEN, R.id.iv_bg_green_select);
sBgSelectorSelectionMap.put(ResourceParser.WHITE, R.id.iv_bg_white_select);
}
sBgSelectorSelectionMap.put(ResourceParser.DUCK, R.id.iv_ph_duck_select);
}//
//选择便签字体大小的界选择器的吧
private static final Map<Integer, Integer> sFontSizeBtnsMap = new HashMap<Integer, Integer>();
static {
sFontSizeBtnsMap.put(R.id.ll_font_large, ResourceParser.TEXT_LARGE);
@ -269,11 +278,20 @@ public class NoteEditActivity extends Activity implements OnClickListener,
}
private void initNoteScreen() {
String defaultText = getIntent().getStringExtra(Notes.INTENT_EXTRA_TEMPLE_TEXT);
if(defaultText!=null){
saveNote();//否则会增加一个null的奇怪现象
mWorkingNote.setWorkingText(mWorkingNote.getContent()+defaultText);
mNoteEditor.setText(mWorkingNote.getContent()); // 将defaultText的值写入到笔记编辑器中
}
// Toast.makeText(getApplicationContext(), defaultText, Toast.LENGTH_SHORT).show();
mNoteEditor.setTextAppearance(this, TextAppearanceResources
.getTexAppearanceResource(mFontSizeId));
if (mWorkingNote.getCheckListMode() == TextNote.MODE_CHECK_LIST) {
switchToListMode(mWorkingNote.getContent());
} else {
;
mNoteEditor.setText(getHighlightQueryResult(mWorkingNote.getContent(), mUserQuery));
mNoteEditor.setSelection(mNoteEditor.getText().length());
}
@ -287,6 +305,43 @@ public class NoteEditActivity extends Activity implements OnClickListener,
mWorkingNote.getModifiedDate(), DateUtils.FORMAT_SHOW_DATE
| DateUtils.FORMAT_NUMERIC_DATE | DateUtils.FORMAT_SHOW_TIME
| DateUtils.FORMAT_SHOW_YEAR));
// String mPassword=mWorkingNote.getPassword();
// if (mWorkingNote.getPassword()!=null){
// final AlertDialog.Builder builder = new AlertDialog.Builder(this);
// View view = LayoutInflater.from(this).inflate(R.layout.dialog_edit_text, null);
// //编辑Text
// final EditText etName = (EditText) view.findViewById(R.id.et_foler_name);
// etName.setText("");
// etName.setHint("请输入密码");
// builder.setTitle("密码检验");
// builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
// @Override
// public void onClick(DialogInterface dialog, int which) {
// //获取输入的字符串
// String password = etName.getText().toString();
// Log.d("mPassword: ", mPassword);
// Log.d("password: ", password);
// //判断密码正确性
// if (!password.equals(mPassword)) {
// Log.d("密码不正确,正确密码是:",mPassword);
// dialog.dismiss();
// onBackPressed();
// }
// }
// });
// builder.setNegativeButton("cancel", new DialogInterface.OnClickListener(){
// @Override
// public void onClick(DialogInterface dialog, int which) {
// dialog.dismiss();
// onBackPressed();
// }
// });
// final Dialog dialog = builder.setView(view).show();
// dialog.show();
// }
// else{
// Toast.makeText(NoteEditActivity.this,"还没有设置密码", Toast.LENGTH_SHORT).show();
// }
/**
* TODO: Add the menu for setting alert. Currently disable it because the DateTimePicker
@ -540,6 +595,102 @@ public class NoteEditActivity extends Activity implements OnClickListener,
} else if (itemId == R.id.menu_delete_remind) {
mWorkingNote.setAlertDate(0, false);
}
else if (itemId == R.id.menu_enter_private_mode){
if(mWorkingNote.getPassword()==null){
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
View view = LayoutInflater.from(this).inflate(R.layout.dialog_edit_text,null);
final EditText etName = (EditText)view.findViewById(R.id.et_foler_name);
etName.setText("");
etName.setHint("请输入密码");
builder.setTitle("为便签设置新密码");
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String password = etName.getText().toString();
mWorkingNote.setPassword(password);
if ( mWorkingNote.getPassword() != null ){
Toast.makeText(NoteEditActivity.this,"密码设置成功", Toast.LENGTH_SHORT).show();
}
InputMethodManager inputMethodManager =(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(etName.getWindowToken(),0);
dialog.dismiss();
}
});
builder.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
InputMethodManager inputMethodManager = (InputMethodManager)
getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(etName.getWindowToken(),0);
}
});
final Dialog dialog = builder.setView(view).show();
}
} else if (itemId==R.id.menu_select_font) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("选择字体")
.setItems(new CharSequence[]{"默认字体", "仿宋_GB2312", "姚体", "宋体","忍者体","楷体","黑体"}, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
switch (which) {
case 0:
// 创建空的模板
// createEmptyTemplate();
mNoteEditor.setTypeface(Typeface.DEFAULT);
break;
case 1:
// 创建模板 1
// createTemplate("模板 1");
// AssetManager mgr = getAssets();
Typeface tf1=Typeface.createFromAsset(getAssets(),"font/fs.ttf");
mNoteEditor.setTypeface(tf1);
break;
case 2:
Typeface tf2=Typeface.createFromAsset(getAssets(),"font/fzytk.TTF");
mNoteEditor.setTypeface(tf2);
break;
case 3:
// 创建模板 3
// createTemplate("模板 3");
Typeface tf3=Typeface.createFromAsset(getAssets(),"font/stsong.TTF");
mNoteEditor.setTypeface(tf3);
break;
case 4:
Typeface tf4=Typeface.createFromAsset(getAssets(),"font/fzrzt.TTF");
mNoteEditor.setTypeface(tf4);
break;
case 5:
Typeface tf5=Typeface.createFromAsset(getAssets(),"font/kt.ttf");
mNoteEditor.setTypeface(tf5);
break;
case 6:
Typeface tf6=Typeface.createFromAsset(getAssets(),"font/simhei.ttf");
mNoteEditor.setTypeface(tf6);
break;
}
}
});
builder.setPositiveButton("OK", new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(NoteEditActivity.this,"字体设置成功", Toast.LENGTH_SHORT).show();
dialog.dismiss();
}
});
builder.setNegativeButton("cancle", new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(NoteEditActivity.this,"字体设置失败", Toast.LENGTH_SHORT).show();
dialog.dismiss();
} });
final Dialog dialog = builder.show();
}
return true;
}

@ -39,7 +39,7 @@ public class NoteItemData {
NoteColumns.SNIPPET,
NoteColumns.TYPE,
NoteColumns.WIDGET_ID,
NoteColumns.WIDGET_TYPE,
NoteColumns.WIDGET_TYPE, NoteColumns.PASSWORD
};
private static final int ID_COLUMN = 0;
@ -54,6 +54,7 @@ public class NoteItemData {
private static final int TYPE_COLUMN = 9;
private static final int WIDGET_ID_COLUMN = 10;
private static final int WIDGET_TYPE_COLUMN = 11;
private static final int PASSWORD_COLUMN = 12;//这里事实上还在存疑,时候需要增加一个列用于索引。
private long mId;
private long mAlertDate;
@ -70,6 +71,8 @@ public class NoteItemData {
private String mName;
private String mPhoneNumber;
private String mPassword;
private boolean mIsLastItem;
private boolean mIsFirstItem;
private boolean mIsOnlyOneItem;
@ -91,6 +94,8 @@ public class NoteItemData {
mType = cursor.getInt(TYPE_COLUMN);
mWidgetId = cursor.getInt(WIDGET_ID_COLUMN);
mWidgetType = cursor.getInt(WIDGET_TYPE_COLUMN);
mPassword =cursor.getString(PASSWORD_COLUMN);
mPhoneNumber = "";
if (mParentId == Notes.ID_CALL_RECORD_FOLDER) {
@ -197,6 +202,9 @@ public class NoteItemData {
public int getType() {
return mType;
}
public String getmPassword(){
return mPassword;
}
public int getWidgetType() {
return mWidgetType;
@ -221,4 +229,11 @@ public class NoteItemData {
public static int getNoteType(Cursor cursor) {
return cursor.getInt(TYPE_COLUMN);
}
public boolean hasPassword(){
if(mPassword.length()!=0&&mPassword!=null){
return true;
}
return false;
}
}

@ -466,6 +466,18 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
intent.putExtra(Notes.INTENT_EXTRA_FOLDER_ID, mCurrentFolderId);
this.startActivityForResult(intent, REQUEST_CODE_NEW_NODE);
}
private void createTempelNote(int num){
String temple1="Time:\nClass:\nTeacher:\nScore:\n";
String temple2="Group:\nLeader:\nNumber:\nScore:\n";
String temple3="早操:\n早餐\n第一节课\n";
String[] temple= {temple1,temple2,temple2};
Intent intent = new Intent(this, NoteEditActivity.class);
intent.setAction(Intent.ACTION_INSERT_OR_EDIT);
intent.putExtra(Notes.INTENT_EXTRA_FOLDER_ID, mCurrentFolderId);
intent.putExtra(Notes.INTENT_EXTRA_TEMPLE_TEXT,temple[num-1]);
this.startActivityForResult(intent, REQUEST_CODE_NEW_NODE);
}
private void batchDelete() {
new AsyncTask<Void, Void, HashSet<AppWidgetAttribute>>() {
@ -557,7 +569,8 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
public void onClick(View v) {
if (v.getId() == R.id.btn_new_note) {
createNewNote();
selectCreatemode(this);
// createNewNote();
}
}
@ -622,11 +635,28 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
});
}
} else if (!TextUtils.isEmpty(name)) {
//如果在根文件夹中创建
if (mCurrentFolderId == Notes.ID_ROOT_FOLDER){
//创建一个ContentValues对象
ContentValues values = new ContentValues();
values.put(NoteColumns.SNIPPET, name);
values.put(NoteColumns.TYPE, Notes.TYPE_FOLDER);
mContentResolver.insert(Notes.CONTENT_NOTE_URI, values);
}
//如果在子文件夹中创建
else {
//创建一个ContentValues对象
ContentValues values = new ContentValues();
//将输入的文本添加到ContentValues对象中
values.put(NoteColumns.SNIPPET, name);
values.put(NoteColumns.TYPE, Notes.TYPE_FOLDER);
values.put(NoteColumns.PARENT_ID, String.valueOf(mCurrentFolderId));
//插入新记录
mContentResolver.insert(Notes.CONTENT_NOTE_URI, values);
}
}
//关闭对话框
dialog.dismiss();
}
});
@ -877,7 +907,7 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
|| item.getType() == Notes.TYPE_SYSTEM) {
openFolder(item);
} else if (item.getType() == Notes.TYPE_NOTE) {
openNode(item);
testNode(item);
} else {
Log.e(TAG, "Wrong note type in NOTE_LIST");
}
@ -885,8 +915,12 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
case SUB_FOLDER:
case CALL_RECORD_FOLDER:
if (item.getType() == Notes.TYPE_NOTE) {
openNode(item);
} else {
testNode(item);
// openNode(item);
}else if (item.getType() == Notes.TYPE_FOLDER
|| item.getType() == Notes.TYPE_SYSTEM) {
openFolder(item);}
else {
Log.e(TAG, "Wrong note type in SUB_FOLDER");
}
break;
@ -932,4 +966,99 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
}
return false;
}
public void testNode(final NoteItemData item){
//if (!item.getmPassword().equals("1"))//判断是否有密码,如果没有密码,直接打开即可
if(item.getmPassword()!=null && !item.getmPassword().equals(""))
{
final AlertDialog.Builder builder = new AlertDialog.Builder(this);//初始化对话框
builder.setTitle("验证密码");
View view = LayoutInflater.from(this).inflate(R.layout.pwd, null);//加载对话框的布局文件
final EditText editPwd = (EditText) view.findViewById(R.id.set_password);//初始化对话框里的文本对象
editPwd.setHint("输入隐私密码");
builder.setPositiveButton(android.R.string.ok, null);//确定按钮
builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {//取消按钮
hideSoftInput(editPwd);//隐藏软键盘
}
});
showSoftInput();//显示软键盘
final Dialog dialog = builder.setView(view).show();//显示出来
final Button positive = (Button)dialog.findViewById(android.R.id.button1);//加载确定按钮布局文件
positive.setOnClickListener(new OnClickListener() {
public void onClick(View v) {//设置确定按钮的接收器
hideSoftInput(editPwd);//点击确定后收起软键盘
String Password = editPwd.getText().toString();//文本框里的输入值
String mPassword=item.getmPassword();
if (TextUtils.isEmpty(Password) || Password.equals(mPassword)) {//输入不为空
// Toast.makeText(getApplicationContext(), Password, Toast.LENGTH_SHORT).show();
Toast.makeText(NotesListActivity.this,"密码正确", Toast.LENGTH_SHORT).show();
// inputPwd = Password;
openNode(item);
dialog.dismiss();//撤销对话框
}else{
Toast.makeText(NotesListActivity.this,"密码错误", Toast.LENGTH_SHORT).show();
editPwd.setText("");
dialog.show();
}
}
});
if (TextUtils.isEmpty(editPwd.getText())) {//如果文件夹名称为空,则不能选择确定按钮
positive.setEnabled(false);
}
editPwd.addTextChangedListener(new TextWatcher() {//添加文本更改监听器,即判断文本更改状态
public void beforeTextChanged(CharSequence s, int start, int count, int after) {//文本更改之前(未完成)
// TODO Auto-generated method stub
}
public void onTextChanged(CharSequence s, int start, int before, int count) {//当前文本改变触发,
if (TextUtils.isEmpty(editPwd.getText())) {//文本为空确定按键不可用,不为空则可用
positive.setEnabled(false);
} else {
positive.setEnabled(true);
}
}
public void afterTextChanged(Editable s) {//文本修改之后(未完成)
// TODO Auto-generated method stub
}
});
} else {
openNode(item);
}
}
public void selectCreatemode(Context context){
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("选择模板")
.setItems(new CharSequence[]{"创建空新模板", "创建模板 1", "创建模板 2", "创建模板 3"}, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
switch (which) {
case 0:
// 创建空的模板
createNewNote();
break;
case 1:
// 创建模板 1
createTempelNote(1);
// createTemplate("模板 1");
break;
case 2:
// 创建模板 2
createTempelNote(2);
// break;
case 3:
// 创建模板 3
createTempelNote(3);
break;
}
}
})
.show();
}
}

@ -32,6 +32,7 @@ import net.micode.notes.tool.ResourceParser.NoteItemBgResources;
public class NotesListItem extends LinearLayout {
private ImageView mAlert;
private ImageView mLock;
private TextView mTitle;
private TextView mTime;
private TextView mCallName;
@ -84,8 +85,16 @@ public class NotesListItem extends LinearLayout {
+ context.getString(R.string.format_folder_files_count,
data.getNotesCount()));
mAlert.setVisibility(View.GONE);
// if(data.has)
} else {
mTitle.setText(DataUtils.getFormattedSnippet(data.getSnippet()));
if(data.getmPassword()==null){
mTitle.setText(DataUtils.getFormattedSnippet(data.getSnippet()));
}else {
mTitle.setText("便签已加密");
}
//
// mTitle.setText("Jiami");
if (data.hasAlert()) {
mAlert.setImageResource(R.drawable.clock);
mAlert.setVisibility(View.VISIBLE);

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 789 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="输入原有密码:"/>
<EditText
android:id="@+id/old_password"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:password="true"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="输入新建密码:"/>
<EditText
android:id="@+id/new_password"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:password="true"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="再次输入密码:"/>
<EditText
android:id="@+id/ack_password"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:password="true"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center">
<Button
android:id="@+id/Bt_Acknowledged"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="确认"/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.LoginActivity"
android:orientation="vertical">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_gravity="center">
<TextView
android:layout_width="90dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textSize="18sp"
android:text="@string/prompt_account" />
<EditText
android:id="@+id/account"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_gravity="center">
<TextView
android:layout_width="90dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/prompt_password"
android:textSize="18sp" />
<EditText
android:id="@+id/password"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:inputType="textPassword" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_gravity="center">
<Button
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/prompt_login" />
<Button
android:id="@+id/cancel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/cancel" />
<Button
android:id="@+id/change_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text='修改密码'/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/login_view_photo_2">
<TextView
android:id="@+id/login_view_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:keepScreenOn="true"
android:text="快放假了家人们"
android:textSize="50sp"
android:textStyle="bold"
android:textColor="#1CAC78"
/>
</LinearLayout>

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:id="@+id/editTextText"
android:layout_width="match_parent"
android:layout_height="182dp"
android:layout_weight="@android:dimen/dialog_min_width_major"
android:ems="20"
android:gravity="center"
android:inputType="text"
android:text="选择你的模版"
android:textSize="50sp"
android:visibility="visible" />
</LinearLayout>

@ -46,6 +46,12 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@drawable/title_alert" />
<!-- <ImageView-->
<!-- android:id="@+id/iv_alert_lock"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_gravity="center_vertical"-->
<!-- android:background="@drawable/lock_private" />-->
<TextView
android:id="@+id/tv_alert_date"
@ -127,7 +133,7 @@
android:id="@+id/note_bg_color_selector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/note_edit_color_selector_panel"
android:background="@drawable/note_edit_color_selector_panel_test"
android:layout_marginTop="30dip"
android:layout_marginRight="8dip"
android:layout_gravity="top|right"
@ -235,6 +241,26 @@
android:visibility="gone"
android:src="@drawable/selected" />
</FrameLayout>
<FrameLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:id="@+id/iv_ph_duck"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ImageView
android:id="@+id/iv_ph_duck_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:focusable="false"
android:visibility="gone"
android:src="@drawable/selected" />
</FrameLayout>
</LinearLayout>
<LinearLayout

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<EditText
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/set_password"
android:layout_width="fill_parent"
android:hint="@string/hint_foler_name"
android:layout_height="fill_parent" />

@ -25,6 +25,9 @@
<item
android:id="@+id/menu_delete"
android:title="@string/menu_delete"/>
<item
android:id="@+id/menu_select_font"
android:title="Select font"/>
<item
android:id="@+id/menu_font_size"
@ -49,4 +52,10 @@
<item
android:id="@+id/menu_delete_remind"
android:title="@string/menu_remove_remind" />
<item
android:id="@+id/menu_enter_private_mode"
android:title="Enter private mode"/>
</menu>

@ -21,4 +21,7 @@
<item
android:id="@+id/menu_new_note"
android:title="@string/notelist_menu_new"/>
</menu>
<item
android:id="@+id/menu_new_folder"
android:title="@string/menu_create_folder"/>
</menu>

@ -132,4 +132,16 @@
<item quantity="other"><xliff:g id="number" example="15">%1$s</xliff:g> results for \"<xliff:g id="search" example="???">%2$s</xliff:g>\"</item>
</plurals>
<string name="login_view_text">玛卡巴卡斗志昂扬</string>
<string name="activity_login_view">LoginView</string>
<string name="prompt_account">用户名:</string>
<string name="prompt_password">密码:</string>
<string name="prompt_login">登录</string>
<string name="cancel">取消</string>
<string name="app_already_quit">程序已退出</string>
<string name="Loading">正在登录,你给我等着</string>
<string name="invalid">有人抢银行啦</string>
<string name="font_mode_change">Font mode change</string>
</resources>

@ -63,7 +63,7 @@
</style>
<style name="NoteActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">
<item name="android:displayOptions" />
<item name="android:visibility">gone</item>
<!--<item name="android:displayOptions"/>-->
<item name="android:visibility">visible</item>
</style>
</resources>
</resources>

Loading…
Cancel
Save