Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
botbahlul authored Mar 1, 2023
1 parent e81a78e commit af6b61a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ android {
minSdkVersion 23
targetSdkVersion 29
versionCode 2
versionName "2.7.2"
versionName "2.7.3"

ndk {
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/java/com/android/autosrt/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1118,19 +1118,21 @@ else if(ContentResolver.SCHEME_CONTENT.equals(uri.getScheme())) {
if(authority.equals("media")) {
idStr = uri.toString().substring(uri.toString().lastIndexOf('/') + 1);
System.out.println("media idStr = " + idStr);
return idStr;
}
else if(authority.startsWith("com.android.providers")) {
idStr = DocumentsContract.getDocumentId(uri).split(":")[1];
System.out.println("providers idStr = " + idStr);
return idStr;
}

ContentResolver contentResolver = context.getContentResolver();
Cursor cursor = contentResolver.query(MediaStore.Files.getContentUri("external"),
new String[] {MediaStore.Files.FileColumns.DATA},
"_id=?",
new String[]{idStr}, null);
if (cursor != null) {
cursor.moveToFirst();
if (cursor != null && cursor.getCount()>0 && cursor.moveToFirst()) {
//cursor.moveToFirst();
try {
int idx = cursor.getColumnIndex(MediaStore.Files.FileColumns.DATA);
System.out.println("cursor.getString(idx) = " + cursor.getString(idx));
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/python/autosrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,14 +867,14 @@ def pBar(count_value, total, prefix, activity, textview_debug):
bar_length = 10
filled_up_Length = int(round(bar_length*count_value/(total)))
percentage = round(100.0 * count_value/(total),1)
bar = '#' * filled_up_Length + ' ' * (bar_length - filled_up_Length)
#bar = '█' * filled_up_Length + ' ' * (bar_length - filled_up_Length)
#bar = '#' * filled_up_Length + '-' * (bar_length - filled_up_Length)
bar = '█' * filled_up_Length + '-' * (bar_length - filled_up_Length)
# dynamic_proxy will make app crash if repeatly called to fast that's why we made a BARRIER 'if (int(percentage) % 10 == 0):'
# and time.sleep(seconds)
if (int(percentage) % 10 == 0):
time.sleep(1)
class R(dynamic_proxy(Runnable)):
def run(self):
textview_debug.setText('%s[%10s]%3s%s\r' %(prefix, bar, int(percentage), '%'))
#textview_debug.setText('%s|%10s|%3s%s\r' %(prefix, bar, int(percentage), '%'))
#textview_debug.setText('%s[%10s]%3s%s\r' %(prefix, bar, int(percentage), '%'))
textview_debug.setText('%s|%10s|%3s%s\r' %(prefix, bar, int(percentage), '%'))
activity.runOnUiThread(R())

0 comments on commit af6b61a

Please sign in to comment.