Merge branch 'audiorecorder-1.1.43'
This commit is contained in:
commit
60eac15eb7
3 changed files with 78 additions and 27 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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,8 +583,14 @@ public class MainActivity extends AppCompatActivity implements AbsListView.OnScr
|
|||
@Override
|
||||
public void run() {
|
||||
if (selected != -1) {
|
||||
list.setSelection(selected);
|
||||
recordings.select(selected);
|
||||
list.smoothScrollToPosition(selected);
|
||||
handler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
list.setSelection(selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -16,19 +16,25 @@
|
|||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/recording_title"
|
||||
<com.github.axet.androidlibrary.widgets.PathMax
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="5dp"
|
||||
android:textColor="?attr/colorPrimary"
|
||||
android:text="2016-02-01.wav"
|
||||
android:textSize="20dp" />
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/recording_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="5dp"
|
||||
android:text="2016-02-01.wav"
|
||||
android:textColor="?attr/colorPrimary"
|
||||
android:textSize="20dp" />
|
||||
</com.github.axet.androidlibrary.widgets.PathMax>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/recording_time"
|
||||
|
|
@ -104,7 +110,7 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<com.github.axet.androidlibrary.widgets.EqualLinearLayout
|
||||
<LinearLayout
|
||||
android:id="@+id/recording_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -117,6 +123,24 @@
|
|||
android:src="@drawable/play"
|
||||
android:tint="?attr/colorAccent" />
|
||||
|
||||
<Space
|
||||
android:layout_weight="1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/recording_player_edit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_create_black_24dp"
|
||||
android:tint="?attr/colorAccent" />
|
||||
|
||||
<Space
|
||||
android:layout_weight="1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/recording_player_share"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
@ -124,13 +148,18 @@
|
|||
android:src="@drawable/share"
|
||||
android:tint="?attr/colorAccent" />
|
||||
|
||||
<Space
|
||||
android:layout_weight="1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/recording_player_trash"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/trash"
|
||||
android:tint="?attr/colorAccent" />
|
||||
</com.github.axet.androidlibrary.widgets.EqualLinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue