-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CardPresenterSelectorは使っていないので削除
- Loading branch information
daigorian
committed
Sep 25, 2021
1 parent
83e60f0
commit 4e23f86
Showing
8 changed files
with
62 additions
and
33 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
app/src/main/java/com/daigorian/epcltvapp/DeleteEnabledArrayObjectAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.daigorian.epcltvapp | ||
|
||
import androidx.leanback.widget.ArrayObjectAdapter | ||
import androidx.leanback.widget.ListRow | ||
import androidx.leanback.widget.Presenter | ||
import androidx.leanback.widget.PresenterSelector | ||
import kotlin.reflect.typeOf | ||
|
||
open class DeleteEnabledArrayObjectAdapter : ArrayObjectAdapter { | ||
constructor(presenterSelector: PresenterSelector?) : super(presenterSelector) | ||
constructor(presenter: Presenter?) : super(presenter) | ||
|
||
fun removeItemFromAllListRows(item:Any){ | ||
var verticalIndex = 0 | ||
while(verticalIndex < size()){ | ||
val row = get(verticalIndex) | ||
if(row is ListRow){ | ||
val horizontalArrayObjectAdapter = row.adapter as? ArrayObjectAdapter | ||
horizontalArrayObjectAdapter?.let{ | ||
var horizontalIndex = 0 | ||
while(horizontalIndex < it.size()) { | ||
if(it.get(horizontalIndex).equals(item) ){ | ||
it.removeItems(horizontalIndex,1) | ||
} | ||
horizontalIndex += 1 | ||
} | ||
} | ||
|
||
} | ||
verticalIndex += 1 | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
app/src/main/java/com/daigorian/epcltvapp/presenter/CardPresenterSelector.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters