//
//  GuideLastView.m
//  创维盒子
//
//  Created by APPLE on 2023/9/18.
//

#import "GuideLastView.h"
#import <Masonry.h>


@implementation GuideLastView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    
    [self drawAnyView];
    
    return self;
}

- (void)drawAnyView{
    [self setBackgroundColor:HWECECECColor];
    
    /*背景视图*/
    UIImageView *bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"guide_last_bg_icon"]];
    [self addSubview:bgImageView];
    [bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
    }];
        
    /*中间图片*/
    UIImage *middleImage = [UIImage imageNamed:@"guide_last_middle_icon"];
    UIImageView *middleImageView = [[UIImageView alloc] initWithImage:middleImage];
    [bgImageView addSubview:middleImageView];
    [middleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(H_STATE_BAR + 211.f);
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo((middleImage.size.height/middleImage.size.width)*SCREEN_W);
    }];
    
    /*中间标签*/
    UILabel *middleLabel = [[UILabel alloc] init];
    [middleLabel setTextColor:HW333333Color];
    [middleLabel setNumberOfLines:0];
    [middleLabel setTextAlignment:(NSTextAlignmentCenter)];
    [middleLabel setFont:[UIFont boldSystemFontOfSize:14.f]];
    [middleLabel setText:NSLocalizedString(@"guide_start_sys_app_name",nil)];
    [bgImageView addSubview:middleLabel];
    [middleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-20.f);
        make.left.mas_equalTo(20.f);
        make.bottom.equalTo(middleImageView.mas_bottom).offset(-12.f);
    }];
    
    /*底部标签*/
    UILabel *bottomLabel = [[UILabel alloc] init];
    [bottomLabel setTextColor:HW9D9D9DColor];
    [bottomLabel setNumberOfLines:0];
    [bottomLabel setTextAlignment:(NSTextAlignmentCenter)];
    [bottomLabel setFont:[UIFont systemFontOfSize:14.f]];
    [bottomLabel setText:NSLocalizedString(@"guide_start_sys_value",nil)];
    [bgImageView addSubview:bottomLabel];
    [bottomLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-20.f);
        make.left.mas_equalTo(20.f);
        make.bottom.mas_equalTo(-14.f);
    }];
}

@end
