Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

Commit

Permalink
Final fixes before release
Browse files Browse the repository at this point in the history
  • Loading branch information
jilleb committed Nov 25, 2018
1 parent 40f8a6d commit b02a840
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 16 deletions.
27 changes: 22 additions & 5 deletions app/src/main/java/com/mqbcoding/stats/MainCarActivity.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mqbcoding.stats;

import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
Expand Down Expand Up @@ -92,9 +93,14 @@ public void onCreate(Bundle bundle) {

SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
String selectedTheme = sharedPreferences.getString("selectedTheme", "VW GTI");

//todo: make signal and other icons optional:
// Boolean signalOn = sharedPreferences.getBoolean("signalActive", false);

Log.d(TAG, "Selected theme: " + selectedTheme);
setTheme(R.style.AppTheme_VolkswagenGTI);


switch (selectedTheme) {
case "VW GTI":
setTheme(R.style.AppTheme_VolkswagenGTI);
Expand Down Expand Up @@ -155,15 +161,26 @@ public void onCreate(Bundle bundle) {
Log.d(TAG, "Set theme: " + selectedTheme);

setContentView(R.layout.activity_car_main);
// getWindow().getDecorView().setBackgroundColor(Color.WHITE);


// todo: make background user selectable:
// View someView = findViewById(R.id.fragment_container);

// Find the root view
//View root = someView.getRootView();

// Set the background
//root.setBackground(someView.getContext().getDrawable(R.drawable.background_incar_outrun));




CarUiController carUiController = getCarUiController();
carUiController.getStatusBarController().showTitle();
//force night mode
carUiController.getStatusBarController().setDayNightStyle(DayNightStyle.FORCE_NIGHT);

//todo: make these user options
//hide all stuff you don't want to see on your screen
// carUiController.getStatusBarController().hideBatteryLevel();
// carUiController.getStatusBarController().hideMicButton();
Expand Down Expand Up @@ -209,10 +226,10 @@ public void onCreate(Bundle bundle) {
.setType(MenuItem.Type.ITEM)
.build());

mainMenu.addMenuItem(MENU_CARDATA, new MenuItem.Builder()
.setTitle(getString(R.string.activity_carstatus_title))
.setType(MenuItem.Type.ITEM)
.build());
// mainMenu.addMenuItem(MENU_CARDATA, new MenuItem.Builder()
// .setTitle(getString(R.string.activity_carstatus_title))
// .setType(MenuItem.Type.ITEM)
// .build());

mainMenu.addMenuItem(MENU_STOPWATCH, new MenuItem.Builder()
.setTitle(getString(R.string.activity_stopwatch_title))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,



//todo: make stopwatch clocks identical in styling, to the dashboardfragment

mStopwatch = rootView.findViewById(R.id.dialMeasStopWatch);
mStopwatch.setSpeedTextTypeface(typeface);
Expand Down
22 changes: 11 additions & 11 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@

<style name="AppTheme.AudiTT" parent="AppTheme.Car">
<item name="themedDialBackground">@drawable/dial_background_marks_audi4</item>
<item name="themedEmptyDialBackground">@drawable/dial_background_audi4</item>
<item name="themedEmptyDialBackground">@drawable/dial_background_marks_audi4</item>
<item name="themedCarBackground">@drawable/background_incar_plain</item>
<item name="themedNeedle">@drawable/needle_audi4</item>
<item name="sv_markColor">@android:color/transparent</item>
<item name="themedStopWatchBackground">@drawable/dial_background_audi4</item>
<item name="themedNeedleColor">@color/red</item>
<item name="sv_tickPadding">20dp</item>
<item name="sv_tickPadding">5dp</item>
</style>
<style name="AppTheme.Volkswagen" parent="AppTheme.Car">
<item name="themedDialBackground">@drawable/dial_background_marks</item>
Expand All @@ -130,23 +130,23 @@
</style>
<style name="AppTheme.Audi" parent="AppTheme.Car">
<item name="themedDialBackground">@drawable/dial_background_marks_audi</item>
<item name="themedEmptyDialBackground">@drawable/dial_background_audi</item>
<item name="themedEmptyDialBackground">@drawable/dial_background_marks_audi</item>
<item name="themedCarBackground">@drawable/background_incar_vw3</item>
<item name="themedNeedle">@drawable/needle_audi_red</item>
<item name="sv_markColor">@android:color/white</item>
<item name="sv_markColor">@android:color/transparent</item>
<item name="themedStopWatchBackground">@drawable/sw_background_audi</item>
<item name="themedNeedleColor">@color/red</item>
<item name="sv_tickPadding">20dp</item>
</style>
<style name="AppTheme.AudiVC" parent="AppTheme.Car">
<item name="themedDialBackground">@drawable/dial_background_marks_audi3</item>
<item name="themedEmptyDialBackground">@drawable/dial_background_audi3</item>
<item name="themedEmptyDialBackground">@drawable/dial_background_marks_audi3</item>
<item name="themedCarBackground">@drawable/background_incar_vw3</item>
<item name="themedNeedle">@drawable/needle_audi3</item>
<item name="sv_markColor">@android:color/transparent</item>
<item name="themedStopWatchBackground">@drawable/dial_background_audi3</item>
<item name="themedNeedleColor">@color/red</item>
<item name="sv_tickPadding">20dp</item>
<item name="sv_tickPadding">5dp</item>
</style>
<style name="AppTheme.Clubsport" parent="AppTheme.Car">
<item name="themedDialBackground">@drawable/dial_background_vw2</item>
Expand Down Expand Up @@ -193,17 +193,17 @@
<style name="AppTheme.SkodaVC" parent="AppTheme.Car">
<item name="themedCarBackground">@drawable/background_incar_black</item>
<item name="themedDialBackground">@drawable/dial_background_marks_skoda3</item>
<item name="themedEmptyDialBackground">@drawable/dial_background_skoda3</item>
<item name="themedEmptyDialBackground">@drawable/dial_background_marks_skoda3</item>
<item name="themedNeedle">@drawable/needle_skoda_2</item>
<item name="sv_markColor">@android:color/transparent</item>
<item name="themedStopWatchBackground">@drawable/dial_background_skoda3</item>
<item name="themedNeedleColor">@color/red</item>
<item name="sv_tickPadding">20dp</item>
<item name="sv_tickPadding">5dp</item>
</style>
<style name="AppTheme.SkodaOneApp" parent="AppTheme.Car">
<item name="themedCarBackground">@drawable/background_incar_skodaone</item>
<item name="themedDialBackground">@drawable/dial_background_marks_skodaone</item>
<item name="themedEmptyDialBackground">@drawable/dial_background_empty_skodaone</item>
<item name="themedEmptyDialBackground">@drawable/dial_background_marks_skodaone</item>
<item name="themedNeedle">@drawable/needle_mib2p</item>
<item name="sv_markColor">@android:color/transparent</item>
<item name="themedStopWatchBackground">@drawable/sw_background_skodaone</item>
Expand All @@ -213,7 +213,7 @@
<item name="sv_indicator">HalfLineIndicator</item>
<item name="sv_indicatorColor">#FFFFFFFF</item>
<item name="sv_indicatorWidth">4dp</item>
<item name="sv_tickPadding">20dp</item>
<item name="sv_tickPadding">0dp</item>
<item name="sv_speedometerWidth">400dp</item>
</style>
<style name="AppTheme.Testing" parent="AppTheme.Car">
Expand All @@ -229,7 +229,7 @@
<style name="AppTheme.Minimalistic" parent="AppTheme.Car">
<item name="themedCarBackground">@drawable/background_incar_black</item>
<item name="themedDialBackground">@drawable/dial_background_minimal</item>
<item name="themedEmptyDialBackground">@drawable/dial_background_empty_minimal</item>
<item name="themedEmptyDialBackground">@drawable/dial_background_minimal</item>
<item name="themedNeedle">@drawable/needle_mib2p</item>
<item name="sv_markColor">@android:color/transparent</item>
<item name="themedStopWatchBackground">@drawable/dial_background_empty_minimal</item>
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/res/xml/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,17 @@
android:key="debugQuery"
android:summary="%s"
android:title="Debug query" />
<!--todo: make clock and signal and stuff optional
<EditTextPreference
android:defaultValue="false"
android:key="signalActive"
android:summary="@pref_showsignalstrength_summary"
android:title="@string/pref_showsignalstrength_title" />
<EditTextPreference
android:defaultValue="false"
android:key="clockActive"
android:summary="@pref_showclock_summary"
android:title="@string/pref_showclock_title" />-->
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_notifications_category_title">
<CheckBoxPreference
Expand Down

0 comments on commit b02a840

Please sign in to comment.