Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.mosamabinomar:androidequalizer:2.2'
}
dependencies {
implementation("com.github.mosamabinomar:androidequalizer:2.2")
}
<dependency>
<groupId>com.github.mosamabinomar</groupId>
<artifactId>androidequalizer</artifactId>
<version>2.2</version>
</dependency>
libraryDependencies += "com.github.mosamabinomar" % "androidequalizer" % "2.2"
:dependencies [[com.github.mosamabinomar/androidequalizer "2.2"]]
Android Equalizer View that can also manage the audio track frequencies
Add Equalizer in your Android app
<div> <img src="https://github.com/bullheadandplato/AndroidEqualizer/blob/master/screenshots/Screenshot_1569785199.png" width="300" height="500"/> <img src="https://raw.githubusercontent.com/mosamabinomar/AndroidEqualizer/master/screenshots/Screenshot_1522935541.png" width="300" height="500"/> <img src="https://raw.githubusercontent.com/mosamabinomar/AndroidEqualizer/master/screenshots/Screenshot_1522962328.png" width="300" height="500"/> <img src="https://raw.githubusercontent.com/mosamabinomar/AndroidEqualizer/master/screenshots/Screenshot_1522962331.png" width="300" height="500"/> </div>In settings.gradle you can add the repositories you want to add to the project:
repositories {
google()
jcenter() // Warning: this repository is going to shut down soon
mavenCentral()
maven { url 'https://www.jitpack.io' } // this is the line to be added
}
and:
dependencies {
implementation 'com.github.bullheadandplato:AndroidEqualizer:2.2'
}
if not using AndroidX.
it will not have DialogEqualizerFragment
or any other improvements
dependencies {
implementation 'com.github.bullheadandplato:AndroidEqualizer:1.0'
}
DialogEqualizerFragment fragment = DialogEqualizerFragment.newBuilder()
.setAudioSessionId(sessionId)
.themeColor(ContextCompat.getColor(this, R.color.primaryColor))
.textColor(ContextCompat.getColor(this, R.color.textColor))
.accentAlpha(ContextCompat.getColor(this, R.color.playingCardColor))
.darkColor(ContextCompat.getColor(this, R.color.primaryDarkColor))
.setAccentColor(ContextCompat.getColor(this, R.color.secondaryColor))
.build();
fragment.show(getSupportFragmentManager(), "eq");
Create a frame in your layout file.
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:id="@+id/eqFrame"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
In your Activity class
int sessionId = mediaPlayer.getAudioSessionId();
mediaPlayer.setLooping(true);
EqualizerFragment equalizerFragment = EqualizerFragment.newBuilder()
.setAccentColor(Color.parseColor("#4caf50"))
.setAudioSessionId(sessionId)
.build();
getSupportFragmentManager().beginTransaction()
.replace(R.id.eqFrame, equalizerFragment)
.commit();
This work is mostly borrowed from https://github.com/harjot-oberai/MusicDNA