本文整理汇总了Java中android.content.res.Configuration.setToDefaults方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.setToDefaults方法的具体用法?Java Configuration.setToDefaults怎么用?Java Configuration.setToDefaults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.content.res.Configuration
的用法示例。
在下文中一共展示了Configuration.setToDefaults方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: y
import android.content.res.Configuration; //导入方法依赖的package包/类
private static Locale y(Context context) {
Locale locale = null;
try {
Configuration configuration = new Configuration();
configuration.setToDefaults();
System.getConfiguration(context.getContentResolver(), configuration);
if (configuration != null) {
locale = configuration.locale;
}
} catch (Exception e) {
bv.c(a, "fail to read user config locale");
}
if (locale == null) {
return Locale.getDefault();
}
return locale;
}
示例2: A
import android.content.res.Configuration; //导入方法依赖的package包/类
private static Locale A(Context context) {
Locale locale = null;
try {
Configuration configuration = new Configuration();
configuration.setToDefaults();
System.getConfiguration(context.getContentResolver(), configuration);
if (configuration != null) {
locale = configuration.locale;
}
} catch (Exception e) {
bv.c(a, "fail to read user config locale");
}
if (locale == null) {
return Locale.getDefault();
}
return locale;
}
示例3: initTextSize
import android.content.res.Configuration; //导入方法依赖的package包/类
/**
* 使其系统更改字体大小无效
*/
private void initTextSize() {
Resources res = getResources();
Configuration config = new Configuration();
config.setToDefaults();
res.updateConfiguration(config, res.getDisplayMetrics());
}
示例4: getResources
import android.content.res.Configuration; //导入方法依赖的package包/类
@Override
public Resources getResources() {
//保持字体不变
Resources res = super.getResources();
Configuration config = new Configuration();
config.setToDefaults();
res.updateConfiguration(config, res.getDisplayMetrics());
return res;
}
示例5: getResources
import android.content.res.Configuration; //导入方法依赖的package包/类
@Override
public Resources getResources() {
Resources res = super.getResources();
if (res.getConfiguration().fontScale != 1) {//非默认值
Configuration newConfig = new Configuration();
newConfig.setToDefaults();//设置默认
res.updateConfiguration(newConfig, res.getDisplayMetrics());
}
return res;
}
示例6: setMetricsConfigWithoutSettings
import android.content.res.Configuration; //导入方法依赖的package包/类
/**
* 加载系统默认设置,字体不随用户设置变化
*/
public static void setMetricsConfigWithoutSettings(Context context){
Resources res = context.getResources();
Configuration config = new Configuration();
config.setToDefaults();
res.updateConfiguration(config, res.getDisplayMetrics());
}
示例7: getResources
import android.content.res.Configuration; //导入方法依赖的package包/类
public Resources getResources() {
Resources res = super.getResources();
Configuration config = new Configuration();
config.setToDefaults();
res.updateConfiguration(config, res.getDisplayMetrics());
return res;
}
示例8: keepFontSize
import android.content.res.Configuration; //导入方法依赖的package包/类
private void keepFontSize() {
Resources res = super.getResources();
Configuration config = new Configuration();
config.setToDefaults();
res.updateConfiguration(config, res.getDisplayMetrics());
}
示例9: keepFontSize
import android.content.res.Configuration; //导入方法依赖的package包/类
public void keepFontSize(){
Resources res = super.getResources();
Configuration config = new Configuration();
config.setToDefaults();
res.updateConfiguration(config, res.getDisplayMetrics());
}