当前位置: 首页>>代码示例>>Java>>正文


Java Easing类代码示例

本文整理汇总了Java中com.github.mikephil.charting.animation.Easing的典型用法代码示例。如果您正苦于以下问题:Java Easing类的具体用法?Java Easing怎么用?Java Easing使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Easing类属于com.github.mikephil.charting.animation包,在下文中一共展示了Easing类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: spin

import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
/**
 * Applys a spin animation to the Chart.
 *
 * @param durationmillis
 * @param fromangle
 * @param toangle
 */
@SuppressLint("NewApi")
public void spin(int durationmillis, float fromangle, float toangle, Easing.EasingOption easing) {

    if (android.os.Build.VERSION.SDK_INT < 11)
        return;

    setRotationAngle(fromangle);

    ObjectAnimator spinAnimator = ObjectAnimator.ofFloat(this, "rotationAngle", fromangle,
            toangle);
    spinAnimator.setDuration(durationmillis);
    spinAnimator.setInterpolator(Easing.getEasingFunctionFromOption(easing));

    spinAnimator.addUpdateListener(new AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            postInvalidate();
        }
    });
    spinAnimator.start();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:30,代码来源:PieRadarChartBase.java

示例2: setData

import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {

        RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();

        RealmLineDataSet<RealmDemoData> set = new RealmLineDataSet<RealmDemoData>(result, "xValue", "yValue");
        set.setMode(LineDataSet.Mode.CUBIC_BEZIER);
        set.setLabel("Realm LineDataSet");
        set.setDrawCircleHole(false);
        set.setColor(ColorTemplate.rgb("#FF5722"));
        set.setCircleColor(ColorTemplate.rgb("#FF5722"));
        set.setLineWidth(1.8f);
        set.setCircleRadius(3.6f);

        ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();
        dataSets.add(set); // add the dataset

        // create a data object with the dataset list
        LineData data = new LineData(dataSets);
        styleData(data);

        // set data
        mChart.setData(data);
        mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:25,代码来源:RealmDatabaseActivityLine.java

示例3: setData

import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {

        RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();

        RealmBubbleDataSet<RealmDemoData> set = new RealmBubbleDataSet<RealmDemoData>(result, "xValue", "yValue", "bubbleSize");
        set.setLabel("Realm BubbleDataSet");
        set.setColors(ColorTemplate.COLORFUL_COLORS, 110);

        ArrayList<IBubbleDataSet> dataSets = new ArrayList<IBubbleDataSet>();
        dataSets.add(set); // add the dataset

        // create a data object with the dataset list
        BubbleData data = new BubbleData(dataSets);
        styleData(data);

        // set data
        mChart.setData(data);
        mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:RealmDatabaseActivityBubble.java

示例4: setData

import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {

        RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();

        //RealmBarDataSet<RealmDemoData> set = new RealmBarDataSet<RealmDemoData>(result, "stackValues", "xIndex"); // normal entries
        RealmBarDataSet<RealmDemoData> set = new RealmBarDataSet<RealmDemoData>(result, "xValue", "stackValues", "floatValue"); // stacked entries
        set.setColors(new int[]{ColorTemplate.rgb("#8BC34A"), ColorTemplate.rgb("#FFC107"), ColorTemplate.rgb("#9E9E9E")});
        set.setLabel("Mobile OS distribution");
        set.setStackLabels(new String[]{"iOS", "Android", "Other"});

        ArrayList<IBarDataSet> dataSets = new ArrayList<IBarDataSet>();
        dataSets.add(set); // add the dataset

        // create a data object with the dataset list
        BarData data = new BarData(dataSets);
        styleData(data);
        data.setValueTextColor(Color.WHITE);

        // set data
        mChart.setData(data);
        mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:RealmDatabaseActivityHorizontalBar.java

示例5: setData

import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {

        RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();

        RealmCandleDataSet<RealmDemoData> set = new RealmCandleDataSet<RealmDemoData>(result, "xValue", "high", "low", "open", "close");
        set.setLabel("Realm CandleDataSet");
        set.setShadowColor(Color.DKGRAY);
        set.setShadowWidth(0.7f);
        set.setDecreasingColor(Color.RED);
        set.setDecreasingPaintStyle(Paint.Style.FILL);
        set.setIncreasingColor(Color.rgb(122, 242, 84));
        set.setIncreasingPaintStyle(Paint.Style.STROKE);
        set.setNeutralColor(Color.BLUE);

        ArrayList<ICandleDataSet> dataSets = new ArrayList<ICandleDataSet>();
        dataSets.add(set); // add the dataset

        // create a data object with the dataset list
        CandleData data = new CandleData(dataSets);
        styleData(data);

        // set data
        mChart.setData(data);
        mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:RealmDatabaseActivityCandle.java

示例6: setData

import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {

        RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();

        RealmScatterDataSet<RealmDemoData> set = new RealmScatterDataSet<RealmDemoData>(result, "xValue", "yValue");
        set.setLabel("Realm ScatterDataSet");
        set.setScatterShapeSize(9f);
        set.setColor(ColorTemplate.rgb("#CDDC39"));
        set.setScatterShape(ScatterChart.ScatterShape.CIRCLE);

        ArrayList<IScatterDataSet> dataSets = new ArrayList<IScatterDataSet>();
        dataSets.add(set); // add the dataset

        // create a data object with the dataset list
        ScatterData data = new ScatterData(dataSets);
        styleData(data);

        // set data
        mChart.setData(data);
        mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:RealmDatabaseActivityScatter.java

示例7: setData

import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {

        RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();

        //RealmBarDataSet<RealmDemoData> set = new RealmBarDataSet<RealmDemoData>(result, "stackValues", "xIndex"); // normal entries
        RealmBarDataSet<RealmDemoData> set = new RealmBarDataSet<RealmDemoData>(result, "xValue", "yValue"); // stacked entries
        set.setColors(new int[] {ColorTemplate.rgb("#FF5722"), ColorTemplate.rgb("#03A9F4")});
        set.setLabel("Realm BarDataSet");

        ArrayList<IBarDataSet> dataSets = new ArrayList<IBarDataSet>();
        dataSets.add(set); // add the dataset

        // create a data object with the dataset list
        BarData data = new BarData(dataSets);
        styleData(data);

        // set data
        mChart.setData(data);
        mChart.setFitBars(true);
        mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:RealmDatabaseActivityBar.java

示例8: bindActivityChart

import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void bindActivityChart() {
    LineData lineData = generateActivityLineData();
    lineChart.setData(lineData);
    int maxYData = (int) (Math.ceil(lineData.getYMax()) + 7200);
    lineChart.getAxisLeft().setAxisMaximum(maxYData);
    long referenceTime = new DateTime(stats.endDate).minusDays(6).getMillis();

    lineChart.getXAxis()
            .setValueFormatter(new FormatUtils().getBarXAxisValueFormatterInstance(referenceTime));

    CustomMarkerView customMarkerView = new CustomMarkerView(context, R.layout.marker_view, referenceTime);
    lineChart.setMarker(customMarkerView);
    customMarkerView.setChartView(lineChart);

    lineChart.animateX(1500, Easing.EasingOption.Linear);
}
 
开发者ID:Protino,项目名称:CodeWatch,代码行数:17,代码来源:DashboardFragment.java

示例9: updateChart

import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
/**
 * Called when the chart statistics loader has completed loading the chart data. The loader
 * listens for changes to the data and this method will be called each time the display of the
 * chart needs to be refreshed. If this fragment has no view, no update will be attempted.
 *
 * @param chartStats The chart statistics populated by the loader.
 */
private void updateChart(ChartStatistics chartStats) {
    if (DEBUG_ME) Log.d(TAG, "updateChart()");

    if (getView() == null) {
        // Must have arrived after "onDestroyView" was called, so do nothing.
        return;
    }

    // Add all times line, best times line, average-of-N times lines (with highlighted
    // best AoN times) and mean limit line and identify them all using a custom legend.
    chartStats.applyTo(lineChartView);

    // Animate and refresh the chart.
    lineChartView.animateY(700, Easing.EasingOption.EaseInOutSine);
}
 
开发者ID:aricneto,项目名称:TwistyTimer,代码行数:23,代码来源:TimerGraphFragment.java

示例10: setData

import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {

        RealmResults<RealmDemoData> result = mRealm.allObjects(RealmDemoData.class);

        RealmLineDataSet<RealmDemoData> set = new RealmLineDataSet<RealmDemoData>(result, "value", "xIndex");
//        set.setDrawCubic(false);
        set.setLabel("次数");
//        set.setDrawCircleHole(false);
        set.setColor(getResourcesColor(R.color.gold));
        set.setCircleColor(getResourcesColor(R.color.gold));
        set.setHighLightColor(Color.WHITE);
        set.setLineWidth(1.8f);
        set.setCircleSize(3.6f);
        set.setValueTextColor(Color.WHITE);

        ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();
        dataSets.add(set); // add the dataset

        // create a data object with the dataset list
        RealmLineData data = new RealmLineData(result, "xValue", dataSets);
        styleData(data);

        // set data
        mChart.setData(data);
        mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
    }
 
开发者ID:dscn,项目名称:ktball,代码行数:27,代码来源:RealmDatabaseActivityLine.java

示例11: initLine

import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
/**
 * 初始化线
 */
private void initLine() {
    RealmResults<RealmDemoData> result = mRealm.allObjects(RealmDemoData.class);
    RealmLineDataSet<RealmDemoData> set = new RealmLineDataSet<RealmDemoData>(result, "value", "xIndex");
    set.setLabel("次数");
    set.setColor(getResourcesColor(R.color.gold));
    set.setCircleColor(getResourcesColor(R.color.gold));
    set.setHighLightColor(Color.WHITE);
    set.setLineWidth(1.8f);
    set.setCircleSize(3.6f);
    set.setValueTextColor(Color.WHITE);
    ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();
    dataSets.add(set); // add the dataset
    RealmLineData data = new RealmLineData(result, "xValue", dataSets);
    styleData(data);
    mChart.setData(data);
    mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
}
 
开发者ID:dscn,项目名称:ktball,代码行数:21,代码来源:SchoolAllPeopleDetailAcitivty.java

示例12: spin

import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
/**
 * Applys a spin animation to the Chart.
 * 
 * @param durationmillis
 * @param fromangle
 * @param toangle
 */
@SuppressLint("NewApi")
public void spin(int durationmillis, float fromangle, float toangle, Easing.EasingOption easing) {

    if (android.os.Build.VERSION.SDK_INT < 11)
        return;

    setRotationAngle(fromangle);

    ObjectAnimator spinAnimator = ObjectAnimator.ofFloat(this, "rotationAngle", fromangle,
            toangle);
    spinAnimator.setDuration(durationmillis);
    spinAnimator.setInterpolator(Easing.getEasingFunctionFromOption(easing));

    spinAnimator.addUpdateListener(new AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            postInvalidate();
        }
    });
    spinAnimator.start();
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:30,代码来源:PieRadarChartBase.java

示例13: setData

import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {

        RealmResults<RealmDemoData> result = mRealm.allObjects(RealmDemoData.class);

        RealmLineDataSet<RealmDemoData> set = new RealmLineDataSet<RealmDemoData>(result, "value", "xIndex");
        set.setDrawCubic(false);
        set.setLabel("Realm LineDataSet");
        set.setDrawCircleHole(false);
        set.setColor(ColorTemplate.rgb("#FF5722"));
        set.setCircleColor(ColorTemplate.rgb("#FF5722"));
        set.setLineWidth(1.8f);
        set.setCircleSize(3.6f);

        ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();
        dataSets.add(set); // add the dataset

        // create a data object with the dataset list
        RealmLineData data = new RealmLineData(result, "xValue", dataSets);
        styleData(data);

        // set data
        mChart.setData(data);
        mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
    }
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:25,代码来源:RealmDatabaseActivityLine.java

示例14: setData

import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {

        RealmResults<RealmDemoData> result = mRealm.allObjects(RealmDemoData.class);

        RealmBubbleDataSet<RealmDemoData> set = new RealmBubbleDataSet<RealmDemoData>(result, "value", "xIndex", "bubbleSize");
        set.setLabel("Realm BubbleDataSet");
        set.setColors(ColorTemplate.COLORFUL_COLORS, 110);

        ArrayList<IBubbleDataSet> dataSets = new ArrayList<IBubbleDataSet>();
        dataSets.add(set); // add the dataset

        // create a data object with the dataset list
        RealmBubbleData data = new RealmBubbleData(result, "xValue", dataSets);
        styleData(data);

        // set data
        mChart.setData(data);
        mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
    }
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:20,代码来源:RealmDatabaseActivityBubble.java

示例15: setData

import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {

        RealmResults<RealmDemoData> result = mRealm.allObjects(RealmDemoData.class);

        //RealmBarDataSet<RealmDemoData> set = new RealmBarDataSet<RealmDemoData>(result, "stackValues", "xIndex"); // normal entries
        RealmBarDataSet<RealmDemoData> set = new RealmBarDataSet<RealmDemoData>(result, "stackValues", "xIndex", "floatValue"); // stacked entries
        set.setColors(new int[]{ColorTemplate.rgb("#8BC34A"), ColorTemplate.rgb("#FFC107"), ColorTemplate.rgb("#9E9E9E")});
        set.setLabel("Mobile OS distribution");
        set.setStackLabels(new String[]{"iOS", "Android", "Other"});

        ArrayList<IBarDataSet> dataSets = new ArrayList<IBarDataSet>();
        dataSets.add(set); // add the dataset

        // create a data object with the dataset list
        RealmBarData data = new RealmBarData(result, "xValue", dataSets);
        styleData(data);
        data.setValueTextColor(Color.WHITE);

        // set data
        mChart.setData(data);
        mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
    }
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:23,代码来源:RealmDatabaseActivityHorizontalBar.java


注:本文中的com.github.mikephil.charting.animation.Easing类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。