Change the screen when click on the button - user-interface

I am new to Blackberry..I am developing an application which contain the home screen having a button on it. When clicked on it, it is changing to new screen for that I used UiApplication.getUiApplication().pushScreen(new NewScreen()); in the fieldchangedListener method.
In the newscreen I added a verticalFieldManager and add some images and a button.What I want is when I click on this button it should takes to the homescreen.
I implemented the second screen functionality in NewScreen class which is in the main class.
Please let me know any suggestions.
Thanks
Koushik

i think you want to go back to the previous screen.
try this.
Screen currentScreen = UiApplication.getUiApplication().getActiveScreen();
UiApplication.getUiApplication().popScreen(currentScreen);

Write this a code snippet, then I can help you.
Perhaps You need to overload methods onClose, onSave or etc.

I can use the command close(); in the button event, thus you'll close the second Screen and return to the first one.

Related

How to deactivate click event on Unity Slider UI?

In Unity, I would like to use the slider in my canvas but only the handle.
A default behaviour is that if the user clicks on a certain point in the slider , the handle will jump right to that point. I would like to disable this behaviour, allowing the user only to drag the handle to move it.
How can this be done?
Thank you.
Simply uncheck the Raycast Target property of the Image component located on the Background GameObject.
Otherwise you could always override the Slider class to fit your need but i guess this would be a bit overkill in your case.
Hope this helps,
Disable interactable checkbox in inspector. This option added with new versions.

XCode7 ui testing: How to swipe a certain location?

I want to swipe a screen to the left. But I have no label or button whose display-label does not change or is recognizeable during recording. So I cannot find a point to grab and swipe the screen.
Is there a possibility to swipe a certain screen-coordinate?
Thanks in advance!
You can swipe directly on the app, and even the window.
let app = XCUIApplication()
app.swipeLeft()
app.windows.element.swipeLeft()
Just solved it by recording a tap on a random screen location. This gave me three lines of app.childrenMatchingType(.Window).elmentBoundByIndex(0).....element.childrenMatchingType(.Other).tap()
Somehow weird. But I changed tap() with swipeLeft() and it worked out.

Showing an NSSharingServicePicker on MouseUp

I'm adding sharing to my app (targeting Mavericks, 10.9), which I want to work like this:
User clicks Share button
Cursor changes to crosshair
User drags selection of what he'd like to share
NSSharingServicePicker displays, allowing the user to pick the service to share with
I'm accomplishing this using the -mouseDown:, -mouseDragged:, and -mouseUp: events. mouseDown begins the selection, mouseDragged provides feedback as to the area being selected, and then mouseUp completes the drag, showing the picker. Each time, though, I get this written to the console:
2014-06-25 00:13:45.111 App[31401:303] Warning: -[NSSharingServicePicker showRelativeToRect: ofView: preferredEdge:] should not be called on mouseUp
Please configure the sender with -[NSControl sendActionOn:NSLeftMouseDownMask];
I don't understand why that would be a problem, unless you were showing it from a button click on mouse up. Should I ignore the message? I've tried showing it using dispatch_async and dispatch_after to try and get it to run outside the event's invocation, but they didn't work. I suppose I could ignore it, but does that leave the door to deprecation open?
I know this is a year late but,
I had the same problem. After some research, I cam back with this answer. Before I implemented this code, my button would spin for a while, and then return with the same error you had. When I click my share button now, it no longer lags, and does not return any error. Insert this into your app's awakeFromNib method:[yourShareButtonName sendActionOn:NSLeftMouseDownMask];.
This is what your code should look like:
- (void)awakeFromNib {
[yourShareButtonName sendActionOn:NSLeftMouseDownMask];
}
I hope this helps!

Page animation with visual feedback on drag gesture

I was wondering, I'm currently using a slide in and out page transition when the user presses a Next of Previous button on the appbar.
( concept: going through a set of articles inside a selected category )
This all looks great, I'm also able add the drag / flick gesture listeners to trigger this page transition... so no problems there.
But now I wanted to add the final part, when the user starts the drag / flick gesture, show this visually so that the page follows the gesture and 'slides' out of frame.
But how to do this? An example would be great :)
But there is also a small extra thing, I don't want the user to always do a full drag... so if we are over 2/3 of the screen, auto start the page transition IF the gesture stops ( so the user lifts up his finger )
So I would like to create a nice reading experience that shows the gesture visualy and performs the page transition...
You can check the following link: https://stackoverflow.com/a/9915016/1565574
In the ManipulationCompleted you'll be able to detect the GestureType and take an action there.
And I found that link: https://stackoverflow.com/a/4342558/1565574 (using the GestureService)
I first started with the DragFlickBehavior from #LocalJoost and it actually worked great!
But in the end I switched to a headerless pivot! Works also great!

label with delete button

I have a UIlabel that is added dynamically to a view.
What i want is a small delete button (custom image I have) to be added
to the top right corner of the label which should basically delete the label when clicked.
Can someone get me started with what kind of trick can be used to achieve this?
Infact I am open to using any other control in place of label.
Thanks a lot in advance,
Prasad.
Just make a button and then when the button is pressed:
- (IBAction)deleteLabelPressed:(id)sender {
[self.labelText setHidden:YES];
}

Resources