Change Quasar Notify icon color - quasar-framework

I have a notification displayed by Quasar notify that includes an icon. How can I change that icon's color?
I can't find a way via the normal options
I don't want to use plain CSS from the caller because I'm using this in multiple places and created a service to display
I tried using the html: true options but in the message if I use <q-icon> it doesn't render
static notify(text: string) {
Notify.create({
message: text,
icon: 'check_circle',
position: 'top-right'
});
}

You can do one thing create class that change the icon color and add that class in default.
import { Notify } from 'quasar'
Notify.setDefaults({
classes:'Your class'
})
https://codepen.io/Pratik__007/pen/jOLvGQj

Related

How to include Notification Scene in WatchOS-App? Option is Missing in XCode V 14.2

I am new to SwiftUI development so I did the official SwiftUI-Landmark tutorial. The chapter Creating a watchOS App says that you should check the checkbox "Include Notification Scene" in the template when adding the WatchOSApp target. However, in my Xcode V 14.2 there is no such checkbox. Am I doing something wrong? Is there a possibility to add this scene afterwards?
This are the options i can choose:
I also posted this Question in the Apple Developer Forum. But till now nobody answered.
The checkbox is in fact missing in Xcode 14+ (as of Jan 2023). In Xcode 13 it creates additional files when you selected the checkbox, these files are: NotificationView.swift, NotificationController.swift, ComplicationController.swift, PushNotificationPayload.apns, as well as two schemes to launch the notification and the complication.
Fortunately, you don't need complications to complete the tutorial, so you have only to create 3 files and one scheme before moving on to the Section 5 —
Create a Custom Notification Interface.
I provided the detailed explanation with screenshots in the blog post, but here is a short description of what you have to do:
Step 1: Create a NotificationView.swift
Create a new SwiftUI View file in the WatchLandmarks Watch App folder. Name it NotificationView.swift:
import SwiftUI
struct NotificationView: View {
var body: some View {
Text("Hello, World!")
}
}
struct NotificationView_Previews: PreviewProvider {
static var previews: some View {
NotificationView()
}
}
Do not be confused about its stub content. The file will be modified during the next section of the Apple tutorial. For now you just need these files in a state they were created in Xcode 13.
Step 2: Create a NotificationController.swift
Create a Swift file called NotificationController.swift in the same folder:
import WatchKit
import SwiftUI
import UserNotifications
class NotificationController: WKUserNotificationHostingController<NotificationView> {
override var body: NotificationView {
return NotificationView()
}
override func willActivate() {
// This method is called when watch view controller is about to be visible to user
super.willActivate()
}
override func didDeactivate() {
// This method is called when watch view controller is no longer visible
super.didDeactivate()
}
override func didReceive(_ notification: UNNotification) {
// This method is called when a notification needs to be presented.
// Implement it if you use a dynamic notification interface.
// Populate your dynamic notification interface as quickly as possible.
}
}
Step 3: Create a PushNotificationPayload.apns
In the same folder, create an Empty file (bottom of the new file screen) and call it PushNotificationPayload.apns. Paste its contents:
{
"aps": {
"alert": {
"body": "Test message",
"title": "Optional title",
"subtitle": "Optional subtitle"
},
"category": "myCategory",
"thread-id": "5280"
},
"WatchKit Simulator Actions": [
{
"title": "First Button",
"identifier": "firstButtonAction"
}
],
"customKey": "Use this file to define a testing payload for your notifications. The aps dictionary specifies the category, alert text and title. The WatchKit Simulator Actions array can provide info for one or more action buttons in addition to the standard Dismiss button. Any other top level keys are custom payload. If you have multiple such JSON files in your project, you'll be able to select them when choosing to debug the notification interface of your Watch App."
}
Step 4: Create a Notification scheme
Now you need to create a scheme to run a notification with a custom view you just created.
Click the scheme selector in the Xcode toolbar and select New Scheme… in the dropdown.
Select the Watch App as the target and add (Notification) to the scheme name for the sake of clarity. Click OK.
Click the schemes again, make sure the Notification scheme is selected, and click Edit Scheme.
In the popup, select the Run row in the left panel, then change Watch Interface to Dynamic Notification. After this, the Notification Payload field should be automatically switched to PushNotificationPayload.apns.
Click Close.
From this state, you can easily continue with the tutorial.
Only if you want to customize that scene. Otherwise watchOS will just display your notifications in a default interface.
When you create a project, you will see a generic ContentView file with your first view and a file named after your app that displays ContentView in a window in a scene.
You can just create a new scene and window for notifications here and customize the view in a separate file (to stay organized) just like for your application.

Change tint color for call alert confirmation

So I want the users to be able to start a call from the app, fo this I'm using:
func prepareCall(to phoneNumber:String) {
let callURL = URL(string:"telprompt://\(phoneNumber)")!
UIApplication.shared.open(callURL, options: [:], completionHandler: nil)
}
Everything works fine, is just a theme issue what I've got here.
I've also set global tint like so:
self.window?.tintColor = //my main theme color
So my whole app has a base tint color applied to all alerts, buttons, etc. But when the user is prompted with the alert confirmation button it has that blue default tint.
Is there any why to change this alert tint?
It is impossible , at least in iOS 11.4.1.
Example view:
the corresponding view hierarchy ,
the blue alert is not there.
the noisy blue alert is not within your app. It is of the system.
More evidence:
Xcode stop running, the blue alert is still there. The app project is terminated.

