• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Simple Notepad Application for Android OS


Commit MetaInfo

Révision5963950bfc55aa1a28830852780a02b5aabf0afd (tree)
l'heure2017-08-19 12:16:14
AuteurMasahiko, SAWAI <say@user...>
CommiterMasahiko, SAWAI

Message de Log

Fixed a issue about search and back button

Change Summary

Modification

--- a/notepad-app-level-11/src/main/AndroidManifest.xml
+++ b/notepad-app-level-11/src/main/AndroidManifest.xml
@@ -6,7 +6,7 @@
66 android:versionName="1.0.13"
77 android:installLocation="auto"
88 >
9- <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="25" />
9+ <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="25" /> <!-- Android 7.1 -->
1010
1111 <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
1212 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
@@ -18,6 +18,8 @@
1818 android:debuggable="false"
1919 >
2020 <!--
21+ android:resizeableActivity="true"
22+ android:supportsPictureInPicture="true"
2123 android:uiOptions="splitActionBarWhenNarrow"
2224 -->
2325
--- a/notepad-app-level-11/src/main/java/org/routine_work/notepad/NotepadActivity.java
+++ b/notepad-app-level-11/src/main/java/org/routine_work/notepad/NotepadActivity.java
@@ -227,6 +227,7 @@ public class NotepadActivity extends Activity implements NotepadConstants,
227227
228228 searchView.setOnQueryTextListener(this);
229229 searchView.setOnCloseListener(this);
230+ Log.v(LOG_TAG, "initialQueryString => " + initialQueryString);
230231 if (!TextUtils.isEmpty(initialQueryString))
231232 {
232233 searchView.setIconified(false);
@@ -249,8 +250,19 @@ public class NotepadActivity extends Activity implements NotepadConstants,
249250 case android.R.id.home:
250251 if (searchView != null)
251252 {
252- searchView.setQuery(null, false);
253- searchView.setIconified(true);
253+ Log.v(LOG_TAG, "seachView.isShown() => " + searchView.isShown());
254+ Log.v(LOG_TAG, "seachView.isIconified() => " + searchView.isIconified());
255+ if (searchView.isShown() && !searchView.isIconified())
256+ {
257+ if (!TextUtils.isEmpty(searchView.getQuery()))
258+ {
259+ Log.v(LOG_TAG, "Clear searchView query");
260+ searchView.setQuery(null, false);
261+ reloadNoteList();
262+ }
263+ Log.v(LOG_TAG, "Iconify seachView");
264+ searchView.setIconified(true);
265+ }
254266 }
255267 closeNoteDetailFragment();
256268 break;
@@ -311,13 +323,15 @@ public class NotepadActivity extends Activity implements NotepadConstants,
311323 boolean result;
312324 Log.v(LOG_TAG, "Hello");
313325
314- if ((keyCode == KeyEvent.KEYCODE_BACK)
315- && searchView.isIconified() == false)
326+ Log.v(LOG_TAG, "searchView.isIconified() => " + searchView.isIconified()); // androud 4 : true, androud 7 : false
327+ Log.v(LOG_TAG, "searchView.isShown() => " + searchView.isShown());
328+
329+ if ((keyCode == KeyEvent.KEYCODE_BACK) && searchView.isShown() && !searchView.isIconified())
316330 {
331+ Log.v(LOG_TAG, "Close SeachView");
317332 searchView.setQuery(null, false);
318333 searchView.setIconified(true);
319334 result = true;
320-
321335 }
322336 else
323337 {
@@ -327,8 +341,8 @@ public class NotepadActivity extends Activity implements NotepadConstants,
327341 Log.v(LOG_TAG, "Bye");
328342 return result;
329343 }
330-
331344 // BEGIN ---------- SeachView.OnCloseListener ----------
345+
332346 public boolean onClose()
333347 {
334348 Log.v(LOG_TAG, "Hello");
@@ -358,7 +372,11 @@ public class NotepadActivity extends Activity implements NotepadConstants,
358372 {
359373 Log.v(LOG_TAG, "Hello");
360374
361- doSeachWithQueryText(queryText);
375+ doSearchWithQueryText(queryText);
376+ if (TextUtils.isEmpty(queryText) == false && searchView != null && searchView.isIconified())
377+ {
378+ searchView.setIconified(false);
379+ }
362380
363381 Log.v(LOG_TAG, "Bye");
364382 return true;
@@ -545,7 +563,7 @@ public class NotepadActivity extends Activity implements NotepadConstants,
545563 Log.v(LOG_TAG, "Bye");
546564 }
547565
548- private void doSeachWithQueryText(String queryString)
566+ private void doSearchWithQueryText(String queryString)
549567 {
550568 Log.v(LOG_TAG, "Hello");
551569 Log.v(LOG_TAG, "queryString => " + queryString);
--- a/notepad-app/src/main/res/values-ja/strings.xml
+++ b/notepad-app/src/main/res/values-ja/strings.xml
@@ -37,9 +37,9 @@
3737 <string name="search_note_hint">ノートを検索</string>
3838 <string name="search_note_description">ノートを検索します。</string>
3939 <string name="find_word_hint">単語を検索</string>
40- <plurals name="found_word_count_message">
41- <item quantity="other">%1$d か所ありました</item>
42- </plurals>
40+ <plurals name="found_word_count_message">
41+ <item quantity="other">%1$d か所ありました</item>
42+ </plurals>
4343
4444 <!-- activity title -->
4545 <string name="note_list_title">ノート一覧</string>