https://github.com/Yalantis/GuillotineMenu-Android
1.首先这就是 让menu 直接转的 所以 如果要图标旋转的 效果 得 要俩个view 还得在toobar 里边 ~~~~
2.动画可以换换 属性动画xxxxx
https://github.com/zhangqifan1/Demo_ok888
duantoutai 包直接CV 然后找来图片一个||| 一个 三 !!!!!
public class MainActivity extends AppCompatActivity {
private static final long RIPPLE_DURATION = 250;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = findViewById(R.id.toolbar);
FrameLayout root=findViewById(R.id.root);
View icon=findViewById(R.id.icon);
if (toolbar != null) {
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(null);
}
View guillotineMenu = LayoutInflater.from(this).inflate(R.layout.custom_daozi, null);
root.addView(guillotineMenu);
new GuillotineAnimation.GuillotineBuilder(guillotineMenu, guillotineMenu.findViewById(R.id.iconchange), icon)
.setStartDelay(RIPPLE_DURATION)
.setActionBarViewForAnimation(toolbar)
.setClosedOnStart(true)
.build();
}
}
2.XML
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#d6000000"
android:orientation="vertical">
<View
android:background="#f0f"
android:layout_width="match_parent"
android:layout_height="?actionBarSize"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
app:contentInsetStart="0dp"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:layout_height="?actionBarSize"
android:layout_width="match_parent">
<ImageView
android:id="@+id/icon"
android:src="@drawable/ic_menu_90"
android:padding="6dp"
android:layout_height="40dp"
android:layout_width="40dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="我是标题"
android:textSize="22sp" />
</android.support.v7.widget.Toolbar>
<View
android:background="#ffffff"
android:layout_width="match_parent"
android:layout_height="1dp"/>
<ImageView
android:src="@mipmap/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:src="@mipmap/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:src="@mipmap/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</FrameLayout>
自定义的
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f0f"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
app:contentInsetStart="0dp"
android:layout_height="?actionBarSize">
<ImageView
android:id="@+id/iconchange"
android:src="@drawable/ic_menu"
android:padding="6dp"
android:layout_width="40dp"
android:layout_height="40dp" />
</android.support.v7.widget.Toolbar>
<TextView
android:text="我就是边边里出来的!"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="我也是边边里出来的!"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="我还是边边里出来的!"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="我不是边边里出来的!"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>