Android Open Source - oidarSample Math Helper






From Project

Back to project page oidarSample.

License

The source code is released under:

GNU General Public License

If you think the Android project oidarSample listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.oidar.util;
/*w ww.j  a  v a2  s. c om*/
import android.content.Context;

/**
 * Helper class for loading static values.
 */
public class MathHelper {

    private static MathHelper sInstance;

    private static float roundToValue = 0.0f;

    /**
     * Private constructor.
     */
    private MathHelper() {
    }


    /**
     * Return a static instance of the class.
     */
    public static MathHelper getInstance() {

        if (sInstance == null) {
            sInstance = new MathHelper();
        }
        return sInstance;
    }

    /**
     * Return the used rounding value.
     */
    public float getRoundToValue(Context context) {

        if (roundToValue == 0.0f) {
            roundToValue =
                    PreferenceUtil.getFloat(
                            context,
                            PreferenceUtil.KEY_ROUND_TO_VALUE,
                            OIDARConstants.DEFAULT_ROUND_TO);
        }

        return roundToValue;
    }

    /**
     * Reset the rounding value.
     */
    public void resetRoundToValue() {
        roundToValue = 0.0f;
    }

}




Java Source Code List

com.oidar.ApplicationTest.java
com.oidar.activity.MainActivity.java
com.oidar.activity.SettingsActivity.java
com.oidar.activity.base.BaseActivity.java
com.oidar.adapter.DrawerAdapter.java
com.oidar.adapter.DrawerLiveNewsAdapter.java
com.oidar.adapter.DrawerTalkRadioAdapter.java
com.oidar.animation.CustomObjectAnimator.java
com.oidar.animation.DepthPageTransformer.java
com.oidar.animation.ZoomOutPageTransformer.java
com.oidar.fragment.AboutFragment.java
com.oidar.fragment.DrawerLiveNewsFragment.java
com.oidar.fragment.DrawerTalkRadioFragment.java
com.oidar.fragment.FeedbackFragment.java
com.oidar.fragment.LiveNewsFragment.java
com.oidar.fragment.SettingsFragment.java
com.oidar.fragment.TalkRadioFragment.java
com.oidar.fragment.base.DrawerFragment.java
com.oidar.fragment.base.RadioFragment.java
com.oidar.model.DrawerListItem.java
com.oidar.model.ListItemType.java
com.oidar.model.Radio.java
com.oidar.sql.SqlHandler.java
com.oidar.util.Constants.java
com.oidar.util.MathHelper.java
com.oidar.util.MyLog.java
com.oidar.util.OIDARConstants.java
com.oidar.util.PreferenceUtil.java
com.oidar.util.StringHelper.java
com.oidar.util.Util.java
com.oidar.view.CustomDrawerLayout.java