com.ingenic.iwds.slpt.view.sport.SlptTodayStepNumView Java Examples

The following examples show how to use com.ingenic.iwds.slpt.view.sport.SlptTodayStepNumView. 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: ThreeLinesStepsWidget.java    From AmazfitAPKs with Apache License 2.0 6 votes vote down vote up
@Override
public List<SlptViewComponent> buildSlptViewComponent(Service service) {
    init(service);

    final float totalHeight = fontHeight * nLines - verticalOffset;
    final float x = 160;
    float y = 160 - totalHeight/2 ;

    SlptLinearLayout steps = new SlptLinearLayout();
    steps.add(new SlptTodayStepNumView());
    steps.setTextAttrForAll(
            service.getResources().getDimension(R.dimen.threelines_font_size),
            service.getResources().getColor(R.color.threelines_steps_color),
            ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.OPEN24)
    );
    steps.centerHorizontal = 1;

    y += fontHeight*2;

    steps.setStart((int)x,(int)y);

    return Collections.<SlptViewComponent>singletonList(steps);
}
 
Example #2
Source File: CirclesWidget.java    From AmazfitAPKs with Apache License 2.0 5 votes vote down vote up
@Override
public List<SlptViewComponent> buildSlptViewComponent(Service service) {
    Typeface timeTypeFace = ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE);

    SlptLinearLayout steps = new SlptLinearLayout();
    steps.alignX = 2;
    steps.alignY = 2;
    steps.add(new SlptTodayStepNumView());
    steps.setTextAttrForAll(
            service.getResources().getDimension(R.dimen.circles_font_size_slpt),
            -16777216 ,
            timeTypeFace
    );



    SlptPowerArcAnglePicView powerArcView = new SlptPowerArcAnglePicView();
    powerArcView.setImagePicture(Util.assetToBytes(service, "battery_splt.png"));
    powerArcView.start_angle = (int) startAngleBattery + 180 - 3;
    powerArcView.full_angle = (int) arcSizeBattery + 6;

    SlptTodayStepArcAnglePicView stepArcPicView = new SlptTodayStepArcAnglePicView();
    stepArcPicView.setImagePicture(Util.assetToBytes(service, "steps_splt.png"));
    stepArcPicView.start_angle = (int) startAngleSteps + 180 - 3;
    stepArcPicView.full_angle = (int) arcSizeSteps + 6;

    return Arrays.asList(steps, stepArcPicView, powerArcView);
}
 
