Skip to content
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

Merged
merged 19 commits into from
Aug 14, 2017

Conversation

nickzenput
Copy link

@nickzenput nickzenput commented May 23, 2017

See associated PR in main Zenput repo: https://github.com/zenput/zenput/pull/1939

Copy link

@davidofwatkins davidofwatkins left a 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" />

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";

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);

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) {

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);
}

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.

screenshot_20170517-161856

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?

Copy link
Author

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.

@HalahRaadSalih HalahRaadSalih changed the title Android gallery ui mobile 449 Android and iOS Gallery ui mobile 449 Jun 19, 2017
@HalahRaadSalih
Copy link

@nickzenput @davidofwatkins I didn't know there was an iOS part to this one, I'll try to review this today.

@davidofwatkins
Copy link

@HalahRaadSalih No worries, this has sort of been on the back-burner anyway (thus my delay in review as well) :)

Copy link

@HalahRaadSalih HalahRaadSalih left a 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]);

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]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as bellow.

Copy link

@HalahRaadSalih HalahRaadSalih left a 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!

@HalahRaadSalih
Copy link

HalahRaadSalih commented Jul 13, 2017

This is LGTM1 from me. (there is no labels for this)

See cordova-plugin-donkeyfont, branch donkeyfont_classes
@HalahRaadSalih
Copy link

@davidofwatkins is this good to go?

@davidofwatkins
Copy link

@HalahRaadSalih Almost! @nickzenput's just cleaning up the cordova-plugin-donkeyfont update that #3 requires and then it should be good to go 🌮

davidofwatkins and others added 2 commits July 17, 2017 19:30
Copy link

@davidofwatkins davidofwatkins left a 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.

@davidofwatkins davidofwatkins merged commit 21d1017 into master Aug 14, 2017
@davidofwatkins davidofwatkins deleted the android-gallery_ui_MOBILE-449 branch August 14, 2017 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants