first step

This commit is contained in:
Page Asgardius 2022-10-01 19:39:14 -07:00
parent ba764121c7
commit 84591d4f6f
2 changed files with 9 additions and 2 deletions

View file

@ -338,7 +338,11 @@ public class ObjectSelect extends AppCompatActivity {
//Toast.makeText(ObjectSelect.this, getResources().getString(R.string.pending_feature), Toast.LENGTH_SHORT).show();
upload();
} else if (menuItem.getTitle() == getResources().getString(R.string.create_link)) {
share(prefix + Name.get(position).toString());
if (Img.get(position).equals(R.drawable.audiofile) || Img.get(position).equals(R.drawable.videofile)) {
share(prefix + Name.get(position).toString(), true);
} else {
share(prefix + Name.get(position).toString(), false);
}
} else if (menuItem.getTitle() == getResources().getString(R.string.object_info)) {
objectInfo(prefix + Name.get(position).toString());
} else if (menuItem.getTitle() == getResources().getString(R.string.file_del)) {
@ -408,7 +412,7 @@ public class ObjectSelect extends AppCompatActivity {
}
private void share(String object) {
private void share(String object, boolean mediafile) {
Intent intent = new Intent(this, Share.class);
//treelevel ++;
@ -418,6 +422,7 @@ public class ObjectSelect extends AppCompatActivity {
intent.putExtra("bucket", bucket);
intent.putExtra("object", object);
intent.putExtra("region", location);
intent.putExtra("mediafile", mediafile);
startActivity(intent);
}

View file

@ -24,6 +24,7 @@ import java.util.Date;
public class Share extends AppCompatActivity {
String username, password, endpoint, bucket, object, location;
boolean mediafile;
Region region;
S3ClientOptions s3ClientOptions;
AWSCredentials myCredentials;
@ -80,6 +81,7 @@ public class Share extends AppCompatActivity {
bucket = getIntent().getStringExtra("bucket");
location = getIntent().getStringExtra("region");
object = getIntent().getStringExtra("object");
mediafile = getIntent().getBooleanExtra("mediafile", false);
region = Region.getRegion(location);
s3ClientOptions = S3ClientOptions.builder().build();
myCredentials = new BasicAWSCredentials(username, password);