Revision 55e6be1d
Added by Leszek Koltunski almost 3 years ago
src/main/java/org/distorted/tutorials/TutorialWebView.java | ||
---|---|---|
20 | 20 |
package org.distorted.tutorials; |
21 | 21 |
|
22 | 22 |
import android.annotation.SuppressLint; |
23 |
import android.content.Context; |
|
24 | 23 |
import android.webkit.WebView; |
25 | 24 |
import android.webkit.WebViewClient; |
26 | 25 |
|
... | ... | |
28 | 27 |
|
29 | 28 |
public class TutorialWebView |
30 | 29 |
{ |
31 |
private String mUrl; |
|
32 |
private Context mContext; |
|
33 |
private WebView mWebView; |
|
30 |
private String mUrl; |
|
31 |
private final WebView mWebView; |
|
34 | 32 |
|
35 | 33 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
36 | 34 |
|
37 | 35 |
@SuppressLint("SetJavaScriptEnabled") |
38 |
public TutorialWebView(Context context, WebView webview)
|
|
36 |
public TutorialWebView(WebView webview) |
|
39 | 37 |
{ |
40 | 38 |
mWebView = webview; |
41 |
mContext = context; |
|
42 | 39 |
mWebView.setBackgroundColor(0); |
43 | 40 |
mWebView.getSettings().setJavaScriptEnabled(true); |
44 | 41 |
|
Also available in: Unified diff
Abstract the part that controls the 'Locked' and 'Back Moves' buttons from the two activities: the main one and the tutorial one.
This code had been duplicated there.