的
This commit is contained in:
@@ -0,0 +1 @@
|
||||
/build
|
||||
@@ -0,0 +1,36 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
apply plugin: 'kotlin-android'
|
||||
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
|
||||
android {
|
||||
compileSdkVersion 27
|
||||
defaultConfig {
|
||||
applicationId "com.github.fujianlian.klinechartdemo"
|
||||
minSdkVersion 17
|
||||
targetSdkVersion 27
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
|
||||
implementation 'com.android.support:appcompat-v7:27.1.1'
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
implementation project(':KLineChartLib')
|
||||
implementation 'com.google.code.gson:gson:2.2.4'
|
||||
implementation 'org.jetbrains.anko:anko-sdk19:+'
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.github.fujianlian.klinechartdemo
|
||||
|
||||
import android.support.test.InstrumentationRegistry
|
||||
import android.support.test.runner.AndroidJUnit4
|
||||
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getTargetContext()
|
||||
assertEquals("com.github.fujianlian.klinechartdemo", appContext.packageName)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.github.fujianlian.klinechartdemo">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/logo"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity android:name=".MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
File diff suppressed because it is too large
Load Diff
+66
@@ -0,0 +1,66 @@
|
||||
package com.github.fujianlian.klinechartdemo;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.github.fujianlian.klinechart.DataHelper;
|
||||
import com.github.fujianlian.klinechart.KLineEntity;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 模拟网络请求
|
||||
* Created by tifezh on 2017/7/3.
|
||||
*/
|
||||
|
||||
public class DataRequest {
|
||||
private static List<KLineEntity> datas = null;
|
||||
|
||||
public static String getStringFromAssert(Context context, String fileName) {
|
||||
try {
|
||||
InputStream in = context.getResources().getAssets().open(fileName);
|
||||
int length = in.available();
|
||||
byte[] buffer = new byte[length];
|
||||
in.read(buffer);
|
||||
return new String(buffer, 0, buffer.length, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static List<KLineEntity> getALL(Context context) {
|
||||
if (datas == null) {
|
||||
final List<KLineEntity> data = new Gson().fromJson(getStringFromAssert(context, "ibm.json"), new TypeToken<List<KLineEntity>>() {
|
||||
}.getType());
|
||||
DataHelper.calculate(data);
|
||||
datas = data;
|
||||
}
|
||||
return datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param context
|
||||
* @param offset 开始的索引
|
||||
* @param size 每次查询的条数
|
||||
*/
|
||||
public static List<KLineEntity> getData(Context context, int offset, int size) {
|
||||
List<KLineEntity> all = getALL(context);
|
||||
List<KLineEntity> data = new ArrayList<>();
|
||||
int start = Math.max(0, all.size() - 1 - offset - size);
|
||||
int stop = Math.min(all.size(), all.size() - offset);
|
||||
for (int i = start; i < stop; i++) {
|
||||
data.add(all.get(i));
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
package com.github.fujianlian.klinechartdemo
|
||||
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.support.v7.app.AppCompatActivity
|
||||
import android.widget.TextView
|
||||
import com.github.fujianlian.klinechart.DataHelper
|
||||
import com.github.fujianlian.klinechart.KLineChartAdapter
|
||||
import com.github.fujianlian.klinechart.KLineEntity
|
||||
import com.github.fujianlian.klinechart.draw.Status
|
||||
import com.github.fujianlian.klinechart.formatter.DateFormatter
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import org.jetbrains.anko.doAsync
|
||||
import org.jetbrains.anko.textColor
|
||||
import java.util.*
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
|
||||
private lateinit var datas: List<KLineEntity>
|
||||
|
||||
private val adapter by lazy { KLineChartAdapter() }
|
||||
|
||||
private val subTexts: ArrayList<TextView> by lazy { arrayListOf(macdText, kdjText, rsiText, wrText) }
|
||||
// 主图指标下标
|
||||
private var mainIndex = 0
|
||||
// 副图指标下标
|
||||
private var subIndex = -1
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
kLineChartView.adapter = adapter
|
||||
kLineChartView.dateTimeFormatter = DateFormatter()
|
||||
kLineChartView.setGridRows(4)
|
||||
kLineChartView.setGridColumns(4)
|
||||
initData()
|
||||
initListener()
|
||||
}
|
||||
|
||||
private fun initData() {
|
||||
kLineChartView.justShowLoading()
|
||||
doAsync {
|
||||
datas = DataRequest.getALL(this@MainActivity).subList(0, 500)
|
||||
DataHelper.calculate(datas)
|
||||
runOnUiThread {
|
||||
adapter.addFooterData(datas)
|
||||
adapter.notifyDataSetChanged()
|
||||
kLineChartView.startAnimation()
|
||||
kLineChartView.refreshEnd()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun initListener() {
|
||||
maText.setOnClickListener {
|
||||
if (mainIndex != 0) {
|
||||
kLineChartView.hideSelectData()
|
||||
mainIndex = 0
|
||||
maText.textColor = Color.parseColor("#eeb350")
|
||||
bollText.textColor = Color.WHITE
|
||||
kLineChartView.changeMainDrawType(Status.MA)
|
||||
}
|
||||
}
|
||||
bollText.setOnClickListener {
|
||||
if (mainIndex != 1) {
|
||||
kLineChartView.hideSelectData()
|
||||
mainIndex = 1
|
||||
bollText.textColor = Color.parseColor("#eeb350")
|
||||
maText.textColor = Color.WHITE
|
||||
kLineChartView.changeMainDrawType(Status.BOLL)
|
||||
}
|
||||
}
|
||||
mainHide.setOnClickListener {
|
||||
if (mainIndex != -1) {
|
||||
kLineChartView.hideSelectData()
|
||||
mainIndex = -1
|
||||
bollText.textColor = Color.WHITE
|
||||
maText.textColor = Color.WHITE
|
||||
kLineChartView.changeMainDrawType(Status.NONE)
|
||||
}
|
||||
}
|
||||
for ((index, text) in subTexts.withIndex()) {
|
||||
text.setOnClickListener {
|
||||
if (subIndex != index) {
|
||||
kLineChartView.hideSelectData()
|
||||
if (subIndex != -1) {
|
||||
subTexts[subIndex].textColor = Color.WHITE
|
||||
}
|
||||
subIndex = index
|
||||
text.textColor = Color.parseColor("#eeb350")
|
||||
kLineChartView.setChildDraw(subIndex)
|
||||
}
|
||||
}
|
||||
}
|
||||
subHide.setOnClickListener {
|
||||
if (subIndex != -1) {
|
||||
kLineChartView.hideSelectData()
|
||||
subTexts[subIndex].textColor = Color.WHITE
|
||||
subIndex = -1
|
||||
kLineChartView.hideChildDraw()
|
||||
}
|
||||
}
|
||||
fenText.setOnClickListener {
|
||||
kLineChartView.hideSelectData()
|
||||
fenText.textColor = Color.parseColor("#eeb350")
|
||||
kText.textColor = Color.WHITE
|
||||
kLineChartView.setMainDrawLine(true)
|
||||
}
|
||||
kText.setOnClickListener {
|
||||
kLineChartView.hideSelectData()
|
||||
kText.textColor = Color.parseColor("#eeb350")
|
||||
fenText.textColor = Color.WHITE
|
||||
kLineChartView.setMainDrawLine(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108">
|
||||
<path
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
|
||||
android:strokeColor="#00000000"
|
||||
android:strokeWidth="1">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="78.5885"
|
||||
android:endY="90.9159"
|
||||
android:startX="48.7653"
|
||||
android:startY="61.0927"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
|
||||
android:strokeColor="#00000000"
|
||||
android:strokeWidth="1" />
|
||||
</vector>
|
||||
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108">
|
||||
<path
|
||||
android:fillColor="#26A69A"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
</vector>
|
||||
@@ -0,0 +1,156 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/colorPrimary"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text1"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="40dp"
|
||||
android:gravity="center"
|
||||
android:text="主图"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/maText"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_toRightOf="@+id/text1"
|
||||
android:gravity="center"
|
||||
android:text="MA"
|
||||
android:textColor="@color/colorAccent" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bollText"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_toRightOf="@+id/maText"
|
||||
android:gravity="center"
|
||||
android:text="BOLL"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/mainHide"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_toRightOf="@+id/bollText"
|
||||
android:gravity="center"
|
||||
android:text="隐藏"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text2"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_below="@+id/text1"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:text="副图"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/macdText"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignBottom="@+id/text2"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_toRightOf="@+id/text2"
|
||||
android:gravity="center"
|
||||
android:text="MACD"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/kdjText"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignBottom="@+id/macdText"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_toRightOf="@+id/macdText"
|
||||
android:gravity="center"
|
||||
android:text="KDJ"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rsiText"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignBottom="@+id/kdjText"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_toRightOf="@+id/kdjText"
|
||||
android:gravity="center"
|
||||
android:text="RSI"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/wrText"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignBottom="@+id/rsiText"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_toRightOf="@+id/rsiText"
|
||||
android:gravity="center"
|
||||
android:text="WR"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subHide"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignBottom="@+id/wrText"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_toRightOf="@+id/wrText"
|
||||
android:gravity="center"
|
||||
android:text="隐藏"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fenText"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_below="@+id/text2"
|
||||
android:gravity="center"
|
||||
android:text="分时"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/kText"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_below="@+id/text2"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_toRightOf="@+id/text1"
|
||||
android:gravity="center"
|
||||
android:text="k线图"
|
||||
android:textColor="@color/colorAccent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="10dp"
|
||||
android:layout_below="@+id/fenText"
|
||||
android:background="#17181f" />
|
||||
|
||||
<com.github.fujianlian.klinechart.KLineChartView
|
||||
android:id="@+id/kLineChartView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/view2"
|
||||
android:layout_below="@+id/view1" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="10dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="#17181f" />
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#1d1f26</color>
|
||||
<color name="colorPrimaryDark">#1d1f26</color>
|
||||
<color name="colorAccent">#efb350</color>
|
||||
<color name="white">#ffffff</color>
|
||||
</resources>
|
||||
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">KLineChart</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,11 @@
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.github.fujianlian.klinechartdemo
|
||||
|
||||
import org.junit.Test
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
class ExampleUnitTest {
|
||||
@Test
|
||||
fun addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user