Disable Swipe to dismiss on ONLY ONE activity - wear-os

I have a fragment activity and I want to disable the swipe to dismiss feature on this, and only this, activity.
Is it possible?

I got it.
on my manifest in the activity I want to disable the swipe to dismiss I've added this:
<activity android:label="#string/app_name" android:name=".ACTIVITYNAME"
android:theme="#style/Theme.Wearable.Modal"/>

Related

Nativescript behavior of the '< Go Back' button

I've got the following ActionBar definition
<ActionBar class="action-bar" title="Settings">
<NavigationButton text="Go Back" android.systemIcon="ic_menu_back" tap="onBackTap"/>
</ActionBar>
The Android version does get called.
In the iOS version - the onBackTap method is never called.
Also it seems in iOS version, even if the NavigationButton entry is not there, {N} inserts one automatically.
UPDATE:
Indeed, it appears that the NavigationButton in iOS can only be used to navigate back and can not be overridden with tap action. Reference from the NativeScript documentation
In iOS, the back button is used explicitly for navigation. It
navigates to the previous page and you cannot handle the tap event to
override this behaviour.
As for the appearing NavigationButton for iOS - it is by design just as in native iOS app. If you do not want to have back navigation you can force it with
clearHistory: true
Uncomment this line in the test application and delete the navigationButton from the sub-page and when navigation from main-page to sub-page the NavButton won't appear.
So as #nick verified, on iOS version of {N} one cannot get the tap event of the Navigation button. I understand why {N} has to add the BACK button automatically if the navigation button is not there (because iPhones don't have a physical BACK button), but not calling an existing tap event is, IMHO, adding unnecessary differences in the framework. Here's the proposed logic for iOS.
if NavigationButton present then
if tap event handler set by user then
use it
else
auto-gen a tap event handler
else
auto-gen a back-button and a tap event handler
Anyway here's how I'm getting around this issue for my app.
<NavigationButton visibility="collapse"/>
<ActionItem ios.position="left" text="< Back" tap="onBack"/>
This gets the behavior I expect and is cross-platform compatible with the Android version.

Xamarin forms slider disable tap/click

I want to make a iphone like slide to unlock slider within xamarin forms.
So I want to disable the slider to be clicked on 100%.
I tried to add a tap gesture recognizer but unfortunatly this doesn't work/
Anyone with ideas?
Xamarin Forms can't work with anything more complicated than tap. You have to implement a custom renderer. There is an example which does what you want:
https://github.com/tkowalczyk/SimpleCustomGestureFrame

How to disable the android wear back swipe?

I am creating a Android Wear app that has an touch area. The user is suppose to be able to move it's finger in all directions over the screen (Think touchpad on your laptop). However the back swipe makes this a bit problematic. Any help with getting around this issue would be a great help.
How to disable the android wear back swipe?
/Jakob
There is an attribute in window style to disable this behavior:
<style name="AppTheme" parent="#android:style/Theme.DeviceDefault.Light">
<item name="android:windowSwipeToDismiss">false</item>
</style>
Once you disable it you have to provide other way of exiting your app.
There is a DismissOverlayView class (listed here https://developer.android.com/training/wearables/apps/layouts.html#UiLibrary) that you should use instead.
Basically it provides an overlay that will show a red button with cross after a long press. Clicking the red button will exit your app.
Here is a video from Google I/O 2014 with some bookmarked moments:
https://www.youtube.com/watch?v=sha_w3_5c2c#t=1390 <- disabling android:windowSwipeToDismiss
https://www.youtube.com/watch?v=sha_w3_5c2c#t=1505 <- Java code for DismissOverlayView
You can also check another video called:
Fullscreen apps for Android Wear:
https://www.youtube.com/watch?v=naf_WbtFAlY
You can try to write AndroidManifest.xml theme
android:theme="#style/Theme.Wearable.Modal inside activity tag
<activity
android:name="com.smart.remote.wear.MainActivity"
android:label="#string/app_name"
android:theme="#style/Theme.Wearable.Modal">
If you want the whole app to override Swipe, place the theme property under your Manifest's <application> tag. If you want it to apply only to a certain activity, then place the property under that activity's <activity> tag.
So:
create or update styles.xml in the res/values folder with the android:windowSwipeToDismiss property, such as:
...
false
If you want to override swipe in the whole app, Update your Manifest as such:
<application
...
android:theme="#style/AppTheme">
If you want to override swipe in a specific activity, Update your Manifest as such:
<activity
...
android:theme="#style/AppTheme">
</activity>
where ... represents all your other settings you already have. Remember you will need to give alternative ways out of the activity and/or app depending on which level you overrode

Swipe Gesture not working in xcode

Since Xcode got updated, i can't use swipe gesture. I have 2 UIViewController, i dragged a Swipe Gesture in the first and in the second. I connected them with Modal Action Segue. I tried in the simulator and on my device and both didn't work. It's so simple and i used to be able to do it but now it just doesn't work. Am i missing something ? I tried playing with the "State: Enable button" but that didn't worked. Normally i would just do a navigation bar with a button to change view but for this app i really want to you swipe gesture... Thanks
That was a stupid mistake... I dragged the Swipe Gestures on the background images. You need do drag them on the view itself. Just move the background image and drag the swipe gesture on the UIView and it should work!
Lol, I'm having trouble with that too.
I fixed it by making swipe gesture programatically

Can i block appearing control center in ios7 on some views?

I need to disable control center on one key view in case i use "swipe up" gesture for navigation on that view controller
Add the following to your Info.plist:
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
When you "swipe up" it avoid to reveal the control centre. The gestures work normally for your application and it shows only a grabber
Best workaround I've found for this is to present the view controller in full screen. (I'm not talking about the deprecated Full Screen property)
By doing so you force the notification \ control center to be triggered with two swipes instead of one. If the user swipes up or down he'll see a small arrow instead of the all notification\control center. Another swipe on that arrow will open the center view. There's no public way to disable it completely so this is your best bet.
You can't do this. Control Center is a apple implemented feature. This is the same thing as notification center, which you also cannot disable.
You can't do it. But you can warn users that they can disable it from the "Settings" (not that I would suggest you do this, unless you want to make your users mad)

Resources