social-aggregator/app/src/main/java/pl/edu/amu/wmi/socialaggregator/utils/SocialPlatformsManager.kt

23 lines
707 B
Kotlin

package pl.edu.amu.wmi.socialaggregator.utils
import android.content.Context
import pl.edu.amu.wmi.socialaggregator.socialplatforms.Facebook
import pl.edu.amu.wmi.socialaggregator.socialplatforms.Snapchat
import pl.edu.amu.wmi.socialaggregator.socialplatforms.SocialPlatform
object SocialPlatformsManager {
private val IMPLEMENTED_PLATFORMS = listOf(
// FacebookMock()
Facebook(),
Snapchat()
)
fun getAll() = IMPLEMENTED_PLATFORMS
fun getLoggedIn(context: Context) =
IMPLEMENTED_PLATFORMS.filter { it.isLoggedIn(context) }.toMutableList()
fun getNotLoggedIn(context: Context) =
(IMPLEMENTED_PLATFORMS - getLoggedIn(context)).toMutableList()
}