package Ġcom . st yling android . connectivity . ui Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . lifecycle . Transform ations Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠMainActivity ViewModel Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġnetwork Capabilities LiveData : ĠNetwork Capabilities LiveData Ċ ) Ġ: ĠViewModel () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġmapper Ġ= ĠNetwork Capabilities Mapper () ĊĊĠĠĠ Ġval Ġconnection State : ĠLive Data < Connection State > Ġ= ĊĠĠĠĠĠĠĠ ĠTransform ations . map ( network Capabilities LiveData ) Ġ{ Ġcapabilities Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmapper . map ( capabilities ) ĊĠĠĠĠĠĠĠ Ġ} Ċ } Ċ