Example #3
Source File: CirclesWidget.java    From AmazfitAPKs with Apache License 2.0 4 votes vote down vote up
@Override
public List<SlptViewComponent> buildSlptViewComponent(Service service) {
    Typeface timeTypeFace = ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.PROTOTYPE_SOURCE);

    SlptPictureView point = new SlptPictureView();
    point.setStringPicture(".");

    SlptLinearLayout power = new SlptLinearLayout();
    SlptPictureView percentage = new SlptPictureView();
    percentage.setStringPicture("%");
    power.alignX = 2;
    power.alignY = 2;
    power.add(new SlptPowerNumView());
    power.add(percentage);
    power.setTextAttrForAll(
            service.getResources().getDimension(R.dimen.circles_font_size_slpt),
            -16777216,
            timeTypeFace
    );
    power.setStart(
            (int) service.getResources().getDimension(R.dimen.battery_text_left_slpt),
            (int) service.getResources().getDimension(R.dimen.battery_text_top_slpt));
    power.alignX= 2;
    power.alignY= 0;
    power.setRect(50, 30);

    SlptLinearLayout steps = new SlptLinearLayout();
    steps.alignX = (byte)1;
    steps.alignY = (byte)2;
   
    steps.add(new SlptTodayStepNumView());
    steps.setTextAttrForAll(
            service.getResources().getDimension(R.dimen.circles_font_size_slpt),
            -16777216,
            timeTypeFace
    );

    steps.setStart(
            (int) service.getResources().getDimension(R.dimen.steps_text_left_slpt),
            (int) service.getResources().getDimension(R.dimen.steps_text_top_slpt));
    steps.alignX= (byte) 2;
    steps.alignY= (byte) 2;
    steps.setRect(64,22);

    SlptLinearLayout sport = new SlptLinearLayout();
    sport.add(new SlptTodaySportDistanceFView());
    sport.add(point);
    sport.add(new SlptTodaySportDistanceLView());
    sport.setTextAttrForAll(
            service.getResources().getDimension(R.dimen.circles_font_size_slpt),
            -16777216,
            timeTypeFace
    );
    sport.setStart(
            (int) service.getResources().getDimension(R.dimen.sport_text_left_slpt),
            (int) service.getResources().getDimension(R.dimen.sport_text_top_slpt));


    SlptLinearLayout road = new SlptLinearLayout();
    SlptPictureView kilometer = new SlptPictureView();
    kilometer.setStringPicture(" km");
    road.add(new SlptTotalDistanceFView());
    road.add(point);
    road.add(new SlptTotalDistanceLView());
    road.add(kilometer);
    road.setTextAttrForAll(
            service.getResources().getDimension(R.dimen.circles_font_size_slpt),-16777216,timeTypeFace
    );
    road.setStart(
            (int) service.getResources().getDimension(R.dimen.road_text_left_slpt),
            (int) service.getResources().getDimension(R.dimen.road_text_top_slpt)
    );
    road.alignX = 1;
    road.alignY = 0;
    road.setRect(100, 30);

    return Arrays.asList(new SlptViewComponent[]{steps, sport, road, power});
}
 
Example #4
Source File: CirclesWidget.java    From AmazfitAPKs with Apache License 2.0 4 votes vote down vote up
@Override
public List<SlptViewComponent> buildSlptViewComponent(Service service) {
    Typeface timeTypeFace = ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE);

    SlptLinearLayout power = new SlptLinearLayout();
    power.alignX = 2;
    power.alignY = 2;
    power.add(new SlptPowerNumView());
    power.setTextAttrForAll(
            service.getResources().getDimension(R.dimen.malvarez_circles_font_size_slpt),
            -1,
            timeTypeFace
    );
    power.setStart(
            (int) service.getResources().getDimension(R.dimen.malvarez_battery_text_left_slpt),
            (int) service.getResources().getDimension(R.dimen.malvarez_battery_text_top_slpt));

    SlptLinearLayout steps = new SlptLinearLayout();
    steps.alignX = 2;
    steps.alignY = 2;
    steps.add(new SlptTodayStepNumView());
    steps.setTextAttrForAll(
            service.getResources().getDimension(R.dimen.malvarez_circles_font_size_slpt),
            -1,
            timeTypeFace
    );

    steps.setStart(
            (int) service.getResources().getDimension(R.dimen.malvarez_steps_text_left_slpt),
            (int) service.getResources().getDimension(R.dimen.malvarez_steps_text_top_slpt));

    SlptLinearLayout sport = new SlptLinearLayout();
    sport.add(new SlptTodaySportDistanceLView());
    sport.setTextAttrForAll(
            service.getResources().getDimension(R.dimen.malvarez_circles_font_size_slpt),
            -1,
            timeTypeFace
    );
    sport.setStart(
            (int) service.getResources().getDimension(R.dimen.malvarez_sport_text_left_slpt),
            (int) service.getResources().getDimension(R.dimen.malvarez_sport_text_top_slpt));

    SlptPowerArcAnglePicView powerArcView = new SlptPowerArcAnglePicView();
    powerArcView.setImagePicture(SimpleFile.readFileFromAssets(service.getApplicationContext(), "battery_splt.png"));
    powerArcView.start_angle = (int) startAngleBattery + 180 - 3;
    powerArcView.full_angle = (int) arcSizeBattery + 6;

    SlptTodayStepArcAnglePicView stepArcPicView = new SlptTodayStepArcAnglePicView();
    stepArcPicView.setImagePicture(SimpleFile.readFileFromAssets(service.getApplicationContext(), "steps_splt.png"));
    stepArcPicView.start_angle = (int) startAngleSteps + 180 - 3;
    stepArcPicView.full_angle = (int) arcSizeSteps + 6;


    SlptTodayDistanceArcAnglePicView distanceArcPicView = new SlptTodayDistanceArcAnglePicView();
    distanceArcPicView.setImagePicture(SimpleFile.readFileFromAssets(service.getApplicationContext(), "sports_splt.png"));
    distanceArcPicView.start_angle = (int) startAngleSport + 180 - 3;
    distanceArcPicView.full_angle = (int) arcSizeSport + 6;

    return Arrays.asList(power, steps, sport, powerArcView, stepArcPicView, distanceArcPicView);
}
 
