From c61a9c6434973f1881028d0760c8728bb63b5303 Mon Sep 17 00:00:00 2001 From: jjjzyhbx <2605274496@qq.com> Date: Fri, 26 May 2023 08:44:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E4=BA=86=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=EF=BC=8C=E5=8C=85=E6=8B=AC=E6=96=B0=E5=BB=BA=E6=96=87=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E6=8E=A7=E5=88=B6=E5=8F=B0=EF=BC=8C=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/encodings.xml | 1 + app/build.gradle | 6 +++++- app/src/main/AndroidManifest.xml | 12 +++++++++--- app/src/main/java/net/micode/notes/data/Contact.java | 7 ++++++- .../java/net/micode/notes/ui/NotesListActivity.java | 3 ++- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.idea/encodings.xml b/.idea/encodings.xml index 582a05f..d11d9c1 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -2,5 +2,6 @@ + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 9e8b972..31cc42b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,7 +9,7 @@ android { defaultConfig { applicationId "net.micode.notes" minSdkVersion 14 - targetSdkVersion 14 + } buildTypes { @@ -19,3 +19,7 @@ android { } } } +dependencies { + implementation 'com.android.support:appcompat-v7:28.0.0' + +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e5c7d47..ad54787 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -16,6 +16,7 @@ --> @@ -40,7 +41,8 @@ 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" > @@ -54,9 +56,13 @@ android:name=".ui.NoteEditActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:launchMode="singleTop" - android:theme="@style/NoteTheme" > + android:theme="@style/Theme.AppCompat.Light.DarkActionBar" + > - + + + + diff --git a/app/src/main/java/net/micode/notes/data/Contact.java b/app/src/main/java/net/micode/notes/data/Contact.java index d97ac5d..e1bb8f3 100644 --- a/app/src/main/java/net/micode/notes/data/Contact.java +++ b/app/src/main/java/net/micode/notes/data/Contact.java @@ -35,7 +35,12 @@ public class Contact { + "(SELECT raw_contact_id " + " FROM phone_lookup" + " WHERE min_match = '+')"; - + /** + * 获取电话号码对应的联系人名字 + * @param context 上下文 + * @param phoneNumber 电话号码 + * @return 联系人名字 + */ public static String getContact(Context context, String phoneNumber) { if(sContactCache == null) { sContactCache = new HashMap(); diff --git a/app/src/main/java/net/micode/notes/ui/NotesListActivity.java b/app/src/main/java/net/micode/notes/ui/NotesListActivity.java index e843aec..93bef89 100644 --- a/app/src/main/java/net/micode/notes/ui/NotesListActivity.java +++ b/app/src/main/java/net/micode/notes/ui/NotesListActivity.java @@ -31,6 +31,7 @@ import android.database.Cursor; import android.os.AsyncTask; import android.os.Bundle; import android.preference.PreferenceManager; +import android.support.v7.app.AppCompatActivity; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; @@ -78,7 +79,7 @@ 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 static final int FOLDER_NOTE_LIST_QUERY_TOKEN = 0; private static final int FOLDER_LIST_QUERY_TOKEN = 1;