|
|
@@ -3,6 +3,7 @@ package cn.muchinfo.rma.view.base.chart.old.timeCharts;
|
|
|
import android.content.Context;
|
|
|
import android.graphics.Color;
|
|
|
import android.text.Html;
|
|
|
+import android.text.Spanned;
|
|
|
import android.view.View;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
@@ -735,6 +736,24 @@ public class StickChartTools {
|
|
|
candleStickTV.setText(Html.fromHtml(strHtml));
|
|
|
}
|
|
|
|
|
|
+ public static Spanned setCandleStickText(Context context, double ma5Val, double ma10Val, double ma15Val) {
|
|
|
+ String source = "";
|
|
|
+ source += "<font color='" + context.getResources().getColor(com.desfate.chart.R.color.mtp_chart_k_ma5) + "'>MA5:%s </font>";
|
|
|
+ source += "<font color='" + context.getResources().getColor(com.desfate.chart.R.color.mtp_chart_k_ma10) + "'>MA10:%s </font>";
|
|
|
+ source += "<font color='" + context.getResources().getColor(com.desfate.chart.R.color.mtp_chart_k_ma15) + "'>MA15:%s</font>";
|
|
|
+ NumberFormat nf = NumberFormat.getInstance();
|
|
|
+ nf.setGroupingUsed(false);
|
|
|
+ nf.setMaximumFractionDigits(2);
|
|
|
+ nf.setMinimumFractionDigits(2);
|
|
|
+ String ma5 = nf.format(ma5Val);
|
|
|
+ String ma10 = nf.format(ma10Val);
|
|
|
+ String ma15 = nf.format(ma15Val);
|
|
|
+ String strHtml = String.format(source, ma5, ma10, ma15);
|
|
|
+ return Html.fromHtml(strHtml);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
public static void setOHLC(Context context, TextView textView, double opened, double highest, double lowest, double closed) {
|
|
|
int decimalPlace = 2;
|
|
|
textView.setText("开:"
|