@ -268,11 +268,11 @@ public class UploadActivity extends BaseActivity {
shouldReturn = true ;
shouldReturn = true ;
}
}
if ( filesList . isEmpty ( ) ) {
if ( filesList . isEmpty ( ) ) {
Toast . makeText ( view . getContext ( ) , "Please choose a file to upload or take a photo" , Toast . LENGTH_LONG ) . show ( ) ;
Toast . makeText ( BaseApplication . getInstance ( ) . getApplication Context ( ) , "Please choose a file to upload or take a photo" , Toast . LENGTH_LONG ) . show ( ) ;
shouldReturn = true ;
shouldReturn = true ;
}
}
if ( categorySelected . equals ( "-1" ) ) {
if ( categorySelected . equals ( "-1" ) ) {
Toast . makeText ( view . getContext ( ) , "Please choose category first" , Toast . LENGTH_SHORT ) . show ( ) ;
Toast . makeText ( BaseApplication . getInstance ( ) . getApplication Context ( ) , "Please choose category first" , Toast . LENGTH_SHORT ) . show ( ) ;
shouldReturn = true ;
shouldReturn = true ;
}
}
if ( ! filesList . isEmpty ( ) ) {
if ( ! filesList . isEmpty ( ) ) {
@ -282,7 +282,7 @@ public class UploadActivity extends BaseActivity {
}
}
if ( totalFilesSize > MAX_FILE_SIZE_SUPPORTED ) {
if ( totalFilesSize > MAX_FILE_SIZE_SUPPORTED ) {
Toast . makeText ( view . getContext ( ) , "Your files are too powerful for thmmy. Reduce size or split!" , Toast . LENGTH_LONG ) . show ( ) ;
Toast . makeText ( BaseApplication . getInstance ( ) . getApplication Context ( ) , "Your files are too powerful for thmmy. Reduce size or split!" , Toast . LENGTH_LONG ) . show ( ) ;
shouldReturn = true ;
shouldReturn = true ;
}
}
}
}
@ -338,7 +338,7 @@ public class UploadActivity extends BaseActivity {
if ( ! storage . rename ( uploadFile . getPhotoFile ( ) . getAbsolutePath ( ) , destinationFilename ) ) {
if ( ! storage . rename ( uploadFile . getPhotoFile ( ) . getAbsolutePath ( ) , destinationFilename ) ) {
//Something went wrong, abort
//Something went wrong, abort
Toast . makeText ( this , "Could not create temporary file for renaming" , Toast . LENGTH_SHORT ) . show ( ) ;
Toast . makeText ( BaseApplication . getInstance ( ) . getApplicationContext ( ) , "Could not create temporary file for renaming" , Toast . LENGTH_SHORT ) . show ( ) ;
progressBar . setVisibility ( View . GONE ) ;
progressBar . setVisibility ( View . GONE ) ;
return ;
return ;
}
}
@ -385,7 +385,7 @@ public class UploadActivity extends BaseActivity {
: tempFileUri ) ) {
: tempFileUri ) ) {
finish ( ) ;
finish ( ) ;
} else {
} else {
Toast . makeText ( this , "Couldn't initiate upload." , Toast . LENGTH_SHORT ) . show ( ) ;
Toast . makeText ( BaseApplication . getInstance ( ) . getApplicationContext ( ) , "Couldn't initiate upload." , Toast . LENGTH_SHORT ) . show ( ) ;
}
}
} ) ;
} ) ;
@ -580,7 +580,7 @@ public class UploadActivity extends BaseActivity {
zipTask . execute ( filesListArray ) ;
zipTask . execute ( filesListArray ) ;
finish ( ) ;
finish ( ) ;
} else {
} else {
Toast . makeText ( this , "Please retry uploading." , Toast . LENGTH_SHORT ) . show ( ) ;
Toast . makeText ( BaseApplication . getInstance ( ) . getApplicationContext ( ) , "Please retry uploading." , Toast . LENGTH_SHORT ) . show ( ) ;
}
}
break ;
break ;
}
}
@ -746,7 +746,7 @@ public class UploadActivity extends BaseActivity {
Timber . d ( "Uploading a file with properties: \nTitle: %s\nCategory: %s\nDescription: %s\nIcon: %s\nUploader: %s" ,
Timber . d ( "Uploading a file with properties: \nTitle: %s\nCategory: %s\nDescription: %s\nIcon: %s\nUploader: %s" ,
uploadTitleText , categorySelected , uploadDescriptionText , fileIcon , uploaderProfileIndex ) ;
uploadTitleText , categorySelected , uploadDescriptionText , fileIcon , uploaderProfileIndex ) ;
multipartUploadRequest . startUpload ( ) ;
multipartUploadRequest . startUpload ( ) ;
Toast . makeText ( context , "Uploading file(s) in the background..." , Toast . LENGTH_SHORT ) . show ( ) ;
Toast . makeText ( BaseAppli cation . getInstance ( ) . getApplicationC ontext( ) , "Uploading file(s) in the background..." , Toast . LENGTH_SHORT ) . show ( ) ;
return true ;
return true ;
} catch ( Exception exception ) {
} catch ( Exception exception ) {
Timber . e ( exception , "AndroidUploadService: %s" , exception . getMessage ( ) ) ;
Timber . e ( exception , "AndroidUploadService: %s" , exception . getMessage ( ) ) ;
@ -1041,7 +1041,7 @@ public class UploadActivity extends BaseActivity {
@Override
@Override
protected void onPreExecute ( ) {
protected void onPreExecute ( ) {
assert weakActivity ! = null ;
assert weakActivity ! = null ;
Toast . makeText ( weakActivity . get ( ) , "Zipping files" , Toast . LENGTH_SHORT ) . show ( ) ;
Toast . makeText ( BaseApplication . getInstance ( ) . getApplicationContex t ( ) , "Zipping files" , Toast . LENGTH_SHORT ) . show ( ) ;
}
}
@Override
@Override
@ -1068,7 +1068,7 @@ public class UploadActivity extends BaseActivity {
return ;
return ;
if ( ! result ) {
if ( ! result ) {
Toast . makeText ( weakActivity . get ( ) , "Couldn't create zip!" , Toast . LENGTH_SHORT ) . show ( ) ;
Toast . makeText ( BaseApplication . getInstance ( ) . getApplicationContex t ( ) , "Couldn't create zip!" , Toast . LENGTH_SHORT ) . show ( ) ;
return ;
return ;
}
}
@ -1077,7 +1077,7 @@ public class UploadActivity extends BaseActivity {
getConfigForUpload ( weakActivity . get ( ) , uploadID , zipFilename ) , categorySelected ,
getConfigForUpload ( weakActivity . get ( ) , uploadID , zipFilename ) , categorySelected ,
uploadTitleText , uploadDescriptionText , fileIcon , uploaderProfileIndex ,
uploadTitleText , uploadDescriptionText , fileIcon , uploaderProfileIndex ,
zipFileUri ) ) {
zipFileUri ) ) {
Toast . makeText ( weakActivity . get ( ) , "Couldn't initiate upload." , Toast . LENGTH_SHORT ) . show ( ) ;
Toast . makeText ( BaseApplication . getInstance ( ) . getApplicationContex t ( ) , "Couldn't initiate upload." , Toast . LENGTH_SHORT ) . show ( ) ;
}
}
}
}
}
}