-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: I2932d5110fa5fbb63c984b288ed4fe66801d8d9c
- Loading branch information
1 parent
183e45e
commit 86e6c4d
Showing
8 changed files
with
117 additions
and
1 deletion.
There are no files selected for viewing
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
17 changes: 17 additions & 0 deletions
17
app/src/main/java/org/lineageos/twelve/models/ActivityTab.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,17 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 The LineageOS Project | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.lineageos.twelve.models | ||
|
||
data class ActivityTab( | ||
val id: String, | ||
val title: LocalizedString, | ||
val items: List<MediaItem<*>>, | ||
) : UniqueItem<ActivityTab> { | ||
override fun areItemsTheSame(other: ActivityTab) = id == other.id | ||
|
||
override fun areContentsTheSame(other: ActivityTab) = | ||
title == other.title && items.toTypedArray().contentEquals(other.items.toTypedArray()) | ||
} |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/org/lineageos/twelve/models/LocalizedString.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,23 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 The LineageOS Project | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.lineageos.twelve.models | ||
|
||
import android.content.Context | ||
import androidx.annotation.StringRes | ||
|
||
data class LocalizedString( | ||
val value: String, | ||
@StringRes val stringResId: Int? = null, | ||
val stringResIdArgs: List<Any>? = null, | ||
) { | ||
override fun toString() = value | ||
|
||
fun getString(context: Context) = stringResId?.let { stringResId -> | ||
stringResIdArgs?.let { stringResIdArgs -> | ||
context.getString(stringResId, *stringResIdArgs.toTypedArray()) | ||
} ?: context.getString(stringResId) | ||
} ?: value | ||
} |
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