1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-27 12:26:48 +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' //version = '0.9.2-SNAPSHOT'
dependencies { dependencies {
compile 'org.greenrobot:greendao-generator:2.2.0' // compile 'org.greenrobot:greendao-generator:2.2.0'
compile 'com.github.freeyourgadget:greendao:c3830951e5dd3d1e63d7bac600d5f773b81df363'
} }
sourceSets { sourceSets {

View File

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

View File

@ -54,7 +54,7 @@ dependencies {
compile 'com.github.PhilJay:MPAndroidChart:v2.2.4' compile 'com.github.PhilJay:MPAndroidChart:v2.2.4'
compile 'com.github.pfichtner:durationformatter:0.1.1' compile 'com.github.pfichtner:durationformatter:0.1.1'
compile 'de.cketti.library.changelog:ckchangelog:1.2.2' 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") preBuild.dependsOn(":GBDaoGenerator:genSources")

View File

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