Skip to content

Commit

Permalink
removed dynamic typeface
Browse files Browse the repository at this point in the history
  • Loading branch information
Ixam97 committed May 3, 2024
1 parent b16619d commit b1f5d07
Show file tree
Hide file tree
Showing 48 changed files with 319 additions and 246 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import android.app.PendingIntent
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.ixam97.carStatsViewer.ui.activities.PermissionsActivity
import com.ixam97.carStatsViewer.dataCollector.DataCollector
import com.ixam97.carStatsViewer.ui.activities.PermissionsActivity
import com.ixam97.carStatsViewer.utils.InAppLogger
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package com.ixam97.carStatsViewer

import android.app.*
import android.app.Activity
import android.app.AlarmManager
import android.app.AlertDialog
import android.app.Application
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.graphics.Bitmap
import android.graphics.Typeface
import android.os.Bundle
import android.util.TypedValue
import android.view.LayoutInflater
Expand All @@ -18,7 +23,8 @@ import com.ixam97.carStatsViewer.appPreferences.AppPreferences
import com.ixam97.carStatsViewer.dataProcessor.DataProcessor
import com.ixam97.carStatsViewer.database.log.LogDao
import com.ixam97.carStatsViewer.database.log.LogDatabase
import com.ixam97.carStatsViewer.database.tripData.*
import com.ixam97.carStatsViewer.database.tripData.LocalTripDataSource
import com.ixam97.carStatsViewer.database.tripData.TripDataDatabase
import com.ixam97.carStatsViewer.liveDataApi.LiveDataApi
import com.ixam97.carStatsViewer.liveDataApi.abrpLiveData.AbrpLiveData
import com.ixam97.carStatsViewer.liveDataApi.http.HttpLiveData
Expand All @@ -27,7 +33,6 @@ import com.ixam97.carStatsViewer.utils.ChangeLogCreator.createChangelog
import com.ixam97.carStatsViewer.utils.InAppLogger
import com.ixam97.carStatsViewer.utils.ScreenshotButton
import com.ixam97.carStatsViewer.utils.Watchdog
import com.ixam97.carStatsViewer.utils.applyTypeface
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -74,9 +79,9 @@ class CarStatsViewer : Application() {

lateinit var logDao: LogDao

var typefaceRegular: Typeface? = null
var typefaceMedium: Typeface? = null
var isPolestarTypeface = false
// var typefaceRegular: Typeface? = null
// var typefaceMedium: Typeface? = null
// var isPolestarTypeface = false

val appContextIsInitialized: Boolean get() = this::appContext.isInitialized

Expand Down Expand Up @@ -142,10 +147,7 @@ class CarStatsViewer : Application() {
style(R.style.changes_text)
})
}

applyTypeface(layout)
setView(layout)

setCancelable(true)
create()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import androidx.recyclerview.widget.RecyclerView
import com.ixam97.carStatsViewer.R
import com.ixam97.carStatsViewer.database.log.LogEntry
import com.ixam97.carStatsViewer.utils.InAppLogger
import kotlinx.android.synthetic.main.recyclerview_log_row.view.*
import kotlinx.android.synthetic.main.recyclerview_log_row.view.log_row
import java.text.SimpleDateFormat

class LogAdapter(var log: List<LogEntry>): RecyclerView.Adapter<LogAdapter.LogViewHolder>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
import com.ixam97.carStatsViewer.CarStatsViewer
import com.ixam97.carStatsViewer.R
import com.ixam97.carStatsViewer.ui.activities.HistoryActivity
import com.ixam97.carStatsViewer.database.tripData.DrivingSession
import com.ixam97.carStatsViewer.database.tripData.TripType
import com.ixam97.carStatsViewer.ui.activities.HistoryActivity
import com.ixam97.carStatsViewer.ui.views.TripHistoryRowWidget
import com.ixam97.carStatsViewer.utils.InAppLogger
import kotlinx.coroutines.CoroutineScope
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.ixam97.carStatsViewer.appPreferences

import android.content.SharedPreferences
import com.ixam97.carStatsViewer.utils.DistanceUnitEnum
import com.ixam97.carStatsViewer.ui.plot.enums.PlotDimensionX
import com.ixam97.carStatsViewer.utils.DistanceUnitEnum

