Giter VIP home page Giter VIP logo

dcmetrowidget's Introduction

DC Metro Widget GitHub license platforms

Available on the Mac App Store

A Today extension for macOS' Notification Center that tracks DC Metro arrival times.

Requirements

  • macOS 10.10+

Installation

This project uses CocoaPods. You know what to do:

$ pod install

WMATA API Key

The extension will not fetch information from WMATA's API without an API key. You can setup a free account and get a key here. Replace [WMATA_KEY_GOES_HERE] in TodayViewController.swift with your key.

Dependencies

dcmetrowidget's People

Contributors

clrung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

carabina

dcmetrowidget's Issues

Improve hiding and showing stations near user implementation

The current method of hiding / showing stations near the user is:

  • User denies location tracking (hide stations near user):
    • A height constant (connected to the "Select a station near you" text field and 5 radio buttons) is set to 2. This is not set to 0 because radio button's height cannot be less than 2. This is admittedly a bit hacky 👎
    • "or choose from the list" becomes "Choose a station from the list"
  • User accepts location tracking (show stations near user):
    • The height constant is set to 23
    • The choose from list text field is "or choose from the list"

Ideally, remove the text field and the radio buttons from the view when location services are denied, and add them to the view when location services are accepted.

Metro Alerts

Show alerts for when there are advisories/alerts/etc. This could be especially useful for the current SafeTrack schedules.

Walking distance to close stations

Add an indicator to show the estimated time to walk to the station.

Before:
Select a station near you

  • Greensboro
  • Tyson's Corner
  • Spring Hill
  • etc

After:
Select a station near you

  • Greensboro (6 minute walk)
  • Tyson's Corner (10 minute walk)
  • Spring Hill (12 minute walk)
  • etc

"Classic" theme

Find a cool dot matrix font and use that to make the widget look exactly like the signage in metro stations.

Insert space between groups

It would be nice if there was a space separating the trains that travel in opposite directions (known as "groups"). This would make the predictions easier to read, especially in stations with two levels, such as Metro Center.

Selected station overrides home/work

If a station is selected in settings, and then either the home or work shortcut is used, the next time the widget is loaded, it will show the station selected in settings, and not the home or work station.

Separate keys into plist

The WMATA API key and the Fabric API keys are currently stored inline.

Separate these keys into APIKeys.plist and add it to .gitignore.

The biggest blocker at the moment is figuring out how to populate plist values with other plist's values. The Fabric API key is stored in Info.plist, and will need to be retrieved by APIKeys.plist.

Resolve station text clipping in main view

If the selected station is "Woodley Park Zoo-Adams Morgan" (the longest station name), the "W" overlaps with the work favorite button:

screen shot 2016-08-24 at 9 19 08 am

Resolve this by either shrinking the text or truncating it with ellipses. I have shortened other names (e.g. shortened "U Street/African-Amer Civil War Memorial/Cardozo" to "U Street"), but I'm not sure what to remove from "Woodley Park Zoo-Adams Morgan."

Crash Analytics

It would be helpful to see crash reports to gauge how the app is doing in the real world. Implement the Crashlytics Pod to achieve this.

Settings view

Use the info button on the upper right corner of the widget to reveal a settings view, which should display the station selection options.

Filter predictions by line

Stations with multiple levels can create a cluttered looking table view:
screen shot 2016-06-29 at 7 16 42 pm
Create a dropdown menu to filter by line. I think this should include connecting lines, too (e.g. selecting Silver will also show predictions for the Orange line).

Replace Settings button with Info Button

Currently, an NSButton reveals the Settings view, since implementing widgetDidBeginEditing() was giving me issues.

The NSButton calls this method:

    @IBAction func clickSettings(sender: NSButton) {
        if settingsViewController == nil {
            settingsViewController = SettingsViewController.init(nibName: "SettingsViewController", bundle: NSBundle.mainBundle())
        }

        presentViewControllerInWidget(settingsViewController)
    }

And this is the current implementation of widgetDidBeginEditing() (yes, I have also tried adding the nil check to no avail):

    func widgetDidBeginEditing() {
        print("began editing")
        // This causes the view to flash back and forth
        //      presentViewControllerInWidget(settingsViewController)
    }

As you can see from the comments, this implementation makes the widget very glitchy, and the Console prints "began editing” and then "ended editing" (widgetDidEndEditing() prints "ended editing") in an infinite loop.

widgetAllowsEditing currently returns false, which disables editing mode until this is figured out.

Replace the NSButton with the correct implementation of widgetDidBeginEditing().

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.