Skip to content

Commit

Permalink
1.2.1
Browse files Browse the repository at this point in the history
release v1.2.1
  • Loading branch information
Balcan authored Mar 26, 2019
2 parents e04175a + 9ec79d7 commit 73ce7e8
Show file tree
Hide file tree
Showing 152 changed files with 6,669 additions and 6,041 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
/captures
.externalNativeBuild
/app/dhis_keystore.jks
dhis2-rule-engine/
/app/src/main/res/raw/testing_credentials.json
7 changes: 7 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[submodule "dhis2-android-sdk"]
path = dhis2-android-sdk
url = [email protected]:dhis2/dhis2-android-sdk.git
[submodule "dhis2-rule-engine"]
path = dhis2-rule-engine
url = [email protected]:quadramqs/dhis2-rule-engine.git

3 changes: 2 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/build
/dhis_keystore.jks
/dhis_keystore.jks
/src/main/res/raw/testing_credentials.json
12 changes: 5 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ sonarqube {

dependencies {

// implementation project(":core")
implementation project(":customFab")
// implementation project(":dhis2-rule-engine")
implementation project(":dhis2-rule-engine")
implementation project(":viewpagerdotsindicator")

//region SUPPORT LIBRARIES
Expand All @@ -175,12 +176,7 @@ dependencies {
exclude group: "org.hisp.dhis", module: "core-rules"
}

/* implementation("org.hisp.dhis:android-rules:${libraries.dhis2sdk}") {
exclude group: "com.google.code.findbugs", module: "jsr305"
exclude group: "org.hisp.dhis", module: "core-rules"
}*/

implementation "org.hisp.dhis.rules:rule-engine:${libraries.ruleEngine}"
//implementation "org.hisp.dhis.rules:rule-engine:${libraries.ruleEngine}"
//endregion

//region UI LIBRARIES
Expand All @@ -200,6 +196,8 @@ dependencies {
implementation "io.reactivex.rxjava2:rxandroid:${libraries.rxandroid}"
implementation "io.reactivex.rxjava2:rxjava:${libraries.rxjava}"
implementation "com.github.akarnokd:rxjava2-interop:${libraries.rxjavainteroperop}"
implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0'

//rxbinding
implementation "com.jakewharton.rxbinding2:rxbinding:${libraries.rxbindings}"
implementation "com.jakewharton.rxbinding2:rxbinding-appcompat-v7:${libraries.rxbindings}"
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<application
android:name=".App"
android:allowBackup="false"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
Expand All @@ -31,10 +30,10 @@
android:required="false" />

<activity
android:name=".usescases.splash.SplashActivity">
android:name=".usescases.splash.SplashActivity"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
Expand Down Expand Up @@ -98,6 +97,7 @@
<activity android:name=".usescases.reservedValue.ReservedValueActivity" />
<activity android:name=".usescases.eventsWithoutRegistration.eventCapture.EventCaptureActivity" />
<activity android:name=".usescases.sync.SyncActivity" />
<activity android:name=".usescases.enrollment.EnrollmentActivity" />
</application>

</manifest>
18 changes: 16 additions & 2 deletions app/src/main/java/org/dhis2/Bindings/Bindings.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.drawable.AnimatedVectorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
Expand Down Expand Up @@ -47,6 +48,17 @@

public class Bindings {

@BindingAdapter("elevation")
public static void setElevation(View view, float elevation) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
view.setElevation(elevation);
} else {
Drawable drawable = view.getResources().getDrawable(android.R.drawable.dialog_holo_light_frame);
drawable.setColorFilter(new PorterDuffColorFilter(view.getResources().getColor(R.color.colorGreyDefault), PorterDuff.Mode.MULTIPLY));
view.setBackground(drawable);
}
}

@BindingAdapter("date")
public static void setDate(TextView textView, String date) {
SimpleDateFormat formatIn = DateUtils.databaseDateFormat();
Expand Down Expand Up @@ -258,11 +270,11 @@ public static void setEventText(TextView view, EventModel event, EnrollmentModel

@BindingAdapter(value = {"eventColor", "eventProgramStage", "eventProgram"})
public static void setEventColor(View view, EventModel event, ProgramStageModel programStage, ProgramModel program) {
if(event!=null) {
if (event != null) {
int bgColor;
if (DateUtils.getInstance().isEventExpired(null, event.completedDate(), program.completeEventsExpiryDays())) {
bgColor = R.drawable.item_event_dark_gray_ripple;
} else {
} else if (event.status() != null) {
switch (event.status()) {
case ACTIVE:
if (DateUtils.getInstance().hasExpired(event, program.expiryDays(), program.completeEventsExpiryDays(), programStage.periodType() != null ? programStage.periodType() : program.expiryPeriodType())) {
Expand All @@ -288,6 +300,8 @@ public static void setEventColor(View view, EventModel event, ProgramStageModel
bgColor = R.drawable.item_event_red_ripple;
break;
}
} else {
bgColor = R.drawable.item_event_red_ripple;
}
view.setBackground(ContextCompat.getDrawable(view.getContext(), bgColor));
}
Expand Down
Loading

0 comments on commit 73ce7e8

Please sign in to comment.