package Ġcom . mars . co . lift metrics . util ty Ċ Ċ import Ġandroid . app . AlertDialog Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Intent Ċ import Ġandroid . graphics . Color Ċ import Ġandroid . graphics . Paint Ċ import Ġandroid . net . Uri Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġcom . mars . co . lift metrics . R Ċ import Ġcom . mars . co . lift metrics . databinding . Exercise Detail Dialog Binding ĊĊ Ċ // ĠUser Ġfor Ġdialog Ġthat Ġcan Ġbe Ġused Ġfor Ġmore Ġthe Ġinstance Ċ class ĠDialog Util ( private Ġval Ġcontext : ĠContext ) Ġ{ ĊĊĠĠĠ Ġfun Ġshow Exercise Details Dialog ( ĊĠĠĠĠĠĠĠ Ġexercise Formatter : ĠExercise Formatter ĊĠĠĠ Ġ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġbinding Ġ= ĠExercise Detail Dialog Binding . inflate ( LayoutInflater . from ( context )) ĊĠĠĠĠĠĠĠ Ġval Ġbuilder Ġ= ĠAlertDialog . Builder ( context ) ĊĠĠĠĠĠĠĠ Ġbuilder . setView ( binding . root ) ĊĠĠĠĠĠĠĠ Ġbinding . exercise Description . text Ġ= Ġexercise Formatter . description ĊĠĠĠĠĠĠĠ Ġif ( exercise Formatter . video Link Ġ== Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbinding . exercise Video . visibility Ġ= ĠView . GONE ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġbinding . exercise Video . text Ġ= Ġcontext . getString ( R . string . video ) ĊĠĠĠĠĠĠĠ Ġbinding . exercise Video . setTextColor ( Color . BLUE ) ĊĠĠĠĠĠĠĠ Ġbinding . exercise Video . paint Flags Ġ= ĠPaint . UNDER LINE _ TEXT _ FLAG ĊĠĠĠĠĠĠĠ Ġbinding . exercise Video . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġbrowser Intent Ġ= ĠIntent ( Intent . ACTION _ VIEW , ĠUri . parse ( exercise Formatter . video Link )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontext . startActivity ( browser Intent ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġbuilder . show () ĊĠĠĠ Ġ} Ċ }