Example #5
Source File: CirclesWidget.java    From malvarez-watchface with Apache License 2.0 4 votes vote down vote up
@Override
public List<SlptViewComponent> buildSlptViewComponent(Service service) {
    Typeface timeTypeFace = ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE);

    SlptLinearLayout power = new SlptLinearLayout();
    power.alignX = 2;
    power.alignY = 2;
    power.add(new SlptPowerNumView());
    power.setTextAttrForAll(
            service.getResources().getDimension(R.dimen.malvarez_circles_font_size_slpt),
            -1,
            timeTypeFace
    );
    power.setStart(
            (int) service.getResources().getDimension(R.dimen.malvarez_battery_text_left_slpt),
            (int) service.getResources().getDimension(R.dimen.malvarez_battery_text_top_slpt));

    SlptLinearLayout steps = new SlptLinearLayout();
    steps.alignX = 2;
    steps.alignY = 2;
    steps.add(new SlptTodayStepNumView());
    steps.setTextAttrForAll(
            service.getResources().getDimension(R.dimen.malvarez_circles_font_size_slpt),
            -1,
            timeTypeFace
    );

    steps.setStart(
            (int) service.getResources().getDimension(R.dimen.malvarez_steps_text_left_slpt),
            (int) service.getResources().getDimension(R.dimen.malvarez_steps_text_top_slpt));

    SlptLinearLayout sport = new SlptLinearLayout();
    sport.add(new SlptTodaySportDistanceLView());
    sport.setTextAttrForAll(
            service.getResources().getDimension(R.dimen.malvarez_circles_font_size_slpt),
            -1,
            timeTypeFace
    );
    sport.setStart(
            (int) service.getResources().getDimension(R.dimen.malvarez_sport_text_left_slpt),
            (int) service.getResources().getDimension(R.dimen.malvarez_sport_text_top_slpt));

    SlptPowerArcAnglePicView powerArcView = new SlptPowerArcAnglePicView();
    powerArcView.setImagePicture(Util.assetToBytes(service, "battery_splt.png"));
    powerArcView.start_angle = (int) startAngleBattery + 180 - 3;
    powerArcView.full_angle = (int) arcSizeBattery + 6;

    SlptTodayStepArcAnglePicView stepArcPicView = new SlptTodayStepArcAnglePicView();
    stepArcPicView.setImagePicture(Util.assetToBytes(service, "steps_splt.png"));
    stepArcPicView.start_angle = (int) startAngleSteps + 180 - 3;
    stepArcPicView.full_angle = (int) arcSizeSteps + 6;


    SlptTodayDistanceArcAnglePicView distanceArcPicView = new SlptTodayDistanceArcAnglePicView();
    distanceArcPicView.setImagePicture(Util.assetToBytes(service, "sports_splt.png"));
    distanceArcPicView.start_angle = (int) startAngleSport + 180 - 3;
    distanceArcPicView.full_angle = (int) arcSizeSport + 6;

    return Arrays.asList(power, steps, sport, powerArcView, stepArcPicView, distanceArcPicView);
}