Add badge icon overlay to Finder icons and folders? - objective-c

When we open Dropbox folder, we can see icon on the left bottom of the folder.
I am developing an application in which i also want the same behavior. If folder is syncing then it will show sync icon and for other operation it will show other icon. The marked files/folder when viewed in Finder must be shown with a custom icon. But when they are selected for preview ( using spacebar) they must show their original icon ( i.e the blue icon for folder etc) .

Starting with Yosemite (10.10), there is now an officially supported (and thus Mac App Store compatible) method for displaying sync status badges in Finder icons in the form of Finder Sync extensions.

Dropbox has developed a NSPlugin for showing icon badges on each folder/file. As you would know, NSPlugins for Finder were deprecated by Apple starting with Snow Leopard. I think Dropbox worked around it with a hack - that reenabled plugin support. I don't think Apple would have liked that. Apple wants third party apps to only provide services support, since they don't want any third party code in Finder's process, but services are underwhelming.

In addition to the Finder Sync Extension mentioned in other answers, badges (and other metadata) on files can additionally be accomplished via the File Provider API:
File Provider
An extension other apps use to access files and folders managed by your app and synced with a remote storage.
https://developer.apple.com/documentation/fileprovider
Specifically, the NSFileProviderItemDecorating class:
Badge
The system displays the badge image on top of the item’s icon. It only displays the first Badge image.
FolderBadge
Only available on folder items. The system embosses the image over the folder icon. It only displays the first FolderBadge image.

This can be achieved by creating new Finder Sync Extension. Find more information here: https://stackoverflow.com/a/43183393

Related

change icon of file in project view tool window

I'm developing a plugin that gives the ability to version control and other stuff, for viewing the files added to my vcs I need to show them with a different overlay icon. Using the api how to change file/folder icons?
You need to implement the com.intellij.ide.FileIconProvider interface and register your implementation using the <fileIconProvider> extension point.

IBM Worklight - how to rename an application and change its icon, splash image

