Close radical view when pressing back on main activity.
CHANGELOG.md
1 | 1 | Changelog | |
2 | 2 | ========= | |
3 | 3 | ||
4 | + | Changes Since 0.3.0 | |
5 | + | ------------------- | |
6 | + | ||
7 | + | ### UI Fixes | |
8 | + | ||
9 | + | * Clicking the back button when the radical panel is open will now close the panel | |
10 | + | instead of exiting the app. No change the behavior when the panel is already | |
11 | + | closed. | |
12 | + | ||
13 | + | ### Translations | |
14 | + | ||
15 | + | * Update fr translation. | |
16 | + | * Translations are now hosted on [fedora's weblate](https://translate.fedoraproject.org/projects/nani/). | |
17 | + | ||
4 | 18 | Changes In 0.3.0 | |
5 | 19 | ---------------- | |
6 | 20 |
app/src/main/java/eu/lepiller/nani/MainActivity.java
336 | 336 | ||
337 | 337 | return super.onOptionsItemSelected(item); | |
338 | 338 | } | |
339 | + | ||
340 | + | @Override | |
341 | + | public void onBackPressed() { | |
342 | + | if(radical_selector.getVisibility() == View.VISIBLE) { | |
343 | + | radical_selector.close(); | |
344 | + | } else { | |
345 | + | super.onBackPressed(); | |
346 | + | } | |
347 | + | } | |
339 | 348 | } |
app/src/main/java/eu/lepiller/nani/RadicalSelectorView.java
209 | 209 | kanjiSelectionListener = listener; | |
210 | 210 | } | |
211 | 211 | ||
212 | + | public void close() { | |
213 | + | close_button.callOnClick(); | |
214 | + | } | |
215 | + | ||
212 | 216 | public void updateSelection(Map<Integer, List<String>> kanji) { | |
213 | 217 | LinearLayout row = kanji_row1; | |
214 | 218 | kanji_row1.removeAllViews(); |