Skip to content

Commit

Permalink
Athena: Drop cached info
Browse files Browse the repository at this point in the history
Change-Id: Iea9556e6207f3ecec1142126206f48e1298577cf
  • Loading branch information
SebaUbuntu committed Jul 31, 2023
1 parent 031b9b3 commit 0959532
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions app/src/main/java/dev/sebaubuntu/athena/sections/Section.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ abstract class Section {

abstract fun getInfo(context: Context): Map<String, Map<String, String>>

private var cachedInfo: Map<String, Map<String, String>>? = null
fun getCachedInfo(context: Context) = cachedInfo ?: run {
getInfo(context)
}.also {
cachedInfo = it
}

companion object {
enum class SectionEnum(val clazz: Section) {
DEVICE(DeviceSection),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SectionFragment : Fragment(R.layout.fragment_section) {
private fun loadContent() {
linearLayout.removeAllViews()

for ((section, sectionInfo) in section.getCachedInfo(requireContext())) {
for ((section, sectionInfo) in section.getInfo(requireContext())) {
linearLayout.addView(
getSectionTitle(section),
LinearLayout.LayoutParams(
Expand Down

0 comments on commit 0959532

Please sign in to comment.