本文整理汇总了Java中com.google.samples.apps.iosched.util.UIUtils.setUpButterBar方法的典型用法代码示例。如果您正苦于以下问题:Java UIUtils.setUpButterBar方法的具体用法?Java UIUtils.setUpButterBar怎么用?Java UIUtils.setUpButterBar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.samples.apps.iosched.util.UIUtils
的用法示例。
在下文中一共展示了UIUtils.setUpButterBar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onAuthFailure
import com.google.samples.apps.iosched.util.UIUtils; //导入方法依赖的package包/类
@Override
public void onAuthFailure(String accountName) {
super.onAuthFailure(accountName);
UIUtils.setUpButterBar(mButterBar, getString(R.string.login_failed_text),
getString(R.string.login_failed_text_retry), new View.OnClickListener() {
@Override
public void onClick(View v) {
removeLoginFailed();
retryAuth();
}
}
);
registerHideableHeaderView(findViewById(R.id.butter_bar));
}
示例2: checkShowStaleDataButterBar
import com.google.samples.apps.iosched.util.UIUtils; //导入方法依赖的package包/类
private void checkShowStaleDataButterBar() {
final boolean showingFilters = findViewById(R.id.filters_box) != null
&& findViewById(R.id.filters_box).getVisibility() == View.VISIBLE;
final long now = UIUtils.getCurrentTime(this);
final boolean inSnooze = (now - mLastDataStaleUserActionTime < Config.STALE_DATA_WARNING_SNOOZE);
final long staleTime = now - PrefUtils.getLastSyncSucceededTime(this);
final long staleThreshold = (now >= Config.CONFERENCE_START_MILLIS && now
<= Config.CONFERENCE_END_MILLIS) ? Config.STALE_DATA_THRESHOLD_DURING_CONFERENCE :
Config.STALE_DATA_THRESHOLD_NOT_DURING_CONFERENCE;
final boolean isStale = (staleTime >= staleThreshold);
final boolean bootstrapDone = PrefUtils.isDataBootstrapDone(this);
final boolean mustShowBar = bootstrapDone && isStale && !inSnooze && !showingFilters;
if (!mustShowBar) {
mButterBar.setVisibility(View.GONE);
} else {
UIUtils.setUpButterBar(mButterBar, getString(R.string.data_stale_warning),
getString(R.string.description_refresh), new View.OnClickListener() {
@Override
public void onClick(View v) {
mButterBar.setVisibility(View.GONE);
updateFragContentTopClearance();
mLastDataStaleUserActionTime = UIUtils.getCurrentTime(
BrowseSessionsActivity.this);
requestDataRefresh();
}
}
);
}
updateFragContentTopClearance();
}