From 47b98c32b0f53d407a4a7bf46b344f6189c2a567 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Sat, 25 Jun 2016 23:38:56 +0300 Subject: [PATCH 1/3] ui tweaks --- .../activities/MainActivity.java | 45 +++++++++++------ app/src/main/res/layout/recording.xml | 49 +++++++++++++++---- 2 files changed, 70 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/com/github/axet/audiorecorder/activities/MainActivity.java b/app/src/main/java/com/github/axet/audiorecorder/activities/MainActivity.java index 3b7f42e..95e71d1 100644 --- a/app/src/main/java/com/github/axet/audiorecorder/activities/MainActivity.java +++ b/app/src/main/java/com/github/axet/audiorecorder/activities/MainActivity.java @@ -220,6 +220,27 @@ public class MainActivity extends AppCompatActivity implements AbsListView.OnScr } }; + final Runnable rename = new Runnable() { + @Override + public void run() { + final OpenFileDialog.EditTextDialog e = new OpenFileDialog.EditTextDialog(getContext()); + e.setTitle("Rename Recording"); + e.setText(Storage.getNameNoExt(f)); + e.setPositiveButton(new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + String ext = Storage.getExt(f); + String s = String.format("%s.%s", e.getText(), ext); + File ff = new File(f.getParent(), s); + f.renameTo(ff); + load(); + } + }); + e.show(); + + } + }; + if (selected == position) { RecordingAnimation.apply(list, convertView, true, scrollState == SCROLL_STATE_IDLE && (int) convertView.getTag() == TYPE_COLLAPSED); convertView.setTag(TYPE_EXPANDED); @@ -240,6 +261,14 @@ public class MainActivity extends AppCompatActivity implements AbsListView.OnScr } }); + final View edit = convertView.findViewById(R.id.recording_player_edit); + edit.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + rename.run(); + } + }); + final View share = convertView.findViewById(R.id.recording_player_share); share.setOnClickListener(new View.OnClickListener() { @Override @@ -299,20 +328,7 @@ public class MainActivity extends AppCompatActivity implements AbsListView.OnScr return true; } if (item.getItemId() == R.id.action_rename) { - final OpenFileDialog.EditTextDialog e = new OpenFileDialog.EditTextDialog(getContext()); - e.setTitle("Rename Recording"); - e.setText(Storage.getNameNoExt(f)); - e.setPositiveButton(new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - String ext = Storage.getExt(f); - String s = String.format("%s.%s", e.getText(), ext); - File ff = new File(f.getParent(), s); - f.renameTo(ff); - load(); - } - }); - e.show(); + rename.run(); return true; } return false; @@ -567,6 +583,7 @@ public class MainActivity extends AppCompatActivity implements AbsListView.OnScr @Override public void run() { if (selected != -1) { + list.smoothScrollToPosition(recordings.selected); list.setSelection(selected); recordings.select(selected); } diff --git a/app/src/main/res/layout/recording.xml b/app/src/main/res/layout/recording.xml index 81830e9..8d30b89 100644 --- a/app/src/main/res/layout/recording.xml +++ b/app/src/main/res/layout/recording.xml @@ -16,19 +16,25 @@ android:layout_height="wrap_content"> - + android:layout_height="wrap_content"> + + + - + + + + + + + + + - + From 9e7fcd8c2e69004ce5b20b36251091743b3be239 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Sat, 25 Jun 2016 23:42:34 +0300 Subject: [PATCH 2/3] ui tweaks --- .../axet/audiorecorder/activities/MainActivity.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/github/axet/audiorecorder/activities/MainActivity.java b/app/src/main/java/com/github/axet/audiorecorder/activities/MainActivity.java index 95e71d1..20e9c43 100644 --- a/app/src/main/java/com/github/axet/audiorecorder/activities/MainActivity.java +++ b/app/src/main/java/com/github/axet/audiorecorder/activities/MainActivity.java @@ -583,9 +583,14 @@ public class MainActivity extends AppCompatActivity implements AbsListView.OnScr @Override public void run() { if (selected != -1) { - list.smoothScrollToPosition(recordings.selected); - list.setSelection(selected); recordings.select(selected); + list.smoothScrollToPosition(selected); + handler.post(new Runnable() { + @Override + public void run() { + list.setSelection(selected); + } + }); } } }); From fbd9b63fdc56332cc6b1221865e3c095e02ddcfb Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Sat, 25 Jun 2016 23:42:46 +0300 Subject: [PATCH 3/3] Bump version 1.1.43 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b2d9060..77a8270 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "com.github.axet.audiorecorder" minSdkVersion 16 targetSdkVersion 23 - versionCode 64 - versionName "1.1.42" + versionCode 65 + versionName "1.1.43" } signingConfigs { release {