From 84edc743f52a86902282a14088647225ad599c58 Mon Sep 17 00:00:00 2001 From: str4d <str4d@mail.i2p> Date: Wed, 21 Aug 2013 11:34:31 +0000 Subject: [PATCH] Fixed SeekBarPreferences to check resource strings --- .../android/preference/SeekBarPreference.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/com/hlidskialf/android/preference/SeekBarPreference.java b/src/com/hlidskialf/android/preference/SeekBarPreference.java index 707b51659..242bbc017 100644 --- a/src/com/hlidskialf/android/preference/SeekBarPreference.java +++ b/src/com/hlidskialf/android/preference/SeekBarPreference.java @@ -49,8 +49,14 @@ public class SeekBarPreference extends DialogPreference implements SeekBar.OnSee public SeekBarPreference(Context context, AttributeSet attrs) { super(context, attrs); mContext = context; - mDialogMessage = attrs.getAttributeValue(androidns, "dialogMessage"); - mSuffix = attrs.getAttributeValue(androidns, "text"); + int dialogMessageR = attrs.getAttributeResourceValue(androidns, "dialogMessage", 0); + mDialogMessage = (dialogMessageR == 0) + ? attrs.getAttributeValue(androidns, "dialogMessage") + : context.getResources().getString(dialogMessageR); + int textR = attrs.getAttributeResourceValue(androidns, "text", 0); + mSuffix = (textR == 0) + ? attrs.getAttributeValue(androidns, "text") + : context.getResources().getString(textR); mDefault = attrs.getAttributeValue(androidns, "defaultValue"); mMax = Integer.parseInt(attrs.getAttributeValue(androidns, "max")); if (attrs.getAttributeValue(androidns, "direction") != null) { -- GitLab