@@ -192,6 +192,7 @@ class NekoLandFragment : Fragment(), PrefsListener {
192
192
bottomsheet!! .dismissWithAnimation = true
193
193
val bottomSheetInternal: View ? = bottomsheet!! .findViewById(com.google.android.material.R .id.design_bottom_sheet)
194
194
BottomSheetBehavior .from(bottomSheetInternal!! ).peekHeight = resources.getDimensionPixelSize(R .dimen.bottomsheet)
195
+ BottomSheetBehavior .from(bottomSheetInternal).state = BottomSheetBehavior .STATE_HALF_EXPANDED
195
196
icon = cat.createIconBitmap(iconSize!! , iconSize!! , mPrefs!! .getIconBackground()).toDrawable(resources)
196
197
textLayout = bottomSheetInternal.findViewById(R .id.catNameField)
197
198
catEditor = bottomSheetInternal.findViewById(R .id.catEditName)
@@ -211,6 +212,7 @@ class NekoLandFragment : Fragment(), PrefsListener {
211
212
catEditor!! .setText(cat.name)
212
213
} catch (e: ClassCastException ) {
213
214
mood!! .text = getString(R .string.error)
215
+ mPrefs!! .removeMood(cat)
214
216
mPrefs!! .setMood(cat, 3 )
215
217
}
216
218
catImage?.setImageDrawable(icon)
@@ -233,7 +235,7 @@ class NekoLandFragment : Fragment(), PrefsListener {
233
235
.setMessage(R .string.name_changed)
234
236
.setNegativeButton(android.R .string.ok, null )
235
237
.show()
236
- cat.name = catEditor!! .getText() .toString().trim { it <= ' ' }
238
+ cat.name = catEditor!! .text .toString().trim { it <= ' ' }
237
239
bottomsheet = null
238
240
mPrefs!! .addCat(cat)
239
241
}
@@ -259,8 +261,8 @@ class NekoLandFragment : Fragment(), PrefsListener {
259
261
val item1 = v.findViewById<MaterialCardView >(R .id.luckyBooster)
260
262
counter0.text = getString(R .string.booster_items, mPrefs!! .moodBoosters)
261
263
counter1.text = getString(R .string.booster_items, mPrefs!! .luckyBoosters)
262
- item0.setEnabled( mPrefs!! .moodBoosters != 0 )
263
- item1.setEnabled( mPrefs!! .luckyBoosters != 0 )
264
+ item0.isEnabled = mPrefs!! .moodBoosters != 0
265
+ item1.isEnabled = mPrefs!! .luckyBoosters != 0
264
266
dialog.setCancelable(true )
265
267
dialog.setNegativeButton(android.R .string.cancel, null )
266
268
val alertd = dialog.create()
@@ -469,12 +471,12 @@ class NekoLandFragment : Fragment(), PrefsListener {
469
471
470
472
private fun updateCatActions (cat : Cat , wash : View , caress : View , touch : View , actionsLimit : View ) {
471
473
if (mPrefs!! .isCanInteract(cat) <= 0 ) {
472
- wash.setEnabled( false )
473
- wash.setAlpha( 0.5f )
474
- caress.setEnabled( false )
475
- caress.setAlpha( 0.5f )
476
- touch.setEnabled( false )
477
- touch.setAlpha( 0.5f )
474
+ wash.isEnabled = false
475
+ wash.alpha = 0.5f
476
+ caress.isEnabled = false
477
+ caress.alpha = 0.5f
478
+ touch.isEnabled = false
479
+ touch.alpha = 0.5f
478
480
actionsLimit.visibility = View .VISIBLE
479
481
}
480
482
}
@@ -508,7 +510,7 @@ class NekoLandFragment : Fragment(), PrefsListener {
508
510
}
509
511
510
512
private fun showCatFull (cat : Cat ) {
511
- val context: Context = if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .M ) ContextThemeWrapper (context, requireActivity().getTheme() ) else requireActivity()
513
+ val context: Context = if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .M ) ContextThemeWrapper (context, requireActivity().theme ) else requireActivity()
512
514
val view = LayoutInflater .from(context).inflate(R .layout.cat_fullscreen_view, null )
513
515
val ico = view.findViewById<ImageView >(R .id.cat_ico)
514
516
ico.setImageBitmap(cat.createIconBitmap(EXPORT_BITMAP_SIZE , EXPORT_BITMAP_SIZE , 0 ))
0 commit comments