Skip to content

Commit

Permalink
Merge pull request nicolas-raoul#84 from flerda/v2.1-editor
Browse files Browse the repository at this point in the history
Switch to original note editor.
  • Loading branch information
flerda committed Aug 10, 2013
2 parents 3f1522c + efcceb5 commit 3b07eff
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<!--
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
Expand Down
7 changes: 5 additions & 2 deletions src/com/ichi2/anki/CardBrowser.java
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,9 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
mPositionInCardsList = position;
long cardId = Long.parseLong(mCards.get(mPositionInCardsList).get("id"));
sCardBrowserCard = mCol.getCard(cardId);
Intent editCard = new Intent(CardBrowser.this, MultimediaCardEditorActivity.class);
Intent editCard = new Intent(CardBrowser.this, CardEditor.class);
editCard.putExtra(CardEditor.EXTRA_CALLER, CardEditor.CALLER_CARDBROWSER_EDIT);
editCard.putExtra(MultimediaCardEditorActivity.EXTRA_CARD_ID, sCardBrowserCard.getId());
editCard.putExtra(CardEditor.EXTRA_CARD_ID, sCardBrowserCard.getId());
startActivityForResult(editCard, EDIT_CARD);
if (AnkiDroidApp.SDK_VERSION > 4) {
ActivityTransitionAnimation.slide(CardBrowser.this, ActivityTransitionAnimation.LEFT);
Expand Down Expand Up @@ -536,6 +536,9 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
closeCardBrowser(DeckPicker.RESULT_DB_ERROR);
}

// TODO(flerda): Currently we are using the regular card editor and
// delete is not possible. We should probably update this went
// switching back to the multimedia card editor.
if (requestCode == EDIT_CARD && resultCode == MultimediaCardEditorActivity.RESULT_DELETED) {
deleteNote(sCardBrowserCard);
DeckTask.launchDeckTask(DeckTask.TASK_TYPE_DISMISS_NOTE, mDeleteNoteHandler,
Expand Down
3 changes: 1 addition & 2 deletions src/com/ichi2/anki/DeckPicker.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
import android.widget.TextView;

import com.ichi2.anim.ActivityTransitionAnimation;
import com.ichi2.anki.multimediacard.activity.MultimediaCardEditorActivity;
import com.ichi2.anki.receiver.SdCardReceiver;
import com.ichi2.async.Connection;
import com.ichi2.async.Connection.OldAnkiDeckFilter;
Expand Down Expand Up @@ -1117,7 +1116,7 @@ public void loadCounts() {


private void addNote() {
Intent intent = new Intent(DeckPicker.this, MultimediaCardEditorActivity.class);
Intent intent = new Intent(DeckPicker.this, CardEditor.class);
intent.putExtra(CardEditor.EXTRA_CALLER, CardEditor.CALLER_DECKPICKER);
startActivityForResult(intent, ADD_NOTE);
if (AnkiDroidApp.SDK_VERSION > 4) {
Expand Down
3 changes: 1 addition & 2 deletions src/com/ichi2/anki/StudyOptionsFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@

import com.ichi2.anim.ActivityTransitionAnimation;
import com.ichi2.anim.ViewAnimation;
import com.ichi2.anki.multimediacard.activity.MultimediaCardEditorActivity;
import com.ichi2.async.DeckTask;
import com.ichi2.async.DeckTask.TaskData;
import com.ichi2.charts.ChartBuilder;
Expand Down Expand Up @@ -529,7 +528,7 @@ private void openReviewer() {


private void addNote() {
Intent intent = new Intent(getActivity(), MultimediaCardEditorActivity.class);
Intent intent = new Intent(getActivity(), CardEditor.class);
intent.putExtra(CardEditor.EXTRA_CALLER, CardEditor.CALLER_STUDYOPTIONS);
startActivityForResult(intent, ADD_NOTE);
animateLeft();
Expand Down

0 comments on commit 3b07eff

Please sign in to comment.