@@ -45,13 +45,13 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener, Breadcrum
4545
4646 private lateinit var mView: View
4747
48- override fun onCreateView (inflater : LayoutInflater ? , container : ViewGroup ? , savedInstanceState : Bundle ? ): View {
49- mView = inflater!! .inflate(R .layout.items_fragment, container, false )!!
48+ override fun onCreateView (inflater : LayoutInflater , container : ViewGroup ? , savedInstanceState : Bundle ? ): View {
49+ mView = inflater.inflate(R .layout.items_fragment, container, false )!!
5050 storeConfigVariables()
5151 return mView
5252 }
5353
54- override fun onViewCreated (view : View ? , savedInstanceState : Bundle ? ) {
54+ override fun onViewCreated (view : View , savedInstanceState : Bundle ? ) {
5555 super .onViewCreated(view, savedInstanceState)
5656 mView.apply {
5757 items_swipe_refresh.setOnRefreshListener({ refreshItems() })
@@ -62,9 +62,9 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener, Breadcrum
6262
6363 override fun onResume () {
6464 super .onResume()
65- context.updateTextColors(mView as ViewGroup )
65+ context!! .updateTextColors(mView as ViewGroup )
6666 mView.items_fastscroller.updateHandleColor()
67- val newColor = context.config.textColor
67+ val newColor = context!! .config.textColor
6868 if (storedTextColor != newColor) {
6969 storedItems = ArrayList ()
7070 (items_list.adapter as ItemsAdapter ).updateTextColor(newColor)
@@ -81,7 +81,7 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener, Breadcrum
8181 }
8282
8383 private fun storeConfigVariables () {
84- storedTextColor = context.config.textColor
84+ storedTextColor = context!! .config.textColor
8585 }
8686
8787 fun openPath (path : String ) {
@@ -95,14 +95,14 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener, Breadcrum
9595
9696 scrollStates.put(currentPath, getScrollState())
9797 currentPath = realPath
98- showHidden = context.config.shouldShowHidden
98+ showHidden = context!! .config.shouldShowHidden
9999 getItems(currentPath) {
100100 if (! isAdded)
101101 return @getItems
102102
103- FileDirItem .sorting = context.config.getFolderSorting(currentPath)
103+ FileDirItem .sorting = context!! .config.getFolderSorting(currentPath)
104104 it.sort()
105- activity.runOnUiThread {
105+ activity!! .runOnUiThread {
106106 addItems(it)
107107 }
108108 }
@@ -176,7 +176,7 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener, Breadcrum
176176
177177 private fun getItems (path : String , callback : (items: ArrayList <FileDirItem >) -> Unit ) {
178178 Thread ({
179- if (! context.config.enableRootAccess || ! context.isPathOnRoot(path)) {
179+ if (! context!! .config.enableRootAccess || ! context!! .isPathOnRoot(path)) {
180180 getRegularItemsOf(path, callback)
181181 } else {
182182 RootHelpers ().getFiles(activity as SimpleActivity , path, callback)
@@ -225,7 +225,7 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener, Breadcrum
225225 (activity as MainActivity ).pickedPath(path)
226226 } else {
227227 val file = File (path)
228- activity.openFile(Uri .fromFile(file), false )
228+ activity!! .openFile(Uri .fromFile(file), false )
229229 }
230230 }
231231 }
@@ -240,7 +240,7 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener, Breadcrum
240240
241241 override fun breadcrumbClicked (id : Int ) {
242242 if (id == 0 ) {
243- StoragePickerDialog (activity, currentPath) {
243+ StoragePickerDialog (activity!! , currentPath) {
244244 openPath(it)
245245 }
246246 } else {
@@ -255,15 +255,15 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener, Breadcrum
255255
256256 override fun deleteFiles (files : ArrayList <File >) {
257257 val hasFolder = files.any { it.isDirectory }
258- if (context.isPathOnRoot(files.firstOrNull()?.absolutePath ? : context.config.internalStoragePath)) {
258+ if (context!! .isPathOnRoot(files.firstOrNull()?.absolutePath ? : context!! .config.internalStoragePath)) {
259259 files.forEach {
260260 RootTools .deleteFileOrDirectory(it.path, false )
261261 }
262262 } else {
263263 (activity as SimpleActivity ).deleteFiles(files, hasFolder) {
264264 if (! it) {
265- activity.runOnUiThread {
266- activity.toast(R .string.unknown_error_occurred)
265+ activity!! .runOnUiThread {
266+ activity!! .toast(R .string.unknown_error_occurred)
267267 }
268268 }
269269 }
0 commit comments