SunnyType.java 文件源码

java
阅读 34 收藏 0 点赞 0 评论 0

项目:FakeWeather 作者:
public SunnyType(Context context, ShortWeatherInfo info) {
    super(context);
    mPathFront = new Path();
    mPathRear = new Path();
    sunPath = new Path();
    mPaint = new Paint();
    pos = new float[2];
    tan = new float[2];
    mMatrix = new Matrix();
    measure = new PathMeasure();
    sunMeasure = new PathMeasure();
    currentSunPosition = TimeUtils.getTimeDiffPercent(info.getSunrise(), info.getSunset());
    currentMoonPosition = TimeUtils.getTimeDiffPercent(info.getMoonrise(), info.getMoonset());
    if (currentSunPosition >= 0 && currentSunPosition <= 1) {
        setColor(colorDay);
        boat = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.ic_boat_day);
    } else {
        setColor(colorNight);
        boat = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.ic_boat_night);
    }

    cloud = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.ic_cloud);

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号