diff --git a/doc/1.docx b/doc/1.docx deleted file mode 100644 index 97e1b7cc..00000000 Binary files a/doc/1.docx and /dev/null differ diff --git a/doc/实践资源-开源软件维护方案及成果.docx b/doc/实践资源-开源软件维护方案及成果.docx deleted file mode 100644 index 0b7e6ead..00000000 Binary files a/doc/实践资源-开源软件维护方案及成果.docx and /dev/null differ diff --git a/src/java/net/micode/notes/tool/Point.java b/src/java/net/micode/notes/tool/Point.java deleted file mode 100644 index f3d8e4ee..00000000 --- a/src/java/net/micode/notes/tool/Point.java +++ /dev/null @@ -1,113 +0,0 @@ -package net.micode.notes.tool; - -public class Point { - public static int BITMAP_NORMAL = 0; // 正常 - public static int BITMAP_ERROR = 1; // 错误 - public static int BITMAP_PRESS = 2; // 按下 - - //九宫格中的点的下标(即每个点代表一个值) - private String index; - //点的状态 - private int state; - //点的坐标 - private float x; - private float y; - - public Point() { - super(); - } - - public Point(int x, int y) { - this.x = x; - this.y = y; - } - - public String getIndex() { - return index; - } - - public int getState() { - return state; - } - - public float getX() { - return x; - } - - public float getY() { - return y; - } - - public void setIndex(String index) { - this.index = index; - } - - public void setState(int state) { - this.state = state; - } - - public void setX(float x) { - this.x = x; - } - - public void setY(float y) { - this.y = y; - } - - /** - * 判断屏幕上的九宫格中的点能否可以进行连线 - * - * @param a - * @param moveX - * @param moveY - * @param radius 点bitmap的半径 - * @return 布尔型 - */ - public boolean isWith(Point a, float moveX, float moveY, float radius) { - float result = (float) Math.sqrt((a.getX() - moveX) - * (a.getX() - moveX) + (a.getY() - moveY) - * (a.getY() - moveY)); - if (result < 5 * radius / 4) { - return true; - } - return false; - } - - public static float getDegrees(Point a, Point b) { - float degrees = 0; - float ax = a.getX(); - float ay = a.getY(); - float bx = b.getX(); - float by = b.getY(); - - if (ax == bx) { - if (by > ay) { - degrees = 90; - } else { - degrees = 270; - } - } else if (by == ay) { - if (ax > bx) { - degrees = 180; - } else { - degrees = 0; - } - } else { - if (ax > bx) { - if (ay > by) { // 第三象限 - degrees = 180 + (float) (Math.atan2(ay - by, ax - bx) * 180 / Math.PI); - } else { // 第二象限 - degrees = 180 - (float) (Math.atan2(by - ay, ax - bx) * 180 / Math.PI); - } - } else { - if (ay > by) { // 第四象限 - degrees = 360 - (float) (Math.atan2(ay - by, bx - ax) * 180 / Math.PI); - } else { // 第一象限 - degrees = (float) (Math.atan2(by - ay, bx - ax) * 180 / Math.PI); - } - } - } - return degrees; - } -} - diff --git a/src/java/net/micode/notes/ui/DeletePasscodeActivity.java b/src/java/net/micode/notes/ui/DeletePasscodeActivity.java deleted file mode 100644 index 3bdd7cdc..00000000 --- a/src/java/net/micode/notes/ui/DeletePasscodeActivity.java +++ /dev/null @@ -1,54 +0,0 @@ -package net.micode.notes.ui; - -import android.content.Intent; -import android.os.Bundle; -import android.widget.Toast; - -import androidx.appcompat.app.AppCompatActivity; - -import net.micode.notes.R; -import net.micode.notes.model.WorkingNote; - -public class DeletePasscodeActivity extends AppCompatActivity { - private LockPatternView mLockPatternView; - private String mPasswordStr; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_lock); - - mLockPatternView = (LockPatternView) findViewById(R.id.lockView); - Intent pre = getIntent(); - final Long noteId = pre.getLongExtra(Intent.EXTRA_UID, 0); - - mLockPatternView.setLockListener(new LockPatternView.OnLockListener() { - WorkingNote mWorkingNote = WorkingNote.load(DeletePasscodeActivity.this,noteId); - String password = mWorkingNote.getPasscode(); - @Override - public void getStringPassword(String password) { - mPasswordStr = password; - } - - @Override - public boolean isPassword() { - if (mPasswordStr.equals(password)) { - Toast.makeText(DeletePasscodeActivity.this, R.string.note_passcode_deleted, Toast.LENGTH_SHORT).show(); - mWorkingNote.setPasscode(""); - mWorkingNote.saveNote(); - NoteEditActivity Activity = new NoteEditActivity(); - Activity.NoteEditActivity.finish(); - Intent intent = new Intent(DeletePasscodeActivity.this, NoteEditActivity.class); - intent.setAction(Intent.ACTION_VIEW); - intent.putExtra(Intent.EXTRA_UID, noteId); - startActivity(intent); - DeletePasscodeActivity.this.finish(); - } else { - Toast.makeText(DeletePasscodeActivity.this, "密码不正确", Toast.LENGTH_SHORT).show(); - } - return false; - } - }); - - } -} diff --git a/src/java/net/micode/notes/ui/LockPatternView.java b/src/java/net/micode/notes/ui/LockPatternView.java deleted file mode 100644 index 0218d439..00000000 --- a/src/java/net/micode/notes/ui/LockPatternView.java +++ /dev/null @@ -1,385 +0,0 @@ -package net.micode.notes.ui; - -import android.content.Context; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.Canvas; -import android.graphics.Matrix; -import android.graphics.Paint; -import android.util.AttributeSet; -import android.util.Log; -import android.view.MotionEvent; -import android.view.View; - -import net.micode.notes.R; -import net.micode.notes.tool.Point; - -import java.util.ArrayList; -import java.util.List; - - -public class LockPatternView extends View { - //判断线的状态 - private static boolean isLineState = true; - //判断点是否被实例化了 - private static boolean isInitPoint = false; - //判断手指是否离开屏幕 - private static boolean isFinish = false; - //判断手指点击屏幕时是否选中了九宫格中的点 - private static boolean isSelect = false; - // 创建MyPoint的数组 - private Point[][] mPoints = new Point[3][3]; - // 声明屏幕的宽和高 - private int mScreenHeight; - private int mScreenWidth; - // 声明点线的图片的半径 - private float mPointRadius; - // 声明线的图片的高(即是半径) - private float mLineHeight; - // 声明鼠标移动的x,y坐标 - private float mMoveX, mMoveY; - // 声明屏幕上的宽和高的偏移量 - private int mScreenHeightOffSet = 0; - private int mScreenWidthOffSet = 0; - // 创建一个画笔 - private Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); - // 声明资源图片 - private Bitmap mBitmapNormal; - private Bitmap mBitmapPressed; - private Bitmap mBitmapError; - private Bitmap mLinePressed; - private Bitmap mLineError; - // 创建一个矩阵 - private Matrix mMatrix = new Matrix(); - // 创建MyPoint的列表 - private List mPointList = new ArrayList(); - // 实例化鼠标点 - private Point mMousePoint = new Point(); - // 用获取从activity中传过来的密码字符串 - private String mPassword = ""; - private final static String TAG = "LockPatternView"; - - private Context mContext; - private OnLockListener mListener; - - public LockPatternView(Context context, AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - mContext = context; - } - - public LockPatternView(Context context, AttributeSet attrs) { - super(context, attrs); - } - - public LockPatternView(Context context) { - super(context); - } - - /** - * 画点和画线 - */ - @Override - protected void onDraw(Canvas canvas) { - super.onDraw(canvas); - if (!isInitPoint) { - initPoint(); // 先初始化 - } - - canvasPoint(canvas); // 开始画点 - - // 开始画线 - if (mPointList.size() > 0) { - Point b = null; - Point a = mPointList.get(0); - for (int i = 1; i < mPointList.size(); i++) { - b = mPointList.get(i); - canvasLine(a, b, canvas); - a = b; - } - if (!isFinish) { - canvasLine(a, mMousePoint, canvas); - } - } - } - - /** - * 手指点击手机屏幕 - */ - @Override - public boolean onTouchEvent(MotionEvent event) { - mMoveX = event.getX(); - mMoveY = event.getY(); - // 设置移动点的坐标 - mMousePoint.setX(mMoveX); - mMousePoint.setY(mMoveY); - Point mPoint = null; - switch (event.getAction()) { - case MotionEvent.ACTION_DOWN: - isLineState = true; - isFinish = false; - // 每次点击时就会将pointList中元素设置转化成正常状态 - for (int i = 0; i < mPointList.size(); i++) { - mPointList.get(i).setState(Point.BITMAP_NORMAL); - } - // 将pointList中的元素清除掉 - mPointList.clear(); - // 判断是否点中了九宫格中的点 - mPoint = getIsSelectedPoint(mMoveX, mMoveY); - if (mPoint != null) { - isSelect = true; - } - break; - case MotionEvent.ACTION_MOVE: - if (isSelect == true) { - mPoint = getIsSelectedPoint(mMoveX, mMoveY); - } - - break; - case MotionEvent.ACTION_UP: - isFinish = true; - isSelect = false; - // 规定至少要有4个点被连线才有可能是正确 - // 其他种情况都是错误的 - if (mPointList.size() >= 4) {// 正确情况 - for (int j = 0; j < mPointList.size(); j++) { - mPassword += mPointList.get(j).getIndex(); - } - //将连线后得到的密码传给activity - mListener.getStringPassword(mPassword); - mPassword = ""; - //经过activity判断传过来是否正确 - if (mListener.isPassword()) { - for (int i = 0; i < mPointList.size(); i++) { - mPointList.get(i).setState(Point.BITMAP_PRESS); - } - } else { - for (int i = 0; i < mPointList.size(); i++) { - mPointList.get(i).setState(Point.BITMAP_ERROR); - } - isLineState = false; - } - // 错误情况 - } else if (mPointList.size() < 4 && mPointList.size() > 1) { - for (int i = 0; i < mPointList.size(); i++) { - mPointList.get(i).setState(Point.BITMAP_ERROR); - } - isLineState = false; - // 如果只有一个点被点中时为正常情况 - } else if (mPointList.size() == 1) { - for (int i = 0; i < mPointList.size(); i++) { - mPointList.get(i).setState(Point.BITMAP_NORMAL); - } - } - break; - } - // 将mPoint添加到pointList中 - if (isSelect && mPoint != null) { - if (mPoint.getState() == Point.BITMAP_NORMAL) { - mPoint.setState(Point.BITMAP_PRESS); - mPointList.add(mPoint); - } - } - // 每次发生OnTouchEvent()后都刷新View - postInvalidate(); - return true; - } - - /** - * 判断九宫格中的某个点是否被点中了,或者某个点能否被连线 - * - * @param moveX - * @param moveY - * @return - */ - private Point getIsSelectedPoint(float moveX, float moveY) { - Point myPoint = null; - for (int i = 0; i < mPoints.length; i++) { - for (int j = 0; j < mPoints[i].length; j++) { - if (mPoints[i][j].isWith(mPoints[i][j], moveX, moveY, - mPointRadius)) { - myPoint = mPoints[i][j]; - } - } - } - - return myPoint; - } - - /** - * 画线 - * - * @param a 起始点 - * @param b 目的点 - * @param canvas 画布 - */ - private void canvasLine(Point a, Point b, Canvas canvas) { - // Math.sqrt(平方+平方) - float abInstance = (float) Math.sqrt( - (a.getX() - b.getX()) * (a.getX() - b.getX()) - + (a.getY() - b.getY()) * (a.getY() - b.getY()) - ); - canvas.rotate(Point.getDegrees(a, b), a.getX(), a.getY()); - - mMatrix.setScale(abInstance / mLineHeight, 1); - mMatrix.postTranslate(a.getX(), a.getY()); - if (isLineState) { - canvas.drawBitmap(mLinePressed, mMatrix, mPaint); - } else { - canvas.drawBitmap(mLineError, mMatrix, mPaint); - } - - canvas.rotate(-Point.getDegrees(a, b), a.getX(), a.getY()); - } - - /** - * 画点 - * - * @param canvas - */ - private void canvasPoint(Canvas canvas) { - for (int i = 0; i < mPoints.length; i++) { - for (int j = 0; j < mPoints[i].length; j++) { - if (mPoints[i][j]==null) { - //重启view时,new的变量被销毁,其他未被销毁,导致设置一次开启app,第二次进入时 - //isinitpoint 变量已为true,可是点实例未初始化; - initPoint(); - } - if (mPoints[i][j].getState() == Point.BITMAP_NORMAL) { - canvas.drawBitmap(mBitmapNormal, - mPoints[i][j].getX() - mPointRadius, - mPoints[i][j].getY() - mPointRadius, mPaint); - } else if (mPoints[i][j].getState() == Point.BITMAP_PRESS) { - canvas.drawBitmap(mBitmapPressed, - mPoints[i][j].getX() - mPointRadius, - mPoints[i][j].getY() - mPointRadius, mPaint); - } else { - canvas.drawBitmap(mBitmapError, - mPoints[i][j].getX() - mPointRadius, - mPoints[i][j].getY() - mPointRadius, mPaint); - } - } - } - } - - private void minitPoint(){ - /** - * 开始实例化九宫格中点 - */ - mPoints[0][0] = new Point(mScreenWidthOffSet + mScreenWidth / 4, - mScreenHeightOffSet + mScreenHeight / 4); - mPoints[0][1] = new Point(mScreenWidthOffSet + mScreenWidth / 2, - mScreenHeightOffSet + mScreenHeight / 4); - mPoints[0][2] = new Point(mScreenWidthOffSet + mScreenWidth * 3 / 4, - mScreenHeightOffSet + mScreenHeight / 4); - - mPoints[1][0] = new Point(mScreenWidthOffSet + mScreenWidth / 4, - mScreenHeightOffSet + mScreenHeight / 2); - mPoints[1][1] = new Point(mScreenWidthOffSet + mScreenWidth / 2, - mScreenHeightOffSet + mScreenHeight / 2); - mPoints[1][2] = new Point(mScreenWidthOffSet + mScreenWidth * 3 / 4, - mScreenHeightOffSet + mScreenHeight / 2); - - mPoints[2][0] = new Point(mScreenWidthOffSet + mScreenWidth / 4, - mScreenHeightOffSet + mScreenHeight * 3 / 4); - mPoints[2][1] = new Point(mScreenWidthOffSet + mScreenWidth / 2, - mScreenHeightOffSet + mScreenHeight * 3 / 4); - mPoints[2][2] = new Point(mScreenWidthOffSet + mScreenWidth * 3 / 4, - mScreenHeightOffSet + mScreenHeight * 3 / 4); - - - // 设置九宫格中的各个index - int index = 1; - for (int i = 0; i < mPoints.length; i++) { - for (int j = 0; j < mPoints[i].length; j++) { - mPoints[i][j].setIndex(index + ""); - // 在没有任何操作的情况下默認点的状态 - mPoints[i][j].setState(Point.BITMAP_NORMAL); - index++; - } - } - } - - /** - * 实例化九宫格中所有点和所有的资源图片 - */ - private void initPoint() { - // 获取View的宽高 - mScreenWidth = getWidth(); - mScreenHeight = getHeight(); - if (mScreenHeight > mScreenWidth) { - // 获取y轴上的偏移量 - mScreenHeightOffSet = (mScreenHeight - mScreenWidth) / 2; - // 将屏幕高的变量设置成与宽相等,目的是为了new Point(x,y)时方便操作 - mScreenHeight = mScreenWidth; - } else { - // 获取x轴上的偏移量 - mScreenWidthOffSet = (mScreenWidth - mScreenHeight) / 2; - // 将屏幕宽的变量设置成与高相等,目的是为了new Point(x,y)时方便操作 - mScreenWidth = mScreenHeight; - } - - /** - * 实例化所有的资源图片 - */ - mBitmapError = BitmapFactory.decodeResource(getResources(), R.drawable.bitmap_error); - mBitmapNormal = BitmapFactory.decodeResource(getResources(), R.drawable.bitmap_normal); - mBitmapPressed = BitmapFactory.decodeResource(getResources(), R.drawable.bitmap_pressed); - mLineError = BitmapFactory.decodeResource(getResources(), R.drawable.line_error); - mLinePressed = BitmapFactory.decodeResource(getResources(), R.drawable.line_pressed); - - mPointRadius = mBitmapNormal.getWidth() / 2; - mLineHeight = mLinePressed.getHeight(); - - /** - * 开始实例化九宫格中点 - */ - mPoints[0][0] = new Point(mScreenWidthOffSet + mScreenWidth / 4, - mScreenHeightOffSet + mScreenHeight / 4); - mPoints[0][1] = new Point(mScreenWidthOffSet + mScreenWidth / 2, - mScreenHeightOffSet + mScreenHeight / 4); - mPoints[0][2] = new Point(mScreenWidthOffSet + mScreenWidth * 3 / 4, - mScreenHeightOffSet + mScreenHeight / 4); - - mPoints[1][0] = new Point(mScreenWidthOffSet + mScreenWidth / 4, - mScreenHeightOffSet + mScreenHeight / 2); - mPoints[1][1] = new Point(mScreenWidthOffSet + mScreenWidth / 2, - mScreenHeightOffSet + mScreenHeight / 2); - mPoints[1][2] = new Point(mScreenWidthOffSet + mScreenWidth * 3 / 4, - mScreenHeightOffSet + mScreenHeight / 2); - - mPoints[2][0] = new Point(mScreenWidthOffSet + mScreenWidth / 4, - mScreenHeightOffSet + mScreenHeight * 3 / 4); - mPoints[2][1] = new Point(mScreenWidthOffSet + mScreenWidth / 2, - mScreenHeightOffSet + mScreenHeight * 3 / 4); - mPoints[2][2] = new Point(mScreenWidthOffSet + mScreenWidth * 3 / 4, - mScreenHeightOffSet + mScreenHeight * 3 / 4); - - - // 设置九宫格中的各个index - int index = 1; - for (int i = 0; i < mPoints.length; i++) { - for (int j = 0; j < mPoints[i].length; j++) { - mPoints[i][j].setIndex(index + ""); - // 在没有任何操作的情况下默認点的状态 - mPoints[i][j].setState(Point.BITMAP_NORMAL); - index++; - } - } - - // 将isInitPoint设置为true - isInitPoint = true; - } - - public interface OnLockListener { - public void getStringPassword(String password); - - public boolean isPassword(); - } - - - public void setLockListener(OnLockListener listener) { - this.mListener = listener; - } - -} - diff --git a/src/java/net/micode/notes/ui/SetLockActivity.java b/src/java/net/micode/notes/ui/SetLockActivity.java deleted file mode 100644 index a994a809..00000000 --- a/src/java/net/micode/notes/ui/SetLockActivity.java +++ /dev/null @@ -1,106 +0,0 @@ -package net.micode.notes.ui; - - -import android.content.Intent; -import android.os.Bundle; -import androidx.appcompat.app.AppCompatActivity; -import android.view.View; -import android.widget.Button; -import android.widget.TextView; -import android.widget.Toast; - -import net.micode.notes.model.WorkingNote; -import net.micode.notes.R; -import net.micode.notes.ui.LockPatternView; - -public class SetLockActivity extends AppCompatActivity { - - private TextView mTitleTv; - private LockPatternView mLockPatternView; - // private LinearLayout mBottomLayout; - private Button mClearBtn; -// private Button mConfirmBtn; - - private String mPassword; - /** - * 是否是第一次输入密码 - */ - private boolean isFirst = true; - - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_set_lock); - - initViews(); - initEvents(); - } - public void onBackPressed() { - super.onBackPressed();//注释掉这行,back键不退出activity - Intent pre = getIntent(); - //将密码写入数据库 - long noteId = pre.getLongExtra(Intent.EXTRA_UID, 0); - Intent intent = new Intent(SetLockActivity.this, NoteEditActivity.class); - intent.setAction(Intent.ACTION_VIEW); - intent.putExtra("lock",0); - intent.putExtra(Intent.EXTRA_UID, noteId); - startActivity(intent); - } - private void initEvents() { - mLockPatternView.setLockListener(new LockPatternView.OnLockListener() { - @Override - public void getStringPassword(String password) { - if (isFirst) { - mPassword = password; - mTitleTv.setText("再次输入手势密码"); - isFirst = false; - mClearBtn.setVisibility(View.VISIBLE); - } else { - if (password.equals(mPassword)) { - Intent pre = getIntent(); - //将密码写入数据库 - long noteId = pre.getLongExtra(Intent.EXTRA_UID, 0); - WorkingNote mWorkingNote = WorkingNote.load(SetLockActivity.this,noteId); - mWorkingNote.setPasscode(password); - boolean saved = mWorkingNote.saveNote();//保存便签 - Intent intent = new Intent(SetLockActivity.this, NoteEditActivity.class); - intent.setAction(Intent.ACTION_VIEW); - intent.putExtra("lock",0); - intent.putExtra(Intent.EXTRA_UID, noteId); - startActivity(intent); - SetLockActivity.this.finish(); - }else { - Toast.makeText(SetLockActivity.this,"两次密码不一致,请重新设置",Toast.LENGTH_SHORT).show(); - mPassword = ""; - mTitleTv.setText("设置手势密码"); - isFirst = true; - mClearBtn.setVisibility(View.GONE); - } - } - } - - @Override - public boolean isPassword() { - return false; - } - }); - - mClearBtn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - mPassword = ""; - isFirst = true; - mClearBtn.setVisibility(View.GONE); - } - }); - - } - - - private void initViews() { - mTitleTv = (TextView) findViewById(R.id.tv_activity_set_lock_title); - mLockPatternView = (LockPatternView) findViewById(R.id.lockView); - mClearBtn = (Button) findViewById(R.id.btn_password_clear); - } -} diff --git a/src/java/net/micode/notes/ui/UnlockActivity.java b/src/java/net/micode/notes/ui/UnlockActivity.java deleted file mode 100644 index 3bba83e8..00000000 --- a/src/java/net/micode/notes/ui/UnlockActivity.java +++ /dev/null @@ -1,55 +0,0 @@ -package net.micode.notes.ui; - - -import android.content.Intent; -import android.os.Bundle; -import androidx.appcompat.app.AppCompatActivity; -import android.widget.Toast; - -import net.micode.notes.model.WorkingNote; -import net.micode.notes.R; -import net.micode.notes.ui.LockPatternView; - -public class UnlockActivity extends AppCompatActivity { - private LockPatternView mLockPatternView; - private String mPasswordStr; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_lock); - - mLockPatternView = (LockPatternView) findViewById(R.id.lockView); - Intent pre = getIntent(); - final Long noteId = pre.getLongExtra(Intent.EXTRA_UID, 0); - - mLockPatternView.setLockListener(new LockPatternView.OnLockListener() { - WorkingNote mWorkingNote = WorkingNote.load(UnlockActivity.this,noteId); - String password = mWorkingNote.getPasscode(); - @Override - public void getStringPassword(String password) { - mPasswordStr = password; - } - - @Override - public boolean isPassword() { - if (mPasswordStr.equals(password)) { - Toast.makeText(UnlockActivity.this, "密码正确", Toast.LENGTH_SHORT).show(); - Intent intent = new Intent(UnlockActivity.this,NoteEditActivity.class); - intent.setAction(Intent.ACTION_VIEW); - intent.putExtra("lock",0); - intent.putExtra(Intent.EXTRA_UID, noteId); - startActivity(intent); - UnlockActivity.this.finish(); - //TODO comment or not - //return true; - } else { - Toast.makeText(UnlockActivity.this, "密码不正确", Toast.LENGTH_SHORT).show(); - } - return false; - } - }); - - } - -} diff --git a/src/AndroidManifest.xml b/src/main/AndroidManifest.xml similarity index 77% rename from src/AndroidManifest.xml rename to src/main/AndroidManifest.xml index 7ff62108..80f59801 100644 --- a/src/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -1,26 +1,10 @@ - - - - + @@ -33,16 +17,22 @@ + + @@ -53,24 +43,26 @@ android:name=".ui.NoteEditActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:launchMode="singleTop" - android:theme="@style/NoteTheme" > - + android:theme="@style/Theme.AppCompat.Light.DarkActionBar" > + + - + + - + @@ -80,7 +72,7 @@ @@ -100,7 +92,6 @@ - @@ -111,15 +102,13 @@ android:name="android.appwidget.provider" android:resource="@xml/widget_4x_info" /> - - @@ -129,18 +118,15 @@ android:launchMode="singleInstance" android:theme="@android:style/Theme.Holo.Wallpaper.NoTitleBar" > - - - @@ -148,4 +134,5 @@ android:name="android.app.default_searchable" android:value=".ui.NoteEditActivity" /> - + + \ No newline at end of file diff --git a/src/java/net/micode/notes/data/Contact.java b/src/main/java/net/micode/notes/data/Contact.java similarity index 100% rename from src/java/net/micode/notes/data/Contact.java rename to src/main/java/net/micode/notes/data/Contact.java diff --git a/src/java/net/micode/notes/data/Notes.java b/src/main/java/net/micode/notes/data/Notes.java similarity index 98% rename from src/java/net/micode/notes/data/Notes.java rename to src/main/java/net/micode/notes/data/Notes.java index 8d2e6c21..f240604b 100644 --- a/src/java/net/micode/notes/data/Notes.java +++ b/src/main/java/net/micode/notes/data/Notes.java @@ -165,12 +165,6 @@ public class Notes { *

Type : INTEGER (long)

*/ public static final String VERSION = "version"; - - public static final String TOP = "top"; - - public static final String STAR = "star"; - - public static final String PASSCODE = "passcode"; } public interface DataColumns { diff --git a/src/java/net/micode/notes/data/NotesDatabaseHelper.java b/src/main/java/net/micode/notes/data/NotesDatabaseHelper.java similarity index 94% rename from src/java/net/micode/notes/data/NotesDatabaseHelper.java rename to src/main/java/net/micode/notes/data/NotesDatabaseHelper.java index e9619734..ffe5d577 100644 --- a/src/java/net/micode/notes/data/NotesDatabaseHelper.java +++ b/src/main/java/net/micode/notes/data/NotesDatabaseHelper.java @@ -59,11 +59,8 @@ public class NotesDatabaseHelper extends SQLiteOpenHelper { NoteColumns.SYNC_ID + " INTEGER NOT NULL DEFAULT 0," + NoteColumns.LOCAL_MODIFIED + " INTEGER NOT NULL DEFAULT 0," + NoteColumns.ORIGIN_PARENT_ID + " INTEGER NOT NULL DEFAULT 0," + - NoteColumns.GTASK_ID + " TEXT NOT NULL DEFAULT 1," + - NoteColumns.VERSION + " INTEGER NOT NULL DEFAULT 0," + - NoteColumns.TOP + " INTEGER NOT NULL DEFAULT 0," + - NoteColumns.STAR + " INTEGER NOT NULL DEFAULT 0," + - NoteColumns.PASSCODE + " TEXT NOT NULL DEFAULT ''"+ + NoteColumns.GTASK_ID + " TEXT NOT NULL DEFAULT ''," + + NoteColumns.VERSION + " INTEGER NOT NULL DEFAULT 0" + ")"; private static final String CREATE_DATA_TABLE_SQL = @@ -325,16 +322,6 @@ public class NotesDatabaseHelper extends SQLiteOpenHelper { oldVersion++; } - if (oldVersion == 4) { - upgradeToV5(db); - oldVersion++; - } - - if (oldVersion == 5) { - upgradeToV6(db); - oldVersion++; - } - if (reCreateTriggers) { reCreateNoteTableTriggers(db); reCreateDataTableTriggers(db); @@ -372,14 +359,4 @@ 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.TOP - + " INTEGER NOT NULL DEFAULT 0"); - } - - private void upgradeToV6(SQLiteDatabase db) { - db.execSQL("ALTER TABLE " + TABLE.NOTE + " ADD COLUMN " + NoteColumns.STAR - + " INTEGER NOT NULL DEFAULT 0"); - } } diff --git a/src/java/net/micode/notes/data/NotesProvider.java b/src/main/java/net/micode/notes/data/NotesProvider.java similarity index 79% rename from src/java/net/micode/notes/data/NotesProvider.java rename to src/main/java/net/micode/notes/data/NotesProvider.java index 908409ee..edb0a606 100644 --- a/src/java/net/micode/notes/data/NotesProvider.java +++ b/src/main/java/net/micode/notes/data/NotesProvider.java @@ -33,13 +33,12 @@ import net.micode.notes.R; import net.micode.notes.data.Notes.DataColumns; import net.micode.notes.data.Notes.NoteColumns; import net.micode.notes.data.NotesDatabaseHelper.TABLE; -import net.micode.notes.gtask.data.SqlNote; public class NotesProvider extends ContentProvider { private static final UriMatcher mMatcher; - private static NotesDatabaseHelper mHelper; + private NotesDatabaseHelper mHelper; private static final String TAG = "NotesProvider"; @@ -303,85 +302,4 @@ public class NotesProvider extends ContentProvider { return null; } - public static boolean isStarNote(Long id) { - SQLiteDatabase db; - db = mHelper.getReadableDatabase(); - Cursor cursor = null; - cursor = db.query(NotesDatabaseHelper.TABLE.NOTE, null, null, null, null, null, null); - //判断游标是否为空 - if (cursor.moveToFirst()) { - //遍历游标 - for (int index = 1; index < cursor.getCount(); index++) { - cursor.moveToNext(); - if (cursor.getLong(SqlNote.ID_COLUMN) == id && !cursor.getString(SqlNote.STAR_COLUMN).equals("0")) { - cursor.close(); - return true; - } - } - } - cursor.close(); - return false; - } - - public static boolean isLockedNote(Long id) { - SQLiteDatabase db; - db = mHelper.getReadableDatabase(); - Cursor cursor = null; - cursor = db.query(NotesDatabaseHelper.TABLE.NOTE, null, null, null, null, null, null); - //判断游标是否为空 - if (cursor.moveToFirst()) { - //遍历游标 - for (int index = 1; index < cursor.getCount(); index++) { - cursor.moveToNext(); - if (cursor.getLong(SqlNote.ID_COLUMN) == id && !cursor.getString(SqlNote.PASSCODE_COLUMN).equals("")) { - cursor.close(); - return true; - } - } - } - cursor.close(); - return false; - } - - public static boolean isStarFolder(long NoteId, long FolderId, boolean setStar){ - if(setStar){ - return true; - } - SQLiteDatabase db; - db = mHelper.getWritableDatabase(); - Cursor cursor = null; - cursor = db.query(NotesDatabaseHelper.TABLE.NOTE, null, null, null, null, null, null); - //判断游标是否为空 - if (cursor.moveToFirst()) { - //遍历游标 - for (int index = 1; index < cursor.getCount(); index++) { - cursor.moveToNext(); - if (cursor.getLong(SqlNote.ID_COLUMN) == NoteId && !setStar){ - continue; - } - if (cursor.getLong(1) == FolderId){ - if (cursor.getString(SqlNote.STAR_COLUMN).equals("1")){ - cursor.close(); - return true; - } - } - } - } - cursor.close(); - return false; - } - - public static void setStarFolder(long FolderId, boolean isStarFolder){ - SQLiteDatabase db; - db = mHelper.getWritableDatabase(); - ContentValues values = new ContentValues(); - if(isStarFolder){ - values.put(NoteColumns.STAR,"1"); - } else{ - values.put(NoteColumns.STAR,"0"); - } - String condition = NoteColumns.ID + " = ?"; - String[] args = {String.valueOf(FolderId)}; - db.update(NotesDatabaseHelper.TABLE.NOTE, values, condition, args); - } } diff --git a/src/java/net/micode/notes/gtask/data/MetaData.java b/src/main/java/net/micode/notes/gtask/data/MetaData.java similarity index 100% rename from src/java/net/micode/notes/gtask/data/MetaData.java rename to src/main/java/net/micode/notes/gtask/data/MetaData.java diff --git a/src/java/net/micode/notes/gtask/data/Node.java b/src/main/java/net/micode/notes/gtask/data/Node.java similarity index 100% rename from src/java/net/micode/notes/gtask/data/Node.java rename to src/main/java/net/micode/notes/gtask/data/Node.java diff --git a/src/java/net/micode/notes/gtask/data/SqlData.java b/src/main/java/net/micode/notes/gtask/data/SqlData.java similarity index 100% rename from src/java/net/micode/notes/gtask/data/SqlData.java rename to src/main/java/net/micode/notes/gtask/data/SqlData.java diff --git a/src/java/net/micode/notes/gtask/data/SqlNote.java b/src/main/java/net/micode/notes/gtask/data/SqlNote.java similarity index 95% rename from src/java/net/micode/notes/gtask/data/SqlNote.java rename to src/main/java/net/micode/notes/gtask/data/SqlNote.java index 652de79a..79a4095e 100644 --- a/src/java/net/micode/notes/gtask/data/SqlNote.java +++ b/src/main/java/net/micode/notes/gtask/data/SqlNote.java @@ -49,7 +49,7 @@ public class SqlNote { NoteColumns.NOTES_COUNT, NoteColumns.PARENT_ID, NoteColumns.SNIPPET, NoteColumns.TYPE, NoteColumns.WIDGET_ID, NoteColumns.WIDGET_TYPE, NoteColumns.SYNC_ID, NoteColumns.LOCAL_MODIFIED, NoteColumns.ORIGIN_PARENT_ID, NoteColumns.GTASK_ID, - NoteColumns.VERSION,NoteColumns.TOP,NoteColumns.STAR,NoteColumns.PASSCODE, + NoteColumns.VERSION }; public static final int ID_COLUMN = 0; @@ -86,12 +86,6 @@ public class SqlNote { public static final int VERSION_COLUMN = 16; - public static final int Top_COLUMN = 17; - - public static final int STAR_COLUMN = 18; - - public static final int PASSCODE_COLUMN = 19; - private Context mContext; private ContentResolver mContentResolver; @@ -124,12 +118,6 @@ public class SqlNote { private long mVersion; - private String mTop; - - private String mStar; - - private String mPasscode; - private ContentValues mDiffNoteValues; private ArrayList mDataList; @@ -151,9 +139,6 @@ public class SqlNote { mWidgetType = Notes.TYPE_WIDGET_INVALIDE; mOriginParent = 0; mVersion = 0; - mTop = getmTop(); - mStar = getmStar(); - mPasscode = getmPasscode(); mDiffNoteValues = new ContentValues(); mDataList = new ArrayList(); } @@ -167,9 +152,6 @@ public class SqlNote { if (mType == Notes.TYPE_NOTE) loadDataContent(); mDiffNoteValues = new ContentValues(); - mTop = getmTop(); - mStar = getmStar(); - mPasscode = getmPasscode(); } public SqlNote(Context context, long id) { @@ -181,21 +163,7 @@ public class SqlNote { if (mType == Notes.TYPE_NOTE) loadDataContent(); mDiffNoteValues = new ContentValues(); - mTop = getmTop(); - mStar = getmStar(); - mPasscode = getmPasscode(); - } - - public String getmTop(){ - return mTop; - } - - public String getmStar(){ - return mStar; - } - public String getmPasscode(){ - return mPasscode; } private void loadFromCursor(long id) { @@ -230,9 +198,6 @@ public class SqlNote { mWidgetId = c.getInt(WIDGET_ID_COLUMN); mWidgetType = c.getInt(WIDGET_TYPE_COLUMN); mVersion = c.getLong(VERSION_COLUMN); - mTop = c.getString(Top_COLUMN); - mStar = c.getString(STAR_COLUMN); - mPasscode = c.getString(PASSCODE_COLUMN); } private void loadDataContent() { diff --git a/src/java/net/micode/notes/gtask/data/Task.java b/src/main/java/net/micode/notes/gtask/data/Task.java similarity index 100% rename from src/java/net/micode/notes/gtask/data/Task.java rename to src/main/java/net/micode/notes/gtask/data/Task.java diff --git a/src/java/net/micode/notes/gtask/data/TaskList.java b/src/main/java/net/micode/notes/gtask/data/TaskList.java similarity index 100% rename from src/java/net/micode/notes/gtask/data/TaskList.java rename to src/main/java/net/micode/notes/gtask/data/TaskList.java diff --git a/src/java/net/micode/notes/gtask/exception/ActionFailureException.java b/src/main/java/net/micode/notes/gtask/exception/ActionFailureException.java similarity index 100% rename from src/java/net/micode/notes/gtask/exception/ActionFailureException.java rename to src/main/java/net/micode/notes/gtask/exception/ActionFailureException.java diff --git a/src/java/net/micode/notes/gtask/exception/NetworkFailureException.java b/src/main/java/net/micode/notes/gtask/exception/NetworkFailureException.java similarity index 100% rename from src/java/net/micode/notes/gtask/exception/NetworkFailureException.java rename to src/main/java/net/micode/notes/gtask/exception/NetworkFailureException.java diff --git a/src/java/net/micode/notes/gtask/remote/GTaskASyncTask.java b/src/main/java/net/micode/notes/gtask/remote/GTaskASyncTask.java similarity index 87% rename from src/java/net/micode/notes/gtask/remote/GTaskASyncTask.java rename to src/main/java/net/micode/notes/gtask/remote/GTaskASyncTask.java index 3f3c3584..36808776 100644 --- a/src/java/net/micode/notes/gtask/remote/GTaskASyncTask.java +++ b/src/main/java/net/micode/notes/gtask/remote/GTaskASyncTask.java @@ -59,7 +59,7 @@ public class GTaskASyncTask extends AsyncTask { public void publishProgess(String message) { publishProgress(new String[] { - message + message }); } @@ -77,7 +77,17 @@ public class GTaskASyncTask extends AsyncTask { pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext, NotesListActivity.class), 0); } - +// notification.setLatestEventInfo(mContext, mContext.getString(R.string.app_name), content, +// pendingIntent); + notification = new Notification.Builder(mContext) + .setContentIntent(pendingIntent) + .setTicker(mContext.getString(R.string.app_name)) + .setContentTitle(mContext.getString(R.string.app_name)) + .setContentText(content) + .setWhen(System.currentTimeMillis()) + .setSmallIcon(R.drawable.icon_app) + .build(); + notification.icon = R.drawable.icon_app; mNotifiManager.notify(GTASK_SYNC_NOTIFICATION_ID, notification); } diff --git a/src/java/net/micode/notes/gtask/remote/GTaskClient.java b/src/main/java/net/micode/notes/gtask/remote/GTaskClient.java similarity index 100% rename from src/java/net/micode/notes/gtask/remote/GTaskClient.java rename to src/main/java/net/micode/notes/gtask/remote/GTaskClient.java diff --git a/src/java/net/micode/notes/gtask/remote/GTaskManager.java b/src/main/java/net/micode/notes/gtask/remote/GTaskManager.java similarity index 100% rename from src/java/net/micode/notes/gtask/remote/GTaskManager.java rename to src/main/java/net/micode/notes/gtask/remote/GTaskManager.java diff --git a/src/java/net/micode/notes/gtask/remote/GTaskSyncService.java b/src/main/java/net/micode/notes/gtask/remote/GTaskSyncService.java similarity index 100% rename from src/java/net/micode/notes/gtask/remote/GTaskSyncService.java rename to src/main/java/net/micode/notes/gtask/remote/GTaskSyncService.java diff --git a/src/java/net/micode/notes/model/Note.java b/src/main/java/net/micode/notes/model/Note.java similarity index 96% rename from src/java/net/micode/notes/model/Note.java rename to src/main/java/net/micode/notes/model/Note.java index 8bfbfd57..6706cf67 100644 --- a/src/java/net/micode/notes/model/Note.java +++ b/src/main/java/net/micode/notes/model/Note.java @@ -47,7 +47,6 @@ public class Note { long createdTime = System.currentTimeMillis(); values.put(NoteColumns.CREATED_DATE, createdTime); values.put(NoteColumns.MODIFIED_DATE, createdTime); - //values.put(NoteColumns.TOP,"1"); values.put(NoteColumns.TYPE, Notes.TYPE_NOTE); values.put(NoteColumns.LOCAL_MODIFIED, 1); values.put(NoteColumns.PARENT_ID, folderId); @@ -77,15 +76,6 @@ public class Note { mNoteDiffValues.put(NoteColumns.MODIFIED_DATE, System.currentTimeMillis()); } - public void setTopValue(String key, String value) { - mNoteDiffValues.put(key, value); - } - - public void setStarValue(String key, String value) { - mNoteDiffValues.put(key, value); - } - - public void setTextData(String key, String value) { mNoteData.setTextData(key, value); } @@ -145,8 +135,6 @@ public class Note { private ContentValues mTextDataValues; - private ContentValues mTopValues; - private long mCallDataId; private ContentValues mCallDataValues; @@ -156,7 +144,6 @@ public class Note { public NoteData() { mTextDataValues = new ContentValues(); mCallDataValues = new ContentValues(); - mTopValues = new ContentValues(); mTextDataId = 0; mCallDataId = 0; } @@ -191,7 +178,6 @@ public class Note { mNoteDiffValues.put(NoteColumns.MODIFIED_DATE, System.currentTimeMillis()); } - Uri pushIntoContentResolver(Context context, long noteId) { /** * Check for safety diff --git a/src/java/net/micode/notes/model/WorkingNote.java b/src/main/java/net/micode/notes/model/WorkingNote.java similarity index 82% rename from src/java/net/micode/notes/model/WorkingNote.java rename to src/main/java/net/micode/notes/model/WorkingNote.java index 028fc76e..be081e43 100644 --- a/src/java/net/micode/notes/model/WorkingNote.java +++ b/src/main/java/net/micode/notes/model/WorkingNote.java @@ -29,7 +29,6 @@ import net.micode.notes.data.Notes.DataColumns; import net.micode.notes.data.Notes.DataConstants; import net.micode.notes.data.Notes.NoteColumns; import net.micode.notes.data.Notes.TextNote; -import net.micode.notes.data.NotesProvider; import net.micode.notes.tool.ResourceParser.NoteBgResources; @@ -61,18 +60,6 @@ public class WorkingNote { private boolean mIsDeleted; - /**记录便签已设置密码*/ - private String mPasscode = ""; - - /**记录已置顶便签*/ - private String mTop = "0"; - - /**记录便签所属类别*/ - private int mClass; - - - private String mStar = "0"; - private NoteSettingChangedListener mNoteSettingStatusListener; public static final String[] DATA_PROJECTION = new String[] { @@ -91,10 +78,7 @@ public class WorkingNote { NoteColumns.BG_COLOR_ID, NoteColumns.WIDGET_ID, NoteColumns.WIDGET_TYPE, - NoteColumns.MODIFIED_DATE, - NoteColumns.TOP, - NoteColumns.STAR, - NoteColumns.PASSCODE, + NoteColumns.MODIFIED_DATE }; private static final int DATA_ID_COLUMN = 0; @@ -117,12 +101,6 @@ public class WorkingNote { private static final int NOTE_MODIFIED_DATE_COLUMN = 5; - private static final int NOTE_TOP_COLUMN = 6; - - private static final int NOTE_STAR_COLUMN = 7; - - private static final int NOTE_PASSCODE_COLUMN = 8; - // New note construct private WorkingNote(Context context, long folderId) { mContext = context; @@ -134,9 +112,6 @@ public class WorkingNote { mIsDeleted = false; mMode = 0; mWidgetType = Notes.TYPE_WIDGET_INVALIDE; - mTop = String.valueOf(getTopId()); - mStar = String.valueOf(getStarId()); - mPasscode = String.valueOf(getPasscode()); } // Existing note construct @@ -162,16 +137,12 @@ public class WorkingNote { mWidgetType = cursor.getInt(NOTE_WIDGET_TYPE_COLUMN); mAlertDate = cursor.getLong(NOTE_ALERTED_DATE_COLUMN); mModifiedDate = cursor.getLong(NOTE_MODIFIED_DATE_COLUMN); - mTop = cursor.getString(NOTE_TOP_COLUMN); - mStar = cursor.getString(NOTE_STAR_COLUMN); - mPasscode = cursor.getString(NOTE_PASSCODE_COLUMN); } cursor.close(); } else { Log.e(TAG, "No note with id:" + mNoteId); throw new IllegalArgumentException("Unable to find note with id " + mNoteId); } - loadNoteData(); } @@ -258,30 +229,6 @@ public class WorkingNote { mNoteSettingStatusListener = l; } - - public void setTop(String Top){ - if (!mTop.equals(Top)) { - mTop = Top; - mNote.setTopValue(NoteColumns.TOP,mTop); - } - if (mNoteSettingStatusListener != null) { - mNoteSettingStatusListener.onTopChanged(Top); - } - } - - public void setStar(String Star){ - if (!mStar.equals(Star)){ - mStar = Star; - mNote.setStarValue(NoteColumns.STAR,mStar); - NotesProvider.setStarFolder(mFolderId, NotesProvider.isStarFolder(mNoteId, mFolderId,Star.equals("1"))); - if (mNoteSettingStatusListener != null) { - mNoteSettingStatusListener.onStarChanged(Star); - } - } - } - - - public void setAlertDate(long date, boolean set) { if (date != mAlertDate) { mAlertDate = date; @@ -351,38 +298,6 @@ public class WorkingNote { return (mAlertDate > 0 ? true : false); } - /**判断是否已经设置密码*/ - public boolean hasPasscode() { - return !mPasscode.equals(""); - } - - /**设置便签访问密码,并存入数据库*/ - public void setPasscode(String passcode) { - mPasscode = passcode; - mNote.setNoteValue(NoteColumns.PASSCODE, passcode); - } - - /**获取设置的密码*/ - public String getPasscode() { - return mPasscode; - } - - public int getTopId() { - if (mTop.equals("1")) { - return 1; - } else { - return 0; - } - } - - public int getStarId() { - if (mStar.equals("1")) { - return 1; - } else { - return 0; - } - } - public String getContent() { return mContent; } @@ -433,16 +348,6 @@ public class WorkingNote { */ void onBackgroundColorChanged(); - /** - * Called when user set top - */ - void onTopChanged(String Top); - - /** - * Called when user set star - */ - void onStarChanged(String Star); - /** * Called when user set clock */ diff --git a/src/java/net/micode/notes/tool/BackupUtils.java b/src/main/java/net/micode/notes/tool/BackupUtils.java similarity index 100% rename from src/java/net/micode/notes/tool/BackupUtils.java rename to src/main/java/net/micode/notes/tool/BackupUtils.java diff --git a/src/java/net/micode/notes/tool/DataUtils.java b/src/main/java/net/micode/notes/tool/DataUtils.java similarity index 95% rename from src/java/net/micode/notes/tool/DataUtils.java rename to src/main/java/net/micode/notes/tool/DataUtils.java index c99538b2..2a14982e 100644 --- a/src/java/net/micode/notes/tool/DataUtils.java +++ b/src/main/java/net/micode/notes/tool/DataUtils.java @@ -16,7 +16,6 @@ package net.micode.notes.tool; -import android.app.Activity; import android.content.ContentProviderOperation; import android.content.ContentProviderResult; import android.content.ContentResolver; @@ -26,23 +25,14 @@ import android.content.OperationApplicationException; import android.database.Cursor; import android.os.RemoteException; import android.util.Log; -import android.database.sqlite.SQLiteDatabase; -import android.widget.Toast; -import net.micode.notes.R; import net.micode.notes.data.Notes; import net.micode.notes.data.Notes.CallNote; import net.micode.notes.data.Notes.NoteColumns; -import net.micode.notes.data.NotesDatabaseHelper; -import net.micode.notes.data.NotesProvider; -import net.micode.notes.gtask.data.SqlNote; -import net.micode.notes.model.Note; -import net.micode.notes.ui.NoteEditActivity; import net.micode.notes.ui.NotesListAdapter.AppWidgetAttribute; import java.util.ArrayList; import java.util.HashSet; -import java.util.TreeSet; public class DataUtils { @@ -56,18 +46,13 @@ public class DataUtils { Log.d(TAG, "no id is in the hashset"); return true; } + ArrayList operationList = new ArrayList(); for (long id : ids) { if(id == Notes.ID_ROOT_FOLDER) { Log.e(TAG, "Don't delete system folder root"); continue; } - /** - * if can delete - */ - if (NotesProvider.isStarNote(id) || NotesProvider.isLockedNote(id)){ - continue; - } ContentProviderOperation.Builder builder = ContentProviderOperation .newDelete(ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, id)); operationList.add(builder.build()); diff --git a/src/java/net/micode/notes/tool/GTaskStringUtils.java b/src/main/java/net/micode/notes/tool/GTaskStringUtils.java similarity index 100% rename from src/java/net/micode/notes/tool/GTaskStringUtils.java rename to src/main/java/net/micode/notes/tool/GTaskStringUtils.java diff --git a/src/java/net/micode/notes/tool/ResourceParser.java b/src/main/java/net/micode/notes/tool/ResourceParser.java similarity index 100% rename from src/java/net/micode/notes/tool/ResourceParser.java rename to src/main/java/net/micode/notes/tool/ResourceParser.java diff --git a/src/java/net/micode/notes/ui/AlarmAlertActivity.java b/src/main/java/net/micode/notes/ui/AlarmAlertActivity.java similarity index 100% rename from src/java/net/micode/notes/ui/AlarmAlertActivity.java rename to src/main/java/net/micode/notes/ui/AlarmAlertActivity.java diff --git a/src/java/net/micode/notes/ui/AlarmInitReceiver.java b/src/main/java/net/micode/notes/ui/AlarmInitReceiver.java similarity index 100% rename from src/java/net/micode/notes/ui/AlarmInitReceiver.java rename to src/main/java/net/micode/notes/ui/AlarmInitReceiver.java diff --git a/src/java/net/micode/notes/ui/AlarmReceiver.java b/src/main/java/net/micode/notes/ui/AlarmReceiver.java similarity index 100% rename from src/java/net/micode/notes/ui/AlarmReceiver.java rename to src/main/java/net/micode/notes/ui/AlarmReceiver.java diff --git a/src/java/net/micode/notes/ui/DateTimePicker.java b/src/main/java/net/micode/notes/ui/DateTimePicker.java similarity index 100% rename from src/java/net/micode/notes/ui/DateTimePicker.java rename to src/main/java/net/micode/notes/ui/DateTimePicker.java diff --git a/src/java/net/micode/notes/ui/DateTimePickerDialog.java b/src/main/java/net/micode/notes/ui/DateTimePickerDialog.java similarity index 100% rename from src/java/net/micode/notes/ui/DateTimePickerDialog.java rename to src/main/java/net/micode/notes/ui/DateTimePickerDialog.java diff --git a/src/java/net/micode/notes/ui/DropdownMenu.java b/src/main/java/net/micode/notes/ui/DropdownMenu.java similarity index 100% rename from src/java/net/micode/notes/ui/DropdownMenu.java rename to src/main/java/net/micode/notes/ui/DropdownMenu.java diff --git a/src/java/net/micode/notes/ui/FoldersListAdapter.java b/src/main/java/net/micode/notes/ui/FoldersListAdapter.java similarity index 100% rename from src/java/net/micode/notes/ui/FoldersListAdapter.java rename to src/main/java/net/micode/notes/ui/FoldersListAdapter.java diff --git a/src/java/net/micode/notes/ui/NoteEditActivity.java b/src/main/java/net/micode/notes/ui/NoteEditActivity.java similarity index 86% rename from src/java/net/micode/notes/ui/NoteEditActivity.java rename to src/main/java/net/micode/notes/ui/NoteEditActivity.java index fdc57304..d7d02bc6 100644 --- a/src/java/net/micode/notes/ui/NoteEditActivity.java +++ b/src/main/java/net/micode/notes/ui/NoteEditActivity.java @@ -30,9 +30,12 @@ import android.content.SharedPreferences; import android.graphics.Paint; import android.os.Bundle; import android.preference.PreferenceManager; +import android.support.v7.app.AppCompatActivity; +import android.text.Editable; import android.text.Spannable; import android.text.SpannableString; import android.text.TextUtils; +import android.text.TextWatcher; import android.text.format.DateUtils; import android.text.style.BackgroundColorSpan; import android.util.Log; @@ -72,20 +75,72 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -public class NoteEditActivity extends Activity implements OnClickListener, +public class NoteEditActivity extends AppCompatActivity implements OnClickListener, NoteSettingChangedListener, OnTextViewChangeListener { private class HeadViewHolder { public TextView tvModified; public ImageView ivAlertIcon; - public TextView tvToptext; - public TextView tvAlertDate; public ImageView ibSetBgColor; } + private EditText editText; + private TextView textView; + + private String Textchange(String oriText){ + StringBuffer stringBuffer = new StringBuffer(oriText); + int Flag1 = -1; + int Flag2 = -1; + do {//不计入表示图片的字符 + Flag1 = stringBuffer.indexOf(""); + if (Flag1 != -1 && Flag2 != -1) { + stringBuffer = stringBuffer.replace(Flag1, Flag2+1, ""); + } + } while (Flag1 != -1 && Flag2 != -1); + + do {//不计入换行字符 + Flag1 = stringBuffer.indexOf("\n"); + + if (Flag1 != -1){ + stringBuffer = stringBuffer.replace(Flag1, Flag1+1, ""); + } + } while (Flag1 != -1); + do {//不计入空格字符 + Flag1 = stringBuffer.indexOf(" "); + + if (Flag1 != -1) { + stringBuffer = stringBuffer.replace(Flag1, Flag1+1, ""); + } + } while (Flag1 != -1); + return stringBuffer.toString(); + } + + private void count() + { + editText = (EditText) findViewById(R.id.note_edit_view); + textView = (TextView) findViewById(R.id.text_num); + editText.addTextChangedListener(new TextWatcher() { + int currentLength = 0; + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + textView.setText("Number of characters:" + currentLength); + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + currentLength = Textchange(mNoteEditor.getText().toString()).length(); + } + + @Override + public void afterTextChanged(Editable s) { + textView.setText("Number of characters:" + currentLength); + } + }); + } private static final Map sBgSelectorBtnsMap = new HashMap(); static { sBgSelectorBtnsMap.put(R.id.iv_bg_yellow, ResourceParser.YELLOW); @@ -143,9 +198,6 @@ public class NoteEditActivity extends Activity implements OnClickListener, private static final int SHORTCUT_ICON_TITLE_MAX_LEN = 10; - private static final int REQUEST_SET_PASSCODE = 0; - private static final int REQUEST_UNLOCK = 1; - public static final String TAG_CHECKED = String.valueOf('\u221A'); public static final String TAG_UNCHECKED = String.valueOf('\u25A1'); @@ -154,20 +206,17 @@ public class NoteEditActivity extends Activity implements OnClickListener, private String mUserQuery; private Pattern mPattern; - private boolean Locked; /* 用以判断是否已解锁 */ - - static Activity NoteEditActivity; - @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.note_edit); - NoteEditActivity = this; + if (savedInstanceState == null && !initActivityState(getIntent())) { finish(); return; } initResources(); + count(); } /** @@ -268,11 +317,6 @@ public class NoteEditActivity extends Activity implements OnClickListener, return false; } mWorkingNote.setOnSettingStatusChangedListener(this); - - Locked = mWorkingNote.hasPasscode();//设置便签解锁状态; - if (intent.hasExtra("lock")) { - Locked = false; - } return true; } @@ -307,22 +351,8 @@ public class NoteEditActivity extends Activity implements OnClickListener, * is not ready */ showAlertHeader(); - showTopHeader(); - unlockNote(); - } - - private void unlockNote(){ - //如果设置了密码,启动输入密码页面 - if (mWorkingNote.hasPasscode() && Locked) { - saveNote(); - Intent intent = new Intent(this,UnlockActivity.class); - intent.putExtra(Intent.EXTRA_UID, mWorkingNote.getNoteId()); - startActivityForResult(intent,REQUEST_SET_PASSCODE); - finish(); - } } - private void showAlertHeader() { if (mWorkingNote.hasClockAlert()) { long time = System.currentTimeMillis(); @@ -337,16 +367,7 @@ public class NoteEditActivity extends Activity implements OnClickListener, } else { mNoteHeaderHolder.tvAlertDate.setVisibility(View.GONE); mNoteHeaderHolder.ivAlertIcon.setVisibility(View.GONE); - } - } - - private void showTopHeader(){ - mNoteHeaderHolder.tvToptext.setText(R.string.menu_set_top); - if(mWorkingNote.getTopId()==1){ - mNoteHeaderHolder.tvToptext.setVisibility(View.VISIBLE); - } else{ - mNoteHeaderHolder.tvToptext.setVisibility(View.GONE); - } + }; } @Override @@ -406,7 +427,6 @@ public class NoteEditActivity extends Activity implements OnClickListener, mNoteHeaderHolder.tvModified = (TextView) findViewById(R.id.tv_modified_date); mNoteHeaderHolder.ivAlertIcon = (ImageView) findViewById(R.id.iv_alert_icon); mNoteHeaderHolder.tvAlertDate = (TextView) findViewById(R.id.tv_alert_date); - mNoteHeaderHolder.tvToptext = (TextView) findViewById(R.id.tv_set_top); mNoteHeaderHolder.ibSetBgColor = (ImageView) findViewById(R.id.btn_set_bg_color); mNoteHeaderHolder.ibSetBgColor.setOnClickListener(this); mNoteEditor = (EditText) findViewById(R.id.note_edit_view); @@ -468,7 +488,7 @@ 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); @@ -530,14 +550,6 @@ public class NoteEditActivity extends Activity implements OnClickListener, } else { getMenuInflater().inflate(R.menu.note_edit, menu); } - if (mWorkingNote.getTopId() == 1 ) { - menu.findItem(R.id.menu_set_top).setVisible(false); - } else if(mWorkingNote.getTopId() == 0){ - menu.findItem(R.id.menu_cancel_top).setVisible(false); - } - if (mWorkingNote.getStarId() == 1){ - menu.findItem(R.id.menu_set_star).setTitle(R.string.menu_delete_star); - } if (mWorkingNote.getCheckListMode() == TextNote.MODE_CHECK_LIST) { menu.findItem(R.id.menu_list_mode).setTitle(R.string.menu_normal_mode); } else { @@ -548,12 +560,6 @@ public class NoteEditActivity extends Activity implements OnClickListener, } else { menu.findItem(R.id.menu_delete_remind).setVisible(false); } - //如果一设置密码,显示删除密码选项,否则,显示设置密码选项 - if (mWorkingNote.hasPasscode()) { - menu.findItem(R.id.menu_set_passcode).setVisible(false); - } else { - menu.findItem(R.id.menu_delete_passcode).setVisible(false); - } return true; } @@ -563,25 +569,6 @@ public class NoteEditActivity extends Activity implements OnClickListener, case R.id.menu_new_note: createNewNote(); break; - case R.id.menu_set_top: - mWorkingNote.setTop((mWorkingNote.getTopId())==1 ? "0" : "1"); - break; - case R.id.menu_cancel_top: - mWorkingNote.setTop((mWorkingNote.getTopId())==0 ? "1" : "0"); - break; - case R.id.menu_set_star: - mWorkingNote.setStar(mWorkingNote.getStarId()==1? "0" : "1"); - System.out.println(mWorkingNote.hasPasscode()); - break; - //设置密码 - case R.id.menu_set_passcode: - setPasscode(); - break; - //删除密码 - case R.id.menu_delete_passcode: - System.out.println(mWorkingNote.hasPasscode()); - deletePasscode(); - break; case R.id.menu_delete: AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(getString(R.string.alert_title_delete)); @@ -590,15 +577,8 @@ public class NoteEditActivity extends Activity implements OnClickListener, builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { - if(mWorkingNote.getStarId()==0 && !mWorkingNote.hasPasscode()) { - deleteCurrentNote(); - finish(); - } else if(mWorkingNote.getStarId()==1){ - showToast(R.string.error_delete_star_note); - } else if(mWorkingNote.hasPasscode()){ - showToast(R.string.error_delete_locked_note); - } - //finish(); + deleteCurrentNote(); + finish(); } }); builder.setNegativeButton(android.R.string.cancel, null); @@ -631,7 +611,6 @@ public class NoteEditActivity extends Activity implements OnClickListener, return true; } - private void setReminder() { DateTimePickerDialog d = new DateTimePickerDialog(this, System.currentTimeMillis()); d.setOnDateTimeSetListener(new OnDateTimeSetListener() { @@ -691,33 +670,6 @@ public class NoteEditActivity extends Activity implements OnClickListener, return NotesPreferenceActivity.getSyncAccountName(this).trim().length() > 0; } - public void onTopChanged(String Top){ - /** - * User could set clock to an unsaved note, so before setting the - * alert clock, we should save the note first - */ - saveNote(); - if (mWorkingNote.getNoteId() > 0) { - showTopHeader(); - } else { - /** - * There is the condition that user has input nothing (the note is - * not worthy saving), we have no note id, remind the user that he - * should input something - */ - Log.e(TAG, "Top setting error"); - showToast(R.string.error_note_empty_for_top); - } - } - - public void onStarChanged(String Star){ - /** - * User could set clock to an unsaved note, so before setting the - * alert clock, we should save the note first - */ - saveNote(); - } - public void onClockAlertChanged(long date, boolean set) { /** * User could set clock to an unsaved note, so before setting the @@ -927,36 +879,6 @@ public class NoteEditActivity extends Activity implements OnClickListener, return saved; } - /** - * 弹出设置密码界面 - */ - private void setPasscode() { - //确保笔记已写入数据库 - saveNote(); - //初始化一个新的意图,用以跳转至设置密码界面 - Intent intent = new Intent(this,SetLockActivity.class); - //给意图传入当前便签的id参数,便于从设置密码活动中跳转回编辑便签活动 - intent.putExtra(Intent.EXTRA_UID, mWorkingNote.getNoteId()); - startActivity(intent); - finish(); - } - - /** - * 删除便签密码 - */ - private void deletePasscode() { - //验证密码 - if (mWorkingNote.hasPasscode()) { - saveNote(); - Intent intent = new Intent(this,DeletePasscodeActivity.class); - intent.putExtra(Intent.EXTRA_UID, mWorkingNote.getNoteId()); - startActivity(intent); - //finish(); - saveNote(); - } - saveNote(); - } - private void sendToDesktop() { /** * Before send message to home, we should make sure that current diff --git a/src/java/net/micode/notes/ui/NoteEditText.java b/src/main/java/net/micode/notes/ui/NoteEditText.java similarity index 100% rename from src/java/net/micode/notes/ui/NoteEditText.java rename to src/main/java/net/micode/notes/ui/NoteEditText.java diff --git a/src/java/net/micode/notes/ui/NoteItemData.java b/src/main/java/net/micode/notes/ui/NoteItemData.java similarity index 88% rename from src/java/net/micode/notes/ui/NoteItemData.java rename to src/main/java/net/micode/notes/ui/NoteItemData.java index ac063721..0f5a8782 100644 --- a/src/java/net/micode/notes/ui/NoteItemData.java +++ b/src/main/java/net/micode/notes/ui/NoteItemData.java @@ -40,9 +40,6 @@ public class NoteItemData { NoteColumns.TYPE, NoteColumns.WIDGET_ID, NoteColumns.WIDGET_TYPE, - NoteColumns.TOP, - NoteColumns.STAR, - NoteColumns.PASSCODE, }; private static final int ID_COLUMN = 0; @@ -57,9 +54,6 @@ 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 TOP_ID_COLUMN = 12; - private static final int STAR_ID_COLUMN = 13; - private static final int PASSCODE_COLUMN = 14; private long mId; private long mAlertDate; @@ -75,9 +69,6 @@ public class NoteItemData { private int mWidgetType; private String mName; private String mPhoneNumber; - private String mTop; - private String mStar; - private String mPasscode; private boolean mIsLastItem; private boolean mIsFirstItem; @@ -100,9 +91,6 @@ public class NoteItemData { mType = cursor.getInt(TYPE_COLUMN); mWidgetId = cursor.getInt(WIDGET_ID_COLUMN); mWidgetType = cursor.getInt(WIDGET_TYPE_COLUMN); - mTop = cursor.getString(TOP_ID_COLUMN); - mStar = cursor.getString(STAR_ID_COLUMN); - mPasscode = cursor.getString(PASSCODE_COLUMN); mPhoneNumber = ""; if (mParentId == Notes.ID_CALL_RECORD_FOLDER) { @@ -146,22 +134,6 @@ public class NoteItemData { } } - public boolean isTOP() { - if(mTop.equals("1")) { - return true; - }else { - return false; - } - } - - public boolean isSTAR() { - if(mStar.equals("0")) { - return false; - }else { - return true; - } - } - public boolean isOneFollowingFolder() { return mIsOneNoteFollowingFolder; } @@ -190,8 +162,6 @@ public class NoteItemData { return mId; } - public boolean hasLock() { return !mPasscode.equals(""); } - public long getAlertDate() { return mAlertDate; } diff --git a/src/java/net/micode/notes/ui/NotesListActivity.java b/src/main/java/net/micode/notes/ui/NotesListActivity.java similarity index 96% rename from src/java/net/micode/notes/ui/NotesListActivity.java rename to src/main/java/net/micode/notes/ui/NotesListActivity.java index a6224807..454b1f7a 100644 --- a/src/java/net/micode/notes/ui/NotesListActivity.java +++ b/src/main/java/net/micode/notes/ui/NotesListActivity.java @@ -31,6 +31,7 @@ import android.database.Cursor; import android.os.AsyncTask; import android.os.Bundle; import android.preference.PreferenceManager; +import android.support.v7.app.AppCompatActivity; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; @@ -78,7 +79,11 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.util.HashSet; -public class NotesListActivity extends Activity implements OnClickListener, OnItemLongClickListener { +public class NotesListActivity extends AppCompatActivity implements OnClickListener, OnItemLongClickListener { + /* 首页背景切换 */ + private int mode = -1; + + private static final int FOLDER_NOTE_LIST_QUERY_TOKEN = 0; private static final int FOLDER_LIST_QUERY_TOKEN = 1; @@ -93,7 +98,7 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt private enum ListEditState { NOTE_LIST, SUB_FOLDER, CALL_RECORD_FOLDER - }; + } private ListEditState mState; @@ -139,6 +144,7 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.note_list); + getWindow().setBackgroundDrawableResource(R.drawable.grassland); initResources(); /** @@ -414,7 +420,7 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt mBackgroundQueryHandler.startQuery(FOLDER_NOTE_LIST_QUERY_TOKEN, null, Notes.CONTENT_NOTE_URI, NoteItemData.PROJECTION, selection, new String[] { String.valueOf(mCurrentFolderId) - }, NoteColumns.TOP+ " DESC,"+ NoteColumns.TYPE + " DESC," + NoteColumns.MODIFIED_DATE + " DESC"); + }, NoteColumns.TYPE + " DESC," + NoteColumns.MODIFIED_DATE + " DESC"); } private final class BackgroundQueryHandler extends AsyncQueryHandler { @@ -775,12 +781,36 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt } else { Log.e(TAG, "Wrong state:" + mState); } + + if (mode == -1) { + menu.findItem(R.id.menu_grassland).setVisible(false); + } else if (mode == 0){ + menu.findItem(R.id.menu_magma).setVisible(false); + } else if(mode == 1){ + menu.findItem(R.id.menu_water).setVisible(false); + } + return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { + case R.id.menu_water: { + mode = 1; + getWindow().setBackgroundDrawableResource(R.drawable.water); + break; + } + case R.id.menu_magma: { + mode = 0; + getWindow().setBackgroundDrawableResource(R.drawable.magma); + break; + } + case R.id.menu_grassland: { + mode = -1; + getWindow().setBackgroundDrawableResource(R.drawable.grassland); + break; + } case R.id.menu_new_folder: { showCreateOrModifyFolderDialog(true); break; diff --git a/src/java/net/micode/notes/ui/NotesListAdapter.java b/src/main/java/net/micode/notes/ui/NotesListAdapter.java similarity index 100% rename from src/java/net/micode/notes/ui/NotesListAdapter.java rename to src/main/java/net/micode/notes/ui/NotesListAdapter.java diff --git a/src/java/net/micode/notes/ui/NotesListItem.java b/src/main/java/net/micode/notes/ui/NotesListItem.java similarity index 83% rename from src/java/net/micode/notes/ui/NotesListItem.java rename to src/main/java/net/micode/notes/ui/NotesListItem.java index ea55907c..1221e808 100644 --- a/src/java/net/micode/notes/ui/NotesListItem.java +++ b/src/main/java/net/micode/notes/ui/NotesListItem.java @@ -37,9 +37,6 @@ public class NotesListItem extends LinearLayout { private TextView mCallName; private NoteItemData mItemData; private CheckBox mCheckBox; - private ImageView mTop; - private ImageView mStar; - private ImageView mLock; public NotesListItem(Context context) { super(context); @@ -49,9 +46,6 @@ public class NotesListItem extends LinearLayout { mTime = (TextView) findViewById(R.id.tv_time); mCallName = (TextView) findViewById(R.id.tv_name); mCheckBox = (CheckBox) findViewById(android.R.id.checkbox); - mTop = (ImageView) findViewById(R.id.iv_top_icon); - mStar =(ImageView) findViewById(R.id.iv_star_icon); - mLock = (ImageView) findViewById(R.id.iv_lock); } public void bind(Context context, NoteItemData data, boolean choiceMode, boolean checked) { @@ -61,6 +55,7 @@ public class NotesListItem extends LinearLayout { } else { mCheckBox.setVisibility(View.GONE); } + mItemData = data; if (data.getId() == Notes.ID_CALL_RECORD_FOLDER) { mCallName.setVisibility(View.GONE); @@ -83,6 +78,7 @@ public class NotesListItem extends LinearLayout { } else { mCallName.setVisibility(View.GONE); mTitle.setTextAppearance(context, R.style.TextAppearancePrimaryItem); + if (data.getType() == Notes.TYPE_FOLDER) { mTitle.setText(data.getSnippet() + context.getString(R.string.format_folder_files_count, @@ -97,26 +93,6 @@ public class NotesListItem extends LinearLayout { mAlert.setVisibility(View.GONE); } } - if(data.isTOP()){ - mTop.setImageResource(R.drawable.menu_top); - mTop.setVisibility(View.VISIBLE); - } else{ - mTop.setVisibility((View.GONE)); - } - if(data.isSTAR()){ - mStar.setImageResource(R.drawable.star); - mStar.setVisibility(View.VISIBLE); - } else{ - mStar.setVisibility(View.GONE); - } - if (data.hasLock()) { - mLock.setImageResource(R.drawable.lock); - mLock.setVisibility(View.VISIBLE); - String text = "已加密"; - mTitle.setText(text); - } else { - mLock.setVisibility(View.GONE); - } } mTime.setText(DateUtils.getRelativeTimeSpanString(data.getModifiedDate())); diff --git a/src/java/net/micode/notes/ui/NotesPreferenceActivity.java b/src/main/java/net/micode/notes/ui/NotesPreferenceActivity.java similarity index 100% rename from src/java/net/micode/notes/ui/NotesPreferenceActivity.java rename to src/main/java/net/micode/notes/ui/NotesPreferenceActivity.java diff --git a/src/main/java/net/micode/notes/ui/SplashActivity.java b/src/main/java/net/micode/notes/ui/SplashActivity.java new file mode 100644 index 00000000..807ca799 --- /dev/null +++ b/src/main/java/net/micode/notes/ui/SplashActivity.java @@ -0,0 +1,34 @@ +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, NotesListActivity.class); + startActivity(intent); + finish(); //销毁欢迎页面 + } + }, 2000); // 2 秒后跳转 + } +} \ No newline at end of file diff --git a/src/java/net/micode/notes/widget/NoteWidgetProvider.java b/src/main/java/net/micode/notes/widget/NoteWidgetProvider.java similarity index 100% rename from src/java/net/micode/notes/widget/NoteWidgetProvider.java rename to src/main/java/net/micode/notes/widget/NoteWidgetProvider.java diff --git a/src/java/net/micode/notes/widget/NoteWidgetProvider_2x.java b/src/main/java/net/micode/notes/widget/NoteWidgetProvider_2x.java similarity index 100% rename from src/java/net/micode/notes/widget/NoteWidgetProvider_2x.java rename to src/main/java/net/micode/notes/widget/NoteWidgetProvider_2x.java diff --git a/src/java/net/micode/notes/widget/NoteWidgetProvider_4x.java b/src/main/java/net/micode/notes/widget/NoteWidgetProvider_4x.java similarity index 100% rename from src/java/net/micode/notes/widget/NoteWidgetProvider_4x.java rename to src/main/java/net/micode/notes/widget/NoteWidgetProvider_4x.java diff --git a/src/res/color/primary_text_dark.xml b/src/main/res/color/primary_text_dark.xml similarity index 100% rename from src/res/color/primary_text_dark.xml rename to src/main/res/color/primary_text_dark.xml diff --git a/src/res/color/secondary_text_dark.xml b/src/main/res/color/secondary_text_dark.xml similarity index 100% rename from src/res/color/secondary_text_dark.xml rename to src/main/res/color/secondary_text_dark.xml diff --git a/src/main/res/drawable-hdpi/app1.png b/src/main/res/drawable-hdpi/app1.png new file mode 100644 index 00000000..1c5d69a2 Binary files /dev/null and b/src/main/res/drawable-hdpi/app1.png differ diff --git a/src/res/drawable-hdpi/bg_btn_set_color.png b/src/main/res/drawable-hdpi/bg_btn_set_color.png similarity index 100% rename from src/res/drawable-hdpi/bg_btn_set_color.png rename to src/main/res/drawable-hdpi/bg_btn_set_color.png diff --git a/src/res/drawable-hdpi/bg_color_btn_mask.png b/src/main/res/drawable-hdpi/bg_color_btn_mask.png similarity index 100% rename from src/res/drawable-hdpi/bg_color_btn_mask.png rename to src/main/res/drawable-hdpi/bg_color_btn_mask.png diff --git a/src/res/drawable-hdpi/call_record.png b/src/main/res/drawable-hdpi/call_record.png similarity index 100% rename from src/res/drawable-hdpi/call_record.png rename to src/main/res/drawable-hdpi/call_record.png diff --git a/src/res/drawable-hdpi/clock.png b/src/main/res/drawable-hdpi/clock.png similarity index 100% rename from src/res/drawable-hdpi/clock.png rename to src/main/res/drawable-hdpi/clock.png diff --git a/src/res/drawable-hdpi/delete.png b/src/main/res/drawable-hdpi/delete.png similarity index 100% rename from src/res/drawable-hdpi/delete.png rename to src/main/res/drawable-hdpi/delete.png diff --git a/src/res/drawable-hdpi/dropdown_icon.9.png b/src/main/res/drawable-hdpi/dropdown_icon.9.png similarity index 100% rename from src/res/drawable-hdpi/dropdown_icon.9.png rename to src/main/res/drawable-hdpi/dropdown_icon.9.png diff --git a/src/res/drawable-hdpi/edit_blue.9.png b/src/main/res/drawable-hdpi/edit_blue.9.png similarity index 100% rename from src/res/drawable-hdpi/edit_blue.9.png rename to src/main/res/drawable-hdpi/edit_blue.9.png diff --git a/src/res/drawable-hdpi/edit_green.9.png b/src/main/res/drawable-hdpi/edit_green.9.png similarity index 100% rename from src/res/drawable-hdpi/edit_green.9.png rename to src/main/res/drawable-hdpi/edit_green.9.png diff --git a/src/res/drawable-hdpi/edit_red.9.png b/src/main/res/drawable-hdpi/edit_red.9.png similarity index 100% rename from src/res/drawable-hdpi/edit_red.9.png rename to src/main/res/drawable-hdpi/edit_red.9.png diff --git a/src/res/drawable-hdpi/edit_title_blue.9.png b/src/main/res/drawable-hdpi/edit_title_blue.9.png similarity index 100% rename from src/res/drawable-hdpi/edit_title_blue.9.png rename to src/main/res/drawable-hdpi/edit_title_blue.9.png diff --git a/src/res/drawable-hdpi/edit_title_green.9.png b/src/main/res/drawable-hdpi/edit_title_green.9.png similarity index 100% rename from src/res/drawable-hdpi/edit_title_green.9.png rename to src/main/res/drawable-hdpi/edit_title_green.9.png diff --git a/src/res/drawable-hdpi/edit_title_red.9.png b/src/main/res/drawable-hdpi/edit_title_red.9.png similarity index 100% rename from src/res/drawable-hdpi/edit_title_red.9.png rename to src/main/res/drawable-hdpi/edit_title_red.9.png diff --git a/src/res/drawable-hdpi/edit_title_white.9.png b/src/main/res/drawable-hdpi/edit_title_white.9.png similarity index 100% rename from src/res/drawable-hdpi/edit_title_white.9.png rename to src/main/res/drawable-hdpi/edit_title_white.9.png diff --git a/src/res/drawable-hdpi/edit_title_yellow.9.png b/src/main/res/drawable-hdpi/edit_title_yellow.9.png similarity index 100% rename from src/res/drawable-hdpi/edit_title_yellow.9.png rename to src/main/res/drawable-hdpi/edit_title_yellow.9.png diff --git a/src/res/drawable-hdpi/edit_white.9.png b/src/main/res/drawable-hdpi/edit_white.9.png similarity index 100% rename from src/res/drawable-hdpi/edit_white.9.png rename to src/main/res/drawable-hdpi/edit_white.9.png diff --git a/src/res/drawable-hdpi/edit_yellow.9.png b/src/main/res/drawable-hdpi/edit_yellow.9.png similarity index 100% rename from src/res/drawable-hdpi/edit_yellow.9.png rename to src/main/res/drawable-hdpi/edit_yellow.9.png diff --git a/src/res/drawable-hdpi/font_large.png b/src/main/res/drawable-hdpi/font_large.png similarity index 100% rename from src/res/drawable-hdpi/font_large.png rename to src/main/res/drawable-hdpi/font_large.png diff --git a/src/res/drawable-hdpi/font_normal.png b/src/main/res/drawable-hdpi/font_normal.png similarity index 100% rename from src/res/drawable-hdpi/font_normal.png rename to src/main/res/drawable-hdpi/font_normal.png diff --git a/src/res/drawable-hdpi/font_size_selector_bg.9.png b/src/main/res/drawable-hdpi/font_size_selector_bg.9.png similarity index 100% rename from src/res/drawable-hdpi/font_size_selector_bg.9.png rename to src/main/res/drawable-hdpi/font_size_selector_bg.9.png diff --git a/src/res/drawable-hdpi/font_small.png b/src/main/res/drawable-hdpi/font_small.png similarity index 100% rename from src/res/drawable-hdpi/font_small.png rename to src/main/res/drawable-hdpi/font_small.png diff --git a/src/res/drawable-hdpi/font_super.png b/src/main/res/drawable-hdpi/font_super.png similarity index 100% rename from src/res/drawable-hdpi/font_super.png rename to src/main/res/drawable-hdpi/font_super.png diff --git a/src/main/res/drawable-hdpi/grassland.png b/src/main/res/drawable-hdpi/grassland.png new file mode 100644 index 00000000..f2b03744 Binary files /dev/null and b/src/main/res/drawable-hdpi/grassland.png differ diff --git a/src/res/drawable-hdpi/icon_app.png b/src/main/res/drawable-hdpi/icon_app.png similarity index 100% rename from src/res/drawable-hdpi/icon_app.png rename to src/main/res/drawable-hdpi/icon_app.png diff --git a/src/res/drawable-hdpi/list_background.png b/src/main/res/drawable-hdpi/list_background.png similarity index 100% rename from src/res/drawable-hdpi/list_background.png rename to src/main/res/drawable-hdpi/list_background.png diff --git a/src/res/drawable-hdpi/list_blue_down.9.png b/src/main/res/drawable-hdpi/list_blue_down.9.png similarity index 100% rename from src/res/drawable-hdpi/list_blue_down.9.png rename to src/main/res/drawable-hdpi/list_blue_down.9.png diff --git a/src/res/drawable-hdpi/list_blue_middle.9.png b/src/main/res/drawable-hdpi/list_blue_middle.9.png similarity index 100% rename from src/res/drawable-hdpi/list_blue_middle.9.png rename to src/main/res/drawable-hdpi/list_blue_middle.9.png diff --git a/src/res/drawable-hdpi/list_blue_single.9.png b/src/main/res/drawable-hdpi/list_blue_single.9.png similarity index 100% rename from src/res/drawable-hdpi/list_blue_single.9.png rename to src/main/res/drawable-hdpi/list_blue_single.9.png diff --git a/src/res/drawable-hdpi/list_blue_up.9.png b/src/main/res/drawable-hdpi/list_blue_up.9.png similarity index 100% rename from src/res/drawable-hdpi/list_blue_up.9.png rename to src/main/res/drawable-hdpi/list_blue_up.9.png diff --git a/src/res/drawable-hdpi/list_folder.9.png b/src/main/res/drawable-hdpi/list_folder.9.png similarity index 100% rename from src/res/drawable-hdpi/list_folder.9.png rename to src/main/res/drawable-hdpi/list_folder.9.png diff --git a/src/res/drawable-hdpi/list_footer_bg.9.png b/src/main/res/drawable-hdpi/list_footer_bg.9.png similarity index 100% rename from src/res/drawable-hdpi/list_footer_bg.9.png rename to src/main/res/drawable-hdpi/list_footer_bg.9.png diff --git a/src/res/drawable-hdpi/list_green_down.9.png b/src/main/res/drawable-hdpi/list_green_down.9.png similarity index 100% rename from src/res/drawable-hdpi/list_green_down.9.png rename to src/main/res/drawable-hdpi/list_green_down.9.png diff --git a/src/res/drawable-hdpi/list_green_middle.9.png b/src/main/res/drawable-hdpi/list_green_middle.9.png similarity index 100% rename from src/res/drawable-hdpi/list_green_middle.9.png rename to src/main/res/drawable-hdpi/list_green_middle.9.png diff --git a/src/res/drawable-hdpi/list_green_single.9.png b/src/main/res/drawable-hdpi/list_green_single.9.png similarity index 100% rename from src/res/drawable-hdpi/list_green_single.9.png rename to src/main/res/drawable-hdpi/list_green_single.9.png diff --git a/src/res/drawable-hdpi/list_green_up.9.png b/src/main/res/drawable-hdpi/list_green_up.9.png similarity index 100% rename from src/res/drawable-hdpi/list_green_up.9.png rename to src/main/res/drawable-hdpi/list_green_up.9.png diff --git a/src/res/drawable-hdpi/list_red_down.9.png b/src/main/res/drawable-hdpi/list_red_down.9.png similarity index 100% rename from src/res/drawable-hdpi/list_red_down.9.png rename to src/main/res/drawable-hdpi/list_red_down.9.png diff --git a/src/res/drawable-hdpi/list_red_middle.9.png b/src/main/res/drawable-hdpi/list_red_middle.9.png similarity index 100% rename from src/res/drawable-hdpi/list_red_middle.9.png rename to src/main/res/drawable-hdpi/list_red_middle.9.png diff --git a/src/res/drawable-hdpi/list_red_single.9.png b/src/main/res/drawable-hdpi/list_red_single.9.png similarity index 100% rename from src/res/drawable-hdpi/list_red_single.9.png rename to src/main/res/drawable-hdpi/list_red_single.9.png diff --git a/src/res/drawable-hdpi/list_red_up.9.png b/src/main/res/drawable-hdpi/list_red_up.9.png similarity index 100% rename from src/res/drawable-hdpi/list_red_up.9.png rename to src/main/res/drawable-hdpi/list_red_up.9.png diff --git a/src/res/drawable-hdpi/list_white_down.9.png b/src/main/res/drawable-hdpi/list_white_down.9.png similarity index 100% rename from src/res/drawable-hdpi/list_white_down.9.png rename to src/main/res/drawable-hdpi/list_white_down.9.png diff --git a/src/res/drawable-hdpi/list_white_middle.9.png b/src/main/res/drawable-hdpi/list_white_middle.9.png similarity index 100% rename from src/res/drawable-hdpi/list_white_middle.9.png rename to src/main/res/drawable-hdpi/list_white_middle.9.png diff --git a/src/res/drawable-hdpi/list_white_single.9.png b/src/main/res/drawable-hdpi/list_white_single.9.png similarity index 100% rename from src/res/drawable-hdpi/list_white_single.9.png rename to src/main/res/drawable-hdpi/list_white_single.9.png diff --git a/src/res/drawable-hdpi/list_white_up.9.png b/src/main/res/drawable-hdpi/list_white_up.9.png similarity index 100% rename from src/res/drawable-hdpi/list_white_up.9.png rename to src/main/res/drawable-hdpi/list_white_up.9.png diff --git a/src/res/drawable-hdpi/list_yellow_down.9.png b/src/main/res/drawable-hdpi/list_yellow_down.9.png similarity index 100% rename from src/res/drawable-hdpi/list_yellow_down.9.png rename to src/main/res/drawable-hdpi/list_yellow_down.9.png diff --git a/src/res/drawable-hdpi/list_yellow_middle.9.png b/src/main/res/drawable-hdpi/list_yellow_middle.9.png similarity index 100% rename from src/res/drawable-hdpi/list_yellow_middle.9.png rename to src/main/res/drawable-hdpi/list_yellow_middle.9.png diff --git a/src/res/drawable-hdpi/list_yellow_single.9.png b/src/main/res/drawable-hdpi/list_yellow_single.9.png similarity index 100% rename from src/res/drawable-hdpi/list_yellow_single.9.png rename to src/main/res/drawable-hdpi/list_yellow_single.9.png diff --git a/src/res/drawable-hdpi/list_yellow_up.9.png b/src/main/res/drawable-hdpi/list_yellow_up.9.png similarity index 100% rename from src/res/drawable-hdpi/list_yellow_up.9.png rename to src/main/res/drawable-hdpi/list_yellow_up.9.png diff --git a/src/main/res/drawable-hdpi/magma.png b/src/main/res/drawable-hdpi/magma.png new file mode 100644 index 00000000..815db918 Binary files /dev/null and b/src/main/res/drawable-hdpi/magma.png differ diff --git a/src/res/drawable-hdpi/menu_delete.png b/src/main/res/drawable-hdpi/menu_delete.png similarity index 100% rename from src/res/drawable-hdpi/menu_delete.png rename to src/main/res/drawable-hdpi/menu_delete.png diff --git a/src/res/drawable-hdpi/menu_move.png b/src/main/res/drawable-hdpi/menu_move.png similarity index 100% rename from src/res/drawable-hdpi/menu_move.png rename to src/main/res/drawable-hdpi/menu_move.png diff --git a/src/res/drawable-hdpi/new_note_normal.png b/src/main/res/drawable-hdpi/new_note_normal.png similarity index 100% rename from src/res/drawable-hdpi/new_note_normal.png rename to src/main/res/drawable-hdpi/new_note_normal.png diff --git a/src/res/drawable-hdpi/new_note_pressed.png b/src/main/res/drawable-hdpi/new_note_pressed.png similarity index 100% rename from src/res/drawable-hdpi/new_note_pressed.png rename to src/main/res/drawable-hdpi/new_note_pressed.png diff --git a/src/res/drawable-hdpi/note_edit_color_selector_panel.png b/src/main/res/drawable-hdpi/note_edit_color_selector_panel.png similarity index 100% rename from src/res/drawable-hdpi/note_edit_color_selector_panel.png rename to src/main/res/drawable-hdpi/note_edit_color_selector_panel.png diff --git a/src/res/drawable-hdpi/notification.png b/src/main/res/drawable-hdpi/notification.png similarity index 100% rename from src/res/drawable-hdpi/notification.png rename to src/main/res/drawable-hdpi/notification.png diff --git a/src/res/drawable-hdpi/search_result.png b/src/main/res/drawable-hdpi/search_result.png similarity index 100% rename from src/res/drawable-hdpi/search_result.png rename to src/main/res/drawable-hdpi/search_result.png diff --git a/src/res/drawable-hdpi/selected.png b/src/main/res/drawable-hdpi/selected.png similarity index 100% rename from src/res/drawable-hdpi/selected.png rename to src/main/res/drawable-hdpi/selected.png diff --git a/src/main/res/drawable-hdpi/splash.png b/src/main/res/drawable-hdpi/splash.png new file mode 100644 index 00000000..1f6ae357 Binary files /dev/null and b/src/main/res/drawable-hdpi/splash.png differ diff --git a/src/res/drawable-hdpi/title_alert.png b/src/main/res/drawable-hdpi/title_alert.png similarity index 100% rename from src/res/drawable-hdpi/title_alert.png rename to src/main/res/drawable-hdpi/title_alert.png diff --git a/src/res/drawable-hdpi/title_bar_bg.9.png b/src/main/res/drawable-hdpi/title_bar_bg.9.png similarity index 100% rename from src/res/drawable-hdpi/title_bar_bg.9.png rename to src/main/res/drawable-hdpi/title_bar_bg.9.png diff --git a/src/main/res/drawable-hdpi/water.png b/src/main/res/drawable-hdpi/water.png new file mode 100644 index 00000000..31dd3cfc Binary files /dev/null and b/src/main/res/drawable-hdpi/water.png differ diff --git a/src/res/drawable-hdpi/widget_2x_blue.png b/src/main/res/drawable-hdpi/widget_2x_blue.png similarity index 100% rename from src/res/drawable-hdpi/widget_2x_blue.png rename to src/main/res/drawable-hdpi/widget_2x_blue.png diff --git a/src/res/drawable-hdpi/widget_2x_green.png b/src/main/res/drawable-hdpi/widget_2x_green.png similarity index 100% rename from src/res/drawable-hdpi/widget_2x_green.png rename to src/main/res/drawable-hdpi/widget_2x_green.png diff --git a/src/res/drawable-hdpi/widget_2x_red.png b/src/main/res/drawable-hdpi/widget_2x_red.png similarity index 100% rename from src/res/drawable-hdpi/widget_2x_red.png rename to src/main/res/drawable-hdpi/widget_2x_red.png diff --git a/src/res/drawable-hdpi/widget_2x_white.png b/src/main/res/drawable-hdpi/widget_2x_white.png similarity index 100% rename from src/res/drawable-hdpi/widget_2x_white.png rename to src/main/res/drawable-hdpi/widget_2x_white.png diff --git a/src/res/drawable-hdpi/widget_2x_yellow.png b/src/main/res/drawable-hdpi/widget_2x_yellow.png similarity index 100% rename from src/res/drawable-hdpi/widget_2x_yellow.png rename to src/main/res/drawable-hdpi/widget_2x_yellow.png diff --git a/src/res/drawable-hdpi/widget_4x_blue.png b/src/main/res/drawable-hdpi/widget_4x_blue.png similarity index 100% rename from src/res/drawable-hdpi/widget_4x_blue.png rename to src/main/res/drawable-hdpi/widget_4x_blue.png diff --git a/src/res/drawable-hdpi/widget_4x_green.png b/src/main/res/drawable-hdpi/widget_4x_green.png similarity index 100% rename from src/res/drawable-hdpi/widget_4x_green.png rename to src/main/res/drawable-hdpi/widget_4x_green.png diff --git a/src/res/drawable-hdpi/widget_4x_red.png b/src/main/res/drawable-hdpi/widget_4x_red.png similarity index 100% rename from src/res/drawable-hdpi/widget_4x_red.png rename to src/main/res/drawable-hdpi/widget_4x_red.png diff --git a/src/res/drawable-hdpi/widget_4x_white.png b/src/main/res/drawable-hdpi/widget_4x_white.png similarity index 100% rename from src/res/drawable-hdpi/widget_4x_white.png rename to src/main/res/drawable-hdpi/widget_4x_white.png diff --git a/src/res/drawable-hdpi/widget_4x_yellow.png b/src/main/res/drawable-hdpi/widget_4x_yellow.png similarity index 100% rename from src/res/drawable-hdpi/widget_4x_yellow.png rename to src/main/res/drawable-hdpi/widget_4x_yellow.png diff --git a/src/res/drawable/new_note.xml b/src/main/res/drawable/new_note.xml similarity index 100% rename from src/res/drawable/new_note.xml rename to src/main/res/drawable/new_note.xml diff --git a/src/res/layout/account_dialog_title.xml b/src/main/res/layout/account_dialog_title.xml similarity index 100% rename from src/res/layout/account_dialog_title.xml rename to src/main/res/layout/account_dialog_title.xml diff --git a/src/res/layout/activity_splash.xml b/src/main/res/layout/activity_splash.xml similarity index 67% rename from src/res/layout/activity_splash.xml rename to src/main/res/layout/activity_splash.xml index eee3607d..f6cba834 100644 --- a/src/res/layout/activity_splash.xml +++ b/src/main/res/layout/activity_splash.xml @@ -1,37 +1,26 @@ - + + + \ No newline at end of file diff --git a/src/res/layout/add_account_text.xml b/src/main/res/layout/add_account_text.xml similarity index 100% rename from src/res/layout/add_account_text.xml rename to src/main/res/layout/add_account_text.xml diff --git a/src/res/layout/datetime_picker.xml b/src/main/res/layout/datetime_picker.xml similarity index 100% rename from src/res/layout/datetime_picker.xml rename to src/main/res/layout/datetime_picker.xml diff --git a/src/res/layout/dialog_edit_text.xml b/src/main/res/layout/dialog_edit_text.xml similarity index 100% rename from src/res/layout/dialog_edit_text.xml rename to src/main/res/layout/dialog_edit_text.xml diff --git a/src/res/layout/folder_list_item.xml b/src/main/res/layout/folder_list_item.xml similarity index 100% rename from src/res/layout/folder_list_item.xml rename to src/main/res/layout/folder_list_item.xml diff --git a/src/res/layout/note_edit.xml b/src/main/res/layout/note_edit.xml similarity index 98% rename from src/res/layout/note_edit.xml rename to src/main/res/layout/note_edit.xml index d3e3e6fe..3905d61f 100644 --- a/src/res/layout/note_edit.xml +++ b/src/main/res/layout/note_edit.xml @@ -39,6 +39,14 @@ android:layout_gravity="left|center_vertical" android:layout_marginRight="8dip" android:textAppearance="@style/TextAppearanceSecondaryItem" /> + + - - - - - - - - diff --git a/src/res/layout/note_list.xml b/src/main/res/layout/note_list.xml similarity index 95% rename from src/res/layout/note_list.xml rename to src/main/res/layout/note_list.xml index 6b25d38f..e4b35850 100644 --- a/src/res/layout/note_list.xml +++ b/src/main/res/layout/note_list.xml @@ -18,9 +18,9 @@ + android:layout_height="fill_parent"> + - - - - - - - - - - diff --git a/src/res/menu/note_list.xml b/src/main/res/menu/note_list.xml similarity index 79% rename from src/res/menu/note_list.xml rename to src/main/res/menu/note_list.xml index 42ea7363..8ebaa718 100644 --- a/src/res/menu/note_list.xml +++ b/src/main/res/menu/note_list.xml @@ -36,4 +36,17 @@ + + + + + + + diff --git a/src/res/menu/note_list_dropdown.xml b/src/main/res/menu/note_list_dropdown.xml similarity index 100% rename from src/res/menu/note_list_dropdown.xml rename to src/main/res/menu/note_list_dropdown.xml diff --git a/src/res/menu/note_list_options.xml b/src/main/res/menu/note_list_options.xml similarity index 100% rename from src/res/menu/note_list_options.xml rename to src/main/res/menu/note_list_options.xml diff --git a/src/res/menu/sub_folder.xml b/src/main/res/menu/sub_folder.xml similarity index 100% rename from src/res/menu/sub_folder.xml rename to src/main/res/menu/sub_folder.xml diff --git a/src/res/raw-zh-rCN/introduction b/src/main/res/raw-zh-rCN/introduction similarity index 100% rename from src/res/raw-zh-rCN/introduction rename to src/main/res/raw-zh-rCN/introduction diff --git a/src/res/raw/introduction b/src/main/res/raw/introduction similarity index 100% rename from src/res/raw/introduction rename to src/main/res/raw/introduction diff --git a/src/main/res/values-night/themes.xml b/src/main/res/values-night/themes.xml new file mode 100644 index 00000000..326b9fef --- /dev/null +++ b/src/main/res/values-night/themes.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/src/res/values-zh-rCN/arrays.xml b/src/main/res/values-zh-rCN/arrays.xml similarity index 100% rename from src/res/values-zh-rCN/arrays.xml rename to src/main/res/values-zh-rCN/arrays.xml diff --git a/src/res/values-zh-rCN/strings.xml b/src/main/res/values-zh-rCN/strings.xml similarity index 92% rename from src/res/values-zh-rCN/strings.xml rename to src/main/res/values-zh-rCN/strings.xml index b17a129c..09f75ed9 100644 --- a/src/res/values-zh-rCN/strings.xml +++ b/src/main/res/values-zh-rCN/strings.xml @@ -63,13 +63,6 @@ 发送到桌面 提醒我 删除提醒 - 置顶 - 取消置顶 - 星标 - 删除星标 - 加密 - 取消加密 - 密码已删除 选择文件夹 上一级文件夹 已添加到桌面 @@ -83,10 +76,7 @@ 导出文本时发生错误,请检查SD卡 要查看的便签不存在 不能为空便签设置闹钟提醒 - 不能置顶空便签 不能将空便签发送到桌面 - 不能删除星标便签 - 不能删除加密便签 导出成功 导出失败 已将文本文件(%1$s)输出至SD卡(%2$s)目录 diff --git a/src/res/values-zh-rTW/arrays.xml b/src/main/res/values-zh-rTW/arrays.xml similarity index 100% rename from src/res/values-zh-rTW/arrays.xml rename to src/main/res/values-zh-rTW/arrays.xml diff --git a/src/res/values-zh-rTW/strings.xml b/src/main/res/values-zh-rTW/strings.xml similarity index 92% rename from src/res/values-zh-rTW/strings.xml rename to src/main/res/values-zh-rTW/strings.xml index e0028409..e29b79bc 100644 --- a/src/res/values-zh-rTW/strings.xml +++ b/src/main/res/values-zh-rTW/strings.xml @@ -1,4 +1,4 @@ - + + + + 背景:水面 + 背景:岩浆 + 背景:草地 + (%d) New Folder Export text @@ -69,13 +73,6 @@ Send to home Remind me Delete reminder - Top - Cancel Top - Star - Delete Star - Lock - Delete Lock - Passcode has deleted Select folder Parent folder Note added to home @@ -89,10 +86,7 @@ Export failed, please check SD card The note is not exist Sorry, can not set clock on empty note - Sorry, can not set top on empty note Sorry, can not send and empty note to home - Sorry, can not delete star note - Sorry, can not delete locked note Export successful Export fail Export text file (%1$s) to SD (%2$s) directory @@ -143,5 +137,9 @@ %1$s results for \"%2$s\" + FullscreenActivity + Dummy Button + 记录你的每一天 + SplashActivity diff --git a/src/res/values/styles.xml b/src/main/res/values/styles.xml similarity index 89% rename from src/res/values/styles.xml rename to src/main/res/values/styles.xml index f803d368..9d116508 100644 --- a/src/res/values/styles.xml +++ b/src/main/res/values/styles.xml @@ -16,22 +16,18 @@ --> - - - - @@ -67,15 +63,14 @@ - - - diff --git a/src/res/values/themes.xml b/src/main/res/values/themes.xml similarity index 60% rename from src/res/values/themes.xml rename to src/main/res/values/themes.xml index 6ddddf73..c369acf0 100644 --- a/src/res/values/themes.xml +++ b/src/main/res/values/themes.xml @@ -1,15 +1,13 @@ - - - diff --git a/src/res/xml/preferences.xml b/src/main/res/xml/preferences.xml similarity index 100% rename from src/res/xml/preferences.xml rename to src/main/res/xml/preferences.xml diff --git a/src/res/xml/searchable.xml b/src/main/res/xml/searchable.xml similarity index 100% rename from src/res/xml/searchable.xml rename to src/main/res/xml/searchable.xml diff --git a/src/res/xml/widget_2x_info.xml b/src/main/res/xml/widget_2x_info.xml similarity index 100% rename from src/res/xml/widget_2x_info.xml rename to src/main/res/xml/widget_2x_info.xml diff --git a/src/res/xml/widget_4x_info.xml b/src/main/res/xml/widget_4x_info.xml similarity index 100% rename from src/res/xml/widget_4x_info.xml rename to src/main/res/xml/widget_4x_info.xml diff --git a/src/res/drawable-hdpi/bitmap_error.png b/src/res/drawable-hdpi/bitmap_error.png deleted file mode 100644 index 72424a8b..00000000 Binary files a/src/res/drawable-hdpi/bitmap_error.png and /dev/null differ diff --git a/src/res/drawable-hdpi/bitmap_normal.png b/src/res/drawable-hdpi/bitmap_normal.png deleted file mode 100644 index 8de75243..00000000 Binary files a/src/res/drawable-hdpi/bitmap_normal.png and /dev/null differ diff --git a/src/res/drawable-hdpi/bitmap_pressed.png b/src/res/drawable-hdpi/bitmap_pressed.png deleted file mode 100644 index f5773c0d..00000000 Binary files a/src/res/drawable-hdpi/bitmap_pressed.png and /dev/null differ diff --git a/src/res/drawable-hdpi/line_error.png b/src/res/drawable-hdpi/line_error.png deleted file mode 100644 index 93f87995..00000000 Binary files a/src/res/drawable-hdpi/line_error.png and /dev/null differ diff --git a/src/res/drawable-hdpi/line_pressed.png b/src/res/drawable-hdpi/line_pressed.png deleted file mode 100644 index 9ab92d17..00000000 Binary files a/src/res/drawable-hdpi/line_pressed.png and /dev/null differ diff --git a/src/res/drawable-hdpi/lock.png b/src/res/drawable-hdpi/lock.png deleted file mode 100644 index 2cb64d01..00000000 Binary files a/src/res/drawable-hdpi/lock.png and /dev/null differ diff --git a/src/res/drawable-hdpi/menu_top.png b/src/res/drawable-hdpi/menu_top.png deleted file mode 100644 index 6568ddf4..00000000 Binary files a/src/res/drawable-hdpi/menu_top.png and /dev/null differ diff --git a/src/res/drawable-hdpi/splash.jpg b/src/res/drawable-hdpi/splash.jpg deleted file mode 100644 index cb1ef035..00000000 Binary files a/src/res/drawable-hdpi/splash.jpg and /dev/null differ diff --git a/src/res/drawable-hdpi/star.png b/src/res/drawable-hdpi/star.png deleted file mode 100644 index f72b6699..00000000 Binary files a/src/res/drawable-hdpi/star.png and /dev/null differ diff --git a/src/res/drawable/settings_launcher_background.xml b/src/res/drawable/settings_launcher_background.xml deleted file mode 100644 index ca3826a4..00000000 --- a/src/res/drawable/settings_launcher_background.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/res/layout/activity_lock.xml b/src/res/layout/activity_lock.xml deleted file mode 100644 index f26cd81e..00000000 --- a/src/res/layout/activity_lock.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - diff --git a/src/res/layout/activity_set_lock.xml b/src/res/layout/activity_set_lock.xml deleted file mode 100644 index 2d5f203f..00000000 --- a/src/res/layout/activity_set_lock.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - -