diff --git a/apps/android/main/AndroidManifest.xml b/apps/android/main/AndroidManifest.xml deleted file mode 100644 index 47609081..00000000 --- a/apps/android/main/AndroidManifest.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/apps/android/main/gen/com/example/ian/titanscout/BuildConfig.java b/apps/android/main/gen/com/example/ian/titanscout/BuildConfig.java new file mode 100644 index 00000000..e4e8299e --- /dev/null +++ b/apps/android/main/gen/com/example/ian/titanscout/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package com.example.ian.titanscout; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/apps/android/main/gen/com/example/ian/titanscout/Manifest.java b/apps/android/main/gen/com/example/ian/titanscout/Manifest.java new file mode 100644 index 00000000..f042a814 --- /dev/null +++ b/apps/android/main/gen/com/example/ian/titanscout/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package com.example.ian.titanscout; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/apps/android/main/gen/com/example/ian/titanscout/R.java b/apps/android/main/gen/com/example/ian/titanscout/R.java new file mode 100644 index 00000000..4befba37 --- /dev/null +++ b/apps/android/main/gen/com/example/ian/titanscout/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package com.example.ian.titanscout; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/apps/android/main/java/com/example/ian/titanscout/Match.kt b/apps/android/main/java/com/example/ian/titanscout/Match.kt deleted file mode 100644 index de3a6614..00000000 --- a/apps/android/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/main/java/com/example/ian/titanscout/MatchAdapter.kt b/apps/android/main/java/com/example/ian/titanscout/MatchAdapter.kt deleted file mode 100644 index 647917bb..00000000 --- a/apps/android/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/main/java/com/example/ian/titanscout/MatchesTableView.kt b/apps/android/main/java/com/example/ian/titanscout/MatchesTableView.kt deleted file mode 100644 index df7c58c7..00000000 --- a/apps/android/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