Improve layouts and images
app/src/main/java/eu/lepiller/nani/DictionaryDownloadActivity.java
48 | 48 | ||
49 | 49 | TextView description_view = findViewById(R.id.additional_info_view); | |
50 | 50 | description_view.setText(d.getDescription()); | |
51 | + | TextView full_description_view = findViewById(R.id.extended_info_view); | |
52 | + | full_description_view.setText(d.getFullDescription()); | |
51 | 53 | ||
52 | 54 | download_bar = findViewById(R.id.download_progress); | |
53 | 55 | download_bar.setProgress(0); | |
… | |||
81 | 83 | LinearLayout remove_layout = findViewById(R.id.remove_layout); | |
82 | 84 | remove_layout.setVisibility(d.isDownloaded()? View.VISIBLE: View.INVISIBLE); | |
83 | 85 | ||
86 | + | TextView size_view = findViewById(R.id.size_view); | |
87 | + | size_view.setText(String.format(getResources().getString(R.string.dictionary_size), d.getSize())); | |
88 | + | ||
84 | 89 | download_button.setOnClickListener(new View.OnClickListener() { | |
85 | 90 | @Override | |
86 | 91 | public void onClick(View v) { |
app/src/main/java/eu/lepiller/nani/dictionary/DictionariesAdapter.java
35 | 35 | } | |
36 | 36 | ||
37 | 37 | // Lookup view for data population | |
38 | - | ImageView icon_view = (ImageView) convertView.findViewById(R.id.icon_view); | |
39 | - | TextView name_view = (TextView) convertView.findViewById(R.id.name_view); | |
40 | - | TextView description_view = (TextView) convertView.findViewById(R.id.additional_info_view); | |
38 | + | ImageView icon_view = convertView.findViewById(R.id.icon_view); | |
39 | + | TextView name_view = convertView.findViewById(R.id.name_view); | |
40 | + | TextView description_view = convertView.findViewById(R.id.additional_info_view); | |
41 | 41 | ||
42 | 42 | // Populate the data into the template view using the data object | |
43 | 43 | Drawable icon = dictionary.getDrawable(context); | |
44 | 44 | if(icon != null) { | |
45 | + | icon = icon.getConstantState().newDrawable().mutate(); | |
46 | + | if(!dictionary.isDownloaded()) | |
47 | + | icon.setAlpha(64); | |
48 | + | else | |
49 | + | icon.setAlpha(255); | |
45 | 50 | icon_view.setImageDrawable(icon); | |
46 | 51 | } | |
47 | 52 |
app/src/main/res/drawable-v24/ic_launcher_foreground.xml
1 | 1 | <vector xmlns:android="http://schemas.android.com/apk/res/android" | |
2 | - | xmlns:aapt="http://schemas.android.com/aapt" | |
3 | 2 | android:width="108dp" | |
4 | 3 | android:height="108dp" | |
5 | 4 | android:viewportWidth="108" | |
6 | 5 | android:viewportHeight="108"> | |
7 | 6 | <group | |
8 | 7 | android:rotation="-15" | |
9 | - | android:translateX="-10" | |
10 | - | android:translateY="50" | |
11 | - | android:scaleX="0.4" | |
12 | - | android:scaleY="0.4"> | |
8 | + | android:translateX="12" | |
9 | + | android:translateY="60" | |
10 | + | android:scaleX="0.3" | |
11 | + | android:scaleY="0.3"> | |
13 | 12 | <path | |
14 | 13 | android:fillColor="#EEF2EE" | |
15 | 14 | android:pathData="M 92.727991,-65.332249 H 210.47799 v 14.25 h -15 v 128.25 q 0,10.5 -3.75,15 -3.75,4.499999 -14.25,4.499999 -9,0 -17.25,-2.249999 l -3,-14.25 q 9,2.25 18,2.25 5.25,0 5.25,-9 v -124.5 H 92.727991 Z m 65.999999,43.5 v 66 h -42.75 v 10.5 h -14.25 v -76.5 z m -42.75,52.5 h 28.5 V -9.0822506 h -28.5 z m -39.749999,-106.5 15,4.5 q -6,17.25 -13.5,34.5 V 96.66775 h -15 V -8.3322506 q -9,14.2499999 -18.75,26.2500016 l -7.5,-15.0000016 q 27.75,-37.4999984 39.75,-78.7499984 z" /> |
app/src/main/res/layout/activity_dictionary_download.xml
41 | 41 | android:id="@+id/additional_info_view" | |
42 | 42 | android:layout_width="wrap_content" | |
43 | 43 | android:layout_height="wrap_content" | |
44 | - | android:layout_margin="8dp" | |
45 | 44 | android:layout_marginStart="8dp" | |
46 | 45 | android:layout_marginLeft="8dp" | |
47 | 46 | android:layout_marginTop="8dp" | |
48 | 47 | android:layout_marginEnd="8dp" | |
49 | 48 | android:layout_marginRight="8dp" | |
49 | + | android:padding="8dp" | |
50 | 50 | android:text="Description" | |
51 | 51 | app:layout_constraintEnd_toEndOf="parent" | |
52 | 52 | app:layout_constraintStart_toStartOf="parent" | |
53 | 53 | app:layout_constraintTop_toBottomOf="@+id/linearLayout2" /> | |
54 | 54 | ||
55 | + | <TextView | |
56 | + | android:id="@+id/extended_info_view" | |
57 | + | android:layout_width="wrap_content" | |
58 | + | android:layout_height="wrap_content" | |
59 | + | android:layout_marginStart="8dp" | |
60 | + | android:layout_marginLeft="8dp" | |
61 | + | android:layout_marginTop="8dp" | |
62 | + | android:layout_marginEnd="8dp" | |
63 | + | android:layout_marginRight="8dp" | |
64 | + | android:padding="8dp" | |
65 | + | android:text="Description" | |
66 | + | app:layout_constraintEnd_toEndOf="parent" | |
67 | + | app:layout_constraintStart_toStartOf="parent" | |
68 | + | app:layout_constraintTop_toBottomOf="@+id/additional_info_view" /> | |
69 | + | ||
55 | 70 | <LinearLayout | |
56 | 71 | android:id="@+id/linearLayout3" | |
57 | 72 | android:layout_width="match_parent" | |
… | |||
63 | 78 | android:layout_marginRight="8dp" | |
64 | 79 | android:orientation="horizontal" | |
65 | 80 | app:layout_constraintEnd_toEndOf="parent" | |
81 | + | app:layout_constraintHorizontal_bias="0.0" | |
66 | 82 | app:layout_constraintStart_toStartOf="parent" | |
67 | - | app:layout_constraintTop_toBottomOf="@+id/additional_info_view"> | |
83 | + | app:layout_constraintTop_toBottomOf="@+id/extended_info_view"> | |
68 | 84 | ||
69 | 85 | <ProgressBar | |
70 | 86 | android:id="@+id/download_progress" | |
… | |||
101 | 117 | android:layout_margin="8dp" | |
102 | 118 | android:layout_marginTop="8dp" | |
103 | 119 | android:layout_marginBottom="8dp" | |
104 | - | android:layout_weight="1" | |
105 | - | android:text="TextView" /> | |
120 | + | android:layout_weight="1" /> | |
106 | 121 | ||
107 | 122 | <ImageButton | |
108 | 123 | android:id="@+id/remove_button" |