Delete Add_Image.java
This commit is contained in:
@@ -1,88 +0,0 @@
|
||||
package in.sminnovations.arresttb;
|
||||
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
import com.theartofdev.edmodo.cropper.CropImage;
|
||||
import com.theartofdev.edmodo.cropper.CropImageView;
|
||||
|
||||
|
||||
public class Add_Image extends Navigation_Top {
|
||||
|
||||
de.hdodenhof.circleimageview.CircleImageView circle_image;
|
||||
Button selection_image,report1;
|
||||
private static final int PERMISSION_FILE=23;
|
||||
String Data_report,patientid,patientdob,patientage,patientnikshayid;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
LayoutInflater inflater = (LayoutInflater) this
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
View contentView = inflater.inflate(R.layout.activity_add_image, null, false);
|
||||
draw.addView(contentView, 0);
|
||||
|
||||
// setContentView(R.layout.activity_add_image);
|
||||
circle_image=findViewById(R.id.circle_image);
|
||||
patientdob= getIntent().getStringExtra("dob_report");
|
||||
patientid=getIntent().getStringExtra("id_report");
|
||||
patientage=getIntent().getStringExtra("age_report");
|
||||
patientnikshayid=getIntent().getStringExtra("nikshay_report");
|
||||
report1=findViewById(R.id.report);
|
||||
|
||||
report1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(Add_Image.this, Report.class);
|
||||
startActivity(intent);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
if(ContextCompat.checkSelfPermission(Add_Image.this, Manifest.permission.WRITE_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED)
|
||||
{
|
||||
|
||||
ActivityCompat.requestPermissions(Add_Image.this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},PERMISSION_FILE);
|
||||
}
|
||||
else
|
||||
{
|
||||
//startCropImageActivity();
|
||||
CropImage.activity()
|
||||
.setGuidelines(CropImageView.Guidelines.ON)
|
||||
.setCropShape(CropImageView.CropShape.OVAL)
|
||||
.start(Add_Image.this);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {
|
||||
CropImage.ActivityResult result = CropImage.getActivityResult(data);
|
||||
if (resultCode == RESULT_OK) {
|
||||
Uri resultUri = result.getUri();
|
||||
circle_image.setImageURI(resultUri);
|
||||
} else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {
|
||||
Exception error = result.getError();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user