i'm attempting to get code to list of all icons visible in the notification area, to the left of the time. i've been experimenting with EnumDesktopWindows and GetWindowLong, without finding any way to single out the system tray icons. thanks!
Use the accessibility interfaces to enumerate the children of User Promoted Notification Area.
Related
We have an SMS app for Android Wear (https://play.google.com/store/apps/details?id=com.awear.coffee)
Right now we use regular notification actions and when you select Reply it launches our activity on the watch. I want to replace the Reply action with a notification page with a custom activity that holds a few buttons and a list of strings.
I've tried two approaches.
Create a large notification page that holds the content
This doesn't work because Notification.WearableExtender.setCustomContentHeight has a hidden max value so the content gets clipped. I think it's the same height as if you use setCustomSizePreset(SIZE_LARGE). I've verified that if I use a default notification with a ton of text it can be larger than this, but if you use a custom display intent it gets clipped.
Use a fullscreen notification page and add a scrollview to it
This doesn't work because the input gets blocked somehow. Whenever you scroll the activity receives Action.DOWN, Action.MOVE, Action.CANCEL in that order, so you only get one Action.MOVE no matter how long you drag. I'm guessing this is because the OS wants to control the left/right swipes.
Any ideas on how to get around this? I've tried setting custom onTouch listeners but they still never receive all the touch events.
Any help would be appreciated. It would make our app much better if we could reduce the number of taps and swipes needed.
Jakob
if you are using bridged notification(With out having wear module) You can insert extended text content to your notification by adding one of the "big view" styles(InboxStyle,BigTextStyle) to your notification. On a handheld device, users can see the big view content by expanding the notification. On a wearable device, the big view content is visible by default.
BigTextStyle bigStyle = new NotificationCompat.BigTextStyle();
bigStyle.bigText(someBigText);
NotificationCompat.Builder notificationBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_small)
.setContentTitle(title)
.setContentText(contentText)
.setContentIntent(viewPendingIntent)
.addAction(R.drawable.ic_map,
getString(R.string.somestring), mapPendingIntent)
.setStyle(bigStyle);
I ran into the same problems.
The limit on setCustomContentHeight is frustrating. I couldn't find a way around it.
Likewise, there doesn't seem to be a good way to circumvent the limitations imposed on tap-listeners with the fullscreen notification.
My solution was to add an Action to the first page of the notification that launches an Activity based on the GridViewPager. Once there, the limitations are gone, but it still mostly looks like a Notification. With the principal differences being, (1) you have to 'tap' the first Notification card, rather than swipe it, and (2) swiping up and down don't automatically go to the next/previous notifications.
I'm using a grid of HubTile in my app, and I'd like to be able to rearrange (aka reorder the items by tapping and hold ) the tile like how the Windows Phone home page does it.
I have come across something a bit similar - A Gesture-Driven Windows Phone Todo List, but I don't think it is readily usable. Is there some kind of open source library or commercial product that does that well. I really don't want to roll my own since the deadline is near and I need to leverage as much as I can
The best way is to use a WrapPanel. If you add your Hub Tiles to the WrapPanel, it would give you the same effect as the Windows Phone Home Page.
The following links should help you understand how to go about the WrapPanel.
http://www.windowsphonegeek.com/articles/WP7-WrapPanel-in-depth
http://www.kotancode.com/2010/12/29/wp7-presenting-listbox-items-inside-a-wrappanel/
Once that is done, you could use touch manipulations to move the Hub Tiles around.
http://blogs.msdn.com/b/mikeormond/archive/2010/07/08/enabling-touch-manipulations-on-windows-phone.aspx
First, group all the Hub Tiles into a List<> or an ObservableCollection<>. (I would advice using an ObservableCollection)
Use the touch manipulations to move the Hub Tile around. Based on the position of the Hub Tile (when the touch manipulation is done), you could rearrange the order of the Hub Tiles in the ObservableCollection. Update the ListBox.
By this I mean, that if the HubTile[3] is dragged and moved to the top of the Listbox, in the List<>, change the index of HubTile[3] to HubTile[0], and update the index of the rest of the HubTiles. When you refresh the ListBox, you should get the HubTiles rearranged.
You could create a StoryBoard for the animations.
On iTunes, the view buttons are grouped together as such:
I would like to achieve this effect in my OS X app. I can't find instructions or a tutorial for this. I suspect my problem is that I don't know what terminology to use in my search.
I have an NSToolBar. I can add a single button, but I don't know how to group multiple buttons and made them dependent on each other's toggle state.
Can you point me in the right direction?
That's a Segmented Control. (NSSegmentedControl)
Just drag it from the object library into the toolbar, and then you can configure every cell individually.
I've seen this done on a few apps:
Can anyone suggest a starting point on how to do this? I've done some work with the Interface builder and Cocoa, but nothing this fancy. The requirements are to be able to display a window on demand under a particular menubar icon, and have the user be able to interact with it (buttons and text fields). Not asking for a full blown solution (unless one exists), just a friendly push in the right direction...
Get the icons rect from the status bar, then present your window based on that rect. Your example shows an arrow (from a png background image), then they aligned the arrow to be the center of the icons rect in the status bar.
I stumbled upon this: http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem/
Matt Gemmell made a very nice class for these kinds of windows MAAttachedWindow
I'm working on a app in which I used a listbox inside a pivot control just like the outlook app does. The problem is sometimes when I scroll the list, a swipe gesture is triggered and it goes to another pivot item. This is very annoying, and it seems doesn't happen to the outlook app. Am I doing something wrong? How do I fix it? Thanks a lot.
If you're just using the default controls in the default way then you're not doing anything wrong in your code.
You haven't said if you're getting this on the emualtor or on an actual device. I find I sometimes do this on the emulator if holding the mouse at a slight angle or on an actual device if holding that in a funny way (such as when lying down).
Whether you scroll the listbox or the pivot will depend on whether your finger (or mouse-if using the emulator on a non touch-screen PC) first moves vertically or horizontally after first touching the screen. In my experience the scenarios described above can lead to this not always working as expected but I've never seen an issue with this on a real device being held in one hand and scrolled using a thumb.