This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
80 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
app/src/main/java/ca/warp7/android/scouting/AppResources.kt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
app/src/main/java/ca/warp7/android/scouting/MainSettingsKey.kt
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
app/src/main/java/ca/warp7/android/scouting/ManagedPreferences.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
app/src/main/java/ca/warp7/android/scouting/ScoutingActivityState.kt
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
app/src/main/java/ca/warp7/android/scouting/ScoutingIntentKey.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package ca.warp7.android.scouting | ||
|
||
import android.content.Context | ||
import android.preference.PreferenceManager | ||
import android.text.Html | ||
import android.text.Spanned | ||
import android.view.View | ||
|
||
fun View.show(){ | ||
visibility = View.VISIBLE | ||
} | ||
|
||
fun View.hide(){ | ||
visibility = View.GONE | ||
} | ||
|
||
|
||
private fun getRaw(context: Context, id: Int): String { | ||
val resources = context.resources | ||
return try { | ||
resources.openRawResource(id).bufferedReader().readText() | ||
} catch (e: Exception) { | ||
e.printStackTrace() | ||
"" | ||
} | ||
} | ||
|
||
@Suppress("DEPRECATION") | ||
fun getHTMLFromContext(context: Context, id: Int): Spanned { | ||
return Html.fromHtml(getRaw(context, id)) | ||
} | ||
|
||
const val kTimerLimit = 150 | ||
const val kAutonomousTime = 15 | ||
const val kFadeDuration = 100 | ||
const val kTotalTimerDigits = 3 | ||
|
||
|
||
object ScoutingIntentKey { | ||
|
||
private const val v5Root = "ca.warp7.android.scouting.intent" | ||
|
||
const val kMatch = "$v5Root.match" | ||
const val kTeam = "$v5Root.team" | ||
const val kScout = "$v5Root.scout" | ||
const val kBoard = "$v5Root.board" | ||
|
||
const val kResult = "$v5Root.result" | ||
} | ||
|
||
object MainSettingsKey { | ||
|
||
private const val kMainSettingsRoot = "ca.warp7.android.scouting.main" | ||
|
||
const val kBoard = "$kMainSettingsRoot.board" | ||
const val kScout = "$kMainSettingsRoot.scout" | ||
} | ||
|
||
class ManagedPreferences(context: Context) { | ||
|
||
private val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context) | ||
|
||
val vibrator: AbstractActionVibrator = ActionVibrator( | ||
context, sharedPreferences.getBoolean(context.getString(R.string.pref_use_vibration_key), true) | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters