Gamebase SDK for Android  1.5.0
Toast Gamebase Platform
Gamebase.WebView Class Reference

This class implements the Webview call function. More...

Collaboration diagram for Gamebase.WebView:
Collaboration graph

Static Public Member Functions

static void openWebBrowser (@NonNull final Activity activity, @NonNull final String url)
 This method to create the web browser and display it on screen. More...
 
static void showWebBrowser (@NonNull final Activity activity, @NonNull final String url)
 This method to create the web browser and display it on screen. More...
 
static void showWebView (@NonNull final Activity activity, @NonNull final String url)
 This method to create the webview and display it on screen. More...
 
static void showWebView (@NonNull Activity activity, @NonNull String url, @NonNull GamebaseWebViewConfiguration configuration)
 This method to create the webview and display it on screen. More...
 
static void showWebView (@NonNull Activity activity, @NonNull String url, @NonNull GamebaseWebViewConfiguration configuration, GamebaseCallback onCloseCallback, List< String > schemeList, GamebaseDataCallback< String > onEvent)
 This method to create the webview and display it on screen. More...
 
static void closeWebView (@NonNull Activity activity)
 This method to close the webview in display on a screen. More...
 

Detailed Description

This class implements the Webview call function.

Member Function Documentation

◆ closeWebView()

static void closeWebView ( @NonNull Activity  activity)
static

This method to close the webview in display on a screen.

Since
Added 1.5.0.
Parameters
activityCurrent activity.

◆ openWebBrowser()

static void openWebBrowser ( @NonNull final Activity  activity,
@NonNull final String  url 
)
static

This method to create the web browser and display it on screen.

Since
Added 1.5.0.
Parameters
activityCurrent activity.
urlThe url of the resource to load.

◆ showWebBrowser()

static void showWebBrowser ( @NonNull final Activity  activity,
@NonNull final String  url 
)
static

This method to create the web browser and display it on screen.

Since
Added 1.4.0.
Deprecated:
As of release 1.5.0, use Gamebase.WebView#openWebBrowser(Activity, String) method instead.
Parameters
activityCurrent activity.
urlThe url of the resource to load.

◆ showWebView() [1/3]

static void showWebView ( @NonNull final Activity  activity,
@NonNull final String  url 
)
static

This method to create the webview and display it on screen.

Since
Added 1.4.0.
Parameters
activityCurrent activity.
urlThe url of the resource to load.

◆ showWebView() [2/3]

static void showWebView ( @NonNull Activity  activity,
@NonNull String  url,
@NonNull GamebaseWebViewConfiguration  configuration 
)
static

This method to create the webview and display it on screen.

Since
Added 1.5.0.
Parameters
activityCurrent activity.
urlThe url of the resource to load.
configurationThe configuration of webview.

Example Usage:

GamebaseWebViewConfiguration configuration
= new GamebaseWebViewConfiguration.Builder()
.setTitleText("title")
.setScreenOrientation(ScreenOrientation.PORTRAIT)
.setNavigationBarColor(Color.RED)
.setNavigationBarHeight(40)
.setBackButtonVisible(true)
.setBackButtonImageResource(R.id.back_button)
.setCloseButtonImageResource(R.id.close_button)
.build();
GamebaseWebView.showWebView(MainActivity.this, "http://www.gamebase.com", configuration);

◆ showWebView() [3/3]

static void showWebView ( @NonNull Activity  activity,
@NonNull String  url,
@NonNull GamebaseWebViewConfiguration  configuration,
GamebaseCallback  onCloseCallback,
List< String >  schemeList,
GamebaseDataCallback< String >  onEvent 
)
static

This method to create the webview and display it on screen.

Since
Added 1.4.0.
Parameters
activityCurrent activity.
urlThe url of the resource to load.
configurationThe configuration of webview.
onCloseCallbackcalled when the browser closed.
schemeListfor receiving events.
onEventfrom Scheme list.

Example Usage:

GamebaseWebViewConfiguration configuration
= new GamebaseWebViewConfiguration.Builder()
.setTitleText("title")
.setScreenOrientation(ScreenOrientation.PORTRAIT)
.setNavigationBarColor(Color.RED)
.setNavigationBarHeight(40)
.setBackButtonVisible(true)
.setBackButtonImageResource(R.id.back_button)
.setCloseButtonImageResource(R.id.close_button)
.build();
Gamebase.WebView.showWebView(getActivity(),
"http://www.gamebase.com",
configuration,
new GamebaseCallback(){
@Override
public void onCallback(GamebaseException exception) {
...
}
},
schemeList,
new GamebaseDataCallback<String>() {
@Override
public void onCallback(String fullUrl, GamebaseException exception) {
...
}
});