VLCNetworkLoginViewButtonCell.m 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*****************************************************************************
  2. * VLC for iOS
  3. *****************************************************************************
  4. * Copyright (c) 2016 VideoLAN. All rights reserved.
  5. * $Id$
  6. *
  7. * Authors: Vincent L. Cone <vincent.l.cone # tuta.io>
  8. *
  9. * Refer to the COPYING file of the official project for license.
  10. *****************************************************************************/
  11. #import "VLCNetworkLoginViewButtonCell.h"
  12. #import "VLC-Swift.h"
  13. NSString * const kVLCNetworkLoginViewButtonCellIdentifier = @"VLCNetworkLoginViewButtonCellIdentifier";
  14. @interface VLCNetworkLoginViewButtonCell ()
  15. @property (nonatomic) UIView *blackView;
  16. @end
  17. @implementation VLCNetworkLoginViewButtonCell
  18. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  19. {
  20. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  21. if (self) {
  22. self.backgroundColor = PresentationTheme.current.colors.background;
  23. self.textLabel.backgroundColor = [UIColor clearColor];
  24. self.textLabel.textColor = [UIColor whiteColor];
  25. self.textLabel.textAlignment = NSTextAlignmentCenter;
  26. self.accessibilityTraits = UIAccessibilityTraitButton;
  27. UIView *blackView = [[UIView alloc] init];
  28. [self insertSubview:blackView atIndex:0];
  29. blackView.backgroundColor = PresentationTheme.current.colors.orangeUI;
  30. self.blackView = blackView;
  31. }
  32. return self;
  33. }
  34. - (void)layoutSubviews
  35. {
  36. [super layoutSubviews];
  37. self.blackView.frame = CGRectInset(self.bounds, 0.0, 2.0);
  38. }
  39. - (void)prepareForReuse
  40. {
  41. [super prepareForReuse];
  42. self.titleString = nil;
  43. }
  44. - (void)setTitleString:(NSString *)title
  45. {
  46. self.textLabel.text = title;
  47. self.accessibilityValue = title;
  48. }
  49. - (NSString *)titleString
  50. {
  51. return self.textLabel.text;
  52. }
  53. @end