File tree Expand file tree Collapse file tree
codeview/src/main/java/io/github/kbiakov/codeview Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ class CodeView : RelativeLayout {
121121 */
122122 var adapter: AbstractCodeAdapter <* >?
123123 get() {
124- return rvCodeContent.adapter as AbstractCodeAdapter <* >
124+ return rvCodeContent.adapter as ? AbstractCodeAdapter <* >
125125 }
126126 set(adapter) {
127127 rvCodeContent.adapter = adapter
@@ -172,18 +172,16 @@ class CodeView : RelativeLayout {
172172 // default color theme provided by enum
173173 fun colorTheme (colorTheme : ColorTheme ): CodeView {
174174 this .colorTheme = colorTheme.with ()
175- if (rvCodeContent.adapter != null ) {
176- adapter?.colorTheme = this .colorTheme
177- }
175+ adapter?.colorTheme = this .colorTheme
176+
178177 return this
179178 }
180179
181180 // custom color theme provided by user
182181 fun colorTheme (colorTheme : ColorThemeData ): CodeView {
183182 this .colorTheme = colorTheme
184- if (rvCodeContent.adapter != null ) {
185- adapter?.colorTheme = this .colorTheme
186- }
183+ adapter?.colorTheme = this .colorTheme
184+
187185 return this
188186 }
189187
You can’t perform that action at this time.
0 commit comments