pEpForiOS/UI/EmailDisplay/EmailListViewController.swift
changeset 1832 8f9685564441
parent 1826 f8fe61819ba6
child 1865 fdd32d28247a
equal deleted inserted replaced
1831:eeada9973971 1832:8f9685564441
    47 
    47 
    48         if MiscUtil.isUnitTest() {
    48         if MiscUtil.isUnitTest() {
    49             return
    49             return
    50         }
    50         }
    51 
    51 
       
    52         self.textFilterButton.isEnabled = filterEnabled
       
    53 
    52         setDefaultColors()
    54         setDefaultColors()
    53         initialConfig()
    55         initialConfig()
    54         updateModel()
    56         updateModel()
    55 
    57 
    56         MessageModelConfig.messageFolderDelegate = self
    58         MessageModelConfig.messageFolderDelegate = self
    81         definesPresentationContext = true
    83         definesPresentationContext = true
    82         tableView.tableHeaderView = searchController.searchBar
    84         tableView.tableHeaderView = searchController.searchBar
    83         tableView.setContentOffset(CGPoint(x: 0.0, y: 40.0), animated: false)
    85         tableView.setContentOffset(CGPoint(x: 0.0, y: 40.0), animated: false)
    84     }
    86     }
    85 
    87 
    86 
       
    87     @IBAction func showUnreadButtonTapped(_ sender: UIBarButtonItem) {}
       
    88 
       
    89     func updateModel() {
    88     func updateModel() {
    90         tableView.reloadData()
    89         tableView.reloadData()
       
    90     }
       
    91 
       
    92 
       
    93     private var filterEnabled = false
       
    94     @IBOutlet weak var enableFilterButton: UIBarButtonItem!
       
    95     @IBOutlet weak var textFilterButton: UIBarButtonItem!
       
    96     @IBAction func showUnreadButtonTapped(_ sender: UIBarButtonItem) {
       
    97         if filterEnabled {
       
    98             filterEnabled = false
       
    99             textFilterButton.title = ""
       
   100             enableFilterButton.image = UIImage(named: "unread-icon")
       
   101             config?.folder?.updateFilter(filter: Filter.unified())
       
   102             self.tableView.reloadData()
       
   103         } else {
       
   104             filterEnabled = true
       
   105             textFilterButton.title = "Filter by: unread"
       
   106             enableFilterButton.image = UIImage(named: "unread-icon-active")
       
   107             if config != nil {
       
   108                 config?.folder?.updateFilter(filter: Filter.unread())
       
   109                 self.tableView.reloadData()
       
   110             }
       
   111         }
       
   112         self.textFilterButton.isEnabled = filterEnabled
       
   113 
    91     }
   114     }
    92 
   115 
    93     // MARK: - UI State
   116     // MARK: - UI State
    94 
   117 
    95     func updateUI() {
   118     func updateUI() {