Skip to content

Commit

Permalink
Bella: add support for all material colors
Browse files Browse the repository at this point in the history
  • Loading branch information
ujwalp15 committed Apr 26, 2017
1 parent f916808 commit 994e103
Show file tree
Hide file tree
Showing 3 changed files with 337 additions and 28 deletions.
34 changes: 22 additions & 12 deletions app/src/main/java/com/example/android/Bella/SettingActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@
public class SettingActivity extends MaterialAboutActivity {

int colorIcon = R.color.colorIconDark;
int red = R.color.red_500;
int lightRed = R.color.red_400;
int blue = R.color.light_blue_900;
int yellow = R.color.yellow_600;
int green = R.color.green_700;
int purple = R.color.purple_500;
int orange = R.color.orange_600;
int grey = R.color.grey_500;
int lightGreen = R.color.green_500;
int lightBlue = R.color.blue_500;

@Override
protected MaterialAboutList getMaterialAboutList(Context c) {
Expand All @@ -34,7 +44,7 @@ protected MaterialAboutList getMaterialAboutList(Context c) {
appCardBuilder.addItem(ConvenienceBuilder.createVersionActionItem(c,
new IconicsDrawable(c)
.icon(GoogleMaterial.Icon.gmd_info_outline)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, red))
.sizeDp(18),
"Version",
false));
Expand All @@ -47,7 +57,7 @@ protected MaterialAboutList getMaterialAboutList(Context c) {
.text("Changelog")
.icon(new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_history)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, purple))
.sizeDp(18))
.setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Releases", "https://github.com/Bella-Assistant/Bella-Android/blob/master/CHANGELOG", true, false))
.build());
Expand All @@ -61,15 +71,15 @@ protected MaterialAboutList getMaterialAboutList(Context c) {
.subText("Bangalore")
.icon(new IconicsDrawable(c)
.icon(GoogleMaterial.Icon.gmd_person)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, blue))
.sizeDp(18))
.build());

authorCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Fork on GitHub")
.icon(new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_github_circle)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, grey))
.sizeDp(18))
.setOnClickListener(ConvenienceBuilder.createWebsiteOnClickAction(c, Uri.parse("https://github.com/ujwalp15/Bella")))
.build());
Expand All @@ -81,7 +91,7 @@ protected MaterialAboutList getMaterialAboutList(Context c) {
convenienceCardBuilder.addItem(ConvenienceBuilder.createVersionActionItem(c,
new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_information_outline)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, lightRed))
.sizeDp(18),
"Revision",
true));
Expand All @@ -92,16 +102,16 @@ protected MaterialAboutList getMaterialAboutList(Context c) {
convenienceCardBuilder.addItem(ConvenienceBuilder.createWebsiteActionItem(c,
new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_earth)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, green))
.sizeDp(18),
"Visit Website",
true,
Uri.parse("https://ujwalp15.github.io")));
Uri.parse("Coming soon!")));

