Skip to content

Commit

Permalink
***2022/09/24***
Browse files Browse the repository at this point in the history
* font file
  • Loading branch information
Jack251970 committed Sep 24, 2022
1 parent eb7f595 commit 02a6b8b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
10 changes: 5 additions & 5 deletions app/src/main/java/com/jack/bookshelf/utils/Toasts.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fun toast(context: Context?, msg: String?, length: Int) {
if (toast == null) {
toast = Toast(context)
}
(view.findViewById<View>(R.id.mpp_tv_toast) as TextView).text = msg
(view.findViewById<View>(R.id.tv_toast) as TextView).text = msg
toast!!.view = view
toast!!.duration = length
toast?.show()
Expand All @@ -41,7 +41,7 @@ fun Context.toastOnUi(message: Int) {
if (toast == null) {
toast = Toast(this)
}
(view.findViewById<View>(R.id.mpp_tv_toast) as TextView).text = StringUtils.getString(message)
(view.findViewById<View>(R.id.tv_toast) as TextView).text = StringUtils.getString(message)
toast!!.view = view
toast!!.duration = Toast.LENGTH_SHORT
toast?.show()
Expand All @@ -54,7 +54,7 @@ fun Context.toastOnUi(message: CharSequence?) {
if (toast == null) {
toast = Toast(this)
}
(view.findViewById<View>(R.id.mpp_tv_toast) as TextView).text = message
(view.findViewById<View>(R.id.tv_toast) as TextView).text = message
toast!!.view = view
toast!!.duration = Toast.LENGTH_SHORT
toast?.show()
Expand All @@ -67,7 +67,7 @@ fun Context.longToastOnUi(message: Int) {
if (toast == null) {
toast = Toast(this)
}
(view.findViewById<View>(R.id.mpp_tv_toast) as TextView).text = StringUtils.getString(message)
(view.findViewById<View>(R.id.tv_toast) as TextView).text = StringUtils.getString(message)
toast!!.view = view
toast!!.duration = Toast.LENGTH_LONG
toast?.show()
Expand All @@ -79,7 +79,7 @@ fun Context.longToastOnUi(message: CharSequence?) {
if (toast == null) {
val view: View = inflater.inflate(R.layout.dialog_toast, null)
toast = Toast(this)
(view.findViewById<View>(R.id.mpp_tv_toast) as TextView).text = message
(view.findViewById<View>(R.id.tv_toast) as TextView).text = message
toast!!.view = view
toast!!.duration = Toast.LENGTH_LONG
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ public View getView(final int position, View convertView, ViewGroup parent) {
if (convertView == null) {
holder = new ViewHolder();
convertView = LayoutInflater.from(mContext).inflate(R.layout.item_select_menu, null);
holder.tv_name_select_menu_item = convertView.findViewById(R.id.mpp_tv_name_select_menu_item);
holder.iv_indicator_select_menu_item = convertView.findViewById(R.id.mpp_iv_indicator_select_menu_item);
holder.tv_name_select_menu_item = convertView.findViewById(R.id.tv_name_select_menu_item);
holder.iv_indicator_select_menu_item = convertView.findViewById(R.id.iv_indicator_select_menu_item);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/layout/dialog_toast.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!--suppress ALL -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_toast_background"
android:orientation="vertical">
<TextView
android:id="@+id/mpp_tv_toast"
android:id="@+id/tv_toast"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="12dp"
Expand Down

0 comments on commit 02a6b8b

Please sign in to comment.