Skip to content

Commit

Permalink
Added TimeOfDay generator.
Browse files Browse the repository at this point in the history
  • Loading branch information
audaciouscode committed Aug 13, 2017
1 parent c938384 commit c743936
Show file tree
Hide file tree
Showing 35 changed files with 711 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.gradle
Expand Up @@ -71,6 +71,7 @@ android {
compile 'com.fasterxml.jackson.core:jackson-core:2.8.8'
compile 'com.github.philjay:mpandroidchart:v3.0.1'
compile 'com.rvalerio:fgchecker:1.0.1'
compile 'com.luckycatlabs:SunriseSunsetCalculator:1.2'
}

buildTypes {
Expand Down
Binary file added res/drawable-hdpi/ic_afternoon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_evening.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_morning.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_night_morning.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_night_night.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_time_of_day.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_afternoon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_evening.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_morning.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_night_morning.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_night_night.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_time_of_day.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_afternoon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_evening.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_morning.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_night_morning.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_night_night.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_time_of_day.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_afternoon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_evening.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_morning.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_night_morning.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_night_night.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_time_of_day.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxxhdpi/ic_afternoon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxxhdpi/ic_evening.png
Binary file added res/drawable-xxxhdpi/ic_morning.png
Binary file added res/drawable-xxxhdpi/ic_night_morning.png
Binary file added res/drawable-xxxhdpi/ic_night_night.png
Binary file added res/drawable-xxxhdpi/ic_time_of_day.png
184 changes: 184 additions & 0 deletions res/layout/card_generator_time_of_day.xml
@@ -0,0 +1,184 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="DuplicateIds,ContentDescription,SpUsage"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardCornerRadius="4dp"
android:layout_margin="8dp"
tools:ignore="UnusedIds">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#0288D1"
android:padding="8dp"
android:baselineAligned="false">
<ImageView android:src="@drawable/ic_time_of_day"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="8dp" />
<TextView android:text="@string/generator_time_of_day"
android:gravity="center_vertical|start"
android:layout_width="0dp"
android:layout_height="24dp"
android:layout_weight="1"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="@android:color/white" />
<TextView android:id="@+id/generator_data_point_date"
android:gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:textSize="12sp"
android:textColor="@android:color/white"
android:layout_marginRight="8dp"/>
</LinearLayout>
<LinearLayout android:id="@+id/card_content"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:padding="16dp">

<LinearLayout android:id="@+id/cell_night_morning"
android:orientation="vertical"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:layout_weight="1">
<ImageView android:layout_gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="64dp"
android:src="@drawable/ic_night_morning"/>
<TextView android:id="@+id/label_first_night"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/label_time_night"/>
</LinearLayout>

<LinearLayout android:id="@+id/cell_morning"
android:orientation="vertical"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:layout_weight="1">
<ImageView android:layout_gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="64dp"
android:src="@drawable/ic_morning"/>
<TextView android:id="@+id/label_first_night"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/label_time_morning"/>
</LinearLayout>

<LinearLayout android:id="@+id/cell_afternoon"
android:orientation="vertical"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:layout_weight="1">
<ImageView android:layout_gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="64dp"
android:src="@drawable/ic_afternoon"/>
<TextView android:id="@+id/label_first_night"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/label_time_afternoon"/>
</LinearLayout>

<LinearLayout android:id="@+id/cell_evening"
android:orientation="vertical"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:layout_weight="1">
<ImageView android:layout_gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="64dp"
android:src="@drawable/ic_evening"/>
<TextView android:id="@+id/label_first_night"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/label_time_evening"/>
</LinearLayout>

<LinearLayout android:id="@+id/cell_night_night"
android:orientation="vertical"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<ImageView android:layout_gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="64dp"
android:src="@drawable/ic_night_night"/>
<TextView android:id="@+id/label_first_night"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/label_time_night"/>
</LinearLayout>
</LinearLayout>

<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:paddingBottom="16dp">
<TextView android:text="@string/label_sunrise"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_marginRight="4dp"
android:textSize="16sp"
android:gravity="right"/>
<TextView android:id="@+id/label_sunrise"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:textSize="16sp"
android:gravity="left"/>
<TextView android:text="@string/label_sunset"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_marginRight="4dp"
android:layout_height="wrap_content"
android:textSize="16sp"
android:gravity="right"/>
<TextView android:id="@+id/label_sunset"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:textSize="16sp"
android:gravity="left"/>
</LinearLayout>
<TextView android:id="@+id/card_empty"
android:text="@string/message_generator_foreground_applications_empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="16dp" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
3 changes: 3 additions & 0 deletions res/values/databases.xml
Expand Up @@ -40,4 +40,7 @@

<!-- System Status Generator -->
<string name="pdk_generator_diagnostics_system_status_create_history_table">CREATE TABLE history(_id INTEGER PRIMARY KEY AUTOINCREMENT, fetched INTEGER, transmitted INTEGER, observed INTEGER, runtime INTEGER, storage_app INTEGER, storage_other INTEGER, storage_available INTEGER, storage_total INTEGER, storage_path TEXT);</string>

<!-- Time of Day Status Generator -->
<string name="pdk_generator_time_of_day_create_history_table">CREATE TABLE history(_id INTEGER PRIMARY KEY AUTOINCREMENT, fetched INTEGER, transmitted INTEGER, observed INTEGER, latitude REAL, longitude REAL, timezone TEXT, sunrise INTEGER, sunset INTEGER);</string>
</resources>
11 changes: 11 additions & 0 deletions res/values/generators.xml
Expand Up @@ -14,6 +14,7 @@
<item>com.audacious_software.passive_data_kit.generators.device.ForegroundApplication</item>
<item>com.audacious_software.passive_data_kit.generators.wearables.WithingsDevice</item>
<item>com.audacious_software.passive_data_kit.generators.diagnostics.SystemStatus</item>
<item>com.audacious_software.passive_data_kit.generators.environment.TimeOfDay</item>
</string-array>

<string-array name="pdk_app_generators" tools:ignore="InconsistentArrays"></string-array>
Expand Down Expand Up @@ -210,5 +211,15 @@
<!-- <color name="generator_system_status_other">#757575</color> -->
<string name="generator_system_status_runtime">Continuous Runtime: %1$s</string>
<string name="generator_system_status_runtime_formatted">%1$dd %2$s:%3$s:%4$s.%5$s</string>

<!-- Time of Day -->
<string name="generator_time_of_day">Time Of Day</string>
<string name="label_time_night">Night</string>
<string name="label_time_morning">Morning</string>
<string name="label_time_afternoon">Afternoon</string>
<string name="label_time_evening">Evening</string>

<string name="label_sunrise">Sunrise:</string>
<string name="label_sunset">Sunset:</string>
</resources>

0 comments on commit c743936

Please sign in to comment.