diff --git a/apps/android/TitanScout/.gitignore b/apps/android/TitanScout/.gitignore deleted file mode 100644 index fd45b12f..00000000 --- a/apps/android/TitanScout/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -*.iml -.gradle -/local.properties -/.idea/caches/build_file_checksums.ser -/.idea/libraries -/.idea/modules.xml -/.idea/workspace.xml -.DS_Store -/build -/captures -.externalNativeBuild diff --git a/apps/android/TitanScout/.idea/.name b/apps/android/TitanScout/.idea/.name new file mode 100644 index 00000000..89d83888 --- /dev/null +++ b/apps/android/TitanScout/.idea/.name @@ -0,0 +1 @@ +tr2022_scouting \ No newline at end of file diff --git a/apps/android/TitanScout/.idea/codeStyles/Project.xml b/apps/android/TitanScout/.idea/codeStyles/Project.xml index 30aa626c..1bec35e5 100644 --- a/apps/android/TitanScout/.idea/codeStyles/Project.xml +++ b/apps/android/TitanScout/.idea/codeStyles/Project.xml @@ -1,29 +1,10 @@ - - - - - - - - - - + + + + \ No newline at end of file diff --git a/apps/android/TitanScout/.idea/codeStyles/codeStyleConfig.xml b/apps/android/TitanScout/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 00000000..79ee123c --- /dev/null +++ b/apps/android/TitanScout/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/apps/android/TitanScout/.idea/gradle.xml b/apps/android/TitanScout/.idea/gradle.xml deleted file mode 100644 index 7ac24c77..00000000 --- a/apps/android/TitanScout/.idea/gradle.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/apps/android/TitanScout/.idea/kotlinc.xml b/apps/android/TitanScout/.idea/kotlinc.xml new file mode 100644 index 00000000..0dd4b354 --- /dev/null +++ b/apps/android/TitanScout/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/apps/android/TitanScout/.idea/libraries/KotlinJavaRuntime__5_.xml b/apps/android/TitanScout/.idea/libraries/KotlinJavaRuntime__5_.xml new file mode 100644 index 00000000..c0d2b8e4 --- /dev/null +++ b/apps/android/TitanScout/.idea/libraries/KotlinJavaRuntime__5_.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/apps/android/TitanScout/.idea/misc.xml b/apps/android/TitanScout/.idea/misc.xml index 99202cc2..05483570 100644 --- a/apps/android/TitanScout/.idea/misc.xml +++ b/apps/android/TitanScout/.idea/misc.xml @@ -1,34 +1,6 @@ - - - - - - - - - \ No newline at end of file diff --git a/apps/android/TitanScout/.idea/modules.xml b/apps/android/TitanScout/.idea/modules.xml new file mode 100644 index 00000000..47f0642e --- /dev/null +++ b/apps/android/TitanScout/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/apps/android/TitanScout/.idea/runConfigurations.xml b/apps/android/TitanScout/.idea/runConfigurations.xml deleted file mode 100644 index 7f68460d..00000000 --- a/apps/android/TitanScout/.idea/runConfigurations.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/apps/android/TitanScout/.idea/workspace.xml b/apps/android/TitanScout/.idea/workspace.xml new file mode 100644 index 00000000..818a2fde --- /dev/null +++ b/apps/android/TitanScout/.idea/workspace.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + General + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/apps/android/TitanScout/TitanScout.iml b/apps/android/TitanScout/TitanScout.iml new file mode 100644 index 00000000..fe87290e --- /dev/null +++ b/apps/android/TitanScout/TitanScout.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/apps/android/TitanScout/app/.gitignore b/apps/android/TitanScout/app/.gitignore deleted file mode 100644 index 796b96d1..00000000 --- a/apps/android/TitanScout/app/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/apps/android/TitanScout/app/build.gradle b/apps/android/TitanScout/app/build.gradle deleted file mode 100644 index 2423752d..00000000 --- a/apps/android/TitanScout/app/build.gradle +++ /dev/null @@ -1,52 +0,0 @@ -apply plugin: 'com.android.application' - -apply plugin: 'kotlin-android-extensions' - - -android { - compileSdkVersion 28 - defaultConfig { - applicationId "com.example.ian.titanscout" - minSdkVersion 15 - targetSdkVersion 28 - versionCode 1 - versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - multiDexEnabled true - - } - buildTypes { - release { - minifyEnabled false - - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } -} - -repositories { - jcenter() -} - -dependencies { - implementation 'com.journeyapps:zxing-android-embedded:3.2.0@aar' - implementation 'com.google.zxing:core:3.2.1' - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'com.android.support:appcompat-v7:28.0.0' - implementation 'com.android.support.constraint:constraint-layout:1.1.3' - implementation 'com.android.support:design:28.0.0' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' - implementation 'com.google.firebase:firebase-core:16.0.6' - implementation 'com.google.firebase:firebase-firestore:17.1.4' - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'com.google.zxing:core:3.2.1' - implementation 'com.journeyapps:zxing-android-embedded:3.2.0@aar' - - implementation 'com.github.kenglxn.QRGen:android:2.3.0' -} - -apply plugin: 'com.google.gms.google-services' -apply plugin: 'kotlin-android' diff --git a/apps/android/TitanScout/app/google-services.json b/apps/android/TitanScout/app/google-services.json deleted file mode 100644 index fdb05b77..00000000 --- a/apps/android/TitanScout/app/google-services.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "project_info": { - "project_number": "1097635313476", - "firebase_url": "https://titanscoutandroid.firebaseio.com", - "project_id": "titanscoutandroid", - "storage_bucket": "titanscoutandroid.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:1097635313476:android:2b1b9246d4e09656", - "android_client_info": { - "package_name": "com.example.ian.titanscout" - } - }, - "oauth_client": [ - { - "client_id": "1097635313476-9dbg4ut5lbd5da3u942hgdhjpcp3sft3.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBdomB5RyPuJO-K6RZM_m4BK0sW-XcNMOk" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/apps/android/TitanScout/app/proguard-rules.pro b/apps/android/TitanScout/app/proguard-rules.pro deleted file mode 100644 index f1b42451..00000000 --- a/apps/android/TitanScout/app/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile diff --git a/apps/android/TitanScout/app/src/androidTest/java/com/example/ian/titanscout/ExampleInstrumentedTest.kt b/apps/android/TitanScout/app/src/androidTest/java/com/example/ian/titanscout/ExampleInstrumentedTest.kt deleted file mode 100644 index d0931777..00000000 --- a/apps/android/TitanScout/app/src/androidTest/java/com/example/ian/titanscout/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.example.ian.titanscout - -import android.support.test.InstrumentationRegistry -import android.support.test.runner.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getTargetContext() - assertEquals("com.example.ian.titanscout", appContext.packageName) - } -} diff --git a/apps/android/TitanScout/app/src/main/AndroidManifest.xml b/apps/android/TitanScout/app/src/main/AndroidManifest.xml deleted file mode 100644 index 47609081..00000000 --- a/apps/android/TitanScout/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/apps/android/TitanScout/app/src/main/java/com/example/ian/titanscout/Match.kt b/apps/android/TitanScout/app/src/main/java/com/example/ian/titanscout/Match.kt deleted file mode 100644 index de3a6614..00000000 --- a/apps/android/TitanScout/app/src/main/java/com/example/ian/titanscout/Match.kt +++ /dev/null @@ -1,31 +0,0 @@ -package com.example.ian.titanscout - - -class Match (var ind: Int, var redTeams: Array, var blueTeams: Array) { - // class body - - fun getScouts(): Int { - var x = 0 - for (red in redTeams) { - if (red.hasScouts()) { - x++ - } - } - for (blue in blueTeams) { - if (blue.hasScouts()) { - x++ - } - } - return x - } -} - -class Team (var num: String, var color:String, var scouts:Array) { - - fun hasScouts() : Boolean { - if (scouts.size > 0 && !scouts[0].equals("")) { - return true - } - return false - } -} \ No newline at end of file diff --git a/apps/android/TitanScout/app/src/main/java/com/example/ian/titanscout/MatchAdapter.kt b/apps/android/TitanScout/app/src/main/java/com/example/ian/titanscout/MatchAdapter.kt deleted file mode 100644 index 647917bb..00000000 --- a/apps/android/TitanScout/app/src/main/java/com/example/ian/titanscout/MatchAdapter.kt +++ /dev/null @@ -1,58 +0,0 @@ -package com.example.ian.titanscout - -import android.content.Context -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.BaseAdapter -import android.widget.ProgressBar -import android.widget.TextView - -class MatchAdapter(private val context: Context, - private val dataSource: Array) : BaseAdapter() { - - private val inflater: LayoutInflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater - - //1 - override fun getCount(): Int { - return dataSource.size - } - - //2 - override fun getItem(position: Int): Any { - return dataSource[position] - } - - //3 - override fun getItemId(position: Int): Long { - return position.toLong() - } - - //4 - override fun getView(position: Int, convertView: View?, parent: ViewGroup): View { - // Get view for row item - val rowView = inflater.inflate(R.layout.list_item, parent, false) - - - // Get title element - val titleTextView = rowView.findViewById(R.id.titleTV) as TextView - - // Get subtitle element - val subtitleTextView = rowView.findViewById(R.id.subtitle) as TextView - - // Get progressBar element - val progressBar = rowView.findViewById(R.id.progressBar) as ProgressBar - - val match = getItem(position) as Match - - val str = "Match " + match.ind - titleTextView.text = str - val str2 = match.getScouts().toString() + " of 6" - subtitleTextView.text = str2 - progressBar.progress = (1.0 * progressBar.max * match.getScouts() / (6.0)).toInt() - - return rowView - } - - -} \ No newline at end of file diff --git a/apps/android/TitanScout/app/src/main/java/com/example/ian/titanscout/MatchesTableView.kt b/apps/android/TitanScout/app/src/main/java/com/example/ian/titanscout/MatchesTableView.kt deleted file mode 100644 index df7c58c7..00000000 --- a/apps/android/TitanScout/app/src/main/java/com/example/ian/titanscout/MatchesTableView.kt +++ /dev/null @@ -1,188 +0,0 @@ -package com.example.ian.titanscout - -import android.graphics.Color -import android.os.Bundle -import android.support.design.widget.FloatingActionButton -import android.support.v7.app.AlertDialog -import android.support.v7.app.AppCompatActivity; - -import com.google.firebase.firestore.FirebaseFirestore -import org.json.JSONObject -import com.google.zxing.WriterException -import android.graphics.Bitmap -import android.widget.* -import net.glxn.qrgen.android.QRCode - - -class MatchesTableView : AppCompatActivity() { - - - var shouldShow = true - // Reference the database to be used in the rest of the class. - val db = FirebaseFirestore.getInstance() - var alias = "" - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_matches_table_view) -// setSupportActionBar(toolbar) - - var matches = arrayOf() - val TAG = "MainActivity" - val docRef = db.collection("appBuilding").document("schedule") - docRef.get().addOnSuccessListener { documentSnapshot -> - val stringData = documentSnapshot.data.toString() - - // Get data from the database and process it into an array of Matches. - val schedule = Response(stringData).getJSONArray("matches") - for (i in 0..(schedule.length() - 1)) { - val item = schedule.getJSONObject(i) - val reds = Response(item["RED"].toString()) - val blues = Response(item["BLUE"].toString()) - val redTeams = getTeamArrayFromJSON(reds, "RED") - val blueTeams = getTeamArrayFromJSON(blues, "BLUE") - matches += Match(i+1, redTeams, blueTeams) - } - - // update the user's alias - alias = intent.getStringExtra("alias") - updateAlias(alias) - - - val listView = findViewById(R.id.match_list_view) - - val listItems = arrayOfNulls(matches.size) - - for (i in 0 until matches.size) { - val match = matches[i] - listItems[i] = "Match " + match.ind - } - - -// val adapter = ArrayAdapter(this, android.R.layout.simple_list_item_1, listItems) -// listView.adapter = adapter - - val adapter = MatchAdapter(this, matches) - listView.adapter = adapter - - } - - val fab = findViewById(R.id.fab) - fab.setImageResource(R.drawable.qrcodeicon) - fab.setColorFilter(Color.parseColor("#FFFFFF")) - - - fab.setOnClickListener { view -> - - // QR Button pressed - - if (shouldShow) { - try { - - val bitmap = TextToImageEncode(intent.getStringExtra("auth")) - - - findViewById(R.id.imageView).setImageBitmap(bitmap) - - } catch (e: WriterException) { - e.printStackTrace() - } - - } else { - findViewById(R.id.imageView).setImageResource(android.R.color.transparent) - } - - shouldShow = !shouldShow - } - - findViewById