Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e460722
Fire cancel event from ios
ArcadeMode Jun 26, 2018
bc4929d
small fix
ArcadeMode Jun 26, 2018
4e2863f
sometimes cancel would still not send an event
ArcadeMode Jun 29, 2018
318dfcf
Add Japanese Language Support.
hayashizaki-masayuki Aug 30, 2018
69f6ec3
bump
EddyVerbruggen Jan 18, 2019
b72c376
Merge pull request #128 from ArcadeMode/master
EddyVerbruggen Feb 18, 2019
fee1ef3
bump
EddyVerbruggen Feb 18, 2019
dc70f4e
Merge pull request #138 from sakaitaka/add_japanese_language_support
EddyVerbruggen Feb 18, 2019
ffbbb7b
Added missing spanish translations(#146) and adjusted discard/ok butt…
hyeritsyan Mar 5, 2019
d44098d
Fix android TransactionTooLargeException
hkjeffchan Mar 11, 2019
2d9ed07
add ResultIPC.java to plugin.xml
hkjeffchan Mar 20, 2019
c34e17b
Merge pull request #150 from hkjeffchan/master
EddyVerbruggen Mar 21, 2019
a53f9b5
bump
EddyVerbruggen Mar 21, 2019
957c0df
Merge pull request #149 from okode/translations-spanish
EddyVerbruggen Mar 26, 2019
490d90b
bump
EddyVerbruggen Mar 26, 2019
6a40fc9
Fix typos in the German translation
uaza Mar 27, 2019
9f41af3
Merge pull request #153 from uaza/master
EddyVerbruggen Mar 27, 2019
4a8e6f6
bump
EddyVerbruggen Mar 27, 2019
e26ca86
Fix - https://github.com/Telerik-Verified-Plugins/ImagePicker/issues/95
anujraghuvanshi Apr 29, 2019
6c52270
Fix- https://github.com/Telerik-Verified-Plugins/ImagePicker/issues/95
anujraghuvanshi Apr 29, 2019
ce7ce9d
Fix - https://github.com/Telerik-Verified-Plugins/ImagePicker/issues/143
anujraghuvanshi Apr 29, 2019
16244b5
Merge pull request #155 from Anuj-Raghuvanshi/master
anujraghuvanshi Apr 30, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.2.2",
"version": "2.3.2",
"name": "cordova-plugin-telerik-imagepicker",
"cordova_name": "ImagePicker",
"description": "This plugin allows selection of multiple images from the camera roll / gallery in a phonegap app",
Expand Down
3 changes: 2 additions & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-telerik-imagepicker"
version="2.2.2">
version="2.3.2">

<name>ImagePicker</name>

Expand Down Expand Up @@ -111,6 +111,7 @@

<source-file src="src/android/com/synconset/ImagePicker/ImagePicker.java" target-dir="src/com/synconset" />
<source-file src="src/android/com/synconset/ImagePicker/FakeR.java" target-dir="src/com/synconset" />
<source-file src="src/android/com/synconset/ImagePicker/ResultIPC.java" target-dir="src/com/synconset" />

<source-file src="src/android/Library/src/ImageFetcher.java" target-dir="src/com/synconset"/>
<source-file src="src/android/Library/src/MultiImageChooserActivity.java" target-dir="src/com/synconset"/>
Expand Down
8 changes: 4 additions & 4 deletions src/android/Library/res/layout/actionbar_discard_button.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
android:drawableStart="@drawable/ic_action_discard_light"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
Expand Down
8 changes: 4 additions & 4 deletions src/android/Library/res/layout/actionbar_done_button.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
android:drawableStart="@drawable/ic_action_done_light"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<resources>
<string name="multi_app_name">MultiImageChooser</string>
<string name="free_version_label">Freie Version - Nur noch %d Bilder können ausgewählt werden</string>
<string name="error_database">Beim öffnen der Bilder-Datenbank ist ein Fehler augetreten. Bitte melden Sie dieses Problem.</string>
<string name="error_database">Beim Öffnen der Bilder-Datenbank ist ein Fehler augetreten. Bitte melden Sie dieses Problem.</string>
<string name="requesting_thumbnails">Vorschaubilder werden geladen, bitte haben Sie etwas Geduld</string>
<string name="multi_image_picker_processing_images_title">Bilder werden verarbeitet</string>
<string name="multi_image_picker_processing_images_message">Dies kann einen Momenent dauern</string>
<string name="multi_image_picker_processing_images_message">Dies kann einen Moment dauern</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
<string name="requesting_thumbnails">Solicitando miniaturas. Por favor, espere…</string>
<string name="free_version_label">Versión gratuita - Imágenes restantes: %d</string>
<string name="error_database">Error al abrir la base de datos de imágenes.</string>
<string name="multi_image_picker_processing_images_title">Procesando imágenes</string>
<string name="multi_image_picker_processing_images_message">Esto puede tomar un momento</string>
<string name="discard">Cancelar</string>
<string name="done">OK</string>
</resources>
3 changes: 2 additions & 1 deletion src/android/Library/src/MultiImageChooserActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,8 @@ protected void onPostExecute(ArrayList<String> al) {
res.putInt("TOTALFILES", imagecursor.getCount());
}

data.putExtras(res);
int sync = ResultIPC.get().setLargeData(res);
data.putExtra("bigdata:synccode", sync);
setResult(RESULT_OK, data);

} else {
Expand Down
6 changes: 5 additions & 1 deletion src/android/com/synconset/ImagePicker/ImagePicker.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ private void requestReadPermission() {

public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == Activity.RESULT_OK && data != null) {
ArrayList<String> fileNames = data.getStringArrayListExtra("MULTIPLEFILENAMES");
int sync = data.getIntExtra("bigdata:synccode", -1);
final Bundle bigData = ResultIPC.get().getLargeData(sync);

ArrayList<String> fileNames = bigData.getStringArrayList("MULTIPLEFILENAMES");

JSONArray res = new JSONArray(fileNames);
callbackContext.success(res);

Expand Down
27 changes: 27 additions & 0 deletions src/android/com/synconset/ImagePicker/ResultIPC.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.synconset;

import android.os.Bundle;

public class ResultIPC {

private static ResultIPC instance;

public synchronized static ResultIPC get() {
if (instance == null) {
instance = new ResultIPC ();
}
return instance;
}

private int sync = 0;

private Bundle largeData;
public int setLargeData(Bundle largeData) {
this.largeData = largeData;
return ++sync;
}

public Bundle getLargeData(int request) {
return (request == sync) ? largeData : null;
}
}
45 changes: 31 additions & 14 deletions src/ios/GMImagePicker/GMAlbumsViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
//self.textLabel.backgroundColor = self.backgroundColor;
//self.detailTextLabel.backgroundColor = self.backgroundColor;

self.titleLabel.backgroundColor = self.backgroundColor;
self.infoLabel.backgroundColor = self.backgroundColor;

self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

//Border width of 1 pixel:
Expand Down Expand Up @@ -97,39 +100,53 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus


//TextLabel
self.textLabel.font = [UIFont fontWithName:@"Helvetica" size:17.0];
self.textLabel.numberOfLines = 1;
self.textLabel.translatesAutoresizingMaskIntoConstraints = NO;
// self.textLabel.font = [UIFont fontWithName:@"Helvetica" size:17.0];
// self.textLabel.numberOfLines = 1;
// self.textLabel.translatesAutoresizingMaskIntoConstraints = NO;

self.titleLabel = [UILabel new];
self.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:17.0];
self.titleLabel.numberOfLines = 1;
self.titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
self.titleLabel.adjustsFontSizeToFitWidth = YES;
[self.contentView addSubview:self.titleLabel];

// self.detailTextLabel.font = [UIFont fontWithName:@"Helvetica" size:14.0];
// self.detailTextLabel.numberOfLines = 1;
// self.detailTextLabel.translatesAutoresizingMaskIntoConstraints = NO;

self.detailTextLabel.font = [UIFont fontWithName:@"Helvetica" size:14.0];
self.detailTextLabel.numberOfLines = 1;
self.detailTextLabel.translatesAutoresizingMaskIntoConstraints = NO;
self.infoLabel = [UILabel new];
self.infoLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:14.0];
self.infoLabel.numberOfLines = 1;
self.infoLabel.translatesAutoresizingMaskIntoConstraints = NO;
self.infoLabel.adjustsFontSizeToFitWidth = YES;
[self.contentView addSubview:self.infoLabel];

