Commit dbc32f3fe268af1c2e03f47d77ad69a17d157fce
1 parent
5146a702
参与人员列表修改
Showing
4 changed files
with
21 additions
and
18 deletions
config.gradle
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/sql/dao/DaoMaster.java
| @@ -21,20 +21,20 @@ public class DaoMaster extends AbstractDaoMaster { | @@ -21,20 +21,20 @@ public class DaoMaster extends AbstractDaoMaster { | ||
| 21 | 21 | ||
| 22 | /** Creates underlying database table using DAOs. */ | 22 | /** Creates underlying database table using DAOs. */ |
| 23 | public static void createAllTables(Database db, boolean ifNotExists) { | 23 | public static void createAllTables(Database db, boolean ifNotExists) { |
| 24 | - CalorieEntityDao.createTable(db, ifNotExists); | ||
| 25 | CollFailedEntityDao.createTable(db, ifNotExists); | 24 | CollFailedEntityDao.createTable(db, ifNotExists); |
| 26 | CollUserStepEntityDao.createTable(db, ifNotExists); | 25 | CollUserStepEntityDao.createTable(db, ifNotExists); |
| 27 | FailedEntityDao.createTable(db, ifNotExists); | 26 | FailedEntityDao.createTable(db, ifNotExists); |
| 28 | UserStepEntityDao.createTable(db, ifNotExists); | 27 | UserStepEntityDao.createTable(db, ifNotExists); |
| 28 | + CalorieEntityDao.createTable(db, ifNotExists); | ||
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | /** Drops underlying database table using DAOs. */ | 31 | /** Drops underlying database table using DAOs. */ |
| 32 | public static void dropAllTables(Database db, boolean ifExists) { | 32 | public static void dropAllTables(Database db, boolean ifExists) { |
| 33 | - CalorieEntityDao.dropTable(db, ifExists); | ||
| 34 | CollFailedEntityDao.dropTable(db, ifExists); | 33 | CollFailedEntityDao.dropTable(db, ifExists); |
| 35 | CollUserStepEntityDao.dropTable(db, ifExists); | 34 | CollUserStepEntityDao.dropTable(db, ifExists); |
| 36 | FailedEntityDao.dropTable(db, ifExists); | 35 | FailedEntityDao.dropTable(db, ifExists); |
| 37 | UserStepEntityDao.dropTable(db, ifExists); | 36 | UserStepEntityDao.dropTable(db, ifExists); |
| 37 | + CalorieEntityDao.dropTable(db, ifExists); | ||
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | /** | 40 | /** |
| @@ -53,11 +53,11 @@ public class DaoMaster extends AbstractDaoMaster { | @@ -53,11 +53,11 @@ public class DaoMaster extends AbstractDaoMaster { | ||
| 53 | 53 | ||
| 54 | public DaoMaster(Database db) { | 54 | public DaoMaster(Database db) { |
| 55 | super(db, SCHEMA_VERSION); | 55 | super(db, SCHEMA_VERSION); |
| 56 | - registerDaoClass(CalorieEntityDao.class); | ||
| 57 | registerDaoClass(CollFailedEntityDao.class); | 56 | registerDaoClass(CollFailedEntityDao.class); |
| 58 | registerDaoClass(CollUserStepEntityDao.class); | 57 | registerDaoClass(CollUserStepEntityDao.class); |
| 59 | registerDaoClass(FailedEntityDao.class); | 58 | registerDaoClass(FailedEntityDao.class); |
| 60 | registerDaoClass(UserStepEntityDao.class); | 59 | registerDaoClass(UserStepEntityDao.class); |
| 60 | + registerDaoClass(CalorieEntityDao.class); | ||
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | public DaoSession newSession() { | 63 | public DaoSession newSession() { |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/sql/dao/DaoSession.java
| @@ -8,17 +8,17 @@ import org.greenrobot.greendao.database.Database; | @@ -8,17 +8,17 @@ import org.greenrobot.greendao.database.Database; | ||
| 8 | import org.greenrobot.greendao.identityscope.IdentityScopeType; | 8 | import org.greenrobot.greendao.identityscope.IdentityScopeType; |
| 9 | import org.greenrobot.greendao.internal.DaoConfig; | 9 | import org.greenrobot.greendao.internal.DaoConfig; |
| 10 | 10 | ||
| 11 | -import com.cnlive.moudle.pedometer.sql.entity.CalorieEntity; | ||
| 12 | import com.cnlive.moudle.pedometer.sql.entity.CollFailedEntity; | 11 | import com.cnlive.moudle.pedometer.sql.entity.CollFailedEntity; |
| 13 | import com.cnlive.moudle.pedometer.sql.entity.CollUserStepEntity; | 12 | import com.cnlive.moudle.pedometer.sql.entity.CollUserStepEntity; |
| 14 | import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; | 13 | import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; |
| 15 | import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity; | 14 | import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity; |
| 15 | +import com.cnlive.moudle.pedometer.sql.entity.CalorieEntity; | ||
| 16 | 16 | ||
| 17 | -import com.cnlive.moudle.pedometer.sql.dao.CalorieEntityDao; | ||
| 18 | import com.cnlive.moudle.pedometer.sql.dao.CollFailedEntityDao; | 17 | import com.cnlive.moudle.pedometer.sql.dao.CollFailedEntityDao; |
| 19 | import com.cnlive.moudle.pedometer.sql.dao.CollUserStepEntityDao; | 18 | import com.cnlive.moudle.pedometer.sql.dao.CollUserStepEntityDao; |
| 20 | import com.cnlive.moudle.pedometer.sql.dao.FailedEntityDao; | 19 | import com.cnlive.moudle.pedometer.sql.dao.FailedEntityDao; |
| 21 | import com.cnlive.moudle.pedometer.sql.dao.UserStepEntityDao; | 20 | import com.cnlive.moudle.pedometer.sql.dao.UserStepEntityDao; |
| 21 | +import com.cnlive.moudle.pedometer.sql.dao.CalorieEntityDao; | ||
| 22 | 22 | ||
| 23 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. | 23 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. |
| 24 | 24 | ||
| @@ -29,25 +29,22 @@ import com.cnlive.moudle.pedometer.sql.dao.UserStepEntityDao; | @@ -29,25 +29,22 @@ import com.cnlive.moudle.pedometer.sql.dao.UserStepEntityDao; | ||
| 29 | */ | 29 | */ |
| 30 | public class DaoSession extends AbstractDaoSession { | 30 | public class DaoSession extends AbstractDaoSession { |
| 31 | 31 | ||
| 32 | - private final DaoConfig calorieEntityDaoConfig; | ||
| 33 | private final DaoConfig collFailedEntityDaoConfig; | 32 | private final DaoConfig collFailedEntityDaoConfig; |
| 34 | private final DaoConfig collUserStepEntityDaoConfig; | 33 | private final DaoConfig collUserStepEntityDaoConfig; |
| 35 | private final DaoConfig failedEntityDaoConfig; | 34 | private final DaoConfig failedEntityDaoConfig; |
| 36 | private final DaoConfig userStepEntityDaoConfig; | 35 | private final DaoConfig userStepEntityDaoConfig; |
| 36 | + private final DaoConfig calorieEntityDaoConfig; | ||
| 37 | 37 | ||
| 38 | - private final CalorieEntityDao calorieEntityDao; | ||
| 39 | private final CollFailedEntityDao collFailedEntityDao; | 38 | private final CollFailedEntityDao collFailedEntityDao; |
| 40 | private final CollUserStepEntityDao collUserStepEntityDao; | 39 | private final CollUserStepEntityDao collUserStepEntityDao; |
| 41 | private final FailedEntityDao failedEntityDao; | 40 | private final FailedEntityDao failedEntityDao; |
| 42 | private final UserStepEntityDao userStepEntityDao; | 41 | private final UserStepEntityDao userStepEntityDao; |
| 42 | + private final CalorieEntityDao calorieEntityDao; | ||
| 43 | 43 | ||
| 44 | public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig> | 44 | public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig> |
| 45 | daoConfigMap) { | 45 | daoConfigMap) { |
| 46 | super(db); | 46 | super(db); |
| 47 | 47 | ||
| 48 | - calorieEntityDaoConfig = daoConfigMap.get(CalorieEntityDao.class).clone(); | ||
| 49 | - calorieEntityDaoConfig.initIdentityScope(type); | ||
| 50 | - | ||
| 51 | collFailedEntityDaoConfig = daoConfigMap.get(CollFailedEntityDao.class).clone(); | 48 | collFailedEntityDaoConfig = daoConfigMap.get(CollFailedEntityDao.class).clone(); |
| 52 | collFailedEntityDaoConfig.initIdentityScope(type); | 49 | collFailedEntityDaoConfig.initIdentityScope(type); |
| 53 | 50 | ||
| @@ -60,29 +57,28 @@ public class DaoSession extends AbstractDaoSession { | @@ -60,29 +57,28 @@ public class DaoSession extends AbstractDaoSession { | ||
| 60 | userStepEntityDaoConfig = daoConfigMap.get(UserStepEntityDao.class).clone(); | 57 | userStepEntityDaoConfig = daoConfigMap.get(UserStepEntityDao.class).clone(); |
| 61 | userStepEntityDaoConfig.initIdentityScope(type); | 58 | userStepEntityDaoConfig.initIdentityScope(type); |
| 62 | 59 | ||
| 63 | - calorieEntityDao = new CalorieEntityDao(calorieEntityDaoConfig, this); | 60 | + calorieEntityDaoConfig = daoConfigMap.get(CalorieEntityDao.class).clone(); |
| 61 | + calorieEntityDaoConfig.initIdentityScope(type); | ||
| 62 | + | ||
| 64 | collFailedEntityDao = new CollFailedEntityDao(collFailedEntityDaoConfig, this); | 63 | collFailedEntityDao = new CollFailedEntityDao(collFailedEntityDaoConfig, this); |
| 65 | collUserStepEntityDao = new CollUserStepEntityDao(collUserStepEntityDaoConfig, this); | 64 | collUserStepEntityDao = new CollUserStepEntityDao(collUserStepEntityDaoConfig, this); |
| 66 | failedEntityDao = new FailedEntityDao(failedEntityDaoConfig, this); | 65 | failedEntityDao = new FailedEntityDao(failedEntityDaoConfig, this); |
| 67 | userStepEntityDao = new UserStepEntityDao(userStepEntityDaoConfig, this); | 66 | userStepEntityDao = new UserStepEntityDao(userStepEntityDaoConfig, this); |
| 67 | + calorieEntityDao = new CalorieEntityDao(calorieEntityDaoConfig, this); | ||
| 68 | 68 | ||
| 69 | - registerDao(CalorieEntity.class, calorieEntityDao); | ||
| 70 | registerDao(CollFailedEntity.class, collFailedEntityDao); | 69 | registerDao(CollFailedEntity.class, collFailedEntityDao); |
| 71 | registerDao(CollUserStepEntity.class, collUserStepEntityDao); | 70 | registerDao(CollUserStepEntity.class, collUserStepEntityDao); |
| 72 | registerDao(FailedEntity.class, failedEntityDao); | 71 | registerDao(FailedEntity.class, failedEntityDao); |
| 73 | registerDao(UserStepEntity.class, userStepEntityDao); | 72 | registerDao(UserStepEntity.class, userStepEntityDao); |
| 73 | + registerDao(CalorieEntity.class, calorieEntityDao); | ||
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | public void clear() { | 76 | public void clear() { |
| 77 | - calorieEntityDaoConfig.clearIdentityScope(); | ||
| 78 | collFailedEntityDaoConfig.clearIdentityScope(); | 77 | collFailedEntityDaoConfig.clearIdentityScope(); |
| 79 | collUserStepEntityDaoConfig.clearIdentityScope(); | 78 | collUserStepEntityDaoConfig.clearIdentityScope(); |
| 80 | failedEntityDaoConfig.clearIdentityScope(); | 79 | failedEntityDaoConfig.clearIdentityScope(); |
| 81 | userStepEntityDaoConfig.clearIdentityScope(); | 80 | userStepEntityDaoConfig.clearIdentityScope(); |
| 82 | - } | ||
| 83 | - | ||
| 84 | - public CalorieEntityDao getCalorieEntityDao() { | ||
| 85 | - return calorieEntityDao; | 81 | + calorieEntityDaoConfig.clearIdentityScope(); |
| 86 | } | 82 | } |
| 87 | 83 | ||
| 88 | public CollFailedEntityDao getCollFailedEntityDao() { | 84 | public CollFailedEntityDao getCollFailedEntityDao() { |
| @@ -101,4 +97,8 @@ public class DaoSession extends AbstractDaoSession { | @@ -101,4 +97,8 @@ public class DaoSession extends AbstractDaoSession { | ||
| 101 | return userStepEntityDao; | 97 | return userStepEntityDao; |
| 102 | } | 98 | } |
| 103 | 99 | ||
| 100 | + public CalorieEntityDao getCalorieEntityDao() { | ||
| 101 | + return calorieEntityDao; | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | } | 104 | } |
moudle_pedometer/src/main/res/layout/item_tabke_part.xml
| @@ -22,7 +22,10 @@ | @@ -22,7 +22,10 @@ | ||
| 22 | android:textSize="15sp" | 22 | android:textSize="15sp" |
| 23 | android:textColor="#333333" | 23 | android:textColor="#333333" |
| 24 | android:layout_toRightOf="@id/icon_img" | 24 | android:layout_toRightOf="@id/icon_img" |
| 25 | + android:lines="1" | ||
| 26 | + android:ellipsize="end" | ||
| 25 | android:layout_centerVertical="true" | 27 | android:layout_centerVertical="true" |
| 28 | + android:layout_marginRight="5dp" | ||
| 26 | /> | 29 | /> |
| 27 | 30 | ||
| 28 | <View | 31 | <View |