@@ -51,9 +51,9 @@ class NoteFragment : androidx.fragment.app.Fragment() {
5151 note = db.getNoteWithId(noteId) ? : return view
5252 retainInstance = true
5353
54- val layoutToInflate = if (context !! .config .enableLineWrap) R .layout.note_view_static else R .layout.note_view_horiz_scrollable
54+ val layoutToInflate = if (config !! .enableLineWrap) R .layout.note_view_static else R .layout.note_view_horiz_scrollable
5555 inflater.inflate(layoutToInflate, view.notes_relative_layout, true )
56- if (context !! .config .clickableLinks) {
56+ if (config !! .clickableLinks) {
5757 view.notes_view.apply {
5858 linksClickable = true
5959 autoLinkMask = Linkify .WEB_URLS or Linkify .EMAIL_ADDRESSES
@@ -72,7 +72,7 @@ class NoteFragment : androidx.fragment.app.Fragment() {
7272 override fun onResume () {
7373 super .onResume()
7474
75- val config = context !! .config
75+ val config = config !!
7676 view.notes_view.apply {
7777 typeface = if (config.monospacedFont) Typeface .MONOSPACE else Typeface .DEFAULT
7878
@@ -117,15 +117,15 @@ class NoteFragment : androidx.fragment.app.Fragment() {
117117
118118 override fun onPause () {
119119 super .onPause()
120- if (context !! .config .autosaveNotes) {
120+ if (config !! .autosaveNotes) {
121121 saveText(false )
122122 }
123123 view.notes_view.removeTextChangedListener(textWatcher)
124124 }
125125
126126 override fun setMenuVisibility (menuVisible : Boolean ) {
127127 super .setMenuVisibility(menuVisible)
128- if (! menuVisible && noteId != 0 && context?. config?.autosaveNotes == true ) {
128+ if (! menuVisible && noteId != 0 && config?.autosaveNotes == true ) {
129129 saveText(false )
130130 }
131131
@@ -192,7 +192,7 @@ class NoteFragment : androidx.fragment.app.Fragment() {
192192 fun getCurrentNoteViewText () = view.notes_view?.text?.toString()
193193
194194 @SuppressLint(" RtlHardcoded" )
195- private fun getTextGravity () = when (context !! .config .gravity) {
195+ private fun getTextGravity () = when (config !! .gravity) {
196196 GRAVITY_CENTER -> Gravity .CENTER_HORIZONTAL
197197 GRAVITY_RIGHT -> Gravity .RIGHT
198198 else -> Gravity .LEFT
0 commit comments