bug fix
This commit is contained in:
parent
5cf91a5d7d
commit
dc360cccd7
3 changed files with 47 additions and 19 deletions
4
app/proguard-rules.pro
vendored
4
app/proguard-rules.pro
vendored
|
@ -14,8 +14,8 @@
|
||||||
|
|
||||||
# Uncomment this to preserve the line number information for
|
# Uncomment this to preserve the line number information for
|
||||||
# debugging stack traces.
|
# debugging stack traces.
|
||||||
#-keepattributes SourceFile,LineNumberTable
|
-keepattributes SourceFile,LineNumberTable
|
||||||
|
|
||||||
# If you keep the line number information, uncomment this to
|
# If you keep the line number information, uncomment this to
|
||||||
# hide the original source file name.
|
# hide the original source file name.
|
||||||
#-renamesourcefileattribute SourceFile
|
-renamesourcefileattribute SourceFile
|
|
@ -277,8 +277,12 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
pdfread.start();
|
pdfread.start();
|
||||||
}
|
}
|
||||||
} else if (Img.get(position).equals(R.drawable.audiofile) || Img.get(position).equals(R.drawable.videofile)) {
|
} else if (Img.get(position).equals(R.drawable.audiofile) || Img.get(position).equals(R.drawable.videofile)) {
|
||||||
//load media file
|
Thread mediaread = new Thread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
try {
|
try {
|
||||||
|
//load media file
|
||||||
Date expiration = new Date();
|
Date expiration = new Date();
|
||||||
Calendar mycal = Calendar.getInstance();
|
Calendar mycal = Calendar.getInstance();
|
||||||
mycal.setTime(expiration);
|
mycal.setTime(expiration);
|
||||||
|
@ -288,10 +292,33 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
expiration = mycal.getTime();
|
expiration = mycal.getTime();
|
||||||
GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, prefix + Name.get(position).toString()).withExpiration(expiration);;
|
GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, prefix + Name.get(position).toString()).withExpiration(expiration);;
|
||||||
URL objectURL = s3client.generatePresignedUrl(request);
|
URL objectURL = s3client.generatePresignedUrl(request);
|
||||||
|
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
// Sending reference and data to Adapter
|
||||||
videoPlayer(objectURL.toString());
|
videoPlayer(objectURL.toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//System.out.println("tree "+treelevel);
|
||||||
|
//System.out.println("prefix "+prefix);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mediaread.start();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(ObjectSelect.this, getResources().getString(R.string.unsupported_file), Toast.LENGTH_SHORT).show();
|
Toast.makeText(ObjectSelect.this, getResources().getString(R.string.unsupported_file), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ public class Share extends AppCompatActivity {
|
||||||
Button share, external;
|
Button share, external;
|
||||||
GeneratePresignedUrlRequest request;
|
GeneratePresignedUrlRequest request;
|
||||||
Date expiration;
|
Date expiration;
|
||||||
|
URL objectURL;
|
||||||
|
|
||||||
public static String URLify(String str) {
|
public static String URLify(String str) {
|
||||||
str = str.trim();
|
str = str.trim();
|
||||||
|
@ -121,7 +122,7 @@ public class Share extends AppCompatActivity {
|
||||||
expiration = mycal.getTime();
|
expiration = mycal.getTime();
|
||||||
//System.out.println(expiration);
|
//System.out.println(expiration);
|
||||||
request = new GeneratePresignedUrlRequest(bucket, object).withExpiration(expiration);
|
request = new GeneratePresignedUrlRequest(bucket, object).withExpiration(expiration);
|
||||||
URL objectURL = s3client.generatePresignedUrl(request);
|
objectURL = s3client.generatePresignedUrl(request);
|
||||||
//System.out.println(URLify(objectURL.toString()));
|
//System.out.println(URLify(objectURL.toString()));
|
||||||
Intent shareIntent = new Intent(Intent.ACTION_SEND);
|
Intent shareIntent = new Intent(Intent.ACTION_SEND);
|
||||||
shareIntent.setType("text/plain");
|
shareIntent.setType("text/plain");
|
||||||
|
@ -150,7 +151,7 @@ public class Share extends AppCompatActivity {
|
||||||
} else {
|
} else {
|
||||||
request = new GeneratePresignedUrlRequest(bucket, object);
|
request = new GeneratePresignedUrlRequest(bucket, object);
|
||||||
}
|
}
|
||||||
URL objectURL = s3client.generatePresignedUrl(request);
|
objectURL = s3client.generatePresignedUrl(request);
|
||||||
//System.out.println(URLify(objectURL.toString()));
|
//System.out.println(URLify(objectURL.toString()));
|
||||||
Intent shareIntent = new Intent(Intent.ACTION_SEND);
|
Intent shareIntent = new Intent(Intent.ACTION_SEND);
|
||||||
shareIntent.setType("text/plain");
|
shareIntent.setType("text/plain");
|
||||||
|
|
Loading…
Reference in a new issue