<commit_before>package com.matthewtamlin.spyglass.library.core;

public enum DimensionUnit {
	PX,
	DP,
	PT,
	IN,
	SP,
	MM
}<commit_msg>Added method convertToPx to enum<commit_after>package com.matthewtamlin.spyglass.library.core;

import android.content.Context;

import com.matthewtamlin.android_utilities.library.helpers.DimensionHelper;

public enum DimensionUnit {
	PX {
		@Override
		public int convertToPx(final Context context, final int value) {
			return value;
		}
	},

	DP {
		@Override
		public int convertToPx(final Context context, final int value) {
			return DimensionHelper.dpToPx(context, value);
		}
	},

	PT{
		@Override
		public int convertToPx(final Context context, final int value) {
			return (int) DimensionHelper.ptToPx(context, value);
		}
	},

	IN{
		@Override
		public int convertToPx(final Context context, final int value) {
			return (int) DimensionHelper.inToPx(context, value);
		}
	},

	SP{
		@Override
		public int convertToPx(final Context context, final int value) {
			return (int) DimensionHelper.spToPx(context, value);
		}
	},

	MM{
		@Override
		public int convertToPx(final Context context, final int value) {
			return (int) DimensionHelper.mmToPx(context, value);
		}
	};

	public abstract int convertToPx(final Context context, final int value);
}
{'fraction_non_alphanumeric': 0.0972972972972973, 'fraction_numerical': 0.0, 'mean_word_length': 4.4, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7153917', 'n_tokens_mistral': 481, 'n_tokens_neox': 442, 'n_words': 114}