Android Studio Circle Menu Animation with Navigation
Build Gradle Project
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
Android Studio Design Animation
Build Gradle Module
implementation 'com.github.Hitomis:CircleMenu:v1.1.0'
Android Studio Design Animation
Main Activity
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/gradientsgreen"
tools:context=".design3bag1">
<com.hitomi.cmlibrary.CircleMenu
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/Circle_menu"/>
</androidx.constraintlayout.widget.ConstraintLayout>
Android Studio Design Animation
Activity Main
package com.designapp
import android.content.Intent
import android.graphics.Color
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_design4part5.*
class design4part5 : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_design4part5)
val arrList = arrayOf("bell","download","bitcoin","error","book")
Circle_menu.setMainMenu(Color.parseColor("#CDCDCD"),R.drawable.bug,R.drawable.bgapp)
.addSubMenu(Color.parseColor("#25BCFE"),R.drawable.bell)
.addSubMenu(Color.parseColor("#6D4C41"),R.drawable.downloadicon)
.addSubMenu(Color.parseColor("#ff0000"),R.drawable.bitcoin)
.addSubMenu(Color.parseColor("#1a237e"),R.drawable.error)
.addSubMenu(Color.parseColor("#03a9f4"),R.drawable.book)
.setOnMenuSelectedListener {
index -> Toast.makeText(this,"Selected" +arrList[index],Toast.LENGTH_SHORT).show()
when(arrList[index])
{
"bell" -> {
val intent = Intent(this, bell :: class.java)
startActivity(intent)
}
"download" -> {
val intent = Intent(this, download :: class.java)
startActivity(intent)
}
"bitcoin" -> {
val intent = Intent(this, bitcoin :: class.java)
startActivity(intent)
}
"error" -> {
val intent = Intent(this, error :: class.java)
startActivity(intent)
}
"book" -> {
val intent = Intent(this, book :: class.java)
startActivity(intent)
}
}
}
}
}
0 Response to "Android Studio Circle Menu Animation with Navigation"
Post a Comment