2018-11-30 13:54:39 +01:00
/ * *
* ProjectLaogai
*
2020-01-15 15:00:05 +01:00
* Copyright 2019 - 2020 < seil0 @mosad . xyz >
2018-11-30 13:54:39 +01:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 51 Franklin Street , Fifth Floor , Boston ,
* MA 02110 - 1301 , USA .
*
* /
2018-11-19 12:00:39 +01:00
package org.mosad.seil0.projectlaogai.fragments
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
2018-11-30 13:54:39 +01:00
import android.webkit.WebSettings
import android.webkit.WebView
2018-11-19 12:00:39 +01:00
import org.mosad.seil0.projectlaogai.R
2018-11-30 13:54:39 +01:00
import android.webkit.WebViewClient
2018-11-19 12:00:39 +01:00
/ * *
* The moodle screen controller class
* contains all needed parts to display and the moodle screen
* /
class MoodleFragment : Fragment ( ) {
2018-11-30 13:54:39 +01:00
private lateinit var webView : WebView
private lateinit var webSettings : WebSettings
2018-11-19 12:00:39 +01:00
override fun onCreateView ( inflater : LayoutInflater , container : ViewGroup ? , savedInstanceState : Bundle ? ) : View ? {
2018-11-30 13:54:39 +01:00
val view : View = inflater . inflate ( R . layout . fragment _moodle , container , false )
2018-11-19 12:00:39 +01:00
2018-11-30 13:54:39 +01:00
webView = view . findViewById ( R . id . webView )
webView . loadUrl ( " https://elearning.hs-offenburg.de/moodle/ " )
2018-11-19 12:00:39 +01:00
2019-03-20 21:33:55 +01:00
webSettings = webView . settings
2018-11-30 13:54:39 +01:00
//webSettings.setJavaScriptEnabled(true) // Enable Javascript
2018-11-19 12:00:39 +01:00
2019-03-20 21:33:55 +01:00
webView . webViewClient = WebViewClient ( ) // Force links and redirects to open in the WebView instead of in a browser
2018-11-19 12:00:39 +01:00
2018-11-30 13:54:39 +01:00
return view
}
2018-11-19 12:00:39 +01:00
}