Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No color or styling For Android 12 and 13 #145

Open
4 of 7 tasks
babihijau opened this issue Apr 10, 2023 · 0 comments
Open
4 of 7 tasks

No color or styling For Android 12 and 13 #145

babihijau opened this issue Apr 10, 2023 · 0 comments

Comments

@babihijau
Copy link

babihijau commented Apr 10, 2023

Expected behaviour

Toast to have color.

Actual behaviour

No color or styling.

I'm seeing this behaviour on

  • iOS device
  • iOS sim
  • Android device
  • Android sim

Hardware models

Example: Samsung XCover 5

OS versions

Example: Android 12++

I'm not a dummy, so I've checked these

  • It happens on a fresh Cordova CLI project as well.
  • I'm waiting for deviceready to fire.
  • My JavaScript has no errors (window.onerror catches nothing).

So how can we reproduce this?

Use android version 12 or higher

Screenshot_20230410_100449_PMMP

function showGreenToast(message) {
	hideToast();
	vibrateDevice([50, 100, 50], showToast(message, '#008000', 'short', 'bottom'));
}

function showToast(message, bgColor, duration, position) {
	 window.plugins.toast.showWithOptions(
		{
			message: message,
			duration: duration, // ms
			position: position,
			addPixelsY: -40, // (optional) added a negative value to move it up a bit (default 0)
			data: { foo: 'bar' }, // (optional) pass in a JSON object here (it will be sent back in the success callback below)
			styling: {
				opacity: 0.8, // 0.0 (transparent) to 1.0 (opaque). Default 0.8
				backgroundColor: bgColor, // make sure you use #RRGGBB. Default #333333
				textColor: '#FFFFFF', // Ditto. Default #FFFFFF
				textSize: 18, // Default is approx. 13.
				cornerRadius: 16, // minimum is 0 (square). iOS default 20, Android default 100
				horizontalPadding: 20, // iOS default 16, Android default 50
				verticalPadding: 16, // iOS default 12, Android default 30
			},
		},
		function (result) {
			if (result && result.event) {
				// touch to hide toast
				if (result.event === 'touch') {
					hideToast();
				}
			}
		}
	);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant