diff --git a/src/AndroidManifest.xml b/src/AndroidManifest.xml new file mode 100644 index 0000000..dc82d02 --- /dev/null +++ b/src/AndroidManifest.xml @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/net/micode/notes/ui/Changepassword.java b/src/net/micode/notes/ui/Changepassword.java new file mode 100644 index 0000000..3f344de --- /dev/null +++ b/src/net/micode/notes/ui/Changepassword.java @@ -0,0 +1,78 @@ +package net.micode.notes.ui; + +import android.app.Activity; +import android.content.Intent; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.EditText; +import android.widget.Toast; + +import net.micode.notes.R; + +public class Changepassword extends Activity{ + EditText OldPassword; + EditText NewPassword; + EditText AckPassword; + Button Acknowledged; + + @Override + protected void onCreate(Bundle savedInstanceState){ + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_change_password); + 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); + AckPassword=(EditText) findViewById(R.id.ack_password); + Acknowledged=(Button)findViewById(R.id.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 = AckPassword.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(ChangingPassword.this, "密码不能为空", + Toast.LENGTH_SHORT).show(); + } + else if (new_password.equals(ack_password) == false) { + Toast.makeText(ChangingPassword.this, "新建密码与重复密码不匹配, + 请重新输入密码", Toast.LENGTH_SHORT).show(); + AckPassword.setText(""); + } + else if(old_password.equals(login_password) == false){ + Toast.makeText(ChangingPassword.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(ChangingPassword.this, "修改密码成功", + Toast.LENGTH_SHORT).show(); + Intent intent=new + Intent(ChangingPassword.this,NotesListActivity.class); + startActivity(intent); + finish(); + } + } + }); + } + @Override + public void onBackPressed(){ + Intent intent=new Intent(ChangingPassword.this,NotesListActivity.class); + startActivity(intent); + finish(); + } +} + diff --git a/src/net/micode/notes/ui/ChangingPassword.java b/src/net/micode/notes/ui/ChangingPassword.java new file mode 100644 index 0000000..54c869b --- /dev/null +++ b/src/net/micode/notes/ui/ChangingPassword.java @@ -0,0 +1,71 @@ +package net.micode.notes.ui; + +import android.app.Activity; +import android.content.Intent; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.EditText; +import android.widget.Toast; + +import net.micode.notes.R; + +public class ChangingPassword extends Activity{ + EditText OldPassword; + EditText NewPassword; + EditText AckPassword; + Button Acknowledged; + + @Override + protected void onCreate(Bundle savedInstanceState){ + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_change_password); + 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); + AckPassword=(EditText) findViewById(R.id.ack_password); + Acknowledged=(Button)findViewById(R.id.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 = AckPassword.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(ChangingPassword.this, "密码不能为空", Toast.LENGTH_SHORT).show(); + } + else if (new_password.equals(ack_password) == false) { + Toast.makeText(ChangingPassword.this, "新建密码与重复密码不匹配,请重新输入密码", Toast.LENGTH_SHORT).show(); + AckPassword.setText(""); + } + else if(old_password.equals(login_password) == false){ + Toast.makeText(ChangingPassword.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(ChangingPassword.this, "修改密码成功",Toast.LENGTH_SHORT).show(); + Intent intent=new + Intent(ChangingPassword.this,NotesListActivity.class); + startActivity(intent); + finish(); + } + } + }); + } + @Override + public void onBackPressed(){ + Intent intent=new Intent(ChangingPassword.this,NotesListActivity.class); + startActivity(intent); + finish(); + } +} + diff --git a/src/net/micode/notes/ui/DeletingPassword.java b/src/net/micode/notes/ui/DeletingPassword.java new file mode 100644 index 0000000..82cbb76 --- /dev/null +++ b/src/net/micode/notes/ui/DeletingPassword.java @@ -0,0 +1,62 @@ +package net.micode.notes.ui; + +import android.app.Activity; +import android.content.Intent; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.EditText; +import android.widget.Toast; + +import net.micode.notes.R; + +public class DeletingPassword extends Activity { + EditText Dt_password; + Button Acknowledged; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_delete_password); + getWindow().setSoftInputMode( + WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE + | WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); + Dt_password=(EditText) findViewById(R.id.thepassword); + Acknowledged=(Button)findViewById(R.id.Dt_Acknowledged); + Acknowledged.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + String text02 = Dt_password.getText().toString(); + if(text02.equals("")==true) + Toast.makeText(DeletingPassword.this, "密码不能为空", + Toast.LENGTH_SHORT).show(); + SharedPreferences pref=getSharedPreferences("user management",MODE_PRIVATE); + String password = pref.getString("password",""); + if(password.equals("")==false&&password.equals(text02)==true){ + SharedPreferences.Editor editor=getSharedPreferences("user management", MODE_PRIVATE).edit(); + editor.putBoolean("user",false);//false 表示已经设置登录密码 + editor.putString("password",""); + editor.apply(); + Toast.makeText(DeletingPassword.this, "已经删除登录密码", + Toast.LENGTH_SHORT).show(); + Intent intent=new + Intent(DeletingPassword.this,NotesListActivity.class); + startActivity(intent); + finish(); + } + else{ + Toast.makeText(DeletingPassword.this, "密码错误", + Toast.LENGTH_SHORT).show(); + Dt_password.setText("");//把密码框内输入过的错误密码清空 + } + } + }); + } + @Override + public void onBackPressed() { + Intent intent=new Intent(DeletingPassword.this,NotesListActivity.class); + startActivity(intent); + finish(); + } +} \ No newline at end of file diff --git a/src/net/micode/notes/ui/LoginActivity.java b/src/net/micode/notes/ui/LoginActivity.java new file mode 100644 index 0000000..d87b98c --- /dev/null +++ b/src/net/micode/notes/ui/LoginActivity.java @@ -0,0 +1,55 @@ +package net.micode.notes.ui; + +import android.content.Intent; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.EditText; +import android.widget.Toast; +import android.app.Activity; + +import net.micode.notes.R; + +public class LoginActivity extends Activity{ + + EditText lgn_password; + Button lgn_login; + + @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) { //如果用户没有设置密码,则直接跳转到便签主界面 + Intent intent = new Intent(LoginActivity.this, NotesListActivity.class); + startActivity(intent); + finish(); + } + + setContentView(R.layout.activity_login); + getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); + lgn_password = (EditText)findViewById(R.id.lgn_password); + lgn_login = (Button) findViewById(R.id.login); + lgn_login.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + SharedPreferences pref = getSharedPreferences("user management", MODE_PRIVATE); + String password = pref.getString("password", ""); + if (password.equals(" ") == false && password.equals(lgn_password.getText().toString()) == true) { + Intent intent = new Intent(LoginActivity.this, NotesListActivity.class); + startActivity(intent); + finish(); + } else { + Toast.makeText(LoginActivity.this, "密码错误", Toast.LENGTH_SHORT).show(); + lgn_password.setText(""); //清空密码框内的输入 + } + + } + } + ); + } +} + + diff --git a/src/net/micode/notes/ui/NoteEditActivity.java b/src/net/micode/notes/ui/NoteEditActivity.java index b67920a..43a7060 100644 --- a/src/net/micode/notes/ui/NoteEditActivity.java +++ b/src/net/micode/notes/ui/NoteEditActivity.java @@ -47,6 +47,7 @@ import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.EditText; +import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; @@ -85,8 +86,10 @@ public class NoteEditActivity extends Activity implements OnClickListener, public ImageView ibSetBgColor; } + //使用Map实现数据存储 private static final Map sBgSelectorBtnsMap = new HashMap(); + static { sBgSelectorBtnsMap.put(R.id.iv_bg_yellow, ResourceParser.YELLOW); sBgSelectorBtnsMap.put(R.id.iv_bg_red, ResourceParser.RED); @@ -97,6 +100,7 @@ public class NoteEditActivity extends Activity implements OnClickListener, } private static final Map sBgSelectorSelectionMap = new HashMap(); + static { sBgSelectorSelectionMap.put(ResourceParser.YELLOW, R.id.iv_bg_yellow_select); sBgSelectorSelectionMap.put(ResourceParser.RED, R.id.iv_bg_red_select); @@ -107,6 +111,7 @@ public class NoteEditActivity extends Activity implements OnClickListener, } private static final Map sFontSizeBtnsMap = new HashMap(); + static { sFontSizeBtnsMap.put(R.id.ll_font_large, ResourceParser.TEXT_LARGE); sFontSizeBtnsMap.put(R.id.ll_font_small, ResourceParser.TEXT_SMALL); @@ -116,6 +121,7 @@ public class NoteEditActivity extends Activity implements OnClickListener, } private static final Map sFontSelectorSelectionMap = new HashMap(); + static { sFontSelectorSelectionMap.put(ResourceParser.TEXT_LARGE, R.id.iv_large_select); sFontSelectorSelectionMap.put(ResourceParser.TEXT_SMALL, R.id.iv_small_select); @@ -220,7 +226,7 @@ public class NoteEditActivity extends Activity implements OnClickListener, getWindow().setSoftInputMode( WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); - } else if(TextUtils.equals(Intent.ACTION_INSERT_OR_EDIT, intent.getAction())) { + } else if (TextUtils.equals(Intent.ACTION_INSERT_OR_EDIT, intent.getAction())) { // New note // intent.getAction() // 大多用于broadcast发送广播时给机制(intent)设置一个action,就是一个字符串 @@ -287,6 +293,7 @@ public class NoteEditActivity extends Activity implements OnClickListener, super.onResume(); initNoteScreen(); //调用方法初始化笔记屏幕 } + //初始化笔记界面的方法 private void initNoteScreen() { //设置笔记编辑器的文字样式 @@ -341,8 +348,10 @@ public class NoteEditActivity extends Activity implements OnClickListener, //没有提醒时,隐藏提醒日期和图标 mNoteHeaderHolder.tvAlertDate.setVisibility(View.GONE); mNoteHeaderHolder.ivAlertIcon.setVisibility(View.GONE); - }; + } + ; } + //当活动通过意图重新初始化时调用 @Override protected void onNewIntent(Intent intent) { @@ -390,7 +399,7 @@ public class NoteEditActivity extends Activity implements OnClickListener, //判断触摸事件是否在给定的视图的范围内的方法 private boolean inRangeOfView(View view, MotionEvent ev) { - int []location = new int[2]; + int[] location = new int[2]; //获取视图在屏幕上的位置 view.getLocationOnScreen(location); int x = location[0]; @@ -400,8 +409,8 @@ public class NoteEditActivity extends Activity implements OnClickListener, || ev.getX() > (x + view.getWidth()) || ev.getY() < y || ev.getY() > (y + view.getHeight())) { - return false; - } + return false; + } return true; } @@ -429,7 +438,8 @@ public class NoteEditActivity extends Activity implements OnClickListener, for (int id : sFontSizeBtnsMap.keySet()) { View view = findViewById(id); view.setOnClickListener(this); - }; + } + ; //获取共享偏好设置,用于恢复特定的笔记属性,如字体的大小 mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); mFontSizeId = mSharedPrefs.getInt(PREFERENCE_FONT_SIZE, ResourceParser.BG_DEFAULT_FONT_SIZE); @@ -439,7 +449,7 @@ public class NoteEditActivity extends Activity implements OnClickListener, * return the {@link ResourceParser#BG_DEFAULT_FONT_SIZE} */ //如果字体大小ID超出资源数组大小,设置为默认字体大小 - if(mFontSizeId >= TextAppearanceResources.getResourcesSize()) { + if (mFontSizeId >= TextAppearanceResources.getResourcesSize()) { mFontSizeId = ResourceParser.BG_DEFAULT_FONT_SIZE; } //初始化笔记编辑列表视图 @@ -451,7 +461,7 @@ public class NoteEditActivity extends Activity implements OnClickListener, protected void onPause() { super.onPause(); //尝试保存笔记,如果成功则记录保存的长度 - if(saveNote()) { + if (saveNote()) { Log.d(TAG, "Note data was saved with length:" + mWorkingNote.getContent().length()); } //清除设置状态 @@ -473,14 +483,15 @@ public class NoteEditActivity extends Activity implements OnClickListener, return; } //添加小部件ID到intent中 - intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, new int[] { - mWorkingNote.getWidgetId() + intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, new int[]{ + mWorkingNote.getWidgetId() }); //发送广播以通知小部件更新 sendBroadcast(intent); //设置结果为OK setResult(RESULT_OK, intent); } + //处理点击事件 public void onClick(View v) { int id = v.getId(); @@ -488,8 +499,8 @@ public class NoteEditActivity extends Activity implements OnClickListener, if (id == R.id.btn_set_bg_color) { mNoteBgColorSelector.setVisibility(View.VISIBLE); findViewById(sBgSelectorSelectionMap.get(mWorkingNote.getBgColorId())).setVisibility( - - View.VISIBLE); - //更改背景颜色或字体大小的逻辑 + -View.VISIBLE); + //更改背景颜色或字体大小的逻辑 } else if (sBgSelectorBtnsMap.containsKey(id)) { findViewById(sBgSelectorSelectionMap.get(mWorkingNote.getBgColorId())).setVisibility( View.GONE); @@ -515,7 +526,7 @@ public class NoteEditActivity extends Activity implements OnClickListener, @Override public void onBackPressed() { //清除设置状态,如果已经处理则返回 - if(clearSettingState()) { + if (clearSettingState()) { return; } //保存笔记然后正常处理返回事件 @@ -620,7 +631,7 @@ public class NoteEditActivity extends Activity implements OnClickListener, d.setOnDateTimeSetListener(new OnDateTimeSetListener() { public void OnDateTimeSet(AlertDialog dialog, long date) { //当用户设置了日期时间后,将这个时间保存为提醒的时间 - mWorkingNote.setAlertDate(date , true); + mWorkingNote.setAlertDate(date, true); } }); //显示日期时间选择对话框 @@ -707,7 +718,7 @@ public class NoteEditActivity extends Activity implements OnClickListener, AlarmManager alarmManager = ((AlarmManager) getSystemService(ALARM_SERVICE)); //显示提醒的头部信息 showAlertHeader(); - if(!set) { + if (!set) { //如果set为false,取消任何现有的闹钟 alarmManager.cancel(pendingIntent); } else { @@ -745,7 +756,7 @@ public class NoteEditActivity extends Activity implements OnClickListener, mEditTextList.removeViewAt(index);//移除指定索引处的编辑框视图 NoteEditText edit = null; - if(index == 0) { //如果删除的是第一个编辑框 + if (index == 0) { //如果删除的是第一个编辑框 edit = (NoteEditText) mEditTextList.getChildAt(0).findViewById( R.id.et_edit_text); } else {//否则,获取欠一个编辑框 @@ -764,7 +775,7 @@ public class NoteEditActivity extends Activity implements OnClickListener, /** * Should not happen, check for debug */ - if(index > mEditTextList.getChildCount()) { + if (index > mEditTextList.getChildCount()) { Log.e(TAG, "Index out of mEditTextList boundrary, should not happen"); } //创建新的列表项视图,然后将其添加到列表中的指定位置 @@ -786,7 +797,7 @@ public class NoteEditActivity extends Activity implements OnClickListener, String[] items = text.split("\n");//按换行符拆分文本成多个项 int index = 0; for (String item : items) { - if(!TextUtils.isEmpty(item)) { //跳过空项 + if (!TextUtils.isEmpty(item)) { //跳过空项 mEditTextList.addView(getListItem(item, index));//添加列表项 index++; } @@ -862,7 +873,7 @@ public class NoteEditActivity extends Activity implements OnClickListener, return; } //根据文本是否存在来设置复选框的可见性 - if(hasText) { + if (hasText) { mEditTextList.getChildAt(index).findViewById(R.id.cb_edit_item).setVisibility(View.VISIBLE); } else { mEditTextList.getChildAt(index).findViewById(R.id.cb_edit_item).setVisibility(View.GONE); @@ -1000,4 +1011,19 @@ public class NoteEditActivity extends Activity implements OnClickListener, private void showToast(int resId, int duration) { Toast.makeText(this, resId, duration).show(); } + + + final ImageButton add_img_btn = (ImageButton) findViewById(R.id.add_img_btn); + add_img_btn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + log.d(TAG, "onClick: click add image button"); + Intent loadImage = new Intent(Intent.ACTION_GET_CONTENT); + loadImage.addCategory(Intent.CATEGORY_OPENABLE); + loadImage.setType("image/*"); + startActivityForResult(loadImage, PHOTO_REQUESt); + } + }); + } + diff --git a/src/net/micode/notes/ui/NoteEditText.java b/src/net/micode/notes/ui/NoteEditText.java index 07060b5..84a8239 100644 --- a/src/net/micode/notes/ui/NoteEditText.java +++ b/src/net/micode/notes/ui/NoteEditText.java @@ -187,9 +187,10 @@ public class NoteEditText extends EditText { if (mOnTextViewChangeListener != null) { if (!focused && TextUtils.isEmpty(getText())) { mOnTextViewChangeListener.onTextChange(mIndex, false); - } else { + } + else { mOnTextViewChangeListener.onTextChange(mIndex, true); - }9 + } } super.onFocusChanged(focused, direction, previouslyFocusedRect); } diff --git a/src/net/micode/notes/ui/SettingPassword.java b/src/net/micode/notes/ui/SettingPassword.java new file mode 100644 index 0000000..abc2fe5 --- /dev/null +++ b/src/net/micode/notes/ui/SettingPassword.java @@ -0,0 +1,66 @@ +package net.micode.notes.ui; + +import static android.content.Context.MODE_PRIVATE; +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; + +import net.micode.notes.R; + + +public class SettingPassword extends Activity { + EditText password; + EditText password_ack; + Button acknowledge; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_set_loginpassword); + getWindow().setSoftInputMode( + WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE + | WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); + password = (EditText) findViewById(R.id.password); + password_ack = (EditText) findViewById(R.id.password_ack); + acknowledge = (Button)findViewById(R.id.acknowledge); + acknowledge.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + String text02 = password.getText().toString(); + String text03 = password_ack.getText().toString(); + if(text02.equals("")==true) { + Toast.makeText(SettingPassword.this, "密码不能为空", Toast.LENGTH_SHORT).show(); + } + else if (text02.equals(text03) == false) { + Toast.makeText(SettingPassword.this, "密码错误,请重新输入密码 ", Toast.LENGTH_SHORT).show(); + password_ack.setText(""); + } + else if (text02.equals(text03) == true){ + SharedPreferences.Editor editor=getSharedPreferences("user management", MODE_PRIVATE).edit(); + editor.putBoolean("user",true); //true 表示已经设置登录密码 + editor.putString("password",text02); + editor.apply(); + Log.d("RegisterLoginPassword","password is "+text02); + Toast.makeText(SettingPassword.this, "密码设置成功", + Toast.LENGTH_SHORT).show(); + Intent intent=new + Intent(SettingPassword.this,NotesListActivity.class); + startActivity(intent); + finish(); + } + } + }); + } + @Override + public void onBackPressed() { + Intent intent=new Intent(SettingPassword.this,NotesListActivity.class); + startActivity(intent); + finish(); + } +} \ No newline at end of file diff --git a/src/net/micode/notes/ui/SplashActivity.java b/src/net/micode/notes/ui/SplashActivity.java new file mode 100644 index 0000000..973e297 --- /dev/null +++ b/src/net/micode/notes/ui/SplashActivity.java @@ -0,0 +1,29 @@ +package net.micode.notes.ui; +import android.annotation.SuppressLint; +import android.content.Intent; +import android.support.v7.app.ActionBar; +import android.support.v7.app.AppCompatActivity; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowInsets; +import net.micode.notes.R; +public class SplashActivity extends AppCompatActivity { + Handler mHandler=new Handler(); + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); //加载启动界面 + setContentView(R.layout.activity_splash); //加载启动 +// 当计时结束时,跳转至 NotesListActivity + mHandler.postDelayed(new Runnable() { + @Override + public void run() { + Intent intent = new Intent(); + intent.setClass(SplashActivity.this, LoginActivity.class); + startActivity(intent); + finish(); //销毁欢迎页面 + } + }, 2000); // 2 秒后跳转} diff --git a/src/res/color/primary_text_dark.xml b/src/res/color/primary_text_dark.xml new file mode 100644 index 0000000..8ad98e3 --- /dev/null +++ b/src/res/color/primary_text_dark.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/res/color/secondary_text_dark.xml b/src/res/color/secondary_text_dark.xml new file mode 100644 index 0000000..9cf8a1a --- /dev/null +++ b/src/res/color/secondary_text_dark.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/src/res/drawable-hdpi/bg_btn_set_color.png b/src/res/drawable-hdpi/bg_btn_set_color.png new file mode 100644 index 0000000..5eb5d44 Binary files /dev/null and b/src/res/drawable-hdpi/bg_btn_set_color.png differ diff --git a/src/res/drawable-hdpi/bg_color_btn_mask.png b/src/res/drawable-hdpi/bg_color_btn_mask.png new file mode 100644 index 0000000..100db77 Binary files /dev/null and b/src/res/drawable-hdpi/bg_color_btn_mask.png differ diff --git a/src/res/drawable-hdpi/call_record.png b/src/res/drawable-hdpi/call_record.png new file mode 100644 index 0000000..fb88ca4 Binary files /dev/null and b/src/res/drawable-hdpi/call_record.png differ diff --git a/src/res/drawable-hdpi/clock.png b/src/res/drawable-hdpi/clock.png new file mode 100644 index 0000000..5f2ae9a Binary files /dev/null and b/src/res/drawable-hdpi/clock.png differ diff --git a/src/res/drawable-hdpi/delete.png b/src/res/drawable-hdpi/delete.png new file mode 100644 index 0000000..643de3e Binary files /dev/null and b/src/res/drawable-hdpi/delete.png differ diff --git a/src/res/drawable-hdpi/dropdown_icon.9.png b/src/res/drawable-hdpi/dropdown_icon.9.png new file mode 100644 index 0000000..5525025 Binary files /dev/null and b/src/res/drawable-hdpi/dropdown_icon.9.png differ diff --git a/src/res/drawable-hdpi/edit_blue.9.png b/src/res/drawable-hdpi/edit_blue.9.png new file mode 100644 index 0000000..55a1856 Binary files /dev/null and b/src/res/drawable-hdpi/edit_blue.9.png differ diff --git a/src/res/drawable-hdpi/edit_green.9.png b/src/res/drawable-hdpi/edit_green.9.png new file mode 100644 index 0000000..2cb2d60 Binary files /dev/null and b/src/res/drawable-hdpi/edit_green.9.png differ diff --git a/src/res/drawable-hdpi/edit_red.9.png b/src/res/drawable-hdpi/edit_red.9.png new file mode 100644 index 0000000..bae944a Binary files /dev/null and b/src/res/drawable-hdpi/edit_red.9.png differ diff --git a/src/res/drawable-hdpi/edit_title_blue.9.png b/src/res/drawable-hdpi/edit_title_blue.9.png new file mode 100644 index 0000000..96e6092 Binary files /dev/null and b/src/res/drawable-hdpi/edit_title_blue.9.png differ diff --git a/src/res/drawable-hdpi/edit_title_green.9.png b/src/res/drawable-hdpi/edit_title_green.9.png new file mode 100644 index 0000000..08d8644 Binary files /dev/null and b/src/res/drawable-hdpi/edit_title_green.9.png differ diff --git a/src/res/drawable-hdpi/edit_title_red.9.png b/src/res/drawable-hdpi/edit_title_red.9.png new file mode 100644 index 0000000..9c430e5 Binary files /dev/null and b/src/res/drawable-hdpi/edit_title_red.9.png differ diff --git a/src/res/drawable-hdpi/edit_title_white.9.png b/src/res/drawable-hdpi/edit_title_white.9.png new file mode 100644 index 0000000..19e8d95 Binary files /dev/null and b/src/res/drawable-hdpi/edit_title_white.9.png differ diff --git a/src/res/drawable-hdpi/edit_title_yellow.9.png b/src/res/drawable-hdpi/edit_title_yellow.9.png new file mode 100644 index 0000000..bf8f580 Binary files /dev/null and b/src/res/drawable-hdpi/edit_title_yellow.9.png differ diff --git a/src/res/drawable-hdpi/edit_white.9.png b/src/res/drawable-hdpi/edit_white.9.png new file mode 100644 index 0000000..918f7a6 Binary files /dev/null and b/src/res/drawable-hdpi/edit_white.9.png differ diff --git a/src/res/drawable-hdpi/edit_yellow.9.png b/src/res/drawable-hdpi/edit_yellow.9.png new file mode 100644 index 0000000..10cb642 Binary files /dev/null and b/src/res/drawable-hdpi/edit_yellow.9.png differ diff --git a/src/res/drawable-hdpi/font_large.png b/src/res/drawable-hdpi/font_large.png new file mode 100644 index 0000000..78cf2e6 Binary files /dev/null and b/src/res/drawable-hdpi/font_large.png differ diff --git a/src/res/drawable-hdpi/font_normal.png b/src/res/drawable-hdpi/font_normal.png new file mode 100644 index 0000000..9de7ced Binary files /dev/null and b/src/res/drawable-hdpi/font_normal.png differ diff --git a/src/res/drawable-hdpi/font_size_selector_bg.9.png b/src/res/drawable-hdpi/font_size_selector_bg.9.png new file mode 100644 index 0000000..be8e64c Binary files /dev/null and b/src/res/drawable-hdpi/font_size_selector_bg.9.png differ diff --git a/src/res/drawable-hdpi/font_small.png b/src/res/drawable-hdpi/font_small.png new file mode 100644 index 0000000..d3ff104 Binary files /dev/null and b/src/res/drawable-hdpi/font_small.png differ diff --git a/src/res/drawable-hdpi/font_super.png b/src/res/drawable-hdpi/font_super.png new file mode 100644 index 0000000..85b13a1 Binary files /dev/null and b/src/res/drawable-hdpi/font_super.png differ diff --git a/src/res/drawable-hdpi/icon_app.png b/src/res/drawable-hdpi/icon_app.png new file mode 100644 index 0000000..418aadc Binary files /dev/null and b/src/res/drawable-hdpi/icon_app.png differ diff --git a/src/res/drawable-hdpi/list_background.png b/src/res/drawable-hdpi/list_background.png new file mode 100644 index 0000000..087e1f9 Binary files /dev/null and b/src/res/drawable-hdpi/list_background.png differ diff --git a/src/res/drawable-hdpi/list_blue_down.9.png b/src/res/drawable-hdpi/list_blue_down.9.png new file mode 100644 index 0000000..b88eebf Binary files /dev/null and b/src/res/drawable-hdpi/list_blue_down.9.png differ diff --git a/src/res/drawable-hdpi/list_blue_middle.9.png b/src/res/drawable-hdpi/list_blue_middle.9.png new file mode 100644 index 0000000..96b1c8b Binary files /dev/null and b/src/res/drawable-hdpi/list_blue_middle.9.png differ diff --git a/src/res/drawable-hdpi/list_blue_single.9.png b/src/res/drawable-hdpi/list_blue_single.9.png new file mode 100644 index 0000000..d7e7206 Binary files /dev/null and b/src/res/drawable-hdpi/list_blue_single.9.png differ diff --git a/src/res/drawable-hdpi/list_blue_up.9.png b/src/res/drawable-hdpi/list_blue_up.9.png new file mode 100644 index 0000000..632e88c Binary files /dev/null and b/src/res/drawable-hdpi/list_blue_up.9.png differ diff --git a/src/res/drawable-hdpi/list_folder.9.png b/src/res/drawable-hdpi/list_folder.9.png new file mode 100644 index 0000000..829f61b Binary files /dev/null and b/src/res/drawable-hdpi/list_folder.9.png differ diff --git a/src/res/drawable-hdpi/list_footer_bg.9.png b/src/res/drawable-hdpi/list_footer_bg.9.png new file mode 100644 index 0000000..5325c25 Binary files /dev/null and b/src/res/drawable-hdpi/list_footer_bg.9.png differ diff --git a/src/res/drawable-hdpi/list_green_down.9.png b/src/res/drawable-hdpi/list_green_down.9.png new file mode 100644 index 0000000..64a39d9 Binary files /dev/null and b/src/res/drawable-hdpi/list_green_down.9.png differ diff --git a/src/res/drawable-hdpi/list_green_middle.9.png b/src/res/drawable-hdpi/list_green_middle.9.png new file mode 100644 index 0000000..897325a Binary files /dev/null and b/src/res/drawable-hdpi/list_green_middle.9.png differ diff --git a/src/res/drawable-hdpi/list_green_single.9.png b/src/res/drawable-hdpi/list_green_single.9.png new file mode 100644 index 0000000..c83405f Binary files /dev/null and b/src/res/drawable-hdpi/list_green_single.9.png differ diff --git a/src/res/drawable-hdpi/list_green_up.9.png b/src/res/drawable-hdpi/list_green_up.9.png new file mode 100644 index 0000000..141f9e1 Binary files /dev/null and b/src/res/drawable-hdpi/list_green_up.9.png differ diff --git a/src/res/drawable-hdpi/list_red_down.9.png b/src/res/drawable-hdpi/list_red_down.9.png new file mode 100644 index 0000000..4224309 Binary files /dev/null and b/src/res/drawable-hdpi/list_red_down.9.png differ diff --git a/src/res/drawable-hdpi/list_red_middle.9.png b/src/res/drawable-hdpi/list_red_middle.9.png new file mode 100644 index 0000000..9988f17 Binary files /dev/null and b/src/res/drawable-hdpi/list_red_middle.9.png differ diff --git a/src/res/drawable-hdpi/list_red_single.9.png b/src/res/drawable-hdpi/list_red_single.9.png new file mode 100644 index 0000000..587c348 Binary files /dev/null and b/src/res/drawable-hdpi/list_red_single.9.png differ diff --git a/src/res/drawable-hdpi/list_red_up.9.png b/src/res/drawable-hdpi/list_red_up.9.png new file mode 100644 index 0000000..46b4757 Binary files /dev/null and b/src/res/drawable-hdpi/list_red_up.9.png differ diff --git a/src/res/drawable-hdpi/list_white_down.9.png b/src/res/drawable-hdpi/list_white_down.9.png new file mode 100644 index 0000000..29f9d8c Binary files /dev/null and b/src/res/drawable-hdpi/list_white_down.9.png differ diff --git a/src/res/drawable-hdpi/list_white_middle.9.png b/src/res/drawable-hdpi/list_white_middle.9.png new file mode 100644 index 0000000..77a4ab4 Binary files /dev/null and b/src/res/drawable-hdpi/list_white_middle.9.png differ diff --git a/src/res/drawable-hdpi/list_white_single.9.png b/src/res/drawable-hdpi/list_white_single.9.png new file mode 100644 index 0000000..3e79189 Binary files /dev/null and b/src/res/drawable-hdpi/list_white_single.9.png differ diff --git a/src/res/drawable-hdpi/list_white_up.9.png b/src/res/drawable-hdpi/list_white_up.9.png new file mode 100644 index 0000000..e23cd5c Binary files /dev/null and b/src/res/drawable-hdpi/list_white_up.9.png differ diff --git a/src/res/drawable-hdpi/list_yellow_down.9.png b/src/res/drawable-hdpi/list_yellow_down.9.png new file mode 100644 index 0000000..31cfc1e Binary files /dev/null and b/src/res/drawable-hdpi/list_yellow_down.9.png differ diff --git a/src/res/drawable-hdpi/list_yellow_middle.9.png b/src/res/drawable-hdpi/list_yellow_middle.9.png new file mode 100644 index 0000000..b6549b2 Binary files /dev/null and b/src/res/drawable-hdpi/list_yellow_middle.9.png differ diff --git a/src/res/drawable-hdpi/list_yellow_single.9.png b/src/res/drawable-hdpi/list_yellow_single.9.png new file mode 100644 index 0000000..3faf507 Binary files /dev/null and b/src/res/drawable-hdpi/list_yellow_single.9.png differ diff --git a/src/res/drawable-hdpi/list_yellow_up.9.png b/src/res/drawable-hdpi/list_yellow_up.9.png new file mode 100644 index 0000000..4ae791c Binary files /dev/null and b/src/res/drawable-hdpi/list_yellow_up.9.png differ diff --git a/src/res/drawable-hdpi/menu_delete.png b/src/res/drawable-hdpi/menu_delete.png new file mode 100644 index 0000000..ccdfc4b Binary files /dev/null and b/src/res/drawable-hdpi/menu_delete.png differ diff --git a/src/res/drawable-hdpi/menu_move.png b/src/res/drawable-hdpi/menu_move.png new file mode 100644 index 0000000..1140b71 Binary files /dev/null and b/src/res/drawable-hdpi/menu_move.png differ diff --git a/src/res/drawable-hdpi/new_note_normal.png b/src/res/drawable-hdpi/new_note_normal.png new file mode 100644 index 0000000..e24e0d1 Binary files /dev/null and b/src/res/drawable-hdpi/new_note_normal.png differ diff --git a/src/res/drawable-hdpi/new_note_pressed.png b/src/res/drawable-hdpi/new_note_pressed.png new file mode 100644 index 0000000..c748936 Binary files /dev/null and b/src/res/drawable-hdpi/new_note_pressed.png differ diff --git a/src/res/drawable-hdpi/note_edit_color_selector_panel.png b/src/res/drawable-hdpi/note_edit_color_selector_panel.png new file mode 100644 index 0000000..fc49552 Binary files /dev/null and b/src/res/drawable-hdpi/note_edit_color_selector_panel.png differ diff --git a/src/res/drawable-hdpi/notification.png b/src/res/drawable-hdpi/notification.png new file mode 100644 index 0000000..b13ab4a Binary files /dev/null and b/src/res/drawable-hdpi/notification.png differ diff --git a/src/res/drawable-hdpi/search_result.png b/src/res/drawable-hdpi/search_result.png new file mode 100644 index 0000000..ff2befd Binary files /dev/null and b/src/res/drawable-hdpi/search_result.png differ diff --git a/src/res/drawable-hdpi/selected.png b/src/res/drawable-hdpi/selected.png new file mode 100644 index 0000000..b889bef Binary files /dev/null and b/src/res/drawable-hdpi/selected.png differ diff --git a/src/res/drawable-hdpi/splash.png b/src/res/drawable-hdpi/splash.png new file mode 100644 index 0000000..8fc31bb Binary files /dev/null and b/src/res/drawable-hdpi/splash.png differ diff --git a/src/res/drawable-hdpi/title_alert.png b/src/res/drawable-hdpi/title_alert.png new file mode 100644 index 0000000..544ee9c Binary files /dev/null and b/src/res/drawable-hdpi/title_alert.png differ diff --git a/src/res/drawable-hdpi/title_bar_bg.9.png b/src/res/drawable-hdpi/title_bar_bg.9.png new file mode 100644 index 0000000..eb6bff0 Binary files /dev/null and b/src/res/drawable-hdpi/title_bar_bg.9.png differ diff --git a/src/res/drawable-hdpi/widget_2x_blue.png b/src/res/drawable-hdpi/widget_2x_blue.png new file mode 100644 index 0000000..a1707f4 Binary files /dev/null and b/src/res/drawable-hdpi/widget_2x_blue.png differ diff --git a/src/res/drawable-hdpi/widget_2x_green.png b/src/res/drawable-hdpi/widget_2x_green.png new file mode 100644 index 0000000..f86886c Binary files /dev/null and b/src/res/drawable-hdpi/widget_2x_green.png differ diff --git a/src/res/drawable-hdpi/widget_2x_red.png b/src/res/drawable-hdpi/widget_2x_red.png new file mode 100644 index 0000000..0e66c29 Binary files /dev/null and b/src/res/drawable-hdpi/widget_2x_red.png differ diff --git a/src/res/drawable-hdpi/widget_2x_white.png b/src/res/drawable-hdpi/widget_2x_white.png new file mode 100644 index 0000000..5f0619a Binary files /dev/null and b/src/res/drawable-hdpi/widget_2x_white.png differ diff --git a/src/res/drawable-hdpi/widget_2x_yellow.png b/src/res/drawable-hdpi/widget_2x_yellow.png new file mode 100644 index 0000000..12d1c2b Binary files /dev/null and b/src/res/drawable-hdpi/widget_2x_yellow.png differ diff --git a/src/res/drawable-hdpi/widget_4x_blue.png b/src/res/drawable-hdpi/widget_4x_blue.png new file mode 100644 index 0000000..9183738 Binary files /dev/null and b/src/res/drawable-hdpi/widget_4x_blue.png differ diff --git a/src/res/drawable-hdpi/widget_4x_green.png b/src/res/drawable-hdpi/widget_4x_green.png new file mode 100644 index 0000000..fa8b452 Binary files /dev/null and b/src/res/drawable-hdpi/widget_4x_green.png differ diff --git a/src/res/drawable-hdpi/widget_4x_red.png b/src/res/drawable-hdpi/widget_4x_red.png new file mode 100644 index 0000000..62de074 Binary files /dev/null and b/src/res/drawable-hdpi/widget_4x_red.png differ diff --git a/src/res/drawable-hdpi/widget_4x_white.png b/src/res/drawable-hdpi/widget_4x_white.png new file mode 100644 index 0000000..a37d67c Binary files /dev/null and b/src/res/drawable-hdpi/widget_4x_white.png differ diff --git a/src/res/drawable-hdpi/widget_4x_yellow.png b/src/res/drawable-hdpi/widget_4x_yellow.png new file mode 100644 index 0000000..d7c5fa4 Binary files /dev/null and b/src/res/drawable-hdpi/widget_4x_yellow.png differ diff --git a/src/res/drawable/new_note.xml b/src/res/drawable/new_note.xml new file mode 100644 index 0000000..2154ebc --- /dev/null +++ b/src/res/drawable/new_note.xml @@ -0,0 +1,23 @@ + + + + + + + + diff --git a/src/res/layout/account_dialog_title.xml b/src/res/layout/account_dialog_title.xml new file mode 100644 index 0000000..7717112 --- /dev/null +++ b/src/res/layout/account_dialog_title.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/res/layout/activity_change_password.xml b/src/res/layout/activity_change_password.xml new file mode 100644 index 0000000..30b0dcb --- /dev/null +++ b/src/res/layout/activity_change_password.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + +