Code example for View

Methods: getSettingssetBackgroundColorsetScrollBarStylesetWebViewClient, setHorizontalScrollBarEnabled, setOnTouchListener, setScrollContainer, setVerticalScrollBarEnabled

0
		super(ttActivity);
		myTTActivity = ttActivity;
		myGestureDetector = new GestureDetector(myTTActivity,
				new MainWebViewGestureDetector(this));
 
		myWebView = new WebView(myTTActivity);
		initWebView(); 
		addView(myWebView);
	} 
 
	public void updateWebView(final String htmlData) {
		myWebView.loadDataWithBaseURL(CONTENT_BASEURL, htmlData,
				CONTENT_MIME_TYPE, CONTENT_ENCODING, CONTENT_STARTPAGEURL);
	} 
 
	public void loadNextPage() { 
		myTTActivity.loadNextPage();
	} 
 
	public void loadPrevPage() { 
		myTTActivity.loadPrevPage();
	} 
 
	@Override 
	public boolean onTouchEvent(MotionEvent event) {
		return myGestureDetector.onTouchEvent(event);
	} 
 
	private void initWebView() { 
		myWebView.setOnTouchListener(new MainWebViewOnTouchListener(this));
		myWebView.setWebViewClient(new MainWebViewClient(myTTActivity));
		myWebView.setScrollContainer(false);
		myWebView.setVerticalScrollBarEnabled(true);
		myWebView.setHorizontalScrollBarEnabled(false);
		myWebView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
		myWebView.setBackgroundColor(Color.BLACK);
		WebSettings webSettings = myWebView.getSettings();
		webSettings.setSavePassword(false);
		webSettings.setSaveFormData(false);
		webSettings.setJavaScriptEnabled(false);
		webSettings.setSupportZoom(false);
		webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);