本文整理汇总了Java中net.nurik.roman.dashclock.BuildConfig类的典型用法代码示例。如果您正苦于以下问题:Java BuildConfig类的具体用法?Java BuildConfig怎么用?Java BuildConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuildConfig类属于net.nurik.roman.dashclock包,在下文中一共展示了BuildConfig类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getWeatherForLocation
import net.nurik.roman.dashclock.BuildConfig; //导入依赖的package包/类
private static WeatherData getWeatherForLocation(Location location)
throws InvalidLocationException, IOException {
if (BuildConfig.DEBUG) {
LOGD(TAG, "Using location: " + location.getLatitude()
+ "," + location.getLongitude());
}
// Honolulu = 2423945
// Paris = 615702
// London = 44418
// New York = 2459115
// San Francisco = 2487956
LocationInfo locationInfo = getLocationInfo(location);
LOGD(TAG, "Using WOEID: " + locationInfo.woeid);
return getWeatherDataForLocation(locationInfo);
}
示例2: onReceive
import net.nurik.roman.dashclock.BuildConfig; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
if (BuildConfig.DEBUG) {
if (intent != null && "demomode".equals(intent.getAction())) {
PreferenceManager.getDefaultSharedPreferences(context)
.edit()
.putBoolean("demomode", intent.getBooleanExtra("on", false))
.commit();
}
}
super.onReceive(context, intent);
}
示例3: LOGD
import net.nurik.roman.dashclock.BuildConfig; //导入依赖的package包/类
public static void LOGD(final String tag, String message) {
//noinspection PointlessBooleanExpression,ConstantConditions
if (BuildConfig.DEBUG || Log.isLoggable(tag, Log.DEBUG)) {
Log.d(tag, message);
}
}
示例4: LOGV
import net.nurik.roman.dashclock.BuildConfig; //导入依赖的package包/类
public static void LOGV(final String tag, String message) {
//noinspection PointlessBooleanExpression,ConstantConditions
if (BuildConfig.DEBUG && Log.isLoggable(tag, Log.VERBOSE)) {
Log.v(tag, message);
}
}
示例5: publishWeatherUpdate
import net.nurik.roman.dashclock.BuildConfig; //导入依赖的package包/类
private void publishWeatherUpdate(WeatherData weatherData) {
String temperature = (weatherData.temperature != WeatherData.INVALID_TEMPERATURE)
? getString(R.string.temperature_template, weatherData.temperature)
: getString(R.string.status_none);
StringBuilder expandedBody = new StringBuilder();
if (weatherData.low != WeatherData.INVALID_TEMPERATURE
&& weatherData.high != WeatherData.INVALID_TEMPERATURE) {
expandedBody.append(getString(R.string.weather_low_high_template,
getString(R.string.temperature_template, weatherData.low),
getString(R.string.temperature_template, weatherData.high)));
}
int conditionIconId = WeatherData.getConditionIconId(weatherData.conditionCode);
if (WeatherData.getConditionIconId(weatherData.todayForecastConditionCode)
== R.drawable.ic_weather_raining) {
// Show rain if it will rain today.
conditionIconId = R.drawable.ic_weather_raining;
if (expandedBody.length() > 0) {
expandedBody.append(", ");
}
expandedBody.append(
getString(R.string.later_forecast_template, weatherData.forecastText));
}
if (expandedBody.length() > 0) {
expandedBody.append("\n");
}
expandedBody.append(weatherData.location);
if (BuildConfig.DEBUG) {
expandedBody.append("\n")
.append(SimpleDateFormat.getDateTimeInstance().format(new Date()));
}
publishUpdate(new ExtensionData()
.visible(true)
.clickIntent(sWeatherIntent)
.status(temperature)
.expandedTitle(getString(R.string.weather_expanded_title_template,
temperature + sWeatherUnits.toUpperCase(Locale.US),
weatherData.conditionText))
.icon(conditionIconId)
.expandedBody(expandedBody.toString()));
// Mark that a successful weather update has been pushed
resetAndCancelRetries();
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
sp.edit().putLong(STATE_WEATHER_LAST_UPDATE_ELAPSED_MILLIS,
SystemClock.elapsedRealtime()).commit();
}