Skip to content

Commit 230f8cf

Browse files
committed
修复了华为设备小部件不显示教室的BUG
1 parent ac6daab commit 230f8cf

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

app/src/main/java/org/shirakawatyu/swust/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public void onPageFinished(WebView view, String url) {
139139

140140
public void setData() {
141141
// 设置版本号
142-
webView.evaluateJavascript("window.localStorage.setItem('version', '0.32')", value -> {});
142+
webView.evaluateJavascript("window.localStorage.setItem('version', '0.33')", value -> {});
143143
// 从本地缓存读取课程表
144144
webView.evaluateJavascript("window.localStorage.getItem('lessons')", value -> {
145145
// Toast.makeText(mContext, value, Toast.LENGTH_SHORT).show();

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,16 @@
2626
android:layout_width="0dp"
2727
android:layout_height="match_parent"
2828
android:layout_weight="5"
29-
android:orientation="vertical"
30-
android:paddingBottom="10dp">
29+
android:orientation="vertical">
3130

3231
<TextView
3332
android:id="@+id/course_name"
3433
android:layout_width="match_parent"
3534
android:layout_height="0dp"
36-
android:layout_weight="2"
35+
android:layout_weight="1"
36+
android:ellipsize="end"
3737
android:gravity="center_vertical"
38+
android:maxLines="1"
3839
android:text="计算机组成原理"
3940
android:textColor="#000000"
4041
android:textSize="16sp" />
@@ -44,7 +45,11 @@
4445
android:layout_width="match_parent"
4546
android:layout_height="0dp"
4647
android:layout_weight="1"
47-
android:text="东1202" />
48+
android:ellipsize="end"
49+
android:maxLines="1"
50+
android:text="东1202"
51+
android:textColor="#616161"
52+
android:textSize="14dp" />
4853
</LinearLayout>
4954
</LinearLayout>
5055
</LinearLayout>

0 commit comments

Comments
 (0)