//Set next text labels contraints :
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[imageView1]-(offset)-[textLabel]-|"
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[imageView1]-(offset)-[titleLabel]-|"
options:0
metrics:@{@"offset": @(kAlbumImageToTextSpace)}
views:@{@"textLabel": self.textLabel,
views:@{@"titleLabel": self.titleLabel,
@"imageView1": self.imageView1}]];

[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[imageView1]-(offset)-[detailTextLabel]-|"
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[imageView1]-(offset)-[infoLabel]-|"
options:0
metrics:@{@"offset": @(kAlbumImageToTextSpace)}
views:@{@"detailTextLabel": self.detailTextLabel,
views:@{@"infoLabel": self.infoLabel,
@"imageView1": self.imageView1}]];


[self.contentView addConstraints:@[[NSLayoutConstraint constraintWithItem:self.textLabel
[self.contentView addConstraints:@[[NSLayoutConstraint constraintWithItem:self.titleLabel
attribute:NSLayoutAttributeBottom
relatedBy:NSLayoutRelationEqual
toItem:self.textLabel.superview
toItem:self.titleLabel.superview
attribute:NSLayoutAttributeCenterY
multiplier:1.f constant:0.f]]];

[self.contentView addConstraints:@[[NSLayoutConstraint constraintWithItem:self.detailTextLabel
[self.contentView addConstraints:@[[NSLayoutConstraint constraintWithItem:self.infoLabel
attribute:NSLayoutAttributeTop
relatedBy:NSLayoutRelationEqual
toItem:self.textLabel.superview
toItem:self.titleLabel.superview
attribute:NSLayoutAttributeCenterY
multiplier:1.f constant:+4.f]]];
}
Expand Down
10 changes: 5 additions & 5 deletions src/ios/GMImagePicker/GMAlbumsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,15 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell.tag = currentTag;

//Set the label
cell.textLabel.text = (self.collectionsFetchResultsTitles[indexPath.section])[indexPath.row];
cell.titleLabel.text = (self.collectionsFetchResultsTitles[indexPath.section])[indexPath.row];

//Retrieve the pre-fetched assets for this album:
PHFetchResult *assetsFetchResult = (self.collectionsFetchResultsAssets[indexPath.section])[indexPath.row];

//Display the number of assets
if(self.picker.displayAlbumsNumberOfAssets)
{
cell.detailTextLabel.text = [self tableCellSubtitle:assetsFetchResult];
cell.infoLabel.text = [self tableCellSubtitle:assetsFetchResult];
}

//Set the 3 images (if exists):
Expand Down Expand Up @@ -353,12 +353,12 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
GMAlbumsViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];

//Init the GMGridViewController
GMGridViewController *gridViewController = [[GMGridViewController alloc] initWithPicker:[self picker]];
//Set the title
gridViewController.title = cell.textLabel.text;
gridViewController.title = cell.titleLabel.text;
//Use the prefetched assets!
gridViewController.assetsFetchResults = [[_collectionsFetchResultsAssets objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
gridViewController.dic_asset_fetches = dic_asset_fetches;
Expand Down Expand Up @@ -442,4 +442,4 @@ - (NSString *)tableCellSubtitle:(PHFetchResult*)assetsFetchResult



@end
@end
6 changes: 3 additions & 3 deletions src/ios/GMImagePicker/GMGridViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ - (id)initWithFrame:(CGRect)frame
_imageView.contentMode = UIViewContentModeScaleAspectFill;
}*/
_imageView.clipsToBounds = YES;
_imageView.translatesAutoresizingMaskIntoConstraints = NO;
_imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
//_imageView.translatesAutoresizingMaskIntoConstraints = NO;
//_imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
[self addSubview:_imageView];


Expand Down Expand Up @@ -214,4 +214,4 @@ -(NSString*)getDurationWithFormat:(NSTimeInterval)duration
return [NSString stringWithFormat:@"%02ld:%02ld", (long)minutes, (long)seconds];
}

@end
@end
Binary file not shown.
13 changes: 11 additions & 2 deletions src/ios/SOSPicker.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ - (void)imagePickerController:(UIImagePickerController *)picker didFinishPicking

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
{
[picker.presentingViewController dismissViewControllerAnimated:YES completion:nil];
CDVPluginResult* pluginResult = nil;
NSArray* emptyArray = [NSArray array];
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:emptyArray];
[self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
[self.viewController dismissViewControllerAnimated:YES completion:nil];
NSLog(@"UIImagePickerController: User pressed cancel button");
}

Expand Down Expand Up @@ -248,7 +252,12 @@ - (void)assetsPickerController:(GMImagePickerController *)picker didFinishPickin
//Optional implementation:
-(void)assetsPickerControllerDidCancel:(GMImagePickerController *)picker
{
NSLog(@"GMImagePicker: User pressed cancel button");
CDVPluginResult* pluginResult = nil;
NSArray* emptyArray = [NSArray array];
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:emptyArray];
[self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
[picker.presentingViewController dismissViewControllerAnimated:YES completion:nil];
NSLog(@"GMImagePicker: User pressed cancel button");
}


Expand Down