Category : kotlin

I am making a game via libgdx for android phone. When I add explosion annimations in the game, after 10 munits later the game is stretching and I am getting this error messages which is below. After 20 munits the game crash and I am getting another error messages in android studio. What is this. ..

Read more

In some situations, when a View changes its position, It’s just hiding from its old position and visible in the new position. But I want to change their position using animation to translate from its old position to a new position. For example, I have a Linear layout with 10 buttons. By clicking a button ..

Read more

What I’m trying to do is to: set switchButton "switchTranslationDirection" to the respective position on opening the Fragment; to make it make respective changes in the dataStore Noew everytime I open the Fragment, the switchButton is always turned Off In the Fragment: @AndroidEntryPoint class SettingsFragment : Fragment(R.layout.settings_layout) { private val viewModel: SettingsViewModel by viewModels() override ..

Read more

I want to format a time display to conform to both the current Locale, and the device user’s 24-hour clock preference. Here is what I’m currently doing, but I’m wondering if there’s a better way. val time = ZonedDateTime.now() val formatter = when (DateFormat.is24HourFormat(context)) { true -> DateTimeFormatter.ofPattern("HH:mm", Locale.getDefault()) false -> DateTimeFormatter.ofPattern("h:mm a", Locale.getDefault()) } ..

Read more

Please Help. Im following tutorial on youtube (channel: coding in flow). Its about making a todo app in kotlin using android studio, and i got stuck on this: taskDao.update(task.copy(completed = isChecked)) Error: Unresolved reference copy. Tryed a lot of things but didnt help. Source: Android..

Read more