We've used an existing example application to start a proof of concept with Worklight, we've made a lot of changes to the original code and we would like to change the application name and customize its icons and splash image. We've managed to make the aforementioned changes (Name, icons and splash) inside xCode, however this doesn't serve the future purpose of an automated build from Worklight to ipa.
Could you please let us know what steps are involved to:
How to rename an existing application in Worklight (changing only the application-descriptor.xml doesn't change the generated binaries though).
How to change icons and splash screens for app.
When you create a new application for a Worklight project, the application name is used throughout several files, so you will need to find all occurrences of the given application name and change them. These are:
main HTML filename
main CSS filename
main JavaScript filename
inside main HTML filename (references to the main CSS and JavaScript files, title)
Inside application-descriptor.xml (the elements: displayName, description, mainFile)
Note, the filenames should not matter to you. In the future they will, hopefully, always get a generic name (like index.html or main.css. ...).
The app icon title in the device is controlled by the displayName element in application-descriptor.xml.
As for the icons and splash images, you can simply place thme (regular icon, retina icon, splash image, retina splash image) with the appropriate filenames in the "nativeResources" folder (sits next to the "native" folder) and they will be copied during build time to the native project (which you will eventually open in Xcode).
You can find out the correct filenames inside the native >> Resources folder.
quote:
however this doesn't serve the future purpose of an automated build
from Worklight to ipa.
Worklight will, of course, never create an .ipa file for you... that's the role of Xcode.

NSUserNotification don't show application icon in notification [duplicate]

I'm using OSX's Notification Center APIs for the first time and can't seem to figure out how to make my app's icon to show up in the Notification badge.
The default "your app doesn't have an icon" icon keeps showing up:
Here's what I've done so far
I have created an icns file that includes 512, 256, 128, 32 & 16px versions
dragged the icon into the "App Icon" section of the target's summary
I made to sure to check the box to copy the icon into the project
the plist's "Icon file" section references the correct icon name (minus the .icns) part
Any ideas? The icon doesn't show up when I run the app thru Xcode or when I export an archive either.
I also have extracted the Sparrow.icns file from Sparrow.app and tried using that one instead of the one I made. That didn't work either.
I was able to fix this issue by incrementing the Build number in the General section for the build Target.
You can force the Notification Center to refresh all of the icons by deleting the Notification Center database file (~/Library/Application Support/NotificationCenter/SOME_UUID.db) and then killing the Notification Center process (e.g., from Activity Monitor).
Unfortunately this has the side effect of deleting your notification history, but this wasn't too much of an issue for me.
There's actually an ongoing debate on Apple's developer forums (link, link for people with access) about this. As far as I know, there's currently no real solution, but you can try the following:
Change your app's bundle ID and try it again. If you change it, clean your app, and change back, some people have reported success with seeing their icon show up.
Log in as another user. The caching Notification Center uses may be per-user, so you might be able to get the properly-iconned notifications as a different person.
The folder location has been moved for OSX 10.10+.
Following command takes to you to its new location:
$ cd `getconf DARWIN_USER_DIR`/com.apple.notificationcenter/db
and then
$ open .
Easiest way that I managed to get the icon to show up is change the Bundle Identifier in your project. This works on OSX 10.10.5 and XCode 7.2
(Once notification center picks up the change, you can change it back to your original bundle identifier if you already have a provisioning profile associated with it)
I have solved the issue by archiving my app and adding a copy to my applications folder. When the app is in Application folder, the icon is always visible even you run the app from XCode...
I tried all of the above suggestions but the only thing that worked for me on 10.14 was to delete DerivedData:
rm -rf ~/Library/Developer/Xcode/DerivedData
If anyone still having this issue, and none of the methods above worked, here is how I solved it:
open Notifications from the System Preference (easiest is to open Alfred or spotlight and type Notifications)
find your application and remove it (press backspace/delete button)
NOTE: this may remove all notifications
I am using Xcode 11.5 and I had the same problem. In my case tough, it was sufficient to clean build output, close and reopen the project. Then do a fresh build and let it run again. The icon was there afterwards.
Side note: I've placed the app icon for every size in the assets.xcassets file, except 1024 x 1024 pixels. Don't know if this is relevant or not. Hope that helps.

How to get system icons in iOS

I want to use icons like opened/closed folder in my table (UITableView)?
UPD:
For example, in Java you can get a standard image "folder" and use it in the FileTree:
new
DefaultTreeCellRenderer().getDefaultClosedIcon()
And also can use the constants of L&F (colors, styles, icons).
In the iOS, I found only these standard icons.
But not folder icons...
I'm not quite sure exactly what you want - the folder icon from iOS? Could you explain a little better?
If it is a folder icon that you want, there's no quick way to get it from code - doing so would use private API's and your app is likely to be rejected from the app store.
If you want something like a folder icon, a good way to get it would be by taking a screenshot of the iPhone simulator and editing it to the right size etc.

Themes in Adobe AIR

What is the best way to skin/theme an AIR application. For example, I want to use a dark/blackish theme instead (similar to Tour de Flex) instead of the default gray one.
The ScaleNine themes are a good place to start, find one that is sort of like what you want, plug it into your app, and gradually replace the colors, images, and controls with your own.
http://www.scalenine.com/
I'm only just getting started in AIR as well, but if you're using Flex check out the Flex in a Week video series. There are several videos that cover creating custom MXML components and item renderers, which effectively let you skin your application.
You can also use CSS to style your app.
First you need to set the system chrome property in the air application properties file to none.
<initialWindow>
...
<systemChrome>none</systemChrome>
...
</initialWindow>
If the main file in your air app is named Main.mxml, then your application properties files will be named Main-app.xml. This file is not hard to find, it should be in the same location as the Main.mxml file.
By setting this property to none you are saying that you do not wish your air app window to take the style of the OS windows in which the app is running.
Since this property is set to none, the chrome for the air app will have to come from your Main.mxml file, which should be a WindowedApplication
Use the titleBarBackgroundSkin attriubute of the WindowedApplication To set the skin for the air app. titleBarBackgroundSkin defaults to "mx.skins.halo.ApplicationTitleBarBackgroundSkin"