iOS overrides the `navBarButtonColor` when using PNGs

Issue Description
In my application I have a navigation bar search button set up as follows:
static navigatorButtons = {
leftButtons: [
{
id: 'back-nav-button',
icon: require('../assets/images/icons/arrow-left.png')
}
]
};
The button works as intended on both iOS and Android, but the button is blue on iOS. I understand that this is the desired behavior and that the color can be overridden by setting navBarButtonColor, but the problem is that it's a multi-colored button - meaning I want then button to simply contain the PNG image's colors, and not the navBarButtonColor.
I've tried setting navBarButtonColor to null, transparent, but nothing seems to work.
So my question is, is there a way to make navigation bar icons take on the color of the PNG provided, as is the case on Android?
Steps to Reproduce / Code Snippets / Screenshots
Simply run any RNN app on iOS with a simple static navigatorButtons = ... using a local multi-colored PNG and you'll see the colors of the icon get overwritten.
Environment
React Native Navigation version: 1.1.473
React Native version: 0.55.3
Platform(s) (iOS, Android, or both?): iOS
Device info (Simulator/Device? OS version? Debug/Release?): Android Emulator on Debug
On iOS, UIBarButtonItem uses images created with source image's alpha channel. To display the actual image (not an alpha channel mask of it) you need to change your image's rendering mode to alwaysOriginal
Although, looking at React Native Image class documentation I can't see renderingMode property
We've managed to find a workaround for this. By setting the disableIconTint button property to true, it disables the icon color override. See the following example:
static navigatorButtons = {
leftButtons: [
{
id: 'back-nav-button',
icon: require('../assets/images/icons/arrow-left.png'),
disableIconTint: true // Add this line to use the PNG's color
}
]
};

Flash Pro - AS3 embeded font not Showing up on Button Label in iOS

So I have an annoying issue that I can't solve. I am creating an app in Flash Pro/AS3 for iOS. I have a button whose label font I want to change:
var ButtonTextFormat:TextFormat = new TextFormat("Showcard Gothic", 120);
//ButtonTextFormat.size = 120;
//ButtonTextFormat.font = "Showcard Gothic";
//ButtonTextFormat.embedFonts = true;
ButtonTextFormat.color = 0x00FF00;
//ButtonTextFormat.embedFonts = true;
SMButton.label = "PUSHME!";
SMButton.setStyle("textFormat", ButtonTextFormat);
I just used the standard button found in the Components Toolbox in Flash.
It displays correctly during debug, but once loaded into the iPhone, the label is changed to a default font.
I did embed the desired font through Text>Font Embedding... and it works for a text field that I have, but why not the button label?
I've tried ButtonTextFormat.embedFonts = true; but I get an error:
1119: Access of possibly undefined property embedFonts through a reference with static type flash.text:TextFormat.
Any help would be appreciated. Thanks.
embedFonts property is for TextField class, not for TextFormat class.
Follow this instructions to embed and use your embeded font properly Embedding Fonts for Components in Flash
I had the same problem recently. For components, you must set embedFonts with the .setStyle() method.
SMButton.setStyle("fontFamily", "Showcard Gothic");
SMButton.setStyle("embedFonts", true);
In the Flash IDE, you may need to add your font to the Library, and then export for ActionScript. The class name "TreasureMapDeadhand" for example.
Then in your document class:
import flash.text.Font;
Font.registerFont(TreasureMapDeadhand);
Another option if your linking your font multiple times, although not necessary, is store your font in a public var.
public var f:Font = new TreasureMapDeadhand();
SMButton.setStyle("fontFamily", f.fontName);
SMButton.setStyle("embedFonts", true);
Anyway, I hope this helps!

Unable to change primary color completely in foundation 5 rails app

I created a new rails 4 app with foundation 5 (via foundation-rails gem). Now I'm about to change some styles.
If I change the primary color of the page inside foundation_and_overrides.scss by enabling and changing the line:
$primary-color: #0f6f5f;
the result is, that all links are now using the new color, but the buttons still use the old foundation blue as background.
Digging into foundation scss I can see that the default background color of a button is $primary-color, so why isn't it changing it's color?
How do I change the default background for all buttons using foundation 5 without using something like
.button {
background-color: #0f6f5f !important;
}
which has 2 disadvantages:
it also changes the background color for buttons of other classes like .secondary
I would have to apply such style to many other elements/classes I'm not aware of for now as well, if foundation doesn't let me change primary-color correctly.
Update: I found out that this also holds for other elements. Changing e.g.
$body-font-family: "Courier New", "Courier", monospace;
will change the font for simple text in the body, but not for buttons, forms etc. even if those font-families are defined like
$button-font-family: $body-font-family;
inside foundation.
So something in my logic must be completely wrong. How to customize a foundation absed rails app??
There might be 2 possibilities why it happened for you:
First, you might have set default button color somewhere and it overwrites the $primary-color that you have set. Inspect the button to see if the color is overwritten or not.
Second, in the file that defines style for button, see the first line if it #import the file that has customized settings for $primary-color
For example in my project, all the default settings are in _global.scss file, all the customized settings are in _settings.scss file. So if I wanna to change settings for any element, I have to #import the file that has customized settings. Hope it works for you.

Resources