mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-23 09:52:16 -05:00
Fixed unit tests
This commit is contained in:
parent
d3f9633378
commit
e66dd3d521
@ -8,6 +8,7 @@ import com.fsck.k9.activity.misc.SwipeGestureDetector.OnSwipeGestureListener;
|
||||
import com.fsck.k9.helper.StringUtils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
@ -36,7 +37,7 @@ public class K9ActivityCommon {
|
||||
return new K9ActivityCommon(activity);
|
||||
}
|
||||
|
||||
public static void setLanguage(Activity activity, String language) {
|
||||
public static void setLanguage(Context context, String language) {
|
||||
Locale locale;
|
||||
if (StringUtils.isNullOrEmpty(language)) {
|
||||
locale = Locale.getDefault();
|
||||
@ -49,7 +50,7 @@ public class K9ActivityCommon {
|
||||
|
||||
Configuration config = new Configuration();
|
||||
config.locale = locale;
|
||||
Resources resources = activity.getResources();
|
||||
Resources resources = context.getResources();
|
||||
resources.updateConfiguration(config, resources.getDisplayMetrics());
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.fsck.k9;
|
||||
|
||||
import com.fsck.k9.activity.K9Activity;
|
||||
import com.fsck.k9.activity.K9ActivityCommon;
|
||||
import com.fsck.k9.helper.DateFormatter;
|
||||
|
||||
import android.content.Context;
|
||||
@ -29,7 +29,7 @@ public class TranslationTest extends AndroidTestCase {
|
||||
String[] languages = res.getStringArray(R.array.supported_languages);
|
||||
|
||||
for (String lang : languages) {
|
||||
K9Activity.setLanguage(mContext, lang);
|
||||
K9ActivityCommon.setLanguage(mContext, lang);
|
||||
|
||||
action.runWithLanguage(mContext, lang);
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import java.util.TimeZone;
|
||||
import android.test.AndroidTestCase;
|
||||
|
||||
import com.fsck.k9.activity.K9Activity;
|
||||
import com.fsck.k9.activity.K9ActivityCommon;
|
||||
import com.fsck.k9.mail.Address;
|
||||
import com.fsck.k9.mail.MessagingException;
|
||||
import com.fsck.k9.mail.Message.RecipientType;
|
||||
@ -109,7 +110,7 @@ public class ViewablesTest extends AndroidTestCase {
|
||||
}
|
||||
|
||||
public void testTextPlusRfc822Message() throws MessagingException {
|
||||
K9Activity.setLanguage(getContext(), "en");
|
||||
K9ActivityCommon.setLanguage(getContext(), "en");
|
||||
Locale.setDefault(Locale.US);
|
||||
TimeZone.setDefault(TimeZone.getTimeZone("GMT+01:00"));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user