Start differentiating bewteen picture attachments and sdcard attachments

pull/14/head
Sam Bosley 13 years ago
parent a1f7c3603c
commit 1742a7532f

@ -20,5 +20,7 @@
<string name="file_browser_up">Up</string>
<string name="file_browser_title">Choose a file</string>
<string name="file_browser_err_permissions">Permissions error! Please make sure you have not blocked Astrid from accessing the SD card.</string>
<string name="file_add_picture">Attach a picture</string>
<string name="file_add_sdcard">Attach a file from your SD card</string>
<string name="file_err_copy">Error copying file for attachment</string>
</resources>

@ -52,6 +52,7 @@ import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.ViewParent;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.FrameLayout;
@ -999,9 +1000,30 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
}
private void startAttachFile() {
ArrayList<String> options = new ArrayList<String>();
options.add(getString(R.string.file_add_picture));
options.add(getString(R.string.file_add_sdcard));
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(),
android.R.layout.simple_spinner_dropdown_item, options.toArray(new String[options.size()]));
DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface d, int which) {
if(which == 0) {
System.err.println("Attach a picture");
} else if (which == 1) {
Intent attachFile = new Intent(getActivity(), FileExplore.class);
startActivityForResult(attachFile, REQUEST_CODE_ATTACH_FILE);
}
}
};
// show a menu of available options
new AlertDialog.Builder(getActivity())
.setAdapter(adapter, listener)
.show().setOwnerActivity(getActivity());
}
private void startRecordingAudio() {
Intent recordAudio = new Intent(getActivity(), AACRecordingActivity.class);

Loading…
Cancel
Save