Java Code Examples for com.ingenic.iwds.slpt.view.core.SlptLinearLayout#setImagePictureArrayForAll()

The following examples show how to use com.ingenic.iwds.slpt.view.core.SlptLinearLayout#setImagePictureArrayForAll() . 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: BatteryWidget.java    From AmazfitAPKs with Apache License 2.0 5 votes vote down vote up
public List<SlptViewComponent> buildSlptViewComponent(Service service) {
    byte[] SlptBlank = Util.assetToBytes(service.getApplicationContext(), "blank.png");
    byte[] SlptZero = Util.assetToBytes(service.getApplicationContext(), "zero.png");
    byte[] SlptBatteryIcon100 = Util.assetToBytes(service.getApplicationContext(), "battery100.png");
    byte[] SlptBatteryIcon90 = Util.assetToBytes(service.getApplicationContext(), "battery90.png");
    byte[] SlptBatteryIcon80 = Util.assetToBytes(service.getApplicationContext(), "battery80.png");
    byte[] SlptBatteryIcon70 = Util.assetToBytes(service.getApplicationContext(), "battery70.png");
    byte[] SlptBatteryIcon60 = Util.assetToBytes(service.getApplicationContext(), "battery60.png");
    byte[] SlptBatteryIcon50 = Util.assetToBytes(service.getApplicationContext(), "battery50.png");
    byte[] SlptBatteryIcon40 = Util.assetToBytes(service.getApplicationContext(), "battery40.png");
    byte[] SlptBatteryIcon30 = Util.assetToBytes(service.getApplicationContext(), "battery30.png");
    byte[] SlptBatteryIcon20 = Util.assetToBytes(service.getApplicationContext(), "battery20.png");
    byte[] SlptBatteryIcon10 = Util.assetToBytes(service.getApplicationContext(), "battery10.png");
    byte[] SlptBatteryIcon0 = Util.assetToBytes(service.getApplicationContext(), "battery0.png");
    byte[][] SlptBatteryArray = new byte[][]{SlptBatteryIcon0, SlptBatteryIcon10, SlptBatteryIcon20, SlptBatteryIcon30, SlptBatteryIcon40, SlptBatteryIcon50, SlptBatteryIcon60, SlptBatteryIcon70, SlptBatteryIcon80, SlptBatteryIcon90};
    byte[][] SlptBatteryArray100 = new byte[][]{SlptZero, SlptBatteryIcon100, SlptBlank, SlptBlank, SlptBlank, SlptBlank, SlptBlank, SlptBlank, SlptBlank, SlptBlank};

    SlptLinearLayout BatteryIcon10 = new SlptLinearLayout();
    BatteryIcon10.add(new SlptPowerNumView());
    BatteryIcon10.setImagePictureArrayForAll(SlptBatteryArray);
    BatteryIcon10.setStart(-17, 17);

    SlptLinearLayout BatteryIcon100 = new SlptLinearLayout();
    BatteryIcon100.add(new SlptPowerNumView());
    BatteryIcon100.setImagePictureArrayForAll(SlptBatteryArray100);
    BatteryIcon100.setStart(-17, 17);
    BatteryIcon100.alignX = (byte) 1;
    BatteryIcon100.alignY = (byte) 0;
    BatteryIcon100.setRect(960, 320);

    return Arrays.asList(new SlptViewComponent[]{BatteryIcon100, BatteryIcon10});
}
 
Example 2
Source File: FloorWidget.java    From AmazfitAPKs with Apache License 2.0 5 votes vote down vote up
@Override
public List<SlptViewComponent> buildSlptViewComponent(Service service) {
    byte[] num0 = Util.assetToBytes(service.getApplicationContext(), "num0.png");
    byte[] num1 = Util.assetToBytes(service.getApplicationContext(), "num1.png");
    byte[] num2 = Util.assetToBytes(service.getApplicationContext(), "num2.png");
    byte[] num3 = Util.assetToBytes(service.getApplicationContext(), "num3.png");
    byte[] num4 = Util.assetToBytes(service.getApplicationContext(), "num4.png");
    byte[] num5 = Util.assetToBytes(service.getApplicationContext(), "num5.png");
    byte[] num6 = Util.assetToBytes(service.getApplicationContext(), "num6.png");
    byte[] num7 = Util.assetToBytes(service.getApplicationContext(), "num7.png");
    byte[] num8 = Util.assetToBytes(service.getApplicationContext(), "num8.png");
    byte[] num9 = Util.assetToBytes(service.getApplicationContext(), "num9.png");
    byte[][] SlptNumArray = new byte[][]{num0, num1, num2, num3, num4, num5, num6, num7, num8, num9};
    SlptLinearLayout floors = new SlptLinearLayout();
    SlptTodayFloorNumView floorsnum = new SlptTodayFloorNumView();

    SlptPictureView floorsunit = new SlptPictureView();
    floors.add(new SlptTodayFloorNumView());
    floors.setImagePictureArrayForAll(SlptNumArray);

    floors.setStart(
            (int) service.getResources().getDimension(R.dimen.floors_text_left_slpt),
            (int) service.getResources().getDimension(R.dimen.floors_text_top_slpt));
    floors.alignX = 2;
    floors.alignY=0;
    floors.setRect(28,21);
    return Arrays.asList(new SlptViewComponent[]{floors});
}