Remove legacy code
This commit is contained in:
parent
cbf62e881e
commit
8f06ad5466
@ -1,41 +0,0 @@
|
|||||||
package de.mm20.launcher2.ui.legacy.component
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.util.AttributeSet
|
|
||||||
import android.view.LayoutInflater
|
|
||||||
import android.view.View
|
|
||||||
import android.widget.LinearLayout
|
|
||||||
import de.mm20.launcher2.favorites.FavoritesItem
|
|
||||||
import de.mm20.launcher2.icons.IconRepository
|
|
||||||
import de.mm20.launcher2.ktx.dp
|
|
||||||
import de.mm20.launcher2.ktx.lifecycleScope
|
|
||||||
import de.mm20.launcher2.ui.databinding.EditFavoritesRowBinding
|
|
||||||
import kotlinx.coroutines.flow.collectLatest
|
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import org.koin.core.component.KoinComponent
|
|
||||||
import org.koin.core.component.inject
|
|
||||||
|
|
||||||
class EditFavoritesRow @JvmOverloads constructor(
|
|
||||||
context: Context,
|
|
||||||
attrs: AttributeSet? = null,
|
|
||||||
defStyleAttr: Int = 0,
|
|
||||||
val favoritesItem: FavoritesItem
|
|
||||||
) : LinearLayout(context, attrs, defStyleAttr), KoinComponent {
|
|
||||||
|
|
||||||
val iconRepository: IconRepository by inject()
|
|
||||||
|
|
||||||
private val binding = EditFavoritesRowBinding.inflate(LayoutInflater.from(context), this, true)
|
|
||||||
|
|
||||||
init {
|
|
||||||
binding.label.text = favoritesItem.searchable?.label
|
|
||||||
lifecycleScope.launch {
|
|
||||||
iconRepository.getIcon(favoritesItem.searchable!!, (48 * dp).toInt()).collectLatest {
|
|
||||||
binding.icon.icon = it
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getDragHandle(): View {
|
|
||||||
return binding.dragHandle
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
package de.mm20.launcher2.ui.legacy.view
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.util.AttributeSet
|
|
||||||
import android.view.View
|
|
||||||
import de.mm20.launcher2.icons.LauncherIcon
|
|
||||||
import org.koin.core.component.KoinComponent
|
|
||||||
|
|
||||||
class LauncherIconView : View, KoinComponent {
|
|
||||||
constructor(context: Context) : super(context)
|
|
||||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
|
||||||
constructor(context: Context, attrs: AttributeSet?, defStyleRes: Int) : super(
|
|
||||||
context,
|
|
||||||
attrs,
|
|
||||||
defStyleRes
|
|
||||||
)
|
|
||||||
|
|
||||||
var icon: LauncherIcon? = null
|
|
||||||
set(value) {
|
|
||||||
field = value
|
|
||||||
invalidate()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user