本文整理汇总了Java中com.google.samples.apps.iosched.util.UIUtils.formatIntervalTimeString方法的典型用法代码示例。如果您正苦于以下问题:Java UIUtils.formatIntervalTimeString方法的具体用法?Java UIUtils.formatIntervalTimeString怎么用?Java UIUtils.formatIntervalTimeString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.samples.apps.iosched.util.UIUtils
的用法示例。
在下文中一共展示了UIUtils.formatIntervalTimeString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBindViewHolder
import com.google.samples.apps.iosched.util.UIUtils; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(final ItemHolder holder, final int position) {
mCursor.moveToPosition(position);
final String title = mCursor.getString(OverviewSessionLoader.Query.SESSION_TITLE);
final String sessionId = mCursor.getString(OverviewSessionLoader.Query.SESSION_ID);
final long blockStart = mCursor.getLong(OverviewSessionLoader.Query.SESSION_START);
final long blockEnd = mCursor.getLong(OverviewSessionLoader.Query.SESSION_END);
final String sessionTag = mCursor.getString(OverviewSessionLoader.Query.SESSION_TAGS);
final int sessionType = ScheduleItem.detectSessionType(sessionTag);
final String text = UIUtils.formatIntervalTimeString(blockStart, blockEnd,
mStringBuilder, mContext);
holder.itemView.setTag(R.id.tag_session_id, sessionId);
holder.title.setText(title);
holder.text.setText(text);
if (mDisplayIcons) {
holder.image.setImageResource(UIUtils.getSessionIcon(sessionType));
}
}
示例2: bindView
import com.google.samples.apps.iosched.util.UIUtils; //导入方法依赖的package包/类
@Override
public void bindView(View view, Context context, Cursor cursor) {
ItemHolder holder = (ItemHolder) view.getTag();
if (holder == null) {
holder = initialiseHolder(view);
view.setTag(holder);
}
final String title = cursor
.getString(OverviewSessionLoader.Query.SESSION_TITLE);
final String sessionId = cursor
.getString(OverviewSessionLoader.Query.SESSION_ID);
final long blockStart = cursor
.getLong(OverviewSessionLoader.Query.SESSION_START);
final long blockEnd = cursor
.getLong(OverviewSessionLoader.Query.SESSION_END);
final String sessionTag = cursor
.getString(OverviewSessionLoader.Query.SESSION_TAGS);
final int sessionType = ScheduleHelper.detectSessionType(sessionTag);
final String text = UIUtils.formatIntervalTimeString(blockStart, blockEnd,
mStringBuilder, context);
holder.title.setText(title);
holder.title.setTag(sessionId);
holder.text.setText(text);
if (mDisplayIcons) {
holder.image.setImageResource(UIUtils.getSessionIcon(sessionType));
}
}
示例3: onCreate
import com.google.samples.apps.iosched.util.UIUtils; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fabric.with(this, new Crashlytics());
setContentView(R.layout.activity_browse_sessions);
Toolbar toolbar = getActionBarToolbar();
long[] interval = ScheduleContract.Sessions.getInterval(getIntent().getData());
if (interval != null) {
String title = UIUtils.formatIntervalTimeString(interval[0], interval[1], null, this);
toolbar.setTitle(title);
mMode = MODE_TIME_FIT;
/* [ANALYTICS:SCREEN]
* TRIGGER: View the Explore screen to find sessions fitting a time slot
* LABEL: 'Explore <time interval>'
* [/ANALYTICS]
*/
AnalyticsManager.sendScreenView(SCREEN_LABEL + ": " + title);
} else {
/* [ANALYTICS:SCREEN]
* TRIGGER: View the Explore screen (landing screen)
* LABEL: 'Explore'
* [/ANALYTICS]
*/
AnalyticsManager.sendScreenView(SCREEN_LABEL);
}
overridePendingTransition(0, 0);
if (savedInstanceState != null) {
mFilterTagsToRestore[0] = mFilterTags[0] = savedInstanceState.getString(STATE_FILTER_0);
mFilterTagsToRestore[1] = mFilterTags[1] = savedInstanceState.getString(STATE_FILTER_1);
mFilterTagsToRestore[2] = mFilterTags[2] = savedInstanceState.getString(STATE_FILTER_2);
} else if (getIntent() != null && getIntent().hasExtra(EXTRA_FILTER_TAG)) {
mFilterTagsToRestore[0] = getIntent().getStringExtra(EXTRA_FILTER_TAG);
}
if (mMode == MODE_EXPLORE) {
// no title (to make more room for navigation and actions)
// unless Nav Drawer opens
toolbar.setTitle(null);
}
mButterBar = findViewById(R.id.butter_bar);
mDrawShadowFrameLayout = (DrawShadowFrameLayout) findViewById(R.id.main_content);
registerHideableHeaderView(mButterBar);
}