I am currently working on the transition effect for my dialogue. Please see the image given below:
Access to my dialogue The animation should be above the middle while the exit animation should be above the top. I am using the following XML animation, but unfortunately, they are not working.
slide_down.xml
& lt ;? Xml version = "1.0" encoding = "UTF-8" & gt; & Lt; Set xmlns: android = "http://schemas.android.com/apk/res/android" & gt; & Lt; Android Translation: fromYDelta = "100% p" Android: toYDelta = "0" Android: Period = "1000" /> & Lt; / Set & gt; slide_up.xml
& lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Translation xmlns: Android = "http://schemas.android.com/apk/res/android" Android: fromYDelta = "0% p" Android: toYDelta = "50% p" Android: Period = "1000" /> ; Edit: This is not the usual dialog . This is a theme with a activity . The dialog applies with AndroidManifest.xml
If you are creating a dialogue as an activity then you can follow this approach
You can create animation classes:
Public category DropDownToMiddleAnimation Animation Expanded { Public entity height, width; @ Override public zero start (int width, integer height, int maternal woth, IT parent) [// Todo auto-generated method stub super interlise (width, height, parentvoth, parentheit); This.width = width; This.height = Height; SetDuration (500); SetFillAfter (true); SetInterpolator (New LinearInterpolator ()); } Camera camera = new camera (); @ Override protected void reflectivity (float interplaced time, transformation t) {// Todo auto-generated method stub super.apple transassemation (interpolated time, t); Matrix matrix = t.get metrics (); Camera.save (); Camera.getMatrix (matrix); Matrix.Settranslate (0, ((height / 2) * interpolated time)); Matrix Pretranslate (0, -high); Camera.restore (); This.setAnimationListener (this); } and:
public class MiddleToTopAnimation expanded animation {public entity height, width; @ Override public zero start (int width, integer height, int maternal woth, IT parent) [// Todo auto-generated method stub super interlise (width, height, parentvoth, parentheit); This.width = width; This.height = Height; SetDuration (500); SetFillAfter (true); SetInterpolator (New LinearInterpolator ()); } Camera camera = new camera (); @ Override protected void reflectivity (float interplaced time, transformation t) {// Todo auto-generated method stub super.apple transassemation (interpolated time, t); Matrix matrix = t.get metrics (); Camera.save (); Camera.getMatrix (matrix); Matrix .Settranslate (0, - ((height / 2) * Interpolated time); // Here is the change matrix .preTranslate (0, -height); Camera.restore (); This.setAnimationListener (this); } and experiment with your dialog
LinearLayout ll = (LinearLayout) findViewById (R.id.parentLayout); // layout in xml in the original, which acts as a background in custom dialog. Start animation (new dropdowntom milied animation ()); // Use with the launch of the dialog. Start animation (new midlotopop animation); // While rejecting the dialog,
Comments
Post a Comment