@@ -100,6 +100,7 @@ public class DBService {
|
||
| 100 | 100 |
public void addPhotoBean(PhotoBean bean){
|
| 101 | 101 |
SQLiteDatabase db = null; |
| 102 | 102 |
synchronized (DB_LOCK) {
|
| 103 |
+ LogHelper.d(TAG,"dbservice addUploadPhoto "+bean.photoId); |
|
| 103 | 104 |
try {
|
| 104 | 105 |
db = dbHelper.getWritableDatabase(); |
| 105 | 106 |
db.beginTransaction(); |
@@ -127,6 +128,7 @@ public class DBService {
|
||
| 127 | 128 |
SQLiteDatabase db = null; |
| 128 | 129 |
synchronized (DB_LOCK) {
|
| 129 | 130 |
try {
|
| 131 |
+ LogHelper.d(TAG,"dbservice deletePhotoBean "+bean.photoId); |
|
| 130 | 132 |
db = dbHelper.getReadableDatabase(); |
| 131 | 133 |
db.beginTransaction(); |
| 132 | 134 |
db.execSQL("delete from " + DBHelper.PHOTO_INFO_TABLE + " where "
|
@@ -151,12 +153,14 @@ public class DBService {
|
||
| 151 | 153 |
Cursor c = null; |
| 152 | 154 |
synchronized (DB_LOCK) {
|
| 153 | 155 |
try {
|
| 156 |
+ LogHelper.d(TAG,"dbservice getSessionBeanListByDay "); |
|
| 154 | 157 |
db = dbHelper.getReadableDatabase(); |
| 155 | 158 |
db.beginTransaction(); |
| 156 | 159 |
c = db.rawQuery("select * from " + DBHelper.PHOTO_INFO_TABLE + " where "
|
| 157 | 160 |
+ DBHelper.PHOTO_INFO_COLUMNS.SESSION_DATE + " = '" + sessionDate + "' order by " + DBHelper.PHOTO_INFO_COLUMNS.SESSION_SEQ + " desc", null); |
| 158 | 161 |
while (c.moveToNext()) {
|
| 159 | 162 |
PhotoBean photoBean = cursor2PhotoBean(c); |
| 163 |
+ LogHelper.d(TAG,"dbservice getSessionBeanListByDay photo found"+photoBean.photoId); |
|
| 160 | 164 |
if(sessionBeanArrayList.size()==0 || sessionBeanArrayList.get(sessionBeanArrayList.size()-1).sessionSeq!=photoBean.sessionSeq){
|
| 161 | 165 |
SessionBean sessionBean = new SessionBean(); |
| 162 | 166 |
sessionBean.sessionDate = photoBean.sessionDate; |
@@ -2,6 +2,8 @@ package ai.pai.lensman.session; |
||
| 2 | 2 |
|
| 3 | 3 |
import android.content.Intent; |
| 4 | 4 |
|
| 5 |
+import com.android.common.utils.LogHelper; |
|
| 6 |
+ |
|
| 5 | 7 |
import java.util.ArrayList; |
| 6 | 8 |
|
| 7 | 9 |
import ai.pai.lensman.App; |
@@ -79,6 +81,7 @@ public class SessionPresenter implements SessionContract.Presenter, SessionInter |
||
| 79 | 81 |
DBService.getInstance().addPhotoBean(bean); |
| 80 | 82 |
sessionView.showPhotoRecyclerView(); |
| 81 | 83 |
sessionView.addNewPhoto(bean); |
| 84 |
+ photoList.add(0,bean); |
|
| 82 | 85 |
App.getAppContext().startService(new Intent(App.getAppContext(), UploadService.class)); |
| 83 | 86 |
} |
| 84 | 87 |
|
@@ -93,6 +96,7 @@ public class SessionPresenter implements SessionContract.Presenter, SessionInter |
||
| 93 | 96 |
return; |
| 94 | 97 |
} |
| 95 | 98 |
PhotoBean photoBean = photoList.get(index); |
| 99 |
+ LogHelper.d("DBService","swipeToDeletePhoto" +photoBean.photoId);
|
|
| 96 | 100 |
photoList.remove(photoBean); |
| 97 | 101 |
DBService.getInstance().deletePhotoBean(photoBean); |
| 98 | 102 |
interactor.deletePhoto(photoBean); |