Link help button in radical view to help topic
CHANGELOG.md
6 | 6 | ||
7 | 7 | ### Features | |
8 | 8 | ||
9 | - | * Add a Help screen. | |
9 | + | * Add a Help screen and two topics: kanji input by component and romaji input. | |
10 | + | * Add a button for direct help access on radical input. | |
10 | 11 | ||
11 | 12 | ### Translations | |
12 | 13 |
app/src/main/java/eu/lepiller/nani/MainActivity.java
129 | 129 | } | |
130 | 130 | }); | |
131 | 131 | ||
132 | + | radical_selector.setOnHelpEventListener(new View.OnClickListener() { | |
133 | + | @Override | |
134 | + | public void onClick(View v) { | |
135 | + | Intent intent = new Intent(MainActivity.this, HelpRadicalActivity.class); | |
136 | + | startActivity(intent); | |
137 | + | } | |
138 | + | }); | |
139 | + | ||
132 | 140 | if(savedResults != null) { | |
133 | 141 | showResults(savedResults); | |
134 | 142 | } |
app/src/main/java/eu/lepiller/nani/RadicalSelectorView.java
30 | 30 | public class RadicalSelectorView extends LinearLayout implements OnTaskCompleted<Map<Integer, List<String>>>, | |
31 | 31 | OnOtherTaskCompleted<Pair<Map<Integer, List<String>>, Set<String>>> { | |
32 | 32 | static private final String TAG = "RSV"; | |
33 | - | private Button close_button; | |
33 | + | private Button close_button, help_button; | |
34 | 34 | private LinearLayout kanji_row1, kanji_row2; | |
35 | 35 | private LinearLayout radical_table; | |
36 | 36 | final List<String> selected = new ArrayList<>(); | |
… | |||
62 | 62 | super.onFinishInflate(); | |
63 | 63 | ||
64 | 64 | close_button = findViewById(R.id.close_button); | |
65 | + | help_button = findViewById(R.id.help_button); | |
65 | 66 | kanji_row1 = findViewById(R.id.kanji_row1); | |
66 | 67 | kanji_row2 = findViewById(R.id.kanji_row2); | |
67 | 68 | radical_table = findViewById(R.id.radical_table); | |
… | |||
200 | 201 | close_button.setOnClickListener(listener); | |
201 | 202 | } | |
202 | 203 | ||
204 | + | public void setOnHelpEventListener(View.OnClickListener listener) { | |
205 | + | help_button.setOnClickListener(listener); | |
206 | + | } | |
207 | + | ||
203 | 208 | public void setOnClickEventListener(View.OnClickListener listener) { | |
204 | 209 | kanjiSelectionListener = listener; | |
205 | 210 | } |