Show sense language

Julien LepillerSun Jul 18 19:23:54+0200 2021

5effbe6

Show sense language

app/src/main/java/eu/lepiller/nani/MainActivity.java

303303
            for (Result.Sense sense : result.getSenses()) {
304304
                View child = getLayoutInflater().inflate(R.layout.layout_sense, senses_view, false);
305305
                TextView id_view = child.findViewById(R.id.id_view);
306+
                TextView lang_view = child.findViewById(R.id.lang_view);
306307
                TextView infos_view = child.findViewById(R.id.infos_view);
307308
                TextView sense_view = child.findViewById(R.id.definition_view);
308309
309310
                id_view.setText(String.format(getResources().getString(R.string.sense_number), sense_pos));
311+
                lang_view.setText(sense.getLanguage());
310312
311313
                StringBuilder sb = new StringBuilder();
312314
                boolean separator1 = false;

app/src/main/java/eu/lepiller/nani/result/Result.java

4545
        public List<String> getInfos() {
4646
            return infos;
4747
        }
48+
49+
        public String getLanguage() {
50+
            return language;
51+
        }
4852
    }
4953
5054
    public static class Reading {

app/src/main/res/layout/layout_sense.xml

22
<LinearLayout
33
    xmlns:android="http://schemas.android.com/apk/res/android"
44
    android:layout_width="match_parent"
5-
    android:layout_height="wrap_content">
5+
    android:layout_height="wrap_content"
6+
    android:gravity="center">
67
78
    <TextView
89
        android:id="@+id/id_view"

1314
        android:layout_marginRight="16dp"
1415
        android:text="id" />
1516
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+
1628
    <LinearLayout
1729
        android:layout_width="0dp"
1830
        android:layout_height="wrap_content"

app/src/main/res/values/colors.xml

99
    <color name="colorDarkGrey">#d2d5d2</color>
1010
    <color name="colorTextGrey">#909090</color>
1111
    <color name="colorBlack">#505050</color>
12+
    <color name="colorLang">#925424</color>
1213
</resources>