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
2074db16
Commit
2074db16
authored
Oct 18, 2021
by
samesh97
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fixes.
parent
56acdc7f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
348 deletions
+40
-348
app/src/main/java/com/app/smartphotoeditor/activities/AdjustBrightness.java
...com/app/smartphotoeditor/activities/AdjustBrightness.java
+7
-66
app/src/main/java/com/app/smartphotoeditor/activities/AdjustSaturation.java
...com/app/smartphotoeditor/activities/AdjustSaturation.java
+7
-67
app/src/main/java/com/app/smartphotoeditor/activities/DenoisingActivity.java
...om/app/smartphotoeditor/activities/DenoisingActivity.java
+6
-81
app/src/main/java/com/app/smartphotoeditor/activities/EditorActivity.java
...a/com/app/smartphotoeditor/activities/EditorActivity.java
+8
-2
app/src/main/java/com/app/smartphotoeditor/activities/LowLightEnhanceActivity.java
.../smartphotoeditor/activities/LowLightEnhanceActivity.java
+6
-66
app/src/main/java/com/app/smartphotoeditor/activities/RestorationActivity.java
.../app/smartphotoeditor/activities/RestorationActivity.java
+6
-66
No files found.
app/src/main/java/com/app/smartphotoeditor/activities/AdjustBrightness.java
View file @
2074db16
...
...
@@ -49,6 +49,7 @@ public class AdjustBrightness extends AppCompatActivity
private
SpeechService
speechService
;
@Override
protected
void
onResume
()
{
super
.
onResume
();
...
...
@@ -74,7 +75,7 @@ public class AdjustBrightness extends AppCompatActivity
setContentView
(
R
.
layout
.
activity_adjust_brightness
);
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
back
));
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
s
ave
));
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
s
elect_btn
));
computerVision
=
new
ComputerVision
(
this
,
this
,
this
);
...
...
@@ -163,17 +164,10 @@ public class AdjustBrightness extends AppCompatActivity
}
void
findViewPoint
(
int
x
,
int
y
)
{
//if(!isPossible) return;
ImageView
b
=
findViewById
(
R
.
id
.
cursor
);
ImageView
cursor
=
findViewById
(
R
.
id
.
cursor
);
int
viewMaxX
=
0
;
int
viewMinX
=
0
;
int
viewMaxY
=
0
;
int
viewMinY
=
0
;
...
...
@@ -206,23 +200,6 @@ public class AdjustBrightness extends AppCompatActivity
}
//
// b.animate().x(x);
// b.animate().y(y);
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
...
...
@@ -231,16 +208,6 @@ public class AdjustBrightness extends AppCompatActivity
int
viewX
=
location
[
0
];
int
viewY
=
location
[
1
];
// if(viewX >= viewMaxX)
// {
// viewMaxX = viewX;
// }
// if(viewY >= viewMaxY)
// {
// viewMaxY = viewY;
// }
Log
.
d
(
"aaaaaaaaaaaa"
,
"View="
+
view
.
getId
()
+
"X="
+
viewX
+
", Y="
+
viewY
);
int
viewMaxWidth
=
viewX
+
view
.
getWidth
();
int
viewMinWidth
=
viewX
-
view
.
getWidth
();
...
...
@@ -248,40 +215,14 @@ public class AdjustBrightness extends AppCompatActivity
int
viewMaxHeight
=
viewY
+
view
.
getHeight
();
int
viewMinHeight
=
viewY
-
view
.
getHeight
();
//b.animate().y((viewMinHeight + viewMaxHeight) / 2);
if
((
x
>=
viewMinWidth
&&
x
<=
viewMaxWidth
))
{
if
(
lastLookedView
!=
null
&&
lastLookedView
.
getId
()
==
view
.
getId
())
{
count
++;
}
else
{
count
=
0
;
}
if
(
count
>=
3
)
{
isPossible
=
false
;
checkCount
();
}
view
.
setBackgroundColor
(
Color
.
RED
);
b
.
animate
().
x
((
viewMinWidth
+
viewMaxWidth
)
/
2
);
b
.
animate
().
y
((
viewMinHeight
+
viewMaxHeight
)
/
2
);
Log
.
d
(
"bbbbb"
,
"Came here"
);
lastLookedView
=
view
;
cursor
.
animate
().
x
((
viewMinWidth
+
viewMaxWidth
)
/
2
);
cursor
.
animate
().
y
((
viewMinHeight
+
viewMaxHeight
)
/
2
);
}
else
...
...
@@ -290,8 +231,8 @@ public class AdjustBrightness extends AppCompatActivity
}
}
b
.
animate
().
x
(
x
);
b
.
animate
().
y
(
y
);
cursor
.
animate
().
x
(
x
);
cursor
.
animate
().
y
(
y
);
}
private
void
checkCount
()
...
...
app/src/main/java/com/app/smartphotoeditor/activities/AdjustSaturation.java
View file @
2074db16
...
...
@@ -76,7 +76,7 @@ public class AdjustSaturation extends AppCompatActivity
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
back
));
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
s
ave
));
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
s
elect_btn
));
computerVision
=
new
ComputerVision
(
this
,
this
,
this
);
...
...
@@ -101,7 +101,7 @@ public class AdjustSaturation extends AppCompatActivity
@Override
public
void
onSeeking
(
SeekParams
seekParams
)
{
saturationLevel
=
seekBar
.
getProgress
()
/
1
0
;
saturationLevel
=
seekBar
.
getProgress
()
/
4
0
;
createImage
();
}
@Override
...
...
@@ -161,17 +161,10 @@ public class AdjustSaturation extends AppCompatActivity
}
void
findViewPoint
(
int
x
,
int
y
)
{
//if(!isPossible) return;
ImageView
b
=
findViewById
(
R
.
id
.
cursor
);
ImageView
cursor
=
findViewById
(
R
.
id
.
cursor
);
int
viewMaxX
=
0
;
int
viewMinX
=
0
;
int
viewMaxY
=
0
;
int
viewMinY
=
0
;
...
...
@@ -204,23 +197,6 @@ public class AdjustSaturation extends AppCompatActivity
}
//
// b.animate().x(x);
// b.animate().y(y);
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
...
...
@@ -229,16 +205,6 @@ public class AdjustSaturation extends AppCompatActivity
int
viewX
=
location
[
0
];
int
viewY
=
location
[
1
];
// if(viewX >= viewMaxX)
// {
// viewMaxX = viewX;
// }
// if(viewY >= viewMaxY)
// {
// viewMaxY = viewY;
// }
Log
.
d
(
"aaaaaaaaaaaa"
,
"View="
+
view
.
getId
()
+
"X="
+
viewX
+
", Y="
+
viewY
);
int
viewMaxWidth
=
viewX
+
view
.
getWidth
();
int
viewMinWidth
=
viewX
-
view
.
getWidth
();
...
...
@@ -246,40 +212,14 @@ public class AdjustSaturation extends AppCompatActivity
int
viewMaxHeight
=
viewY
+
view
.
getHeight
();
int
viewMinHeight
=
viewY
-
view
.
getHeight
();
//b.animate().y((viewMinHeight + viewMaxHeight) / 2);
if
((
x
>=
viewMinWidth
&&
x
<=
viewMaxWidth
))
{
if
(
lastLookedView
!=
null
&&
lastLookedView
.
getId
()
==
view
.
getId
())
{
count
++;
}
else
{
count
=
0
;
}
if
(
count
>=
3
)
{
isPossible
=
false
;
checkCount
();
}
view
.
setBackgroundColor
(
Color
.
RED
);
b
.
animate
().
x
((
viewMinWidth
+
viewMaxWidth
)
/
2
);
b
.
animate
().
y
((
viewMinHeight
+
viewMaxHeight
)
/
2
);
Log
.
d
(
"bbbbb"
,
"Came here"
);
lastLookedView
=
view
;
cursor
.
animate
().
x
((
viewMinWidth
+
viewMaxWidth
)
/
2
);
cursor
.
animate
().
y
((
viewMinHeight
+
viewMaxHeight
)
/
2
);
}
else
...
...
@@ -288,8 +228,8 @@ public class AdjustSaturation extends AppCompatActivity
}
}
b
.
animate
().
x
(
x
);
b
.
animate
().
y
(
y
);
cursor
.
animate
().
x
(
x
);
cursor
.
animate
().
y
(
y
);
}
private
void
checkCount
()
{
...
...
app/src/main/java/com/app/smartphotoeditor/activities/DenoisingActivity.java
View file @
2074db16
...
...
@@ -102,7 +102,7 @@ public class DenoisingActivity extends AppCompatActivity
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
back
));
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
s
ave
));
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
s
elect_btn
));
computerVision
=
new
ComputerVision
(
this
,
this
,
this
);
...
...
@@ -220,17 +220,10 @@ public class DenoisingActivity extends AppCompatActivity
}
void
findViewPoint
(
int
x
,
int
y
)
{
//if(!isPossible) return;
ImageView
b
=
findViewById
(
R
.
id
.
cursor
);
ImageView
cursor
=
findViewById
(
R
.
id
.
cursor
);
int
viewMaxX
=
0
;
int
viewMinX
=
0
;
int
viewMaxY
=
0
;
int
viewMinY
=
0
;
...
...
@@ -263,23 +256,6 @@ public class DenoisingActivity extends AppCompatActivity
}
//
// b.animate().x(x);
// b.animate().y(y);
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
...
...
@@ -288,16 +264,6 @@ public class DenoisingActivity extends AppCompatActivity
int
viewX
=
location
[
0
];
int
viewY
=
location
[
1
];
// if(viewX >= viewMaxX)
// {
// viewMaxX = viewX;
// }
// if(viewY >= viewMaxY)
// {
// viewMaxY = viewY;
// }
Log
.
d
(
"aaaaaaaaaaaa"
,
"View="
+
view
.
getId
()
+
"X="
+
viewX
+
", Y="
+
viewY
);
int
viewMaxWidth
=
viewX
+
view
.
getWidth
();
int
viewMinWidth
=
viewX
-
view
.
getWidth
();
...
...
@@ -305,40 +271,14 @@ public class DenoisingActivity extends AppCompatActivity
int
viewMaxHeight
=
viewY
+
view
.
getHeight
();
int
viewMinHeight
=
viewY
-
view
.
getHeight
();
//b.animate().y((viewMinHeight + viewMaxHeight) / 2);
if
((
x
>=
viewMinWidth
&&
x
<=
viewMaxWidth
))
{
if
(
lastLookedView
!=
null
&&
lastLookedView
.
getId
()
==
view
.
getId
())
{
count
++;
}
else
{
count
=
0
;
}
if
(
count
>=
3
)
{
isPossible
=
false
;
checkCount
();
}
view
.
setBackgroundColor
(
Color
.
RED
);
b
.
animate
().
x
((
viewMinWidth
+
viewMaxWidth
)
/
2
);
b
.
animate
().
y
((
viewMinHeight
+
viewMaxHeight
)
/
2
);
Log
.
d
(
"bbbbb"
,
"Came here"
);
lastLookedView
=
view
;
cursor
.
animate
().
x
((
viewMinWidth
+
viewMaxWidth
)
/
2
);
cursor
.
animate
().
y
((
viewMinHeight
+
viewMaxHeight
)
/
2
);
}
else
...
...
@@ -347,23 +287,8 @@ public class DenoisingActivity extends AppCompatActivity
}
}
b
.
animate
().
x
(
x
);
b
.
animate
().
y
(
y
);
}
private
void
checkCount
()
{
count
++;
if
(
count
>=
5
)
{
isPossible
=
true
;
count
=
0
;
}
else
{
isPossible
=
false
;
}
cursor
.
animate
().
x
(
x
);
cursor
.
animate
().
y
(
y
);
}
@Override
...
...
app/src/main/java/com/app/smartphotoeditor/activities/EditorActivity.java
View file @
2074db16
...
...
@@ -82,6 +82,9 @@ public class EditorActivity extends AppCompatActivity
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_editor
);
tools_rv
=
findViewById
(
R
.
id
.
tools_rv
);
toolsAdapter
=
new
ToolsAdapter
(
getApplicationContext
(),
new
OnToolClicked
()
{
@Override
...
...
@@ -116,6 +119,8 @@ public class EditorActivity extends AppCompatActivity
tools_rv
.
setLayoutManager
(
layoutManager
);
tools_rv
.
setAdapter
(
toolsAdapter
);
computerVision
=
new
ComputerVision
(
this
,
this
,
this
);
ConstraintLayout
constraintLayout
=
findViewById
(
R
.
id
.
constraint_main
);
...
...
@@ -128,6 +133,9 @@ public class EditorActivity extends AppCompatActivity
}
}).
initialize
();
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
back
));
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
select_btn
));
methods
=
new
Methods
(
getApplicationContext
());
...
...
@@ -142,8 +150,6 @@ public class EditorActivity extends AppCompatActivity
speechService
=
new
SpeechService
(
getApplicationContext
(),
findViewById
(
R
.
id
.
speech_progress
),
this
);
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
back
));
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
save
));
}
private
void
setPreviewFrame
(
Mat
previewMat
)
...
...
app/src/main/java/com/app/smartphotoeditor/activities/LowLightEnhanceActivity.java
View file @
2074db16
...
...
@@ -134,7 +134,7 @@ public class LowLightEnhanceActivity extends AppCompatActivity
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
back
));
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
s
ave
));
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
s
elect_btn
));
computerVision
=
new
ComputerVision
(
this
,
this
,
this
);
...
...
@@ -252,17 +252,10 @@ public class LowLightEnhanceActivity extends AppCompatActivity
}
void
findViewPoint
(
int
x
,
int
y
)
{
//if(!isPossible) return;
ImageView
b
=
findViewById
(
R
.
id
.
cursor
);
ImageView
cursor
=
findViewById
(
R
.
id
.
cursor
);
int
viewMaxX
=
0
;
int
viewMinX
=
0
;
int
viewMaxY
=
0
;
int
viewMinY
=
0
;
...
...
@@ -295,23 +288,6 @@ public class LowLightEnhanceActivity extends AppCompatActivity
}
//
// b.animate().x(x);
// b.animate().y(y);
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
...
...
@@ -320,16 +296,6 @@ public class LowLightEnhanceActivity extends AppCompatActivity
int
viewX
=
location
[
0
];
int
viewY
=
location
[
1
];
// if(viewX >= viewMaxX)
// {
// viewMaxX = viewX;
// }
// if(viewY >= viewMaxY)
// {
// viewMaxY = viewY;
// }
Log
.
d
(
"aaaaaaaaaaaa"
,
"View="
+
view
.
getId
()
+
"X="
+
viewX
+
", Y="
+
viewY
);
int
viewMaxWidth
=
viewX
+
view
.
getWidth
();
int
viewMinWidth
=
viewX
-
view
.
getWidth
();
...
...
@@ -337,40 +303,14 @@ public class LowLightEnhanceActivity extends AppCompatActivity
int
viewMaxHeight
=
viewY
+
view
.
getHeight
();
int
viewMinHeight
=
viewY
-
view
.
getHeight
();
//b.animate().y((viewMinHeight + viewMaxHeight) / 2);
if
((
x
>=
viewMinWidth
&&
x
<=
viewMaxWidth
))
{
if
(
lastLookedView
!=
null
&&
lastLookedView
.
getId
()
==
view
.
getId
())
{
count
++;
}
else
{
count
=
0
;
}
if
(
count
>=
3
)
{
isPossible
=
false
;
checkCount
();
}
view
.
setBackgroundColor
(
Color
.
RED
);
b
.
animate
().
x
((
viewMinWidth
+
viewMaxWidth
)
/
2
);
b
.
animate
().
y
((
viewMinHeight
+
viewMaxHeight
)
/
2
);
Log
.
d
(
"bbbbb"
,
"Came here"
);
lastLookedView
=
view
;
cursor
.
animate
().
x
((
viewMinWidth
+
viewMaxWidth
)
/
2
);
cursor
.
animate
().
y
((
viewMinHeight
+
viewMaxHeight
)
/
2
);
}
else
...
...
@@ -379,8 +319,8 @@ public class LowLightEnhanceActivity extends AppCompatActivity
}
}
b
.
animate
().
x
(
x
);
b
.
animate
().
y
(
y
);
cursor
.
animate
().
x
(
x
);
cursor
.
animate
().
y
(
y
);
}
private
void
checkCount
()
...
...
app/src/main/java/com/app/smartphotoeditor/activities/RestorationActivity.java
View file @
2074db16
...
...
@@ -103,7 +103,7 @@ public class RestorationActivity extends AppCompatActivity
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
back
));
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
s
ave
));
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
s
elect_btn
));
computerVision
=
new
ComputerVision
(
this
,
this
,
this
);
...
...
@@ -219,17 +219,10 @@ public class RestorationActivity extends AppCompatActivity
}
void
findViewPoint
(
int
x
,
int
y
)
{
//if(!isPossible) return;
ImageView
b
=
findViewById
(
R
.
id
.
cursor
);
ImageView
cursor
=
findViewById
(
R
.
id
.
cursor
);
int
viewMaxX
=
0
;
int
viewMinX
=
0
;
int
viewMaxY
=
0
;
int
viewMinY
=
0
;
...
...
@@ -262,23 +255,6 @@ public class RestorationActivity extends AppCompatActivity
}
//
// b.animate().x(x);
// b.animate().y(y);
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
...
...
@@ -287,16 +263,6 @@ public class RestorationActivity extends AppCompatActivity
int
viewX
=
location
[
0
];
int
viewY
=
location
[
1
];
// if(viewX >= viewMaxX)
// {
// viewMaxX = viewX;
// }
// if(viewY >= viewMaxY)
// {
// viewMaxY = viewY;
// }
Log
.
d
(
"aaaaaaaaaaaa"
,
"View="
+
view
.
getId
()
+
"X="
+
viewX
+
", Y="
+
viewY
);
int
viewMaxWidth
=
viewX
+
view
.
getWidth
();
int
viewMinWidth
=
viewX
-
view
.
getWidth
();
...
...
@@ -304,40 +270,14 @@ public class RestorationActivity extends AppCompatActivity
int
viewMaxHeight
=
viewY
+
view
.
getHeight
();
int
viewMinHeight
=
viewY
-
view
.
getHeight
();
//b.animate().y((viewMinHeight + viewMaxHeight) / 2);
if
((
x
>=
viewMinWidth
&&
x
<=
viewMaxWidth
))
{
if
(
lastLookedView
!=
null
&&
lastLookedView
.
getId
()
==
view
.
getId
())
{
count
++;
}
else
{
count
=
0
;
}
if
(
count
>=
3
)
{
isPossible
=
false
;
checkCount
();
}
view
.
setBackgroundColor
(
Color
.
RED
);
b
.
animate
().
x
((
viewMinWidth
+
viewMaxWidth
)
/
2
);
b
.
animate
().
y
((
viewMinHeight
+
viewMaxHeight
)
/
2
);
Log
.
d
(
"bbbbb"
,
"Came here"
);
lastLookedView
=
view
;
cursor
.
animate
().
x
((
viewMinWidth
+
viewMaxWidth
)
/
2
);
cursor
.
animate
().
y
((
viewMinHeight
+
viewMaxHeight
)
/
2
);
}
else
...
...
@@ -346,8 +286,8 @@ public class RestorationActivity extends AppCompatActivity
}
}
b
.
animate
().
x
(
x
);
b
.
animate
().
y
(
y
);
cursor
.
animate
().
x
(
x
);
cursor
.
animate
().
y
(
y
);
}
private
void
checkCount
()
...
...
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