Shake coupon, mail shake coupon
Some time ago, I received a request saying that I would like to shake the coupon. The effect is as follows:
Figure 1 Figure 2 Figure 3 Figure 4 Figure 5
1
Run the ShakeCouponsSubmit method in the controller.
1 [HttpPost] 2 public JsonResult shake processing method () 3 {4 // method vari
The shaking is how to realize it ~ found that the original iOS supportThere's a way to do this in Uiresponder.-(void) Motionbegan: (uieventsubtype) Motion withevent: (uievent *) event __osx_available_starting (__mac_na,__iphone_3 _0);-(void) motionended: (uieventsubtype) Motion withevent: (uievent *) event __osx_available_starting (__mac_na,__iphone_3 _0);-(void) motioncancelled: (uieventsubtype) Motion withevent: (uievent *) event __osx_available_starting (__mac_na,__ IPHONE_3_0);This is the wa
Since the deviceorientation of HTML 5 has been developed, many developers have started to study their features and have developed applications such as shaking, pedometer, and so on. Small series recently Idle bored, also developed a shake a shake Web application, interested in small partners can experience.Sweep code Access650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Backgrou
Import Android.content.Context;
Import Android.hardware.Sensor;
Import android.hardware.SensorEvent;
Import Android.hardware.SensorEventListener;
Import Android.hardware.SensorManager;
/**
*
* A monitor that detects phone shake
* @author Fuzhengchao
*
*/
Public class Shakelistener implements Sensoreventlistener {
//Speed threshold, which acts when the shaking speed reaches this value
private static final int speed_shresho
1. Detects if the device supports gravity sensing event deviceorientationDeviceorientation provides the physical orientation information for a device, represented as a spin-angle function Motionhandler (event) {accgravity = event.acceleration;} for a series of local coordinate systems ;} if (Window. devicemotionevent) { Window.addeventlistener ("Devicemotion", Motionhandler, False); } else { Document.body.innerHTML = "What user agent u r using???";} Simple Start shaking$ (".
The shake function is implemented based on html5 DeviceOrientation, and html5 performs shake-like operations.Since it has been added for a long time and many of my friends are playing, how can I implement the shake Function Based on html5 DeviceOrientation? The following content is shared with you by the Helper's house for your reference.
In HTML5, The DeviceMoti
Android micro-letter shake function to achieve, the recent learning of sensors, want to realize the function of shaking, the Internet to check some information on the collation. If there is a mistake, please correct me.
Development environment
Android Studio 2.2.1
JDK1.7
API 24
Gradle 2.2.1
Related knowledge points
Acceleration Sensor
Tween Animation
Mobile phone Vibration (vibrator)
Short Sound/Sound playback (So
There's a way to do this in Uiresponder.-(void) Motionbegan: (uieventsubtype) motion withevent: (uievent *) event __osx_ Available_starting(__MAC_NA,__IPHONE_3_0);-(void) motionended: (uieventsubtype) motion withevent: (uievent *) event __osx_ Available_starting(__MAC_NA,__IPHONE_3_0);-(void) motioncancelled: (uieventsubtype) motion withevent: (uievent *) event __osx_ Available_starting(__MAC_NA,__IPHONE_3_0);This is the way to perform a shake. So how
Now a lot of mobile site also has similar to the same shake shake function, such as what shake a wave to collect red envelopes, collect gifts and so on1,deviceorientation: Encapsulates the direction sensor data event, can get the mobile phone in the static state of the direction of data, such as the angle of the mobile phone, orientation, orientation, etc.2,devic
Devicemotion Gets the device acceleration information. Its event object returns 3 values, but I use accelerationincludinggravity to consider the effects of gravity. The gravitational value of the earth is 9.81. The z axis of the return is 9.81, but the positive and negative levels are shown in Android, which is +9.81 in the Apple Display-9.81 (most certainly no effect on our calculations, but write it out to let everyone know, lest there is doubt in the test).Note: The units of the returned x, y
The iphone has a good support for shaking, generally two steps: first in the attempt to open the controller to accept the shaking of the switch and then in the method of shaking the trigger to achieve the function you want to achieve.在 UIResponder中存在这么一套方法 - (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0); - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0); - (vo
Hand shake algorithm, hand shake Generator
How can we put the string upside down? We use the two pointers at the beginning and end of the string to scan the two sides in the middle, and constantly exchange the content of the two pointers,
void reverse(int a[], int n){ if(n Then, if you want to reverse the string, for example, if you want to replace the first n characters with the rest of the string, for
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.