Commit c3112e99 authored by Samesh Buddhika Alahakoon's avatar Samesh Buddhika Alahakoon

Merge branch 'IT18109672' into 'master'

performance improvements

See merge request !28
parents 41b6920d 2b75323b
......@@ -80,7 +80,7 @@ public class AddEffects extends AppCompatActivity
private ComputerVision computerVision;
private EyeGazeDetection eyeGazeDetection;
@Override
......@@ -130,12 +130,7 @@ public class AddEffects extends AppCompatActivity
viewsInDisplay.add(findViewById(R.id.back));
viewsInDisplay.add(findViewById(R.id.save));
try {
eyeGazeDetection = new EyeGazeDetection(getAssets(),getApplicationContext(),
"eye_gaze.tflite",224);
} catch (IOException e) {
e.printStackTrace();
}
init();
......@@ -326,16 +321,12 @@ public class AddEffects extends AppCompatActivity
void findViewPoint(int x,int y)
{
//if(!isPossible) return;
ImageView b = findViewById(R.id.cursor);
int viewMaxX = 0;
int viewMinX = 0;
int viewMaxY = 0;
int viewMinY = 0;
......@@ -368,17 +359,6 @@ public class AddEffects extends AppCompatActivity
}
//
// b.animate().x(x);
// b.animate().y(y);
......@@ -393,16 +373,6 @@ public class AddEffects 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();
......@@ -410,24 +380,14 @@ public class AddEffects 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();
}
......@@ -456,21 +416,6 @@ public class AddEffects extends AppCompatActivity
b.animate().y(y);
}
private void checkCount()
{
count++;
if(count >= 5)
{
isPossible = true;
count = 0;
}
else
{
isPossible = false;
}
}
@Override
public void opened() {
......@@ -489,7 +434,6 @@ public class AddEffects extends AppCompatActivity
@Override
public void onPupilChanged(Mat binary,int x, int y,int range,int pupilX)
{
if(eyeGazeDetection != null)eyeGazeDetection.detect(Methods.matToBit(binary));
// try
// {
......
package com.app.smartphotoeditor.activities;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.app.smartphotoeditor.R;
import com.app.smartphotoeditor.config.ImageList;
import com.app.smartphotoeditor.listeners.OnCameraPreviewChanged;
import com.app.smartphotoeditor.listeners.OnVoiceCommandResultChanged;
import com.app.smartphotoeditor.listeners.ml.OnEyeStatusChanged;
import com.app.smartphotoeditor.listeners.ml.OnGestureDetected;
import com.app.smartphotoeditor.sdk.Methods;
import com.app.smartphotoeditor.sdk.RealTimeCamera;
import com.app.smartphotoeditor.services.ComputerVision;
import com.app.smartphotoeditor.services.SpeechService;
import com.bumptech.glide.Glide;
import com.warkiz.tickseekbar.OnSeekChangeListener;
import com.warkiz.tickseekbar.SeekParams;
import com.warkiz.tickseekbar.TickSeekBar;
import org.opencv.core.Mat;
public class AdjustBrightness extends AppCompatActivity {
import java.util.ArrayList;
public class AdjustBrightness extends AppCompatActivity
implements OnGestureDetected, OnEyeStatusChanged, OnVoiceCommandResultChanged {
private ImageView adjustImage;
......@@ -24,7 +39,14 @@ public class AdjustBrightness extends AppCompatActivity {
private Methods methods;
float brightnessValue = 0.0f;
private ComputerVision computerVision;
private int count = 0;
private View lastLookedView = null;
private ArrayList<View> viewsInDisplay = new ArrayList<>();
private TickSeekBar seekBar;
private boolean isPossible = true;
private SpeechService speechService;
@Override
......@@ -32,10 +54,25 @@ public class AdjustBrightness extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_adjust_brightness);
viewsInDisplay.add(findViewById(R.id.back));
viewsInDisplay.add(findViewById(R.id.save));
computerVision = new ComputerVision(this,this,this);
ConstraintLayout constraintLayout = findViewById(R.id.constraint_main);
new RealTimeCamera(AdjustBrightness.this, constraintLayout, new OnCameraPreviewChanged() {
@Override
public void updated(Mat rgba,Mat previewMat)
{
computerVision.setMat(rgba);
setPreviewFrame(previewMat);
}
}).initialize();
methods = new Methods(getApplicationContext());
adjustImage = findViewById(R.id.adjustImage);
TickSeekBar seekBar = findViewById(R.id.seekbar);
seekBar = findViewById(R.id.seekbar);
createImage();
......@@ -43,20 +80,39 @@ public class AdjustBrightness extends AppCompatActivity {
{
@Override
public void onSeeking(SeekParams seekParams)
{ }
{
brightnessValue = seekBar.getProgress();
createImage();
}
@Override
public void onStartTrackingTouch(TickSeekBar seekBar) { }
@Override
public void onStopTrackingTouch(TickSeekBar seekBar)
{
brightnessValue = seekBar.getProgress();
createImage();
}
});
speechService = new SpeechService(getApplicationContext(),findViewById(R.id.progress),this);
}
private void setPreviewFrame(Mat previewMat)
{
ImageView preview = findViewById(R.id.preview);
Bitmap previewBitmap = Methods.matToBit(previewMat);
previewBitmap = Methods.rotateBitmap(previewBitmap,-90f);
Bitmap finalPreviewBitmap = previewBitmap;
runOnUiThread(new Runnable() {
@Override
public void run() {
if(preview != null)
preview.setImageBitmap(finalPreviewBitmap);
}
});
}
private void createImage()
......@@ -68,19 +124,6 @@ public class AdjustBrightness extends AppCompatActivity {
currentEditingImage = methods.changeBitmapContrastBrightness(currentEditingImage,1f, brightnessValue);
}
// if(blurValue > 0)
// {
// currentEditingImage = new BlurUtils().blur(AdjustImage.this,currentEditingImage, blurValue);
// }
// if(saturationValue > 0)
// {
// currentEditingImage = methods.addSaturation(currentEditingImage,saturationValue);
// }
// if(brightnessValue > 0)
// {
// currentEditingImage = methods.changeBitmapContrastBrightness(currentEditingImage,1f,brightnessValue);
// }
Glide.with(getApplicationContext()).load(currentEditingImage).into(adjustImage);
}
......@@ -99,4 +142,244 @@ public class AdjustBrightness extends AppCompatActivity {
}
Back(null);
}
void findViewPoint(int x,int y)
{
//if(!isPossible) return;
ImageView b = findViewById(R.id.cursor);
int viewMaxX = 0;
int viewMinX = 0;
int viewMaxY = 0;
int viewMinY = 0;
for(View view : viewsInDisplay)
{
int[] location = new int[2];
view.getLocationOnScreen(location);
int viewX = location[0] + (view.getWidth() / 2);
int viewY = location[1] / 2;
if(viewX >= viewMaxX)
{
viewMaxX = viewX;
}
if(viewY >= viewMaxY)
{
viewMaxY = viewY;
}
}
if(x > viewMaxX)
{
x = viewMaxX;
}
if(y > viewMaxY)
{
y = viewMaxY;
}
//
// b.animate().x(x);
// b.animate().y(y);
for(View view : viewsInDisplay)
{
int[] location = new int[2];
view.getLocationOnScreen(location);
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();
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;
}
else
{
view.setBackgroundColor(Color.BLACK);
}
}
b.animate().x(x);
b.animate().y(y);
}
private void checkCount()
{
count++;
if(count >= 5)
{
isPossible = true;
count = 0;
}
else
{
isPossible = false;
}
}
@Override
public void opened() {
}
@Override
public void closed() {
}
@Override
public void longClosed() {
}
@Override
public void onPupilChanged(Mat binary, int x, int y, int range, int pupilX) {
findViewPoint(x,y);
}
@Override
public void onIdle() {
}
@Override
public void onLeft() {
runOnUiThread(new Runnable() {
@Override
public void run()
{
seekBar.setProgress(seekBar.getProgress() - 10);
}
});
}
@Override
public void onRight() {
runOnUiThread(new Runnable() {
@Override
public void run()
{
seekBar.setProgress(seekBar.getProgress() + 10);
}
});
}
@Override
public void onTop() {
}
@Override
public void onBottom() {
}
@Override
public void back() {
Back(null);
}
@Override
public void exit() {
}
@Override
public void undo() {
}
@Override
public void redo() {
}
@Override
public void save() {
Save(null);
}
@Override
public void select() {
}
}
package com.app.smartphotoeditor.activities;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.app.smartphotoeditor.R;
import com.app.smartphotoeditor.config.ImageList;
import com.app.smartphotoeditor.listeners.OnCameraPreviewChanged;
import com.app.smartphotoeditor.listeners.OnVoiceCommandResultChanged;
import com.app.smartphotoeditor.listeners.ml.OnEyeStatusChanged;
import com.app.smartphotoeditor.listeners.ml.OnGestureDetected;
import com.app.smartphotoeditor.sdk.Methods;
import com.app.smartphotoeditor.sdk.RealTimeCamera;
import com.app.smartphotoeditor.services.ComputerVision;
import com.app.smartphotoeditor.services.SpeechService;
import com.bumptech.glide.Glide;
import com.warkiz.tickseekbar.OnSeekChangeListener;
import com.warkiz.tickseekbar.SeekParams;
import com.warkiz.tickseekbar.TickSeekBar;
import org.opencv.core.Mat;
public class AdjustSaturation extends AppCompatActivity {
import java.util.ArrayList;
public class AdjustSaturation extends AppCompatActivity
implements OnGestureDetected, OnEyeStatusChanged, OnVoiceCommandResultChanged {
private ImageView adjustImage;
......@@ -24,6 +39,15 @@ public class AdjustSaturation extends AppCompatActivity {
private Methods methods;
float saturationLevel = 0.0f;
private ComputerVision computerVision;
private int count = 0;
private View lastLookedView = null;
private ArrayList<View> viewsInDisplay = new ArrayList<>();
private TickSeekBar seekBar;
private boolean isPossible = true;
private SpeechService speechService;
@Override
......@@ -32,9 +56,24 @@ public class AdjustSaturation extends AppCompatActivity {
setContentView(R.layout.activity_adjust_saturation);
viewsInDisplay.add(findViewById(R.id.back));
viewsInDisplay.add(findViewById(R.id.save));
computerVision = new ComputerVision(this,this,this);
ConstraintLayout constraintLayout = findViewById(R.id.constraint_main);
new RealTimeCamera(AdjustSaturation.this, constraintLayout, new OnCameraPreviewChanged() {
@Override
public void updated(Mat rgba, Mat previewMat)
{
computerVision.setMat(rgba);
setPreviewFrame(previewMat);
}
}).initialize();
methods = new Methods(getApplicationContext());
adjustImage = findViewById(R.id.adjustImage);
TickSeekBar seekBar = findViewById(R.id.seekbar);
seekBar = findViewById(R.id.seekbar);
createImage();
......@@ -42,21 +81,38 @@ public class AdjustSaturation extends AppCompatActivity {
{
@Override
public void onSeeking(SeekParams seekParams)
{ }
{
saturationLevel = seekBar.getProgress() / 10;
createImage();
}
@Override
public void onStartTrackingTouch(TickSeekBar seekBar) { }
@Override
public void onStopTrackingTouch(TickSeekBar seekBar)
{
saturationLevel = seekBar.getProgress();
createImage();
}
{ }
});
speechService = new SpeechService(getApplicationContext(),findViewById(R.id.progress),this);
}
private void setPreviewFrame(Mat previewMat)
{
ImageView preview = findViewById(R.id.preview);
Bitmap previewBitmap = Methods.matToBit(previewMat);
previewBitmap = Methods.rotateBitmap(previewBitmap,-90f);
Bitmap finalPreviewBitmap = previewBitmap;
runOnUiThread(new Runnable() {
@Override
public void run() {
if(preview != null)
preview.setImageBitmap(finalPreviewBitmap);
}
});
}
private void createImage()
{
......@@ -67,20 +123,6 @@ public class AdjustSaturation extends AppCompatActivity {
currentEditingImage = methods.addSaturation(currentEditingImage,saturationLevel);
}
// if(blurValue > 0)
// {
// currentEditingImage = new BlurUtils().blur(AdjustImage.this,currentEditingImage, blurValue);
// }
// if(saturationValue > 0)
// {
// currentEditingImage = methods.addSaturation(currentEditingImage,saturationValue);
// }
// if(brightnessValue > 0)
// {
// currentEditingImage = methods.changeBitmapContrastBrightness(currentEditingImage,1f,brightnessValue);
// }
Glide.with(getApplicationContext()).load(currentEditingImage).into(adjustImage);
}
......@@ -98,4 +140,243 @@ public class AdjustSaturation extends AppCompatActivity {
}
Back(null);
}
void findViewPoint(int x,int y)
{
//if(!isPossible) return;
ImageView b = findViewById(R.id.cursor);
int viewMaxX = 0;
int viewMinX = 0;
int viewMaxY = 0;
int viewMinY = 0;
for(View view : viewsInDisplay)
{
int[] location = new int[2];
view.getLocationOnScreen(location);
int viewX = location[0] + (view.getWidth() / 2);
int viewY = location[1] / 2;
if(viewX >= viewMaxX)
{
viewMaxX = viewX;
}
if(viewY >= viewMaxY)
{
viewMaxY = viewY;
}
}
if(x > viewMaxX)
{
x = viewMaxX;
}
if(y > viewMaxY)
{
y = viewMaxY;
}
//
// b.animate().x(x);
// b.animate().y(y);
for(View view : viewsInDisplay)
{
int[] location = new int[2];
view.getLocationOnScreen(location);
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();
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;
}
else
{
view.setBackgroundColor(Color.BLACK);
}
}
b.animate().x(x);
b.animate().y(y);
}
private void checkCount()
{
count++;
if(count >= 5)
{
isPossible = true;
count = 0;
}
else
{
isPossible = false;
}
}
@Override
public void opened() {
}
@Override
public void closed() {
}
@Override
public void longClosed() {
}
@Override
public void onPupilChanged(Mat binary, int x, int y, int range, int pupilX) {
findViewPoint(x,y);
}
@Override
public void onIdle() {
}
@Override
public void onLeft() {
runOnUiThread(new Runnable() {
@Override
public void run()
{
seekBar.setProgress(seekBar.getProgress() - 10);
}
});
}
@Override
public void onRight() {
runOnUiThread(new Runnable() {
@Override
public void run()
{
seekBar.setProgress(seekBar.getProgress() + 10);
}
});
}
@Override
public void onTop() {
}
@Override
public void onBottom() {
}
@Override
public void back() {
Back(null);
}
@Override
public void exit() {
}
@Override
public void undo() {
}
@Override
public void redo() {
}
@Override
public void save() {
Save(null);
}
@Override
public void select() {
}
}
......@@ -56,6 +56,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.MappedByteBuffer;
......@@ -371,6 +372,12 @@ public class Methods
return ret;
}
public static float round(float d, int decimalPlace)
{
BigDecimal bd = new BigDecimal(Float.toString(d));
bd = bd.setScale(decimalPlace, BigDecimal.ROUND_HALF_UP);
return bd.floatValue();
}
public Uri getImageUri(Bitmap inImage,Boolean isNeededToDelete)
{
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
......
......@@ -25,6 +25,7 @@ public class ComputerVision
private FacialLandmarkDetection landmarkDetection;
private GestureDetection gestureDetection;
private EyeBlinkDetection eyeBlinkDetection;
private EyeGazeDetection eyeGazeDetection;
//listeners
private final OnGestureDetected gestureListener;
......@@ -44,6 +45,17 @@ public class ComputerVision
setupLandmarkDetection();
setupGestureDetection();
setupEyeBlinkDetection();
setupEyeGazeDetection();
}
private void setupEyeGazeDetection()
{
try {
eyeGazeDetection = new EyeGazeDetection(activity.getAssets(),activity.getApplicationContext(),
"eye_gaze.tflite",224);
} catch (IOException e) {
e.printStackTrace();
}
}
......@@ -104,9 +116,18 @@ public class ComputerVision
{
Bitmap bitmap = Methods.matToBit(mat);
// try {
// Methods.saveImage(activity.getApplicationContext(),bitmap,"NewEyeClose");
// } catch (IOException e) {
// e.printStackTrace();
// }
if(eyeBlinkDetection != null)
eyeBlinkDetection.detectEyeBlinkState(bitmap);
if(eyeGazeDetection != null)
eyeGazeDetection.detect(bitmap);
}
......
......@@ -7,6 +7,7 @@ import android.speech.tts.TextToSpeech;
import android.util.Log;
import com.app.smartphotoeditor.listeners.ml.OnEyeStatusChanged;
import com.app.smartphotoeditor.sdk.Methods;
import org.tensorflow.lite.Interpreter;
import java.io.IOException;
......@@ -22,8 +23,9 @@ public class EyeBlinkDetection
private final Interpreter interpreter;
private final int imageSize;
private static final int MIN_EYE_CLOSE_COUNT = 2;
private static final int MAX_EYE_CLOSE_TIME = -1;
private static final int MIN_EYE_CLOSE_COUNT = 0;
private static final int LONG_EYE_CLOSE_COUNT = 2;
private static final int MAX_EYE_CLOSE_TIME = 3;
private int eyeCloseCount = MIN_EYE_CLOSE_COUNT;
private final OnEyeStatusChanged listener;
......@@ -68,45 +70,40 @@ public class EyeBlinkDetection
float opened = (float) Array.get(Array.get(result, 0), i + 0);
//get eye closed probability
float closed = (float) Array.get(Array.get(result, 0), i + 1);
//closed = Methods.round(closed,5);
Log.d("CheckBlink","" + closed);
//if open or close probability is good
if((opened >= 0.95 && opened <= 1) || (closed >= 0.90 && closed <= 1))
if((opened >= 0.95 && opened <= 1) || (closed <= 1 && closed >= 0.90))
{
//if opened probability is high
if(opened > closed)
if(closed > 0.90)
{
//close
listener.closed();
if(eyeCloseCount <= 0)
eyeCloseCount += 1;
if(eyeCloseCount >= LONG_EYE_CLOSE_COUNT && eyeCloseCount <= MAX_EYE_CLOSE_TIME)
{
Log.d("EyeBlink","Long Closed");
speak("Button Clicked");
//long
listener.longClosed();
speak("Button Clicked");
eyeCloseCount = MIN_EYE_CLOSE_COUNT;
}
else
else if(eyeCloseCount > MAX_EYE_CLOSE_TIME)
{
//opened
Log.d("EyeBlink","Opened");
listener.opened();
eyeCloseCount = MIN_EYE_CLOSE_COUNT;
}
eyeCloseCount = MIN_EYE_CLOSE_COUNT;
}
else
{
//closed
Log.d("EyeBlink","Closed");
eyeCloseCount--;
listener.closed();
//open
eyeCloseCount = MIN_EYE_CLOSE_COUNT;
listener.opened();
if(eyeCloseCount <= MAX_EYE_CLOSE_TIME)
{
eyeCloseCount = MIN_EYE_CLOSE_COUNT;
}
}
}
......
......@@ -37,7 +37,7 @@ public class EyeGazeDetection
ByteBuffer byteBuffer = convertBitmapToByteBuffer(scaledBitmap,imageSize);
//create 2d array to store results
float[][] result = new float[1][2];
float[][] result = new float[1][3];
//run the model
interpreter.run(byteBuffer,result);
......@@ -47,10 +47,13 @@ public class EyeGazeDetection
//float center = (float) Array.get(Array.get(result, 0), i + 0);
float left = (float) Array.get(Array.get(result, 0), i + 0);
float right = (float) Array.get(Array.get(result, 0), i + 1);
float center = (float) Array.get(Array.get(result, 0), i + 2);
Log.d("GazePointer","" + right);
if(left > right && left >= 0.2)
{
Log.d("Hello22","Left - " + right);
Log.d("Hello22","Left - " + left);
}
else if(right >= 0.2)
{
......
......@@ -104,7 +104,7 @@ public class GestureDetection
float top = (float) Array.get(Array.get(result,0),i + 3);
float bottom = (float) Array.get(Array.get(result,0),i + 4);
Log.d("Left", "" + bottom);
Log.d("Leftccc", "" + idle);
float max = 0;
......
......@@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/constraint_main"
android:background="@android:color/white"
tools:context=".activities.AdjustBrightness">
......@@ -55,46 +56,44 @@
android:id="@+id/adjustImage"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="80dp"
android:adjustViewBounds="true"
android:background="@color/white"
android:scaleType="centerCrop"
app:layout_constraintBottom_toTopOf="@+id/guideline6"
app:layout_constraintBottom_toBottomOf="@+id/displayImageDenoise"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toolbar" />
app:layout_constraintTop_toBottomOf="@+id/progress"
app:layout_constraintVertical_bias="0.0" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@color/colorPrimary"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/displayImageDenoise" />
<TextView
android:id="@+id/textView22"
android:layout_width="wrap_content"
<com.warkiz.tickseekbar.TickSeekBar
android:id="@+id/seekbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:text="Brightness"
android:textColor="@color/darkAsh"
android:textSize="17sp"
android:textStyle="bold"
android:layout_marginEnd="32dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/displayImageDenoise" />
<com.warkiz.tickseekbar.TickSeekBar
android:id="@+id/seekbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="32dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/textView22"
app:layout_constraintTop_toBottomOf="@+id/textView22"
app:tsb_max="250"
app:tsb_show_tick_marks_type="none"
app:tsb_thumb_color="@color/darkAsh"
app:tsb_thumb_size="20dp"
app:tsb_ticks_count="1"
app:tsb_track_background_color="@color/darkAsh"
app:tsb_track_background_size="9dp"
app:tsb_track_progress_color="#FFFFFF"
app:tsb_track_progress_size="3dp" />
app:layout_constraintTop_toBottomOf="@+id/displayImageDenoise"
app:tsb_max="250"
app:tsb_show_tick_marks_type="none"
app:tsb_thumb_color="@color/darkAsh"
app:tsb_thumb_size="20dp"
app:tsb_ticks_count="1"
app:tsb_track_background_color="@color/darkAsh"
app:tsb_track_background_size="9dp"
app:tsb_track_progress_color="#FFFFFF"
app:tsb_track_progress_size="3dp" />
<androidx.constraintlayout.widget.Guideline
......@@ -104,6 +103,15 @@
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.82" />
<ImageView
android:id="@+id/preview"
android:layout_width="120dp"
android:layout_height="120dp"
android:scaleType="centerCrop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toolbar" />
<Button
android:id="@+id/back"
android:layout_width="wrap_content"
......@@ -127,4 +135,20 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toolbar" />
<ProgressBar
android:id="@+id/progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:max="100"
android:progress="50"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/preview" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -4,8 +4,9 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/constraint_main"
android:background="@android:color/white"
tools:context=".activities.AdjustSaturation">
tools:context=".activities.AdjustBrightness">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
......@@ -55,46 +56,44 @@
android:id="@+id/adjustImage"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="80dp"
android:adjustViewBounds="true"
android:background="@color/white"
android:scaleType="centerCrop"
app:layout_constraintBottom_toTopOf="@+id/guideline6"
app:layout_constraintBottom_toBottomOf="@+id/displayImageDenoise"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toolbar" />
app:layout_constraintTop_toBottomOf="@+id/progress"
app:layout_constraintVertical_bias="0.0" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@color/colorPrimary"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/displayImageDenoise" />
<TextView
android:id="@+id/textView22"
android:layout_width="wrap_content"
<com.warkiz.tickseekbar.TickSeekBar
android:id="@+id/seekbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:text="Saturation"
android:textColor="@color/darkAsh"
android:textSize="17sp"
android:textStyle="bold"
android:layout_marginEnd="32dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/displayImageDenoise" />
<com.warkiz.tickseekbar.TickSeekBar
android:id="@+id/seekbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="32dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/textView22"
app:layout_constraintTop_toBottomOf="@+id/textView22"
app:tsb_max="250"
app:tsb_show_tick_marks_type="none"
app:tsb_thumb_color="@color/darkAsh"
app:tsb_thumb_size="20dp"
app:tsb_ticks_count="1"
app:tsb_track_background_color="@color/darkAsh"
app:tsb_track_background_size="9dp"
app:tsb_track_progress_color="#FFFFFF"
app:tsb_track_progress_size="3dp" />
app:layout_constraintTop_toBottomOf="@+id/displayImageDenoise"
app:tsb_max="250"
app:tsb_show_tick_marks_type="none"
app:tsb_thumb_color="@color/darkAsh"
app:tsb_thumb_size="20dp"
app:tsb_ticks_count="1"
app:tsb_track_background_color="@color/darkAsh"
app:tsb_track_background_size="9dp"
app:tsb_track_progress_color="#FFFFFF"
app:tsb_track_progress_size="3dp" />
<androidx.constraintlayout.widget.Guideline
......@@ -104,6 +103,15 @@
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.82" />
<ImageView
android:id="@+id/preview"
android:layout_width="120dp"
android:layout_height="120dp"
android:scaleType="centerCrop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toolbar" />
<Button
android:id="@+id/back"
android:layout_width="wrap_content"
......@@ -127,4 +135,20 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toolbar" />
<ProgressBar
android:id="@+id/progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:max="100"
android:progress="50"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/preview" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment