Commit 2547873d authored by dilshan-98's avatar dilshan-98

code clean

parent cb67cde4
......@@ -70,23 +70,11 @@ public class BackgroundCustomization extends AppCompatActivity
btnedit = (Button) findViewById(R.id.btnedit);
image = findViewById(R.id.img);
//displayFileChoose();
btnedit.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v) {
// 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...");
......@@ -101,10 +89,6 @@ public class BackgroundCustomization extends AppCompatActivity
try
{
//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();
Thread t = new Thread(new Runnable()
{
@Override
......@@ -113,20 +97,15 @@ 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);
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 request_body = new FormBody.Builder()
.add("image", input)
//.addFormDataPart("image", f_path.substring(f_path.lastIndexOf("/") +1), file_body)
.build();
Request request = new Request.Builder()
......@@ -150,14 +129,11 @@ public class BackgroundCustomization extends AppCompatActivity
}
});
t.start();
//}else
//{
//}
}catch (Exception e)
{
e.printStackTrace();
}//******
//}
}
}
});
......
......@@ -136,8 +136,6 @@ 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();
progress.dismiss();
openCutActivity();
} catch (Exception e) {
......
......@@ -125,8 +125,6 @@ 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();
progress.dismiss();
openBokehActivity();
} catch (Exception e) {
......
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