// Path: slideOutMenu/menux/src/main/java/mxh/kickassmenu/Util/ViewUtils.java
// public class ViewUtils {
//     private ViewUtils() {
//     }
// 
//     public static void setViewWidths(View view, View[] views) {
//         int w = view.getWidth();
//         int h = view.getHeight();
//         for (int i = 0; i < views.length; i++) {
//             View v = views[i];
//             v.layout((i + 1) * w, 0, (i + 2) * w, h);
//             printView("view[" + i + "]", v);
//         }
//     }
// 
//     public static void printView(String msg, View v) {
//         System.out.println(msg + "=" + v);
//         if (null == v) {
//             return;
//         }
//         System.out.print("[" + v.getLeft());
//         System.out.print(", " + v.getTop());
//         System.out.print(", w=" + v.getWidth());
//         System.out.println(", h=" + v.getHeight() + "]");
//         System.out.println("mw=" + v.getMeasuredWidth() + ", mh=" + v.getMeasuredHeight());
//         System.out.println("scroll [" + v.getScrollX() + "," + v.getScrollY() + "]");
//     }
// 
//     public static void initListView(Context context, ListView listView, String prefix, int numItems, int layout) {
//         // By using setAdpater method in listview we an add string array in list.
//         String[] arr = new String[numItems];
//         for (int i = 0; i < arr.length; i++) {
//             arr[i] = prefix + (i + 1);
//         }
//         listView.setAdapter(new ArrayAdapter<String>(context, layout, arr));
//         listView.setOnItemClickListener(new OnItemClickListener() {
//             @Override
//             public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//                 Context context = view.getContext();
//                 String msg = "item[" + position + "]=" + parent.getItemAtPosition(position);
//                 Toast.makeText(context, msg, Toast.LENGTH_LONG).show();
//                 System.out.println(msg);
//             }
//         });
//     }
// }


import java.util.Date;
import mxh.kickassmenu.R;
import mxh.kickassmenu.Util.ViewUtils;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.TranslateAnimation;
import android.widget.ListView;
                anim = new TranslateAnimation(0, -left, 0, 0);
                animParams.init(0, 0, w, h);
            }

            anim.setDuration(500);
            anim.setAnimationListener(me);
            //Tell the animation to stay as it ended (we are going to set the app.layout first than remove this property)
            anim.setFillAfter(true);


            // Only use fillEnabled and fillAfter if we don't call layout ourselves.
            // We need to do the layout ourselves and not use fillEnabled and fillAfter because when the anim is finished
            // although the View appears to have moved, it is actually just a drawing effect and the View hasn't moved.
            // Therefore clicking on the screen where the button appears does not work, but clicking where the View *was* does
            // work.
            // anim.setFillEnabled(true);
            // anim.setFillAfter(true);

            app.startAnimation(anim);
        }
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.slide_animation_then_call_layout);

        menu = findViewById(R.id.menu);
        app = findViewById(R.id.app);

// Path: slideOutMenu/menux/src/main/java/mxh/kickassmenu/Util/ViewUtils.java
// public class ViewUtils {
//     private ViewUtils() {
//     }
// 
//     public static void setViewWidths(View view, View[] views) {
//         int w = view.getWidth();
//         int h = view.getHeight();
//         for (int i = 0; i < views.length; i++) {
//             View v = views[i];
//             v.layout((i + 1) * w, 0, (i + 2) * w, h);
//             printView("view[" + i + "]", v);
//         }
//     }
// 
//     public static void printView(String msg, View v) {
//         System.out.println(msg + "=" + v);
//         if (null == v) {
//             return;
//         }
//         System.out.print("[" + v.getLeft());
//         System.out.print(", " + v.getTop());
//         System.out.print(", w=" + v.getWidth());
//         System.out.println(", h=" + v.getHeight() + "]");
//         System.out.println("mw=" + v.getMeasuredWidth() + ", mh=" + v.getMeasuredHeight());
//         System.out.println("scroll [" + v.getScrollX() + "," + v.getScrollY() + "]");
//     }
// 
//     public static void initListView(Context context, ListView listView, String prefix, int numItems, int layout) {
//         // By using setAdpater method in listview we an add string array in list.
//         String[] arr = new String[numItems];
//         for (int i = 0; i < arr.length; i++) {
//             arr[i] = prefix + (i + 1);
//         }
//         listView.setAdapter(new ArrayAdapter<String>(context, layout, arr));
//         listView.setOnItemClickListener(new OnItemClickListener() {
//             @Override
//             public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//                 Context context = view.getContext();
//                 String msg = "item[" + position + "]=" + parent.getItemAtPosition(position);
//                 Toast.makeText(context, msg, Toast.LENGTH_LONG).show();
//                 System.out.println(msg);
//             }
//         });
//     }
// }


// Path: slideOutMenu/menux/src/main/java/mxh/kickassmenu/fbstyle/SlideAnimationThenCallLayout.java
import java.util.Date;
import mxh.kickassmenu.R;
import mxh.kickassmenu.Util.ViewUtils;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.TranslateAnimation;
import android.widget.ListView;

                anim = new TranslateAnimation(0, -left, 0, 0);
                animParams.init(0, 0, w, h);
            }

            anim.setDuration(500);
            anim.setAnimationListener(me);
            //Tell the animation to stay as it ended (we are going to set the app.layout first than remove this property)
            anim.setFillAfter(true);


            // Only use fillEnabled and fillAfter if we don't call layout ourselves.
            // We need to do the layout ourselves and not use fillEnabled and fillAfter because when the anim is finished
            // although the View appears to have moved, it is actually just a drawing effect and the View hasn't moved.
            // Therefore clicking on the screen where the button appears does not work, but clicking where the View *was* does
            // work.
            // anim.setFillEnabled(true);
            // anim.setFillAfter(true);

            app.startAnimation(anim);
        }
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.slide_animation_then_call_layout);

        menu = findViewById(R.id.menu);
        app = findViewById(R.id.app);

        ViewUtils.printView("menu", menu);