ArcMenu
自己封装的扇形弹出菜单库。
Gradle dependency build.gradle
repositories { mavenCentral() mavenLocal() }
...
dependencies {
compile 'com.github.CCCCoder:ArcMenu:v1.0'
}
Example Usage:
你可以根据你的需要添加各个子项的icon
position:位置在左上,左下,右上,右下四个位置。
android:id="@+id/arc_menu"
custom:position="left_bottom"
custom:radius="250dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/composer_button">
android:id="@+id/btn_iv"
android:layout_centerInParent="true"
android:src="@drawable/composer_icn_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:tag="camera"
android:src="@drawable/composer_camera"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:tag="music"
android:src="@drawable/composer_music"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:tag="place"
android:src="@drawable/composer_place"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:tag="sleep"
android:src="@drawable/composer_sleep"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:tag="thought"
android:src="@drawable/composer_thought"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:tag="with"
android:src="@drawable/composer_with"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
你可以像这样使用:
arcMenu = (ArcMenu) findViewById(R.id.arc_menu);
arcMenu.setmMenuItemClickListener(new ArcMenu.OnMenuItemClickListener() {
@Override
public void onClick(View view, int pos) {
Toast.makeText(MainActivity.this,"pos:"+pos,Toast.LENGTH_SHORT).show();
}
});
arcMenu.setRadius(200);