Skip to content

Commit

Permalink
Tweaking graph colors and fixing a bug with collapsing news
Browse files Browse the repository at this point in the history
  • Loading branch information
gotosleep committed May 19, 2014
1 parent 19b200d commit d2c9b58
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/io/itch/activities/MyGamesActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class MyGamesActivity extends BaseActivity {
private View header;
private ProgressBar progress;
private Post latestNews;
private boolean preventCollapse;
private Boolean preventCollapse;
private GraphView graphView;
private ViewGroup graphContainer;
private static final int GRAPH_DAYS = 5;
Expand Down Expand Up @@ -187,8 +187,7 @@ public void success(GraphsResponse result, Response response) {
GraphHelper.configureYAxis(graphView, result.getMax(), 4);
if (result.getViews() != null) {
graphView.addSeries(GraphHelper.generateSeries(MyGamesActivity.this, "Views",
result.getViews(),
GRAPH_DAYS,
result.getViews(), GRAPH_DAYS,
Color.argb(255, 255, 128, 128)));
}
if (result.getPurchases() != null) {
Expand All @@ -199,7 +198,7 @@ public void success(GraphsResponse result, Response response) {
if (result.getDownloads() != null) {
graphView.addSeries(GraphHelper.generateSeries(MyGamesActivity.this, "Downloads",
result.getDownloads(), GRAPH_DAYS,
Color.MAGENTA));
Color.rgb(243, 191, 141)));
}
} else {
getGraphContainer().setVisibility(View.GONE);
Expand Down Expand Up @@ -299,7 +298,10 @@ public boolean preventCollapse() {
}

public void setPreventCollapse(boolean flag) {
this.preventCollapse = flag;
if (!flag || this.preventCollapse == null) {
// cannot switch back from false to true
this.preventCollapse = flag;
}
}

@Override
Expand Down

0 comments on commit d2c9b58

Please sign in to comment.