1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| public void onSousMenuClick(String title) {
this.animatedLayout = (RelativeLayout) findViewById(R.id.animated_layout);
int[] location = new int[] {0,0};
this.animatedLayout.getLocationOnScreen(location);
Log.v("x coord", ""+location[0]);
Log.v("y coord", ""+location[1]);
this.takeNreplaceLayout = (RelativeLayout) findViewById(R.id.takenreplace_layout);
this.takeNreplaceLayout.removeView(animatedLayout);
AbsoluteLayout.LayoutParams lay_params = new AbsoluteLayout.LayoutParams(animatedLayout.getWidth(), animatedLayout.getHeight(), location[0], location[1]);
this.animatedLayout.setLayoutParams(lay_params);
this.theAbsoluteLayout.addView(animatedLayout);
/**layoutMenuContent > liste deroulante ou insérer l'animated layout*/
layoutMenuContent.setVisibility(View.VISIBLE);
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.show(fragmentMenuContent);
ft.show(fragmentContent);
layoutMenuSousMenu.setVisibility(View.GONE);
layoutSousMenu.setVisibility(View.GONE);
ft.hide(fragmentMenuSousMenu);
ft.hide(fragmentSousMenu);
//ft.addToBackStack("");
ft.commit();
startAnimation(R.id.animated_layout, R.anim.animation_homesousmenu_2 , true);
}
public void afterAnimationEffect() {
this.m_expandableList = (ExpandableListView) layoutMenuContent.findViewById(R.id.expandableHome);
this.m_expandableList.expandGroup(1);
/**on remet le layout dans son container d'origine */
this.theAbsoluteLayout.removeView(animatedLayout);
this.takeNreplaceLayout.addView(animatedLayout);
} |
Partager