Adding the buttons
28
plugin.xml
@ -19,7 +19,7 @@
|
||||
<clobbers target="window.open" />
|
||||
</js-module>
|
||||
|
||||
<!-- android -->
|
||||
<!-- -->
|
||||
<platform name="android">
|
||||
<config-file target="res/xml/config.xml" parent="/*">
|
||||
<feature name="InAppBrowser">
|
||||
@ -30,21 +30,21 @@
|
||||
<source-file src="src/android/InAppBrowser.java" target-dir="src/org/apache/cordova/inappbrowser" />
|
||||
<source-file src="src/android/InAppChromeClient.java" target-dir="src/org/apache/cordova/inappbrowser" />
|
||||
|
||||
<!-- android drawable resources -->
|
||||
<source-file src="res/android/drawable-hdpi/ic_action_next_item.png" target-dir="res/drawable-hdpi" />
|
||||
<source-file src="res/android/drawable-mdpi/ic_action_next_item.png" target-dir="res/drawable-mdpi" />
|
||||
<source-file src="res/android/drawable-xhdpi/ic_action_next_item.png" target-dir="res/drawable-xhdpi" />
|
||||
<source-file src="res/android/drawable-xxhdpi/ic_action_next_item.png" target-dir="res/drawable-xxhdpi" />
|
||||
<!-- drawable src/android/resources -->
|
||||
<source-file src="src/android/res/drawable-hdpi/ic_action_next_item.png" target-dir="res/drawable-hdpi" />
|
||||
<source-file src="src/android/res/drawable-mdpi/ic_action_next_item.png" target-dir="res/drawable-mdpi" />
|
||||
<source-file src="src/android/res/drawable-xhdpi/ic_action_next_item.png" target-dir="res/drawable-xhdpi" />
|
||||
<source-file src="src/android/res/drawable-xxhdpi/ic_action_next_item.png" target-dir="res/drawable-xxhdpi" />
|
||||
|
||||
<source-file src="res/android/drawable-hdpi/ic_action_previous_item.png" target-dir="res/drawable-hdpi" />
|
||||
<source-file src="res/android/drawable-mdpi/ic_action_previous_item.png" target-dir="res/drawable-mdpi" />
|
||||
<source-file src="res/android/drawable-xhdpi/ic_action_previous_item.png" target-dir="res/drawable-xhdpi" />
|
||||
<source-file src="res/android/drawable-xxhdpi/ic_action_previous_item.png" target-dir="res/drawable-xxhdpi" />
|
||||
<source-file src="src/android/res/drawable-hdpi/ic_action_previous_item.png" target-dir="res/drawable-hdpi" />
|
||||
<source-file src="src/android/res/drawable-mdpi/ic_action_previous_item.png" target-dir="res/drawable-mdpi" />
|
||||
<source-file src="src/android/res/drawable-xhdpi/ic_action_previous_item.png" target-dir="res/drawable-xhdpi" />
|
||||
<source-file src="src/android/res/drawable-xxhdpi/ic_action_previous_item.png" target-dir="res/drawable-xxhdpi" />
|
||||
|
||||
<source-file src="res/android/drawable-hdpi/ic_action_remove.png" target-dir="res/drawable-hdpi" />
|
||||
<source-file src="res/android/drawable-mdpi/ic_action_remove.png" target-dir="res/drawable-mdpi" />
|
||||
<source-file src="res/android/drawable-xhdpi/ic_action_remove.png" target-dir="res/drawable-xhdpi" />
|
||||
<source-file src="res/android/drawable-xxhdpi/ic_action_remove.png" target-dir="res/drawable-xxhdpi" />
|
||||
<source-file src="src/android/res/drawable-hdpi/ic_action_remove.png" target-dir="res/drawable-hdpi" />
|
||||
<source-file src="src/android/res/drawable-mdpi/ic_action_remove.png" target-dir="res/drawable-mdpi" />
|
||||
<source-file src="src/android/res/drawable-xhdpi/ic_action_remove.png" target-dir="res/drawable-xhdpi" />
|
||||
<source-file src="src/android/res/drawable-xxhdpi/ic_action_remove.png" target-dir="res/drawable-xxhdpi" />
|
||||
|
||||
</platform>
|
||||
|
||||
|
@ -23,7 +23,9 @@ import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@ -483,7 +485,13 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
back.setLayoutParams(backLayoutParams);
|
||||
back.setContentDescription("Back Button");
|
||||
back.setId(2);
|
||||
/*
|
||||
back.setText("<");
|
||||
*/
|
||||
Resources activityRes = cordova.getActivity().getResources();
|
||||
int backResId = activityRes.getIdentifier("ic_action_previous_item", "drawable", cordova.getActivity().getPackageName());
|
||||
Drawable backIcon = activityRes.getDrawable(backResId);
|
||||
back.setBackground(backIcon);
|
||||
back.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
goBack();
|
||||
@ -497,7 +505,10 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
forward.setLayoutParams(forwardLayoutParams);
|
||||
forward.setContentDescription("Forward Button");
|
||||
forward.setId(3);
|
||||
forward.setText(">");
|
||||
//forward.setText(">");
|
||||
int fwdResId = activityRes.getIdentifier("ic_action_next_item", "drawable", cordova.getActivity().getPackageName());
|
||||
Drawable fwdIcon = activityRes.getDrawable(fwdResId);
|
||||
forward.setBackground(fwdIcon);
|
||||
forward.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
goForward();
|
||||
@ -534,7 +545,10 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
close.setLayoutParams(closeLayoutParams);
|
||||
forward.setContentDescription("Close Button");
|
||||
close.setId(5);
|
||||
close.setText(buttonLabel);
|
||||
//close.setText(buttonLabel);
|
||||
int closeResId = activityRes.getIdentifier("ic_action_remove", "drawable", cordova.getActivity().getPackageName());
|
||||
Drawable closeIcon = activityRes.getDrawable(closeResId);
|
||||
close.setBackground(closeIcon);
|
||||
close.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
closeDialog();
|
||||
|
Before Width: | Height: | Size: 593 B After Width: | Height: | Size: 593 B |
Before Width: | Height: | Size: 599 B After Width: | Height: | Size: 599 B |
Before Width: | Height: | Size: 438 B After Width: | Height: | Size: 438 B |
Before Width: | Height: | Size: 427 B After Width: | Height: | Size: 427 B |
Before Width: | Height: | Size: 438 B After Width: | Height: | Size: 438 B |
Before Width: | Height: | Size: 328 B After Width: | Height: | Size: 328 B |
Before Width: | Height: | Size: 727 B After Width: | Height: | Size: 727 B |
Before Width: | Height: | Size: 744 B After Width: | Height: | Size: 744 B |
Before Width: | Height: | Size: 536 B After Width: | Height: | Size: 536 B |
Before Width: | Height: | Size: 1021 B After Width: | Height: | Size: 1021 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 681 B After Width: | Height: | Size: 681 B |