HannahMitt / HannahMitt/HomeMirror

[Suggestions] Tweaks made during customization

Open
#49 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
7.8k
Forks
646
PR merge metrics
No merged PRs in 30d

Description

Hey Hannah, thanks so much for starting this project. I'm not a frequent programmer, so having this backbone in place for me to tweak for my needs has been greatly appreciated. I wanted to share some things that I've discovered in case you want to incorporate the changes. I'll only go over general concepts of my major changes, but I would be happy to share the actual code if you want details.
### ForecastModule:

I wanted a little more out of the weather forecast, so I pulled in a few more items from the json and updated the layout:
- **currently.icon**: A machine readable icon description used to show the associated Climacon. This required a new ImageView and corresponding switch statement to assign the right .png.
- **daily.data.get(0).temperatureMax**: Today's max temperature.
- **daily.data.get(0).temperatureMin**: Today's min temperature.
- **hourly.summary**: Human readable description of today's weather.
### NewsModule:

I wanted to see the top 5 headlines, so I just arrayified everything and added a `for` loop to populate it. I also added an icon to help the headlines stand out.
### CalendarModule:

I've been fiddling with this the most because it's the feature that's most appealing to me. I use this for chores, reminders, meetings, and a countdown to fun things I have planned in the future. This is what I've changed and a couple of things for you to keep in mind if you're not already aware:

**Potential "bugs:"** You are using the Events table in the Calendar provider to search for upcoming events. This is fine and dandy, but it will not catch instances of recurring events. I banged my head on this one for a bit since I have several recurring chore-like events. I switched to using the following public method of the `CalendarContract.Instances` class when assigning the cursor:

`public static final Cursor query (ContentResolver cr, String[] projection, long begin, long end)`

This grabs all of the event instances since the instances table contains 1 instance for each single event and 1 instance each for every iteration of a recurring event.

Your `where` clause will also not catch events that last through to the following day(s). You might want it function that way, but you may consider changing the clause from:
`(dtstart > start) and (dtend < endofday)`
to:
`(dtstart > start) and (dtstart < endofday)`

**My updates and how I use this module:** I created a new shared calendar specifically for the device running the app and have it as the only visible one. I put chores and reminder type events as well as fun events ("countdown events") that I have coming up. There's nothing special about the chores/reminders, but the countdown events start with a `#` (more on that shortly). I query all event instances on the calendar for the next six months (hopefully this doesn't come back to bite me, but the Instances query doesn't let you specify a `where` clause, so I guess I'd have to do another query to optimize this).

The first chore/reminder event is shown only if there is one happening today. In the attached screenshot, the text on the bottom is an event reminding me to pick up anything from the floor so my Roomba "Rosie" doesn't get in trouble while I'm at work. The first upcoming countdown event in the next 180 days is always visible (default text if none), and I calculate the days until that event. I can distinguish those events from others due to the `#`, and then just take the `.substring(1)` of the title to get it to display properly.
### layout-land:

I created a new resource folder called `layout-land` and copied the `activity_mirror.xml` into it. Android will automatically switch the layout based on screen orientation, so now I can choose which orientation to run the device.

Here's what the layout looks like for now (I am constantly tweaking the layout because I'm never satisfied with how it looks. arrrrgggggghhhh.)
![device-2016-02-18-105726](https://cloud.githubusercontent.com/assets/17180150/13152104/14c6124a-d633-11e5-9b7a-0b0b443abdb7.png)

Oh, I also changed the app icon to Minecraft's Magic Mirror item... sorry, I couldn't resist! :stuck_out_tongue:

![magic_mirror](https://cloud.githubusercontent.com/assets/17180150/13153474/eef83c58-d639-11e5-99df-83df62f4c3ef.png)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the ForecastModule, NewsModule, CalendarModule, and activity_mirror.xml sections described in the issue, along with the proposed layout-land resource folder. Compare the suggested weather, headline, recurring-event, orientation, and countdown changes with the current app, then confirm the desired scope before making any changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.