-
Notifications
You must be signed in to change notification settings - Fork 1
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
Android and iOS Gallery ui mobile 449 #1
Conversation
…d check to fill it in
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.
Haven't tested iOS, but looking good on Android. See a few comments.
plugin.xml
Outdated
@@ -4,6 +4,7 @@ | |||
id="cordova-plugin-image-picker" | |||
version="1.1.1"> | |||
|
|||
<dependency id="cordova-plugin-donkeyfont" url="https://github.com/zenput/cordova-plugin-donkeyfont" commit="master" /> |
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.
Once everything's good to go, we should make a release tag on the donkeyfont repo and point this to that instead of just the master
branch. Less dangerous.
@@ -87,6 +93,11 @@ | |||
public static final String HEIGHT_KEY = "HEIGHT"; | |||
public static final String QUALITY_KEY = "QUALITY"; | |||
|
|||
private final String mIconSelected = "\uE060"; | |||
private final String mIconUnselected = "\uE061"; |
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.
Finals in Java are typically all-caps, e.g., M_ICON_SELECTED
circlePaint.setTypeface(mDonkeyFont); | ||
circlePaint.setColor(Color.WHITE); | ||
circlePaint.setTextSize(size); | ||
canvas.drawText("\uE06E", padding, padding+size, circlePaint); |
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.
This is fine for now, but future idea: I wonder if we could make a script that converts our donkeyfont.css file into a Java/Obj. C class that we could import and lets us reference these icons by a class name. For example:
mDonkeyFont = Donkeyfont.getTypeface();
And:
canvas.drawText(Donkeyfont.ROTATE_1, padding, padding+size, circlePaint);
That probably wouldn't be hard, and it would make our code a bit cleaner. It would also remove the danger of accidentally changing the character code for any of our icons.
float padding = this.getWidth() * 0.05f; | ||
iconPaint.setTextSize(size); | ||
|
||
if(this.checked) { |
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.
Space after if
imageView.setAlpha(255); | ||
} | ||
imageView.setBackgroundColor(Color.TRANSPARENT); | ||
} |
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.
If we're trying to copy the look of Google Photos (as per the screenshot in the Jira ticket), the images there become smaller when they're checked and have a white border.
You might want to check with Brian to make sure that's what we should be doing here too (I personally really like it), but if so, that would probably be done in place of these imageView.setAlpha()
here?
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 didn't notice the image shrinking in the screenshot. This plugin currently crashes in the play store version of Zenput if you rotate the device after pressing the OK button once you've selecting images. I say we come back to this later.
@nickzenput @davidofwatkins I didn't know there was an iOS part to this one, I'll try to review this today. |
@HalahRaadSalih No worries, this has sort of been on the back-burner anyway (thus my delay in review as well) :) |
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.
Two things here:
_ replace the use of assert with NSAssert or if statement.
- Replace all your numbers with constants as usual
Getting this to run required updates zencam and imagepicker, please mention such information in future PRs.
@@ -81,12 +104,15 @@ - (void)cellTapped:(UITapGestureRecognizer *)tapRecognizer | |||
|
|||
CGRect frame = CGRectMake(startX, 2, 75, 75); | |||
|
|||
for (int i = 0; i < [_rowAssets count]; ++i) { | |||
assert([_checkIconArray count] == [_circleIconArray count]); |
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.
Asset crashes the app when it fails, we certainly don't want that behavior. either use NSAssert so you can include a nice exception message or use an if statement. 🌮 here
UIImageView *overlayView = [_overlayViewArray objectAtIndex:i]; | ||
overlayView.hidden = asset.selected ? NO : YES; | ||
|
||
assert([_checkIconArray count] == [_circleIconArray count]); |
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.
Same as bellow.
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.
Looks good to me!
This is LGTM1 from me. (there is no labels for this) |
See cordova-plugin-donkeyfont, branch donkeyfont_classes
@davidofwatkins is this good to go? |
@HalahRaadSalih Almost! @nickzenput's just cleaning up the cordova-plugin-donkeyfont update that #3 requires and then it should be good to go 🌮 |
Reference Donkeyfont Icons By Name
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.
Looks good to me. Once this passes the final round of UAT, we can merge and tag.
See associated PR in main Zenput repo: https://github.com/zenput/zenput/pull/1939