class AppPreference<T>(
private val key: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import android.content.SharedPreferences
import com.google.gson.ExclusionStrategy
import com.google.gson.FieldAttributes
import com.ixam97.carStatsViewer.R
import com.ixam97.carStatsViewer.utils.DistanceUnitEnum
import com.ixam97.carStatsViewer.ui.plot.enums.PlotDimensionX
import com.ixam97.carStatsViewer.utils.DistanceUnitEnum
import com.ixam97.carStatsViewer.utils.Exclude

class AppPreferences(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.ixam97.carStatsViewer.carPropertiesClient

import android.car.VehiclePropertyIds

class CarProperty(val propertyId: Int) {

private val startupTimestamp = System.nanoTime()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,27 @@ import com.google.android.gms.common.ConnectionResult
import com.google.android.gms.common.GoogleApiAvailability
import com.ixam97.carStatsViewer.CarStatsViewer
import com.ixam97.carStatsViewer.R
import com.ixam97.carStatsViewer.ui.activities.MainActivity
import com.ixam97.carStatsViewer.carPropertiesClient.CarProperties
import com.ixam97.carStatsViewer.carPropertiesClient.CarPropertiesClient
import com.ixam97.carStatsViewer.dataProcessor.DataProcessor
import com.ixam97.carStatsViewer.emulatorMode
import com.ixam97.carStatsViewer.locationClient.DefaultLocationClient
import com.ixam97.carStatsViewer.locationClient.LocationClient
import com.ixam97.carStatsViewer.ui.activities.MainActivity
import com.ixam97.carStatsViewer.utils.DistanceUnitEnum
import com.ixam97.carStatsViewer.utils.InAppLogger
import com.ixam97.carStatsViewer.utils.StringFormatters
import com.ixam97.carStatsViewer.utils.WatchdogState
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.cancel
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch

class DataCollector: Service() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
package com.ixam97.carStatsViewer.dataProcessor

// import com.ixam97.carStatsViewer.utils.TimestampSynchronizer
import android.app.Notification
import android.app.PendingIntent
import android.content.Intent
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import androidx.core.graphics.drawable.toBitmap
import com.ixam97.carStatsViewer.AutoStartReceiver
import com.ixam97.carStatsViewer.CarStatsViewer
import com.ixam97.carStatsViewer.Defines
import com.ixam97.carStatsViewer.R
import com.ixam97.carStatsViewer.carPropertiesClient.CarProperties
import com.ixam97.carStatsViewer.carPropertiesClient.CarPropertiesData
import com.ixam97.carStatsViewer.utils.TimeTracker
import com.ixam97.carStatsViewer.database.tripData.*
import com.ixam97.carStatsViewer.database.tripData.ChargingPoint
import com.ixam97.carStatsViewer.database.tripData.ChargingSession
import com.ixam97.carStatsViewer.database.tripData.DrivingPoint
import com.ixam97.carStatsViewer.database.tripData.DrivingSession
import com.ixam97.carStatsViewer.database.tripData.TripType
import com.ixam97.carStatsViewer.emulatorMode
import com.ixam97.carStatsViewer.emulatorPowerSign
import com.ixam97.carStatsViewer.liveDataApi.http.HttpLiveData
import com.ixam97.carStatsViewer.ui.plot.enums.PlotLineMarkerType
import com.ixam97.carStatsViewer.utils.InAppLogger
import com.ixam97.carStatsViewer.utils.Ticker
// import com.ixam97.carStatsViewer.utils.TimestampSynchronizer
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.MutableSharedFlow
import com.ixam97.carStatsViewer.utils.TimeTracker
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.update
import java.util.*
import java.util.concurrent.Executor
import kotlinx.coroutines.launch
import java.util.Date
import kotlin.math.absoluteValue
import kotlin.math.roundToInt

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.ixam97.carStatsViewer.database.log

import androidx.room.*
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query

@Dao
interface LogDao {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.ixam97.carStatsViewer.database.log

import androidx.room.Database
import androidx.room.Entity
import androidx.room.PrimaryKey
import androidx.room.RoomDatabase

@Database(entities = [LogEntry::class], version = 1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package com.ixam97.carStatsViewer.database.tripData

import androidx.room.*
import androidx.room.Dao
import androidx.room.Ignore
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Transaction
import androidx.room.Upsert

@Dao
interface TripDao {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.ixam97.carStatsViewer.database.tripData

import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.room.migration.AutoMigrationSpec

@Database(entities =
[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package com.ixam97.carStatsViewer.database.tripData

import androidx.room.*
import androidx.room.Embedded
import androidx.room.Entity
import androidx.room.Ignore
import androidx.room.Junction
import androidx.room.PrimaryKey
import androidx.room.Relation


/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.ixam97.carStatsViewer.database.tripData

import androidx.room.Query

interface TripDataSource {

/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.ixam97.carStatsViewer.liveDataApi

import android.content.Context
import android.os.Handler
import com.ixam97.carStatsViewer.CarStatsViewer
import com.ixam97.carStatsViewer.R
import com.ixam97.carStatsViewer.dataProcessor.RealTimeData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ import android.app.AlertDialog
import android.content.Context
import android.view.LayoutInflater
import android.widget.EditText
import android.widget.Switch
import com.ixam97.carStatsViewer.liveDataApi.LiveDataApi
import com.ixam97.carStatsViewer.CarStatsViewer
import com.ixam97.carStatsViewer.utils.InAppLogger
import com.ixam97.carStatsViewer.R
import com.ixam97.carStatsViewer.appPreferences.AppPreferences
import com.ixam97.carStatsViewer.dataProcessor.DrivingState
import com.ixam97.carStatsViewer.dataProcessor.RealTimeData
import com.ixam97.carStatsViewer.liveDataApi.ConnectionStatus
import com.ixam97.carStatsViewer.liveDataApi.LiveDataApi
import com.ixam97.carStatsViewer.ui.views.FixedSwitchWidget
import com.ixam97.carStatsViewer.utils.InAppLogger
import org.json.JSONObject
import java.io.DataOutputStream
import java.net.HttpURLConnection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ import java.io.DataOutputStream
import java.net.HttpURLConnection
import java.net.URL
import java.nio.charset.StandardCharsets
import java.util.*
import kotlin.collections.ArrayList
import java.util.Base64


class HttpLiveData (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
package com.ixam97.carStatsViewer.locationClient

// import com.google.android.gms.location.*
import android.annotation.SuppressLint
import android.content.Context
import android.location.Location
import android.location.LocationManager
// import com.google.android.gms.location.*
import com.google.android.gms.tasks.CancellationTokenSource
import com.ixam97.carStatsViewer.CarStatsViewer
import com.ixam97.carStatsViewer.emulatorMode
import com.ixam97.carStatsViewer.utils.InAppLogger
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.tasks.await
import org.matthiaszimmermann.location.egm96.Geoid
import kotlin.math.absoluteValue

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ package com.ixam97.carStatsViewer.mailSender

import android.graphics.Bitmap
import com.ixam97.carStatsViewer.CarStatsViewer
import kotlin.jvm.Synchronized
import kotlin.Throws
import com.ixam97.carStatsViewer.mailSender.JSSEProvider
import jakarta.activation.DataHandler
import jakarta.activation.DataSource
import jakarta.activation.FileDataSource
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.ixam97.carStatsViewer.ui.activities

import android.app.Activity
import android.app.AlertDialog
import android.content.Intent
import android.net.Uri
Expand All @@ -9,20 +8,24 @@ import androidx.fragment.app.FragmentActivity
import com.ixam97.carStatsViewer.BuildConfig
import com.ixam97.carStatsViewer.CarStatsViewer
import com.ixam97.carStatsViewer.R
import com.ixam97.carStatsViewer.utils.applyTypeface
import com.ixam97.carStatsViewer.utils.setContentViewAndTheme
import kotlinx.android.synthetic.main.activity_about.*
import kotlinx.android.synthetic.main.activity_about.about_button_back
import kotlinx.android.synthetic.main.activity_about.about_club_widget
import kotlinx.android.synthetic.main.activity_about.about_contributors_widget
import kotlinx.android.synthetic.main.activity_about.about_forums_widget
import kotlinx.android.synthetic.main.activity_about.about_github_issues_widget
import kotlinx.android.synthetic.main.activity_about.about_libs_widget
import kotlinx.android.synthetic.main.activity_about.about_support_widget
import kotlinx.android.synthetic.main.activity_about.about_supporters_widget
import kotlinx.android.synthetic.main.activity_about.about_translators_widget
import kotlinx.android.synthetic.main.activity_about.about_version_widget

class AboutActivity : FragmentActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentViewAndTheme(this, R.layout.activity_about)

CarStatsViewer.typefaceMedium?.let {
applyTypeface(about_activity)
}

about_button_back.setOnClickListener {
finish()
if (BuildConfig.FLAVOR_aaos != "play")
Expand Down
Loading

0 comments on commit b1f5d07

Please sign in to comment.