Show sense language
app/src/main/java/eu/lepiller/nani/MainActivity.java
| 303 | 303 | for (Result.Sense sense : result.getSenses()) { | |
| 304 | 304 | View child = getLayoutInflater().inflate(R.layout.layout_sense, senses_view, false); | |
| 305 | 305 | TextView id_view = child.findViewById(R.id.id_view); | |
| 306 | + | TextView lang_view = child.findViewById(R.id.lang_view); | |
| 306 | 307 | TextView infos_view = child.findViewById(R.id.infos_view); | |
| 307 | 308 | TextView sense_view = child.findViewById(R.id.definition_view); | |
| 308 | 309 | ||
| 309 | 310 | id_view.setText(String.format(getResources().getString(R.string.sense_number), sense_pos)); | |
| 311 | + | lang_view.setText(sense.getLanguage()); | |
| 310 | 312 | ||
| 311 | 313 | StringBuilder sb = new StringBuilder(); | |
| 312 | 314 | boolean separator1 = false; |
app/src/main/java/eu/lepiller/nani/result/Result.java
| 45 | 45 | public List<String> getInfos() { | |
| 46 | 46 | return infos; | |
| 47 | 47 | } | |
| 48 | + | ||
| 49 | + | public String getLanguage() { | |
| 50 | + | return language; | |
| 51 | + | } | |
| 48 | 52 | } | |
| 49 | 53 | ||
| 50 | 54 | public static class Reading { |
app/src/main/res/layout/layout_sense.xml
| 2 | 2 | <LinearLayout | |
| 3 | 3 | xmlns:android="http://schemas.android.com/apk/res/android" | |
| 4 | 4 | android:layout_width="match_parent" | |
| 5 | - | android:layout_height="wrap_content"> | |
| 5 | + | android:layout_height="wrap_content" | |
| 6 | + | android:gravity="center"> | |
| 6 | 7 | ||
| 7 | 8 | <TextView | |
| 8 | 9 | android:id="@+id/id_view" | |
… | |||
| 13 | 14 | android:layout_marginRight="16dp" | |
| 14 | 15 | android:text="id" /> | |
| 15 | 16 | ||
| 17 | + | <TextView | |
| 18 | + | android:id="@+id/lang_view" | |
| 19 | + | android:layout_width="wrap_content" | |
| 20 | + | android:layout_height="wrap_content" | |
| 21 | + | android:textColor="@color/colorLang" | |
| 22 | + | android:padding="4dp" | |
| 23 | + | android:background="@drawable/ic_pitch_border" | |
| 24 | + | android:layout_marginLeft="8dp" | |
| 25 | + | android:layout_marginStart="8dp" | |
| 26 | + | android:text="lang" /> | |
| 27 | + | ||
| 16 | 28 | <LinearLayout | |
| 17 | 29 | android:layout_width="0dp" | |
| 18 | 30 | android:layout_height="wrap_content" | |
app/src/main/res/values/colors.xml
| 9 | 9 | <color name="colorDarkGrey">#d2d5d2</color> | |
| 10 | 10 | <color name="colorTextGrey">#909090</color> | |
| 11 | 11 | <color name="colorBlack">#505050</color> | |
| 12 | + | <color name="colorLang">#925424</color> | |
| 12 | 13 | </resources> |