的
This commit is contained in:
@@ -0,0 +1 @@
|
||||
/build
|
||||
@@ -0,0 +1,58 @@
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
android {
|
||||
compileSdkVersion 28
|
||||
defaultConfig {
|
||||
applicationId "com.openxu.chart"
|
||||
minSdkVersion 18
|
||||
targetSdkVersion 28
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
multiDexEnabled true
|
||||
}
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
dataBinding { // android gradle 5.0弃用
|
||||
enabled = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.google.code.gson:gson:2.8.0'
|
||||
implementation project(':OXViewLib')
|
||||
implementation 'com.github.abel533:ECharts:3.0.0.2'
|
||||
// implementation 'com.openxu.viewlib:OXViewLib:1.0.2'
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Vendored
+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
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.openxu.hkchart">
|
||||
<!--震动-->
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:name="com.openxu.MyApplication"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/OXViewAppTheme">
|
||||
|
||||
<activity android:name="com.openxu.hkchart.MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name="com.openxu.hkchart.RoseActivity"/>
|
||||
<activity android:name="com.openxu.hkchart.PieActivity"/>
|
||||
<activity android:name="com.openxu.hkchart.VerticalBarActivity"/>
|
||||
<activity android:name="com.openxu.hkchart.HorizontalBarActivity"/>
|
||||
<activity android:name="com.openxu.hkchart.ProgressPieActivity"/>
|
||||
<activity android:name="com.openxu.hkchart.XmStockChartActivity"/>
|
||||
<activity android:name="com.openxu.hkchart.XmStockChartActivity191205"/>
|
||||
<activity android:name="com.openxu.hkchart.XmStockChartActivity20201030"/>
|
||||
<activity android:name="com.openxu.hkchart.XmStockChartActivity202010301"/>
|
||||
<activity android:name="com.openxu.hkchart.Base64ToBitmapActivity"/>
|
||||
<activity android:name="com.openxu.hkchart.BigBitmapActivity"/>
|
||||
<activity android:name="com.openxu.hkchart.FpcActivity"/>
|
||||
<activity android:name="com.openxu.hkchart.SettingActivity"/>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html style="height: 100%">
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body style="height: 100%; margin: 0">
|
||||
<div id="container" style="height: 100%"></div>
|
||||
<script type="text/javascript" src="./echarts.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
var dom =document.getElementById("container");
|
||||
var myChart =echarts.init(dom);
|
||||
var app ={};
|
||||
function loadEcharts(echartJson){
|
||||
var option = JSON.parse(echartJson);
|
||||
if (option &&typeof option ==="object") {
|
||||
myChart.setOption(option,true);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+14
File diff suppressed because one or more lines are too long
@@ -0,0 +1,95 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>ECharts</title>
|
||||
<!-- 引入 echarts.js -->
|
||||
<script src="echarts.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 为ECharts准备一个具备大小(宽高)的Dom -->
|
||||
<!--<div id="main" style="width: 400px;height:400px;"></div>-->
|
||||
<div id="main"></div>
|
||||
<script type="text/javascript">
|
||||
// 基于准备好的dom,初始化echarts实例
|
||||
var myChart = echarts.init(document.getElementById('main'));
|
||||
|
||||
// 指定图表的配置项和数据
|
||||
var option = {
|
||||
media: [ // 这里定义了 media query 的逐条规则。
|
||||
{ // 这条里没有写规则,表示『默认』,
|
||||
option: { // 即所有规则都不满足时,采纳这个option。
|
||||
legend: { // legend 放在底部中间。
|
||||
right: 'center',
|
||||
bottom: 0,
|
||||
height:400px
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
title: {
|
||||
text: '折线图堆叠'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
data: ['邮件营销', '联盟广告', '视频广告', '直接访问', '搜索引擎']
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
toolbox: {
|
||||
feature: {
|
||||
saveAsImage: {}
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '邮件营销',
|
||||
type: 'line',
|
||||
stack: '总量',
|
||||
data: [120, 132, 101, 134, 90, 230, 210]
|
||||
},
|
||||
{
|
||||
name: '联盟广告',
|
||||
type: 'line',
|
||||
stack: '总量',
|
||||
data: [220, 182, 191, 234, 290, 330, 310]
|
||||
},
|
||||
{
|
||||
name: '视频广告',
|
||||
type: 'line',
|
||||
stack: '总量',
|
||||
data: [150, 232, 201, 154, 190, 330, 410]
|
||||
},
|
||||
{
|
||||
name: '直接访问',
|
||||
type: 'line',
|
||||
stack: '总量',
|
||||
data: [320, 332, 301, 334, 390, 330, 320]
|
||||
},
|
||||
{
|
||||
name: '搜索引擎',
|
||||
type: 'line',
|
||||
stack: '总量',
|
||||
data: [820, 932, 901, 934, 1290, 1330, 1320]
|
||||
}
|
||||
]
|
||||
};
|
||||
// 使用刚指定的配置项和数据显示图表。
|
||||
myChart.setOption(option);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -0,0 +1,29 @@
|
||||
package com.openxu.hkchart;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.ViewGroup;
|
||||
import com.openxu.view.BigBitmapView;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class BigBitmapActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
BigBitmapView bigBitmapView = new BigBitmapView(this);
|
||||
((ViewGroup)getWindow().getDecorView()).addView(bigBitmapView);
|
||||
|
||||
try {
|
||||
// bigBitmapView.setImage(getResources().getAssets().open("qmsht.png"));
|
||||
bigBitmapView.setImage(getResources().getAssets().open("world6.png"));
|
||||
// bigBitmapView.setImage(getResources().getAssets().open("image2.png"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.openxu.hkchart;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by BeiZhenbo on 2017.03.10.
|
||||
*/
|
||||
|
||||
public class DownUserImage {
|
||||
|
||||
private static byte[] data;
|
||||
private static Bitmap bm = null;
|
||||
private static Map<String, Bitmap> bms = new HashMap<>();
|
||||
public static Bitmap Base64ToBitmap(String str) {
|
||||
bm = bms.get(str);
|
||||
if (bm == null) {
|
||||
if (!TextUtils.isEmpty(str)) {
|
||||
try {
|
||||
if (data != null) {
|
||||
data = null;
|
||||
}
|
||||
data = Base64.decode(str, Base64.DEFAULT);
|
||||
try {
|
||||
bm = BitmapFactory.decodeByteArray(data, 0, data.length);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
bm = BitmapFactory.decodeByteArray(data, 0, data.length);
|
||||
}
|
||||
bms.put(str, bm);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return bm;
|
||||
}
|
||||
/*
|
||||
* bitmap转base64
|
||||
* */
|
||||
private static String bitmapToBase64(Bitmap bitmap) {
|
||||
String result = null;
|
||||
ByteArrayOutputStream baos = null;
|
||||
try {
|
||||
if (bitmap != null) {
|
||||
baos = new ByteArrayOutputStream();
|
||||
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
|
||||
|
||||
baos.flush();
|
||||
baos.close();
|
||||
|
||||
byte[] bitmapBytes = baos.toByteArray();
|
||||
result = Base64.encodeToString(bitmapBytes, Base64.DEFAULT);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (baos != null) {
|
||||
baos.flush();
|
||||
baos.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* base64转为bitmap
|
||||
* @param base64Data
|
||||
* @return
|
||||
*/
|
||||
public static Bitmap base64ToBitmap(String base64Data) {
|
||||
byte[] bytes = Base64.decode(base64Data, Base64.DEFAULT);
|
||||
Log.e("gadggsddg", "转换为数组:"+bytes.length);
|
||||
Bitmap btmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
|
||||
Log.e("gadggsddg", "转换:"+btmap);
|
||||
return btmap;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,69 @@
|
||||
package com.openxu.hkchart;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.openxu.cview.chart.barchart.BarHorizontalChart;
|
||||
import com.openxu.cview.chart.bean.BarBean;
|
||||
import com.openxu.utils.DensityUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class HorizontalBarActivity extends AppCompatActivity {
|
||||
|
||||
private BarHorizontalChart chart1, chart2, chart3;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_horizontalbar);
|
||||
Random random = new Random();
|
||||
|
||||
|
||||
chart1 = (BarHorizontalChart)findViewById(R.id.chart1);
|
||||
chart1.setBarSpace(DensityUtil.dip2px(this, 1)); //双柱间距
|
||||
chart1.setBarItemSpace(DensityUtil.dip2px(this, 20)); //柱间距
|
||||
chart1.setBarNum(3);
|
||||
chart1.setBarColor(new int[]{Color.parseColor("#5F93E7"),Color.parseColor("#F28D02")});
|
||||
//X轴
|
||||
List<String> strXList = new ArrayList<>();
|
||||
//柱状图数据
|
||||
List<List<BarBean>> dataList = new ArrayList<>();
|
||||
for(int i = 0; i<100; i++){
|
||||
//此集合为柱状图上一条数据,集合中包含几个实体就是几个柱子
|
||||
List<BarBean> list = new ArrayList<>();
|
||||
list.add(new BarBean(random.nextInt(30), "lable1"));
|
||||
list.add(new BarBean(random.nextInt(20), "lable2"));
|
||||
dataList.add(list);
|
||||
strXList.add((i+1)+"月");
|
||||
}
|
||||
chart1.setLoading(false);
|
||||
chart1.setData(dataList, strXList);
|
||||
|
||||
|
||||
chart2 = (BarHorizontalChart)findViewById(R.id.chart2);
|
||||
chart2.setLoading(true);
|
||||
chart2.setBarNum(1);
|
||||
chart2.setBarColor(new int[]{Color.parseColor("#5F93E7")});
|
||||
strXList.clear();
|
||||
dataList.clear();
|
||||
for(int i = 0; i<12; i++){
|
||||
//此集合为柱状图上一条数据,集合中包含几个实体就是几个柱子
|
||||
List<BarBean> list = new ArrayList<>();
|
||||
list.add(new BarBean(random.nextInt(10), "接入系统"));
|
||||
dataList.add(list);
|
||||
strXList.add((i+1)+"月");
|
||||
}
|
||||
chart2.setLoading(false);
|
||||
chart2.setData(dataList, strXList);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.openxu.hkchart;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.view.View;
|
||||
|
||||
import com.openxu.cview.TitleLayout;
|
||||
import com.openxu.hkchart.adapter.CommandRecyclerAdapter;
|
||||
import com.openxu.hkchart.adapter.ViewHolder;
|
||||
import com.openxu.hkchart.bean.MainItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
private List<MainItem> datas;
|
||||
|
||||
Handler handler = new Handler(){
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
}
|
||||
};
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
TitleLayout titleLayout = findViewById(R.id.title_layout);
|
||||
titleLayout.setOnMenuClickListener(new TitleLayout.OnMenuClickListener() {
|
||||
@Override
|
||||
public void onClick(TitleLayout.MENU_NAME menu, View view) {
|
||||
if(menu== TitleLayout.MENU_NAME.MENU_RIGHT_TEXT){
|
||||
startActivity(new Intent(MainActivity.this, SettingActivity.class));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
recyclerView = (RecyclerView)findViewById(R.id.recyclerView);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
datas = new ArrayList<>();
|
||||
datas.add(new MainItem("南丁格尔玫瑰图", RoseActivity.class));
|
||||
datas.add(new MainItem("饼状图", PieActivity.class));
|
||||
datas.add(new MainItem("进度环形图", ProgressPieActivity.class));
|
||||
datas.add(new MainItem("纵向柱状图", VerticalBarActivity.class));
|
||||
datas.add(new MainItem("横向柱状图", HorizontalBarActivity.class));
|
||||
datas.add(new MainItem("折线图", XmStockChartActivity.class));
|
||||
datas.add(new MainItem("股票信息", XmStockChartActivity191205.class));
|
||||
datas.add(new MainItem("股票信息20201031", XmStockChartActivity20201030.class));
|
||||
datas.add(new MainItem("Base64TBitmap", Base64ToBitmapActivity.class));
|
||||
datas.add(new MainItem("大图加载", BigBitmapActivity.class));
|
||||
datas.add(new MainItem("法之运", FpcActivity.class));
|
||||
recyclerView.setAdapter(new CommandRecyclerAdapter<MainItem>(this, R.layout.list_item, datas) {
|
||||
@Override
|
||||
public void convert(ViewHolder holder, MainItem item) {
|
||||
holder.setText(R.id.tv_name, item.getName());
|
||||
}
|
||||
@Override
|
||||
public void onItemClick(MainItem item, int position) {
|
||||
startActivity(new Intent(MainActivity.this, item.getGotoClass()));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.openxu.hkchart;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.openxu.hkchart.bean.PieBean;
|
||||
import com.openxu.cview.chart.bean.ChartLable;
|
||||
import com.openxu.cview.chart.piechart.PieChartLayout;
|
||||
import com.openxu.utils.DensityUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class PieActivity extends AppCompatActivity {
|
||||
|
||||
private PieChartLayout pieChart1, pieChart2, pieChart3,pieChart4;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_pie);
|
||||
pieChart1 = (PieChartLayout)findViewById(R.id.pieChart1);
|
||||
/*
|
||||
* 圆环宽度
|
||||
* ringWidth > 0 :空心圆环,内环为白色,可以在内环中绘制字
|
||||
* ringWidth <=0 :实心
|
||||
*/
|
||||
pieChart1.setRingWidth(DensityUtil.dip2px(this, 15));
|
||||
pieChart1.setLineLenth(DensityUtil.dip2px(this, 8)); // //指示线长度
|
||||
pieChart1.setTagModul(PieChartLayout.TAG_MODUL.MODUL_CHART); //在扇形图上显示tag
|
||||
pieChart1.setLoading(true);
|
||||
//请求数据
|
||||
List<PieBean> datalist = new ArrayList<>();
|
||||
datalist.add(new PieBean(20, "理发屋"));
|
||||
datalist.add(new PieBean(20, "KTV"));
|
||||
//显示在中间的lable
|
||||
List<ChartLable> tableList = new ArrayList<>();
|
||||
tableList.add(new ChartLable("建筑", DensityUtil.sp2px(this, 12), getResources().getColor(R.color.text_color_light_gray)));
|
||||
tableList.add(new ChartLable("性质", DensityUtil.sp2px(this, 12), getResources().getColor(R.color.text_color_light_gray)));
|
||||
pieChart1.setLoading(false);
|
||||
//参数1:数据类型 参数2:数量字段名称 参数3:名称字段 参数4:数据集合 参数5:lable集合
|
||||
pieChart1.setChartData(PieBean.class, "Numner", "Name",datalist ,tableList);
|
||||
|
||||
|
||||
pieChart2 = (PieChartLayout)findViewById(R.id.pieChart2);
|
||||
pieChart2.setRingWidth(DensityUtil.dip2px(this, 20));
|
||||
pieChart2.setTagModul(PieChartLayout.TAG_MODUL.MODUL_LABLE); //在lable后面显示tag
|
||||
pieChart2.setLoading(true);
|
||||
//请求数据
|
||||
datalist.clear();
|
||||
datalist.add(new PieBean(20, "IT"));
|
||||
datalist.add(new PieBean(10, "销售"));
|
||||
datalist.add(new PieBean(30, "金融"));
|
||||
datalist.add(new PieBean(8, "林木业"));
|
||||
datalist.add(new PieBean(15, "制造"));
|
||||
datalist.add(new PieBean(15, "农业"));
|
||||
pieChart2.setLoading(false);
|
||||
pieChart2.setChartData(PieBean.class, "Numner", "Name",datalist ,null);
|
||||
|
||||
|
||||
pieChart3 = (PieChartLayout)findViewById(R.id.pieChart3);
|
||||
//圆环宽度,如果值>0,则为空心圆环,内环为白色,可以在内环中绘制字
|
||||
pieChart3.setRingWidth(DensityUtil.dip2px(this, 0));
|
||||
pieChart3.setTagModul(PieChartLayout.TAG_MODUL.MODUL_LABLE);
|
||||
pieChart3.setLoading(false);
|
||||
pieChart3.setChartData(PieBean.class, "Numner", "Name",datalist ,null);
|
||||
|
||||
pieChart4 = (PieChartLayout)findViewById(R.id.pieChart4);
|
||||
//圆环宽度,如果值>0,则为空心圆环,内环为白色,可以在内环中绘制字
|
||||
pieChart4.setRingWidth(DensityUtil.dip2px(this, 0));
|
||||
pieChart4.setTagModul(PieChartLayout.TAG_MODUL.MODUL_CHART);
|
||||
datalist.add(new PieBean(20, "IT"));
|
||||
datalist.add(new PieBean(10, "销售"));
|
||||
datalist.add(new PieBean(30, "金融"));
|
||||
datalist.add(new PieBean(8, "林木业"));
|
||||
datalist.add(new PieBean(15, "制造"));
|
||||
datalist.add(new PieBean(15, "农业"));
|
||||
datalist.add(new PieBean(20, "IT"));
|
||||
datalist.add(new PieBean(10, "销售"));
|
||||
datalist.add(new PieBean(30, "金融"));
|
||||
datalist.add(new PieBean(8, "林木业"));
|
||||
datalist.add(new PieBean(15, "制造"));
|
||||
datalist.add(new PieBean(15, "农业"));
|
||||
pieChart4.setLoading(false);
|
||||
pieChart4.setChartData(PieBean.class, "Numner", "Name",datalist ,null);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.openxu.hkchart;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.openxu.cview.chart.ProgressPieChart;
|
||||
import com.openxu.cview.chart.bean.ChartLable;
|
||||
import com.openxu.utils.DensityUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class ProgressPieActivity extends AppCompatActivity {
|
||||
|
||||
private ProgressPieChart chart1, chart2;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_progresspie);
|
||||
|
||||
chart1 = (ProgressPieChart)findViewById(R.id.chart1);
|
||||
chart1.setProSize(DensityUtil.dip2px(this, 5)); //圆环宽度
|
||||
chart1.setLoading(false);
|
||||
chart1.setProColor(Color.parseColor("#ff0000")); //进度颜色
|
||||
//环形中间显示的lable
|
||||
List<ChartLable> lables = new ArrayList<>();
|
||||
lables.add(new ChartLable("60.0%",
|
||||
DensityUtil.sp2px(this, 12), Color.parseColor("#ff0000")));
|
||||
lables.add(new ChartLable("完成率",
|
||||
DensityUtil.sp2px(this, 8), getResources().getColor(R.color.text_color_light_gray)));
|
||||
chart1.setData(100, 60, lables);
|
||||
|
||||
|
||||
lables = new ArrayList<>();
|
||||
lables.add(new ChartLable("60.0%",
|
||||
DensityUtil.sp2px(this, 12), Color.parseColor("#ff0000")));
|
||||
chart2 = (ProgressPieChart)findViewById(R.id.chart2);
|
||||
chart2.setProSize(DensityUtil.dip2px(this, 20)); //圆环宽度
|
||||
chart2.setLoading(false);
|
||||
chart2.setProColor(Color.parseColor("#F28D02")); //进度颜色
|
||||
chart2.setData(100, 60, lables);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.openxu.hkchart;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.openxu.hkchart.bean.RoseBean;
|
||||
import com.openxu.cview.chart.rosechart.NightingaleRoseChart;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class RoseActivity extends AppCompatActivity {
|
||||
|
||||
private NightingaleRoseChart roseChartEmpty, roseChartOne, roseChartSmall,roseChartMany;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_rose);
|
||||
roseChartEmpty = (NightingaleRoseChart)findViewById(R.id.roseChartEmpty);
|
||||
roseChartEmpty.setLoading(false);
|
||||
|
||||
roseChartOne = (NightingaleRoseChart)findViewById(R.id.roseChartOne);
|
||||
roseChartOne.setShowChartLable(false); //是否在图表上显示指示lable
|
||||
roseChartOne.setShowChartNum(true); //是否在图表上显示指示num
|
||||
roseChartOne.setShowNumTouched(true); //点击显示数量
|
||||
roseChartOne.setShowRightNum(false); //右侧显示数量
|
||||
List<Object> roseList = new ArrayList<>();
|
||||
roseList.add(new RoseBean(10, "单条数据"));
|
||||
//参数1:数据对象class, 参数2:数量属性字段名称, 参数3:名称属性字段名称, 参数4:数据集合
|
||||
roseChartOne.setData(RoseBean.class, "count", "ClassName", roseList);
|
||||
roseChartOne.setLoading(false); //是否正在加载,数据加载完毕后置为false
|
||||
|
||||
|
||||
roseChartSmall = (NightingaleRoseChart)findViewById(R.id.roseChartSmall);
|
||||
roseChartSmall.setShowChartLable(true); //是否在图表上显示指示lable
|
||||
roseChartSmall.setShowChartNum(false); //是否在图表上显示指示num
|
||||
roseChartSmall.setShowNumTouched(false); //点击显示数量
|
||||
roseChartSmall.setShowRightNum(true); //右侧显示数量
|
||||
roseList.add(new RoseBean(10, "数据1"));
|
||||
roseList.add(new RoseBean(13, "数据2"));
|
||||
roseList.add(new RoseBean(31, "数据3"));
|
||||
roseList.add(new RoseBean(8, "数据4"));
|
||||
roseList.add(new RoseBean(21, "数据5"));
|
||||
//参数1:数据对象class, 参数2:数量属性字段名称, 参数3:名称属性字段名称, 参数4:数据集合
|
||||
roseChartSmall.setData(RoseBean.class, "count", "ClassName", roseList);
|
||||
roseChartSmall.setLoading(false);//是否正在加载,数据加载完毕后置为false
|
||||
|
||||
roseChartMany = (NightingaleRoseChart)findViewById(R.id.roseChartMany);
|
||||
roseChartMany.setShowChartLable(false);
|
||||
roseChartMany.setShowChartNum(true);
|
||||
roseChartMany.setShowNumTouched(true);
|
||||
roseChartMany.setShowRightNum(false);
|
||||
roseList.add(new RoseBean(10, "数据1"));
|
||||
roseList.add(new RoseBean(13, "数据2"));
|
||||
roseList.add(new RoseBean(31, "数据3"));
|
||||
roseList.add(new RoseBean(8, "数据4"));
|
||||
roseList.add(new RoseBean(21, "数据5"));
|
||||
roseList.add(new RoseBean(21, "数据6"));
|
||||
roseList.add(new RoseBean(25, "数据7"));
|
||||
roseList.add(new RoseBean(14, "数据8"));
|
||||
roseList.add(new RoseBean(39, "数据9"));
|
||||
roseList.add(new RoseBean(39, "数据10"));
|
||||
roseList.add(new RoseBean(39, "数据11"));
|
||||
roseList.add(new RoseBean(1, "数据12"));
|
||||
roseList.add(new RoseBean(3, "数据13"));
|
||||
roseList.add(new RoseBean(8, "数据14"));
|
||||
roseList.add(new RoseBean(8, "数据14"));
|
||||
roseChartMany.setData(RoseBean.class, "count", "ClassName", roseList);
|
||||
roseChartMany.setLoading(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.openxu.hkchart;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.widget.CompoundButton;
|
||||
|
||||
import com.openxu.hkchart.base.BaseActivity;
|
||||
import com.openxu.hkchart.base.BaseFragment;
|
||||
import com.openxu.hkchart.databinding.ActivitySettingBinding;
|
||||
|
||||
public class SettingActivity extends BaseActivity<ActivitySettingBinding> {
|
||||
|
||||
private String TAG = "SettingActivity";
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.activity_setting;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
binding.debugOnOff.checkbox.setChecked(spUtil.getSp().getBoolean(spUtil.KEY_DEBUG, false));
|
||||
binding.debugOnOff.checkbox.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
SharedPreferences.Editor editor = spUtil.getSp().edit();
|
||||
editor.putBoolean(spUtil.KEY_DEBUG, isChecked);
|
||||
editor.commit();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.openxu.hkchart;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.openxu.cview.chart.barchart.BarVerticalChart;
|
||||
import com.openxu.cview.chart.bean.BarBean;
|
||||
import com.openxu.utils.DensityUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class VerticalBarActivity extends AppCompatActivity {
|
||||
|
||||
private BarVerticalChart chart1, chart2, chart3,chart4;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_verticalbar);
|
||||
Random random = new Random();
|
||||
|
||||
|
||||
chart1 = (BarVerticalChart)findViewById(R.id.chart1);
|
||||
chart1.setLoading(true);
|
||||
chart1.setBarNum(1);
|
||||
chart1.setBarColor(new int[]{Color.parseColor("#5F93E7")});
|
||||
//X轴
|
||||
List<String> strXList = new ArrayList<>();
|
||||
//柱状图数据
|
||||
List<List<BarBean>> dataList = new ArrayList<>();
|
||||
for(int i = 0; i<5; i++){
|
||||
//此集合为柱状图上一条数据,集合中包含几个实体就是几个柱子
|
||||
List<BarBean> list = new ArrayList<>();
|
||||
list.add(new BarBean(random.nextInt(10), "接入系统"));
|
||||
dataList.add(list);
|
||||
strXList.add((i+1)+"月");
|
||||
}
|
||||
chart1.setLoading(false);
|
||||
chart1.setData(dataList, strXList);
|
||||
|
||||
|
||||
chart2 = (BarVerticalChart)findViewById(R.id.chart2);
|
||||
chart2.setBarSpace(DensityUtil.dip2px(this, 1)); //双柱间距
|
||||
chart2.setBarItemSpace(DensityUtil.dip2px(this, 20)); //柱间距
|
||||
chart2.setBarNum(2); //一组柱子数量
|
||||
chart2.setBarColor(new int[]{Color.parseColor("#5F93E7"),Color.parseColor("#F28D02")});
|
||||
strXList.clear();
|
||||
dataList.clear();
|
||||
for(int i = 0; i<5; i++){
|
||||
//此集合为柱状图上一条数据,集合中包含几个实体就是几个柱子
|
||||
List<BarBean> list = new ArrayList<>();
|
||||
list.add(new BarBean(random.nextInt(30), "接入系统"));
|
||||
list.add(new BarBean(random.nextInt(20), "审核信息"));
|
||||
dataList.add(list);
|
||||
strXList.add((i+1)+"月");
|
||||
}
|
||||
chart2.setLoading(false);
|
||||
chart2.setData(dataList, strXList);
|
||||
|
||||
chart3 = (BarVerticalChart)findViewById(R.id.chart3);
|
||||
chart3.setBarSpace(DensityUtil.dip2px(this, 1)); //双柱间距
|
||||
chart3.setBarItemSpace(DensityUtil.dip2px(this, 20)); //柱间距
|
||||
chart3.setShowEnd(true); //内容超过时,初始显示是否是最后的数据
|
||||
chart3.setBarNum(4);
|
||||
chart3.setBarColor(new int[]{Color.parseColor("#5F93E7"),Color.parseColor("#F28D02"),
|
||||
Color.parseColor("#157EFB"),Color.parseColor("#FED032")});
|
||||
strXList.clear();
|
||||
dataList.clear();
|
||||
for(int i = 0; i<5; i++){
|
||||
//此集合为柱状图上一条数据,集合中包含几个实体就是几个柱子
|
||||
List<BarBean> list = new ArrayList<>();
|
||||
list.add(new BarBean(random.nextInt(30), "lable1"));
|
||||
list.add(new BarBean(random.nextInt(20), "lable2"));
|
||||
list.add(new BarBean(random.nextInt(35), "lable3"));
|
||||
list.add(new BarBean(random.nextInt(28), "lable4"));
|
||||
dataList.add(list);
|
||||
strXList.add((i+1)+"月");
|
||||
}
|
||||
chart3.setLoading(false);
|
||||
chart3.setData(dataList, strXList);
|
||||
|
||||
|
||||
chart4 = (BarVerticalChart)findViewById(R.id.chart4);
|
||||
chart4.setBarSpace(DensityUtil.dip2px(this, 1)); //双柱间距
|
||||
chart4.setBarItemSpace(DensityUtil.dip2px(this, 20)); //柱间距
|
||||
chart4.setBarNum(2);
|
||||
chart4.setBarColor(new int[]{Color.parseColor("#5F93E7"),Color.parseColor("#F28D02")});
|
||||
strXList.clear();
|
||||
dataList.clear();
|
||||
for(int i = 0; i<100; i++){
|
||||
//此集合为柱状图上一条数据,集合中包含几个实体就是几个柱子
|
||||
List<BarBean> list = new ArrayList<>();
|
||||
list.add(new BarBean(random.nextInt(30), "接入系统"));
|
||||
list.add(new BarBean(random.nextInt(20), "审核信息"));
|
||||
dataList.add(list);
|
||||
strXList.add((i+1)+"月");
|
||||
}
|
||||
chart4.setLoading(false);
|
||||
chart4.setData(dataList, strXList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,260 @@
|
||||
package com.openxu.hkchart;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.openxu.cview.xmstock.BarChart;
|
||||
import com.openxu.cview.xmstock.LinesChart;
|
||||
import com.openxu.cview.xmstock.LinesLableChart;
|
||||
import com.openxu.cview.xmstock.bean.ChartData;
|
||||
import com.openxu.cview.xmstock.bean.Constacts;
|
||||
import com.openxu.cview.xmstock.bean.DataPoint;
|
||||
import com.openxu.cview.xmstock.bean.FocusInfo;
|
||||
import com.openxu.utils.NumberFormatUtil;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class XmStockChartActivity extends AppCompatActivity {
|
||||
ChartData data;
|
||||
BarChart bartChart;
|
||||
LinesLableChart trendLableChart, trendLableChartMonth, compareLableChart, zhabanLableChart, zhangfuLableChart, weightLableChart;
|
||||
LinesChart trendLinesChart, trendLinesChartMonth, compareLinesChart, zhabanLinesChart, zhangfuLinesChart, weightLinesChart;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_wcxstock_chart);
|
||||
|
||||
bartChart = (BarChart)findViewById(R.id.bartChart);
|
||||
trendLableChart = (LinesLableChart)findViewById(R.id.trendLableChart);
|
||||
trendLableChartMonth = (LinesLableChart)findViewById(R.id.trendLableChartMonth);
|
||||
compareLableChart = (LinesLableChart)findViewById(R.id.compareLableChart);
|
||||
zhabanLableChart = (LinesLableChart)findViewById(R.id.zhabanLableChart);
|
||||
zhangfuLableChart = (LinesLableChart)findViewById(R.id.zhangfuLableChart);
|
||||
weightLableChart = (LinesLableChart)findViewById(R.id.weightLableChart);
|
||||
trendLinesChart = (LinesChart)findViewById(R.id.trendLinesChart);
|
||||
trendLinesChartMonth = (LinesChart)findViewById(R.id.trendLinesChartMonth);
|
||||
compareLinesChart = (LinesChart)findViewById(R.id.compareLinesChart);
|
||||
zhabanLinesChart = (LinesChart)findViewById(R.id.zhabanLinesChart);
|
||||
zhangfuLinesChart = (LinesChart)findViewById(R.id.zhangfuLinesChart);
|
||||
weightLinesChart = (LinesChart)findViewById(R.id.weightLinesChart);
|
||||
|
||||
/**1、设置图表*/
|
||||
//涨跌分布
|
||||
//涨跌停走势(图表分为两部分)
|
||||
|
||||
int[] trendLineColor = new int[]{Color.parseColor("#ffb26c"),
|
||||
Color.parseColor("#ce332f"),
|
||||
Color.parseColor("#2a8c39")};
|
||||
trendLableChart.setLineColor(trendLineColor);//设置折线颜色
|
||||
trendLinesChart.setLineColor(trendLineColor);
|
||||
trendLableChartMonth.setLineColor(trendLineColor);//设置折线颜色
|
||||
trendLinesChartMonth.setLineColor(trendLineColor);
|
||||
//涨跌对比
|
||||
int[] compareLineColor = new int[]{Color.parseColor("#cb3235"),
|
||||
Color.parseColor("#1f8f3b")};
|
||||
compareLableChart.setLineColor(compareLineColor);
|
||||
compareLinesChart.setLineColor(compareLineColor);
|
||||
//炸板
|
||||
int[] zhabanLineColor = new int[]{Color.parseColor("#647bc1")};
|
||||
zhabanLableChart.setLineColor(zhabanLineColor);
|
||||
zhabanLinesChart.setLineColor(zhabanLineColor);
|
||||
zhabanLinesChart.setLINE_NUM(zhabanLineColor.length);
|
||||
//涨幅
|
||||
int[] zhangfuLineColor = new int[]{Color.parseColor("#e21b20"),
|
||||
Color.parseColor("#2c5aa7")};
|
||||
zhangfuLableChart.setLineColor(zhangfuLineColor);
|
||||
//设置数据为百分比,如果数据为整数或者小数,不需要设置
|
||||
zhangfuLinesChart.setyMarkType(LinesChart.YMARK_TYPE.PERCENTAGE);
|
||||
zhangfuLinesChart.setLineColor(zhangfuLineColor);
|
||||
|
||||
//权重
|
||||
int[] weightLineColor = new int[]{Color.parseColor("#dd1d12"),
|
||||
Color.parseColor("#fec52e"),
|
||||
Color.parseColor("#1e5bac"),
|
||||
Color.parseColor("#20b1dd")};
|
||||
weightLableChart.setLineColor(weightLineColor);
|
||||
//设置数据为百分比
|
||||
weightLinesChart.setyMarkType(LinesChart.YMARK_TYPE.PERCENTAGE);
|
||||
weightLinesChart.setLineColor(weightLineColor);
|
||||
|
||||
|
||||
getData();
|
||||
|
||||
}
|
||||
/**2、模拟接口获取数据*/
|
||||
private void getData(){
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
JSONObject json = new JSONObject(Constacts.data);
|
||||
Gson gson = new Gson();
|
||||
String dataStr = json.getString("data");
|
||||
data = gson.fromJson(dataStr, ChartData.class);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//绑定
|
||||
bindChartData();
|
||||
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
|
||||
/**3、绑定数据*/
|
||||
private void bindChartData(){
|
||||
bartChart.setLoading(false);
|
||||
bartChart.setData(data.getFenbu());
|
||||
|
||||
//涨跌停走势 日
|
||||
trendLableChart.setLoading(false); //不显示loading
|
||||
final String[] trendLables = new String[]{"非一字涨停","涨停", "跌停"};
|
||||
trendLableChart.setColumnNum(3); //设置标签列数
|
||||
trendLableChart.setData(trendLables, "03-13 15:00"); //标签控件设置数据
|
||||
trendLinesChart.setLoading(false); //不显示loading
|
||||
trendLinesChart.setAnimType(LinesChart.AnimType.LEFT_TO_RIGHT); //设置动画类型(3种)
|
||||
// trendLinesChart.setAnimType(LinesChart.AnimType.BOTTOM_TO_TOP);
|
||||
// trendLinesChart.setAnimType(LinesChart.AnimType.SLOW_DRAW);
|
||||
//触摸焦点变化,改变标签数量
|
||||
trendLinesChart.setOnFocusChangeListener(new LinesChart.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onfocus(FocusInfo focusInfo) {
|
||||
String[] newTrendLables = new String[3]; //创建新的lable数组,数组元素数量是lable总数(必须和trendLables元素数量一致)
|
||||
List<DataPoint> datas = focusInfo.getFocusData();
|
||||
for(int i = 0; i<datas.size() ; i++){
|
||||
//在标签上拼接数据
|
||||
newTrendLables[i] = trendLables[i]+" "+ (int)datas.get(i).getValueY();
|
||||
}
|
||||
//重新设置标签数据
|
||||
trendLableChart.setData(newTrendLables, "03-13 15:00");
|
||||
}
|
||||
});
|
||||
trendLinesChart.setData(data.getTrend().getDay(), null); //折线图设置数据
|
||||
|
||||
//月
|
||||
trendLableChartMonth.setLoading(false); //不显示loading
|
||||
trendLableChartMonth.setColumnNum(3); //设置标签列数
|
||||
trendLableChartMonth.setData(trendLables, "03-13 15:00"); //标签控件设置数据
|
||||
trendLinesChartMonth.setLoading(false); //不显示loading
|
||||
trendLinesChartMonth.setAnimType(LinesChart.AnimType.LEFT_TO_RIGHT); //设置动画类型(3种)
|
||||
// trendLinesChart.setAnimType(LinesChart.AnimType.BOTTOM_TO_TOP);
|
||||
// trendLinesChart.setAnimType(LinesChart.AnimType.SLOW_DRAW);
|
||||
//触摸焦点变化,改变标签数量
|
||||
trendLinesChartMonth.setOnFocusChangeListener(new LinesChart.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onfocus(FocusInfo focusInfo) {
|
||||
String[] newTrendLablesMonth = new String[3];
|
||||
List<DataPoint> datas = focusInfo.getFocusData();
|
||||
for(int i = 0; i<datas.size() ; i++){
|
||||
//在标签上拼接数据
|
||||
newTrendLablesMonth[i] = trendLables[i]+" "+ (int)datas.get(i).getValueY();
|
||||
}
|
||||
//重新设置标签数据
|
||||
trendLableChartMonth.setData(newTrendLablesMonth, "03-13 15:00");
|
||||
}
|
||||
});
|
||||
//重组X轴刻度, 取其中5个日期
|
||||
List<List<String>> monthData = data.getTrend().getMonth();
|
||||
Collections.reverse(monthData); //倒序
|
||||
String[] xStrArr = new String[5];
|
||||
xStrArr[0] = monthData.get(0).get(0); //第一天
|
||||
xStrArr[1] = monthData.get(monthData.size()/3).get(0); //
|
||||
xStrArr[2] = monthData.get(monthData.size()/2).get(0); //中间一天
|
||||
xStrArr[3] = monthData.get(monthData.size()/2-1+(monthData.size()-(monthData.size()/2-1))/2).get(0); //
|
||||
xStrArr[4] = monthData.get(monthData.size()-1).get(0); //最后一天
|
||||
for(int i = 0; i<xStrArr.length; i++){
|
||||
String monthDay = xStrArr[i];
|
||||
xStrArr[i] = monthDay.substring(monthDay.indexOf("-")+1,monthDay.length());
|
||||
}
|
||||
trendLinesChartMonth.setData(data.getTrend().getMonth(), xStrArr); //折线图设置数据
|
||||
|
||||
//涨跌对比
|
||||
compareLableChart.setLoading(false);
|
||||
final String[] compareLables = new String[]{"涨家数", "跌家数"};
|
||||
compareLableChart.setColumnNum(2);
|
||||
compareLableChart.setData(compareLables, "03-13 15:00");
|
||||
compareLinesChart.setLoading(false);
|
||||
compareLinesChart.setOnFocusChangeListener(new LinesChart.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onfocus(FocusInfo focusInfo) {
|
||||
String[] newCompareLables = new String[2];
|
||||
List<DataPoint> datas = focusInfo.getFocusData();
|
||||
for(int i = 0; i<datas.size() ; i++){
|
||||
newCompareLables[i] = compareLables[i] +" "+ (int)datas.get(i).getValueY();
|
||||
}
|
||||
compareLableChart.setData(newCompareLables, "03-13 15:00");
|
||||
}
|
||||
});
|
||||
//全部
|
||||
compareLinesChart.setData(data.getCompare().getCompare_line().getStock_updown_all(), null);
|
||||
|
||||
//炸板
|
||||
zhabanLableChart.setLoading(false);
|
||||
final String[] zhabanLables = new String[]{"炸板家数"};
|
||||
zhabanLableChart.setColumnNum(1);
|
||||
zhabanLableChart.setData(zhabanLables, "03-13 15:00");
|
||||
zhabanLinesChart.setLoading(false);
|
||||
zhabanLinesChart.setOnFocusChangeListener(new LinesChart.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onfocus(FocusInfo focusInfo) {
|
||||
String[] newZhabanLables = new String[1];
|
||||
List<DataPoint> datas = focusInfo.getFocusData();
|
||||
newZhabanLables[0] = zhabanLables[0] + (" "+(int)datas.get(0).getValueY()+"家"+
|
||||
" 炸板数"+ NumberFormatUtil.formattedDecimalToPercentage(datas.get(1).getValueY(), 2));
|
||||
zhabanLableChart.setData(newZhabanLables, "03-13 15:00");
|
||||
}
|
||||
});
|
||||
zhabanLinesChart.setData(data.getZhaban().getZhaban_line(), null);
|
||||
|
||||
//涨幅
|
||||
zhangfuLableChart.setLoading(false);
|
||||
final String[] zhangfuLables = new String[]{"上证指数涨幅","昨日涨停股今日涨幅"};
|
||||
zhangfuLableChart.setColumnNum(1);
|
||||
zhangfuLableChart.setData(zhangfuLables, "03-13 15:00");
|
||||
zhangfuLinesChart.setLoading(false);
|
||||
zhangfuLinesChart.setOnFocusChangeListener(new LinesChart.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onfocus(FocusInfo focusInfo) {
|
||||
String[] newZhangfuLables = new String[2];
|
||||
List<DataPoint> datas = focusInfo.getFocusData();
|
||||
for(int i = 0; i<datas.size() ; i++){
|
||||
newZhangfuLables[i] = zhangfuLables[i]+ " "+
|
||||
NumberFormatUtil.formattedDecimalToPercentage(datas.get(i).getValueY(), 2);
|
||||
}
|
||||
zhangfuLableChart.setData(newZhangfuLables, "03-13 15:00");
|
||||
}
|
||||
});
|
||||
zhangfuLinesChart.setData(data.getZhangfu().getZhangfu_line(), null);
|
||||
|
||||
//权重
|
||||
weightLableChart.setLoading(false);
|
||||
final String[] weightLables = new String[]{"沪深300","中小板" , "上证指数", "深证指数"};
|
||||
weightLableChart.setColumnNum(2);
|
||||
weightLableChart.setData(weightLables, "03-13 15:00");
|
||||
weightLinesChart.setLoading(false);
|
||||
weightLinesChart.setOnFocusChangeListener(new LinesChart.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onfocus(FocusInfo focusInfo) {
|
||||
List<DataPoint> datas = focusInfo.getFocusData();
|
||||
String[] newWeightLables = new String[4];
|
||||
for(int i = 0; i<weightLables.length ; i++){
|
||||
newWeightLables[i] = weightLables[i]+ " "+
|
||||
(i>datas.size()-1?"0":NumberFormatUtil.formattedDecimalToPercentage(datas.get(i).getValueY(), 2));
|
||||
}
|
||||
weightLableChart.setData(newWeightLables, "03-13 15:00");
|
||||
}
|
||||
});
|
||||
weightLinesChart.setData(data.getWeight().getWeight_line(), null);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
package com.openxu.hkchart;
|
||||
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.widget.Button;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.openxu.cview.chart.dashboard.DashBoardItem;
|
||||
import com.openxu.cview.xmstock20191205.DashboardView;
|
||||
import com.openxu.cview.xmstock20191205.LevelProgressView;
|
||||
import com.openxu.cview.xmstock20191205.NorthSouthChart;
|
||||
import com.openxu.cview.xmstock20191205.bean.Constacts;
|
||||
import com.openxu.cview.xmstock20191205.bean.NorthSouth;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class XmStockChartActivity191205 extends AppCompatActivity {
|
||||
Button btn_d_north, btn_d_south, btn_y_north, btn_y_south;
|
||||
NorthSouth data;
|
||||
com.openxu.cview.chart.dashboard.DashBoardView dashboardViewOld;
|
||||
DashboardView dashboardView;
|
||||
|
||||
LevelProgressView levelView1, levelView2,levelView3,levelView4;
|
||||
NorthSouthChart chart;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_wcxstock_chart191205);
|
||||
dashboardViewOld = (com.openxu.cview.chart.dashboard.DashBoardView)findViewById(R.id.dashboardViewOld);
|
||||
dashboardView = (DashboardView)findViewById(R.id.dashboardView);
|
||||
|
||||
levelView1 = (LevelProgressView)findViewById(R.id.levelView1);
|
||||
levelView2 = (LevelProgressView)findViewById(R.id.levelView2);
|
||||
levelView3 = (LevelProgressView)findViewById(R.id.levelView3);
|
||||
levelView4 = (LevelProgressView)findViewById(R.id.levelView4);
|
||||
|
||||
btn_d_north = (Button)findViewById(R.id.btn_d_north);
|
||||
btn_d_south = (Button)findViewById(R.id.btn_d_south);
|
||||
btn_y_north = (Button)findViewById(R.id.btn_y_north);
|
||||
btn_y_south = (Button)findViewById(R.id.btn_y_south);
|
||||
chart = (NorthSouthChart)findViewById(R.id.chart);
|
||||
//北向资金今日
|
||||
btn_d_north.setOnClickListener(v->{
|
||||
getData(NorthSouthChart.ChartType.TYPE_T_NORTH);
|
||||
});
|
||||
//南向资金今日
|
||||
btn_d_south.setOnClickListener(v->{
|
||||
getData(NorthSouthChart.ChartType.TYPE_T_SOUTH);
|
||||
});
|
||||
//北向资金 历史每日每周
|
||||
btn_y_north.setOnClickListener(v->{
|
||||
getData(NorthSouthChart.ChartType.TYPE_DW_NORTH);
|
||||
});
|
||||
//南向资金 历史每日每周
|
||||
btn_y_south.setOnClickListener(v->{
|
||||
getData(NorthSouthChart.ChartType.TYPE_DW_SOUTH);
|
||||
});
|
||||
getData();
|
||||
|
||||
}
|
||||
|
||||
//模拟获取数据
|
||||
private void getData(NorthSouthChart.ChartType type){
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(type == NorthSouthChart.ChartType.TYPE_T_NORTH){ //北向资金今日流向
|
||||
data = new Gson().fromJson(Constacts.dataMap.get("north-t"), NorthSouth.class);
|
||||
}else if(type == NorthSouthChart.ChartType.TYPE_T_SOUTH){ //南向资金今日流向
|
||||
data = new Gson().fromJson(Constacts.dataMap.get("north-t"), NorthSouth.class);
|
||||
} else if(type == NorthSouthChart.ChartType.TYPE_DW_NORTH){ //北向资金 历史每日/周流向
|
||||
data = new Gson().fromJson(Constacts.dataMap.get("north-d"), NorthSouth.class);
|
||||
} else if(type == NorthSouthChart.ChartType.TYPE_DW_SOUTH){ //南向资金 历史每日/周流向
|
||||
data = new Gson().fromJson(Constacts.dataMap.get("north-w"), NorthSouth.class);
|
||||
}
|
||||
setChartData(data, type);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
/**设置图表数据*/
|
||||
private void setChartData(NorthSouth data, NorthSouthChart.ChartType type){
|
||||
chart.setLoading(false);
|
||||
chart.setChartType(type);
|
||||
//北向资金
|
||||
if(type == NorthSouthChart.ChartType.TYPE_T_NORTH || type == NorthSouthChart.ChartType.TYPE_DW_NORTH){
|
||||
chart.setFocusLableArray(new String[]{"时间", "净流入金额", "上证指数价格", "上证指数跌涨幅"});
|
||||
//南向资金
|
||||
}else if(type == NorthSouthChart.ChartType.TYPE_T_SOUTH || type == NorthSouthChart.ChartType.TYPE_DW_SOUTH){
|
||||
chart.setFocusLableArray(new String[]{"时间", "净流入金额", "恒生指数价格", "恒生指数跌涨幅"});
|
||||
}
|
||||
//今日流向
|
||||
if(type == NorthSouthChart.ChartType.TYPE_T_NORTH || type == NorthSouthChart.ChartType.TYPE_T_SOUTH){
|
||||
chart.setUpDownColor(new int[]{Color.parseColor("#FC4B4B"),
|
||||
Color.parseColor("#1DAA3E")}); //涨跌颜色(红绿)
|
||||
//lable 和 color必须按照后台返回数据的顺序设置,比如["0930","1.0亿元","26300.510","+0.91%"] 金额在前,指数在后
|
||||
chart.setlableColor(new int[]{Color.parseColor("#DC1010"), Color.parseColor("#FEB271")});
|
||||
chart.setYMARK_NUM(5);
|
||||
// 历史每日每周
|
||||
}else if(type == NorthSouthChart.ChartType.TYPE_DW_NORTH || type == NorthSouthChart.ChartType.TYPE_DW_SOUTH){
|
||||
data = new Gson().fromJson(Constacts.dataMap.get("north-d"), NorthSouth.class);
|
||||
chart.setlableColor(new int[]{Color.parseColor("#FC4B4B"),
|
||||
Color.parseColor("#1DAA3E"),
|
||||
Color.parseColor("#C9D0DC")});
|
||||
chart.setUpDownColor(new int[]{Color.parseColor("#FC4B4B"),
|
||||
Color.parseColor("#1DAA3E")});
|
||||
chart.setYMARK_NUM(5);
|
||||
chart.setXMARK_NUM(4);
|
||||
}
|
||||
/**今日流向数据结构一样,历史日周数据结构一样*/
|
||||
if(type == NorthSouthChart.ChartType.TYPE_T_NORTH){ //北向资金今日流向
|
||||
chart.setlableArray(new String[]{"总资金净流入", "上证指数价格"});
|
||||
chart.setLableX(new String[]{"9:30", "11:30/13:00", "15:00"});
|
||||
}else if(type == NorthSouthChart.ChartType.TYPE_T_SOUTH){ //南向资金今日流向
|
||||
chart.setlableArray(new String[]{"总资金净流入", "恒生指数价格"});
|
||||
chart.setLableX(new String[]{"9:30", "12:00/13:00", "16:00"});
|
||||
} else if(type == NorthSouthChart.ChartType.TYPE_DW_NORTH){ //北向资金 历史每日/周流向
|
||||
chart.setlableArray(new String[]{"净流入金额", "净流出金额", "上证指数价格"});
|
||||
} else if(type == NorthSouthChart.ChartType.TYPE_DW_SOUTH){ //南向资金 历史每日/周流向
|
||||
chart.setlableArray(new String[]{"净流入金额", "净流出金额", "恒生指数价格"});
|
||||
}
|
||||
chart.setData(data.getData());
|
||||
chart.refresh();
|
||||
}
|
||||
|
||||
|
||||
/**2、模拟接口获取数据*/
|
||||
private void getData(){
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
dashboardViewOld.setLoading(false);
|
||||
List<DashBoardItem> list = new ArrayList<>();
|
||||
int[] colors = new int[]{Color.BLUE,Color.RED,Color.YELLOW};
|
||||
for(int i =0;i<3;i++){
|
||||
list.add(new DashBoardItem(colors[i], "lable"+i, i+10));
|
||||
}
|
||||
dashboardViewOld.setData(list);
|
||||
dashboardViewOld.setPro(20);
|
||||
dashboardView.setLoading(false);
|
||||
dashboardView.setData(10000, 4563);
|
||||
|
||||
//注意:等级是从0开始的,所以总等级和当前等级值在设置时应该+1
|
||||
levelView1.setLoading(false);
|
||||
levelView1.setLable("9折+100优惠卷");
|
||||
levelView1.setData(11, 11); //总共Lv10,当前Lv10
|
||||
|
||||
levelView2.setLoading(false);
|
||||
levelView2.setLable("96折");
|
||||
levelView2.setData(11, 5);//总共Lv10,当前Lv4
|
||||
|
||||
levelView3.setLoading(false);
|
||||
levelView3.setLable("93折");
|
||||
levelView3.setData(16, 7);//总共Lv15,当前Lv6
|
||||
|
||||
levelView4.setLoading(false);
|
||||
levelView4.setLable("91折+50优惠卷");
|
||||
levelView4.setData(11, 10);//总共Lv10,当前Lv9
|
||||
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,400 @@
|
||||
package com.openxu.hkchart;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.openxu.cview.xmstock20201030.GlzsLinesChart;
|
||||
import com.openxu.cview.xmstock20201030.MyCalendar;
|
||||
import com.openxu.cview.xmstock20201030.ProgressBar;
|
||||
import com.openxu.cview.xmstock20201030.QsrdLinesChart;
|
||||
import com.openxu.cview.xmstock20201030.SshqLinesChart;
|
||||
import com.openxu.cview.xmstock20201030.StandLinesChart;
|
||||
import com.openxu.cview.xmstock20201030.bean.CalandarList;
|
||||
import com.openxu.cview.xmstock20201030.bean.CalendarData;
|
||||
import com.openxu.cview.xmstock20201030.bean.CalendarDetail;
|
||||
import com.openxu.cview.xmstock20201030.bean.HotDetail;
|
||||
import com.openxu.cview.xmstock20201030.bean.TopDetail;
|
||||
import com.openxu.cview.xmstock20201030.bean.Constacts;
|
||||
import com.openxu.cview.xmstock20201030.build.AnimType;
|
||||
import com.openxu.cview.xmstock20201030.build.AxisLine;
|
||||
import com.openxu.cview.xmstock20201030.build.AxisLineType;
|
||||
import com.openxu.cview.xmstock20201030.build.AxisMark;
|
||||
import com.openxu.cview.xmstock20201030.build.Line;
|
||||
import com.openxu.cview.xmstock20201030.build.Orientation;
|
||||
import com.openxu.utils.DensityUtil;
|
||||
import com.openxu.utils.LogUtil;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class XmStockChartActivity20201030 extends AppCompatActivity {
|
||||
|
||||
|
||||
StandLinesChart linesChart1;
|
||||
// CustomCalendar cal;
|
||||
MyCalendar calendar;
|
||||
ProgressBar progress1, progress2, progress3, progress4;
|
||||
//1. 券商热点走势对比图
|
||||
QsrdLinesChart qsrdLinesChart;
|
||||
//2. 概念走势图
|
||||
GlzsLinesChart glzsLinesChart;
|
||||
//3. 实时行情图
|
||||
SshqLinesChart sshqLinesChart;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_wcxstock_chart20201030);
|
||||
calendar = (MyCalendar)findViewById(R.id.calendar);
|
||||
linesChart1 = (StandLinesChart)findViewById(R.id.linesChart1);
|
||||
|
||||
progress1 = (ProgressBar) findViewById(R.id.progress1);
|
||||
progress2 = (ProgressBar) findViewById(R.id.progress2);
|
||||
progress3 = (ProgressBar) findViewById(R.id.progress3);
|
||||
progress4 = (ProgressBar) findViewById(R.id.progress4);
|
||||
progress1.setData(100, 0);
|
||||
progress2.setData(100, 50);
|
||||
progress3.setData(100, 90);
|
||||
progress4.setData(100, 100);
|
||||
|
||||
qsrdLinesChart = (QsrdLinesChart) findViewById(R.id.qsrdLinesChart);
|
||||
glzsLinesChart = (GlzsLinesChart) findViewById(R.id.glzsLinesChart);
|
||||
sshqLinesChart = (SshqLinesChart) findViewById(R.id.sshqLinesChart);
|
||||
|
||||
// cal = (CustomCalendar)findViewById(R.id.cal);
|
||||
//TODO 模拟请求当月数据
|
||||
/* final List<DayFinish> list = new ArrayList<>();
|
||||
list.add(new DayFinish(1,2,2));
|
||||
list.add(new DayFinish(2,1,2));
|
||||
list.add(new DayFinish(3,0,2));
|
||||
list.add(new DayFinish(4,2,2));
|
||||
list.add(new DayFinish(5,2,2));
|
||||
list.add(new DayFinish(6,2,2));
|
||||
list.add(new DayFinish(7,2,2));
|
||||
list.add(new DayFinish(8,0,2));
|
||||
list.add(new DayFinish(9,1,2));
|
||||
list.add(new DayFinish(10,2,2));
|
||||
list.add(new DayFinish(11,5,2));
|
||||
list.add(new DayFinish(12,2,2));
|
||||
list.add(new DayFinish(13,2,2));
|
||||
list.add(new DayFinish(14,3,2));
|
||||
list.add(new DayFinish(15,2,2));
|
||||
list.add(new DayFinish(16,1,2));
|
||||
list.add(new DayFinish(17,0,2));
|
||||
list.add(new DayFinish(18,2,2));
|
||||
list.add(new DayFinish(19,2,2));
|
||||
list.add(new DayFinish(20,0,2));
|
||||
list.add(new DayFinish(21,2,2));
|
||||
list.add(new DayFinish(22,1,2));
|
||||
list.add(new DayFinish(23,2,0));
|
||||
list.add(new DayFinish(24,0,2));
|
||||
list.add(new DayFinish(25,2,2));
|
||||
list.add(new DayFinish(26,2,2));
|
||||
list.add(new DayFinish(27,2,2));
|
||||
list.add(new DayFinish(28,2,2));
|
||||
list.add(new DayFinish(29,2,2));
|
||||
list.add(new DayFinish(30,2,2));
|
||||
list.add(new DayFinish(31,2,2));
|
||||
|
||||
cal.setRenwu("2017年1月", list);
|
||||
cal.setOnClickListener(new CustomCalendar.onClickListener() {
|
||||
@Override
|
||||
public void onLeftRowClick() {
|
||||
Toast.makeText(XmStockChartActivity20201030.this, "点击减箭头", Toast.LENGTH_SHORT).show();
|
||||
cal.monthChange(-1);
|
||||
new Thread(){
|
||||
@Override
|
||||
public void run() {
|
||||
try{
|
||||
Thread.sleep(1000);
|
||||
XmStockChartActivity20201030.this.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
cal.setRenwu(list);
|
||||
}
|
||||
});
|
||||
}catch (Exception e){
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRightRowClick() {
|
||||
Toast.makeText(XmStockChartActivity20201030.this, "点击加箭头", Toast.LENGTH_SHORT).show();
|
||||
cal.monthChange(1);
|
||||
new Thread(){
|
||||
@Override
|
||||
public void run() {
|
||||
try{
|
||||
Thread.sleep(1000);
|
||||
XmStockChartActivity20201030.this.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
cal.setRenwu(list);
|
||||
}
|
||||
});
|
||||
}catch (Exception e){
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTitleClick(String monthStr, Date month) {
|
||||
Toast.makeText(XmStockChartActivity20201030.this, "点击了标题:"+monthStr, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWeekClick(int weekIndex, String weekStr) {
|
||||
Toast.makeText(XmStockChartActivity20201030.this, "点击了星期:"+weekStr, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDayClick(int day, String dayStr, DayFinish finish) {
|
||||
Toast.makeText(XmStockChartActivity20201030.this, "点击了日期:"+dayStr, Toast.LENGTH_SHORT).show();
|
||||
Log.w("", "点击了日期:"+dayStr);
|
||||
}
|
||||
});
|
||||
*/
|
||||
getData();
|
||||
|
||||
}
|
||||
|
||||
private void getData(){
|
||||
//1. 日历
|
||||
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
CalandarList calandarList = new Gson().fromJson(Constacts.data4, CalandarList.class);
|
||||
//设置监听
|
||||
calendar.setItemClickListener(new MyCalendar.ItemClickListener() {
|
||||
@Override
|
||||
public void onDayClick(CalendarData calendar, List<CalendarDetail> details) {
|
||||
String str = "点击的日期为"+calendar.getDate()+"\n"+"股票信息数量"+details.size();
|
||||
Toast.makeText(getApplicationContext(), str, Toast.LENGTH_SHORT).show();
|
||||
Log.w("XmStockChartActivity", str);
|
||||
|
||||
Intent intent = new Intent(XmStockChartActivity20201030.this, XmStockChartActivity202010301.class);
|
||||
intent.putExtra("stock", details.get(0).getStock_list().get(0));
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
//绑定数据
|
||||
calendar.setData(calandarList.getData().getCalendar(), calandarList.getData().getCalendar_detail());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}, 500);
|
||||
|
||||
|
||||
//1. 券商热点与走势对比
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
JSONObject json = null;
|
||||
try {
|
||||
// json = new JSONObject(Constacts.data);
|
||||
// Gson gson = new Gson();
|
||||
// String dataStr = json.getString("data");
|
||||
TopDetail topDetail = new Gson().fromJson(Constacts.data1, TopDetail.class);
|
||||
//触摸回调
|
||||
qsrdLinesChart.setOnFocusChangeListener(new QsrdLinesChart.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onfocus(QsrdLinesChart.FocusData focusData) {
|
||||
//手指触摸后回调焦点数据,
|
||||
//focusData.getData() --> ["2020-09-30", 2245.38]
|
||||
//focusData.getNews() --> {"title":"国办:协调推动智能路网设施建设","publishdate":"2020-11-03 08:00:00"}
|
||||
LogUtil.v(getClass().getSimpleName(), "焦点数据:"+focusData.getData().get(0)+":"+focusData.getData().get(1));
|
||||
if(focusData.getNews()==null){
|
||||
LogUtil.w(getClass().getSimpleName(), "--------当天没有新闻");
|
||||
}else{
|
||||
Toast.makeText(getApplicationContext(), "焦点新闻:"+focusData.getNews().getPublishdate()+
|
||||
" "+focusData.getNews().getTitle(), Toast.LENGTH_SHORT).show();
|
||||
LogUtil.e(getClass().getSimpleName(), "========焦点新闻:"+focusData.getNews().getTitle());
|
||||
}
|
||||
}
|
||||
});
|
||||
//绑定数据
|
||||
qsrdLinesChart.setData(topDetail.getData().getTrend_line(), topDetail.getData().getNews());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}, 500);
|
||||
|
||||
|
||||
//2. 概念走势图
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
JSONObject json = null;
|
||||
try {
|
||||
HotDetail hotDetail = new Gson().fromJson(Constacts.data2, HotDetail.class);
|
||||
//概念走势图, 每个元素表示:时间、概念、热度 [20200803,"1582.08","30.00"],
|
||||
glzsLinesChart.setData(hotDetail.getData().getTrend_line());
|
||||
|
||||
//实时行情
|
||||
sshqLinesChart.setData(hotDetail.getData().getReal_trend_line());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}, 500);
|
||||
|
||||
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
// JSONObject json = new JSONObject(Constacts.data);
|
||||
// Gson gson = new Gson();
|
||||
// String dataStr = json.getString("data");
|
||||
//data = gson.fromJson(dataStr, ChartData.class);
|
||||
|
||||
Random random = new Random();
|
||||
List<LinesData> datas = new ArrayList<>();
|
||||
for(int i = 100; i<200; i++){
|
||||
datas.add(new LinesData(random.nextInt(10)+i, random.nextInt(30)+i, "2020-"+i));
|
||||
}
|
||||
//绑定
|
||||
bindChartData(datas);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**3、绑定数据*/
|
||||
private void bindChartData(List<LinesData> datas){
|
||||
linesChart1.builder()
|
||||
//设置折线
|
||||
.line(new Line.Builder<LinesData>(this)
|
||||
.lineColor(Color.RED)
|
||||
.lineWidth(2)
|
||||
.lineType(Line.LineType.CURVE)
|
||||
.orientation(Orientation.LEFT)
|
||||
.animType(AnimType.LEFT_TO_RIGHT)
|
||||
.datas(datas)
|
||||
.field_x("xlable")
|
||||
.field_y("num1").build())
|
||||
.line(new Line.Builder(this)
|
||||
.lineColor(Color.BLUE)
|
||||
.lineType(Line.LineType.CURVE)
|
||||
.orientation(Orientation.LEFT)
|
||||
// .orientation(Orientation.RIGHT)
|
||||
.datas(datas)
|
||||
.animType(AnimType.NONE) //BOTTOM_TO_TOP
|
||||
.field_x("xlable")
|
||||
.field_y("num2").build())
|
||||
//设置x轴刻度
|
||||
.xAxisMark(new AxisMark.Builder(this)
|
||||
.showLable(true)
|
||||
.lables(new String[]{"9:00", "10:00", "11:00", "12:00"})
|
||||
.lableOrientation(Orientation.BOTTOM)
|
||||
.datas(datas)
|
||||
.field("xlable").build())
|
||||
// .xAxisMark(new AxisMark.Builder(this)
|
||||
// .showLable(true)
|
||||
// .lableNum(5)
|
||||
// .lableOrientation(Orientation.BOTTOM)
|
||||
// .datas(datas)
|
||||
// .field("xlable").build())
|
||||
//设置左右y轴刻度
|
||||
.yLeftAxisMark(new AxisMark.Builder(this)
|
||||
.showLable(true)
|
||||
.lableNum(5)
|
||||
.lableOrientation(Orientation.TOP)
|
||||
.lableType(AxisMark.LABLE_TYPE.FLOAT)
|
||||
.datas(datas)
|
||||
.field("num1").build())
|
||||
.yRightAxisMark(new AxisMark.Builder(this)
|
||||
.showLable(true)
|
||||
.lableNum(5)
|
||||
.lableOrientation(Orientation.RIGHT)
|
||||
.lableType(AxisMark.LABLE_TYPE.FLOAT)
|
||||
.datas(datas)
|
||||
.field("num2").build())
|
||||
//默认坐标轴线水平方向最下方和最上方为实线,其他为虚线;垂直方向最左和最右为实线,中间不画线。
|
||||
//可以设置任意一条线,只需要传入指定的index ,并调用设置水平或者垂直线的方法,需要注意index不能超标
|
||||
//设置竖直方向上第3根线为红色实线,总共5根线(xAxisMark()确定)
|
||||
.verticalAxisLine(2, new AxisLine.Builder(this)
|
||||
.lineType(AxisLineType.DASHE)
|
||||
.lineWidth(DensityUtil.dip2px(this, 1))
|
||||
.lineColor(Color.parseColor("#939393")).build())
|
||||
//设置水平方向上第3根线为红色实线,总共5根线(yLeftAxisMark() / yRightAxisMark()确定)
|
||||
.horizontalAxisLine(0, new AxisLine.Builder(this)
|
||||
.lineType(AxisLineType.SOLID)
|
||||
.lineWidth(DensityUtil.dip2px(this, 3))
|
||||
.lineColor(Color.parseColor("#939393")).build())
|
||||
.horizontalAxisLine(2, new AxisLine.Builder(this)
|
||||
.lineType(AxisLineType.DASHE)
|
||||
.lineWidth(DensityUtil.dip2px(this, 1))
|
||||
.lineColor(Color.RED).build())
|
||||
.horizontalAxisLine(3, new AxisLine.Builder(this)
|
||||
.lineType(AxisLineType.NONE).build())
|
||||
.build();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public class LinesData {
|
||||
|
||||
private float num1;
|
||||
private float num2;
|
||||
private String xlable;
|
||||
|
||||
public LinesData(float num1, float num2, String xlable) {
|
||||
this.num1 = num1;
|
||||
this.num2 = num2;
|
||||
this.xlable = xlable;
|
||||
}
|
||||
|
||||
public float getNum1() {
|
||||
return num1;
|
||||
}
|
||||
|
||||
public void setNum1(float num1) {
|
||||
this.num1 = num1;
|
||||
}
|
||||
|
||||
public float getNum2() {
|
||||
return num2;
|
||||
}
|
||||
|
||||
public void setNum2(float num2) {
|
||||
this.num2 = num2;
|
||||
}
|
||||
|
||||
public String getXlable() {
|
||||
return xlable;
|
||||
}
|
||||
|
||||
public void setXlable(String xlable) {
|
||||
this.xlable = xlable;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.openxu.hkchart;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import com.openxu.cview.xmstock20201030.SyzsLinesChart;
|
||||
import com.openxu.cview.xmstock20201030.bean.CalendarDataStock;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class XmStockChartActivity202010301 extends AppCompatActivity {
|
||||
|
||||
private String TAG = "XmStockChartActivity202010301";
|
||||
SyzsLinesChart syzsLinesChart;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_wcxstock_chart20201030_syzs);
|
||||
syzsLinesChart = (SyzsLinesChart)findViewById(R.id.syzsLinesChart);
|
||||
getData();
|
||||
}
|
||||
|
||||
private void getData(){
|
||||
CalendarDataStock stock = getIntent().getParcelableExtra("stock");
|
||||
syzsLinesChart.setData(stock.getTrend_line());
|
||||
Log.w(TAG, "获取传递的股票数据:"+stock);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.openxu.hkchart.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
|
||||
/**
|
||||
* autour : openXu
|
||||
* date : 2017/9/7 19:05
|
||||
* className : CommandRecyclerAdapter
|
||||
* version : 1.0
|
||||
* description : 通用的CommandRecyclerAdapter
|
||||
*/
|
||||
public abstract class CommandRecyclerAdapter<T> extends RecyclerView.Adapter<ViewHolder> {
|
||||
protected Context mContext;
|
||||
protected int mLayoutId;
|
||||
protected List<T> mDatas;
|
||||
protected LayoutInflater mInflater;
|
||||
|
||||
public CommandRecyclerAdapter(Context context, int layoutId, List<T> datas) {
|
||||
mDatas = new ArrayList<>();
|
||||
mContext = context;
|
||||
mInflater = LayoutInflater.from(context);
|
||||
mLayoutId = layoutId;
|
||||
if(datas!=null)
|
||||
mDatas.addAll(datas);
|
||||
}
|
||||
|
||||
public void setData(List<T> datas){
|
||||
mDatas.clear();
|
||||
if(datas!=null)
|
||||
mDatas.addAll(datas);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(final ViewGroup parent, int viewType){
|
||||
ViewHolder viewHolder = ViewHolder.get(mContext, parent, mLayoutId);
|
||||
return viewHolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(ViewHolder holder, final int position) {
|
||||
convert(holder, mDatas.get(position));
|
||||
setItemViewLayout(holder, position);
|
||||
holder.setOnClickListener(-1, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
onItemClick(mDatas.get(position), position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount(){
|
||||
return mDatas.size();
|
||||
}
|
||||
|
||||
public List<T> getDatas(){
|
||||
return mDatas;
|
||||
}
|
||||
/**
|
||||
* 重写此方法,将数据绑定到控件上
|
||||
* @param holder
|
||||
* @param t
|
||||
*/
|
||||
public abstract void convert(ViewHolder holder, T t);
|
||||
|
||||
/**
|
||||
* 此方法后面添加,用于根据条目位置position设置item布局样式
|
||||
* @param holder
|
||||
* @param position
|
||||
*/
|
||||
public void setItemViewLayout(ViewHolder holder, int position){}
|
||||
/***
|
||||
* item点击
|
||||
* @param data
|
||||
*/
|
||||
public abstract void onItemClick(T data, int position);
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.openxu.hkchart.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.SparseArray;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
|
||||
/**
|
||||
* autour : openXu
|
||||
* date : 2017/9/7 19:04
|
||||
* className : ViewHolder
|
||||
* version : 1.0
|
||||
* description : 通用的ViewHolder
|
||||
*/
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
private SparseArray<View> mViews;
|
||||
private View mConvertView;
|
||||
private Context mContext;
|
||||
|
||||
public ViewHolder(Context context, View itemView, ViewGroup parent) {
|
||||
super(itemView);
|
||||
mContext = context;
|
||||
mConvertView = itemView;
|
||||
mViews = new SparseArray<>();
|
||||
}
|
||||
|
||||
public static ViewHolder get(Context context, ViewGroup parent, int layoutId) {
|
||||
View itemView = LayoutInflater.from(context).inflate(layoutId, parent, false);
|
||||
ViewHolder holder = new ViewHolder(context, itemView, parent);
|
||||
return holder;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过viewId获取控件
|
||||
* @param viewId
|
||||
* @return
|
||||
*/
|
||||
public <T extends View> T getView(int viewId) {
|
||||
View view = mViews.get(viewId);
|
||||
if (view == null) {
|
||||
view = mConvertView.findViewById(viewId);
|
||||
mViews.put(viewId, view);
|
||||
}
|
||||
return (T) view;
|
||||
}
|
||||
public ViewHolder setVisible(int viewId, int visible) {
|
||||
getView(viewId).setVisibility(visible);
|
||||
return this;
|
||||
}
|
||||
public ViewHolder setTextColor(int viewId, int color) {
|
||||
TextView tv = getView(viewId);
|
||||
tv.setTextColor(color);
|
||||
return this;
|
||||
}
|
||||
public ViewHolder setText(int viewId, CharSequence text) {
|
||||
TextView tv = getView(viewId);
|
||||
tv.setText(TextUtils.isEmpty(text)?"":text);
|
||||
return this;
|
||||
}
|
||||
public ViewHolder setBackgroundResource(int viewId, int id) {
|
||||
View view = getView(viewId);
|
||||
view.setBackgroundResource(id);
|
||||
return this;
|
||||
}
|
||||
public ViewHolder setImageResource(int viewId, int resId) {
|
||||
ImageView view = getView(viewId);
|
||||
view.setImageResource(resId);
|
||||
return this;
|
||||
}
|
||||
public ViewHolder setCheckBoxChecked(int viewId, boolean check) {
|
||||
CheckBox cb = getView(viewId);
|
||||
cb.setChecked(check);
|
||||
return this;
|
||||
}
|
||||
public ViewHolder setLinearLayoutBgIcon(int viewId, int iconResourse) {
|
||||
LinearLayout ll = getView(viewId);
|
||||
ll.setBackgroundResource(iconResourse);
|
||||
return this;
|
||||
}
|
||||
public ViewHolder setOnClickListener(int viewId, View.OnClickListener listener) {
|
||||
if(viewId==-1){
|
||||
mConvertView.setOnClickListener(listener);
|
||||
}else{
|
||||
View view = getView(viewId);
|
||||
view.setOnClickListener(listener);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.openxu.hkchart.base;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
|
||||
import com.openxu.cview.TitleLayout;
|
||||
import com.openxu.hkchart.R;
|
||||
import com.openxu.utils.FBarUtils;
|
||||
import com.openxu.utils.SharedData;
|
||||
import com.openxu.utils.StatusBarUtil;
|
||||
import com.yanzhenjie.permission.AndPermission;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ViewDataBinding;
|
||||
|
||||
/**
|
||||
* Author: openX
|
||||
* Time: 2019/2/27 15:51
|
||||
* class: BaseActivity
|
||||
* Description:
|
||||
*/
|
||||
public abstract class BaseActivity<V extends ViewDataBinding>
|
||||
extends AppCompatActivity implements IBaseView {
|
||||
|
||||
protected String TAG;
|
||||
protected Context mContext;
|
||||
|
||||
protected V binding;
|
||||
protected TitleLayout titleLayout;
|
||||
|
||||
protected SharedData spUtil;
|
||||
|
||||
@SuppressLint("WrongViewCast")
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
TAG = getClass().getSimpleName();
|
||||
mContext = this;
|
||||
//DataBindingUtil类需要在project的build中配置 dataBinding {enabled true }, 同步后会自动关联android.databinding包
|
||||
binding = DataBindingUtil.setContentView(this, getLayoutId());
|
||||
|
||||
//状态栏透明和间距处理
|
||||
// StatusBarUtil.darkMode(this); //状态栏字体变黑色(透明状态栏)
|
||||
StatusBarUtil.immersive(this);//全透明状态栏(状态栏字体默认白色)
|
||||
// StatusBarUtil.immersive(this, getResources().getColor(R.color.colorPrimary), 1);
|
||||
//导航栏颜色
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && FBarUtils.isSupportNavBar()) {
|
||||
FBarUtils.setNavBarVisibility(this, true);
|
||||
FBarUtils.setNavBarColor(this, Color.parseColor("#dddddd"));
|
||||
}
|
||||
// titleLayout = findViewById(R.id.titleLayout);
|
||||
if (null != titleLayout) {
|
||||
StatusBarUtil.setPaddingSmart(this, titleLayout);
|
||||
titleLayout.setOnMenuClickListener((menu, view) -> {
|
||||
onMenuClick(menu, view);
|
||||
});
|
||||
}
|
||||
spUtil = SharedData.getInstance();
|
||||
initView();
|
||||
initData();
|
||||
}
|
||||
|
||||
protected void onMenuClick(TitleLayout.MENU_NAME menu, View view) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏输入法
|
||||
*/
|
||||
public void hideSoftInputFromWindow() {
|
||||
try {
|
||||
((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(getWindow().getDecorView().getWindowToken(), 0);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (binding != null)
|
||||
binding.unbind();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.openxu.hkchart.base;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.openxu.cview.TitleLayout;
|
||||
import com.openxu.hkchart.R;
|
||||
import com.openxu.utils.StatusBarUtil;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ViewDataBinding;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
/**
|
||||
* Author: openX
|
||||
* Time: 2019/2/28 16:24
|
||||
* class: BaseFragment
|
||||
* Description:
|
||||
*/
|
||||
public abstract class BaseFragment<V extends ViewDataBinding>
|
||||
extends Fragment implements IBaseView {
|
||||
|
||||
protected V binding;
|
||||
private boolean lazyLoaded = false;
|
||||
|
||||
protected TitleLayout titleLayout;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
binding = DataBindingUtil.inflate(inflater, getLayoutId(), container, false);
|
||||
return binding.getRoot();
|
||||
}
|
||||
@Override
|
||||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
titleLayout = binding.getRoot().findViewById(R.id.titleLayout);
|
||||
if (null != titleLayout) {
|
||||
StatusBarUtil.setPaddingSmart(getContext(), titleLayout);
|
||||
titleLayout.setOnMenuClickListener((menu, view1) -> {
|
||||
onMenuClick(menu, view1);
|
||||
});
|
||||
}
|
||||
initView();
|
||||
}
|
||||
|
||||
protected void onMenuClick(TitleLayout.MENU_NAME menu, View view) {
|
||||
}
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
// 实现懒加载
|
||||
if (!lazyLoaded) {
|
||||
initData();
|
||||
lazyLoaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void finish() {
|
||||
getActivity().finish();
|
||||
}
|
||||
|
||||
public void finish(int resultCode, Intent intent) {
|
||||
getActivity().setResult(resultCode, intent);
|
||||
getActivity().finish();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (binding != null) {
|
||||
binding.unbind();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.openxu.hkchart.base;
|
||||
|
||||
/**
|
||||
* Author: openX
|
||||
* Time: 2019/3/15 9:42
|
||||
* class: IBaseView
|
||||
* Description: 定义View(Activity、Fragment)的模板方法
|
||||
*/
|
||||
public interface IBaseView {
|
||||
/**获取布局id*/
|
||||
int getLayoutId();
|
||||
/**初始化控件*/
|
||||
void initView();
|
||||
/**初始化数据*/
|
||||
void initData();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.openxu.hkchart.bean;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
/**
|
||||
* Author: openXu
|
||||
* Time: 2021/5/10 17:45
|
||||
* class: MainItem
|
||||
* Description:
|
||||
*/
|
||||
public class MainItem {
|
||||
private String name;
|
||||
private Class<? extends Activity> gotoClass;
|
||||
|
||||
public MainItem(String name, Class<? extends Activity> gotoClass) {
|
||||
this.name = name;
|
||||
this.gotoClass = gotoClass;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Class<? extends Activity> getGotoClass() {
|
||||
return gotoClass;
|
||||
}
|
||||
|
||||
public void setGotoClass(Class<? extends Activity> gotoClass) {
|
||||
this.gotoClass = gotoClass;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.openxu.hkchart.bean;
|
||||
|
||||
|
||||
/**
|
||||
* autour : openXu
|
||||
* date : 2018/6/8 9:40
|
||||
* className : PieBean
|
||||
* version : 1.0
|
||||
* description : 请添加类说明
|
||||
*/
|
||||
public class PieBean {
|
||||
private float Numner;
|
||||
private String Name;
|
||||
|
||||
public PieBean() {
|
||||
}
|
||||
|
||||
public PieBean(float Numner, String Name) {
|
||||
this.Numner = Numner;
|
||||
this.Name = Name;
|
||||
}
|
||||
|
||||
public float getNumner() {
|
||||
return Numner;
|
||||
}
|
||||
|
||||
public void setNumner(float numner) {
|
||||
Numner = numner;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return Name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
Name = name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.openxu.hkchart.bean;
|
||||
|
||||
|
||||
/**
|
||||
* autour : openXu
|
||||
* date : 2018/6/8 9:40
|
||||
* className : RoseBean
|
||||
* version : 1.0
|
||||
* description : 请添加类说明
|
||||
*/
|
||||
public class RoseBean {
|
||||
|
||||
private float count;
|
||||
private String ClassName;
|
||||
|
||||
public RoseBean() {
|
||||
}
|
||||
|
||||
public RoseBean(float count, String className) {
|
||||
this.count = count;
|
||||
ClassName = className;
|
||||
}
|
||||
|
||||
public float getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(float count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
return ClassName;
|
||||
}
|
||||
|
||||
public void setClassName(String className) {
|
||||
ClassName = className;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.openxu.hkchart.view;
|
||||
|
||||
import com.github.abel533.echarts.axis.CategoryAxis;
|
||||
import com.github.abel533.echarts.axis.ValueAxis;
|
||||
import com.github.abel533.echarts.code.Trigger;
|
||||
import com.github.abel533.echarts.json.GsonOption;
|
||||
import com.github.abel533.echarts.series.Line;
|
||||
|
||||
/**
|
||||
* Author: openXu
|
||||
* Time: 2020/11/12 11:17
|
||||
* class: EchartOptionUtil
|
||||
* Description:
|
||||
*/
|
||||
public class EchartOptionUtil {
|
||||
|
||||
public static GsonOption getLineChartOptions(Object[] xAxis, Object[] yAxis) {
|
||||
GsonOption option = new GsonOption();
|
||||
option.title("折线图");
|
||||
option.legend("销量");
|
||||
option.tooltip().trigger(Trigger.axis);
|
||||
|
||||
ValueAxis valueAxis = new ValueAxis();
|
||||
option.yAxis(valueAxis);
|
||||
|
||||
CategoryAxis categorxAxis = new CategoryAxis();
|
||||
categorxAxis.axisLine().onZero(false);
|
||||
categorxAxis.boundaryGap(true);
|
||||
categorxAxis.data(xAxis);
|
||||
option.xAxis(categorxAxis);
|
||||
|
||||
Line line = new Line();
|
||||
line.smooth(false).name("销量").data(yAxis).itemStyle().normal().lineStyle().shadowColor("rgba(0,0,0,0.4)");
|
||||
option.series(line);
|
||||
return option;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.openxu.hkchart.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import com.github.abel533.echarts.json.GsonOption;
|
||||
|
||||
/**
|
||||
* Author: openXu
|
||||
* Time: 2020/11/12 11:17
|
||||
* class: EchartView
|
||||
* Description:
|
||||
*/
|
||||
public class EchartView extends WebView {
|
||||
private static final String TAG = EchartView.class.getSimpleName();
|
||||
|
||||
public EchartView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public EchartView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public EchartView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
WebSettings webSettings = getSettings();
|
||||
webSettings.setJavaScriptEnabled(true);
|
||||
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
|
||||
webSettings.setSupportZoom(false);
|
||||
webSettings.setDisplayZoomControls(false);
|
||||
loadUrl("file:///android_asset/echarts.html");
|
||||
}
|
||||
|
||||
/**刷新图表
|
||||
* java调用js的loadEcharts方法刷新echart
|
||||
* 不能在第一时间就用此方法来显示图表,因为第一时间html的标签还未加载完成,不能获取到标签值
|
||||
* @param option
|
||||
*/
|
||||
public void refreshEchartsWithOption(GsonOption option) {
|
||||
if (option == null) {
|
||||
return;
|
||||
}
|
||||
String optionString = option.toString();
|
||||
String call = "javascript:loadEcharts('" + optionString + "')";
|
||||
loadUrl(call);
|
||||
}
|
||||
}
|
||||
@@ -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,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true" android:drawable="@mipmap/icon_checkbox_checked" />
|
||||
<item android:drawable="@mipmap/icon_checkbox_uncheck" />
|
||||
</selector>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<com.openxu.cview.TitleLayout
|
||||
android:id="@+id/title_layout"
|
||||
style="@style/TitleDefStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:iconBack="@mipmap/btn_back"
|
||||
app:textcenter="base64图片"/>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_img"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:background="#ff0000"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<com.openxu.cview.TitleLayout
|
||||
android:id="@+id/title_layout"
|
||||
style="@style/TitleDefStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:iconBack="@mipmap/btn_back"
|
||||
app:textcenter="法之运"/>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
<com.openxu.hkchart.bar.MultipartBarChart
|
||||
android:id="@+id/multipartBarChart"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip"/>
|
||||
<com.openxu.hkchart.bar.MultipartBarChart
|
||||
android:id="@+id/multipartBarChart1"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip"/>
|
||||
<com.openxu.hkchart.bar.MultipartBarChart
|
||||
android:id="@+id/multipartBarChart2"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip"/>
|
||||
<com.openxu.hkchart.bar.MultipartBarChart
|
||||
android:id="@+id/multipartBarChart3"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip"/>
|
||||
<com.openxu.hkchart.line.LineChart
|
||||
android:id="@+id/lineChart1"
|
||||
android:visibility="visible"
|
||||
android:layout_marginTop="20dp"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip" />
|
||||
<com.openxu.hkchart.line.LineChart
|
||||
android:id="@+id/lineChart2"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="20dp"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip" />
|
||||
<com.openxu.hkchart.line.LineChart
|
||||
android:id="@+id/lineChart3"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="20dp"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip" />
|
||||
|
||||
<com.openxu.hkchart.bar.HorizontalBarChart
|
||||
android:id="@+id/horizontalBarChart"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<com.openxu.hkchart.bar.BarChart
|
||||
android:id="@+id/bartChart1"
|
||||
android:visibility="visible"
|
||||
android:layout_marginTop="20dp"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip" />
|
||||
<com.openxu.hkchart.bar.BarChart
|
||||
android:id="@+id/bartChart2"
|
||||
android:visibility="visible"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip" />
|
||||
<com.openxu.hkchart.bar.BarChart
|
||||
android:id="@+id/bartChart3"
|
||||
android:visibility="visible"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip" />
|
||||
<com.openxu.hkchart.bar.BarChart
|
||||
android:id="@+id/bartChart4"
|
||||
android:visibility="visible"
|
||||
android:layout_marginTop="20dp"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip" />
|
||||
|
||||
<WebView
|
||||
android:id="@+id/webview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="500dp"/>
|
||||
|
||||
<com.openxu.hkchart.view.EchartView
|
||||
android:id="@+id/lineChart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="400dp"
|
||||
android:layout_gravity="center">
|
||||
</com.openxu.hkchart.view.EchartView>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.openxu.cview.TitleLayout
|
||||
android:id="@+id/title_layout"
|
||||
style="@style/TitleDefStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:iconBack="@mipmap/btn_back"
|
||||
app:textcenter="横向柱状图"/>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<com.openxu.cview.chart.barchart.BarHorizontalChart
|
||||
android:id="@+id/chart1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="250dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="#ffffff"
|
||||
android:padding="10dip"/>
|
||||
<com.openxu.cview.chart.barchart.BarHorizontalChart
|
||||
android:id="@+id/chart2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="250dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:background="#ffffff"
|
||||
android:padding="10dip"/>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<com.openxu.cview.TitleLayout
|
||||
android:id="@+id/title_layout"
|
||||
style="@style/TitleDefStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:textRight="设置"
|
||||
app:textcenter="自定义控件-图表"/>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,106 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.openxu.cview.TitleLayout
|
||||
android:id="@+id/title_layout"
|
||||
style="@style/TitleDefStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:iconBack="@mipmap/btn_back"
|
||||
app:textcenter="饼状图"/>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<!--饼状图1-->
|
||||
<com.openxu.cview.chart.piechart.PieChartLayout
|
||||
android:id="@+id/pieChart1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="180dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingRight="10dp"
|
||||
android:background="#ffffff"
|
||||
android:orientation="horizontal">
|
||||
<com.openxu.cview.chart.piechart.PieChart
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
<com.openxu.cview.chart.piechart.PieChartLableView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2" />
|
||||
</com.openxu.cview.chart.piechart.PieChartLayout>
|
||||
|
||||
<!--饼状图2-->
|
||||
<com.openxu.cview.chart.piechart.PieChartLayout
|
||||
android:id="@+id/pieChart2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="180dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingRight="10dp"
|
||||
android:background="#ffffff"
|
||||
android:orientation="horizontal">
|
||||
<com.openxu.cview.chart.piechart.PieChart
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
<com.openxu.cview.chart.piechart.PieChartLableView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2" />
|
||||
</com.openxu.cview.chart.piechart.PieChartLayout>
|
||||
|
||||
<!--饼状图3-->
|
||||
<com.openxu.cview.chart.piechart.PieChartLayout
|
||||
android:id="@+id/pieChart3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="180dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingRight="10dp"
|
||||
android:background="#ffffff"
|
||||
android:orientation="horizontal">
|
||||
<com.openxu.cview.chart.piechart.PieChart
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
<com.openxu.cview.chart.piechart.PieChartLableView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2" />
|
||||
</com.openxu.cview.chart.piechart.PieChartLayout>
|
||||
|
||||
<!--饼状图4-->
|
||||
<com.openxu.cview.chart.piechart.PieChartLayout
|
||||
android:id="@+id/pieChart4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingRight="10dp"
|
||||
android:background="#ffffff"
|
||||
android:orientation="horizontal">
|
||||
<com.openxu.cview.chart.piechart.PieChart
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
<com.openxu.cview.chart.piechart.PieChartLableView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2" />
|
||||
</com.openxu.cview.chart.piechart.PieChartLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.openxu.cview.TitleLayout
|
||||
android:id="@+id/title_layout"
|
||||
style="@style/TitleDefStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:iconBack="@mipmap/btn_back"
|
||||
app:textcenter="进度环形图"/>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="20dp"
|
||||
android:orientation="vertical">
|
||||
<com.openxu.cview.chart.ProgressPieChart
|
||||
android:id="@+id/chart1"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:background="#ffffff"/>
|
||||
|
||||
<com.openxu.cview.chart.ProgressPieChart
|
||||
android:id="@+id/chart2"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_marginTop="10dp"/>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.openxu.cview.TitleLayout
|
||||
android:id="@+id/title_layout"
|
||||
style="@style/TitleDefStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:iconBack="@mipmap/btn_back"
|
||||
app:textcenter="南丁格尔玫瑰图"/>
|
||||
|
||||
<ScrollView
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:orientation="horizontal">
|
||||
<com.openxu.cview.chart.rosechart.NightingaleRoseChart
|
||||
android:id="@+id/roseChartEmpty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"/>
|
||||
<com.openxu.cview.chart.rosechart.NightingaleRoseChart
|
||||
android:id="@+id/roseChartOne"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="150dp"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:paddingRight="10dp"
|
||||
android:layout_weight="1"/>
|
||||
</LinearLayout>
|
||||
|
||||
<com.openxu.cview.chart.rosechart.NightingaleRoseChart
|
||||
android:id="@+id/roseChartSmall"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"/>
|
||||
<com.openxu.cview.chart.rosechart.NightingaleRoseChart
|
||||
android:id="@+id/roseChartMany"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
>
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<com.openxu.cview.TitleLayout
|
||||
android:id="@+id/title_layout"
|
||||
style="@style/TitleDefStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:iconBack="@mipmap/btn_back"
|
||||
app:textcenter="设置"/>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
<include
|
||||
android:id="@+id/debugOnOff"
|
||||
layout="@layout/setting_item_layout_checkbox"
|
||||
app:title="@{`开启Debug模式(绘制辅助线)`}"
|
||||
app:lineVisible="@{View.VISIBLE}"/>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.openxu.cview.TitleLayout
|
||||
android:id="@+id/title_layout"
|
||||
style="@style/TitleDefStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:iconBack="@mipmap/btn_back"
|
||||
app:textcenter="纵向柱状图"/>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<com.openxu.cview.chart.barchart.BarVerticalChart
|
||||
android:id="@+id/chart1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="250dip"
|
||||
android:background="#ffffff"
|
||||
android:padding="10dp"/>
|
||||
<com.openxu.cview.chart.barchart.BarVerticalChart
|
||||
android:id="@+id/chart2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="250dip"
|
||||
android:layout_marginTop="7dp"
|
||||
android:background="#ffffff"
|
||||
android:padding="10dp"/>
|
||||
<com.openxu.cview.chart.barchart.BarVerticalChart
|
||||
android:id="@+id/chart3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="250dip"
|
||||
android:layout_marginTop="7dp"
|
||||
android:background="#ffffff"
|
||||
android:padding="10dp"/>
|
||||
<com.openxu.cview.chart.barchart.BarVerticalChart
|
||||
android:id="@+id/chart4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="250dip"
|
||||
android:layout_marginTop="7dp"
|
||||
android:background="#ffffff"
|
||||
android:padding="10dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,202 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<com.openxu.cview.TitleLayout
|
||||
android:id="@+id/title_layout"
|
||||
style="@style/TitleDefStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:iconBack="@mipmap/btn_back"
|
||||
app:textcenter="折线图"/>
|
||||
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="15dip"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:text="收评:沪指全天单边走弱,竣工、区块链领涨题材概念"/>
|
||||
|
||||
<com.openxu.cview.xmstock.BarChart
|
||||
android:id="@+id/bartChart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="220dip"
|
||||
android:paddingRight="15dip"
|
||||
android:paddingLeft="15dip"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="10dip"
|
||||
android:background="#fb000000"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="15dip"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:text="日日日日:涨跌停走势:题材炒作情绪活跃"/>
|
||||
<com.openxu.cview.xmstock.LinesLableChart
|
||||
android:id="@+id/trendLableChart"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<com.openxu.cview.xmstock.LinesChart
|
||||
android:id="@+id/trendLinesChart"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="15dip"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:text="月月月:涨跌停走势:题材炒作情绪活跃"/>
|
||||
<!--涨跌停走势有日月之分,需要自己写切换控件,切换后只需要重新设置数据即可,这里将日月分开写,只是举例-->
|
||||
<com.openxu.cview.xmstock.LinesLableChart
|
||||
android:id="@+id/trendLableChartMonth"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<com.openxu.cview.xmstock.LinesChart
|
||||
android:id="@+id/trendLinesChartMonth"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="10dip"
|
||||
android:background="#fb000000"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="15dip"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:text="涨跌对比:市场人气趋于平淡"/>
|
||||
<com.openxu.cview.xmstock.LinesLableChart
|
||||
android:id="@+id/compareLableChart"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<com.openxu.cview.xmstock.LinesChart
|
||||
android:id="@+id/compareLinesChart"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip" />
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="10dip"
|
||||
android:background="#fb000000"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="15dip"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:text="今日封板未遂:市场做多气氛良好"/>
|
||||
<com.openxu.cview.xmstock.LinesLableChart
|
||||
android:id="@+id/zhabanLableChart"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<com.openxu.cview.xmstock.LinesChart
|
||||
android:id="@+id/zhabanLinesChart"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="10dip"
|
||||
android:background="#fb000000"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="15dip"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:text="昨日涨停今日表现:短线资金接力意愿较好"/>
|
||||
<com.openxu.cview.xmstock.LinesLableChart
|
||||
android:id="@+id/zhangfuLableChart"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<com.openxu.cview.xmstock.LinesChart
|
||||
android:id="@+id/zhangfuLinesChart"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="10dip"
|
||||
android:background="#fb000000"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="15dip"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:text="权重表现:权重拖累,题材偏要"/>
|
||||
<com.openxu.cview.xmstock.LinesLableChart
|
||||
android:id="@+id/weightLableChart"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<com.openxu.cview.xmstock.LinesChart
|
||||
android:id="@+id/weightLinesChart"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,152 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<com.openxu.cview.TitleLayout
|
||||
android:id="@+id/title_layout"
|
||||
style="@style/TitleDefStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:iconBack="@mipmap/btn_back"
|
||||
app:textcenter="南北向"/>
|
||||
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
<!--仪表-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<com.openxu.cview.xmstock20191205.DashboardView
|
||||
android:id="@+id/dashboardView"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:paddingTop="10dip"
|
||||
android:layout_weight="3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="能量:238767823亿"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<com.openxu.cview.xmstock20191205.OilTableLine
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp" />
|
||||
<com.openxu.cview.chart.dashboard.DashBoardView
|
||||
android:id="@+id/dashboardViewOld"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:paddingTop="10dip"
|
||||
android:layout_weight="3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp" />
|
||||
|
||||
<!--等级-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="#000000">
|
||||
<com.openxu.cview.xmstock20191205.LevelProgressView
|
||||
android:id="@+id/levelView1"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:paddingTop="10dip"
|
||||
android:layout_marginTop="10dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<com.openxu.cview.xmstock20191205.LevelProgressView
|
||||
android:id="@+id/levelView2"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:paddingTop="10dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<com.openxu.cview.xmstock20191205.LevelProgressView
|
||||
android:id="@+id/levelView3"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:paddingTop="10dip"
|
||||
android:layout_marginTop="10dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<com.openxu.cview.xmstock20191205.LevelProgressView
|
||||
android:id="@+id/levelView4"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:paddingTop="10dip"
|
||||
android:layout_marginTop="10dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<Button
|
||||
android:id="@+id/btn_d_north"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="北向资金今日"/>
|
||||
<Button
|
||||
android:id="@+id/btn_d_south"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="南向资金今日"/>
|
||||
<Button
|
||||
android:id="@+id/btn_y_north"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="北向资金 历史"/>
|
||||
<Button
|
||||
android:id="@+id/btn_y_south"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="南向资金 历史"/>
|
||||
</LinearLayout>
|
||||
<com.openxu.cview.xmstock20191205.NorthSouthChart
|
||||
android:id="@+id/chart"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:paddingTop="10dip"
|
||||
android:background="#fb000000"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="230dip" />
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="10dip"
|
||||
android:background="#fb000000"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,125 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<com.openxu.cview.TitleLayout
|
||||
android:id="@+id/title_layout"
|
||||
style="@style/TitleDefStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:iconBack="@mipmap/btn_back"
|
||||
app:textcenter="折线图"/>
|
||||
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.openxu.cview.xmstock20201030.MyCalendar
|
||||
android:id="@+id/calendar"
|
||||
android:layout_marginTop="20dp"
|
||||
android:padding="20dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<com.openxu.cview.xmstock20201030.StandLinesChart
|
||||
android:id="@+id/linesChart1"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip" />
|
||||
|
||||
<!-- <com.openxu.cview.xmstock20201030.CustomCalendar
|
||||
android:id="@+id/cal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
app:mMonthRowL="@mipmap/custom_calendar_row_left"
|
||||
app:mMonthRowR="@mipmap/custom_calendar_row_right"
|
||||
app:mMonthRowSpac="20dip"
|
||||
|
||||
app:mTextSizeMonth="20sp"
|
||||
app:mTextSizeWeek="17sp"
|
||||
app:mTextSizeDay="17sp"
|
||||
app:mTextSizePre="10sp"
|
||||
|
||||
app:mTextColorMonth="#4b4b4b"
|
||||
app:mTextColorWeek="#9e9e9d"
|
||||
app:mSelectWeekTextColor="#f67633"
|
||||
app:mTextColorDay="#686768"
|
||||
app:mTextColorPreFinish="#fc7451"
|
||||
app:mTextColorPreUnFinish="#60ba8d"
|
||||
app:mTextColorPreNull="#cecdcd"
|
||||
app:mSelectTextColor="#ffffff"
|
||||
|
||||
app:mMonthSpac="10dip"
|
||||
app:mLineSpac="12dip"
|
||||
app:mTextSpac="8dip"
|
||||
|
||||
app:mCurrentBg="#6E6E6E"
|
||||
app:mCurrentBgStrokeWidth="1.5dip"
|
||||
app:mCurrentBgDashPath="@array/customCalendar_currentDay_bg_DashPath"
|
||||
app:mSelectBg="#fe7f5c"
|
||||
app:mSelectRadius="15dip" />
|
||||
-->
|
||||
<com.openxu.cview.xmstock20201030.ProgressBar
|
||||
android:id="@+id/progress1"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content" />
|
||||
<com.openxu.cview.xmstock20201030.ProgressBar
|
||||
android:id="@+id/progress2"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content" />
|
||||
<com.openxu.cview.xmstock20201030.ProgressBar
|
||||
android:id="@+id/progress3"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content" />
|
||||
<com.openxu.cview.xmstock20201030.ProgressBar
|
||||
android:id="@+id/progress4"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content" />
|
||||
<com.openxu.cview.xmstock20201030.QsrdLinesChart
|
||||
android:id="@+id/qsrdLinesChart"
|
||||
android:layout_marginTop="20dp"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip" />
|
||||
|
||||
<com.openxu.cview.xmstock20201030.GlzsLinesChart
|
||||
android:id="@+id/glzsLinesChart"
|
||||
android:layout_marginTop="20dp"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip" />
|
||||
|
||||
<com.openxu.cview.xmstock20201030.SshqLinesChart
|
||||
android:id="@+id/sshqLinesChart"
|
||||
android:layout_marginTop="20dp"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<com.openxu.cview.TitleLayout
|
||||
android:id="@+id/title_layout"
|
||||
style="@style/TitleDefStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:iconBack="@mipmap/btn_back"
|
||||
app:textcenter="收益走势"/>
|
||||
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
<com.openxu.cview.xmstock20201030.SyzsLinesChart
|
||||
android:id="@+id/syzsLinesChart"
|
||||
android:layout_marginTop="20dp"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="12dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dip" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:paddingTop="1dp">
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#ffffff"
|
||||
android:padding="15dp"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/text_size_level_def"
|
||||
android:textColor="@color/text_color_def"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<data>
|
||||
<variable name="title" type="String" />
|
||||
<variable name="lineVisible" type="Integer" />
|
||||
</data>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/color_white"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:paddingLeft="@dimen/dp_19"
|
||||
android:paddingRight="@dimen/dp_19"
|
||||
>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:textColor="@color/text_color_def"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:text="@{title.toString()}"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:button="@drawable/selector_checkbox"
|
||||
android:layout_alignParentRight="true"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/line"
|
||||
android:visibility="@{lineVisible}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_04"
|
||||
android:background="@color/line_bg_color"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</layout>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
@@ -0,0 +1,6 @@
|
||||
<resources>
|
||||
<style name="OXViewAppTheme" parent="@style/OXViewAppBaseTheme">
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,9 @@
|
||||
<resources>
|
||||
<style name="OXViewAppTheme" parent="@style/OXViewAppBaseTheme">
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
</resources>
|
||||
@@ -0,0 +1,41 @@
|
||||
<resources>
|
||||
|
||||
<dimen name="dp_04">0.4dp</dimen>
|
||||
<dimen name="dp_1">1dp</dimen>
|
||||
<dimen name="dp_5">5dp</dimen>
|
||||
<dimen name="dp_8">8dp</dimen>
|
||||
<dimen name="dp_10">10dp</dimen>
|
||||
<dimen name="dp_12">12dp</dimen>
|
||||
<dimen name="dp_15">15dp</dimen>
|
||||
<dimen name="dp_16">16dp</dimen>
|
||||
<dimen name="dp_18">18dp</dimen>
|
||||
<dimen name="dp_19">19dp</dimen>
|
||||
<dimen name="dp_20">20dp</dimen>
|
||||
<dimen name="dp_23">23dp</dimen>
|
||||
<dimen name="dp_25">25dp</dimen>
|
||||
<dimen name="dp_31">31dp</dimen>
|
||||
<dimen name="dp_32">32dp</dimen>
|
||||
<dimen name="dp_36">36dp</dimen>
|
||||
<dimen name="dp_40">40dp</dimen>
|
||||
<dimen name="dp_42">42dp</dimen>
|
||||
<dimen name="dp_45">45dp</dimen>
|
||||
<dimen name="dp_48">48dp</dimen>
|
||||
<dimen name="dp_50">50dp</dimen>
|
||||
<dimen name="dp_58">58dp</dimen>
|
||||
<dimen name="dp_60">60dp</dimen>
|
||||
<dimen name="dp_70">70dp</dimen>
|
||||
<dimen name="dp_80">80dp</dimen>
|
||||
<dimen name="dp_100">100dp</dimen>
|
||||
<dimen name="dp_240">240dp</dimen>
|
||||
<dimen name="dp_320">320dp</dimen>
|
||||
|
||||
<dimen name="sp_12">12sp</dimen>
|
||||
<dimen name="sp_14">14sp</dimen>
|
||||
<dimen name="sp_16">16sp</dimen>
|
||||
<dimen name="sp_17">17sp</dimen>
|
||||
<dimen name="sp_24">24sp</dimen>
|
||||
<dimen name="sp_34">34sp</dimen>
|
||||
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">OXViewLib</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="OXViewAppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowActionBar">false</item>
|
||||
<item name="android:clipToPadding">true</item>
|
||||
<item name="android:windowSoftInputMode">adjustResize</item>
|
||||
</style>
|
||||
|
||||
<style name="OXViewAppTheme" parent="@style/OXViewAppBaseTheme">
|
||||
<!--不能在此配置fitsSystemWindows,会导致toast或者系统弹窗上移挪位-->
|
||||
<!-- <item name="android:fitsSystemWindows">true</item>-->
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user