Skip to content

Commit ab63d96

Browse files
Merge remote-tracking branch 'origin/main'
2 parents a33d1f6 + 9f320b3 commit ab63d96

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

lite/src/main/java/com/pengxh/kt/lite/extensions/String.kt

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
package com.pengxh.kt.lite.extensions
22

33
import android.content.Context
4-
import android.graphics.Color
5-
import android.os.Build
6-
import android.widget.TextView
74
import android.widget.Toast
8-
import com.pengxh.kt.lite.R
95
import net.sourceforge.pinyin4j.PinyinHelper
106
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType
117
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat
@@ -219,21 +215,5 @@ fun String.writeToFile(file: File) {
219215
}
220216

221217
fun String.show(context: Context) {
222-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
223-
Toast.makeText(context, this, Toast.LENGTH_SHORT).show()
224-
} else {
225-
val toast = Toast(context)
226-
val textView = TextView(context)
227-
textView.setBackgroundResource(R.drawable.toast_bg_layout)
228-
textView.setTextColor(Color.WHITE)
229-
textView.textSize = 16f
230-
textView.text = this
231-
textView.setPadding(
232-
20.dp2px(context), 10.dp2px(context), 20.dp2px(context), 10.dp2px(context)
233-
)
234-
toast.view = textView
235-
toast.duration = Toast.LENGTH_SHORT
236-
toast.show()
237-
Toast.makeText(context, this, Toast.LENGTH_SHORT).show()
238-
}
218+
Toast.makeText(context, this, Toast.LENGTH_SHORT).show()
239219
}

lite/src/main/res/drawable/toast_bg_layout.xml

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

0 commit comments

Comments
 (0)