Loading src/com/android/settings/deviceinfo/storage/StorageSummaryDonutPreference.java +3 −3 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import com.android.settings.R; import com.android.settings.overlay.FeatureFactory; import com.android.settings.widget.DonutView; import java.text.NumberFormat; import java.util.Locale; /** Loading @@ -46,7 +47,7 @@ import java.util.Locale; * on a given storage volume. It is visualized with a donut graphing the % used. */ public class StorageSummaryDonutPreference extends Preference implements View.OnClickListener { private int mPercent = -1; private double mPercent = -1; public StorageSummaryDonutPreference(Context context) { this(context, null); Loading @@ -64,8 +65,7 @@ public class StorageSummaryDonutPreference extends Preference implements View.On return; } mPercent = MathUtils.constrain((int) ((usedBytes * 100) / totalBytes), (usedBytes > 0) ? 1 : 0, 100); mPercent = usedBytes / (double) totalBytes; } @Override Loading src/com/android/settings/widget/DonutView.java +3 −3 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ public class DonutView extends View { // From manual testing, this is the longest we can go without visual errors. private static final int LINE_CHARACTER_LIMIT = 10; private float mStrokeWidth; private int mPercent; private double mPercent; private Paint mBackgroundCircle; private Paint mFilledArc; private TextPaint mTextPaint; Loading Loading @@ -118,7 +118,7 @@ public class DonutView extends View { getWidth() - mStrokeWidth, getHeight() - mStrokeWidth, TOP, (360 * mPercent / 100), (360 * (float) mPercent), false, mFilledArc); } Loading @@ -140,7 +140,7 @@ public class DonutView extends View { /** * Set a percentage full to have the donut graph. */ public void setPercentage(int percent) { public void setPercentage(double percent) { mPercent = percent; mPercentString = Utils.formatPercentage(mPercent); mFullString = getContext().getString(R.string.storage_percent_full); Loading Loading
src/com/android/settings/deviceinfo/storage/StorageSummaryDonutPreference.java +3 −3 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import com.android.settings.R; import com.android.settings.overlay.FeatureFactory; import com.android.settings.widget.DonutView; import java.text.NumberFormat; import java.util.Locale; /** Loading @@ -46,7 +47,7 @@ import java.util.Locale; * on a given storage volume. It is visualized with a donut graphing the % used. */ public class StorageSummaryDonutPreference extends Preference implements View.OnClickListener { private int mPercent = -1; private double mPercent = -1; public StorageSummaryDonutPreference(Context context) { this(context, null); Loading @@ -64,8 +65,7 @@ public class StorageSummaryDonutPreference extends Preference implements View.On return; } mPercent = MathUtils.constrain((int) ((usedBytes * 100) / totalBytes), (usedBytes > 0) ? 1 : 0, 100); mPercent = usedBytes / (double) totalBytes; } @Override Loading
src/com/android/settings/widget/DonutView.java +3 −3 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ public class DonutView extends View { // From manual testing, this is the longest we can go without visual errors. private static final int LINE_CHARACTER_LIMIT = 10; private float mStrokeWidth; private int mPercent; private double mPercent; private Paint mBackgroundCircle; private Paint mFilledArc; private TextPaint mTextPaint; Loading Loading @@ -118,7 +118,7 @@ public class DonutView extends View { getWidth() - mStrokeWidth, getHeight() - mStrokeWidth, TOP, (360 * mPercent / 100), (360 * (float) mPercent), false, mFilledArc); } Loading @@ -140,7 +140,7 @@ public class DonutView extends View { /** * Set a percentage full to have the donut graph. */ public void setPercentage(int percent) { public void setPercentage(double percent) { mPercent = percent; mPercentString = Utils.formatPercentage(mPercent); mFullString = getContext().getString(R.string.storage_percent_full); Loading