Compare commits

..

No commits in common. 'master' and 'develop' have entirely different histories.

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

Binary file not shown.

@ -1,10 +1,26 @@
<?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="16" />
<uses-sdk android:minSdkVersion="14" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
@ -18,44 +34,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/Theme.AppCompat.Light.DarkActionBar"
android:theme="@style/NoteTheme"
android:uiOptions="splitActionBarWhenNarrow"
android:windowSoftInputMode="adjustPan">
</activity>
android:windowSoftInputMode="adjustPan" >
<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/Theme.AppCompat.Light.DarkActionBar">
android:theme="@style/NoteTheme" >
<intent-filter>
<action android:name="android.intent.action.INSERT_OR_EDIT" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/text_note" />
<data android:mimeType="vnd.android.cursor.item/call_note" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.INSERT_OR_EDIT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/text_note" />
<data android:mimeType="vnd.android.cursor.item/call_note" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
@ -65,13 +81,13 @@
</activity>
<provider
android:name=".data.NotesProvider"
android:name="net.micode.notes.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" />
@ -84,7 +100,8 @@
</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" />
@ -95,33 +112,39 @@
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=".ui.AlarmReceiver"
android:process=":remote"></receiver>
android:name="net.micode.notes.ui.AlarmReceiver"
android:process=":remote" >
</receiver>
<activity
android:name=".ui.AlarmAlertActivity"
android:label="@string/app_name"
android:launchMode="singleInstance"
android:theme="@android:style/Theme.Holo.Wallpaper.NoTitleBar"></activity>
android:theme="@android:style/Theme.Holo.Wallpaper.NoTitleBar" >
</activity>
<activity
android:name=".ui.NotesPreferenceActivity"
android:name="net.micode.notes.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=".gtask.remote.GTaskSyncService"
android:exported="false"></service>
android:name="net.micode.notes.gtask.remote.GTaskSyncService"
android:exported="false" >
</service>
<meta-data
android:name="android.app.default_searchable"
android:value=".ui.NoteEditActivity" />
</application>
</manifest>
</manifest>

