Compare commits

...

46 Commits

Author SHA1 Message Date
王润泽 fd203c4f0a 完结撒花
2 years ago
王润泽 5d66dc7cf7 除了泛读,全部最后
2 years ago
王润泽 f10635b720 除了泛读报告以外,全部为最后
2 years ago
王润泽 aba3d0dc8c 实现背景切换,欢迎界面
2 years ago
王润泽 f7b3c00a10 添加了背景切换,欢迎界面
2 years ago
王润泽 1736f1f57a Merge branch 'wangrunze_branch' of https://bdgit.educoder.net/mth9uq3ve/xiaomi_mini
2 years ago
王润泽 96891ded29 完成了背景切换和欢迎界面
2 years ago
夏彦博 be81ecfa6a 修复了私密模式未经允许提前进入以及按键不随是否属于私密模式变换的bug
2 years ago
王润泽 a8223eb850 实现背景及切换
2 years ago
王润泽 3efc053b12 Merge branch 'develop' of https://bdgit.educoder.net/mth9uq3ve/xiaomi_mini
2 years ago
夏彦博 11acb45652 初步完成插入图片功能
2 years ago
mth9uq3ve 6a75eafbfe 期中测评的报告以及代码上传
2 years ago
mth9uq3ve c1fc0da4f6 ui包大部分代码批注上传
2 years ago
王润泽 8f4fa66623 代码注释
2 years ago
mth9uq3ve 25a53b6eac ui包大部分代码批注上传
2 years ago
夏彦博 204772e78e 批注了model包,上传两个报告进行期中测评
2 years ago
王润泽 ee9e7d0bb3 Merge branch 'wangrunze_branch' of https://bdgit.educoder.net/mth9uq3ve/xiaomi_mini
2 years ago
夏彦博 6b3a15d3b9 补上王润泽上次误传的代码
2 years ago
夏彦博 a7733f05de 初步完成私密模式功能
2 years ago
mth9uq3ve 373a15ac18 两个文档第一次提交
2 years ago
夏彦博 7759bfd902 文档第一次提交
2 years ago
王润泽 de9efc5179 活动
2 years ago
mth9uq3ve 0a3a2ebde1 精读批注第二次提交
2 years ago
夏彦博 a8b8243502 批注了NoteEditActivity
2 years ago
mth9uq3ve adfcb1ae14 精读批注第一次上传
2 years ago
夏彦博 127e07ab58 批注了NoteEditText和GTaskASyncTask两个类
2 years ago
夏彦博 d9b9dde803 标准批注了exception两个类
2 years ago
夏彦博 ee0e553b4f 增加了批注的行数的统计表
2 years ago
夏彦博 60f54c08db gtask包中的data包批注完成
2 years ago
夏彦博 b9e5d499ac 批注gtask包中的data里面的4个类
2 years ago
mth9uq3ve 9928cf3ca5 提交完整的泛读报告
2 years ago
夏彦博 7b2964bf2d 更新包图,并统一文章格式,排版
2 years ago
王润泽 3504c8ad29 功能与类的关系
2 years ago
王润泽 e74122b424 Merge branch 'develop' of https://bdgit.educoder.net/mth9uq3ve/xiaomi_mini
2 years ago
王润泽 6b062ad113 ui包,model包类图
2 years ago
夏彦博 5c0ee8bd93 修复了data包的类图由于内部类导致的一点问题
2 years ago
夏彦博 6671235f86 完善了widget,gtask类图,以及包图更新
2 years ago
mth9uq3ve ef14e3cb62 Merge pull request 'model类图' (#1) from wangrunze_branch into develop
2 years ago
王润泽 668a3891de model类图
2 years ago
夏彦博 d53e521725 修改了图中的一点错误
2 years ago
夏彦博 d36c289d71 新增了包图类图,但还缺失了部分
2 years ago
夏彦博 16dbf92587 修改了用例图部分
2 years ago
夏彦博 fda7e22298 泛读大概的理解
2 years ago
夏彦博 16c1a52349 新批注了另外两个
2 years ago
夏彦博 1eafd04b5e 泛读Note以及Contact做了适当批注
2 years ago
夏彦博 ccadbd921b 创建当前版本
2 years ago

@ -1,2 +0,0 @@
# xiaomi_mini

Binary file not shown.

@ -1,26 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.micode.notes"
android:versionCode="1"
android:versionName="0.1" >
android:versionName="0.1">
<uses-sdk android:minSdkVersion="14" />
<uses-sdk android:minSdkVersion="16" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
@ -34,44 +18,44 @@
<application
android:icon="@drawable/icon_app"
android:label="@string/app_name" >
android:label="@string/app_name">
<activity
android:name=".ui.NotesListActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTop"
android:theme="@style/NoteTheme"
android:theme="@style/Theme.AppCompat.Light.DarkActionBar"
android:uiOptions="splitActionBarWhenNarrow"
android:windowSoftInputMode="adjustPan" >
android:windowSoftInputMode="adjustPan">
</activity>
<activity
android:name=".ui.SplashActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/Theme.Notesmaster.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.NoteEditActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop"
android:theme="@style/NoteTheme" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/text_note" />
<data android:mimeType="vnd.android.cursor.item/call_note" />
</intent-filter>
android:theme="@style/Theme.AppCompat.Light.DarkActionBar">
<intent-filter>
<action android:name="android.intent.action.INSERT_OR_EDIT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/text_note" />
<data android:mimeType="vnd.android.cursor.item/call_note" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
@ -81,13 +65,13 @@
</activity>
<provider
android:name="net.micode.notes.data.NotesProvider"
android:name=".data.NotesProvider"
android:authorities="micode_notes"
android:multiprocess="true" />
<receiver
android:name=".widget.NoteWidgetProvider_2x"
android:label="@string/app_widget2x2" >
android:label="@string/app_widget2x2">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="android.appwidget.action.APPWIDGET_DELETED" />
@ -100,8 +84,7 @@
</receiver>
<receiver
android:name=".widget.NoteWidgetProvider_4x"
android:label="@string/app_widget4x4" >
android:label="@string/app_widget4x4">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="android.appwidget.action.APPWIDGET_DELETED" />
@ -112,39 +95,33 @@
android:name="android.appwidget.provider"
android:resource="@xml/widget_4x_info" />
</receiver>
<receiver android:name=".ui.AlarmInitReceiver" >
<receiver android:name=".ui.AlarmInitReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<receiver
android:name="net.micode.notes.ui.AlarmReceiver"
android:process=":remote" >
</receiver>
android:name=".ui.AlarmReceiver"
android:process=":remote"></receiver>
<activity
android:name=".ui.AlarmAlertActivity"
android:label="@string/app_name"
android:launchMode="singleInstance"
android:theme="@android:style/Theme.Holo.Wallpaper.NoTitleBar" >
</activity>
android:theme="@android:style/Theme.Holo.Wallpaper.NoTitleBar"></activity>
<activity
android:name="net.micode.notes.ui.NotesPreferenceActivity"
android:name=".ui.NotesPreferenceActivity"
android:label="@string/preferences_title"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Holo.Light" >
</activity>
android:theme="@android:style/Theme.Holo.Light"></activity>
<service
android:name="net.micode.notes.gtask.remote.GTaskSyncService"
android:exported="false" >
</service>
android:name=".gtask.remote.GTaskSyncService"
android:exported="false"></service>
<meta-data
android:name="android.app.default_searchable"
android:value=".ui.NoteEditActivity" />
</application>
</manifest>
</manifest>

@ -59,7 +59,12 @@ import java.util.List;
import java.util.zip.GZIPInputStream;
import java.util.zip.Inflater;
import java.util.zip.InflaterInputStream;
/**
* @classname: GTaskClient
* @description:GTASKGTASK
* @date: 2024/1/4 11:21
* @author: wangrunze
*/
public class GTaskClient {
private static final String TAG = GTaskClient.class.getSimpleName();
@ -101,17 +106,32 @@ public class GTaskClient {
mAccount = null;
mUpdateArray = null;
}
/**
* @classname: GTaskClient
* @methodname: getInstance
* @description:
* @date: 2024/1/4 11:22
* @author: wangrunze
*/
public static synchronized GTaskClient getInstance() {
if (mInstance == null) {
mInstance = new GTaskClient();
}
return mInstance;
}
/**
* @classname: GTaskClient
* @methodname: login
* @description:
* @date: 2024/1/4 11:22
* @author: wangrunze
* @param:Activity activity
* @return:true/false
*/
public boolean login(Activity activity) {
// we suppose that the cookie would expire after 5 minutes
// then we need to re-login
//判断距离最后一次登录操作是否超过5分钟
final long interval = 1000 * 60 * 5;
if (mLastLoginTime + interval < System.currentTimeMillis()) {
mLoggedin = false;
@ -126,6 +146,7 @@ public class GTaskClient {
if (mLoggedin) {
Log.d(TAG, "already logged in");
//如果没超过时间,则不需要重新登录
return true;
}
@ -135,7 +156,7 @@ public class GTaskClient {
Log.e(TAG, "login google account failed");
return false;
}
//使用用户自己的域名登录
// login with custom domain if necessary
if (!(mAccount.name.toLowerCase().endsWith("gmail.com") || mAccount.name.toLowerCase()
.endsWith("googlemail.com"))) {
@ -151,6 +172,7 @@ public class GTaskClient {
}
}
//如果用户账户无法登录则使用谷歌官方的URI进行登录
// try to login with google official url
if (!mLoggedin) {
mGetUrl = GTASK_GET_URL;
@ -163,7 +185,16 @@ public class GTaskClient {
mLoggedin = true;
return true;
}
/**
* @classname: GTaskClient
* @methodname: loginGoogleAccount
* @description:使
* @date: 2024/1/4 11:24
* @author: wangrunze
* @param:Activity activity
* @param:boolean invalidateToken
* @return:
*/
private String loginGoogleAccount(Activity activity, boolean invalidateToken) {
String authToken;
AccountManager accountManager = AccountManager.get(activity);
@ -188,7 +219,7 @@ public class GTaskClient {
Log.e(TAG, "unable to get an account with the same name in the settings");
return null;
}
//获取选中账号的令牌
// get the token now
AccountManagerFuture<Bundle> accountManagerFuture = accountManager.getAuthToken(account,
"goanna_mobile", null, activity, null, null);
@ -206,7 +237,16 @@ public class GTaskClient {
return authToken;
}
/**
* @classname: GTaskClient
* @methodname: tryToLoginGtask
* @description:GTask
* @date: 2024/1/4 11:25
* @author: wangrunze
* @param:Activity activity
* @param:String authToken
* @return:true/false
*/
private boolean tryToLoginGtask(Activity activity, String authToken) {
if (!loginGtask(authToken)) {
// maybe the auth token is out of date, now let's invalidate the
@ -224,7 +264,14 @@ public class GTaskClient {
}
return true;
}
/**
* @classname: GTaskClient
* @methodname: loginGtask
* @description:GTask
* @date: 2024/1/4 11:26
* @author: wangrunze
* @param:String authToken
*/
private boolean loginGtask(String authToken) {
int timeoutConnection = 10000;
int timeoutSocket = 15000;
@ -238,11 +285,11 @@ public class GTaskClient {
// login gtask
try {
String loginUrl = mGetUrl + "?auth=" + authToken;
HttpGet httpGet = new HttpGet(loginUrl);
String loginUrl = mGetUrl + "?auth=" + authToken;//设置登录的url
HttpGet httpGet = new HttpGet(loginUrl);//通过登录的uri实例化网页上资源的查找
HttpResponse response = null;
response = mHttpClient.execute(httpGet);
//获取CookieStore里存放的cookie
// get the cookie now
List<Cookie> cookies = mHttpClient.getCookieStore().getCookies();
boolean hasAuthCookie = false;
@ -254,7 +301,7 @@ public class GTaskClient {
if (!hasAuthCookie) {
Log.w(TAG, "it seems that there is no auth cookie");
}
//获取client的内容
// get the client version
String resString = getResponseContent(response.getEntity());
String jsBegin = "_setup(";
@ -283,14 +330,29 @@ public class GTaskClient {
private int getActionId() {
return mActionId++;
}
/**
* @classname: GTaskClient
* @methodname: createHttpPost
* @description:
* @date: 2024/1/4 11:28
* @author: wangrunze
* @return:httpPost
*/
private HttpPost createHttpPost() {
HttpPost httpPost = new HttpPost(mPostUrl);
httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
httpPost.setHeader("AT", "1");
return httpPost;
}
/**
* @classname: GTaskClient
* @methodname: getResponseContent
* @description:
* @date: 2024/1/4 11:29
* @author: wangrunze
* @param:HttpEntity entity
* @return:
*/
private String getResponseContent(HttpEntity entity) throws IOException {
String contentEncoding = null;
if (entity.getContentEncoding() != null) {
@ -322,7 +384,15 @@ public class GTaskClient {
input.close();
}
}
/**
* @classname: GTaskClient
* @methodname: postRequest
* @description: JSON
* @date: 2024/1/4 11:30
* @author: wangrunze
* @param:JSONObject js
* @return:JSONObject
*/
private JSONObject postRequest(JSONObject js) throws NetworkFailureException {
if (!mLoggedin) {
Log.e(TAG, "please login first");
@ -359,7 +429,14 @@ public class GTaskClient {
throw new ActionFailureException("error occurs when posting request");
}
}
/**
* @classname: GTaskClient
* @methodname: createTask
* @description:
* @date: 2024/1/4 11:31
* @author: wangrunze
* @param:Task task
*/
public void createTask(Task task) throws NetworkFailureException {
commitUpdate();
try {
@ -385,7 +462,14 @@ public class GTaskClient {
throw new ActionFailureException("create task: handing jsonobject failed");
}
}
/**
* @classname: GTaskClient
* @methodname: createTaskList
* @description:
* @date: 2024/1/4 11:31
* @author: wangrunze
* @param:TaskList tasklist
*/
public void createTaskList(TaskList tasklist) throws NetworkFailureException {
commitUpdate();
try {
@ -411,7 +495,13 @@ public class GTaskClient {
throw new ActionFailureException("create tasklist: handing jsonobject failed");
}
}
/**
* @classname: GTaskClient
* @methodname: commitUpdate
* @description:
* @date: 2024/1/4 11:32
* @author: wangrunze
*/
public void commitUpdate() throws NetworkFailureException {
if (mUpdateArray != null) {
try {
@ -432,7 +522,14 @@ public class GTaskClient {
}
}
}
/**
* @classname: GTaskClient
* @methodname: addUpdateNode
* @description:
* @date: 2024/1/4 11:32
* @author: wangrunze
* @param:Node node
*/
public void addUpdateNode(Node node) throws NetworkFailureException {
if (node != null) {
// too many update items may result in an error
@ -446,7 +543,16 @@ public class GTaskClient {
mUpdateArray.put(node.getUpdateAction(getActionId()));
}
}
/**
* @classname: GTaskClient
* @methodname: moveTask
* @description:task
* @date: 2024/1/4 11:32
* @author: wangrunze
* @param:Task task
* @param:TaskList preParent
* @param:TaskList curParent
*/
public void moveTask(Task task, TaskList preParent, TaskList curParent)
throws NetworkFailureException {
commitUpdate();
@ -485,7 +591,14 @@ public class GTaskClient {
throw new ActionFailureException("move task: handing jsonobject failed");
}
}
/**
* @classname: GTaskClient
* @methodname: deleteNode
* @description:
* @date: 2024/1/4 11:33
* @author: wangrunze
* @param:Node node
*/
public void deleteNode(Node node) throws NetworkFailureException {
commitUpdate();
try {
@ -508,7 +621,13 @@ public class GTaskClient {
throw new ActionFailureException("delete node: handing jsonobject failed");
}
}
/**
* @classname: GTaskClient
* @methodname: getTaskLists
* @description:
* @date: 2024/1/4 11:34
* @author: wangrunze
*/
public JSONArray getTaskLists() throws NetworkFailureException {
if (!mLoggedin) {
Log.e(TAG, "please login first");
@ -546,7 +665,14 @@ public class GTaskClient {
throw new ActionFailureException("get task lists: handing jasonobject failed");
}
}
/**
* @classname: GTaskClient
* @methodname: getTaskList
* @description:
* @date: 2024/1/4 11:34
* @author: wangrunze
* @param:String listGid
*/
public JSONArray getTaskList(String listGid) throws NetworkFailureException {
commitUpdate();
try {

@ -47,7 +47,12 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
/**
* @classname: GTaskManager
* @description:gtask
* @date: 2024/1/4 11:36
* @author: wangrunze
*/
public class GTaskManager {
private static final String TAG = GTaskManager.class.getSimpleName();
@ -87,7 +92,7 @@ public class GTaskManager {
private HashMap<Long, String> mNidToGid;
private GTaskManager() {
private GTaskManager() {//对象初始化函数
mSyncing = false;
mCancelled = false;
mGTaskListHashMap = new HashMap<String, TaskList>();
@ -98,19 +103,41 @@ public class GTaskManager {
mGidToNid = new HashMap<String, Long>();
mNidToGid = new HashMap<Long, String>();
}
/**
* @classname: GTaskManager
* @methodname: getInstance
* @description:
* @date: 2024/1/4 11:37
* @author: wangrunze
*/
public static synchronized GTaskManager getInstance() {
if (mInstance == null) {
mInstance = new GTaskManager();
}
return mInstance;
}
/**
* @classname: GTaskManager
* @methodname: setActivityContext
* @description:线
* @date: 2024/1/4 11:38
* @author: wangrunze
* @param:Activity activity
*/
public synchronized void setActivityContext(Activity activity) {
// used for getting authtoken
mActivity = activity;
}
/**
* @classname: GTaskManager
* @methodname: sync
* @description:
* @date: 2024/1/4 11:38
* @author: wangrunze
* @param:Context context
* @param:GTaskASyncTask asyncTask
*/
public int sync(Context context, GTaskASyncTask asyncTask) {
if (mSyncing) {
Log.d(TAG, "Sync is in progress");
@ -128,14 +155,14 @@ public class GTaskManager {
mNidToGid.clear();
try {
GTaskClient client = GTaskClient.getInstance();
GTaskClient client = GTaskClient.getInstance();//getInstance即为创建一个实例
client.resetUpdateArray();
// login google task
if (!mCancelled) {
if (!client.login(mActivity)) {
throw new NetworkFailureException("login google task failed");
}
}//获取Google上的JSONtasklist转为本地TaskList
}
// get the task list from google
@ -167,7 +194,13 @@ public class GTaskManager {
return mCancelled ? STATE_SYNC_CANCELLED : STATE_SUCCESS;
}
/**
* @classname: GTaskManager
* @methodname: initGTaskList
* @description:GtaskList
* @date: 2024/1/4 11:41
* @author: wangrunze
*/
private void initGTaskList() throws NetworkFailureException {
if (mCancelled)
return;
@ -246,7 +279,13 @@ public class GTaskManager {
throw new ActionFailureException("initGTaskList: handing JSONObject failed");
}
}
/**
* @classname: GTaskManager
* @methodname: syncContent
* @description:
* @date: 2024/1/4 11:41
* @author: wangrunze
*/
private void syncContent() throws NetworkFailureException {
int syncType;
Cursor c = null;
@ -350,7 +389,13 @@ public class GTaskManager {
}
}
/**
* @classname: GTaskManager
* @methodname: syncFolder
* @description:
* @date: 2024/1/4 11:42
* @author: wangrunze
*/
private void syncFolder() throws NetworkFailureException {
Cursor c = null;
String gid;
@ -475,7 +520,16 @@ public class GTaskManager {
if (!mCancelled)
GTaskClient.getInstance().commitUpdate();
}
/**
* @classname: GTaskManager
* @methodname: doContentSync
* @description:syncType
* @date: 2024/1/4 11:43
* @author: wangrunze
* @param:int syncType
* @param:Node node
* @param: Cursor c
*/
private void doContentSync(int syncType, Node node, Cursor c) throws NetworkFailureException {
if (mCancelled) {
return;
@ -521,7 +575,14 @@ public class GTaskManager {
throw new ActionFailureException("unkown sync action type");
}
}
/**
* @classname: GTaskManager
* @methodname: addLocalNode
* @description:Node
* @date: 2024/1/4 11:43
* @author: wangrunze
* @param:Node node
*/
private void addLocalNode(Node node) throws NetworkFailureException {
if (mCancelled) {
return;
@ -595,7 +656,15 @@ public class GTaskManager {
// update meta
updateRemoteMeta(node.getGid(), sqlNote);
}
/**
* @classname: GTaskManager
* @methodname: updateLocalNode
* @description:node
* @date: 2024/1/4 11:44
* @author: wangrunze
* @param:Node node
* @param:Cursor cCursor c
*/
private void updateLocalNode(Node node, Cursor c) throws NetworkFailureException {
if (mCancelled) {
return;
@ -618,7 +687,15 @@ public class GTaskManager {
// update meta info
updateRemoteMeta(node.getGid(), sqlNote);
}
/**
* @classname: GTaskManager
* @methodname: addRemoteNode
* @description:Node
* @date: 2024/1/4 11:44
* @author: wangrunze
* @param:Node node
* @param:Cursor c
*/
private void addRemoteNode(Node node, Cursor c) throws NetworkFailureException {
if (mCancelled) {
return;
@ -691,7 +768,15 @@ public class GTaskManager {
mGidToNid.put(n.getGid(), sqlNote.getId());
mNidToGid.put(sqlNote.getId(), n.getGid());
}
/**
* @classname: GTaskManager
* @methodname: updateRemoteNode
* @description:Node
* @date: 2024/1/4 11:45
* @author: wangrunze
* @param:Node node
* @param:Cursor c
*/
private void updateRemoteNode(Node node, Cursor c) throws NetworkFailureException {
if (mCancelled) {
return;
@ -729,7 +814,15 @@ public class GTaskManager {
sqlNote.resetLocalModified();
sqlNote.commit(true);
}
/**
* @classname: GTaskManager
* @methodname: updateRemoteMeta
* @description:meta
* @date: 2024/1/4 11:45
* @author: wangrunze
* @param:String gid
* @param:SqlNote sqlNote
*/
private void updateRemoteMeta(String gid, SqlNote sqlNote) throws NetworkFailureException {
if (sqlNote != null && sqlNote.isNoteType()) {
MetaData metaData = mMetaHashMap.get(gid);
@ -745,7 +838,13 @@ public class GTaskManager {
}
}
}
/**
* @classname: GTaskManager
* @methodname: refreshLocalSyncId
* @description:
* @date: 2024/1/4 11:46
* @author: wangrunze
*/
private void refreshLocalSyncId() throws NetworkFailureException {
if (mCancelled) {
return;
@ -789,11 +888,23 @@ public class GTaskManager {
}
}
}
/**
* @classname: GTaskManager
* @methodname: getSyncAccount
* @description:
* @date: 2024/1/4 11:47
* @author: wangrunze
*/
public String getSyncAccount() {
return GTaskClient.getInstance().getSyncAccount().name;
}
/**
* @classname: GTaskManager
* @methodname: cancelSync
* @description:
* @date: 2024/1/4 11:48
* @author: wangrunze
*/
public void cancelSync() {
mCancelled = true;
}

@ -22,7 +22,12 @@ import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.IBinder;
/**
* @classname: GTaskSyncService
* @description:
* @date: 2024/1/4 11:50
* @author: wangrunze
*/
public class GTaskSyncService extends Service {
public final static String ACTION_STRING_NAME = "sync_action_type";
@ -41,7 +46,13 @@ public class GTaskSyncService extends Service {
private static GTaskASyncTask mSyncTask = null;
private static String mSyncProgress = "";
/**
* @classname: GTaskSyncService
* @methodname: startSync
* @description:
* @date: 2024/1/4 11:52
* @author: wangrunze
*/
private void startSync() {
if (mSyncTask == null) {
mSyncTask = new GTaskASyncTask(this, new GTaskASyncTask.OnCompleteListener() {
@ -55,18 +66,36 @@ public class GTaskSyncService extends Service {
mSyncTask.execute();
}
}
/**
* @classname: GTaskSyncService
* @methodname: cancelSync
* @description:
* @date: 2024/1/4 11:53
* @author: wangrunze
*/
private void cancelSync() {
if (mSyncTask != null) {
mSyncTask.cancelSync();
}
}
/**
* @classname: GTaskSyncService
* @methodname: onCreate
* @description:service
* @date: 2024/1/4 11:53
* @author: wangrunze
*/
@Override
public void onCreate() {
mSyncTask = null;
}
/**
* @classname: GTaskSyncService
* @methodname: onStartCommand
* @description:service
* @date: 2024/1/4 11:54
* @author: wangrunze
*/
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Bundle bundle = intent.getExtras();
@ -85,7 +114,13 @@ public class GTaskSyncService extends Service {
}
return super.onStartCommand(intent, flags, startId);
}
/**
* @classname: GTaskSyncService
* @methodname: onLowMemory
* @description:
* @date: 2024/1/4 11:54
* @author: wangrunze
*/
@Override
public void onLowMemory() {
if (mSyncTask != null) {
@ -96,7 +131,14 @@ public class GTaskSyncService extends Service {
public IBinder onBind(Intent intent) {
return null;
}
/**
* @classname: GTaskSyncService
* @methodname: sendBroadcast
* @description:广
* @date: 2024/1/4 11:55
* @author: wangrunze
* @param:String msg
*/
public void sendBroadcast(String msg) {
mSyncProgress = msg;
Intent intent = new Intent(GTASK_SERVICE_BROADCAST_NAME);
@ -105,13 +147,28 @@ public class GTaskSyncService extends Service {
sendBroadcast(intent);
}
/**
* @classname: GTaskSyncService
* @methodname: startSync
* @description:service
* @date: 2024/1/4 11:56
* @author: wangrunze
* @param:Activity activity
*/
public static void startSync(Activity activity) {
GTaskManager.getInstance().setActivityContext(activity);
Intent intent = new Intent(activity, GTaskSyncService.class);
intent.putExtra(GTaskSyncService.ACTION_STRING_NAME, GTaskSyncService.ACTION_START_SYNC);
activity.startService(intent);
}
/**
* @classname: GTaskSyncService
* @methodname: cancelSync
* @description:service
* @date: 2024/1/4 11:56
* @author: wangrunze
* @param:Context context
*/
public static void cancelSync(Context context) {
Intent intent = new Intent(context, GTaskSyncService.class);
intent.putExtra(GTaskSyncService.ACTION_STRING_NAME, GTaskSyncService.ACTION_CANCEL_SYNC);

@ -38,7 +38,7 @@ public class WorkingNote {
// Note Id
private long mNoteId;
// Note content
private String mContent;
public String mContent;
// Note mode
private int mMode;

@ -39,35 +39,50 @@ import net.micode.notes.tool.DataUtils;
import java.io.IOException;
/**
* @classname: AlarmAlertActivity
* @description:
* @date: 2023/12/28 11:18
* @author: wangrunze
*/
public class AlarmAlertActivity extends Activity implements OnClickListener, OnDismissListener {
private long mNoteId;
private String mSnippet;
private long mNoteId;//文本在数据库存储中的ID号
private String mSnippet;//闹钟提示时出现的文本片段
private static final int SNIPPET_PREW_MAX_LEN = 60;
MediaPlayer mPlayer;
//Bundle类型的数据与Map类型的数据相似都是以key-value的形式存储数据的
//onsaveInstanceState方法是用来保存Activity的状态的,能从onCreate的参数savedInsanceState中获得状态数据
/**
* @classname: AlarmAlertActivity
* @methodname onCreate
* @description:
* @date: 2023/12/28 11:27
* @author: wangrunze
* @param: Bundle savedInstanceState
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
requestWindowFeature(Window.FEATURE_NO_TITLE);//界面显示——无标题
final Window win = getWindow();
win.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
if (!isScreenOn()) {
win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
| WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
| WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
| WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR);
win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON//保持窗体点亮
| WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON//将窗体点亮
| WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON//允许窗体点亮时锁屏
| WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR);//在手机锁屏后如果到了闹钟提示时间,点亮屏幕
}
Intent intent = getIntent();
try {
mNoteId = Long.valueOf(intent.getData().getPathSegments().get(1));
mSnippet = DataUtils.getSnippetById(this.getContentResolver(), mNoteId);
mSnippet = DataUtils.getSnippetById(this.getContentResolver(), mNoteId);//根据ID从数据库中获取标签的内容
mSnippet = mSnippet.length() > SNIPPET_PREW_MAX_LEN ? mSnippet.substring(0,
SNIPPET_PREW_MAX_LEN) + getResources().getString(R.string.notelist_string_info)
SNIPPET_PREW_MAX_LEN) + getResources().getString(R.string.notelist_string_info)//判断标签片段是否达到符合长度
: mSnippet;
} catch (IllegalArgumentException e) {
e.printStackTrace();
@ -76,23 +91,39 @@ public class AlarmAlertActivity extends Activity implements OnClickListener, OnD
mPlayer = new MediaPlayer();
if (DataUtils.visibleInNoteDatabase(getContentResolver(), mNoteId, Notes.TYPE_NOTE)) {
showActionDialog();
playAlarmSound();
showActionDialog();//弹出对话框
playAlarmSound();//闹钟提示音激发
} else {
finish();
}
}
/**
* @classname: AlarmAlertActivity
* @methodname isScreenOn
* @description:
* @date: 2023/12/28 11:28
* @author: wangrunze
* @return: pm.isScreenOn()
*/
private boolean isScreenOn() {
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
return pm.isScreenOn();
}
/**
* @classname: AlarmAlertActivity
* @methodname playAlarmSound
* @description:
* @date: 2023/12/28 11:29
* @author: wangrunze
*/
private void playAlarmSound() {
Uri url = RingtoneManager.getActualDefaultRingtoneUri(this, RingtoneManager.TYPE_ALARM);
int silentModeStreams = Settings.System.getInt(getContentResolver(),
Settings.System.MODE_RINGER_STREAMS_AFFECTED, 0);
Settings.System.MODE_RINGER_STREAMS_AFFECTED, 0); //调用系统的铃声管理URI得到闹钟提示音
if ((silentModeStreams & (1 << AudioManager.STREAM_ALARM)) != 0) {
mPlayer.setAudioStreamType(silentModeStreams);
@ -100,13 +131,13 @@ public class AlarmAlertActivity extends Activity implements OnClickListener, OnD
mPlayer.setAudioStreamType(AudioManager.STREAM_ALARM);
}
try {
mPlayer.setDataSource(this, url);
mPlayer.prepare();
mPlayer.setLooping(true);
mPlayer.start();
mPlayer.setDataSource(this, url);//无返回值,设置多媒体数据来源
mPlayer.prepare();//准备同步
mPlayer.setLooping(true);//设置是否循环播放
mPlayer.start();//开始播放
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
e.printStackTrace();//抛出异常, 还将显示出更深的调用信息
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@ -119,22 +150,31 @@ public class AlarmAlertActivity extends Activity implements OnClickListener, OnD
}
}
/**
* @classname: AlarmAlertActivity
* @methodname showActionDialog
* @description:
* @date: 2023/12/28 11:30
* @author: wangrunze
*/
private void showActionDialog() {
AlertDialog.Builder dialog = new AlertDialog.Builder(this);
dialog.setTitle(R.string.app_name);
dialog.setMessage(mSnippet);
dialog.setPositiveButton(R.string.notealert_ok, this);
AlertDialog.Builder dialog = new AlertDialog.Builder(this);//用到AlertDialog.Builder中的create()新建了一个AlertDialog
dialog.setTitle(R.string.app_name);//为对话框设置标题
dialog.setMessage(mSnippet);//为对话框设置内容
dialog.setPositiveButton(R.string.notealert_ok, this);//给对话框添加"Yes"按钮
if (isScreenOn()) {
dialog.setNegativeButton(R.string.notealert_enter, this);
dialog.setNegativeButton(R.string.notealert_enter, this);//给对话框添加"no"按钮
}
dialog.show().setOnDismissListener(this);
}
//DialogInterface dialog为对话框which为选择按钮,功能为选择各种操作
public void onClick(DialogInterface dialog, int which) {
switch (which) {
case DialogInterface.BUTTON_NEGATIVE:
Intent intent = new Intent(this, NoteEditActivity.class);
intent.setAction(Intent.ACTION_VIEW);
case DialogInterface.BUTTON_NEGATIVE://这是取消操作
Intent intent = new Intent(this, NoteEditActivity.class);//实现两个类间的数据传输
intent.setAction(Intent.ACTION_VIEW);//设置动作属性
intent.putExtra(Intent.EXTRA_UID, mNoteId);
startActivity(intent);
break;
@ -143,11 +183,25 @@ public class AlarmAlertActivity extends Activity implements OnClickListener, OnD
}
}
/**
* @classname: AlarmAlertActivity
* @methodname onDismiss
* @description:
* @date: 2023/12/28 11:30
* @author: wangrunze
* @param:DialogInterface dialog
*/
public void onDismiss(DialogInterface dialog) {
stopAlarmSound();
finish();
}
/**
* @classname: AlarmAlertActivity
* @methodname: stopAlarmSound
* @description:
* @date: 2023/12/28 11:31
* @author: wangrunze
*/
private void stopAlarmSound() {
if (mPlayer != null) {
mPlayer.stop();

@ -27,20 +27,34 @@ import android.database.Cursor;
import net.micode.notes.data.Notes;
import net.micode.notes.data.Notes.NoteColumns;
/**
* @classname: AlarmInitReceiver
* @description:
* @date: 2023/12/29 11:17
* @author: wangrunze
*/
public class AlarmInitReceiver extends BroadcastReceiver {
private static final String [] PROJECTION = new String [] {
NoteColumns.ID,
NoteColumns.ALERTED_DATE
};
//对数据库的操作调用标签ID和闹钟时间
private static final int COLUMN_ID = 0;
private static final int COLUMN_ALERTED_DATE = 1;
/**
* @classname: AlarmInitReceiver
* @methodname: onReceive
* @description:
* @date: 2023/12/29 11:23
* @author: wangrunze
* @param:Context context
* @param:Intent intent
*/
@Override
public void onReceive(Context context, Intent intent) {
long currentDate = System.currentTimeMillis();
long currentDate = System.currentTimeMillis();//System.currentTimeMillis()产生一个当前的毫秒,这个毫秒其实就是自1970年1月1日0时起的毫秒数
Cursor c = context.getContentResolver().query(Notes.CONTENT_NOTE_URI,
PROJECTION,
NoteColumns.ALERTED_DATE + ">? AND " + NoteColumns.TYPE + "=" + Notes.TYPE_NOTE,

@ -19,8 +19,23 @@ package net.micode.notes.ui;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
/**
* @classname: AlarmReceiver
* @description:alarm
* @date: 2023/12/29 11:28
* @author: wangrunze
*/
public class AlarmReceiver extends BroadcastReceiver {
/**
* @classname: AlarmReceiver
* @methodname: onReceive
* @description:AlarmAlertActivity
* @date: 2023/12/29 11:29
* @author: wangrunze
* @param:Context context
* @param:Intent intent
*/
@Override
public void onReceive(Context context, Intent intent) {
intent.setClass(context, AlarmAlertActivity.class);

@ -28,6 +28,12 @@ import android.view.View;
import android.widget.FrameLayout;
import android.widget.NumberPicker;
/**
* @classname: DateTimePicker
* @description:
* @date: 2023/12/29 11:40
* @author: wangrunze
*/
public class DateTimePicker extends FrameLayout {
private static final boolean DEFAULT_ENABLE_STATE = true;
@ -65,6 +71,16 @@ public class DateTimePicker extends FrameLayout {
private OnDateTimeChangedListener mOnDateTimeChangedListener;
private NumberPicker.OnValueChangeListener mOnDateChangedListener = new NumberPicker.OnValueChangeListener() {
/**
* @classname: DateTimePicker
* @methodname: onValueChange
* @description:
* @date: 2023/12/29 11:41
* @author: wangrunze
* @param:NumberPicker picker
* @param:int oldVal
* @param: int newVal
*/
@Override
public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
mDate.add(Calendar.DAY_OF_YEAR, newVal - oldVal);
@ -74,6 +90,16 @@ public class DateTimePicker extends FrameLayout {
};
private NumberPicker.OnValueChangeListener mOnHourChangedListener = new NumberPicker.OnValueChangeListener() {
/**
* @classname: DateTimePicker
* @methodname: onValueChange
* @description:Hour
* @date: 2023/12/29 11:42
* @author: wangrunze
* @param:NumberPicker picker
* @param:int oldVal
* @param:int newVal
*/
@Override
public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
boolean isDateChanged = false;
@ -116,6 +142,16 @@ public class DateTimePicker extends FrameLayout {
};
private NumberPicker.OnValueChangeListener mOnMinuteChangedListener = new NumberPicker.OnValueChangeListener() {
/**
* @classname: DateTimePicker
* @methodname: onValueChange
* @description:
* @date: 2023/12/29 11:43
* @author: wangrunze
* @param:NumberPicker picker
* @param:int oldVal
* @param:int newVal
*/
@Override
public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
int minValue = mMinuteSpinner.getMinValue();
@ -146,6 +182,16 @@ public class DateTimePicker extends FrameLayout {
private NumberPicker.OnValueChangeListener mOnAmPmChangedListener = new NumberPicker.OnValueChangeListener() {
@Override
/**
* @classname: DateTimePicker
* @methodname: onValueChange
* @description: AMPM
* @date: 2023/12/29 11:43
* @author: wangrunze
* @param:NumberPicker picker
* @param:int oldVal
* @param: int newVal
*/
public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
mIsAm = !mIsAm;
if (mIsAm) {
@ -157,12 +203,20 @@ public class DateTimePicker extends FrameLayout {
onDateTimeChanged();
}
};
public interface OnDateTimeChangedListener {
void onDateTimeChanged(DateTimePicker view, int year, int month,
int dayOfMonth, int hourOfDay, int minute);
}
/**
* @classname: DateTimePicker
* @methodname: DateTimePicker
* @description:
* @date: 2023/12/29 11:45
* @author: wangrunze
* @param:Context context
*/
public DateTimePicker(Context context) {
this(context, System.currentTimeMillis());
}
@ -171,6 +225,16 @@ public class DateTimePicker extends FrameLayout {
this(context, date, DateFormat.is24HourFormat(context));
}
/**
* @classname: DateTimePicker
* @methodname: DateTimePicker
* @description:
* @date: 2023/12/29 11:47
* @author: wangrunze
* @param:Context context
* @param:long date
* @param:boolean is24HourView
*/
public DateTimePicker(Context context, long date, boolean is24HourView) {
super(context);
mDate = Calendar.getInstance();
@ -214,6 +278,14 @@ public class DateTimePicker extends FrameLayout {
mInitialising = false;
}
/**
* @classname: DateTimePicker
* @methodname: setEnabled
* @description:
* @date: 2023/12/29 11:49
* @author: wangrunze
* @param:boolean enabled
*/
@Override
public void setEnabled(boolean enabled) {
if (mIsEnabled == enabled) {
@ -246,6 +318,14 @@ public class DateTimePicker extends FrameLayout {
*
* @param date The current date in millis
*/
/**
* @classname: DateTimePicker
* @methodname: setCurrentDate
* @description:
* @date: 2023/12/29 11:51
* @author: wangrunze
* @param:long date
*/
public void setCurrentDate(long date) {
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(date);
@ -262,6 +342,14 @@ public class DateTimePicker extends FrameLayout {
* @param hourOfDay The current hourOfDay
* @param minute The current minute
*/
/**
* @classname: DateTimePicker
* @methodname: setCurrentDate
* @description:
* @date: 2023/12/29 11:51
* @author: wangrunze
* @param:long date
*/
public void setCurrentDate(int year, int month,
int dayOfMonth, int hourOfDay, int minute) {
setCurrentYear(year);
@ -285,6 +373,14 @@ public class DateTimePicker extends FrameLayout {
*
* @param year The current year
*/
/**
* @classname: DateTimePicker
* @methodname: setCurrentYear
* @description:Set current year
* @date: 2024/1/7 9:53
* @author: wangrunze
* @param:year
*/
public void setCurrentYear(int year) {
if (!mInitialising && year == getCurrentYear()) {
return;
@ -293,12 +389,19 @@ public class DateTimePicker extends FrameLayout {
updateDateControl();
onDateTimeChanged();
}
/**
* Get current month in the year
*
* @return The current month in the year
*/
/**
* @classname: DateTimePicker
* @methodname: getCurrentMonth
* @description:Get current month in the year
* @date: 2024/1/7 9:54
* @author: wangrunze
* @return:current month
*/
public int getCurrentMonth() {
return mDate.get(Calendar.MONTH);
}
@ -308,6 +411,14 @@ public class DateTimePicker extends FrameLayout {
*
* @param month The month in the year
*/
/**
* @classname: DateTimePicker
* @methodname: setCurrentMonth
* @description:Set current month in the year
* @date: 2024/1/7 9:56
* @author: wangrunze
* @param:current month
*/
public void setCurrentMonth(int month) {
if (!mInitialising && month == getCurrentMonth()) {
return;
@ -322,6 +433,14 @@ public class DateTimePicker extends FrameLayout {
*
* @return The day of the month
*/
/**
* @classname: DateTimePicker
* @methodname: getCurrentDay
* @description:Get current day of the month
* @date: 2024/1/7 9:57
* @author: wangrunze
* @return:current day
*/
public int getCurrentDay() {
return mDate.get(Calendar.DAY_OF_MONTH);
}
@ -331,6 +450,14 @@ public class DateTimePicker extends FrameLayout {
*
* @param dayOfMonth The day of the month
*/
/**
* @classname: DateTimePicker
* @methodname: setCurrentDay
* @description:Set current day of the month
* @date: 2024/1/7 9:57
* @author: wangrunze
* @param:The day of the month
*/
public void setCurrentDay(int dayOfMonth) {
if (!mInitialising && dayOfMonth == getCurrentDay()) {
return;
@ -344,10 +471,26 @@ public class DateTimePicker extends FrameLayout {
* Get current hour in 24 hour mode, in the range (0~23)
* @return The current hour in 24 hour mode
*/
/**
* @classname: DateTimePicker
* @methodname: getCurrentHourOfDay
* @description:Get current hour in 24 hour mode
* @date: 2024/1/7 9:58
* @author: wangrunze
* @return:The current hour in 24 hour mode
*/
public int getCurrentHourOfDay() {
return mDate.get(Calendar.HOUR_OF_DAY);
}
/**
* @classname: DateTimePicker
* @methodname: getCurrentHour
* @description:Get current hour
* @date: 2024/1/7 9:58
* @author: wangrunze
* @return:The current hour
*/
private int getCurrentHour() {
if (mIs24HourView){
return getCurrentHourOfDay();
@ -366,6 +509,14 @@ public class DateTimePicker extends FrameLayout {
*
* @param hourOfDay
*/
/**
* @classname: DateTimePicker
* @methodname: setCurrentHour
* @description:Set current hour in 24 hour mode
* @date: 2024/1/7 9:59
* @author: wangrunze
* @param:hourOfDay
*/
public void setCurrentHour(int hourOfDay) {
if (!mInitialising && hourOfDay == getCurrentHourOfDay()) {
return;
@ -394,6 +545,14 @@ public class DateTimePicker extends FrameLayout {
*
* @return The Current Minute
*/
/**
* @classname: DateTimePicker
* @methodname: getCurrentMinute
* @description: Get currentMinute
* @date: 2024/1/7 9:59
* @author: wangrunze
* @return:The Current Minute
*/
public int getCurrentMinute() {
return mDate.get(Calendar.MINUTE);
}
@ -401,6 +560,14 @@ public class DateTimePicker extends FrameLayout {
/**
* Set current minute
*/
/**
* @classname: DateTimePicker
* @methodname: setCurrentMinute
* @description:Set current minute
* @date: 2024/1/7 9:59
* @author: wangrunze
* @param:int minute
*/
public void setCurrentMinute(int minute) {
if (!mInitialising && minute == getCurrentMinute()) {
return;
@ -413,6 +580,14 @@ public class DateTimePicker extends FrameLayout {
/**
* @return true if this is in 24 hour view else false.
*/
/**
* @classname: DateTimePicker
* @methodname: is24HourView
* @description:24Hour
* @date: 2024/1/7 10:00
* @author: wangrunze
* @return:true if this is in 24 hour view else false.
*/
public boolean is24HourView () {
return mIs24HourView;
}
@ -422,6 +597,14 @@ public class DateTimePicker extends FrameLayout {
*
* @param is24HourView True for 24 hour mode. False for AM/PM mode.
*/
/**
* @classname: DateTimePicker
* @methodname: set24HourView
* @description:Set whether in 24 hour or AM/PM mode
* @date: 2024/1/7 10:01
* @author: wangrunze
* @param:is24HourView True for 24 hour mode
*/
public void set24HourView(boolean is24HourView) {
if (mIs24HourView == is24HourView) {
return;
@ -434,6 +617,13 @@ public class DateTimePicker extends FrameLayout {
updateAmPmControl();
}
/**
* @classname: DateTimePicker
* @methodname: updateDateControl
* @description:
* @date: 2023/12/29 11:53
* @author: wangrunze
*/
private void updateDateControl() {
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(mDate.getTimeInMillis());
@ -448,6 +638,13 @@ public class DateTimePicker extends FrameLayout {
mDateSpinner.invalidate();
}
/**
* @classname: DateTimePicker
* @methodname: updateDateControl
* @description:ampm
* @date: 2023/12/29 11:53
* @author: wangrunze
*/
private void updateAmPmControl() {
if (mIs24HourView) {
mAmPmSpinner.setVisibility(View.GONE);
@ -458,6 +655,13 @@ public class DateTimePicker extends FrameLayout {
}
}
/**
* @classname: DateTimePicker
* @methodname: updateDateControl
* @description:
* @date: 2023/12/29 11:53
* @author: wangrunze
*/
private void updateHourControl() {
if (mIs24HourView) {
mHourSpinner.setMinValue(HOUR_SPINNER_MIN_VAL_24_HOUR_VIEW);
@ -476,6 +680,13 @@ public class DateTimePicker extends FrameLayout {
mOnDateTimeChangedListener = callback;
}
/**
* @classname: DateTimePicker
* @methodname: onDateTimeChanged
* @description:
* @date: 2023/12/29 11:54
* @author: wangrunze
*/
private void onDateTimeChanged() {
if (mOnDateTimeChangedListener != null) {
mOnDateTimeChangedListener.onDateTimeChanged(this, getCurrentYear(),

@ -29,17 +29,31 @@ import android.content.DialogInterface.OnClickListener;
import android.text.format.DateFormat;
import android.text.format.DateUtils;
/**
* @classname: DateTimePickerDialog
* @description:
* @date: 2024/1/4 10:19
* @author: wangrunze
*/
public class DateTimePickerDialog extends AlertDialog implements OnClickListener {
private Calendar mDate = Calendar.getInstance();
private boolean mIs24HourView;
private OnDateTimeSetListener mOnDateTimeSetListener;
private DateTimePicker mDateTimePicker;
private DateTimePicker mDateTimePicker;//DateTimePicker控件控件一般用于让用户可以从日期列表中选择单个值。
public interface OnDateTimeSetListener {
void OnDateTimeSet(AlertDialog dialog, long date);
}
/**
* @classname: DateTimePickerDialog
* @methodname: DateTimePickerDialog
* @description:
* @date: 2024/1/4 10:26
* @author: wangrunze
* @param:Context context
* @param:long date
*/
public DateTimePickerDialog(Context context, long date) {
super(context);
mDateTimePicker = new DateTimePicker(context);
@ -64,14 +78,35 @@ public class DateTimePickerDialog extends AlertDialog implements OnClickListener
updateTitle(mDate.getTimeInMillis());
}
/**
* @classname: DateTimePickerDialog
* @methodname: set24HourView
* @description:24
* @date: 2024/1/4 10:34
* @author: wangrunze
*/
public void set24HourView(boolean is24HourView) {
mIs24HourView = is24HourView;
}
/**
* @classname: DateTimePickerDialog
* @methodname: setOnDateTimeSetListener
* @description:
* @date: 2024/1/4 10:43
* @author: wangrunze
* @param:OnDateTimeSetListener callBack
*/
public void setOnDateTimeSetListener(OnDateTimeSetListener callBack) {
mOnDateTimeSetListener = callBack;
}
/**
* @classname: DateTimePickerDialog
* @methodname: updateTitle
* @description:
* @date: 2024/1/4 10:55
* @author: wangrunze
* @param:long date
*/
private void updateTitle(long date) {
int flag =
DateUtils.FORMAT_SHOW_YEAR |
@ -80,7 +115,15 @@ public class DateTimePickerDialog extends AlertDialog implements OnClickListener
flag |= mIs24HourView ? DateUtils.FORMAT_24HOUR : DateUtils.FORMAT_24HOUR;
setTitle(DateUtils.formatDateTime(this.getContext(), date, flag));
}
/**
* @classname: DateTimePickerDialog
* @methodname: onClick
* @description:
* @date: 2024/1/4 10:58
* @author: wangrunze
* @param:DialogInterface arg0
* @param:int arg1
*/
public void onClick(DialogInterface arg0, int arg1) {
if (mOnDateTimeSetListener != null) {
mOnDateTimeSetListener.OnDateTimeSet(this, mDate.getTimeInMillis());

@ -26,12 +26,26 @@ import android.widget.PopupMenu;
import android.widget.PopupMenu.OnMenuItemClickListener;
import net.micode.notes.R;
/**
* @classname: DropdownMenu
* @description:
* @date: 2024/1/4 11:00
* @author: wangrunze
*/
public class DropdownMenu {
private Button mButton;
private PopupMenu mPopupMenu;
private Menu mMenu;
/**
* @classname: DropdownMenu
* @methodname: DropdownMenu
* @description:
* @date: 2024/1/4 11:02
* @author: wangrunze
* @param:Context context
* @param:Button button
* @param:int menuId
*/
public DropdownMenu(Context context, Button button, int menuId) {
mButton = button;
mButton.setBackgroundResource(R.drawable.dropdown_icon);
@ -44,17 +58,38 @@ public class DropdownMenu {
}
});
}
/**
* @classname: DropdownMenu
* @methodname: setOnDropdownMenuItemClickListener
* @description:
* @date: 2024/1/4 11:03
* @author: wangrunze
* @param:OnMenuItemClickListener listener
*/
public void setOnDropdownMenuItemClickListener(OnMenuItemClickListener listener) {
if (mPopupMenu != null) {
mPopupMenu.setOnMenuItemClickListener(listener);
}
}
/**
* @classname: DropdownMenu
* @methodname: findItem
* @description:
* @date: 2024/1/4 11:04
* @author: wangrunze
* @param:int id
*/
public MenuItem findItem(int id) {
return mMenu.findItem(id);
}
/**
* @classname: DropdownMenu
* @methodname: setTitle
* @description:
* @date: 2024/1/4 11:05
* @author: wangrunze
* @param:CharSequence title
*/
public void setTitle(CharSequence title) {
mButton.setText(title);
}

@ -28,26 +28,57 @@ import net.micode.notes.R;
import net.micode.notes.data.Notes;
import net.micode.notes.data.Notes.NoteColumns;
/**
* @classname: FoldersListAdapter
* @description:便
* @date: 2024/1/4 11:07
* @author: wangrunze
*/
public class FoldersListAdapter extends CursorAdapter {
public static final String [] PROJECTION = {
NoteColumns.ID,
NoteColumns.SNIPPET
};
};//调用数据库中便签的ID和片段
public static final int ID_COLUMN = 0;
public static final int NAME_COLUMN = 1;
/**
* @classname: FoldersListAdapter
* @methodname: FoldersListAdapter
* @description:
* @date: 2024/1/4 11:08
* @author: wangrunze
* @param:Context context
* @param: Cursor c
*/
public FoldersListAdapter(Context context, Cursor c) {
super(context, c);
// TODO Auto-generated constructor stub
}
/**
* @classname: FoldersListAdapter
* @methodname: newView
* @description:
* @date: 2024/1/4 11:09
* @author: wangrunze
* @param:Context context
* @param:Cursor cursor
* @param:ViewGroup parent
*/
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
return new FolderListItem(context);
}
/**
* @classname: FoldersListAdapter
* @methodname: bindView
* @description:
* @date: 2024/1/4 11:10
* @author: wangrunze
* @param:View view
* @param:Context context
* @param:Cursor cursor
*/
@Override
public void bindView(View view, Context context, Cursor cursor) {
if (view instanceof FolderListItem) {
@ -56,22 +87,49 @@ public class FoldersListAdapter extends CursorAdapter {
((FolderListItem) view).bind(folderName);
}
}
/**
* @classname: FoldersListAdapter
* @methodname: getFolderName
* @description:
* @date: 2024/1/4 11:10
* @author: wangrunze
* @param:Context context
* @param:int position
*/
public String getFolderName(Context context, int position) {
Cursor cursor = (Cursor) getItem(position);
return (cursor.getLong(ID_COLUMN) == Notes.ID_ROOT_FOLDER) ? context
.getString(R.string.menu_move_parent_folder) : cursor.getString(NAME_COLUMN);
}
/**
* @classname: FoldersListAdapter
* @description:
* @date: 2024/1/4 11:11
* @author: wangrunze
*/
private class FolderListItem extends LinearLayout {
private TextView mName;
/**
* @classname: FolderListItem
* @methodname: FolderListItem
* @description:
* @date: 2024/1/4 11:12
* @author: wangrunze
* @param:Context context
*/
public FolderListItem(Context context) {
super(context);
inflate(context, R.layout.folder_list_item, this);
mName = (TextView) findViewById(R.id.tv_folder_name);
}
/**
* @classname: FolderListItem
* @methodname: bind
* @description:
* @date: 2024/1/4 11:13
* @author: wangrunze
* @param:String name
*/
public void bind(String name) {
mName.setText(name);
}

File diff suppressed because it is too large Load Diff

@ -1,4 +1,4 @@
/*
/*
* Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
*
* Licensed under the Apache License, Version 2.0 (the "License");

@ -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,9 @@ 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;
@ -124,6 +127,8 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
public static final int NOTES_LISTVIEW_SCROLL_RATE = 30;
private NoteItemData mFocusNoteDataItem;
//表示是否在私密模式
public static int secret_mode = 0;
private static final String NORMAL_SELECTION = NoteColumns.PARENT_ID + "=?";
@ -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.decade);//将decade作为初始背景
initResources();
/**
@ -412,10 +418,35 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
private void startAsyncNotesListQuery() {
String selection = (mCurrentFolderId == Notes.ID_ROOT_FOLDER) ? ROOT_FOLDER_SELECTION
: NORMAL_SELECTION;
mBackgroundQueryHandler.startQuery(FOLDER_NOTE_LIST_QUERY_TOKEN, null,
Notes.CONTENT_NOTE_URI, NoteItemData.PROJECTION, selection, new String[] {
String.valueOf(mCurrentFolderId)
}, NoteColumns.TYPE + " DESC," + NoteColumns.MODIFIED_DATE + " DESC");
if(secret_mode == 0) {
mBackgroundQueryHandler.startQuery(FOLDER_NOTE_LIST_QUERY_TOKEN, null,
Notes.CONTENT_NOTE_URI, NoteItemData.PROJECTION, selection, new String[]{
String.valueOf(mCurrentFolderId)
}, NoteColumns.TYPE + " DESC," + NoteColumns.MODIFIED_DATE + " DESC");
}
else{
String str1 = "444";
String [] PROJECTION = new String [] { //定义一个新的PROJECTION数组只换掉SNIPPET
NoteColumns.ID,
NoteColumns.ALERTED_DATE,
NoteColumns.BG_COLOR_ID,
NoteColumns.CREATED_DATE,
NoteColumns.HAS_ATTACHMENT,
NoteColumns.MODIFIED_DATE,
NoteColumns.NOTES_COUNT,
NoteColumns.PARENT_ID,
// NoteColumns.SNIPPET,
str1,
NoteColumns.TYPE,
NoteColumns.WIDGET_ID,
NoteColumns.WIDGET_TYPE,
};
mBackgroundQueryHandler.startQuery(FOLDER_NOTE_LIST_QUERY_TOKEN, null,
Notes.CONTENT_NOTE_URI, PROJECTION, selection, new String[]{
String.valueOf(mCurrentFolderId)
}, NoteColumns.TYPE + " DESC," + NoteColumns.MODIFIED_DATE + " DESC");
}
}
private final class BackgroundQueryHandler extends AsyncQueryHandler {
@ -772,12 +803,31 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
} else {
Log.e(TAG, "Wrong state:" + mState);
}
if(secret_mode == 1)
menu.findItem(R.id.menu_secret).setVisible(false);
else
menu.findItem(R.id.menu_quit_secret).setVisible(false);
if(mode==-1){//decade
menu.findItem(R.id.menu_decade).setVisible(false);
}
else if(mode==1){//zio
menu.findItem(R.id.menu_zio).setVisible(false);
}
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if(item.getItemId()==R.id.menu_new_folder){
if(item.getItemId()==R.id.menu_decade){
mode = -1;
getWindow().setBackgroundDrawableResource(R.drawable.decade);
}
else if(item.getItemId()==R.id.menu_zio){
mode = 1;
getWindow().setBackgroundDrawableResource(R.drawable.zio);
}
else if(item.getItemId()==R.id.menu_new_folder){
showCreateOrModifyFolderDialog(true);
}
else if(item.getItemId()==R.id.menu_export_text ){
@ -804,6 +854,53 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
else if(item.getItemId()==R.id.menu_search) {
onSearchRequested();
}
else if(item.getItemId()==R.id.menu_secret)
{//进入私密模式
AlertDialog.Builder dialog = new AlertDialog.Builder(NotesListActivity.this);
dialog.setTitle("重要提醒");
dialog.setMessage("您确认进入私密模式吗?");
dialog.setCancelable(false);
dialog.setPositiveButton("确认", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(NotesListActivity.this,"您已进入私密模式",Toast.LENGTH_SHORT).show();
secret_mode = 1;
startAsyncNotesListQuery();
}
});
dialog.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which){}
});
dialog.show();
startAsyncNotesListQuery();
}
else if(item.getItemId()==R.id.menu_quit_secret)
{ //退出私密模式
AlertDialog.Builder dialog = new AlertDialog.Builder(NotesListActivity.this);
dialog.setTitle("重要提醒");
dialog.setMessage("您确认退出私密模式吗?");
dialog.setCancelable(false);
dialog.setPositiveButton("确认", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
secret_mode = 0;
Toast.makeText(NotesListActivity.this,"您已退出私密模式",Toast.LENGTH_SHORT).show();
startAsyncNotesListQuery();
}
});
dialog.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which){}
});
dialog.show();
}
return true;
}

@ -0,0 +1,42 @@
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(); //销毁
}
}, 3000); // 3秒后跳转
}
}

@ -31,7 +31,12 @@ import net.micode.notes.data.Notes.NoteColumns;
import net.micode.notes.tool.ResourceParser;
import net.micode.notes.ui.NoteEditActivity;
import net.micode.notes.ui.NotesListActivity;
/**
* @classname: NoteWidgetProvider
* @description:
* @date: 2024/1/7 10:22
* @author: wangrunze
*/
public abstract class NoteWidgetProvider extends AppWidgetProvider {
public static final String [] PROJECTION = new String [] {
NoteColumns.ID,
@ -45,6 +50,15 @@ public abstract class NoteWidgetProvider extends AppWidgetProvider {
private static final String TAG = "NoteWidgetProvider";
/**
* @classname: NoteWidgetProvider
* @methodname: onDeleted
* @description:
* @date: 2024/1/7 10:23
* @author: wangrunze
* @param:Context context
* @param:int[] appWidgetIds
*/
@Override
public void onDeleted(Context context, int[] appWidgetIds) {
ContentValues values = new ContentValues();
@ -56,7 +70,15 @@ public abstract class NoteWidgetProvider extends AppWidgetProvider {
new String[] { String.valueOf(appWidgetIds[i])});
}
}
/**
* @classname: NoteWidgetProvider
* @methodname: getNoteWidgetInfo
* @description:
* @date: 2024/1/7 10:23
* @author: wangrunze
* @param:Context context
* @param:int widgetId
*/
private Cursor getNoteWidgetInfo(Context context, int widgetId) {
return context.getContentResolver().query(Notes.CONTENT_NOTE_URI,
PROJECTION,
@ -64,11 +86,30 @@ public abstract class NoteWidgetProvider extends AppWidgetProvider {
new String[] { String.valueOf(widgetId), String.valueOf(Notes.ID_TRASH_FOLER) },
null);
}
/**
* @classname: NoteWidgetProvider
* @methodname: update
* @description:
* @date: 2024/1/7 10:24
* @author: wangrunze
* @param:Context context
* @param:AppWidgetManager appWidgetManager
* @param:int[] appWidgetIds
*/
protected void update(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
update(context, appWidgetManager, appWidgetIds, false);
}
/**
* @classname: NoteWidgetProvider
* @methodname: update
* @description:
* @date: 2024/1/7 10:24
* @author: wangrunze
* @param:Context context
* @param:AppWidgetManager appWidgetManager
* @param:int[] appWidgetIds
* @param:boolean privacyMode
*/
private void update(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds,
boolean privacyMode) {
for (int i = 0; i < appWidgetIds.length; i++) {

@ -23,24 +23,61 @@ import net.micode.notes.R;
import net.micode.notes.data.Notes;
import net.micode.notes.tool.ResourceParser;
/**
* @classname: NoteWidgetProvider_2x
* @description:2*2
* @date: 2024/1/7 10:27
* @author: wangrunze
*/
public class NoteWidgetProvider_2x extends NoteWidgetProvider {
@Override
/**
* @classname: NoteWidgetProvider_2x
* @methodname: onUpdate
* @description:
* @date: 2024/1/7 10:29
* @author: wangrunze
* @param:Context context
* @param:AppWidgetManager appWidgetManager
* @param:int[] appWidgetIds
*/
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
super.update(context, appWidgetManager, appWidgetIds);
}
@Override
/**
* @classname: NoteWidgetProvider_2x
* @methodname: getLayoutId
* @description:ID
* @date: 2024/1/7 10:30
* @author: wangrunze
*/
protected int getLayoutId() {
return R.layout.widget_2x;
}
@Override
/**
* @classname: NoteWidgetProvider_2x
* @methodname: getBgResourceId
* @description:2ID
* @date: 2024/1/7 10:31
* @author: wangrunze
* @param:int bgId
*/
protected int getBgResourceId(int bgId) {
return ResourceParser.WidgetBgResources.getWidget2xBgResource(bgId);
}
@Override
/**
* @classname: NoteWidgetProvider_2x
* @methodname: getWidgetType
* @description:
* @date: 2024/1/7 10:31
* @author: wangrunze
*/
protected int getWidgetType() {
return Notes.TYPE_WIDGET_2X;
}

@ -23,23 +23,59 @@ import net.micode.notes.R;
import net.micode.notes.data.Notes;
import net.micode.notes.tool.ResourceParser;
/**
* @classname: NoteWidgetProvider_4x
* @description:4*1
* @date: 2024/1/7 10:32
* @author: wangrunze
*/
public class NoteWidgetProvider_4x extends NoteWidgetProvider {
@Override
/**
* @classname: NoteWidgetProvider_4x
* @methodname: onUpdate
* @description:
* @date: 2024/1/7 10:32
* @author: wangrunze
* @param:Context context
* @param:AppWidgetManager appWidgetManager
* @param: int[] appWidgetIds
*/
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
super.update(context, appWidgetManager, appWidgetIds);
}
/**
* @classname: NoteWidgetProvider_4x
* @methodname: getLayoutId
* @description:ID
* @date: 2024/1/7 10:33
* @author: wangrunze
*/
protected int getLayoutId() {
return R.layout.widget_4x;
}
@Override
/**
* @classname: NoteWidgetProvider_4x
* @methodname: getBgResourceId
* @description:4ID
* @date: 2024/1/7 10:33
* @author: wangrunze
* @param:int bgId
*/
protected int getBgResourceId(int bgId) {
return ResourceParser.WidgetBgResources.getWidget4xBgResource(bgId);
}
@Override
/**
* @classname: NoteWidgetProvider_4x
* @methodname: getWidgetType
* @description:
* @date: 2024/1/7 10:34
* @author: wangrunze
*/
protected int getWidgetType() {
return Notes.TYPE_WIDGET_4X;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 934 KiB

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/fullscreenBackgroundColor"
android:theme="@style/ThemeOverlay.Notesmaster.FullscreenContainer"
tools:context=".ui.SplashActivity">
<!-- The primary full-screen view. This can be replaced with whatever view
is needed to present your content, e.g. VideoView, SurfaceView,
TextureView, etc. -->
<TextView
android:id="@+id/fullscreen_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/splash"
android:gravity="center"
android:keepScreenOn="true"
android:text="@string/dummy_content"
android:textColor="?attr/fullscreenTextColor"
android:textSize="50sp"
android:textStyle="bold" />
<!-- This FrameLayout insets its children based on system windows using
android:fitsSystemWindows. -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<LinearLayout
android:id="@+id/fullscreen_content_controls"
style="@style/Widget.Theme.Notesmaster.ButtonBar.Fullscreen"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:orientation="horizontal"
tools:ignore="UselessParent">
<Button
android:id="@+id/dummy_button"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/dummy_button" />
</LinearLayout>
<!-- <TextView
android:id="@+id/fullscreen_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/splash"
android:gravity="center"
android:keepScreenOn="true"
android:text="@string/dummy_content"
android:textSize="50sp"
android:textStyle="bold"/> -->
</FrameLayout>
</FrameLayout>

@ -15,7 +15,7 @@
limitations under the License.
-->
<FrameLayout
<FrameLayout xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/list_background"
@ -61,6 +61,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/bg_btn_set_color" />
</LinearLayout>
<LinearLayout
@ -396,5 +397,17 @@
android:layout_marginBottom="-7dip"
android:src="@drawable/selected" />
</FrameLayout>
</LinearLayout>
<ImageButton
android:id="@+id/add_img_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="7dp"
android:layout_marginTop="600dp"
android:layout_marginBottom="7dp"
android:background="@android:drawable/ic_menu_camera"
android:visibility="visible"
tools:visibility="visible" />
</FrameLayout>

@ -18,8 +18,8 @@
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/list_background">
android:layout_height="fill_parent">
<!--android:background="@drawable/list_background"-->
<LinearLayout
android:layout_width="fill_parent"

@ -36,4 +36,20 @@
<item
android:id="@+id/menu_search"
android:title="@string/menu_search"/>
<item
android:id="@+id/menu_decade"
android:title="@string/menu_decade"/>
<item
android:id="@+id/menu_zio"
android:title="@string/menu_zio"/>
<item
android:id="@+id/menu_secret"
android:title="@string/menu_secret"/>
<item
android:id="@+id/menu_quit_secret"
android:title="@string/menu_quit_secret"/>
</menu>

@ -21,4 +21,11 @@
<item
android:id="@+id/menu_new_note"
android:title="@string/notelist_menu_new"/>
<item
android:id="@+id/menu_secret"
android:title="@string/menu_secret"/>
<item
android:id="@+id/menu_quit_secret"
android:title="@string/menu_quit_secret"/>
</menu>

@ -0,0 +1,7 @@
<resources>
<style name="ThemeOverlay.Notesmaster.FullscreenContainer" parent="">
<item name="fullscreenBackgroundColor">@color/light_blue_900</item>
<item name="fullscreenTextColor">@color/light_blue_A400</item>
</style>
</resources>

@ -0,0 +1,6 @@
<resources>
<declare-styleable name="FullscreenAttrs">
<attr name="fullscreenBackgroundColor" format="color" />
<attr name="fullscreenTextColor" format="color" />
</declare-styleable>
</resources>

@ -17,4 +17,9 @@
<resources>
<color name="user_query_highlight">#335b5b5b</color>
<color name="light_blue_600">#FF039BE5</color>
<color name="light_blue_900">#FF01579B</color>
<color name="light_blue_A200">#FF40C4FF</color>
<color name="light_blue_A400">#FF00B0FF</color>
<color name="black_overlay">#66000000</color>
</resources>

@ -15,8 +15,7 @@
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_name">Notes</string>
<string name="app_widget2x2">Notes 2x2</string>
<string name="app_widget4x4">Notes 4x4</string>
@ -39,6 +38,13 @@
<string name="file_path">/MIUI/notes/</string>
<string name="file_name_txt_format">notes_%s.txt</string>
<!-- notes list string -->
<!--首页背景切换-->
<string name="menu_secret">secret model</string>
<string name="menu_quit_secret">quit secret model</string>
<string name="menu_decade">Background: decade</string>
<string name="menu_zio">Background: zio</string>
<string name="format_folder_files_count">(%d)</string>
<string name="menu_create_folder">New Folder</string>
<string name="menu_export_text">Export text</string>
@ -127,9 +133,13 @@
<string name="datetime_dialog_ok">set</string>
<string name="datetime_dialog_cancel">cancel</string>
<plurals name="search_results_title">
<item quantity="one"><xliff:g id="number" example="1">%1$s</xliff:g> result for \"<xliff:g id="search" example="???">%2$s</xliff:g>\"</item>
<item quantity="one"><xliff:g example="1" id="number">%1$s</xliff:g> result for \"<xliff:g example="???" id="search">%2$s</xliff:g>\"</item>
<!-- Case of 0 or 2 or more results. -->
<item quantity="other"><xliff:g id="number" example="15">%1$s</xliff:g> results for \"<xliff:g id="search" example="???">%2$s</xliff:g>\"</item>
<item quantity="other"><xliff:g example="15" id="number">%1$s</xliff:g> results for \"<xliff:g example="???" id="search">%2$s</xliff:g>\"</item>
</plurals>
<string name="title_activity_fullscreen">FullscreenActivity</string>
<string name="dummy_button">Dummy Button</string>
<string name="dummy_content">welcome</string>
<string name="title_activity_splash">SplashActivity</string>
</resources>

@ -16,18 +16,22 @@
-->
<resources>
<style name="TextAppearanceSuper">
<item name="android:textSize">@dimen/text_font_size_super</item>
<item name="android:textColorLink">#0000ff</item>
</style>
<style name="TextAppearanceLarge">
<item name="android:textSize">@dimen/text_font_size_large</item>
<item name="android:textColorLink">#0000ff</item>
</style>
<style name="TextAppearanceMedium">
<item name="android:textSize">@dimen/text_font_size_medium</item>
<item name="android:textColorLink">#0000ff</item>
</style>
<style name="TextAppearanceNormal">
<item name="android:textSize">@dimen/text_font_size_normal</item>
<item name="android:textColorLink">#0000ff</item>
@ -49,7 +53,7 @@
</style>
<style name="HighlightTextAppearancePrimary">
<item name="android:textSize">@dimen/text_font_size_normal</item>
<item name="android:textSize">@dimen/text_font_size_normal</item>
<item name="android:textColor">@color/primary_text_dark</item>
</style>
@ -63,7 +67,16 @@
</style>
<style name="NoteActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">
<item name="android:displayOptions" />
<item name="android:visibility">gone</item>
<!-- <item name="android:displayOptions" /> -->
<item name="android:visibility">visible</item>
</style>
<style name="Widget.Theme.Notesmaster.ActionBar.Fullscreen" parent="Widget.AppCompat.ActionBar">
<item name="android:background">@color/black_overlay</item>
</style>
<style name="Widget.Theme.Notesmaster.ButtonBar.Fullscreen" parent="">
<item name="android:background">@color/black_overlay</item>
<item name="android:buttonBarStyle">?android:attr/buttonBarStyle</item>
</style>
</resources>

@ -0,0 +1,16 @@
<resources>
<style name="Theme.Notesmaster" parent="Theme.AppCompat.Light" />
<style name="Theme.Notesmaster.Fullscreen" parent="Theme.Notesmaster">
<item name="android:actionBarStyle">@style/Widget.Theme.Notesmaster.ActionBar.Fullscreen
</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:windowBackground">@null</item>
</style>
<style name="ThemeOverlay.Notesmaster.FullscreenContainer" parent="">
<item name="fullscreenBackgroundColor">@color/light_blue_600</item>
<item name="fullscreenTextColor">@color/light_blue_A200</item>
</style>
</resources>
Loading…
Cancel
Save