/* Ċ Ġ* ĠCopyright ĠÂ© Ġ 2 0 2 1 ĠBy ĠG eek s ĠEmp ire . Ċ Ġ* Ċ Ġ* ĠCreated Ġby ĠE li as ĠF azel Ċ Ġ* ĠLast Ġmodified Ġ 4 / 1 2 / 2 1 Ġ 8 : 5 0 ĠAM Ċ Ġ* Ċ Ġ* ĠLicensed ĠUnder ĠMIT ĠLicense . Ċ Ġ* Ġhttps :// opensource . org / licenses / MIT Ċ Ġ*/ Ċ Ċ package Ġnet . ge ek semp ire . ready . keep . notes . Notes . T aking . Extensions Ċ Ċ import Ġandroid . text . Html Ċ import Ġnet . ge ek semp ire . ready . keep . notes . Notes . T aking . Take Note Ċ import Ġnet . ge ek semp ire . ready . keep . notes . Notes . Tools . Paint ing . Extensions . change Paint ing Path Stroke Width Ċ import Ġnet . ge ek semp ire . ready . keep . notes . Notes . Tools . Paint ing . New Paint ing Data Ċ import Ġjava . math . Round ingMode Ċ import Ġjava . text . Decimal Format Ċ Ċ /** Ċ Ġ* ĠLine ĠSt roke ĠWidth ĠCh anger Ċ Ġ**/ Ċ fun ĠTake Note . paint ing Actions Stroke Width Sample () Ġ{ ĊĊĠĠĠ Ġval Ġfluid Slider Minimum Ġ= Ġ 3 . 0 . toFloat () ĊĠĠĠ Ġval Ġfluid Slide Maximum Ġ= Ġ 7 1 . 0 . toFloat () ĊĠĠĠ Ġval Ġtotal Fluid Slider Amount Ġ= Ġ( fluid Slide Maximum Ġ- Ġfluid Slider Minimum ) ĊĊĠĠĠ Ġtake Note Layout Binding . color Palette Include . stroke Width Fluid Slider . position Listener Ġ= Ġ{ Ġfluid Slider Position Ġ-> ĊĊĠĠĠĠĠĠĠ Ġval Ġdecimal Format Ġ= ĠDecimal Format ("# . ## ") ĊĠĠĠĠĠĠĠ Ġdecimal Format . rounding Mode Ġ= ĠRound ingMode . HALF _ E VEN ĊĊĠĠĠĠĠĠĠ Ġval Ġselected Stroke Width Ġ= Ġdecimal Format . format (( fluid Slider Minimum Ġ+ Ġ( total Fluid Slider Amount Ġ Ġ* Ġfluid Slider Position ))). toFloat () ĊĊĠĠĠĠĠĠĠ Ġtake Note Layout Binding . color Palette Include . stroke Width Fluid Slider . bubble Text Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ ĠHtml . from Html ("< small >${ selected Stroke Width . toString () }</ small >", ĠHtml . FROM _ HTML _ MODE _ COMP ACT ). toString () ĊĊĠĠĠĠĠĠĠ Ġif Ġ( input Recognizer . stylus Detected ) Ġ{ ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġpaint ing Canvas View . change Paint ing Path Stroke Width ( New Paint ing Data ( paint Color Ġ= Ġpaint ing Canvas View . stylus Paint ing Data . paint Color , Ġpaint Stroke Width Ġ= Ġselected Stroke Width , Ġpaint Stroke Slider Position Ġ= Ġfluid Slider Position )) ĊĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġpaint ing Canvas View . change Paint ing Path Stroke Width ( New Paint ing Data ( paint Color Ġ= Ġpaint ing Canvas View . f inger Paint ing Data . paint Color , Ġpaint Stroke Width Ġ= Ġselected Stroke Width , Ġpaint Stroke Slider Position Ġ= Ġfluid Slider Position )) ĊĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġstroke Paint ing Canvas View . change Paint ing Path Stroke Width ( New Paint ing Data ( paint Color Ġ= Ġstroke Paint ing Canvas View . new Paint ing Data . paint Color , Ġpaint Stroke Width Ġ= Ġselected Stroke Width , Ġpaint Stroke Slider Position Ġ= Ġfluid Slider Position )) ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġtake Note Layout Binding . color Palette Include . stroke Width Fluid Slider . position Ġ= Ġpaint ing Canvas View . new Paint ing Data . paint Stroke Slider Position ĊĊĠĠĠ Ġtake Note Layout Binding . color Palette Include . stroke Width Fluid Slider . begin Tracking Listener Ġ= Ġ{ ĊĊĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġtake Note Layout Binding . color Palette Include . stroke Width Fluid Slider . end Tracking Listener Ġ= Ġ{ ĊĊĠĠĠĠĠĠĠ Ġstroke Paint ing Canvas View . removeAll Paint s () ĊĊĊĠĠĠ Ġ} Ċ Ċ }