2017-12-18 8 views
0

私はアプリでyalantisのギロチンメニューを使用していますが、アイテムをクリックしてメニューを閉じるときに閉じるアニメーションを挿入するにはどうすればいいですか?ギロチンメニューの項目をクリックしたときの閉じアニメーションの挿入方法は?

これは私がオブジェクトを初期化GuillotineAnimationこれまで

 final View guillotineMenu = LayoutInflater.from(this).inflate(R.layout.guillotine, null); 
    root.addView(guillotineMenu); 
    LinearLayout home = (LinearLayout) findViewById(R.id.home_g); 
    home.setOnClickListener(new View.OnClickListener() { 
     @Override 
     public void onClick(View view) { 
      openHomeFragment(); 

     } 
    }); 
    LinearLayout news = (LinearLayout) findViewById(R.id.news_g); 
    news.setOnClickListener(new View.OnClickListener() { 
     @Override 
     public void onClick(View view) { 
      openNewsFragment(); 

     } 
    }); 

new GuillotineAnimation.GuillotineBuilder(guillotineMenu, guillotineMenu.findViewById(R.id.guillotine_hamburger), contentHamburger) 
      .setStartDelay(RIPPLE_DURATION) 
      .setActionBarViewForAnimation(toolbar) 
      .setClosedOnStart(true) 
      .build(); 

答えて

0

をやったものです。

GuillotineAnimation animation = new GuillotineAnimation.GuillotineBuilder(guillotineMenu, guillotineMenu.findViewById(R.id.guillotine_hamburger), contentHamburger) 
      .setStartDelay(RIPPLE_DURATION) 
      .setActionBarViewForAnimation(toolbar) 
      .setClosedOnStart(true) 
      .build(); 

// Close with animation 
     animation.close(); 
関連する問題