Skip to content
This repository was archived by the owner on Oct 9, 2022. It is now read-only.

Commit aecb8f5

Browse files
bug fixes
1 parent aa936b2 commit aecb8f5

File tree

8 files changed

+91
-11
lines changed

8 files changed

+91
-11
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: android
22
jdk: oraclejdk8
3-
# Use the Travis Container-Based Infrastructure
3+
44
sudo: false
55

66
android:
@@ -14,4 +14,4 @@ android:
1414
- 'android-sdk-license-.+'
1515

1616
script:
17-
- ./gradlew clean assembleDebug -x library:signArchives -PdisablePreDex
17+
- ./gradlew clean assembleDebug -PdisablePreDex

CONTRIBUTING.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,49 @@
1-
* Amin Yazdanpanah , https://github.com/aminyazdanpanah
1+
# Contributing
2+
3+
Contributions are **welcome** and will be fully **credited**.
4+
5+
Please read and understand the contribution guide before creating an issue or pull request.
6+
7+
## Etiquette
8+
9+
This project is open source, and as such, the maintainers give their free time to build and maintain the source code
10+
held within. They make the code freely available in the hope that it will be of use to other developers. It would be
11+
extremely unfair for them to suffer abuse or anger for their hard work.
12+
13+
Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the
14+
world that developers are civilized and selfless people.
15+
16+
It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
17+
quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.
18+
19+
## Viability
20+
21+
When requesting or submitting new features, first consider whether it might be useful to others. Open
22+
source projects are used by many developers, who may have entirely different needs to your own. Think about
23+
whether or not your feature is likely to be used by other users of the project.
24+
25+
## Procedure
26+
27+
Before filing an issue:
28+
29+
- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
30+
- Check to make sure your feature suggestion isn't already present within the project.
31+
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
32+
- Check the pull requests tab to ensure that the feature isn't already in progress.
33+
34+
Before submitting a pull request:
35+
36+
- Check the codebase to ensure that your feature doesn't already exist.
37+
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
38+
39+
## Requirements
40+
41+
If the project maintainer has any additional requirements, you will find them listed here.
42+
43+
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
44+
45+
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
46+
47+
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
48+
49+
**Happy coding**!

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# Google Maps Chart for Android
1+
# 🗺 Google Maps Chart for Android
22

33
[![Build Status](https://travis-ci.org/aminyazdanpanah/google-maps-android-charts.svg?branch=master)](https://travis-ci.org/aminyazdanpanah/google-maps-android-charts)
4+
[![](https://jitpack.io/v/aminyazdanpanah/google-maps-android-charts.svg)](https://jitpack.io/#aminyazdanpanah/google-maps-android-charts)
45

56
A Google Maps Android library to render marker clusters as charts categorized on map with specified values.
67
Available Charts: [Pie Chart](#pie-chart), [Bar Chart](#bar-chart) and [Donut Chart](#donut-chart)
@@ -28,17 +29,35 @@ This library is a wrapper around "[Google Maps Android API utility library](http
2829

2930
Before using this library, please read the "[Google Maps Android API utility library documentation](https://developers.google.com/maps/documentation/android-sdk/utility/)" .
3031

32+
You can see the demo for more details.
33+
34+
NOTE:
35+
-Before Building the demo, you must [get an API key](https://developers.google.com/maps/documentation/android-sdk/signup) which you can then add to your demo app.
36+
3137
### Marker
3238

3339
Firstly, you need to generate markers that have a name.
3440
You must initialize `CMaker` class that is implemented `ClusterItem` and pass the LarLng, the name of marker and the drawable Id. Also you can set the title and snippet of marker.
3541

3642
```java
3743

38-
CMarker marker = new CMarker(new LatLng(), "Somthing", 12355468);
39-
marker.setTitle("somthing");
44+
CMarker marker = new CMarker(new LatLng(52.22222, 36.25622), "Ford", 12355468); //(Location of marker, specifed name, the drawable marker ID)
45+
marker.setTitle("somthing you want to display when you tap on marker");
46+
47+
48+
CMarker marker2 = new CMarker(new LatLng(52.25552, 36.25624), "Toyota", 12355469); //(Location of marker, specifed name, the drawable marker ID)
49+
marker.setTitle("somthing you want to display when you tap on marker");
50+
51+
//...
52+
```
53+
Add the marker to the `addItem()` method;
4054

55+
```java
56+
clusterManager.addItem(marker);
57+
clusterManager.addItem(marker2);
58+
//...
4159
```
60+
4261
### Chart
4362

4463
This library uses the the name to calculate the values of charts. In face, the number of each slice of chart is sum of names.

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ buildscript {
77

88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.3.0'
11-
10+
classpath 'com.android.tools.build:gradle:3.3.2'
11+
classpath 'com.novoda:bintray-release:0.9'
1212
// NOTE: Do not place your application dependencies here; they belong
1313
// in the individual module build.gradle files
1414
}

library/build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
apply plugin: 'com.android.library'
2+
apply plugin: 'com.novoda.bintray-release'
3+
4+
publish {
5+
userOrg = 'yazdanpanah'
6+
groupId = 'com.aminyazdanpanah'
7+
artifactId = 'google-maps-android-charts'
8+
publishVersion = '1.3'
9+
desc = 'A Google Maps Android library to render marker clusters as charts categorized on map with specified values.'
10+
website = 'https://github.com/aminyazdanpanah/google-maps-android-charts'
11+
}
212

313
android {
414
compileSdkVersion 28

library/src/main/java/com/aminyazdanpanah/maps/android/charts/BarChart.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import android.graphics.Color;
2222
import android.graphics.ColorFilter;
2323
import android.graphics.Paint;
24+
import android.graphics.PixelFormat;
2425
import android.graphics.drawable.Drawable;
2526
import android.util.DisplayMetrics;
2627

@@ -71,7 +72,7 @@ public void setColorFilter(@Nullable ColorFilter colorFilter) {
7172

7273
@Override
7374
public int getOpacity() {
74-
return 0;
75+
return PixelFormat.UNKNOWN;
7576
}
7677

7778
private static float convertDpToPixel(float dp) {

library/src/main/java/com/aminyazdanpanah/maps/android/charts/DonutChart.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import android.graphics.ColorFilter;
2424
import android.graphics.Paint;
2525
import android.graphics.Path;
26+
import android.graphics.PixelFormat;
2627
import android.graphics.RadialGradient;
2728
import android.graphics.RectF;
2829
import android.graphics.Shader.TileMode;
@@ -132,7 +133,7 @@ public void setColorFilter(@Nullable ColorFilter colorFilter) {
132133

133134
@Override
134135
public int getOpacity() {
135-
return 0;
136+
return PixelFormat.UNKNOWN;
136137
}
137138

138139
private void drawDonut(Canvas canvas, Paint paint, float start, float sweep) {

library/src/main/java/com/aminyazdanpanah/maps/android/charts/PieChart.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import android.graphics.Color;
2222
import android.graphics.ColorFilter;
2323
import android.graphics.Paint;
24+
import android.graphics.PixelFormat;
2425
import android.graphics.RectF;
2526
import android.graphics.drawable.Drawable;
2627
import android.util.DisplayMetrics;
@@ -82,7 +83,7 @@ public void setColorFilter(ColorFilter colorFilter) {
8283

8384
@Override
8485
public int getOpacity() {
85-
return 0;
86+
return PixelFormat.UNKNOWN;
8687
}
8788

8889
private static float convertDpToPixel(float dp){

0 commit comments

Comments
 (0)