Skip to content

Commit b39f1f6

Browse files
committed
Fix missing appcompat tooltipText
1 parent 7895e1e commit b39f1f6

File tree

5 files changed

+4
-13
lines changed

5 files changed

+4
-13
lines changed

mobile/src/main/java/com/github/shadowsocks/widget/StatsBar.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
package com.github.shadowsocks.widget
2222

2323
import android.content.Context
24-
import android.os.Build
2524
import android.text.format.Formatter
2625
import android.util.AttributeSet
2726
import android.view.View
2827
import android.widget.TextView
28+
import androidx.appcompat.widget.TooltipCompat
2929
import androidx.coordinatorlayout.widget.CoordinatorLayout
3030
import androidx.fragment.app.FragmentActivity
3131
import androidx.lifecycle.Observer
@@ -73,7 +73,7 @@ class StatsBar @JvmOverloads constructor(context: Context, attrs: AttributeSet?
7373

7474
private fun setStatus(text: CharSequence) {
7575
statusText.text = text
76-
if (Build.VERSION.SDK_INT >= 26) tooltipText = text
76+
TooltipCompat.setTooltipText(this, text)
7777
}
7878

7979
fun changeState(state: BaseService.State) {

mobile/src/main/res/layout/layout_apps.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
android:layout_weight="1"
7777
android:text="@string/bypass_apps"
7878
tools:checked="true"
79-
android:tooltipText="@string/bypass_apps_summary" />
79+
app:tooltipText="@string/bypass_apps_summary" />
8080
</RadioGroup>
8181

8282
</androidx.constraintlayout.widget.ConstraintLayout>

mobile/src/main/res/layout/layout_main.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
android:layout_row="2"
115115
android:layout_column="0"
116116
android:layout_columnSpan="3"
117-
style="@style/stats_status"
117+
android:ellipsize="end"
118118
tools:text="@string/connection_test_available"/>
119119

120120
</GridLayout>

mobile/src/main/res/values-v26/styles.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

mobile/src/main/res/values/styles.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,4 @@
33
<style name="Theme.Shadowsocks.Immersive.Navigation">
44
<item name="android:statusBarColor">@android:color/transparent</item>
55
</style>
6-
<style name="stats_status">
7-
<item name="android:ellipsize">marquee</item>
8-
</style>
96
</resources>

0 commit comments

Comments
 (0)