Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-129
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-129
2021-129
Commits
9c1ffa66
Commit
9c1ffa66
authored
Nov 23, 2021
by
dilshan-98
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integrated
parent
a3ea3bd0
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
393 additions
and
64 deletions
+393
-64
.idea/misc.xml
.idea/misc.xml
+1
-1
app/src/main/AndroidManifest.xml
app/src/main/AndroidManifest.xml
+1
-0
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/BackgroundCustomization.java
...tphotoeditor/ImageProcessing/BackgroundCustomization.java
+26
-21
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/Backgroundupload.java
...pp/smartphotoeditor/ImageProcessing/Backgroundupload.java
+4
-4
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/Blur.java
...n/java/com/app/smartphotoeditor/ImageProcessing/Blur.java
+5
-5
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/Bokeh.java
.../java/com/app/smartphotoeditor/ImageProcessing/Bokeh.java
+4
-3
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/Constants.java
...a/com/app/smartphotoeditor/ImageProcessing/Constants.java
+1
-1
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/Cut.java
...in/java/com/app/smartphotoeditor/ImageProcessing/Cut.java
+4
-4
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/MedBlur.java
...ava/com/app/smartphotoeditor/ImageProcessing/MedBlur.java
+4
-3
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/RetrofitClient.java
.../app/smartphotoeditor/ImageProcessing/RetrofitClient.java
+1
-1
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/Selectedit.java
.../com/app/smartphotoeditor/ImageProcessing/Selectedit.java
+4
-5
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/Splashedit.java
.../com/app/smartphotoeditor/ImageProcessing/Splashedit.java
+4
-4
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/Vignette.java
...va/com/app/smartphotoeditor/ImageProcessing/Vignette.java
+4
-3
app/src/main/java/com/app/smartphotoeditor/activities/EditorActivity.java
...a/com/app/smartphotoeditor/activities/EditorActivity.java
+330
-9
No files found.
.idea/misc.xml
View file @
9c1ffa66
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1
_8"
default=
"tru
e"
project-jdk-name=
"1.8"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1
1"
default=
"fals
e"
project-jdk-name=
"1.8"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
<component
name=
"ProjectType"
>
...
...
app/src/main/AndroidManifest.xml
View file @
9c1ffa66
...
...
@@ -69,6 +69,7 @@
<activity
android:name=
".ImageProcessing.MedBlur"
/>
<activity
android:name=
".ImageProcessing.BackgroundCustomization"
/>
<activity
android:name=
".ImageProcessing.Bokeh"
/>
<activity
android:name=
".ImageProcessing.Vignette"
/>
<meta-data
...
...
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/BackgroundCustomization.java
View file @
9c1ffa66
...
...
@@ -31,6 +31,7 @@ import java.io.ByteArrayOutputStream;
import
java.io.File
;
import
java.util.concurrent.TimeUnit
;
import
okhttp3.FormBody
;
import
okhttp3.MediaType
;
import
okhttp3.MultipartBody
;
import
okhttp3.OkHttpClient
;
...
...
@@ -42,7 +43,9 @@ public class BackgroundCustomization extends AppCompatActivity
private
Button
btnedit
,
btnselectimage
;
private
static
final
String
UPLOAD_IMAGE_URL
=
"http://10.0.2.2:5000/upload"
;
//private static final String UPLOAD_IMAGE_URL = "http://10.0.2.2:5000/upload";
private
static
final
String
UPLOAD_IMAGE_URL
=
"http://2989-112-134-170-172.ngrok.io/upload"
;
ImageView
image
;
String
f_path
,
filePath
,
fileExtn
;
String
f_extension
;
...
...
@@ -67,7 +70,7 @@ public class BackgroundCustomization extends AppCompatActivity
btnedit
=
(
Button
)
findViewById
(
R
.
id
.
btnedit
);
image
=
findViewById
(
R
.
id
.
img
);
displayFileChoose
();
//
displayFileChoose();
...
...
@@ -78,12 +81,12 @@ public class BackgroundCustomization extends AppCompatActivity
{
@Override
public
void
onClick
(
View
v
)
{
if
(
filePath
==
null
)
{
Toast
.
makeText
(
BackgroundCustomization
.
this
,
"Select An Image"
,
Toast
.
LENGTH_LONG
).
show
();
}
else
{
// if(filePath==null)
// {
//Toast.makeText(BackgroundCustomization.this,"Select An Image", Toast.LENGTH_LONG).show();
//}else{
//****
progress
=
new
ProgressDialog
(
BackgroundCustomization
.
this
);
progress
.
setTitle
(
"Uploading"
);
progress
.
setMessage
(
"Please Wait..."
);
...
...
@@ -94,11 +97,13 @@ public class BackgroundCustomization extends AppCompatActivity
f_path
=
filePath
;
f_extension
=
fileExtn
;
try
{
if
(
fileExtn
.
equals
(
"img"
)
||
fileExtn
.
equals
(
"jpg"
)
||
fileExtn
.
equals
(
"jpeg"
)
||
fileExtn
.
equals
(
"gif"
)
||
fileExtn
.
equals
(
"png"
))
{
//
if(fileExtn.equals("img") || fileExtn.equals("jpg") || fileExtn.equals("jpeg") || fileExtn.equals("gif") || fileExtn.equals("png")) {
Toast
.
makeText
(
BackgroundCustomization
.
this
,
filePath
,
Toast
.
LENGTH_SHORT
).
show
();
//
Toast.makeText(BackgroundCustomization.this, filePath, Toast.LENGTH_SHORT).show();
Thread
t
=
new
Thread
(
new
Runnable
()
{
...
...
@@ -108,20 +113,20 @@ public class BackgroundCustomization extends AppCompatActivity
//To upload the image to server
String
input
=
convert
(
ImageList
.
getInstance
().
getCurrentBitmap
());
System
.
out
.
println
(
input
);
File
file
=
new
File
(
f_path
);
String
content_type
=
MimeTypeMap
.
getSingleton
().
getMimeTypeFromExtension
(
f_extension
);
//
File file = new File(f_path);
//
String content_type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(f_extension);
OkHttpClient
okHttpClient
=
new
OkHttpClient
().
newBuilder
()
.
connectTimeout
(
320
,
TimeUnit
.
SECONDS
)
.
readTimeout
(
320
,
TimeUnit
.
SECONDS
)
.
writeTimeout
(
320
,
TimeUnit
.
SECONDS
)
.
build
();
RequestBody
file_body
=
RequestBody
.
create
(
MediaType
.
parse
(
content_type
),
file
);
//RequestBody file_body = RequestBody.create(MediaType.parse(content_type), file);
RequestBody
request_body
=
new
FormBody
.
Builder
()
RequestBody
request_body
=
new
MultipartBody
.
Builder
()
.
setType
(
MultipartBody
.
FORM
)
.
addFormDataPart
(
"type"
,
content_type
)
.
addFormDataPart
(
"image"
,
f_path
.
substring
(
f_path
.
lastIndexOf
(
"/"
)
+
1
),
file_body
)
.
add
(
"image"
,
input
)
//.addFormDataPart("image", f_path.substring(f_path.lastIndexOf("/") +1), file_body)
.
build
();
Request
request
=
new
Request
.
Builder
()
...
...
@@ -145,14 +150,14 @@ public class BackgroundCustomization extends AppCompatActivity
}
});
t
.
start
();
}
else
{
}
//
}else
//
{
//
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
//******
//
}
}
});
...
...
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/Backgroundupload.java
View file @
9c1ffa66
...
...
@@ -38,7 +38,7 @@ public class Backgroundupload extends AppCompatActivity {
private
Button
btncutprocess
,
btnselectimage
;
ImageView
image
;
private
static
final
String
UPLOAD_IMAGE_URL
=
"http://
10.0.2.2:5000/upload
"
;
private
static
final
String
UPLOAD_IMAGE_URL
=
"http://
727a-112-134-169-152.ngrok.io/uploadbg
"
;
String
f_path
,
filePath
,
fileExtn
;
String
f_extension
;
ProgressDialog
progress
;
...
...
@@ -136,11 +136,11 @@ public class Backgroundupload extends AppCompatActivity {
public
void
onResponse
(
Call
<
ResponseBody
>
call
,
retrofit2
.
Response
<
ResponseBody
>
response
)
{
try
{
String
s
=
response
.
body
().
string
();
Toast
.
makeText
(
Backgroundupload
.
this
,
s
,
Toast
.
LENGTH_LONG
).
show
();
//
String s = response.body().string();
//
Toast.makeText(Backgroundupload.this, s, Toast.LENGTH_LONG).show();
progress
.
dismiss
();
openCutActivity
();
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/Blur.java
View file @
9c1ffa66
...
...
@@ -9,6 +9,7 @@ import android.widget.Button;
import
android.widget.ImageView
;
import
com.app.smartphotoeditor.R
;
import
com.app.smartphotoeditor.activities.EditorActivity
;
import
com.squareup.picasso.MemoryPolicy
;
import
com.squareup.picasso.NetworkPolicy
;
import
com.squareup.picasso.Picasso
;
...
...
@@ -33,20 +34,19 @@ public class Blur extends AppCompatActivity {
.
networkPolicy
(
NetworkPolicy
.
NO_CACHE
)
.
memoryPolicy
(
MemoryPolicy
.
NO_CACHE
)
.
resize
(
300
,
300
)
.
into
(
imgView
);
.
into
(
imgView
);
//
btnBack
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
open
SelecteditAc
tivity
();
open
EditorAci
tivity
();
}
});
}
public
void
openSelecteditActivity
()
{
Intent
intent
=
new
Intent
(
this
,
Selectedit
.
class
);
public
void
openEditorAcitivity
()
{
Intent
intent
=
new
Intent
(
this
,
EditorActivity
.
class
);
startActivity
(
intent
);
}
}
\ No newline at end of file
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/Bokeh.java
View file @
9c1ffa66
...
...
@@ -9,6 +9,7 @@ import android.widget.ImageView;
import
androidx.appcompat.app.AppCompatActivity
;
import
com.app.smartphotoeditor.R
;
import
com.app.smartphotoeditor.activities.EditorActivity
;
import
com.squareup.picasso.MemoryPolicy
;
import
com.squareup.picasso.NetworkPolicy
;
import
com.squareup.picasso.Picasso
;
...
...
@@ -38,13 +39,13 @@ public class Bokeh extends AppCompatActivity {
btnBack
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
open
Selectedit
Acitivity
();
open
Editor
Acitivity
();
}
});
}
public
void
open
Selectedit
Acitivity
()
{
Intent
intent
=
new
Intent
(
this
,
Selectedit
.
class
);
public
void
open
Editor
Acitivity
()
{
Intent
intent
=
new
Intent
(
this
,
EditorActivity
.
class
);
startActivity
(
intent
);
}
...
...
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/Constants.java
View file @
9c1ffa66
...
...
@@ -3,6 +3,6 @@ package com.app.smartphotoeditor.ImageProcessing;
public
class
Constants
{
// This should be replaced with the server link when server starts running
public
static
final
String
IMGLINK
=
"
4e11-112-134-169-3
2"
;
public
static
final
String
IMGLINK
=
"
727a-112-134-169-15
2"
;
}
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/Cut.java
View file @
9c1ffa66
...
...
@@ -9,6 +9,7 @@ import android.widget.ImageView;
import
androidx.appcompat.app.AppCompatActivity
;
import
com.app.smartphotoeditor.R
;
import
com.app.smartphotoeditor.activities.EditorActivity
;
import
com.squareup.picasso.MemoryPolicy
;
import
com.squareup.picasso.NetworkPolicy
;
import
com.squareup.picasso.Picasso
;
...
...
@@ -38,14 +39,13 @@ public class Cut extends AppCompatActivity {
btnBack
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
open
SelecteditAc
tivity
();
open
EditorAci
tivity
();
}
});
}
public
void
openSelecteditActivity
()
{
Intent
intent
=
new
Intent
(
this
,
Selectedit
.
class
);
public
void
openEditorAcitivity
()
{
Intent
intent
=
new
Intent
(
this
,
EditorActivity
.
class
);
startActivity
(
intent
);
}
}
\ No newline at end of file
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/MedBlur.java
View file @
9c1ffa66
...
...
@@ -9,6 +9,7 @@ import android.widget.ImageView;
import
androidx.appcompat.app.AppCompatActivity
;
import
com.app.smartphotoeditor.R
;
import
com.app.smartphotoeditor.activities.EditorActivity
;
import
com.squareup.picasso.MemoryPolicy
;
import
com.squareup.picasso.NetworkPolicy
;
import
com.squareup.picasso.Picasso
;
...
...
@@ -38,13 +39,13 @@ public class MedBlur extends AppCompatActivity {
btnBack
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
open
Selectedit
Acitivity
();
open
Editor
Acitivity
();
}
});
}
public
void
open
Selectedit
Acitivity
()
{
Intent
intent
=
new
Intent
(
this
,
Selectedit
.
class
);
public
void
open
Editor
Acitivity
()
{
Intent
intent
=
new
Intent
(
this
,
EditorActivity
.
class
);
startActivity
(
intent
);
}
}
\ No newline at end of file
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/RetrofitClient.java
View file @
9c1ffa66
...
...
@@ -9,7 +9,7 @@ import retrofit2.converter.gson.GsonConverterFactory;
public
class
RetrofitClient
{
// private static final String baseurl="http://10.0.2.15:5000";
private
static
final
String
baseurl
=
"http://
4e11-112-134-169-3
2.ngrok.io"
;
private
static
final
String
baseurl
=
"http://
727a-112-134-169-15
2.ngrok.io"
;
private
static
RetrofitClient
mInstance
;
private
Retrofit
retrofit
;
...
...
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/Selectedit.java
View file @
9c1ffa66
...
...
@@ -44,7 +44,7 @@ public class Selectedit extends AppCompatActivity {
Picasso
.
get
()
.
load
(
"https:///"
+
Constants
.
IMGLINK
+
".ngrok.io/static/
masked
.jpg"
)
.
load
(
"https:///"
+
Constants
.
IMGLINK
+
".ngrok.io/static/
theimage
.jpg"
)
.
placeholder
(
R
.
drawable
.
progress_bar_material
)
.
resize
(
300
,
300
)
.
networkPolicy
(
NetworkPolicy
.
NO_CACHE
)
...
...
@@ -82,7 +82,6 @@ public class Selectedit extends AppCompatActivity {
try
{
String
s
=
response
.
body
().
string
();
Toast
.
makeText
(
Selectedit
.
this
,
s
,
Toast
.
LENGTH_LONG
).
show
();
progress
.
dismiss
();
openBlurActivity
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
...
...
@@ -126,11 +125,11 @@ public class Selectedit extends AppCompatActivity {
@Override
public
void
onResponse
(
Call
<
ResponseBody
>
call
,
Response
<
ResponseBody
>
response
)
{
try
{
String
s
=
response
.
body
().
string
();
Toast
.
makeText
(
Selectedit
.
this
,
s
,
Toast
.
LENGTH_LONG
).
show
();
//
String s = response.body().string();
//
Toast.makeText(Selectedit.this, s, Toast.LENGTH_LONG).show();
progress
.
dismiss
();
openBokehActivity
();
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
...
...
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/Splashedit.java
View file @
9c1ffa66
...
...
@@ -9,6 +9,7 @@ import android.widget.Button;
import
android.widget.ImageView
;
import
com.app.smartphotoeditor.R
;
import
com.app.smartphotoeditor.activities.EditorActivity
;
import
com.squareup.picasso.MemoryPolicy
;
import
com.squareup.picasso.NetworkPolicy
;
import
com.squareup.picasso.Picasso
;
...
...
@@ -41,14 +42,13 @@ public class Splashedit extends AppCompatActivity {
@Override
public
void
onClick
(
View
v
)
{
open
SelecteditAc
tivity
();
open
EditorAci
tivity
();
}
});
}
public
void
openSelecteditActivity
()
{
Intent
intent
=
new
Intent
(
this
,
Selectedit
.
class
);
public
void
openEditorAcitivity
()
{
Intent
intent
=
new
Intent
(
this
,
EditorActivity
.
class
);
startActivity
(
intent
);
}
}
\ No newline at end of file
app/src/main/java/com/app/smartphotoeditor/ImageProcessing/Vignette.java
View file @
9c1ffa66
...
...
@@ -9,6 +9,7 @@ import android.widget.ImageView;
import
androidx.appcompat.app.AppCompatActivity
;
import
com.app.smartphotoeditor.R
;
import
com.app.smartphotoeditor.activities.EditorActivity
;
import
com.squareup.picasso.MemoryPolicy
;
import
com.squareup.picasso.NetworkPolicy
;
import
com.squareup.picasso.Picasso
;
...
...
@@ -38,13 +39,13 @@ public class Vignette extends AppCompatActivity {
btnBack
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
open
Selectedit
Acitivity
();
open
Editor
Acitivity
();
}
});
}
public
void
open
Selectedit
Acitivity
()
{
Intent
intent
=
new
Intent
(
this
,
Selectedit
.
class
);
public
void
open
Editor
Acitivity
()
{
Intent
intent
=
new
Intent
(
this
,
EditorActivity
.
class
);
startActivity
(
intent
);
}
}
\ No newline at end of file
app/src/main/java/com/app/smartphotoeditor/activities/EditorActivity.java
View file @
9c1ffa66
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment