├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── pyz │ │ │ │ └── retrofitdemo │ │ │ │ ├── Constant.java │ │ │ │ ├── bean │ │ │ │ ├── WeatherInfo.java │ │ │ │ ├── WeatherInfoReq.java │ │ │ │ ├── DailyForecast.java │ │ │ │ ├── Temperature.java │ │ │ │ └── WeatherResult.java │ │ │ │ ├── netrequest │ │ │ │ └── NetRequest.java │ │ │ │ ├── RetrofitWrapper.java │ │ │ │ └── model │ │ │ │ └── WeatherInfoModel.java │ │ ├── AndroidManifest.xml │ │ └── assets │ │ │ └── MyEcharts │ │ │ └── myEcharts.html │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── pyz │ │ │ └── retrofitdemo │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── pyz │ │ └── retrofitdemo │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── .idea ├── .name ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── vcs.xml ├── libraries │ ├── junit_4_12.xml │ ├── gson_2_4.xml │ ├── support_annotations_23_3_0.xml │ ├── okio_1_6_0.xml │ ├── rxjava_1_1_1.xml │ ├── okhttp_3_2_0.xml │ ├── hamcrest_core_1_3.xml │ ├── retrofit_2_0_1.xml │ ├── realm_android_0_87_5.xml │ ├── adapter_rxjava_2_0_1.xml │ ├── logger_1_11.xml │ ├── rxandroid_1_1_0.xml │ ├── converter_gson_2_0_0_beta4.xml │ ├── support_vector_drawable_23_3_0.xml │ ├── animated_vector_drawable_23_3_0.xml │ ├── appcompat_v7_23_3_0.xml │ └── support_v4_23_3_0.xml ├── modules.xml ├── runConfigurations.xml ├── compiler.xml ├── gradle.xml └── misc.xml ├── JNChartLib ├── .gitignore ├── ic_launcher-web.png ├── .settings │ └── gradle │ │ └── org.springsource.ide.eclipse.gradle.core.prefs ├── src │ └── com │ │ └── jn │ │ └── chart │ │ ├── interfaces │ │ ├── dataprovider │ │ │ ├── BubbleDataProvider.java │ │ │ ├── CandleDataProvider.java │ │ │ ├── LineDataProvider.java │ │ │ ├── BarDataProvider.java │ │ │ ├── BarLineScatterCandleBubbleDataProvider.java │ │ │ ├── ScatterDataProvider.java │ │ │ └── ChartInterface.java │ │ └── datasets │ │ │ ├── IBarLineScatterCandleBubbleDataSet.java │ │ │ ├── IBubbleDataSet.java │ │ │ ├── IScatterDataSet.java │ │ │ ├── IRadarDataSet.java │ │ │ ├── ILineScatterCandleRadarDataSet.java │ │ │ ├── ILineRadarDataSet.java │ │ │ ├── IPieDataSet.java │ │ │ ├── IBarDataSet.java │ │ │ ├── ICandleDataSet.java │ │ │ └── ILineDataSet.java │ │ ├── formatter │ │ ├── ColorFormatter.java │ │ ├── DefaultXAxisValueFormatter.java │ │ ├── YAxisValueFormatter.java │ │ ├── FillFormatter.java │ │ ├── XAxisValueFormatter.java │ │ ├── DefaultYAxisValueFormatter.java │ │ ├── PercentFormatter.java │ │ ├── DefaultFillFormatter.java │ │ ├── ValueFormatter.java │ │ ├── DefaultValueFormatter.java │ │ ├── StackedValueFormatter.java │ │ └── LargeValueFormatter.java │ │ ├── exception │ │ └── DrawingDataSetNotCreatedException.java │ │ ├── animation │ │ └── EasingFunction.java │ │ ├── listener │ │ ├── OnDrawLineChartTouchListener.java │ │ ├── OnChartValueSelectedListener.java │ │ ├── OnDrawListener.java │ │ └── OnChartGestureListener.java │ │ ├── utils │ │ ├── EntryXIndexComparator.java │ │ ├── PointD.java │ │ ├── FSize.java │ │ ├── SelectionDetail.java │ │ └── TransformerHorizontalBarChart.java │ │ ├── data │ │ ├── realm │ │ │ ├── implementation │ │ │ │ ├── RealmPieData.java │ │ │ │ ├── RealmBarData.java │ │ │ │ ├── RealmLineData.java │ │ │ │ ├── RealmRadarData.java │ │ │ │ ├── RealmBubbleData.java │ │ │ │ ├── RealmCandleData.java │ │ │ │ └── RealmScatterData.java │ │ │ └── base │ │ │ │ ├── RealmUtils.java │ │ │ │ ├── RealmBarLineScatterCandleBubbleDataSet.java │ │ │ │ └── RealmLineRadarDataSet.java │ │ ├── BarLineScatterCandleBubbleData.java │ │ ├── BarLineScatterCandleBubbleDataSet.java │ │ ├── CandleData.java │ │ ├── RadarData.java │ │ ├── LineData.java │ │ ├── BubbleData.java │ │ ├── BubbleEntry.java │ │ ├── ScatterData.java │ │ ├── PieData.java │ │ ├── BarData.java │ │ ├── LineRadarDataSet.java │ │ ├── CandleEntry.java │ │ └── LineScatterCandleRadarDataSet.java │ │ ├── jobs │ │ ├── MoveViewJob.java │ │ ├── AnimatedMoveViewJob.java │ │ ├── ViewPortJob.java │ │ ├── AnimatedViewPortJob.java │ │ ├── ZoomJob.java │ │ └── AnimatedZoomJob.java │ │ ├── manager │ │ ├── MyYValueFormatter.java │ │ ├── MyValueFormatter.java │ │ ├── MyMakerView.java │ │ └── BarChartManager.java │ │ ├── buffer │ │ ├── ScatterBuffer.java │ │ ├── AbstractBuffer.java │ │ └── HorizontalBarBuffer.java │ │ ├── renderer │ │ ├── scatter │ │ │ ├── ShapeRenderer.java │ │ │ ├── CrossShapeRenderer.java │ │ │ ├── ChevronUpShapeRenderer.java │ │ │ ├── XShapeRenderer.java │ │ │ ├── ChevronDownShapeRenderer.java │ │ │ ├── CircleShapeRenderer.java │ │ │ ├── SquareShapeRenderer.java │ │ │ └── TriangleShapeRenderer.java │ │ ├── Renderer.java │ │ ├── XAxisRendererRadarChart.java │ │ ├── LineScatterCandleRadarRenderer.java │ │ ├── LineRadarRenderer.java │ │ ├── AxisRenderer.java │ │ └── XAxisRendererBarChart.java │ │ ├── highlight │ │ ├── Range.java │ │ ├── CombinedHighlighter.java │ │ └── HorizontalBarHighlighter.java │ │ ├── charts │ │ ├── CandleStickChart.java │ │ ├── LineChart.java │ │ └── BubbleChart.java │ │ ├── components │ │ └── MarkerView.java │ │ └── matrix │ │ └── Vector3.java ├── AndroidManifest.xml ├── project.properties ├── proguard-project.txt ├── build.gradle └── pom.xml ├── settings.gradle ├── rxjava-essentials-cn.pdf ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties └── gradlew.bat /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | Retrofit-RxJavaDemo -------------------------------------------------------------------------------- /JNChartLib/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':JNChartLib' 2 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | RetrofitDemo 3 | 4 | -------------------------------------------------------------------------------- /rxjava-essentials-cn.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panyz/Retrofit-RxJava-MPAndroidChart/HEAD/rxjava-essentials-cn.pdf -------------------------------------------------------------------------------- /JNChartLib/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panyz/Retrofit-RxJava-MPAndroidChart/HEAD/JNChartLib/ic_launcher-web.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panyz/Retrofit-RxJava-MPAndroidChart/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panyz/Retrofit-RxJava-MPAndroidChart/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panyz/Retrofit-RxJava-MPAndroidChart/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panyz/Retrofit-RxJava-MPAndroidChart/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panyz/Retrofit-RxJava-MPAndroidChart/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panyz/Retrofit-RxJava-MPAndroidChart/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip 7 | -------------------------------------------------------------------------------- /JNChartLib/.settings/gradle/org.springsource.ide.eclipse.gradle.core.prefs: -------------------------------------------------------------------------------- 1 | #org.springsource.ide.eclipse.gradle.core.preferences.GradleProjectPreferences 2 | #Mon Jan 18 23:02:46 CET 2016 3 | org.springsource.ide.eclipse.gradle.linkedresources= 4 | org.springsource.ide.eclipse.gradle.rootprojectloc=.. 5 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/interfaces/dataprovider/BubbleDataProvider.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.interfaces.dataprovider; 2 | 3 | import com.jn.chart.data.BubbleData; 4 | 5 | public interface BubbleDataProvider extends BarLineScatterCandleBubbleDataProvider { 6 | 7 | BubbleData getBubbleData(); 8 | } 9 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/interfaces/dataprovider/CandleDataProvider.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.interfaces.dataprovider; 2 | 3 | import com.jn.chart.data.CandleData; 4 | 5 | public interface CandleDataProvider extends BarLineScatterCandleBubbleDataProvider { 6 | 7 | CandleData getCandleData(); 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/pyz/retrofitdemo/Constant.java: -------------------------------------------------------------------------------- 1 | package com.pyz.retrofitdemo; 2 | 3 | 4 | public class Constant { 5 | 6 | public static final String BASE_URL = "http://apis.baidu.com";//服务器地址 7 | public static final String API_KEY = "2600907be4021f9979ecc9554a4065ac";//开发密钥 8 | public static final String CITY = "guangzhou"; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/interfaces/dataprovider/LineDataProvider.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.interfaces.dataprovider; 2 | 3 | import com.jn.chart.components.YAxis; 4 | import com.jn.chart.data.LineData; 5 | 6 | public interface LineDataProvider extends BarLineScatterCandleBubbleDataProvider { 7 | 8 | LineData getLineData(); 9 | 10 | YAxis getAxis(YAxis.AxisDependency dependency); 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/formatter/ColorFormatter.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.formatter; 2 | 3 | import com.jn.chart.data.Entry; 4 | 5 | /** 6 | * Interface that can be used to return a customized color instead of setting 7 | * colors via the setColor(...) method of the DataSet. 8 | * 9 | * @author Philipp Jahoda 10 | */ 11 | public interface ColorFormatter { 12 | 13 | int getColor(Entry e, int index); 14 | } -------------------------------------------------------------------------------- /app/src/test/java/com/pyz/retrofitdemo/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.pyz.retrofitdemo; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/interfaces/dataprovider/BarDataProvider.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.interfaces.dataprovider; 2 | 3 | import com.jn.chart.data.BarData; 4 | 5 | public interface BarDataProvider extends BarLineScatterCandleBubbleDataProvider { 6 | 7 | BarData getBarData(); 8 | boolean isDrawBarShadowEnabled(); 9 | boolean isDrawValueAboveBarEnabled(); 10 | boolean isDrawHighlightArrowEnabled(); 11 | } 12 | -------------------------------------------------------------------------------- /JNChartLib/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/pyz/retrofitdemo/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.pyz.retrofitdemo; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/exception/DrawingDataSetNotCreatedException.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.exception; 2 | 3 | public class DrawingDataSetNotCreatedException extends RuntimeException { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public DrawingDataSetNotCreatedException() { 11 | super("Have to create a new drawing set first. Call ChartData's createNewDrawingDataSet() method"); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/animation/EasingFunction.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.animation; 2 | 3 | import android.animation.TimeInterpolator; 4 | import android.annotation.SuppressLint; 5 | 6 | /** 7 | * Interface for creating custom made easing functions. Uses the 8 | * TimeInterpolator interface provided by Android. 9 | */ 10 | @SuppressLint("NewApi") 11 | public interface EasingFunction extends TimeInterpolator { 12 | 13 | @Override 14 | float getInterpolation(float input); 15 | } 16 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/interfaces/datasets/IBarLineScatterCandleBubbleDataSet.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.interfaces.datasets; 2 | 3 | import com.jn.chart.data.Entry; 4 | 5 | /** 6 | * Created by philipp on 21/10/15. 7 | */ 8 | public interface IBarLineScatterCandleBubbleDataSet extends IDataSet { 9 | 10 | /** 11 | * Returns the color that is used for drawing the highlight indicators. 12 | * 13 | * @return 14 | */ 15 | int getHighLightColor(); 16 | } 17 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/listener/OnDrawLineChartTouchListener.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.listener; 2 | 3 | import android.view.GestureDetector.SimpleOnGestureListener; 4 | import android.view.MotionEvent; 5 | import android.view.View; 6 | import android.view.View.OnTouchListener; 7 | 8 | public class OnDrawLineChartTouchListener extends SimpleOnGestureListener implements OnTouchListener { 9 | 10 | @Override 11 | public boolean onTouch(View v, MotionEvent event) { 12 | return false; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/utils/EntryXIndexComparator.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.utils; 2 | 3 | import com.jn.chart.data.Entry; 4 | 5 | import java.util.Comparator; 6 | 7 | /** 8 | * Comparator for comparing Entry-objects by their x-index. 9 | * Created by philipp on 17/06/15. 10 | */ 11 | public class EntryXIndexComparator implements Comparator { 12 | @Override 13 | public int compare(Entry entry1, Entry entry2) { 14 | return entry1.getXIndex() - entry2.getXIndex(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.idea/libraries/junit_4_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/gson_2_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/support_annotations_23_3_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/okio_1_6_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/rxjava_1_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/okhttp_3_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/utils/PointD.java: -------------------------------------------------------------------------------- 1 | 2 | package com.jn.chart.utils; 3 | 4 | /** 5 | * Point encapsulating two double values. 6 | * 7 | * @author Philipp Jahoda 8 | */ 9 | public class PointD { 10 | 11 | public double x; 12 | public double y; 13 | 14 | public PointD(double x, double y) { 15 | this.x = x; 16 | this.y = y; 17 | } 18 | 19 | /** 20 | * returns a string representation of the object 21 | */ 22 | public String toString() { 23 | return "PointD, x: " + x + ", y: " + y; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /.idea/libraries/hamcrest_core_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/retrofit_2_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/realm_android_0_87_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/adapter_rxjava_2_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/logger_1_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/formatter/DefaultXAxisValueFormatter.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.formatter; 2 | 3 | import com.jn.chart.utils.ViewPortHandler; 4 | 5 | /** 6 | * Created by Philipp Jahoda on 14/09/15. 7 | * Default formatter class for adjusting x-values before drawing them. 8 | * This simply returns the original value unmodified. 9 | */ 10 | public class DefaultXAxisValueFormatter implements XAxisValueFormatter { 11 | 12 | @Override 13 | public String getXValue(String original, int index, ViewPortHandler viewPortHandler) { 14 | return original; // just return original, no adjustments 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.idea/libraries/rxandroid_1_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # Intellij 36 | *.iml 37 | .idea/workspace.xml 38 | 39 | # Keystore files 40 | *.jks 41 | -------------------------------------------------------------------------------- /.idea/libraries/converter_gson_2_0_0_beta4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/pyz/retrofitdemo/bean/WeatherInfo.java: -------------------------------------------------------------------------------- 1 | package com.pyz.retrofitdemo.bean; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Created by pyz on 2016/5/4. 9 | */ 10 | public class WeatherInfo { 11 | @SerializedName("HeWeather data service 3.0") 12 | public List HeWeatherDataList; 13 | 14 | public List getHeWeatherDataList() { 15 | return HeWeatherDataList; 16 | } 17 | 18 | public void setHeWeatherDataList(List heWeatherDataList) { 19 | HeWeatherDataList = heWeatherDataList; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/data/realm/implementation/RealmPieData.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.data.realm.implementation; 2 | 3 | import com.jn.chart.data.PieData; 4 | import com.jn.chart.data.realm.base.RealmUtils; 5 | import com.jn.chart.interfaces.datasets.IPieDataSet; 6 | 7 | import io.realm.RealmObject; 8 | import io.realm.RealmResults; 9 | 10 | /** 11 | * Created by Philipp Jahoda on 19/12/15. 12 | */ 13 | public class RealmPieData extends PieData { 14 | 15 | public RealmPieData(RealmResults result, String xValuesField, IPieDataSet dataSet) { 16 | super(RealmUtils.toXVals(result, xValuesField), dataSet); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/pyz/retrofitdemo/bean/WeatherInfoReq.java: -------------------------------------------------------------------------------- 1 | package com.pyz.retrofitdemo.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Created by pyz on 2016/5/4. 7 | */ 8 | public class WeatherInfoReq implements Serializable { 9 | 10 | public String apiKey; 11 | public String city; 12 | 13 | public String getApiKey() { 14 | return apiKey; 15 | } 16 | 17 | public void setApiKey(String apiKey) { 18 | this.apiKey = apiKey; 19 | } 20 | 21 | public String getCity() { 22 | return city; 23 | } 24 | 25 | public void setCity(String city) { 26 | this.city = city; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /JNChartLib/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-23 15 | android.library=true 16 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/interfaces/dataprovider/BarLineScatterCandleBubbleDataProvider.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.interfaces.dataprovider; 2 | 3 | import com.jn.chart.components.YAxis.AxisDependency; 4 | import com.jn.chart.data.BarLineScatterCandleBubbleData; 5 | import com.jn.chart.utils.Transformer; 6 | 7 | public interface BarLineScatterCandleBubbleDataProvider extends ChartInterface { 8 | 9 | Transformer getTransformer(AxisDependency axis); 10 | int getMaxVisibleCount(); 11 | boolean isInverted(AxisDependency axis); 12 | 13 | int getLowestVisibleXIndex(); 14 | int getHighestVisibleXIndex(); 15 | 16 | BarLineScatterCandleBubbleData getData(); 17 | } 18 | -------------------------------------------------------------------------------- /.idea/libraries/support_vector_drawable_23_3_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/animated_vector_drawable_23_3_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/data/realm/implementation/RealmBarData.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.data.realm.implementation; 2 | 3 | import com.jn.chart.data.BarData; 4 | import com.jn.chart.data.realm.base.RealmUtils; 5 | import com.jn.chart.interfaces.datasets.IBarDataSet; 6 | 7 | import java.util.List; 8 | 9 | import io.realm.RealmObject; 10 | import io.realm.RealmResults; 11 | 12 | /** 13 | * Created by Philipp Jahoda on 19/12/15. 14 | */ 15 | public class RealmBarData extends BarData { 16 | 17 | public RealmBarData(RealmResults result, String xValuesField, List dataSets) { 18 | super(RealmUtils.toXVals(result, xValuesField), dataSets); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/data/realm/implementation/RealmLineData.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.data.realm.implementation; 2 | 3 | import com.jn.chart.data.LineData; 4 | import com.jn.chart.data.realm.base.RealmUtils; 5 | import com.jn.chart.interfaces.datasets.ILineDataSet; 6 | 7 | import java.util.List; 8 | 9 | import io.realm.RealmObject; 10 | import io.realm.RealmResults; 11 | 12 | /** 13 | * Created by Philipp Jahoda on 19/12/15. 14 | */ 15 | public class RealmLineData extends LineData { 16 | 17 | public RealmLineData(RealmResults result, String xValuesField, List dataSets) { 18 | super(RealmUtils.toXVals(result, xValuesField), dataSets); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/pyz/retrofitdemo/bean/DailyForecast.java: -------------------------------------------------------------------------------- 1 | package com.pyz.retrofitdemo.bean; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * Created by pyz on 2016/5/4. 7 | */ 8 | public class DailyForecast { 9 | @SerializedName("date") 10 | public String date; 11 | @SerializedName("tmp") 12 | public Temperature tmp; 13 | 14 | public String getDate() { 15 | return date; 16 | } 17 | 18 | public void setDate(String date) { 19 | this.date = date; 20 | } 21 | 22 | public Temperature getTmp() { 23 | return tmp; 24 | } 25 | 26 | public void setTmp(Temperature tmp) { 27 | this.tmp = tmp; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/data/realm/implementation/RealmRadarData.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.data.realm.implementation; 2 | 3 | import com.jn.chart.data.RadarData; 4 | import com.jn.chart.data.realm.base.RealmUtils; 5 | import com.jn.chart.interfaces.datasets.IRadarDataSet; 6 | 7 | import java.util.List; 8 | 9 | import io.realm.RealmObject; 10 | import io.realm.RealmResults; 11 | 12 | /** 13 | * Created by Philipp Jahoda on 19/12/15. 14 | */ 15 | public class RealmRadarData extends RadarData{ 16 | 17 | public RealmRadarData(RealmResults result, String xValuesField, List dataSets) { 18 | super(RealmUtils.toXVals(result, xValuesField), dataSets); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in E:\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/pyz/retrofitdemo/netrequest/NetRequest.java: -------------------------------------------------------------------------------- 1 | package com.pyz.retrofitdemo.netrequest; 2 | 3 | import com.pyz.retrofitdemo.bean.WeatherInfo; 4 | 5 | import retrofit2.Call; 6 | import retrofit2.http.GET; 7 | import retrofit2.http.Header; 8 | import retrofit2.http.Query; 9 | import rx.Observable; 10 | 11 | /** 12 | * Created by pyz on 2016/4/29. 13 | */ 14 | public interface NetRequest { 15 | 16 | @GET("/heweather/weather/free?/") 17 | Call getWeather(@Header("apiKey")String apiKey, @Query("city")String city); 18 | 19 | @GET("/heweather/weather/free?/") 20 | Observable getWeatherByRxJava(@Header("apiKey")String apiKey, @Query("city")String city); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/data/realm/implementation/RealmBubbleData.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.data.realm.implementation; 2 | 3 | import com.jn.chart.data.BubbleData; 4 | import com.jn.chart.data.realm.base.RealmUtils; 5 | import com.jn.chart.interfaces.datasets.IBubbleDataSet; 6 | 7 | import java.util.List; 8 | 9 | import io.realm.RealmObject; 10 | import io.realm.RealmResults; 11 | 12 | /** 13 | * Created by Philipp Jahoda on 19/12/15. 14 | */ 15 | public class RealmBubbleData extends BubbleData { 16 | 17 | public RealmBubbleData(RealmResults result, String xValuesField, List dataSets) { 18 | super(RealmUtils.toXVals(result, xValuesField), dataSets); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/data/realm/implementation/RealmCandleData.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.data.realm.implementation; 2 | 3 | import com.jn.chart.data.CandleData; 4 | import com.jn.chart.data.realm.base.RealmUtils; 5 | import com.jn.chart.interfaces.datasets.ICandleDataSet; 6 | 7 | import java.util.List; 8 | 9 | import io.realm.RealmObject; 10 | import io.realm.RealmResults; 11 | 12 | /** 13 | * Created by Philipp Jahoda on 19/12/15. 14 | */ 15 | public class RealmCandleData extends CandleData { 16 | 17 | public RealmCandleData(RealmResults result, String xValuesField, List dataSets) { 18 | super(RealmUtils.toXVals(result, xValuesField), dataSets); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/pyz/retrofitdemo/bean/Temperature.java: -------------------------------------------------------------------------------- 1 | package com.pyz.retrofitdemo.bean; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * Created by pyz on 2016/5/4. 7 | */ 8 | public class Temperature { 9 | @SerializedName("max") 10 | public String maxTem; 11 | @SerializedName("min") 12 | public String minTem; 13 | 14 | public String getMaxTem() { 15 | return maxTem; 16 | } 17 | 18 | public void setMaxTem(String maxTem) { 19 | this.maxTem = maxTem; 20 | } 21 | 22 | public String getMinTem() { 23 | return minTem; 24 | } 25 | 26 | public void setMinTem(String minTem) { 27 | this.minTem = minTem; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/data/realm/implementation/RealmScatterData.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.data.realm.implementation; 2 | 3 | import com.jn.chart.data.ScatterData; 4 | import com.jn.chart.data.realm.base.RealmUtils; 5 | import com.jn.chart.interfaces.datasets.IScatterDataSet; 6 | 7 | import java.util.List; 8 | 9 | import io.realm.RealmObject; 10 | import io.realm.RealmResults; 11 | 12 | /** 13 | * Created by Philipp Jahoda on 19/12/15. 14 | */ 15 | public class RealmScatterData extends ScatterData { 16 | 17 | public RealmScatterData(RealmResults result, String xValuesField, List dataSets) { 18 | super(RealmUtils.toXVals(result, xValuesField), dataSets); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/jobs/MoveViewJob.java: -------------------------------------------------------------------------------- 1 | 2 | package com.jn.chart.jobs; 3 | 4 | import android.view.View; 5 | 6 | import com.jn.chart.utils.Transformer; 7 | import com.jn.chart.utils.ViewPortHandler; 8 | 9 | /** 10 | * Created by Philipp Jahoda on 19/02/16. 11 | */ 12 | public class MoveViewJob extends ViewPortJob { 13 | 14 | public MoveViewJob(ViewPortHandler viewPortHandler, float xValue, float yValue, Transformer trans, View v) { 15 | super(viewPortHandler, xValue, yValue, trans, v); 16 | } 17 | 18 | @Override 19 | public void run() { 20 | 21 | pts[0] = xValue; 22 | pts[1] = yValue; 23 | 24 | mTrans.pointValuesToPixel(pts); 25 | mViewPortHandler.centerViewPort(pts, view); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/manager/MyYValueFormatter.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.manager; 2 | 3 | import com.jn.chart.components.YAxis; 4 | import com.jn.chart.formatter.YAxisValueFormatter; 5 | 6 | import java.text.DecimalFormat; 7 | 8 | /** 9 | * @Author: pyz 10 | * @Package: com.pyz.retrofitdemo 11 | * @Description: TODO 12 | * @Project: Retrofit-RxJavaDemo 13 | * @Date: 2016/8/8 11:59 14 | */ 15 | public class MyYValueFormatter implements YAxisValueFormatter { 16 | private DecimalFormat mFormat; 17 | 18 | public MyYValueFormatter(){ 19 | mFormat = new DecimalFormat("###,###,###,##0"); 20 | } 21 | 22 | @Override 23 | public String getFormattedValue(float value, YAxis yAxis) { 24 | return mFormat.format(value)+"℃"; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /JNChartLib/src/com/jn/chart/formatter/YAxisValueFormatter.java: -------------------------------------------------------------------------------- 1 | package com.jn.chart.formatter; 2 | 3 | import com.jn.chart.components.YAxis; 4 | 5 | /** 6 | * Created by Philipp Jahoda on 20/09/15. 7 | * Custom formatter interface that allows formatting of 8 | * YAxis labels before they are being drawn. 9 | */ 10 | public interface YAxisValueFormatter { 11 | 12 | /** 13 | * Called when a value from the YAxis is formatted 14 | * before being drawn. For performance reasons, avoid excessive calculations 15 | * and memory allocations inside this method. 16 | * 17 | * @param value the YAxis value to be formatted 18 | * @param yAxis the YAxis object the value belongs to 19 | * @return 20 | */ 21 | String getFormattedValue(float value, YAxis yAxis); 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 |