1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-23 18:36:50 +01:00

Further WIP towards greendao:

- for now, use a custom version of greendao with the fix 39ac07be550c5f5b6fd265c8870f58015c95e908
- use a superclass for activity sample classes that provides value normalization using SampleProvider
This commit is contained in:
cpfeiffer 2016-05-01 23:56:14 +02:00
parent 4744d8b59e
commit 70eaca8883
4 changed files with 20 additions and 18 deletions

View File

@ -6,7 +6,8 @@ archivesBaseName = 'gadgetbridge-daogenerator'
//version = '0.9.2-SNAPSHOT'
dependencies {
compile 'org.greenrobot:greendao-generator:2.2.0'
// compile 'org.greenrobot:greendao-generator:2.2.0'
compile 'com.github.freeyourgadget:greendao:c3830951e5dd3d1e63d7bac600d5f773b81df363'
}
sourceSets {

View File

@ -115,6 +115,7 @@ public class GBDaoGenerator {
}
private static void addCommonAcivitySampleProperties(Schema schema, Entity activitySample, Entity user, Entity device) {
activitySample.setSuperclass("AbstractActivitySample");
activitySample.addImport(MODEL_PACKAGE + ".ActivitySample");
activitySample.addImport(MAIN_PACKAGE + ".devices.SampleProvider");
activitySample.implementsInterface("ActivitySample");

View File

@ -54,7 +54,7 @@ dependencies {
compile 'com.github.PhilJay:MPAndroidChart:v2.2.4'
compile 'com.github.pfichtner:durationformatter:0.1.1'
compile 'de.cketti.library.changelog:ckchangelog:1.2.2'
compile 'org.greenrobot:greendao:2.2.0'
compile 'com.github.freeyourgadget:greendao:c3830951e5dd3d1e63d7bac600d5f773b81df363'
}
preBuild.dependsOn(":GBDaoGenerator:genSources")

View File

@ -3,34 +3,34 @@ package nodomain.freeyourgadget.gadgetbridge.model;
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
public interface ActivitySample extends TimeStamped {
// /**
// * Returns the provider of the data.
// *
// * @return who created the sample data
// */
// SampleProvider getProvider();
/**
* Returns the provider of the data.
*
* @return who created the sample data
*/
SampleProvider getProvider();
/**
* Returns the raw activity kind value as recorded by the SampleProvider
*/
int getRawKind();
// /**
// * Returns the activity kind value as recorded by the SampleProvider
// *
// * @see ActivityKind
// */
// int getKind();
/**
* Returns the activity kind value as recorded by the SampleProvider
*
* @see ActivityKind
*/
int getKind();
/**
* Returns the raw intensity value as recorded by the SampleProvider
*/
int getRawIntensity();
// /**
// * Returns the normalized intensity value between 0 and 1
// */
// float getIntensity();
/**
* Returns the normalized intensity value between 0 and 1
*/
float getIntensity();
/**
* Returns the number of steps performed during the period of this sample