Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Voice Model Dashboard #996

Open
wants to merge 16 commits into
base: feature/voicecommand
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {

dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0'

}

Expand All @@ -19,6 +19,7 @@ buildscript {
plugins {
id 'maven-publish'
id "com.github.hierynomus.license" version "0.16.1"
id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
}

allprojects {
Expand Down
6 changes: 5 additions & 1 deletion org.envirocar.app/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
android:theme="@style/Theme.Cario">
android:theme="@style/Theme.Cario"
android:usesCleartextTraffic="true">

<!-- Activities -->
<activity
Expand Down Expand Up @@ -106,6 +107,9 @@
<activity
android:name=".views.settings.SettingsActivity"
android:screenOrientation="portrait" />
<activity
android:name=".views.modeldashboard.ModelDashboardActivity"
android:screenOrientation="portrait" />
<activity
android:name=".views.SplashScreenActivity"
android:label="@string/app_name"
Expand Down
8 changes: 7 additions & 1 deletion org.envirocar.app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'com.android.application' //or apply plugin: 'java'
apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'//or apply plugin: 'java'

dependencies {
// Android dependencies.
Expand Down Expand Up @@ -63,6 +64,7 @@ dependencies {
// Coroutines
implementation rootProject.ext.lifecycleExtension
implementation rootProject.ext.coroutines
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.4.1"

// Test
testImplementation 'junit:junit:4.13.2'
Expand Down Expand Up @@ -187,6 +189,10 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled true
}

buildFeatures {
viewBinding = true
}
}

// custom licenseFormat-tasks to access the directories, which are not part of the standard maven directory pattern
Expand Down
5 changes: 5 additions & 0 deletions org.envirocar.app/res/drawable/baseline_delete_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
</vector>
5 changes: 5 additions & 0 deletions org.envirocar.app/res/drawable/baseline_download_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M5,20h14v-2H5V20zM19,9h-4V3H9v6H5l7,7L19,9z"/>
</vector>
5 changes: 5 additions & 0 deletions org.envirocar.app/res/drawable/baseline_error_outline_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M11,15h2v2h-2zM11,7h2v6h-2zM11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z"/>
</vector>
5 changes: 5 additions & 0 deletions org.envirocar.app/res/drawable/baseline_no_internet.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M20,18h2v-8h-2v8zM20,22h2v-2h-2v2zM2,22h16L18,8h4L22,2L2,22z"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M9,9m-4,0a4,4 0,1 1,8 0a4,4 0,1 1,-8 0"/>
<path android:fillColor="@android:color/white" android:pathData="M9,15c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4zM16.76,5.36l-1.68,1.69c0.84,1.18 0.84,2.71 0,3.89l1.68,1.69c2.02,-2.02 2.02,-5.07 0,-7.27zM20.07,2l-1.63,1.63c2.77,3.02 2.77,7.56 0,10.74L20.07,16c3.9,-3.89 3.91,-9.95 0,-14z"/>
</vector>
Binary file added org.envirocar.app/res/font/roboto_bold.ttf
Binary file not shown.
158 changes: 158 additions & 0 deletions org.envirocar.app/res/layout/activity_model_dashboard.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".views.modeldashboard.ModelDashboardActivity">

<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/cario_color_primary"
android:gravity="center"
app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteX="-16dp">

<ImageView
android:layout_width="wrap_content"
android:layout_height="30dp"
android:src="@drawable/img_envirocar_logo_white" />

</LinearLayout>

<info.hoang8f.android.segmented.SegmentedGroup
android:id="@+id/voiceModelSegmentedGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:orientation="horizontal"
android:weightSum="2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout2"
app:sc_border_width="2dp"
app:sc_checked_text_color="@color/white_cario"
app:sc_corner_radius="10dp"
app:sc_tint_color="@color/cario_color_primary">

<RadioButton
android:id="@+id/englishSegmentedButton"
style="@style/RadioButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true"
android:text="English" />

<RadioButton
android:id="@+id/germanSegmentedButton"
style="@style/RadioButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="German" />

</info.hoang8f.android.segmented.SegmentedGroup>

<TextView
android:id="@+id/availableModelTitle"
style="@style/enviroCar.title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="15dp"
android:padding="0dp"
android:text="Available Models"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/voiceModelSegmentedGroup" />


<ProgressBar
android:id="@+id/available_models_progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="30dp"
app:layout_constraintBottom_toBottomOf="@+id/availableModelTitle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.9"
app:layout_constraintStart_toEndOf="@+id/availableModelTitle"
app:layout_constraintTop_toTopOf="@+id/availableModelTitle" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
app:layout_constraintBottom_toTopOf="@+id/guideline2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/availableModelTitle">

<FrameLayout
android:id="@+id/available_content"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</LinearLayout>

<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintGuide_percent="0.6"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/downloadedTitle"
style="@style/enviroCar.title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:padding="0dp"
android:text="Downloaded Models"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/guideline2" />

<ProgressBar
android:id="@+id/downloaded_models_progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="30dp"
app:layout_constraintBottom_toBottomOf="@+id/downloadedTitle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.9"
app:layout_constraintStart_toEndOf="@+id/downloadedTitle"
app:layout_constraintTop_toTopOf="@+id/downloadedTitle" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:maxHeight="200dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/downloadedTitle">

<FrameLayout
android:id="@+id/downloaded_content"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/spacing_medium"
tools:viewBindingIgnore="true"
tools:context="org.envirocar.app.views.trackdetails.TrackStatisticsActivity$PlaceholderFragment">

<lecho.lib.hellocharts.view.LineChartView
Expand Down
88 changes: 88 additions & 0 deletions org.envirocar.app/res/layout/dialog_model_delete.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/cario_color_primary"
android:orientation="horizontal"
android:gravity="center">

<ImageView
android:layout_width="match_parent"
android:layout_height="30dp"
android:src="@drawable/baseline_delete_24"
app:tint="@color/white"
android:layout_weight="1"/>

<TextView
android:id="@+id/model_name_tv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="Delete Model"
android:paddingStart="5dp"
android:fontFamily="@font/roboto_bold"
android:singleLine="true"
android:textColor="@color/white"
app:autoSizeMaxTextSize="17sp"
app:autoSizeMinTextSize="13sp"
app:autoSizeTextType="uniform"
android:layout_weight="0.2"/>

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">

<TextView
android:id="@+id/phase_description_textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/spacing_large"
android:text="Are you sure you want to delete this model?"/>

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="right">

<Button
android:id="@+id/cancel_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"
android:backgroundTint="@color/white"
android:textColor="@color/blue_dark_cario"
android:layout_marginTop="5dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="5dp"
style="?android:attr/borderlessButtonStyle"/>

<Button
android:id="@+id/confirm_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="5dp"
app:backgroundTint="@color/blue_dark_cario"
android:text="Yes"
android:textColor="@color/white_cario" />

</LinearLayout>

</LinearLayout>
Loading