New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v-play] add venue description implementation #65
Merged
micuintus
merged 6 commits into
development
from
jmastr/v_play_add_venue_description_implementation
Feb 19, 2017
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
99e8cd0
Add BVApp.Theme where it is still missing
3c997f2
Add framework specific IconButton implementation
3387449
Add more properties to BVApp.Theme
bbbbc1d
[v-play] add first VenueDescription implementation
9132749
[v-play] enable navigation stack in v-play builds
4cb6ba7
Move iconBy() function into Theme.qml
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import Sailfish.Silica 1.0 | ||
import "." as BVApp | ||
|
||
IconButton { | ||
function iconBy(type) { | ||
switch (type) { | ||
case "answer": | ||
return "image://theme/icon-l-answer?"+ (pressed | ||
? BVApp.Theme.highlightColor | ||
: BVApp.Theme.primaryColor) | ||
case "favorite": | ||
return "image://theme/icon-m-favorite?" + (pressed | ||
? BVApp.Theme.highlightColor | ||
: BVApp.Theme.primaryColor) | ||
case "home": | ||
return "image://theme/icon-m-home?" + (pressed | ||
? BVApp.Theme.highlightColor | ||
: BVApp.Theme.primaryColor) | ||
case "location": | ||
return "image://theme/icon-m-location?" + BVApp.Theme.highlightBackgroundColor | ||
} | ||
} | ||
|
||
property string type | ||
property real scale | ||
|
||
icon.source: iconBy(type) | ||
icon.scale: scale ? scale : 1 | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
module BerlinVegan.components | ||
IconButton 1.0 IconButton.qml | ||
singleton Theme 1.0 Theme.qml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import VPlayApps 1.0 | ||
|
||
IconButton { | ||
|
||
function iconBy(type) { | ||
switch (type) { | ||
case "answer": | ||
return IconType.phone | ||
case "favorite": | ||
return IconType.hearto | ||
case "home": | ||
return IconType.home | ||
case "location": | ||
return IconType.mapmarker | ||
} | ||
} | ||
|
||
property string type | ||
property real scale | ||
|
||
icon: iconBy(type) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
module BerlinVegan.components | ||
IconButton 1.0 IconButton.qml | ||
singleton Theme 1.0 Theme.qml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That
IconButton
abstraction is amazing, nice! I have also already thought about this a bit (when thinking about the Theme), and I head exactly something like this in mind ;). Of course, I haven't implemented it / tried it out. Very nice work!One idea: What would you think about moving this
iconBy()
function to the Theme class? Maybe we could do sth. likeI see the following advantages with that approach:
IconButton
implementation.IconButton
use case, when we need icons with native look and feel.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I think it's a good idea to move it into the Themes, but shall the function then return an array with
[iconString, scalingFactor]
or what did you think of?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest just to move the functions
iconBy(type)
into the according Themes and set the scaling factor from the outside, as it is now already.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea was that it actually returns the icon type that is used on the corresponding platform: A string on v-play and a (scaled) icon on Sailfish, which both can be directly assigned to the icon object of the
IconButton
. But I just saw that we then need to export thepressed
property as a parameter of this function, as well, right? Does v-play have sth. like this? I assume yes, and I assume it is named differently. ;)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They have something how the icon should look like AFTER it was pressed (what we actually need for the upcoming favourites feature), but not for the pressed state itself.
I am not quite sure, what you want to achieve. So I'd suggest to move the function as it is, so it is at the right place and to postpone further improvements. I have to think about the whole VenueDetails-design anyways.
Ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I was wrong, I think pressed is called
selected
in v-play...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Lets do it scrummy-iteratively step by step. (I still steer towards removing the
IconButton
abtraction in a later step ;))