/** ----------------------- */
  public CalendarPickerView(Context context, AttributeSet attrs) {
    super(context, attrs);
    adapter = new MonthAdapter();
    setDivider(null);

    setDividerHeight(100);

    setVerticalScrollBarEnabled(false);

    final int bg = getResources().getColor(R.color.calendar_bg);
    // setBackgroundColor(bg);
    setCacheColorHint(bg);
    locale = Locale.getDefault();
    today = Calendar.getInstance(locale);
    minCal = Calendar.getInstance(locale);
    maxCal = Calendar.getInstance(locale);
    monthCounter = Calendar.getInstance(locale);
    monthNameFormat = new SimpleDateFormat(context.getString(R.string.month_name_format), locale);
    weekdayNameFormat = new SimpleDateFormat(context.getString(R.string.day_name_format), locale);
    fullDateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM, locale);

    if (isInEditMode()) {
      Calendar nextYear = Calendar.getInstance(locale);
      nextYear.add(Calendar.YEAR, 1);

      init(new Date(), nextYear.getTime()) //
          .withSelectedDate(new Date());
    }
  }
Пример #2
0
  /** Event raised when the form is created for the first time */
  @Override
  public void onCreate(Bundle savedInstanceState) {

    Utilities.LogDebug("GpsMainActivity.onCreate");

    SharedPreferences prefs =
        PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    String lang = prefs.getString("locale_override", "");

    if (!lang.equalsIgnoreCase("")) {
      Locale locale = new Locale(lang);
      Locale.setDefault(locale);
      Configuration config = new Configuration();
      config.locale = locale;
      getApplicationContext()
          .getResources()
          .updateConfiguration(config, getApplicationContext().getResources().getDisplayMetrics());
    }

    super.onCreate(savedInstanceState);

    Utilities.LogInfo("GPSLogger started");

    setContentView(R.layout.main);

    GetPreferences();

    StartAndBindService();
  }
Пример #3
0
 public String getTitleLower() {
   return getTitle().toLowerCase(Locale.getDefault());
 }
 /**
  * Both date parameters must be non-null and their {@link Date#getTime()} must not return 0. Time
  * of day will be ignored. For instance, if you pass in {@code minDate} as 11/16/2012 5:15pm and
  * {@code maxDate} as 11/16/2013 4:30am, 11/16/2012 will be the first selectable date and
  * 11/15/2013 will be the last selectable date ({@code maxDate} is exclusive).
  *
  * <p>This will implicitly set the {@link SelectionMode} to {@link SelectionMode#SINGLE}. If you
  * want a different selection mode, use {@link FluentInitializer#inMode(SelectionMode)} on the
  * {@link FluentInitializer} this method returns.
  *
  * <p>The calendar will be constructed using the default locale as returned by {@link
  * java.util.Locale#getDefault()}. If you wish the calendar to be constructed using a different
  * locale, use {@link #init(java.util.Date, java.util.Date, java.util.Locale)}.
  *
  * @param minDate Earliest selectable date, inclusive. Must be earlier than {@code maxDate}.
  * @param maxDate Latest selectable date, exclusive. Must be later than {@code minDate}.
  */
 public FluentInitializer init(Date minDate, Date maxDate) {
   return init(minDate, maxDate, Locale.getDefault());
 }