@@ -98,7 +98,7 @@ public void addItem(final Activity activity) {
9898 .title (R .string .info_add_new_title )
9999 .customView (R .layout .flash_dialog_add_edit_item , true )
100100 .positiveText (R .string .info_template_add )
101- .negativeText (R .string .info_template_delete )
101+ .negativeText (R .string .info_template_cancel )
102102 .build ();
103103
104104 final EditText question = (EditText ) dialog .findViewById (R .id .flash_question );
@@ -152,16 +152,16 @@ public void onClick(View v) {
152152
153153
154154 @ Override
155- public void editItem (final Activity activity , int position ) {
155+ public void editItem (final Activity activity , final int position ) {
156156 mIsPhotoAttached = true ;
157157
158158 FlashCardModel data = mData .get (position );
159159
160160 final MaterialDialog dialog = new MaterialDialog .Builder (activity )
161- .title (R .string .info_add_new_title )
161+ .title (R .string .info_edit_title )
162162 .customView (R .layout .flash_dialog_add_edit_item , true )
163- .positiveText (R .string .info_template_add )
164- .negativeText (R .string .info_template_delete )
163+ .positiveText (R .string .info_template_ok )
164+ .negativeText (R .string .info_template_cancel )
165165 .build ();
166166
167167 final EditText question = (EditText ) dialog .findViewById (R .id .flash_question );
@@ -207,7 +207,7 @@ public void onClick(View v) {
207207 String questionText = question .getText ().toString ();
208208 String answerText = answer .getText ().toString ();
209209 String hintText = answerHint .getText ().toString ();
210- mData .add ( new FlashCardModel (questionText , answerText , hintText , bitmap ));
210+ mData .set ( position , new FlashCardModel (questionText , answerText , hintText , bitmap ));
211211 mAdapter .notifyDataSetChanged ();
212212 }
213213
0 commit comments