com.ingenic.iwds.slpt.view.digital.SlptWeekView Java Examples
The following examples show how to use
com.ingenic.iwds.slpt.view.digital.SlptWeekView.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MainClock.java From AmazfitAPKs with Apache License 2.0 | 4 votes |
@Override public List<SlptViewComponent> buildSlptViewComponent(Service service) { SlptPictureView background = new SlptPictureView(); background.setImagePicture(Util.assetToBytes(service, "background_heart_splt.png")); SlptLinearLayout hourLayout = new SlptLinearLayout(); hourLayout.add(new SlptHourHView()); hourLayout.add(new SlptHourLView()); hourLayout.setStringPictureArrayForAll(this.digitalNums); SlptLinearLayout minuteLayout = new SlptLinearLayout(); minuteLayout.add(new SlptMinuteHView()); minuteLayout.add(new SlptMinuteLView()); minuteLayout.setStringPictureArrayForAll(this.digitalNums); Typeface timeTypeFace = ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE); hourLayout.setTextAttrForAll( service.getResources().getDimension(R.dimen.time_font_size), -16777216, timeTypeFace); minuteLayout.setTextAttrForAll( service.getResources().getDimension(R.dimen.time_font_size), -65536, timeTypeFace); hourLayout.setStart( (int) service.getResources().getDimension(R.dimen.time_hour_left_slpt), (int) service.getResources().getDimension(R.dimen.time_hour_top_slpt)); hourLayout.alignX = 2; hourLayout.alignY = 0; hourLayout.setRect(320,160); minuteLayout.setStart( (int) service.getResources().getDimension(R.dimen.time_minute_left_slpt), (int) service.getResources().getDimension(R.dimen.time_minute_top_slpt)); minuteLayout.alignX=2; minuteLayout.alignY=0; minuteLayout.setRect(320,160); SlptPictureView dash = new SlptPictureView(); dash.setStringPicture(" -"); SlptLinearLayout dayLayout = new SlptLinearLayout(); dayLayout.add(new SlptDayHView()); dayLayout.add(new SlptDayLView()); dayLayout.add(dash); SlptLinearLayout monthLayout = new SlptLinearLayout(); monthLayout.add(new SlptMonthHView()); monthLayout.add(new SlptMonthLView()); for (SlptLayout component : Arrays.asList(monthLayout, dayLayout)) { component.setTextAttrForAll( service.getResources().getDimension(R.dimen.date_font_size), -16777216, timeTypeFace ); } dayLayout.setStart( (int) service.getResources().getDimension(R.dimen.date_left_slpt), (int) service.getResources().getDimension(R.dimen.date_top_slpt)); monthLayout.setStart( (int) service.getResources().getDimension(R.dimen.month_left_slpt), (int) service.getResources().getDimension(R.dimen.month_top_slpt)); SlptLinearLayout WeekdayLayout = new SlptLinearLayout(); WeekdayLayout.add(new SlptWeekView()); WeekdayLayout.setStart( (int) service.getResources().getDimension(R.dimen.week_left_slpt), (int) service.getResources().getDimension(R.dimen.week_top_slpt)); WeekdayLayout.setTextAttrForAll(service.getResources().getDimension(R.dimen.date_font_size), -16777216, timeTypeFace ); WeekdayLayout.alignX = (byte) 2; WeekdayLayout.alignY = (byte) 0; WeekdayLayout.setRect(50, 40); return Arrays.asList(background, hourLayout, minuteLayout, dayLayout, monthLayout, WeekdayLayout); }
Example #2
Source File: MalvarezClock.java From AmazfitAPKs with Apache License 2.0 | 4 votes |
@Override public List<SlptViewComponent> buildSlptViewComponent(Service service) { SlptPictureView background = new SlptPictureView(); background.setImagePicture(SimpleFile.readFileFromAssets(service.getApplicationContext(), "background_splt.png")); SlptLinearLayout hourLayout = new SlptLinearLayout(); hourLayout.add(new SlptHourHView()); hourLayout.add(new SlptHourLView()); Utility.setStringPictureArrayForAll(hourLayout, this.digitalNums); SlptLinearLayout minuteLayout = new SlptLinearLayout(); minuteLayout.add(new SlptMinuteHView()); minuteLayout.add(new SlptMinuteLView()); Utility.setStringPictureArrayForAll(minuteLayout, this.digitalNums); Typeface timeTypeFace = ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE); hourLayout.setTextAttrForAll( service.getResources().getDimension(R.dimen.malvarez_time_font_size), -1, timeTypeFace); minuteLayout.setTextAttrForAll( service.getResources().getDimension(R.dimen.malvarez_time_font_size), -65536, timeTypeFace); hourLayout.setStart( (int) service.getResources().getDimension(R.dimen.malvarez_time_hour_left_slpt), (int) service.getResources().getDimension(R.dimen.malvarez_time_hour_top_slpt)); minuteLayout.setStart( (int) service.getResources().getDimension(R.dimen.malvarez_time_minute_left_slpt), (int) service.getResources().getDimension(R.dimen.malvarez_time_minute_top_slpt)); SlptLinearLayout dayLayout = new SlptLinearLayout(); dayLayout.add(new SlptDayHView()); dayLayout.add(new SlptDayLView()); SlptLinearLayout monthLayout = new SlptLinearLayout(); monthLayout.add(new SlptMonthHView()); monthLayout.add(new SlptMonthLView()); SlptWeekView weekView = new SlptWeekView(); for (SlptLayout component : Arrays.asList(monthLayout, dayLayout)) { component.setTextAttrForAll( service.getResources().getDimension(R.dimen.malvarez_date_font_size), -1, timeTypeFace ); } weekView.setTextAttr( service.getResources().getDimension(R.dimen.malvarez_date_font_size), -1, timeTypeFace ); dayLayout.setStart( (int) service.getResources().getDimension(R.dimen.malvarez_date_left_slpt), (int) service.getResources().getDimension(R.dimen.malvarez_date_top_slpt)); monthLayout.setStart( (int) service.getResources().getDimension(R.dimen.malvarez_month_left_slpt), (int) service.getResources().getDimension(R.dimen.malvarez_month_top_slpt)); weekView.setStart( (int) service.getResources().getDimension(R.dimen.malvarez_week_left_slpt), (int) service.getResources().getDimension(R.dimen.malvarez_week_top_slpt)); return Arrays.asList(background, hourLayout, minuteLayout, dayLayout, monthLayout, weekView); }
Example #3
Source File: MalvarezClock.java From malvarez-watchface with Apache License 2.0 | 4 votes |
@Override public List<SlptViewComponent> buildSlptViewComponent(Service service) { SlptPictureView background = new SlptPictureView(); background.setImagePicture(Util.assetToBytes(service, "background_splt.png")); SlptLinearLayout hourLayout = new SlptLinearLayout(); hourLayout.add(new SlptHourHView()); hourLayout.add(new SlptHourLView()); hourLayout.setStringPictureArrayForAll(this.digitalNums); SlptLinearLayout minuteLayout = new SlptLinearLayout(); minuteLayout.add(new SlptMinuteHView()); minuteLayout.add(new SlptMinuteLView()); minuteLayout.setStringPictureArrayForAll(this.digitalNums); Typeface timeTypeFace = ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE); hourLayout.setTextAttrForAll( service.getResources().getDimension(R.dimen.malvarez_time_font_size), -1, timeTypeFace); minuteLayout.setTextAttrForAll( service.getResources().getDimension(R.dimen.malvarez_time_font_size), -65536, timeTypeFace); hourLayout.setStart( (int) service.getResources().getDimension(R.dimen.malvarez_time_hour_left_slpt), (int) service.getResources().getDimension(R.dimen.malvarez_time_hour_top_slpt)); minuteLayout.setStart( (int) service.getResources().getDimension(R.dimen.malvarez_time_minute_left_slpt), (int) service.getResources().getDimension(R.dimen.malvarez_time_minute_top_slpt)); SlptLinearLayout dayLayout = new SlptLinearLayout(); dayLayout.add(new SlptDayHView()); dayLayout.add(new SlptDayLView()); SlptLinearLayout monthLayout = new SlptLinearLayout(); monthLayout.add(new SlptMonthHView()); monthLayout.add(new SlptMonthLView()); SlptWeekView weekView = new SlptWeekView(); for (SlptLayout component : Arrays.asList(monthLayout, dayLayout)) { component.setTextAttrForAll( service.getResources().getDimension(R.dimen.malvarez_date_font_size), -1, timeTypeFace ); } weekView.setTextAttr( service.getResources().getDimension(R.dimen.malvarez_date_font_size), -1, timeTypeFace ); dayLayout.setStart( (int) service.getResources().getDimension(R.dimen.malvarez_date_left_slpt), (int) service.getResources().getDimension(R.dimen.malvarez_date_top_slpt)); monthLayout.setStart( (int) service.getResources().getDimension(R.dimen.malvarez_month_left_slpt), (int) service.getResources().getDimension(R.dimen.malvarez_month_top_slpt)); weekView.setStart( (int) service.getResources().getDimension(R.dimen.malvarez_week_left_slpt), (int) service.getResources().getDimension(R.dimen.malvarez_week_top_slpt)); return Arrays.asList(background, hourLayout, minuteLayout, dayLayout, monthLayout, weekView); }