@ -59,12 +59,7 @@ 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();
@ -106,32 +101,17 @@ 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;
@ -146,7 +126,6 @@ public class GTaskClient {
if (mLoggedin) {
Log.d(TAG, "already logged in");
//如果没超过时间,则不需要重新登录
return true;
}
@ -156,7 +135,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"))) {
@ -172,7 +151,6 @@ public class GTaskClient {
}
}
//如果用户账户无法登录则使用谷歌官方的URI进行登录
// try to login with google official url
if (!mLoggedin) {
mGetUrl = GTASK_GET_URL;
@ -185,16 +163,7 @@ 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);
@ -219,7 +188,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);
@ -237,16 +206,7 @@ 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
@ -264,14 +224,7 @@ 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;
@ -285,11 +238,11 @@ public class GTaskClient {
// login gtask
try {
String loginUrl = mGetUrl + "?auth=" + authToken;//设置登录的url
HttpGet httpGet = new HttpGet(loginUrl);//通过登录的uri实例化网页上资源的查找
String loginUrl = mGetUrl + "?auth=" + authToken;
HttpGet httpGet = new HttpGet(loginUrl);
HttpResponse response = null;
response = mHttpClient.execute(httpGet);
//获取CookieStore里存放的cookie
// get the cookie now
List<Cookie> cookies = mHttpClient.getCookieStore().getCookies();
boolean hasAuthCookie = false;
@ -301,7 +254,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(";
@ -330,29 +283,14 @@ 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) {
@ -384,15 +322,7 @@ 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");
@ -429,14 +359,7 @@ 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 {
@ -462,14 +385,7 @@ 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 {
@ -495,13 +411,7 @@ 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 {
@ -522,14 +432,7 @@ 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
@ -543,16 +446,7 @@ 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();
@ -591,14 +485,7 @@ 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 {
@ -621,13 +508,7 @@ 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");
@ -665,14 +546,7 @@ 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,12 +47,7 @@ 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();
@ -92,7 +87,7 @@ public class GTaskManager {
private HashMap<Long, String> mNidToGid;
private GTaskManager() {//对象初始化函数
private GTaskManager() {
mSyncing = false;
mCancelled = false;
mGTaskListHashMap = new HashMap<String, TaskList>();
@ -103,41 +98,19 @@ 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");
@ -155,14 +128,14 @@ public class GTaskManager {
mNidToGid.clear();
try {
GTaskClient client = GTaskClient.getInstance();//getInstance即为创建一个实例
GTaskClient client = GTaskClient.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
@ -194,13 +167,7 @@ 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;
@ -279,13 +246,7 @@ 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;
@ -389,13 +350,7 @@ 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;
@ -520,16 +475,7 @@ 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;
@ -575,14 +521,7 @@ 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;
@ -656,15 +595,7 @@ 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;
@ -687,15 +618,7 @@ 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;
@ -768,15 +691,7 @@ 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;
@ -814,15 +729,7 @@ 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);
@ -838,13 +745,7 @@ public class GTaskManager {
}
}
}
/**
* @classname: GTaskManager
* @methodname: refreshLocalSyncId
* @description:
* @date: 2024/1/4 11:46
* @author: wangrunze
*/
private void refreshLocalSyncId() throws NetworkFailureException {
if (mCancelled) {
return;
@ -888,23 +789,11 @@ 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,12 +22,7 @@ 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";
@ -46,13 +41,7 @@ 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() {
@ -66,36 +55,18 @@ 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();
@ -114,13 +85,7 @@ 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) {
@ -131,14 +96,7 @@ 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);
@ -147,28 +105,13 @@ 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
public String mContent;
private String mContent;
// Note mode
private int mMode;

@ -39,50 +39,35 @@ 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;//文本在数据库存储中的ID号
private String mSnippet;//闹钟提示时出现的文本片段
private long mNoteId;
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);//根据ID从数据库中获取标签的内容
mSnippet = DataUtils.getSnippetById(this.getContentResolver(), mNoteId);
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();
@ -91,39 +76,23 @@ 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); //调用系统的铃声管理URI得到闹钟提示音
Settings.System.MODE_RINGER_STREAMS_AFFECTED, 0);
if ((silentModeStreams & (1 << AudioManager.STREAM_ALARM)) != 0) {
mPlayer.setAudioStreamType(silentModeStreams);
@ -131,13 +100,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();
@ -150,31 +119,22 @@ 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);//用到AlertDialog.Builder中的create()新建了一个AlertDialog
dialog.setTitle(R.string.app_name);//为对话框设置标题
dialog.setMessage(mSnippet);//为对话框设置内容
dialog.setPositiveButton(R.string.notealert_ok, this);//给对话框添加"Yes"按钮
AlertDialog.Builder dialog = new AlertDialog.Builder(this);
dialog.setTitle(R.string.app_name);
dialog.setMessage(mSnippet);
dialog.setPositiveButton(R.string.notealert_ok, this);
if (isScreenOn()) {
dialog.setNegativeButton(R.string.notealert_enter, this);//给对话框添加"no"按钮
dialog.setNegativeButton(R.string.notealert_enter, this);
}
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;
@ -183,25 +143,11 @@ 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,34 +27,20 @@ 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();//System.currentTimeMillis()产生一个当前的毫秒,这个毫秒其实就是自1970年1月1日0时起的毫秒数
long currentDate = System.currentTimeMillis();
Cursor c = context.getContentResolver().query(Notes.CONTENT_NOTE_URI,
PROJECTION,
NoteColumns.ALERTED_DATE + ">? AND " + NoteColumns.TYPE + "=" + Notes.TYPE_NOTE,

@ -19,23 +19,8 @@ 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,12 +28,6 @@ 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;
@ -71,16 +65,6 @@ 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);
@ -90,16 +74,6 @@ 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;
@ -142,16 +116,6 @@ 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();
@ -182,16 +146,6 @@ 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) {
@ -203,20 +157,12 @@ 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());
}
@ -225,16 +171,6 @@ 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();
@ -278,14 +214,6 @@ 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) {
@ -318,14 +246,6 @@ 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);
@ -342,14 +262,6 @@ 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);
@ -373,14 +285,6 @@ 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;
@ -389,19 +293,12 @@ 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);
}
@ -411,14 +308,6 @@ 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;
@ -433,14 +322,6 @@ 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);
}
@ -450,14 +331,6 @@ 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;
@ -471,26 +344,10 @@ 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();
@ -509,14 +366,6 @@ 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;
@ -545,14 +394,6 @@ 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);
}
@ -560,14 +401,6 @@ 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;
@ -580,14 +413,6 @@ 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;
}
@ -597,14 +422,6 @@ 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;
@ -617,13 +434,6 @@ 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());
@ -638,13 +448,6 @@ 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);
@ -655,13 +458,6 @@ 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);
@ -680,13 +476,6 @@ 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,31 +29,17 @@ 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;//DateTimePicker控件控件一般用于让用户可以从日期列表中选择单个值。
private DateTimePicker mDateTimePicker;
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);
@ -78,35 +64,14 @@ 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 |
@ -115,15 +80,7 @@ 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,26 +26,12 @@ 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);
@ -58,38 +44,17 @@ 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,57 +28,26 @@ 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) {
@ -87,49 +56,22 @@ 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,7 +31,6 @@ 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;
@ -79,9 +78,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashSet;
public class NotesListActivity extends AppCompatActivity implements OnClickListener, OnItemLongClickListener {
//首页背景变换
private int mode = -1;
public class NotesListActivity extends Activity implements OnClickListener, OnItemLongClickListener {
private static final int FOLDER_NOTE_LIST_QUERY_TOKEN = 0;
private static final int FOLDER_LIST_QUERY_TOKEN = 1;
@ -127,8 +124,6 @@ public class NotesListActivity extends AppCompatActivity implements OnClickListe
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 + "=?";
@ -144,7 +139,6 @@ public class NotesListActivity extends AppCompatActivity implements OnClickListe
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.note_list);
getWindow().setBackgroundDrawableResource(R.drawable.decade);//将decade作为初始背景
initResources();
/**
@ -418,35 +412,10 @@ public class NotesListActivity extends AppCompatActivity implements OnClickListe
private void startAsyncNotesListQuery() {
String selection = (mCurrentFolderId == Notes.ID_ROOT_FOLDER) ? ROOT_FOLDER_SELECTION
: NORMAL_SELECTION;
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");
}
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");
}
private final class BackgroundQueryHandler extends AsyncQueryHandler {
@ -803,31 +772,12 @@ public class NotesListActivity extends AppCompatActivity implements OnClickListe
} 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_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){
if(item.getItemId()==R.id.menu_new_folder){
showCreateOrModifyFolderDialog(true);
}
else if(item.getItemId()==R.id.menu_export_text ){
@ -854,53 +804,6 @@ public class NotesListActivity extends AppCompatActivity implements OnClickListe
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;
}

@ -1,42 +0,0 @@
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,12 +31,7 @@ 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,
@ -50,15 +45,6 @@ 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();
@ -70,15 +56,7 @@ 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,
@ -86,30 +64,11 @@ 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,61 +23,24 @@ 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,59 +23,23 @@ 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.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 934 KiB

@ -1,63 +0,0 @@
<?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 xmlns:tools="http://schemas.android.com/tools"
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/list_background"
@ -61,7 +61,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/bg_btn_set_color" />
</LinearLayout>
<LinearLayout
@ -397,17 +396,5 @@
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,20 +36,4 @@
<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,11 +21,4 @@
<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>

@ -1,7 +0,0 @@
<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>

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

@ -17,9 +17,4 @@
<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,7 +15,8 @@
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>
@ -38,13 +39,6 @@
<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>
@ -133,13 +127,9 @@
<string name="datetime_dialog_ok">set</string>
<string name="datetime_dialog_cancel">cancel</string>
<plurals name="search_results_title">
<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>
<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>
<!-- Case of 0 or 2 or more results. -->
<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>
<item quantity="other"><xliff:g id="number" example="15">%1$s</xliff:g> results for \"<xliff:g id="search" example="???">%2$s</xliff:g>\"</item>
</plurals>
<string name="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,22 +16,18 @@
-->
<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>
@ -53,7 +49,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>
@ -67,16 +63,7 @@
</style>
<style name="NoteActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">
<!-- <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>
<item name="android:displayOptions" />
<item name="android:visibility">gone</item>
</style>
</resources>

@ -1,16 +0,0 @@
<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