Dynamic Speedometer UI for Android ⚡ , you can change the color of everything.
minSdkVersion=11
Library Size ~ 9 Kb.
add this line to build.gradle
dependencies {
compile 'com.github.anastr:speedviewlib:1.0.3'
}
we have two views :
add SpeedView to your layout
<com.github.anastr.speedviewlib.SpeedView
android:id="@+id/speedView"
android:layout_width="250dp"
android:layout_height="wrap_content" />
change the speed from your code :
SpeedView speedView = (SpeedView) findViewById(R.id.speedView);
// change speed to 50 Km/h
speedView.speedTo(50);
you can change max speed by this line (default : 100)
speedView.setMaxSpeed(220);
/**
* see also:
* speedView.setWithTremble(false);
* speedView.setIndicatorColor(Color.BLUE);
* speedView.setHighSpeedColor(Color.RED);
* .....
*/
SpeedView with Blur Effects.
add DeluxeSpeedView to your layout
<com.github.anastr.speedviewlib.DeluxeSpeedView
android:id="@+id/deluxeSpeedView"
android:layout_width="250dp"
android:layout_height="wrap_content" />
the same methods in SpeedView
DeluxeSpeedView deluxeSpeedView = (DeluxeSpeedView) findViewById(R.id.deluxeSpeedView);
deluxeSpeedView.speedTo(50);
deluxeSpeedView.setMaxSpeed(220);
special methods for DeluxeSpeedView :
deluxeSpeedView.setWithEffects(false); //def : true
deluxeSpeedView.setSpeedBackgroundColor(Color.YELLOW);
and also you can change everything in XML, see this Attributes :
app:unit="m/s" <!-- def : Km/h -->
app:maxSpeed="220" <!-- def : 100 -->
app:withTremble="false" <!-- def : true -->
app:withBackgroundCircle="false" <!-- def : true -->
app:speedometerWidth="35dp" <!-- def : 30dp -->
app:indicatorColor="#2b38e6"
app:centerCircleColor="#b2f941ff"
app:lowSpeedColor="#58ed21"
app:mediumSpeedColor="#edd029"
app:highSpeedColor="#ec2f33"
app:markColor="#99000000"
app:textColor="#e23900"
app:backgroundCircleColor="#212121"
Attributes just for DeluxeSpeedView :
app:withEffects="false" <!-- def : true -->
app:speedBackgroundColor="#000077"
app:speedTextColor="#000000"
i well try to draw this Speedometer. if you have any idea, image, template please open new issue and give me the image , and i well try to add it to the Library.
Copyright 2016 Anas ALtair
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.