Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1.1.7 #63

Merged
merged 8 commits into from
Jan 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Library Size just ~ 50 KB.
```gradle

dependencies {
compile 'com.github.anastr:speedviewlib:1.1.6'
compile 'com.github.anastr:speedviewlib:1.1.7'
}

```
Expand All @@ -38,7 +38,7 @@ for **maven**
<dependency>
<groupId>com.github.anastr</groupId>
<artifactId>speedviewlib</artifactId>
<version>1.1.6</version>
<version>1.1.7</version>
<type>pom</type>
</dependency>
```
Expand All @@ -49,14 +49,14 @@ choose one of Speedometers, gauges and add it to your `Layout.xml`, here we use

<com.github.anastr.speedviewlib.SpeedView
android:id="@+id/speedView"
android:layout_width="250dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

```

for all speedometers and gauges, this simple method to smoothly change speed:
```java
SpeedView speedometer = (SpeedView) findViewById(R.id.speedView);
SpeedView speedometer = findViewById(R.id.speedView);

// move to 50 Km/s
speedometer.speedTo(50);
Expand All @@ -74,7 +74,7 @@ and also you can see **Advanced Usage** in [Usage - Wiki](https://github.com/ana
<img src="/images/usage/StartEndDegree.png" width="40%" />
<img src="/images/usage/WorkWithNote.gif" width="35%" />

## we have **9 Speedometers, Gauges** :
## All Speedometers, Gauges :

<table style="width:100%">
<tr>
Expand All @@ -90,7 +90,7 @@ and also you can see **Advanced Usage** in [Usage - Wiki](https://github.com/ana
<pre>
&lt; com.github.anastr.speedviewlib.SpeedView
android:id="@+id/speedView"
android:layout_width="300dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</pre>
</td>
Expand All @@ -103,7 +103,7 @@ and also you can see **Advanced Usage** in [Usage - Wiki](https://github.com/ana
<pre>
&lt; com.github.anastr.speedviewlib.DeluxeSpeedView
android:id="@+id/deluxeSpeedView"
android:layout_width="300dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</pre>
</td>
Expand All @@ -116,7 +116,7 @@ and also you can see **Advanced Usage** in [Usage - Wiki](https://github.com/ana
<pre>
&lt; com.github.anastr.speedviewlib.AwesomeSpeedometer
android:id="@+id/awesomeSpeedometer"
android:layout_width="300dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</pre>
</td>
Expand All @@ -129,7 +129,7 @@ and also you can see **Advanced Usage** in [Usage - Wiki](https://github.com/ana
<pre>
&lt; com.github.anastr.speedviewlib.RaySpeedometer
android:id="@+id/raySpeedometer"
android:layout_width="300dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</pre>
</td>
Expand All @@ -142,7 +142,7 @@ and also you can see **Advanced Usage** in [Usage - Wiki](https://github.com/ana
<pre>
&lt; com.github.anastr.speedviewlib.PointerSpeedometer
android:id="@+id/pointerSpeedometer"
android:layout_width="300dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</pre>
</td>
Expand All @@ -155,7 +155,7 @@ and also you can see **Advanced Usage** in [Usage - Wiki](https://github.com/ana
<pre>
&lt; com.github.anastr.speedviewlib.TubeSpeedometer
android:id="@+id/tubeSpeedometer"
android:layout_width="300dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</pre>
</td>
Expand All @@ -168,7 +168,7 @@ and also you can see **Advanced Usage** in [Usage - Wiki](https://github.com/ana
<pre>
&lt; com.github.anastr.speedviewlib.ImageSpeedometer
android:id="@+id/imageSpeedometer"
android:layout_width="300dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:sv_image="@drawable/your_image" />
</pre>
Expand Down Expand Up @@ -208,7 +208,7 @@ and also you can see **Advanced Usage** in [Usage - Wiki](https://github.com/ana
* add fuel gauge component.
* build new custom speedometer.

your `pull request` is always Welcome, please review the **[rules of contribution](https://github.com/anastr/SpeedView/wiki/Contributing)** to make useful change.
your `pull request` is always Welcome, please review the **[rules of contribution](https://github.com/anastr/SpeedView/blob/master/CONTRIBUTING.md)** to make useful change.

## Coming Soon ...
i well try to draw this Speedometer.
Expand Down
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
compileSdkVersion 27
buildToolsVersion '27.0.0'

defaultConfig {
applicationId "com.github.anastr.speedview"
minSdkVersion 14
targetSdkVersion 26
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
Expand All @@ -23,6 +23,6 @@ android {
}

dependencies {
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:appcompat-v7:27.+'
compile project(':speedviewlib')
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_awesome_speedometer);

awesomeSpeedometer = (AwesomeSpeedometer) findViewById(R.id.awesomeSpeedometer);
seekBar = (SeekBar) findViewById(R.id.seekBar);
speedTo = (Button) findViewById(R.id.speedTo);
realSpeedTo = (Button) findViewById(R.id.realSpeedTo);
stop = (Button) findViewById(R.id.stop);
textSpeed = (TextView) findViewById(R.id.textSpeed);
awesomeSpeedometer = findViewById(R.id.awesomeSpeedometer);
seekBar = findViewById(R.id.seekBar);
speedTo = findViewById(R.id.speedTo);
realSpeedTo = findViewById(R.id.realSpeedTo);
stop = findViewById(R.id.stop);
textSpeed = findViewById(R.id.textSpeed);

speedTo.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down
24 changes: 12 additions & 12 deletions app/src/main/java/com/github/anastr/speedview/ControlActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_control);

speedView = (SpeedView) findViewById(R.id.awesomeSpeedometer);
seekBar = (SeekBar) findViewById(R.id.seekBar);
textSpeed = (TextView) findViewById(R.id.textSpeed);
maxSpeed = (EditText) findViewById(R.id.maxSpeed);
speedometerWidth = (EditText) findViewById(R.id.speedometerWidth);
withTremble = (CheckBox) findViewById(R.id.withTremble);
speedView = findViewById(R.id.awesomeSpeedometer);
seekBar = findViewById(R.id.seekBar);
textSpeed = findViewById(R.id.textSpeed);
maxSpeed = findViewById(R.id.maxSpeed);
speedometerWidth = findViewById(R.id.speedometerWidth);
withTremble = findViewById(R.id.withTremble);

withTremble.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
Expand Down Expand Up @@ -87,7 +87,7 @@ public void setSpeedometerWidth(View view) {
}

public void setSpeedTextSize(View view) {
EditText speedTextSize = (EditText) findViewById(R.id.speedTextSize);
EditText speedTextSize = findViewById(R.id.speedTextSize);
try {
float size = Float.parseFloat(speedTextSize.getText().toString());
speedView.setSpeedTextSize(size);
Expand All @@ -98,7 +98,7 @@ public void setSpeedTextSize(View view) {
}

public void setIndicatorColor(View view) {
EditText indicatorColor = (EditText) findViewById(R.id.indicatorColor);
EditText indicatorColor = findViewById(R.id.indicatorColor);
try{
speedView.setIndicatorColor(Color.parseColor(indicatorColor.getText().toString()));
} catch (Exception e) {
Expand All @@ -107,7 +107,7 @@ public void setIndicatorColor(View view) {
}

public void setCenterCircleColor(View view) {
EditText centerCircleColor = (EditText) findViewById(R.id.centerCircleColor);
EditText centerCircleColor = findViewById(R.id.centerCircleColor);
try{
speedView.setCenterCircleColor(Color.parseColor(centerCircleColor.getText().toString()));
} catch (Exception e) {
Expand All @@ -116,7 +116,7 @@ public void setCenterCircleColor(View view) {
}

public void setLowSpeedColor(View view) {
EditText lowSpeedColor = (EditText) findViewById(R.id.lowSpeedColor);
EditText lowSpeedColor = findViewById(R.id.lowSpeedColor);
try{
speedView.setLowSpeedColor(Color.parseColor(lowSpeedColor.getText().toString()));
} catch (Exception e) {
Expand All @@ -125,7 +125,7 @@ public void setLowSpeedColor(View view) {
}

public void setMediumSpeedColor(View view) {
EditText mediumSpeedColor = (EditText) findViewById(R.id.mediumSpeedColor);
EditText mediumSpeedColor = findViewById(R.id.mediumSpeedColor);
try{
speedView.setMediumSpeedColor(Color.parseColor(mediumSpeedColor.getText().toString()));
} catch (Exception e) {
Expand All @@ -134,7 +134,7 @@ public void setMediumSpeedColor(View view) {
}

public void setHighSpeedColor(View view) {
EditText highSpeedColor = (EditText) findViewById(R.id.highSpeedColor);
EditText highSpeedColor = findViewById(R.id.highSpeedColor);
try{
speedView.setHighSpeedColor(Color.parseColor(highSpeedColor.getText().toString()));
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_create_programmatically);

rootSpeedometer = (LinearLayout) findViewById(R.id.root_speedometer);
rootSpeedometer = findViewById(R.id.root_speedometer);

seekBar = (SeekBar) findViewById(R.id.seekBar);
ok = (Button) findViewById(R.id.ok);
textSpeed = (TextView) findViewById(R.id.textSpeed);
seekBar = findViewById(R.id.seekBar);
ok = findViewById(R.id.ok);
textSpeed = findViewById(R.id.textSpeed);

ok.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_deluxe_speed);

deluxeSpeedView = (DeluxeSpeedView) findViewById(R.id.deluxeSpeedView);
seekBar = (SeekBar) findViewById(R.id.seekBar);
ok = (Button) findViewById(R.id.ok);
textSpeed = (TextView) findViewById(R.id.textSpeed);
withTremble = (CheckBox) findViewById(R.id.withTremble);
withEffects = (CheckBox) findViewById(R.id.withEffects);
deluxeSpeedView = findViewById(R.id.deluxeSpeedView);
seekBar = findViewById(R.id.seekBar);
ok = findViewById(R.id.ok);
textSpeed = findViewById(R.id.textSpeed);
withTremble = findViewById(R.id.withTremble);
withEffects = findViewById(R.id.withEffects);

ok.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_image_speedometer);

imageSpeedometer = (ImageSpeedometer) findViewById(R.id.imageSpeedometer);
seekBar = (SeekBar) findViewById(R.id.seekBar);
ok = (Button) findViewById(R.id.ok);
textSpeed = (TextView) findViewById(R.id.textSpeed);
imageSpeedometer = findViewById(R.id.imageSpeedometer);
seekBar = findViewById(R.id.seekBar);
ok = findViewById(R.id.ok);
textSpeed = findViewById(R.id.textSpeed);

ok.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

ListView listView = (ListView) findViewById(R.id.list);
ListView listView = findViewById(R.id.list);

String[] values = new String[] {
"1. Speed View",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pointer);

pointerSpeedometer = (PointerSpeedometer) findViewById(R.id.pointerSpeedometer);
seekBarSpeed = (SeekBar) findViewById(R.id.seekBarSpeed);
ok = (Button) findViewById(R.id.ok);
textSpeed = (TextView) findViewById(R.id.textSpeed);
textSpeedChange = (TextView) findViewById(R.id.textSpeedChange);
pointerSpeedometer = findViewById(R.id.pointerSpeedometer);
seekBarSpeed = findViewById(R.id.seekBarSpeed);
ok = findViewById(R.id.ok);
textSpeed = findViewById(R.id.textSpeed);
textSpeedChange = findViewById(R.id.textSpeedChange);

ok.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down
16 changes: 8 additions & 8 deletions app/src/main/java/com/github/anastr/speedview/RayActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ray);

raySpeedometer = (RaySpeedometer) findViewById(R.id.raySpeedometer);
seekBarSpeed = (SeekBar) findViewById(R.id.seekBarSpeed);
seekBarDegree = (SeekBar) findViewById(R.id.seekBarDegree);
seekBarWidth = (SeekBar) findViewById(R.id.seekBarWidth);
ok = (Button) findViewById(R.id.ok);
textSpeed = (TextView) findViewById(R.id.textSpeed);
textDegree = (TextView) findViewById(R.id.textDegree);
textWidth = (TextView) findViewById(R.id.textWidth);
raySpeedometer = findViewById(R.id.raySpeedometer);
seekBarSpeed = findViewById(R.id.seekBarSpeed);
seekBarDegree = findViewById(R.id.seekBarDegree);
seekBarWidth = findViewById(R.id.seekBarWidth);
ok = findViewById(R.id.ok);
textSpeed = findViewById(R.id.textSpeed);
textDegree = findViewById(R.id.textDegree);
textWidth = findViewById(R.id.textWidth);

ok.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_speed_text_position);

speedometer = (Speedometer) findViewById(R.id.speedometer);
speedometer = findViewById(R.id.speedometer);

assert speedometer != null;
speedometer.speedTo(40);

Spinner spinner = (Spinner) findViewById(R.id.spinner);
Spinner spinner = findViewById(R.id.spinner);
assert spinner != null;
spinner.setOnItemSelectedListener(this);

Expand All @@ -41,7 +41,7 @@ protected void onCreate(Bundle savedInstanceState) {
categories.add("BOTTOM_CENTER");
categories.add("BOTTOM_RIGHT");

ArrayAdapter<String> dataAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, categories);
ArrayAdapter<String> dataAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, categories);
spinner.setAdapter(dataAdapter);
spinner.setSelection(7);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_speed_view);

speedView = (SpeedView) findViewById(R.id.speedView);
seekBar = (SeekBar) findViewById(R.id.seekBar);
ok = (Button) findViewById(R.id.ok);
textSpeed = (TextView) findViewById(R.id.textSpeed);
speedView = findViewById(R.id.speedView);
seekBar = findViewById(R.id.seekBar);
ok = findViewById(R.id.ok);
textSpeed = findViewById(R.id.textSpeed);

ok.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_start_end_degree);

speedometer = (Speedometer) findViewById(R.id.speedometer);
seekBarStartDegree = (SeekBar) findViewById(R.id.seekBarStartDegree);
seekBarEndDegree = (SeekBar) findViewById(R.id.seekBarEndDegree);
textStartDegree = (TextView) findViewById(R.id.textStartDegree);
textEndDegree = (TextView) findViewById(R.id.textEndDegree);
speedometer = findViewById(R.id.speedometer);
seekBarStartDegree = findViewById(R.id.seekBarStartDegree);
seekBarEndDegree = findViewById(R.id.seekBarEndDegree);
textStartDegree = findViewById(R.id.textStartDegree);
textEndDegree = findViewById(R.id.textEndDegree);

speedometer.speedPercentTo(50);

Expand Down
Loading