convenienceCardBuilder.addItem(ConvenienceBuilder.createRateActionItem(c,
new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_star)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, yellow))
.sizeDp(18),
"Rate this app",
null
Expand All @@ -110,7 +120,7 @@ protected MaterialAboutList getMaterialAboutList(Context c) {
convenienceCardBuilder.addItem(ConvenienceBuilder.createEmailItem(c,
new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_email)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, grey))
.sizeDp(18),
"Send an email",
true,
Expand All @@ -120,7 +130,7 @@ protected MaterialAboutList getMaterialAboutList(Context c) {
convenienceCardBuilder.addItem(ConvenienceBuilder.createPhoneItem(c,
new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_phone)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, blue))
.sizeDp(18),
"Call me",
true,
Expand All @@ -129,7 +139,7 @@ protected MaterialAboutList getMaterialAboutList(Context c) {
convenienceCardBuilder.addItem(ConvenienceBuilder.createMapItem(c,
new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_map)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, lightGreen))
.sizeDp(18),
"Visit Bangalore",
null,
Expand All @@ -141,7 +151,7 @@ protected MaterialAboutList getMaterialAboutList(Context c) {
otherCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.icon(new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_language_html5)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, orange))
.sizeDp(18))
.text("Contributions")
.subTextHtml("We believe in <b>Open-Source</b> ideology. <br />Therefore, the <i>source</i> is readily available to work with. This gives other developers a chance to contribute to our project<br/>Remember that we accept only pull-requests")
Expand Down
41 changes: 25 additions & 16 deletions app/src/main/java/com/example/android/Bella/SuggestionActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
public class SuggestionActivity extends MaterialAboutActivity {

int colorIcon = R.color.colorIconDark;
int red = R.color.red_500;
int blue = R.color.light_blue_900;
int yellow = R.color.yellow_600;
int green = R.color.green_700;
int purple = R.color.purple_500;
int orange = R.color.orange_600;
int grey = R.color.grey_500;
int lightGreen = R.color.green_500;
int lightBlue = R.color.blue_500;

@Override
protected MaterialAboutList getMaterialAboutList(Context c) {
Expand All @@ -26,31 +35,31 @@ protected MaterialAboutList getMaterialAboutList(Context c) {
.text("Check my home status")
.icon(new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_home)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, blue))
.sizeDp(18))
.build());

homeCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Turn on light 1 in room")
.icon(new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_lightbulb_on)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, yellow))
.sizeDp(18))
.build());

homeCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Turn off Sprinkler")
.icon(new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_blur_radial)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, lightBlue))
.sizeDp(18))
.build());

homeCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Give me the status of my kitchen")
.icon(new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_food_variant)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, green))
.sizeDp(18))
.build());

Expand All @@ -61,15 +70,15 @@ protected MaterialAboutList getMaterialAboutList(Context c) {
.text("How's the weather today?")
.icon(new IconicsDrawable(c)
.icon(GoogleMaterial.Icon.gmd_wb_sunny)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, yellow))
.sizeDp(18))
.build());

detailCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Get me the latest news")
.icon(new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_newspaper)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, blue))
.sizeDp(18))
.build());

Expand All @@ -81,47 +90,47 @@ protected MaterialAboutList getMaterialAboutList(Context c) {
.text("Play the song closer")
.icon(new IconicsDrawable(c)
.icon(GoogleMaterial.Icon.gmd_music_note)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, purple))
.sizeDp(18))
.build());

aiCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Is this a good song?")
.icon(new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_bookmark_music)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, orange))
.sizeDp(18))
.build());

aiCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("What is 15 * 10?")
.icon(new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_calculator)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, grey))
.sizeDp(18))
.build());

aiCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Tell me some joke")
.icon(new IconicsDrawable(c)
.icon(GoogleMaterial.Icon.gmd_tag_faces)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, lightGreen))
.sizeDp(18))
.build());

aiCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("What date is it today?")
.icon(new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_calendar_today)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, lightBlue))
.sizeDp(18))
.build());

aiCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("What is your favourite food?")
.icon(new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_food)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, yellow))
.sizeDp(18))
.build());

Expand All @@ -132,31 +141,31 @@ protected MaterialAboutList getMaterialAboutList(Context c) {
.text("Set an alarm")
.icon(new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_alarm)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, red))
.sizeDp(18))
.build());

taskCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Remind me to feed my cat")
.icon(new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_calendar_clock)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, purple))
.sizeDp(18))
.build());

taskCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Add apple mango to shopping list")
.icon(new IconicsDrawable(c)
.icon(GoogleMaterial.Icon.gmd_shopping_cart)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, lightGreen))
.sizeDp(18))
.build());

taskCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Navigate me to Yelahanka")
.icon(new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_navigation)
.color(ContextCompat.getColor(c, colorIcon))
.color(ContextCompat.getColor(c, blue))
.sizeDp(18))
.build());

Expand Down
Loading

0 comments on commit 994e103

Please sign in to comment.