diff --git a/app/src/main/java/com/aurora/store/view/epoxy/controller/EditorChoiceController.kt b/app/src/main/java/com/aurora/store/view/epoxy/controller/EditorChoiceController.kt deleted file mode 100644 index 9dd885e97..000000000 --- a/app/src/main/java/com/aurora/store/view/epoxy/controller/EditorChoiceController.kt +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Aurora Store - * Copyright (C) 2021, Rahul Kumar Patel - * - * Aurora Store is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * Aurora Store is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Aurora Store. If not, see . - * - */ - -package com.aurora.store.view.epoxy.controller - -import com.airbnb.epoxy.TypedEpoxyController -import com.aurora.gplayapi.data.models.editor.EditorChoiceBundle -import com.aurora.gplayapi.data.models.editor.EditorChoiceCluster -import com.aurora.store.view.epoxy.groups.EditorChoiceModelGroup -import com.aurora.store.view.epoxy.views.HeaderViewModel_ - -class EditorChoiceController(private val callbacks: Callbacks) : - TypedEpoxyController>() { - - interface Callbacks { - fun onClick(editorChoiceCluster: EditorChoiceCluster) - } - - override fun buildModels(editorChoiceBundles: List) { - editorChoiceBundles.forEach { editorChoiceBundle -> - val idPrefix = editorChoiceBundle.id - - add( - HeaderViewModel_() - .id("header_${idPrefix}") - .title(editorChoiceBundle.bundleTitle) - ) - - editorChoiceBundle.bundleChoiceClusters.forEach { - add(EditorChoiceModelGroup(it, callbacks)) - } - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/aurora/store/view/epoxy/groups/EditorChoiceModelGroup.kt b/app/src/main/java/com/aurora/store/view/epoxy/groups/EditorChoiceModelGroup.kt deleted file mode 100644 index d69129eb0..000000000 --- a/app/src/main/java/com/aurora/store/view/epoxy/groups/EditorChoiceModelGroup.kt +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Aurora Store - * Copyright (C) 2021, Rahul Kumar Patel - * - * Aurora Store is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * Aurora Store is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Aurora Store. If not, see . - * - */ - -package com.aurora.store.view.epoxy.groups - -import com.airbnb.epoxy.EpoxyModel -import com.airbnb.epoxy.EpoxyModelGroup -import com.aurora.gplayapi.data.models.editor.EditorChoiceCluster -import com.aurora.store.R -import com.aurora.store.view.epoxy.controller.EditorChoiceController -import com.aurora.store.view.epoxy.views.EditorHeadViewModel_ -import com.aurora.store.view.epoxy.views.EditorImageViewModel_ - -class EditorChoiceModelGroup( - editorChoiceCluster: EditorChoiceCluster, - callbacks: EditorChoiceController.Callbacks -) : EpoxyModelGroup( - R.layout.model_editorchoice_group, - buildModels(editorChoiceCluster, callbacks) -) { - companion object { - private fun buildModels( - editorChoiceCluster: EditorChoiceCluster, - callbacks: EditorChoiceController.Callbacks - ): List> { - - val models = ArrayList>() - val clusterViewModels = mutableListOf>() - - val idPrefix = editorChoiceCluster.id - - - models.add( - EditorImageViewModel_() - .id("artwork_header_${idPrefix}") - .artwork(editorChoiceCluster.clusterArtwork[0]) - .click { _ -> callbacks.onClick(editorChoiceCluster) } - - ) - - models.add( - EditorHeadViewModel_() - .id("header_${idPrefix}") - .title(editorChoiceCluster.clusterTitle) - .click { _ -> callbacks.onClick(editorChoiceCluster) } - ) - - editorChoiceCluster.clusterArtwork - .drop(1) - .forEach { - clusterViewModels.add( - EditorImageViewModel_() - .id("artwork_${idPrefix}_${it.url}") - .artwork(it) - .click { _ -> callbacks.onClick(editorChoiceCluster) } - - ) - } - - models.add( - CarouselHorizontalModel_() - .id("cluster_${idPrefix}") - .models(clusterViewModels) - ) - - return models - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/aurora/store/view/epoxy/views/EditorHeadView.kt b/app/src/main/java/com/aurora/store/view/epoxy/views/EditorHeadView.kt deleted file mode 100644 index f8ebf8ba9..000000000 --- a/app/src/main/java/com/aurora/store/view/epoxy/views/EditorHeadView.kt +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Aurora Store - * Copyright (C) 2021, Rahul Kumar Patel - * - * Aurora Store is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * Aurora Store is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Aurora Store. If not, see . - * - */ - -package com.aurora.store.view.epoxy.views - -import android.content.Context -import android.util.AttributeSet -import com.airbnb.epoxy.CallbackProp -import com.airbnb.epoxy.ModelProp -import com.airbnb.epoxy.ModelView -import com.aurora.store.databinding.ViewEditorHeadBinding - -@ModelView( - autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT, - baseModelClass = BaseModel::class -) -class EditorHeadView @JvmOverloads constructor( - context: Context?, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : BaseView(context, attrs, defStyleAttr) { - - @CallbackProp - fun click(onClickListener: OnClickListener?) { - binding.root.setOnClickListener(onClickListener) - } - - @ModelProp - fun title(title: String) { - binding.title.text = title - } -} diff --git a/app/src/main/java/com/aurora/store/view/epoxy/views/EditorImageView.kt b/app/src/main/java/com/aurora/store/view/epoxy/views/EditorImageView.kt deleted file mode 100644 index 1620af6c1..000000000 --- a/app/src/main/java/com/aurora/store/view/epoxy/views/EditorImageView.kt +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Aurora Store - * Copyright (C) 2021, Rahul Kumar Patel - * - * Aurora Store is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * Aurora Store is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Aurora Store. If not, see . - * - */ - -package com.aurora.store.view.epoxy.views - -import android.content.Context -import android.util.AttributeSet -import coil3.load -import coil3.request.transformations -import coil3.transform.RoundedCornersTransformation -import com.airbnb.epoxy.CallbackProp -import com.airbnb.epoxy.ModelProp -import com.airbnb.epoxy.ModelView -import com.aurora.extensions.px -import com.aurora.gplayapi.data.models.Artwork -import com.aurora.store.databinding.ViewEditorImageBinding - -@ModelView( - autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT, - baseModelClass = BaseModel::class -) -class EditorImageView @JvmOverloads constructor( - context: Context?, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : BaseView(context, attrs, defStyleAttr) { - - @ModelProp - fun artwork(artwork: Artwork) { - when (artwork.type) { - 14 -> { - binding.img.layoutParams.height = 108.px.toInt() - binding.img.layoutParams.width = 192.px.toInt() - binding.img.requestLayout() - - binding.img.load(artwork.url) { - transformations(RoundedCornersTransformation(8.px.toFloat())) - } - } - - else -> { - binding.img.layoutParams.width = 24.px.toInt() - binding.img.layoutParams.height = 24.px.toInt() - binding.img.requestLayout() - binding.img.load(artwork.url) { - transformations(RoundedCornersTransformation(4.px.toFloat())) - } - } - } - } - - @CallbackProp - fun click(onClickListener: OnClickListener?) { - binding.root.setOnClickListener(onClickListener) - } -} diff --git a/app/src/main/res/layout/model_editorchoice_group.xml b/app/src/main/res/layout/model_editorchoice_group.xml deleted file mode 100644 index 050a013fa..000000000 --- a/app/src/main/res/layout/model_editorchoice_group.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/view_editor_head.xml b/app/src/main/res/layout/view_editor_head.xml deleted file mode 100644 index 4cd368025..000000000 --- a/app/src/main/res/layout/view_editor_head.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/view_editor_image.xml b/app/src/main/res/layout/view_editor_image.xml deleted file mode 100644 index cea3602c0..000000000 --- a/app/src/main/res/layout/view_editor_image.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - \ No newline at end of file