2017-12-18 82 views
0

我在我的應用程序中使用yalantis的斷頭臺菜單,我怎樣才能把關閉動畫,當我點擊一個項目關閉菜單。點擊斷頭臺菜單中的項目時如何放置關閉動畫?

這是我到目前爲止

 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與對象。

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(); 
相關問題