Posts

Showing posts from July, 2016

D3js Pie Chart with Toggle for 3D/2D View

   I found an example that does this already out there however I found it on accident after playing around with the code. I know that any examples with a 3D pie-chart would help to get me started but I didn't think any example would just have a straight shot answer. Here are links to both the used example and my example to play around with the chart. Even got a cool toggle button going on!

The trick is to play with the inner radius parameter in the Donut3D js file.


Solution: https://github.com/fassetar/blog-examples/tree/gh-pages/toggle-dimension-d3


Research
http://bl.ocks.org/NPashaP/9994181


A Better Material UI/UX SwipeRefreshLayout Style

Image
    When I was thinking of the designs for mypatco, I decided to use a pulling down gesture to handle user requests for updating train schedules. If your not familiar with android's UI/UX jump to what the images to get what I mean.

The Issue with my design
    At first this is what I did and where I ran into trouble with is when I was loading in the data I would use a second spinner. The pull to refresh spinner would disappear but for a split moment both spinners would be in the user's view. This was a design fail in implementation, and I didn't better design for fixing this.


  I don't like this version of the pull to refresh but I wanted to include it because I think its interesting it combines what I would call the old style of Google's spinner with a "pull to refresh" gesture. The correct way would be to use the material progress bar. The spinner used in this image is too large for its parent container and add extra content before the original content.…

Firebase Realtime Data - "setPersistenceEnabled() must be made before any other usage"

    Just a small issue I encountered with my android app with how to correctly implement firebase real time data to be persistent. I did found a few notices on how to correct this and most of them was just making the database instance static or with a flag to see if the object wasn't already created. A better solution would be having the later version of the object handle this in a method. What I did was just wrap it with my own object and create a method like its explained in the github issue. The purpose of this post is really just make the information more available and public so the documents get updated or the code get addressed.

Code
public class FirebaseUtil { private static FirebaseDatabase mDatabase; public static FirebaseDatabase getDatabase() { if (mDatabase == null) { mDatabase = FirebaseDatabase.getInstance(); mDatabase.setPersistenceEnabled(true); } return mDatabase; } }

Usage
DatabaseReference myRef = Fireb…