List of usage examples for java.util Formatter Formatter
public Formatter(OutputStream os, String csn) throws UnsupportedEncodingException
From source file:com.superchat.date.MonthView.java
public MonthView(Context context, AttributeSet attr) { super(context, attr); Resources res = context.getResources(); mDayLabelCalendar = Calendar.getInstance(); mCalendar = Calendar.getInstance(); mDayOfWeekTypeface = res.getString(R.string.day_of_week_label_typeface); mMonthTitleTypeface = res.getString(R.string.sans_serif); mDayTextColor = res.getColor(R.color.date_picker_text_normal); mTodayNumberColor = res.getColor(R.color.blue); mDisabledDayTextColor = res.getColor(R.color.date_picker_text_disabled); mMonthTitleColor = res.getColor(android.R.color.white); mMonthTitleBGColor = res.getColor(R.color.circle_background); mStringBuilder = new StringBuilder(50); mFormatter = new Formatter(mStringBuilder, Locale.getDefault()); MINI_DAY_NUMBER_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.day_number_size); MONTH_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.month_label_size); MONTH_DAY_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.month_day_label_text_size); MONTH_HEADER_SIZE = res.getDimensionPixelOffset(R.dimen.month_list_item_header_height); DAY_SELECTED_CIRCLE_SIZE = res.getDimensionPixelSize(R.dimen.day_number_select_circle_radius); mRowHeight = (res.getDimensionPixelOffset(R.dimen.date_picker_view_animator_height) - getMonthHeaderSize()) / MAX_NUM_ROWS;//from ww w . j av a2 s . co m // Set up accessibility components. mTouchHelper = getMonthViewTouchHelper(); ViewCompat.setAccessibilityDelegate(this, mTouchHelper); ViewCompat.setImportantForAccessibility(this, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES); mLockAccessibilityDelegate = true; // Sets up any standard paints that will be used initView(); }
From source file:com.android.datetimepicker.date.MonthView.java
public MonthView(Context context, AttributeSet attr) { super(context, attr); Resources res = context.getResources(); mDayLabelCalendar = Calendar.getInstance(); mCalendar = Calendar.getInstance(); mDayOfWeekTypeface = res.getString(R.string.day_of_week_label_typeface); mMonthTitleTypeface = res.getString(R.string.sans_serif); mDayTextColor = res.getColor(R.color.date_picker_text_normal); mTodayNumberColor = res.getColor(R.color.blue); mDisabledDayTextColor = res.getColor(R.color.date_picker_text_disabled); mMonthTitleColor = res.getColor(R.color.white); mMonthTitleBGColor = res.getColor(R.color.circle_background); mStringBuilder = new StringBuilder(50); mFormatter = new Formatter(mStringBuilder, Locale.getDefault()); MINI_DAY_NUMBER_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.day_number_size); MONTH_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.month_label_size); MONTH_DAY_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.month_day_label_text_size); MONTH_HEADER_SIZE = res.getDimensionPixelOffset(R.dimen.month_list_item_header_height); DAY_SELECTED_CIRCLE_SIZE = res.getDimensionPixelSize(R.dimen.day_number_select_circle_radius); mRowHeight = (res.getDimensionPixelOffset(R.dimen.date_picker_view_animator_height) - getMonthHeaderSize()) / MAX_NUM_ROWS;/* w w w. java 2 s . com*/ // Set up accessibility components. mTouchHelper = getMonthViewTouchHelper(); ViewCompat.setAccessibilityDelegate(this, mTouchHelper); ViewCompat.setImportantForAccessibility(this, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES); mLockAccessibilityDelegate = true; // Sets up any standard paints that will be used initView(); }
From source file:jp.seesaa.android.datetimepicker.date.MonthView.java
public MonthView(Context context, AttributeSet attr) { super(context, attr); Resources res = context.getResources(); mDayLabelCalendar = Calendar.getInstance(); mCalendar = Calendar.getInstance(); mDayOfWeekTypeface = res.getString(R.string.dtp_day_of_week_label_typeface); mMonthTitleTypeface = res.getString(R.string.dtp_sans_serif); mDayTextColor = res.getColor(R.color.dtp_date_picker_text_normal); mTodayNumberColor = res.getColor(R.color.dtp_blue); mDisabledDayTextColor = res.getColor(R.color.dtp_date_picker_text_disabled); mMonthTitleColor = res.getColor(R.color.dtp_white); mMonthTitleBGColor = res.getColor(R.color.dtp_circle_background); mStringBuilder = new StringBuilder(50); mFormatter = new Formatter(mStringBuilder, Locale.getDefault()); MINI_DAY_NUMBER_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.dtp_day_number_size); MONTH_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.dtp_month_label_size); MONTH_DAY_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.dtp_month_day_label_text_size); MONTH_HEADER_SIZE = res.getDimensionPixelOffset(R.dimen.dtp_month_list_item_header_height); DAY_SELECTED_CIRCLE_SIZE = res.getDimensionPixelSize(R.dimen.dtp_day_number_select_circle_radius); mRowHeight = (res.getDimensionPixelOffset(R.dimen.dtp_date_picker_view_animator_height) - getMonthHeaderSize()) / MAX_NUM_ROWS; // Set up accessibility components. mTouchHelper = getMonthViewTouchHelper(); ViewCompat.setAccessibilityDelegate(this, mTouchHelper); ViewCompat.setImportantForAccessibility(this, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES); mLockAccessibilityDelegate = true;//w ww . jav a 2 s . c om // Sets up any standard paints that will be used initView(); }
From source file:edu.hawaii.android.datetimepickermaterial.date.MonthView.java
public MonthView(Context context, AttributeSet attr) { super(context, attr); Resources res = context.getResources(); mDayLabelCalendar = Calendar.getInstance(); mCalendar = Calendar.getInstance(); mDayOfWeekTypeface = res.getString(R.string.day_of_week_label_typeface); mMonthTitleTypeface = res.getString(R.string.sans_serif); mDayTextColor = res.getColor(R.color.date_picker_text_normal); mTodayNumberColor = res.getColor(R.color.green); mDisabledDayTextColor = res.getColor(R.color.date_picker_text_disabled); mMonthTitleColor = res.getColor(R.color.white); mMonthTitleBGColor = res.getColor(R.color.circle_background); mStringBuilder = new StringBuilder(50); mFormatter = new Formatter(mStringBuilder, Locale.getDefault()); MINI_DAY_NUMBER_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.day_number_size); MONTH_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.month_label_size); MONTH_DAY_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.month_day_label_text_size); MONTH_HEADER_SIZE = res.getDimensionPixelOffset(R.dimen.month_list_item_header_height); DAY_SELECTED_CIRCLE_SIZE = res.getDimensionPixelSize(R.dimen.day_number_select_circle_radius); mRowHeight = (res.getDimensionPixelOffset(R.dimen.date_picker_view_animator_height) - getMonthHeaderSize()) / MAX_NUM_ROWS;/* ww w . j a v a 2s . co m*/ // Set up accessibility components. mTouchHelper = getMonthViewTouchHelper(); ViewCompat.setAccessibilityDelegate(this, mTouchHelper); ViewCompat.setImportantForAccessibility(this, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES); mLockAccessibilityDelegate = true; // Sets up any standard paints that will be used initView(); }
From source file:com.chauffeurprive.kronos.date.MonthView.java
public MonthView(Context context, AttributeSet attr, DatePickerController controller) { super(context, attr); mController = controller;/*from w w w .jav a 2s . c o m*/ Resources res = context.getResources(); mDayLabelCalendar = Calendar.getInstance(); mCalendar = Calendar.getInstance(); mDayOfWeekTypeface = res.getString(R.string.mdtp_day_of_week_label_typeface); mMonthTitleTypeface = res.getString(R.string.mdtp_sans_serif); mDayTextColor = ContextCompat.getColor(context, mController.getTextColor()); mMonthDayTextColor = ContextCompat.getColor(context, mController.getTextColor()); mDisabledDayTextColor = ContextCompat.getColor(context, mController.getDisabledTextColor()); mHighlightedDayTextColor = ContextCompat.getColor(context, mController.getTextColor()); mSelectedDayTextColor = ContextCompat.getColor(context, mController.getSelectedTextColor()); mTodayNumberColor = ContextCompat.getColor(context, mController.getTodayTextColor()); mMonthTitleColor = ContextCompat.getColor(context, mController.getTextColor()); mStringBuilder = new StringBuilder(50); mFormatter = new Formatter(mStringBuilder, Locale.getDefault()); MINI_DAY_NUMBER_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.mdtp_day_number_size); MONTH_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.mdtp_month_label_size); MONTH_DAY_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.mdtp_month_day_label_text_size); MONTH_HEADER_SIZE = res.getDimensionPixelOffset(R.dimen.mdtp_month_list_item_header_height); DAY_SELECTED_CIRCLE_SIZE = res.getDimensionPixelSize(R.dimen.mdtp_day_number_select_circle_radius); mRowHeight = (res.getDimensionPixelOffset(R.dimen.mdtp_date_picker_view_animator_height) - getMonthHeaderSize()) / MAX_NUM_ROWS; // Set up accessibility components. mTouchHelper = getMonthViewTouchHelper(); ViewCompat.setAccessibilityDelegate(this, mTouchHelper); ViewCompat.setImportantForAccessibility(this, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES); mLockAccessibilityDelegate = true; // Sets up any standard paints that will be used initView(); }
From source file:com.borax12.materialdaterangepicker.date.MonthView.java
public MonthView(Context context, AttributeSet attr, DatePickerController controller) { super(context, attr); mController = controller;/* ww w .j ava 2s. c om*/ Resources res = context.getResources(); mDayLabelCalendar = Calendar.getInstance(); mCalendar = Calendar.getInstance(); mDayOfWeekTypeface = res.getString(R.string.mdtrp_day_of_week_label_typeface); mMonthTitleTypeface = res.getString(R.string.mdtrp_sans_serif); boolean darkTheme = mController != null && mController.isThemeDark(); if (darkTheme) { mDayTextColor = res.getColor(R.color.mdtrp_date_picker_text_normal_dark_theme); mMonthDayTextColor = res.getColor(R.color.mdtrp_date_picker_month_day_dark_theme); mDisabledDayTextColor = res.getColor(R.color.mdtrp_date_picker_text_disabled_dark_theme); mHighlightedDayTextColor = res.getColor(R.color.mdtrp_date_picker_text_highlighted_dark_theme); } else { mDayTextColor = res.getColor(R.color.mdtrp_date_picker_text_normal); mMonthDayTextColor = res.getColor(R.color.mdtrp_date_picker_month_day); mDisabledDayTextColor = res.getColor(R.color.mdtrp_date_picker_text_disabled); mHighlightedDayTextColor = res.getColor(R.color.mdtrp_date_picker_text_highlighted); } mSelectedDayTextColor = res.getColor(R.color.mdtrp_white); mTodayNumberColor = res.getColor(R.color.mdtrp_accent_color); mMonthTitleColor = res.getColor(R.color.mdtrp_white); mStringBuilder = new StringBuilder(50); mFormatter = new Formatter(mStringBuilder, Locale.getDefault()); MINI_DAY_NUMBER_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.mdtrp_day_number_size); MONTH_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.mdtrp_month_label_size); MONTH_DAY_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.mdtrp_month_day_label_text_size); MONTH_HEADER_SIZE = res.getDimensionPixelOffset(R.dimen.mdtrp_month_list_item_header_height); DAY_SELECTED_CIRCLE_SIZE = res.getDimensionPixelSize(R.dimen.mdtrp_day_number_select_circle_radius); mRowHeight = (res.getDimensionPixelOffset(R.dimen.mdtrp_date_picker_view_animator_height) - getMonthHeaderSize()) / MAX_NUM_ROWS; // Set up accessibility components. mTouchHelper = getMonthViewTouchHelper(); ViewCompat.setAccessibilityDelegate(this, mTouchHelper); ViewCompat.setImportantForAccessibility(this, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES); mLockAccessibilityDelegate = true; // Sets up any standard paints that will be used initView(); }
From source file:com.borax12.materialdaterangepicker.multi.date.MonthView.java
public MonthView(Context context, AttributeSet attr, DatePickerController controller) { super(context, attr); mController = controller;//from w w w .ja va 2s . c o m Resources res = context.getResources(); mDayLabelCalendar = Calendar.getInstance(); mCalendar = Calendar.getInstance(); mDayOfWeekTypeface = res.getString(R.string.mdtp_day_of_week_label_typeface); mMonthTitleTypeface = res.getString(R.string.mdtp_sans_serif); boolean darkTheme = mController != null && mController.isThemeDark(); if (darkTheme) { mDayTextColor = res.getColor(R.color.mdtp_date_picker_text_normal_dark_theme); mMonthDayTextColor = res.getColor(R.color.mdtp_date_picker_month_day_dark_theme); mDisabledDayTextColor = res.getColor(R.color.mdtp_date_picker_text_disabled_dark_theme); mHighlightedDayTextColor = res.getColor(R.color.mdtp_date_picker_text_highlighted_dark_theme); } else { mDayTextColor = res.getColor(R.color.mdtp_date_picker_text_normal); mMonthDayTextColor = res.getColor(R.color.mdtp_date_picker_month_day); mDisabledDayTextColor = res.getColor(R.color.mdtp_date_picker_text_disabled); mHighlightedDayTextColor = res.getColor(R.color.mdtp_date_picker_text_highlighted); } mSelectedDayTextColor = res.getColor(R.color.mdtp_white); mTodayNumberColor = res.getColor(R.color.mdtp_accent_color); mMonthTitleColor = res.getColor(R.color.mdtp_white); mStringBuilder = new StringBuilder(50); mFormatter = new Formatter(mStringBuilder, Locale.getDefault()); MINI_DAY_NUMBER_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.mdtp_day_number_size); MONTH_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.mdtp_month_label_size); MONTH_DAY_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.mdtp_month_day_label_text_size); MONTH_HEADER_SIZE = res.getDimensionPixelOffset(R.dimen.mdtp_month_list_item_header_height); DAY_SELECTED_CIRCLE_SIZE = res.getDimensionPixelSize(R.dimen.mdtp_day_number_select_circle_radius); mRowHeight = (res.getDimensionPixelOffset(R.dimen.mdtp_date_picker_view_animator_height) - getMonthHeaderSize()) / MAX_NUM_ROWS; // Set up accessibility components. mTouchHelper = getMonthViewTouchHelper(); ViewCompat.setAccessibilityDelegate(this, mTouchHelper); ViewCompat.setImportantForAccessibility(this, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES); mLockAccessibilityDelegate = true; // Sets up any standard paints that will be used initView(); }
From source file:com.leavjenn.smoothdaterangepicker.date.MonthView.java
public MonthView(Context context, AttributeSet attr, SmoothDateRangePickerController controller) { super(context, attr); mController = controller;/*from w w w. j a v a2 s. co m*/ Resources res = context.getResources(); mDayLabelCalendar = Calendar.getInstance(); mCalendar = Calendar.getInstance(); mDayOfWeekTypeface = res.getString(R.string.mdtp_day_of_week_label_typeface); mMonthTitleTypeface = res.getString(R.string.mdtp_sans_serif); boolean darkTheme = mController != null && mController.isThemeDark(); if (darkTheme) { mDayTextColor = res.getColor(R.color.mdtp_date_picker_text_normal_dark_theme); mMonthDayTextColor = res.getColor(R.color.mdtp_date_picker_month_day_dark_theme); mDisabledDayTextColor = res.getColor(R.color.mdtp_date_picker_text_disabled_dark_theme); mHighlightedDayTextColor = res.getColor(R.color.mdtp_date_picker_text_highlighted_dark_theme); } else { mDayTextColor = res.getColor(R.color.mdtp_date_picker_text_normal); mMonthDayTextColor = res.getColor(R.color.mdtp_date_picker_month_day); mDisabledDayTextColor = res.getColor(R.color.mdtp_date_picker_text_disabled); mHighlightedDayTextColor = res.getColor(R.color.mdtp_date_picker_text_highlighted); } mSelectedDayTextColor = res.getColor(R.color.mdtp_white); mTodayNumberColor = res.getColor(R.color.mdtp_accent_color); mMonthTitleColor = res.getColor(R.color.mdtp_white); mStringBuilder = new StringBuilder(50); mFormatter = new Formatter(mStringBuilder, Locale.getDefault()); MINI_DAY_NUMBER_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.mdtp_day_number_size); MONTH_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.mdtp_month_label_size); MONTH_DAY_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.mdtp_month_day_label_text_size); MONTH_HEADER_SIZE = res.getDimensionPixelOffset(R.dimen.mdtp_month_list_item_header_height); DAY_SELECTED_CIRCLE_SIZE = res.getDimensionPixelSize(R.dimen.mdtp_day_number_select_circle_radius); mRowHeight = (res.getDimensionPixelOffset(R.dimen.mdtp_date_picker_view_animator_height) - getMonthHeaderSize()) / MAX_NUM_ROWS; // Set up accessibility components. mTouchHelper = getMonthViewTouchHelper(); ViewCompat.setAccessibilityDelegate(this, mTouchHelper); ViewCompat.setImportantForAccessibility(this, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES); mLockAccessibilityDelegate = true; // Sets up any standard paints that will be used initView(); }
From source file:com.codetroopers.betterpickers.calendardatepicker.MonthView.java
public MonthView(Context context) { super(context); Resources res = context.getResources(); mDayLabelCalendar = Calendar.getInstance(); mCalendar = Calendar.getInstance(); mDayOfWeekTypeface = res.getString(R.string.day_of_week_label_typeface); mMonthTitleTypeface = res.getString(R.string.sans_serif); mDayTextColorEnabled = res.getColor(R.color.date_picker_text_normal); mDayTextColorDisabled = res.getColor(R.color.date_picker_text_disabled); mTodayNumberColor = res.getColor(R.color.bpBlue); mDayBackgroundColorDisabled = res.getColor(R.color.bpDarker_red); mMonthTitleColor = res.getColor(R.color.date_picker_text_normal); mStringBuilder = new StringBuilder(50); mFormatter = new Formatter(mStringBuilder, Locale.getDefault()); MINI_DAY_NUMBER_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.day_number_size); MONTH_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.month_label_size); MONTH_DAY_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.month_day_label_text_size); MONTH_HEADER_SIZE = res.getDimensionPixelOffset(R.dimen.month_list_item_header_height); DAY_SELECTED_CIRCLE_SIZE = res.getDimensionPixelSize(R.dimen.day_number_select_circle_radius); mRowHeight = (res.getDimensionPixelOffset(R.dimen.date_picker_view_animator_height) - MONTH_HEADER_SIZE) / MAX_NUM_ROWS;/* w w w . j a v a 2s . co m*/ // Set up accessibility components. mTouchHelper = new MonthViewTouchHelper(this); ViewCompat.setAccessibilityDelegate(this, mTouchHelper); ViewCompat.setImportantForAccessibility(this, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES); mLockAccessibilityDelegate = true; // Sets up any standard paints that will be used initView(); }
From source file:com.mattfred.betterpickers.calendardatepicker.MonthView.java
public MonthView(Context context) { super(context); Resources res = context.getResources(); mDayLabelCalendar = Calendar.getInstance(); mCalendar = Calendar.getInstance(); mDayOfWeekTypeface = res.getString(R.string.day_of_week_label_typeface); mMonthTitleTypeface = res.getString(R.string.sans_serif); mDayTextColorEnabled = res.getColor(R.color.date_picker_text_normal); mDayTextColorDisabled = res.getColor(R.color.date_picker_text_disabled); mTodayNumberColor = res.getColor(R.color.bpBlue); mDisabledDayColor = res.getColor(R.color.bpDarker_red); mMonthTitleColor = res.getColor(R.color.date_picker_text_normal); mMonthTitleBGColor = res.getColor(R.color.circle_background); mStringBuilder = new StringBuilder(50); mFormatter = new Formatter(mStringBuilder, Locale.getDefault()); MINI_DAY_NUMBER_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.day_number_size); MONTH_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.month_label_size); MONTH_DAY_LABEL_TEXT_SIZE = res.getDimensionPixelSize(R.dimen.month_day_label_text_size); MONTH_HEADER_SIZE = res.getDimensionPixelOffset(R.dimen.month_list_item_header_height); DAY_SELECTED_CIRCLE_SIZE = res.getDimensionPixelSize(R.dimen.day_number_select_circle_radius); mRowHeight = (res.getDimensionPixelOffset(R.dimen.date_picker_view_animator_height) - MONTH_HEADER_SIZE) / MAX_NUM_ROWS;// w w w. j av a 2s . c o m // Set up accessibility components. mTouchHelper = new MonthViewTouchHelper(this); ViewCompat.setAccessibilityDelegate(this, mTouchHelper); ViewCompat.setImportantForAccessibility(this, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES); mLockAccessibilityDelegate = true; // Sets up any standard paints that will be used initView(); }