Skip to content

Commit

Permalink
fix quality selector
Browse files Browse the repository at this point in the history
show file size
  • Loading branch information
programmingisart committed Aug 19, 2020
1 parent a127621 commit 58ed8f9
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions app/src/main/java/com/jackco/avifencoder/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public class MainActivity extends AppCompatActivity {

int speed = 10;


SeekBar s;
SeekBar s2;
SeekBar ss;
Expand Down Expand Up @@ -123,8 +122,8 @@ protected void onPostExecute(Bitmap bitmap) {
}

Log.e("DONE","POST EXECUTE!");
Log.e("DONE","Time: " + String.valueOf(System.currentTimeMillis()-time));
encodedIn = "Encoded in " + String.valueOf(System.currentTimeMillis() - time) + " milliseconds";
Log.e("DONE","Time: " + (System.currentTimeMillis() - time));
encodedIn = "Encoded in " + (System.currentTimeMillis() - time) + " milliseconds";

String fileName = "b.avif";

Expand All @@ -143,7 +142,10 @@ protected void onPostExecute(Bitmap bitmap) {
copy(i, t);
if(f.exists()) f.delete();

if(t.exists()) text2.setText("AVIF file saved to:\n\n " +getExternalFilesDir(null).getAbsolutePath() + "/" + tofilename +"\n\n"+encodedIn);
String sizecomp = "AVIF size " + t.length()/1024 + " KB";


if(t.exists()) text2.setText("AVIF file saved to:\n\n " +getExternalFilesDir(null).getAbsolutePath() + "/" + tofilename +"\n\n"+encodedIn + "\n" + sizecomp);


}
Expand Down Expand Up @@ -216,6 +218,8 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {

fo.write(byteArray);



Log.e("DONE","DONE!");

AsyncCreateAVIF asyncTask=new AsyncCreateAVIF();
Expand Down Expand Up @@ -319,11 +323,11 @@ public void onClick(View v) {

@Override
public void onProgressChanged(SeekBar seekBar,int progress, boolean fromUser) {
if(progress < 50) {
qua1 = 63 - progress;
qua2 = qua1 + 10;
}
qua1 = 63 - progress;
qua2 = qua1 + 10;

if(qua2 > 63) qua2 = 63;
if(qua1 == 0) qua2 = 0;
String qu = String.format("Quality: %s", progress);
textq.setText(qu);
}
Expand Down

0 comments on commit 58ed8f9

Please sign in to comment.