|
楼主 |
发表于 2024-7-26 11:57:30
|
显示全部楼层
湖南省娄底市
package com.e4a.runtime.components.impl.android.天文历法类类库;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.NinePatch;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Typeface;
import android.graphics.Bitmap.Config;
import android.graphics.Paint.Style;
import android.graphics.drawable.Drawable;
import android.text.StaticLayout;
import android.text.TextPaint;
import android.text.Layout.Alignment;
import android.util.DisplayMetrics;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.widget.TextView;
import com.e4a.runtime.android.mainActivity;
import com.e4a.runtime.components.ComponentContainer;
import com.e4a.runtime.components.impl.android.ViewComponent;
import com.e4a.runtime.components.impl.android.util.PaintUtil;
import com.e4a.runtime.events.EventDispatcher;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class 天文历法类Impl extends ViewComponent implements OnClickListener, OnTouchListener, 天文历法类 {
private Paint backgroundColor;
private String backgroundImage = "";
private int backgroundImage2 = -1;
private int canvasheight = mainActivity.getContext().getWallpaperDesiredMinimumWidth();
private int canvaswidth = mainActivity.getContext().getWallpaperDesiredMinimumWidth();
private int currX;
private int currY;
private int lastX;
private int lastY;
private GestureDetector mGestureDetector;
private Paint paintColor;
private int paintsize;
private int paintstyle;
private float textsize;
private Typeface typeface = null;
private boolean visiable;
private DisplayMetrics displayMetrics;
private Paint paint;
public static final int DATE_YEAR = 1;
private int pulltorefresh_arrow;
private int XZDAY = 0;
private int 列宽;
private int 行高;
private static final int 列数 = 7;
private static int 行数 = 7;
private int 画布宽度 = 0;
private int 画布高度 = 0;
private int 日期高度 = 0;
private int 日期宽度 = 0;
private int 详情高度 = 0;
private int 详情宽度 = 0;
private int 月历高度 = 0;
private int 月历顶边 = 0;
private int 星期高度 = 0;
private int 格高 = 0;
private int 格宽 = 0;
private int 横标值 = 0;
private int 纵标值 = 0;
private int 月总天数 = 0;
private int 月首星期 = 0;
private int 月总周数 = 0;
private int 公历年 = 0;
private int 公历月 = 0;
private int 公历日 = 0;
private int 公历时 = 0;
private int 放假日 = 0;
private int 农历月 = 0;
private int 农历日 = 0;
private int 农历时 = 0;
private int 月大小 = 0;
private String 月状况 = "";
private String 闰状况 = "";
private String 月名称 = "";
private String 日名称 = "";
private String 月相名称 = "";
private String 节气 = "";
private String 民俗节日 = "";
private String 公历节日 = "";
private String 农历节日 = "";
private String 节气名称 = "";
private String 年号 = "";
private int 今日值 = 0;
private int 公日值 = 0;
private int 月天数 = 0;
private int 选择年 = 0;
private int 选择月 = 0;
private int 选择日 = 0;
public static boolean 轮值显示;
public static boolean 运转显示;
private int 公历日字体 = 18;
private int 当前年;
private int 当前月;
private int KKKK = -1;
public static String Zhouqi = "①②③④⑤⑥⑦⑧⑨⑩⑾⑿";
public static int CxY;
public static int CxM;
public static int CxD;
public static int Mtbs;
public static int Dbzq;
public static String Dbpx;
private int cheight = mainActivity.getContext().getWallpaperDesiredMinimumHeight();
private int cwidth = mainActivity.getContext().getWallpaperDesiredMinimumWidth();
private int SSW = 0;
private int SSH = 0;
private int 循环余 = 0;
public 天文历法类Impl(ComponentContainer var1) {
super(var1);
}
protected View createView() {
天文历法类Impl.CanvasView var1 = new 天文历法类Impl.CanvasView(mainActivity.getContext());
var1.setOnClickListener(this);
var1.setFocusable(true);
this.backgroundColor = new Paint();
this.paintColor = new Paint(1);
this.paintColor.setStrokeWidth(1.0F);
this.mGestureDetector = new GestureDetector(new SimpleOnGestureListener() {
public boolean onFling(MotionEvent var1, MotionEvent var2, float var3, float var4) {
int var5 = (int)(var1.getRawX() - var2.getRawX());
int var6 = (int)(var1.getRawY() - var2.getRawY());
int var7 = Math.abs(var5) > Math.abs(var6) ? (var5 > 0 ? 4 : 5) : (var6 > 0 ? 2 : 3);
if (var7 == 4) {
天文历法类Impl.this.月递增();
}
if (var7 == 5) {
天文历法类Impl.this.月递减();
}
return true;
}
public boolean onScroll(MotionEvent var1, MotionEvent var2, float var3, float var4) {
int var10000 = (int)(var1.getRawX() - var2.getRawX());
var10000 = (int)(var1.getRawY() - var2.getRawY());
boolean var8;
if (Math.abs(var3) > Math.abs(var4)) {
var8 = var3 > 0.0F ? true : true;
} else {
var8 = var4 > 0.0F ? true : true;
}
return true;
}
public boolean onDown(MotionEvent var1) {
return true;
}
public void onLongPress(MotionEvent var1) {
}
public void onShowPress(MotionEvent var1) {
}
public boolean onSingleTapUp(MotionEvent var1) {
int var2 = (int)var1.getX();
int var3 = (int)var1.getY();
天文历法类Impl.this.currX = var2;
天文历法类Impl.this.currY = var3;
if (var2 > 0 && var3 < 天文历法类Impl.this.月历顶边 + 天文历法类Impl.this.星期高度) {
boolean var4 = SharedPrefsUtil.getValue(mainActivity.getContext(), "RoquerySetting", "Roquery", false);
if (var4 && !天文历法类Impl.轮值显示) {
天文历法类Impl.轮值显示 = true;
} else {
天文历法类Impl.轮值显示 = false;
}
boolean var5 = SharedPrefsUtil.getValue(mainActivity.getContext(), "RoquerySetting", "Yunzry", false);
if (var5 && !天文历法类Impl.运转显示) {
天文历法类Impl.运转显示 = true;
} else {
天文历法类Impl.运转显示 = false;
}
天文历法类Impl.this.历法视窗(天文历法类Impl.this.选择年, 天文历法类Impl.this.选择月);
}
if (var2 > 0 && var3 > 天文历法类Impl.this.月历顶边 + 天文历法类Impl.this.星期高度) {
int var6 = (int)(Math.floor((double)(var2 / 天文历法类Impl.this.格宽)) + 1.0D);
int var7 = (int)Math.floor((double)((var3 - 天文历法类Impl.this.月历顶边 - 天文历法类Impl.this.星期高度) / 天文历法类Impl.this.格高));
天文历法类Impl.this.选择日 = var7 * 7 + var6 - 天文历法类Impl.this.月首星期;
if (天文历法类Impl.this.选择日 >= 1 && 天文历法类Impl.this.选择日 <= 天文历法类Impl.this.月总天数) {
天文历法类Impl.this.历法视窗(天文历法类Impl.this.选择年, 天文历法类Impl.this.选择月);
}
}
return true;
}
public boolean onDoubleTap(MotionEvent var1) {
return true;
}
public boolean onDoubleTapEvent(MotionEvent var1) {
return true;
}
public boolean onSingleTapConfirmed(MotionEvent var1) {
return true;
}
});
var1.setOnTouchListener(this);
return var1;
}
public boolean onTouch(View var1, MotionEvent var2) {
this.lastX = this.currX;
this.lastY = this.currY;
this.currX = (int)var2.getX();
this.currY = (int)var2.getY();
this.mGestureDetector.onTouchEvent(var2);
return false;
}
public void onClick(View var1) {
}
public int 背景颜色() {
return PaintUtil.extractARGB(this.backgroundColor);
}
public void 背景颜色(int var1) {
PaintUtil.changePaint(this.backgroundColor, var1);
天文历法类Impl.CanvasView var2 = (天文历法类Impl.CanvasView)this.getView();
var2.canvas.drawPaint(this.backgroundColor);
var2.invalidate();
}
public String 背景图片() {
return this.backgroundImage;
}
public void 背景图片(String var1) {
this.backgroundImage = var1;
try {
if (var1.length() <= 0) {
return;
}
天文历法类Impl.CanvasView var2;
if (var1.startsWith("/")) {
var2 = (天文历法类Impl.CanvasView)this.getView();
PaintUtil.changePaint(this.backgroundColor, 0);
var2.canvas.drawPaint(this.backgroundColor);
var2.setBackgroundDrawable(Drawable.createFromStream(new FileInputStream(var1), var1));
var2.invalidate();
return;
}
var2 = (天文历法类Impl.CanvasView)this.getView();
PaintUtil.changePaint(this.backgroundColor, 0);
var2.canvas.drawPaint(this.backgroundColor);
var2.setBackgroundDrawable(Drawable.createFromStream(var2.getContext().getAssets().open(var1), var1));
var2.invalidate();
} catch (IOException var3) {
}
}
public int 背景图片2() {
return this.backgroundImage2;
}
public void 背景图片2(int var1) {
this.backgroundImage2 = var1;
天文历法类Impl.CanvasView var2 = (天文历法类Impl.CanvasView)this.getView();
PaintUtil.changePaint(this.backgroundColor, 0);
var2.canvas.drawPaint(this.backgroundColor);
var2.setBackgroundResource(var1);
var2.invalidate();
}
public int 画笔颜色() {
return PaintUtil.extractARGB(this.paintColor);
}
public void 画笔颜色(int var1) {
PaintUtil.changePaint(this.paintColor, var1);
}
public int 画笔粗细() {
return this.paintsize;
}
public void 画笔粗细(int var1) {
if (var1 == 0) {
this.paintColor.setStrokeWidth(1.0F);
this.paintsize = 1;
} else {
this.paintColor.setStrokeWidth((float)var1);
this.paintsize = var1;
}
}
public int 画笔类型() {
return this.paintstyle;
}
public void 画笔类型(int var1) {
if (var1 == 1) {
this.paintColor.setStyle(Style.FILL);
}
if (var1 == 2) {
this.paintColor.setStyle(Style.STROKE);
}
if (var1 == 3) {
this.paintColor.setStyle(Style.FILL_AND_STROKE);
}
this.paintstyle = var1;
}
public float 字体大小() {
return this.textsize;
}
public void 字体大小(float var1) {
this.paintColor.setTextSize(this.转换字体大小(var1));
this.textsize = var1;
}
public float 转换字体大小(float var1) {
TextView var2 = new TextView(mainActivity.getContext());
var2.setText("");
float var3 = var2.getTextSize();
return var3 / 9.0F * var1;
}
public int 画布宽度() {
天文历法类Impl.CanvasView var1 = (天文历法类Impl.CanvasView)this.getView();
this.cwidth = var1.getWidth();
return this.cwidth;
}
public int 画布高度() {
天文历法类Impl.CanvasView var1 = (天文历法类Impl.CanvasView)this.getView();
this.cheight = var1.getHeight();
return this.cheight;
}
public void 自定义字体(String var1) {
if (var1.startsWith("/")) {
this.typeface = Typeface.createFromFile(var1);
} else {
this.typeface = Typeface.createFromAsset(mainActivity.getContext().getAssets(), var1);
}
this.paintColor.setTypeface(this.typeface);
}
public void 清空() {
天文历法类Impl.CanvasView var1 = (天文历法类Impl.CanvasView)this.getView();
var1.bitmap.eraseColor(0);
var1.invalidate();
}
public int 取点颜色值(int var1, int var2) {
return ((天文历法类Impl.CanvasView)this.getView()).bitmap.getPixel(var1, var2);
}
public void 保存状态() {
((天文历法类Impl.CanvasView)this.getView()).canvas.save();
}
public void 恢复状态() {
((天文历法类Impl.CanvasView)this.getView()).canvas.restore();
}
public void 旋转画布(int var1, int var2, float var3) {
((天文历法类Impl.CanvasView)this.getView()).canvas.rotate(var3, (float)var1, (float)var2);
}
public void 画点(int var1, int var2) {
天文历法类Impl.CanvasView var3 = (天文历法类Impl.CanvasView)this.getView();
var3.canvas.drawPoint((float)var1, (float)var2, this.paintColor);
var3.invalidate();
}
public void 画圆(int var1, int var2, float var3) {
天文历法类Impl.CanvasView var4 = (天文历法类Impl.CanvasView)this.getView();
var4.canvas.drawCircle((float)var1, (float)var2, var3, this.paintColor);
var4.invalidate();
}
public void 画直线(int var1, int var2, int var3, int var4) {
天文历法类Impl.CanvasView var5 = (天文历法类Impl.CanvasView)this.getView();
var5.canvas.drawLine((float)var1, (float)var2, (float)var3, (float)var4, this.paintColor);
var5.invalidate();
}
public void 画贝塞尔曲线(int var1, int var2, int var3, int var4, int var5, int var6) {
Path var7 = new Path();
var7.moveTo((float)var1, (float)var2);
var7.quadTo((float)var3, (float)var4, (float)var5, (float)var6);
天文历法类Impl.CanvasView var8 = (天文历法类Impl.CanvasView)this.getView();
var8.canvas.drawPath(var7, this.paintColor);
var8.invalidate();
}
public void 画文字(int var1, int var2, String var3) {
天文历法类Impl.CanvasView var4 = (天文历法类Impl.CanvasView)this.getView();
var4.canvas.drawText(var3, (float)var1, (float)var2, this.paintColor);
var4.invalidate();
}
public int 画文字2(int var1, int var2, String var3, float var4, int var5) {
天文历法类Impl.CanvasView var6 = (天文历法类Impl.CanvasView)this.getView();
TextPaint var7 = new TextPaint();
var7.setAntiAlias(true);
var7.setTextSize(this.转换字体大小(this.textsize));
var7.setColor(this.画笔颜色());
var7.setStrokeWidth((float)this.paintsize);
if (this.typeface != null) {
var7.setTypeface(this.typeface);
}
if (this.paintstyle == 1) {
var7.setStyle(Style.FILL);
} else {
var7.setStyle(Style.STROKE);
}
StaticLayout var8 = new StaticLayout(var3, var7, var5, Alignment.ALIGN_NORMAL, var4, 0.0F, true);
var6.canvas.translate((float)var1, (float)var2);
var8.draw(var6.canvas);
var6.canvas.translate((float)(-var1), (float)(-var2));
var6.invalidate();
return var8.getLineCount();
}
public int 取文字宽度(String var1) {
Rect var2 = new Rect();
this.paintColor.getTextBounds(var1, 0, var1.length(), var2);
return var2.width();
}
public int 水平居中(String var1) {
int var2 = (int)(this.paintColor.measureText(var1) / 2.0F);
return var2;
}
public int 垂直居中() {
int var1 = (int)((this.paintColor.ascent() + this.paintColor.descent()) / 2.0F);
return var1;
}
public int 取文字高度(String var1) {
Rect var2 = new Rect();
this.paintColor.getTextBounds(var1, 0, var1.length(), var2);
return var2.height();
}
public void 画矩形(int var1, int var2, int var3, int var4) {
天文历法类Impl.CanvasView var5 = (天文历法类Impl.CanvasView)this.getView();
Rect var6 = new Rect();
var6.left = var1;
var6.top = var2;
var6.right = var1 + var3;
var6.bottom = var2 + var4;
var5.canvas.drawRect(var6, this.paintColor);
var5.invalidate();
}
public void 画圆角矩形(int var1, int var2, int var3, int var4, float var5) {
天文历法类Impl.CanvasView var6 = (天文历法类Impl.CanvasView)this.getView();
RectF var7 = new RectF();
var7.left = (float)var1;
var7.top = (float)var2;
var7.right = (float)(var1 + var3);
var7.bottom = (float)(var2 + var4);
var6.canvas.drawRoundRect(var7, var5, var5, this.paintColor);
var6.invalidate();
}
public void 画弧形(int var1, int var2, int var3, int var4, float var5, float var6, boolean var7) {
天文历法类Impl.CanvasView var8 = (天文历法类Impl.CanvasView)this.getView();
RectF var9 = new RectF();
var9.left = (float)var1;
var9.top = (float)var2;
var9.right = (float)(var1 + var3);
var9.bottom = (float)(var2 + var4);
var8.canvas.drawArc(var9, var5, var6, var7, this.paintColor);
var8.invalidate();
}
public void 画图片缩放部分(String var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9) {
try {
if (var1.length() <= 0) {
return;
}
Bitmap var10;
Rect var11;
天文历法类Impl.CanvasView var12;
if (!var1.startsWith("/")) {
var10 = Bitmap.createBitmap(BitmapFactory.decodeStream(mainActivity.getContext().getResources().getAssets().open(var1)), var6, var7, var8, var9);
var11 = new Rect();
var11.left = var2;
var11.top = var3;
var11.right = var2 + var4;
var11.bottom = var3 + var5;
var12 = (天文历法类Impl.CanvasView)this.getView();
var12.canvas.drawBitmap(var10, (Rect)null, var11, this.paintColor);
var12.invalidate();
} else if ((new File(var1)).exists()) {
var10 = Bitmap.createBitmap(BitmapFactory.decodeFile(var1), var6, var7, var8, var9);
var11 = new Rect();
var11.left = var2;
var11.top = var3;
var11.right = var2 + var4;
var11.bottom = var3 + var5;
var12 = (天文历法类Impl.CanvasView)this.getView();
var12.canvas.drawBitmap(var10, (Rect)null, var11, this.paintColor);
var12.invalidate();
}
} catch (IOException var13) {
}
}
public void 画图片缩放2(int var1, int var2, int var3, int var4, int var5) {
Bitmap var6 = BitmapFactory.decodeResource(mainActivity.getContext().getResources(), var1);
(new NinePatch(var6, var6.getNinePatchChunk(), (String)null)).draw(((天文历法类Impl.CanvasView)this.getView()).canvas, new Rect(var2, var3, var4, var5));
}
public void 画图片缩放(String var1, int var2, int var3, int var4, int var5) {
try {
if (var1.length() <= 0) {
return;
}
Bitmap var6;
Rect var7;
天文历法类Impl.CanvasView var8;
if (!var1.startsWith("/")) {
var6 = BitmapFactory.decodeStream(mainActivity.getContext().getResources().getAssets().open(var1));
var7 = new Rect();
var7.left = var2;
var7.top = var3;
var7.right = var2 + var4;
var7.bottom = var3 + var5;
var8 = (天文历法类Impl.CanvasView)this.getView();
var8.canvas.drawBitmap(var6, (Rect)null, var7, this.paintColor);
var8.invalidate();
} else if ((new File(var1)).exists()) {
var6 = BitmapFactory.decodeFile(var1);
var7 = new Rect();
var7.left = var2;
var7.top = var3;
var7.right = var2 + var4;
var7.bottom = var3 + var5;
var8 = (天文历法类Impl.CanvasView)this.getView();
var8.canvas.drawBitmap(var6, (Rect)null, var7, this.paintColor);
var8.invalidate();
}
} catch (IOException var9) {
}
}
public static String DateTime() {
SimpleDateFormat var0 = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
Date var1 = new Date(System.currentTimeMillis());
String var2 = var0.format(var1);
return var2;
}
public static int YDateTime() {
SimpleDateFormat var0 = new SimpleDateFormat("yyyy");
Date var1 = new Date(System.currentTimeMillis());
String var2 = var0.format(var1);
return Integer.parseInt(var2);
}
public static int MDateTime() {
SimpleDateFormat var0 = new SimpleDateFormat("MM");
Date var1 = new Date(System.currentTimeMillis());
String var2 = var0.format(var1);
return Integer.parseInt(var2);
}
public static int DDateTime() {
SimpleDateFormat var0 = new SimpleDateFormat("dd");
Date var1 = new Date(System.currentTimeMillis());
String var2 = var0.format(var1);
return Integer.parseInt(var2);
}
public static int 历法配色(int var0) {
int var1 = -1;
if (var0 % 7 == 0) {
var1 = -65536;
}
if (var0 % 7 == 6) {
var1 = -65281;
}
return var1;
}
public void 自定义日期(int var1, int var2, int var3) {
this.选择年 = var1;
this.选择月 = var2;
this.选择日 = var3;
this.历法视窗(this.选择年, this.选择月);
}
public void 今天() {
this.选择年 = YDateTime();
this.选择月 = MDateTime();
this.选择日 = DDateTime();
this.历法视窗(this.选择年, this.选择月);
}
public void 年递增() {
++this.选择年;
this.历法视窗(this.选择年, this.选择月);
}
public void 年递减() {
--this.选择年;
this.历法视窗(this.选择年, this.选择月);
}
public void 月递增() {
++this.选择月;
if (this.选择月 >= 13) {
this.选择月 = 1;
++this.选择年;
}
this.历法视窗(this.选择年, this.选择月);
}
public void 月递减() {
--this.选择月;
if (this.选择月 <= 0) {
this.选择月 = 12;
--this.选择年;
}
this.历法视窗(this.选择年, this.选择月);
}
public void 历法视窗(int var1, int var2) {
LunarDate var3 = LunCal.yueLiCalc(var1, var2, 1);
this.月总天数 = var3.getDdn();
this.公历年 = var3.getY();
this.公历月 = var3.getM();
this.月首星期 = var3.getWIn();
this.月总周数 = var3.getWeekN();
this.清空();
this.月历高度 = (int)((double)this.画布高度 * 0.67D);
this.月历顶边 = (int)((double)this.画布高度 * 0.25D);
this.星期高度 = (int)((double)this.画布高度 * 0.08D);
this.日期高度 = (int)((double)this.画布高度 * 0.33D);
this.日期宽度 = this.画布宽度 / 3;
this.详情高度 = (int)((double)this.画布高度 * 0.33D);
this.详情宽度 = this.画布宽度 / 3 * 2;
this.格高 = this.月历高度 / this.月总周数;
this.格宽 = this.画布宽度 / 7;
String var4 = " ";
this.画笔类型(1);
this.画笔颜色(-7829368);
this.画笔粗细(1);
this.字体大小((float)(this.格宽 / 30));
this.纵标值 = this.画布高度 - this.取文字高度(var4);
this.横标值 = (int)((double)this.画布宽度 - (double)this.水平居中(var4) * 2.1D);
this.画文字(this.横标值, this.纵标值, var4);
this.画笔类型(2);
this.画笔颜色(-7829368);
this.画笔粗细(5);
this.字体大小((float)(this.画布宽度 / 15));
String var5 = Integer.toString(this.公历年);
this.纵标值 = this.月历顶边 + this.月历高度 / 2;
this.横标值 = this.画布宽度 / 2 - this.水平居中(var5);
this.画文字(this.横标值, this.纵标值, var5);
this.画笔粗细(7);
this.字体大小((float)(this.画布宽度 / 12));
String var6 = Integer.toString(this.公历月);
this.纵标值 = this.月历顶边 + this.月历高度 / 2 + this.月历高度 / 4;
this.横标值 = this.画布宽度 / 2 - this.水平居中(var6);
this.画文字(this.横标值, this.纵标值, var6);
this.画笔颜色(-7829368);
this.画笔粗细(1);
this.画笔类型(1);
this.画直线(0, this.月历顶边, this.画布宽度, this.月历顶边);
int var7;
for(var7 = 0; var7 <= this.月总周数 - 1; ++var7) {
this.画直线(0, this.月历顶边 + this.星期高度 + this.格高 * var7, this.画布宽度, this.月历顶边 + this.星期高度 + this.格高 * var7);
}
for(var7 = 0; var7 <= 6; ++var7) {
this.画直线(this.格宽 * var7, this.月历顶边, this.格宽 * var7, this.画布高度);
}
var7 = mainActivity.getContext().getResources().getIdentifier("butt_white_normal", "drawable", mainActivity.getContext().getPackageName());
int var8 = (int)((double)(this.画布宽度 / 3) * 1.05D);
this.画图片缩放2(var7, 0, 0, this.画布宽度, this.月历顶边);
this.画图片缩放2(var7, 0, this.月历顶边, this.画布宽度, this.画布高度);
int var10;
int var11;
int var12;
int var13;
int var14;
int var21;
if (轮值显示) {
String var9 = SharedPrefsUtil.getValue(mainActivity.getContext(), "RoquerySetting", "Cbanxun", "甲乙丙");
var10 = var9.length();
for(var11 = 0; var11 <= var10; ++var11) {
var12 = this.画布宽度 / var10;
var13 = this.月历顶边 - this.星期高度;
var14 = (int)((double)this.星期高度 * 0.95D);
String var15 = "Duty_infn_backg.png";
this.画图片缩放(var15, var12 * (var11 - 1), var14, var12, var13);
}
} else {
var21 = mainActivity.getContext().getResources().getIdentifier("code_money", "drawable", mainActivity.getContext().getPackageName());
this.画图片缩放2(var21, 0, 0, var8, this.月历顶边);
var10 = this.画布宽度 / 3 * 2;
var11 = this.月历顶边;
var12 = this.画布宽度 / 3;
byte var24 = 0;
var14 = this.画布宽度 / 3;
int var26 = (int)((double)var10 * 0.95D);
int var16 = (int)((double)var11 * 0.95D);
int var17 = var12 + (var10 - var26) / 2;
int var18 = var24 + (var11 - var16);
int var19 = this.画布宽度 - (var10 - var26) / 2;
int var20 = mainActivity.getContext().getResources().getIdentifier("dialog_bg", "drawable", mainActivity.getContext().getPackageName());
this.画图片缩放2(var20, var17, var18, var19, var16);
}
for(var21 = 0; var21 <= 6; ++var21) {
this.画笔颜色(历法配色(var21));
this.画笔粗细(2);
this.画笔类型(3);
String var22 = LunCal.dayStr2(var21);
this.字体大小((float)(this.格宽 / 10));
this.纵标值 = this.月历顶边 + this.星期高度 / 2 - this.垂直居中();
this.横标值 = this.格宽 * (var21 % 7) + this.格宽 / 2 - this.水平居中(var22);
this.画文字(this.横标值, this.纵标值, var22);
}
var21 = this.月总天数;
if (this.选择年 == 1582 && this.选择月 == 10) {
var21 = this.月总天数 + 10;
}
if (this.选择日 >= 1 && this.选择日 <= var21) {
var10 = this.选择日 + this.月首星期 - 1;
this.横标值 = var10 % 7 * this.格宽;
this.纵标值 = (int)(Math.floor((double)(var10 / 7)) * (double)this.格高 + (double)this.月历顶边 + (double)this.星期高度);
this.画图片缩放("widget_today_task.png", this.横标值, this.纵标值, this.格宽, this.格高);
}
for(var10 = this.月首星期; var10 <= this.月总天数 + this.月首星期 - 1; ++var10) {
var11 = var10 - this.月首星期 + 1;
var3 = LunCal.yueLiCalc(var1, var2, var11);
this.公历年 = var3.getY();
this.公历月 = var3.getM();
this.公历日 = var3.getD();
this.放假日 = var3.getHyer();
this.农历日 = var3.getLuMs();
this.农历月 = var3.getLunM();
this.月大小 = var3.getDLM();
this.闰状况 = var3.getLeap();
this.月名称 = var3.getLuM();
this.日名称 = var3.getLuD();
this.月相名称 = var3.getMoPN();
this.节气 = var3.getSolar();
this.公历节日 = LunCal.sFtvl(this.公历年, this.公历月, this.公历日);
this.民俗节日 = LunCal.民俗节日((double)this.公历年, (double)this.公历月, (double)this.公历日);
this.农历节日 = LunCal.农历节日((double)this.农历月, (double)this.农历日, (double)this.月大小);
this.字体大小((float)(this.格宽 / 8));
this.画笔类型(3);
this.画笔粗细(5);
this.画笔颜色(历法配色(var10));
String var23 = Integer.toString(var3.getD());
this.纵标值 = (int)((double)(this.月历顶边 + this.星期高度) + (double)this.格高 * Math.floor((double)(var10 / 7)) + (double)(this.格高 / 3) - (double)this.垂直居中());
this.横标值 = this.格宽 * (var10 % 7) + this.格宽 / 2 - this.水平居中(var23);
this.画文字(this.横标值, this.纵标值, var23);
this.画笔类型(1);
if (var1 == YDateTime() && var2 == MDateTime() && var3.getD() == DDateTime()) {
var13 = this.格宽 * (var10 % 7);
var14 = (int)((double)(this.月历顶边 + this.星期高度) + (double)this.格高 * Math.floor((double)(var10 / 7)));
this.画图片缩放("widget_today_bg.png", var13, var14, this.格宽, this.格高);
}
this.画笔颜色(-3355444);
if (!"".equals(this.节气)) {
this.日名称 = "◆" + this.节气;
this.画笔颜色(-16711936);
}
if (!"".equals(this.农历节日)) {
this.日名称 = this.农历节日;
this.画笔颜色(-16711681);
}
if (!"".equals(this.公历节日)) {
this.日名称 = this.公历节日;
this.画笔颜色(-16776961);
}
if (this.月大小 == 29) {
this.月状况 = this.闰状况 + this.月名称 + "月小";
}
if (this.月大小 == 30) {
this.月状况 = this.闰状况 + this.月名称 + "月大";
}
if (this.日名称.equals("除夕")) {
this.画笔颜色(-65281);
}
if (this.日名称.equals("春节")) {
this.画笔颜色(-65536);
this.日名称 = "春节";
}
if (this.农历日 == 0 && !"春节".equals(this.日名称)) {
this.日名称 = this.月状况;
this.画笔颜色(-65536);
}
var13 = this.格宽 / 15 / this.日名称.length() * 3;
this.字体大小((float)var13);
if (this.日名称.length() <= 2) {
this.字体大小((float)(this.格宽 / 18));
}
this.画笔粗细(2);
this.横标值 = this.格宽 * (var10 % 7) + this.格宽 / 2 - this.水平居中(this.日名称);
this.纵标值 = (int)((double)(this.月历顶边 + this.星期高度) + (double)this.格高 * Math.floor((double)(var10 / 7)) + (double)(this.格高 / 2) + (double)(this.格高 / 3) - (double)this.垂直居中());
this.画文字(this.横标值, this.纵标值, this.日名称);
if (this.放假日 == 1) {
this.字体大小((float)(this.格宽 / 20));
this.画笔粗细(1);
this.画笔颜色(-256);
this.纵标值 = (int)((double)(this.月历顶边 + this.星期高度) + (double)this.格高 * Math.floor((double)(var10 / 7)) + (double)this.取文字高度("假"));
this.横标值 = this.格宽 * (var10 % 7) + this.格宽 - this.水平居中("假") * 2;
this.画文字(this.横标值, this.纵标值, "假");
}
if (!"".equals(this.月相名称)) {
if (this.月相名称.equals("望")) {
this.月相名称 = "○";
}
if (this.月相名称.equals("上弦")) {
this.月相名称 = "∪";
}
if (this.月相名称.equals("下弦")) {
this.月相名称 = "∩";
}
if (this.月相名称.equals("朔")) {
this.月相名称 = "●";
}
this.字体大小((float)(this.格宽 / 20));
this.画笔粗细(1);
this.画笔颜色(-256);
this.纵标值 = (int)((double)(this.月历顶边 + this.星期高度) + (double)this.格高 * Math.floor((double)(var10 / 7)) + (double)this.取文字高度(this.月相名称));
this.横标值 = this.格宽 * (var10 % 7);
this.画文字(this.横标值, this.纵标值, this.月相名称);
}
if (!"".equals(this.民俗节日)) {
if (!"".equals(this.公历节日)) {
this.民俗节日 = this.农历节日;
if (this.民俗节日.equals("") && !"".equals(this.节气)) {
this.民俗节日 = "◆" + this.节气;
}
}
this.字体大小((float)(this.格宽 / 20));
this.画笔粗细(1);
this.画笔颜色(-16711936);
this.纵标值 = (int)((double)(this.月历顶边 + this.星期高度) + (double)this.格高 * Math.floor((double)(var10 / 7)) + (double)(this.格高 / 5 * 4) - (double)this.取文字高度(this.民俗节日));
this.横标值 = this.格宽 * (var10 % 7) + this.格宽 / 2 - this.水平居中(this.民俗节日);
this.画文字(this.横标值, this.纵标值, this.民俗节日);
}
if (运转显示) {
String var25 = this.运转值班(var1, var2, var11);
this.字体大小((float)(this.格宽 / 22));
this.画笔粗细(1);
this.画笔颜色(-12303292);
this.纵标值 = (int)((double)(this.月历顶边 + this.星期高度) + (double)this.格高 * Math.floor((double)(var10 / 7)) + (double)(this.格高 / 2) + (double)(this.格高 / 4) + (double)this.垂直居中());
this.横标值 = this.格宽 * (var10 % 7) + this.格宽 / 4 - this.水平居中(var25);
this.画文字(this.横标值, this.纵标值, var25);
}
}
if (轮值显示) {
this.轮值信息(this.选择年, this.选择月, this.选择日);
} else {
this.日历信息(this.选择年, this.选择月, this.选择日);
}
}
public void 轮值信息(int var1, int var2, int var3) {
LunarDate var4 = LunCal.yueLiCalc(var1, var2, var3);
this.公历年 = var4.getY();
this.公历月 = var4.getM();
this.公历日 = var4.getD();
int var5 = var4.getLunY();
this.农历月 = var4.getLunM();
this.月大小 = var4.getDLM();
this.闰状况 = var4.getLeap();
this.农历日 = var4.getLuMs();
this.月名称 = var4.getLuM();
this.日名称 = var4.getLuD();
String var6 = "";
if (var4.getDLM() == 29) {
var6 = var4.getLeap() + var4.getLuM() + "月(小)";
}
if (var4.getDLM() == 30) {
var6 = var4.getLeap() + var4.getLuM() + "月(大)";
}
if (this.日名称.equals("除夕")) {
var6 = this.农历节日;
var6 = "除夕";
}
if (this.日名称.equals("春节")) {
var6 = this.农历节日;
var6 = "春节";
}
String var7 = Integer.toString(this.公历年) + "年" + Integer.toString(this.公历月) + "月" + Integer.toString(this.公历日) + "日 " + var6;
String[] var8 = this.轮值cha询(var1, var2, var3);
this.字体大小((float)(this.格宽 / 10));
this.画笔粗细(5);
this.画笔颜色(-1);
this.画笔类型(3);
int var9 = this.日期高度 / 3;
int var10 = this.画布宽度 - this.画布宽度 / 2 - this.水平居中(var7);
int var11 = var9 / 2 - this.取文字高度(var7) / 3;
this.画文字(var10, var11, var7);
int var12 = var8.length - 1;
int var13 = this.画布宽度 / var12;
for(int var14 = 0; var14 < var12; ++var14) {
String var15 = "班一班二班三班四班五班六班七班八班九班十";
if (var12 == 3) {
var15 = "白班夜班休息";
}
if (var12 == 4) {
var15 = "零点八点四点休息";
}
String var16 = charAt(var15, var14 * 2, 2);
this.字体大小((float)(this.格宽 / var12 / 3));
this.画笔粗细(3);
this.画笔颜色(-1);
this.画笔类型(1);
if (var14 == var12 - 1) {
this.画笔颜色(-256);
}
int var17 = var13 * var14 + var13 / 2 - this.取文字宽度(var16) / 2;
int var18 = (int)((double)this.星期高度 * 1.7D);
this.画文字(var17, var18, var16);
String var19 = var8[var14 + 1];
var17 = var13 * var14 + var13 / 2 - this.取文字宽度(var19) / 2;
var18 = (int)((double)this.星期高度 * 2.7D);
this.画笔类型(3);
this.画文字(var17, var18, var19);
this.画笔类型(2);
if (var14 == var12 - 1) {
this.画笔颜色(-256);
}
this.字体大小((float)(this.格宽 / 12));
this.画笔颜色(-16711936);
String var20 = var8[0];
var17 = this.日期宽度 / 11;
var18 = this.日期高度 / 8;
this.画文字(var17, var18, var20);
this.画笔类型(1);
}
}
public void 画文字3(int var1, int var2, String var3) {
天文历法类Impl.CanvasView var4 = (天文历法类Impl.CanvasView)this.getView();
int var5 = (int)((float)(this.列宽 * var1) + ((float)this.列宽 - this.paintColor.measureText(var3)) / 2.0F);
int var6 = (int)((float)(this.行高 * var2 + this.行高 / 2) - (this.paintColor.ascent() + this.paintColor.descent()) / 2.0F);
var4.canvas.drawText(var3, (float)var5, (float)var6, this.paintColor);
var4.invalidate();
}
public void 日历信息(int var1, int var2, int var3) {
LunarDate var4 = LunCal.yueLiCalc(var1, var2, var3);
this.公历年 = var4.getY();
this.公历月 = var4.getM();
this.公历日 = var4.getD();
int var5 = var4.getLunY();
int var6 = var4.getLunM();
this.农历日 = var4.getLuMs();
String var7 = var4.getLuM();
String var8 = var4.getLuD();
this.月大小 = var4.getDLM();
String var9 = var4.getLeap();
int var10 = var4.gethY();
int var11 = var4.gethM();
int var12 = var4.gethD();
int var13 = var4.getLuMs();
int var14 = var4.getToDZ();
int var15 = var4.getToXZ();
int var16 = var4.getToLQ();
int var17 = var4.getToMZ();
int var18 = var4.getToXS();
String var19 = var4.getCnY() + "年 ";
String var20 = var4.getCnM() + "月 ";
String var21 = var4.getCnD() + "日 ";
String var22 = var4.getCnT() + "时 ";
String var23 = var4.getHNer();
String var24 = var4.getINer();
String var25 = var4.getANer();
this.放假日 = var4.getHyer();
this.农历日 = var4.getLuMs();
var6 = var4.getLunM();
this.月大小 = var4.getDLM();
var9 = var4.getLeap();
var7 = var4.getLuM();
var8 = var4.getLuD();
this.月相名称 = var4.getMoPN();
this.节气 = var4.getSolar();
var6 = var4.getLunM();
String var26 = var4.getMoPN();
String var27 = var4.getMoPTStr();
double var28 = var4.getMoPT();
this.节气 = var4.getSolar();
String var30 = var4.getSolTN();
String var31 = var4.getSolTTStr();
double var32 = var4.getSolTT();
this.年号 = LunCal.getNH(var1);
String var34 = var4.getLyear4() + "年";
String var35 = var4.getLyear5();
String var36 = var4.getXiZ();
this.放假日 = var4.getHyer();
int var37 = var4.getDR();
int var38 = var4.getDIn();
int var39 = var4.getWeek();
int var40 = this.画布宽度 / 3;
int var41 = this.月历顶边;
int var42 = var41 / 10;
this.字体大小((float)(this.格宽 / 12));
this.画笔类型(1);
this.画笔颜色(-1);
this.画笔粗细(3);
String var43 = Integer.toString(var4.getY()) + "年" + Integer.toString(var4.getM()) + "月";
int var44 = var40 - var40 / 2 - this.取文字宽度(var43) / 2;
int var45 = var42 * 1 + this.取文字高度(var43);
this.画文字(var44, var45, var43);
var43 = Integer.toString(var4.getD());
this.画笔颜色(-256);
this.画笔粗细(3);
this.画笔类型(3);
var40 = (int)((double)this.画布宽度 / 2.8D);
this.字体大小((float)(var40 / 9));
var41 = this.月历顶边;
var44 = var40 - var40 / 2 - this.取文字宽度(var43) / 2;
var45 = var42 * 3 + this.取文字高度(var43);
this.画笔类型(3);
this.画文字(var44, var45, var43);
this.画笔类型(1);
this.画笔类型(1);
var43 = "星期" + LunCal.dayStr2(var4.getWeek()) + " " + var4.getXiZ();
this.画笔颜色(-16711936);
this.画笔粗细(8);
this.字体大小((float)(this.格宽 / 18));
var40 = (int)((double)this.画布宽度 / 2.8D);
var41 = this.月历顶边;
var44 = var40 - var40 / 2 - this.取文字宽度(var43) / 2;
var45 = var42 * 7 + this.取文字高度(var43) + var42 / 2;
this.画文字(var44, var45, var43);
if (this.月大小 == 29) {
var43 = var9 + var7 + "月(小)" + var8;
} else {
var43 = var9 + var7 + "月(大)" + var8;
}
this.画笔颜色(-65281);
this.画笔粗细(8);
this.字体大小((float)(this.格宽 / 18));
var40 = (int)((double)this.画布宽度 / 2.8D);
var41 = this.月历顶边;
var44 = var40 - var40 / 2 - this.取文字宽度(var43) / 2;
var45 = var42 * 8 + this.取文字高度(var43) + var42 / 3;
this.画文字(var44, var45, var43);
String var46 = this.年号 + "\n";
var46 = var46 + var19 + var20 + var21 + var22 + "\n" + var34 + var43;
var46 = var46 + var35 + "\nJD " + Integer.toString(var37 + 2451545) + "(" + Integer.toString(var37) + ")\n";
var46 = var46 + "回历:" + Integer.toString(var10) + "年" + Integer.toString(var11) + "月" + Integer.toString(var12) + "日\n";
this.公历节日 = LunCal.sFtvl(this.公历年, this.公历月, this.公历日);
this.民俗节日 = LunCal.民俗节日((double)this.公历年, (double)this.公历月, (double)this.公历日);
this.农历节日 = LunCal.农历节日((double)var6, (double)this.农历日, (double)this.月大小);
if (!"".equals(var26)) {
if (var28 > 0.0D) {
var46 = var46 + var26 + ":" + var27 + "\n";
} else {
var46 = var46 + var26 + "\n";
}
}
if (!"".equals(this.节气)) {
if (var32 > 0.0D) {
var46 = var46 + this.节气 + ":" + var31 + "\n";
} else {
var46 = var46 + this.节气 + "\n";
}
}
if (!"".equals(var23)) {
var46 = var46 + var23 + " ";
}
if (!"".equals(var24)) {
var46 = var46 + var24 + " ";
}
if (!"".equals(this.公历节日)) {
var46 = var46 + this.公历节日 + " ";
}
if (!"".equals(this.农历节日)) {
var46 = var46 + this.农历节日 + " ";
}
if (!"".equals(this.民俗节日)) {
var46 = var46 + this.民俗节日 + " ";
}
if (!"".equals(var25)) {
var46 = var46 + var25 + " ";
}
this.画笔颜色(-1);
this.画笔粗细(1);
this.画笔类型(1);
this.字体大小((float)(this.格宽 / 24));
int var48 = this.画布宽度 / 3 * 2;
int var49 = this.月历顶边;
int var50 = this.画布宽度 / 3;
boolean var51 = false;
int var52 = this.画布宽度 / 3;
int var53 = (int)((double)var48 * 0.9D);
int var54 = var50 + var48 / 2 - var53 / 2;
int var55 = var49 / 9;
this.画文字2(var54, var55, var46, 1.0F, var53);
}
public void 日历cha询(int var1, int var2, int var3, int var4) {
LunarDate var5 = LunCal.yueLiCalc2(var1, var2, var3, var4);
this.公历年 = var5.getY();
this.公历月 = var5.getM();
this.公历日 = var5.getD();
this.公历时 = var4;
this.农历时 = var4;
int var6 = var5.getLunY();
int var7 = var5.getLunM();
this.农历日 = var5.getLuMs();
String var8 = var5.getLuM();
String var9 = var5.getLuD();
this.月大小 = var5.getDLM();
String var10 = var5.getLeap();
int var11 = var5.gethY();
int var12 = var5.gethM();
int var13 = var5.gethD();
int var14 = var5.getLuMs();
int var15 = var5.getToDZ();
int var16 = var5.getToXZ();
int var17 = var5.getToLQ();
int var18 = var5.getToMZ();
int var19 = var5.getToXS();
String var20 = var5.getCnY();
String var21 = var5.getCnM();
String var22 = var5.getCnD();
String var23 = var5.getCnT();
String var24 = var5.getHNer();
String var25 = var5.getINer();
String var26 = var5.getANer();
this.放假日 = var5.getHyer();
this.农历日 = var5.getLuMs();
var7 = var5.getLunM();
this.月大小 = var5.getDLM();
var10 = var5.getLeap();
var8 = var5.getLuM();
var9 = var5.getLuD();
this.月相名称 = var5.getMoPN();
this.节气 = var5.getSolar();
var7 = var5.getLunM();
String var27 = var5.getMoPN();
String var28 = var5.getMoPTStr();
double var29 = var5.getMoPT();
this.节气 = var5.getSolar();
String var31 = var5.getSolTN();
String var32 = var5.getSolTTStr();
double var33 = var5.getSolTT();
this.年号 = LunCal.getNH(var1);
String var35 = var5.getLyear4() + "年";
String var36 = var5.getLyear5();
String var37 = var5.getXiZ();
this.放假日 = var5.getHyer();
int var38 = var5.getDR();
int var39 = var5.getDIn();
int var40 = var5.getWeek();
String var41 = Integer.toString(var5.getY()) + "年" + Integer.toString(var5.getM()) + "月";
var41 = Integer.toString(var5.getD());
(new StringBuilder()).append("星期").append(LunCal.dayStr2(var5.getWeek())).append(" ").append(var5.getXiZ()).toString();
if (this.月大小 == 29) {
var41 = var10 + var8 + "月(小)" + var9;
} else {
var41 = var10 + var8 + "月(大)" + var9;
}
String var42 = this.年号 + "\n";
var42 = var42 + var20 + var21 + var22 + "\n" + var35 + var41;
var42 = var42 + var36 + "\nJD " + Integer.toString(var38 + 2451545) + "(" + Integer.toString(var38) + ")\n";
var42 = var42 + "回历:" + Integer.toString(var11) + "年" + Integer.toString(var12) + "月" + Integer.toString(var13) + "日\n";
this.公历节日 = LunCal.sFtvl(this.公历年, this.公历月, this.公历日);
this.民俗节日 = LunCal.民俗节日((double)this.公历年, (double)this.公历月, (double)this.公历日);
this.农历节日 = LunCal.农历节日((double)var7, (double)this.农历日, (double)this.月大小);
if (!"".equals(var27)) {
if (var29 > 0.0D) {
var42 = var42 + var27 + ":" + var28 + "\n";
} else {
var42 = var42 + var27 + "\n";
}
}
if (!"".equals(this.节气)) {
if (var33 > 0.0D) {
var42 = var42 + this.节气 + ":" + var32 + "\n";
} else {
var42 = var42 + this.节气 + "\n";
}
}
if (!"".equals(var24)) {
var42 = var42 + var24 + " ";
}
if (!"".equals(var25)) {
var42 = var42 + var25 + " ";
}
if (!"".equals(this.公历节日)) {
var42 = var42 + this.公历节日 + " ";
}
if (!"".equals(this.农历节日)) {
var42 = var42 + this.农历节日 + " ";
}
if (!"".equals(this.民俗节日)) {
var42 = var42 + this.民俗节日 + " ";
}
if (!"".equals(var26)) {
var42 = var42 + var26 + " ";
}
this.cha询结果1(this.公历年, this.公历月, this.公历日, this.公历时, var6, var7, this.农历日, this.农历时, var10);
this.cha询结果2(var20, var21, var22, var23);
this.cha询结果3(var35, var41);
this.cha询结果4(var27, var28, var29, var31, var32, var33);
this.cha询结果5(var15, var16, var17, var18, var19);
this.cha询结果6(this.年号, var35, var36, var37, this.放假日, var38, var40);
this.cha询结果7(var11, var12, var13);
this.cha询结果8(var36, this.公历节日, this.农历节日, this.民俗节日, var24, var25, var26);
}
public void cha询结果1(int var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, String var9) {
EventDispatcher.dispatchEvent(this, "cha询结果1", new Object[]{var1, var2, var3, var4, var5, var6, var7, var8, var9});
}
public void cha询结果2(String var1, String var2, String var3, String var4) {
EventDispatcher.dispatchEvent(this, "cha询结果2", new Object[]{var1, var2, var3, var4});
}
public void cha询结果3(String var1, String var2) {
EventDispatcher.dispatchEvent(this, "cha询结果3", new Object[]{var1, var2});
}
public void cha询结果4(String var1, String var2, double var3, String var5, String var6, double var7) {
EventDispatcher.dispatchEvent(this, "cha询结果4", new Object[]{var1, var2, var3, var5, var6, var7});
}
public void cha询结果5(int var1, int var2, int var3, int var4, int var5) {
EventDispatcher.dispatchEvent(this, "cha询结果5", new Object[]{var1, var2, var3, var4, var5});
}
public void cha询结果6(String var1, String var2, String var3, String var4, int var5, int var6, int var7) {
EventDispatcher.dispatchEvent(this, "cha询结果6", new Object[]{var1, var2, var3, var4, var5, var6, var7});
}
public void cha询结果7(int var1, int var2, int var3) {
EventDispatcher.dispatchEvent(this, "cha询结果7", new Object[]{var1, var2, var3});
}
public void cha询结果8(String var1, String var2, String var3, String var4, String var5, String var6, String var7) {
EventDispatcher.dispatchEvent(this, "cha询结果8", new Object[]{var1, var2, var3, var4, var5, var6, var7});
}
public static String cha询日期(int var0, int var1, int var2) {
LunCal.yueLiCalc(var0, var1, var2);
String var4 = "";
return var4;
}
public void 公历转农历(int var1, int var2, int var3) {
LunarDate var4 = LunCal.yueLiCalc(var1, var2, var3);
int var5 = var4.getLunY();
int var6 = var4.getLunM();
int var7 = var4.getLuMs();
this.转换结果(var5, var6, var7);
}
public void 农历转公历(int var1, int var2, int var3, String var4) {
LunarDate var5 = LunCal.yerCalc(var1, var2, var3, var4);
int var6 = var5.getY();
int var7 = var5.getM();
int var8 = var5.getD();
this.转换结果(var6, var7, var8);
}
public void 转换结果(int var1, int var2, int var3) {
EventDispatcher.dispatchEvent(this, "转换结果", new Object[]{var1, var2, var3});
}
public void 轮值cha询显示(boolean var1) {
SharedPrefsUtil.putValue(mainActivity.getContext(), "RoquerySetting", "Roquery", var1);
}
public void 运转值班显示(boolean var1) {
SharedPrefsUtil.putValue(mainActivity.getContext(), "RoquerySetting", "Yunzry", var1);
}
public void 特定日期加显信息(String var1, String var2) {
int var3 = Dbpx.length();
if (var3 == 8 || !"".equals(var2)) {
SharedPrefsUtil.putValue(mainActivity.getContext(), "LunCalSetting", var1, var2);
}
}
public void 设置轮值(int var1, int var2, int var3, int var4, String var5) {
if (var1 >= 1900 && var1 <= 3000) {
SharedPrefsUtil.putValue(mainActivity.getContext(), "RoquerySetting", "Cyear", var1);
}
if (var2 >= 1 && var2 <= 12) {
SharedPrefsUtil.putValue(mainActivity.getContext(), "RoquerySetting", "Cmonth", var2);
}
if (var3 >= 1 && var3 <= 31) {
SharedPrefsUtil.putValue(mainActivity.getContext(), "RoquerySetting", "Cday", var3);
}
if (var4 >= 1 && var4 <= 10) {
SharedPrefsUtil.putValue(mainActivity.getContext(), "RoquerySetting", "Cbanar", var4);
}
if (var5.length() >= 1 && var5.length() <= 10) {
SharedPrefsUtil.putValue(mainActivity.getContext(), "RoquerySetting", "Cbanxun", var5);
}
}
public static double JD(int var0, int var1, int var2) {
int var3 = 0;
boolean var4 = false;
if ((double)(var0 * 372 + var1 * 31) + Math.floor((double)var2) >= 588829.0D) {
var4 = true;
}
if (var1 <= 2) {
var1 += 12;
--var0;
}
if (var4) {
var3 = (int)Math.floor((double)(var0 / 100));
var3 = 2 - var3 + (int)Math.floor((double)(var3 / 4));
}
return Math.floor(365.25D * (double)(var0 + 4716)) + Math.floor(30.6001D * (double)(var1 + 1)) + (double)var2 + (double)var3 - 1524.5D;
}
public String[] 轮值cha询(int var1, int var2, int var3) {
CxY = SharedPrefsUtil.getValue(mainActivity.getContext(), "RoquerySetting", "Cyear", 2015);
CxM = SharedPrefsUtil.getValue(mainActivity.getContext(), "RoquerySetting", "Cmonth", 12);
CxD = SharedPrefsUtil.getValue(mainActivity.getContext(), "RoquerySetting", "Cday", 23);
Dbzq = SharedPrefsUtil.getValue(mainActivity.getContext(), "RoquerySetting", "Cbanar", 2);
Dbpx = SharedPrefsUtil.getValue(mainActivity.getContext(), "RoquerySetting", "Cbanxun", "甲乙丙");
Mtbs = Dbpx.length() * Dbzq;
int var4 = Dbpx.length() + 1;
int var5 = Dbpx.length();
String[] var6 = new String[var4];
double var7 = LunCal.JD(CxY, CxM, (double)CxD);
double var9 = LunCal.JD(var1, var2, (double)var3);
double var11 = var9 - var7;
int var13 = (int)((var11 % (double)Mtbs + (double)Mtbs) % (double)Mtbs);
int var14 = (int)((double)Dbzq - Math.floor((double)(var13 / Dbzq)));
int var15 = (int)((double)var13 % Math.floor((double)(Mtbs / Dbpx.length())));
var6[0] = charAt(Zhouqi, var15, 1);
for(int var16 = 1; var16 <= var5; ++var16) {
int var17 = var14 + var16;
int var18 = (var17 % var5 + var5) % var5;
var6[var16] = charAt(Dbpx, var18, 1) + "班";
}
return var6;
}
public String 运转值班(int var1, int var2, int var3) {
String var14 = "原料,原料,原料,浇钢,精整,浇钢,浇钢,精整";
String[] var15 = var14.split(",");
double var4 = LunCal.JD(2017, 10, 22.0D);
double var6 = LunCal.JD(var1, var2, (double)var3);
double var8 = var6 - var4;
int var16 = (int)(var8 % 8.0D + 8.0D) % 8;
String var17 = var15[var16];
return var17;
}
public static String IntStr(int var0) {
return Integer.toString(var0);
}
public static String charAt(String var0, int var1, int var2) {
if (!"".equals(var0) && var1 >= 0 && var2 > 0 && var1 <= var0.length()) {
int var3 = var1 + var2;
var2 = var3;
if (var3 > var0.length()) {
var2 = var0.length();
}
return var0.substring(var1, var2);
} else {
return "";
}
}
public static double floor(double var0) {
return Math.floor(var0);
}
public static int Strint(String var0) {
return !"".equals(var0) ? Integer.parseInt(var0) : 0;
}
public String 当前时间() {
return DateTime();
}
public boolean 检查轮值显示() {
boolean var1 = SharedPrefsUtil.getValue(mainActivity.getContext(), "RoquerySetting", "Roquery", false);
return var1;
}
public boolean 检查运转显示() {
boolean var1 = SharedPrefsUtil.getValue(mainActivity.getContext(), "RoquerySetting", "Yunzry", false);
return var1;
}
public String 检查轮值设置() {
CxY = SharedPrefsUtil.getValue(mainActivity.getContext(), "RoquerySetting", "Cyear", 2015);
CxM = SharedPrefsUtil.getValue(mainActivity.getContext(), "RoquerySetting", "Cmonth", 12);
CxD = SharedPrefsUtil.getValue(mainActivity.getContext(), "RoquerySetting", "Cday", 23);
Dbzq = SharedPrefsUtil.getValue(mainActivity.getContext(), "RoquerySetting", "Cbanar", 2);
Dbpx = SharedPrefsUtil.getValue(mainActivity.getContext(), "RoquerySetting", "Cbanxun", "甲乙丙");
return CxY + "#" + CxM + "#" + CxD + "#" + Dbzq + "#" + Dbpx;
}
private class CanvasView extends View {
protected final Canvas canvas;
protected final Bitmap bitmap;
public CanvasView(Context var2) {
super(var2);
this.bitmap = Bitmap.createBitmap(var2.getWallpaperDesiredMinimumWidth(), var2.getWallpaperDesiredMinimumHeight(), Config.ARGB_8888);
this.canvas = new Canvas(this.bitmap);
this.setFocusable(true);
this.setFocusableInTouchMode(true);
}
protected void onFinishInflate() {
super.onFinishInflate();
}
protected void onMeasure(int var1, int var2) {
super.onMeasure(var1, var2);
LunCal.LunarCalendar();
天文历法类Impl.this.选择年 = 天文历法类Impl.YDateTime();
天文历法类Impl.this.选择月 = 天文历法类Impl.MDateTime();
天文历法类Impl.this.选择日 = 天文历法类Impl.DDateTime();
天文历法类Impl.this.历法视窗(天文历法类Impl.this.选择年, 天文历法类Impl.this.选择月);
}
protected void onSizeChanged(int var1, int var2, int var3, int var4) {
super.onSizeChanged(var1, var2, var3, var4);
天文历法类Impl.this.画布高度 = var2;
天文历法类Impl.this.画布宽度 = var1;
LunCal.LunarCalendar();
天文历法类Impl.this.选择年 = 天文历法类Impl.YDateTime();
天文历法类Impl.this.选择月 = 天文历法类Impl.MDateTime();
天文历法类Impl.this.选择日 = 天文历法类Impl.DDateTime();
天文历法类Impl.this.历法视窗(天文历法类Impl.this.选择年, 天文历法类Impl.this.选择月);
}
protected void onDraw(Canvas var1) {
super.onDraw(var1);
if (this.bitmap != null) {
var1.drawBitmap(this.bitmap, 0.0F, 0.0F, (Paint)null);
}
}
}
}
这里面的错误我怎找不出 |
|