Advertisement
JachyHm

SJR display

Jun 29th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 44.18 KB | None | 0 0
  1. package com.jachyhm.sjrregiojet
  2.  
  3. import android.annotation.SuppressLint
  4. import android.content.SharedPreferences
  5. import android.support.v7.app.AppCompatActivity
  6. import android.os.Bundle
  7. import android.os.Handler
  8. import android.support.v4.content.ContextCompat
  9. import android.view.Gravity
  10. import android.view.View
  11. import android.widget.*
  12. import java.io.File
  13. import java.io.InputStream
  14. import java.text.SimpleDateFormat
  15. import kotlin.math.roundToInt
  16. import android.graphics.Typeface
  17. import android.support.v4.view.AsyncLayoutInflater
  18. import android.view.LayoutInflater
  19. import android.view.WindowManager
  20. import android.widget.TextView
  21. import java.util.*
  22. import kotlin.math.round
  23.  
  24.  
  25. class displayTrain : AppCompatActivity() {
  26.     private lateinit var contrast: Contrast
  27.     private lateinit var settingsMenu: SettingsMenu
  28.     private var recreated = false
  29.     private var displayedTrain: String = ""
  30.     private lateinit var sharedPref: SharedPreferences
  31.     private val SETTINGS_PREFS_FILENAME = "com.jachyhm.sjrregiojet.settings"
  32.     private var isShowAllChecked = false
  33.     private lateinit var timetable: Timetable
  34.     private lateinit var clockRunnable: Runnable
  35.     val handler = Handler()
  36.  
  37.     fun reCreate() {
  38.         val savedInstanceState = Bundle()
  39.         //this is important to save all your open states/fragment states
  40.         onSaveInstanceState(savedInstanceState)
  41.         //this is needed to release the resources
  42.         onDestroy()
  43.  
  44.         //call on create where new theme is applied
  45.         recreated = true
  46.         onCreate(savedInstanceState)
  47.     }
  48.  
  49.     @SuppressLint("SimpleDateFormat")
  50.     override fun onCreate(savedInstanceState: Bundle?) {
  51.         sharedPref = this.getSharedPreferences(SETTINGS_PREFS_FILENAME,0)
  52.         isShowAllChecked = sharedPref.getBoolean("showAll", false)
  53.         contrast = Contrast(this, ::reCreate)
  54.         super.onCreate(savedInstanceState)
  55.         setContentView(R.layout.activity_display_train)
  56.         getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  57.         // Hide the status bar.
  58.         window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_FULLSCREEN
  59.         actionBar?.hide()
  60.         try {
  61.             this.supportActionBar!!.hide()
  62.         } catch (e: NullPointerException) {
  63.         }
  64.         findViewById<ProgressBar>(R.id.progressBar).visibility = View.VISIBLE
  65.         val clock = findViewById<TextView>(R.id.clock)
  66.         clockRunnable = object: Runnable {
  67.             val formatter = SimpleDateFormat("HH:mm:ss")
  68.             override fun run() {
  69.                 clock.text = formatter.format(java.util.Calendar.getInstance().time)
  70.                 handler.postDelayed(this, 1000)
  71.             }
  72.         }
  73.         clockRunnable.run()
  74.         displayedTrain = intent.getStringExtra("trainNumber")
  75.         if (!recreated) {
  76.             contrast.initialiseButtons(
  77.                 findViewById(R.id.dayButton),
  78.                 findViewById(R.id.nightButton),
  79.                 findViewById(R.id.autoContrastButtonWhite),
  80.                 findViewById(R.id.autoContrastButtonBlack),
  81.                 findViewById(R.id.appSettings_white),
  82.                 findViewById(R.id.appSettings_black),
  83.                 findViewById(R.id.main_layout),
  84.                 recreated
  85.             )
  86.             settingsMenu = SettingsMenu(
  87.                 this,
  88.                 this,
  89.                 findViewById(R.id.appSettings_white),
  90.                 findViewById(R.id.appSettings_black),
  91.                 findViewById(R.id.progressBar),
  92.                 true
  93.             )
  94.         }
  95.         val load_thread = Thread {
  96.             val _timetable = parseXML(File(displayedTrain).inputStream())
  97.             if (_timetable != null) {
  98.                 timetable = _timetable
  99.                 /*findViewById<TextView>(R.id.heading).text = (
  100.                         checkNotNull(timetable.shared_attributes).train_types.joinToString(" ")+" "+
  101.                                 checkNotNull(timetable.shared_attributes).train_kinds.joinToString(" / ")+" "+
  102.                                 getTrainNumber(timetable)
  103.                         ).trim()
  104.                 findViewById<TextView>(R.id.routeDescription).text = getRouteDescriptions(timetable)*/
  105.                 if (savedInstanceState == null) {
  106.                     val trainNames = getTrainNames(timetable)
  107.                     val routeDescriptions = getRouteDescriptions(timetable)
  108.                     if (trainNames.size == routeDescriptions.size) {
  109.                         trainNames.forEachIndexed { i, element ->
  110.                             supportFragmentManager
  111.                                 .beginTransaction()
  112.                                 .add(
  113.                                     R.id.descriptions_layout,
  114.                                     TrainDescription.newInstance(
  115.                                         element,
  116.                                         routeDescriptions[i]
  117.                                     )
  118.                                 )
  119.                                 .commit()
  120.                         }
  121.                         if (timetable.adHoc) {
  122.                             supportFragmentManager
  123.                                 .beginTransaction()
  124.                                 .add(
  125.                                     R.id.descriptions_layout,
  126.                                     TrainDescriptionNote.newInstance(
  127.                                         getString(R.string.adhoc)
  128.                                     )
  129.                                 )
  130.                                 .commit()
  131.                         }
  132.                     } else {
  133.                         Toast.makeText(
  134.                             this,
  135.                             "Kritická chyba při zpracovávání XML souboru, nesouhlasí počet tras ${routeDescriptions.size} a přiřazených čísel vlaků ${trainNames.size}!",
  136.                             Toast.LENGTH_SHORT
  137.                         ).show()
  138.                         finish()
  139.                     }
  140.                 }
  141.                 if (timetable.D3) {
  142.                     runOnUiThread {
  143.                         findViewById<TableLayout>(R.id.contentHeader).getChildAt(0).visibility = View.GONE
  144.                         findViewById<TableLayout>(R.id.contentHeader).getChildAt(1).visibility = View.VISIBLE
  145.                     }
  146.                 }
  147.                 else
  148.                 {
  149.                     runOnUiThread {
  150.                         findViewById<TableLayout>(R.id.contentHeader).getChildAt(0).visibility = View.VISIBLE
  151.                         findViewById<TableLayout>(R.id.contentHeader).getChildAt(1).visibility = View.GONE
  152.                     }
  153.                 }
  154.                 flushTimetableToTable(timetable)
  155.             } else {
  156.                 Toast.makeText(
  157.                     this,
  158.                     "Kritická chyba při zpracovávání XML souboru, XMLParse vrátil null!",
  159.                     Toast.LENGTH_SHORT
  160.                 ).show()
  161.                 finish()
  162.             }
  163.         }
  164.         Handler().postDelayed({
  165.             load_thread.start()
  166.         }, 500)
  167.     }
  168.  
  169.     private fun flushTimetableToTable(timetable: Timetable) {
  170.         val content_table = TableLayout(this)
  171.         val table_params = TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT,TableLayout.LayoutParams.WRAP_CONTENT)
  172.         content_table.layoutParams = table_params
  173.         generateRows(timetable).forEach {
  174.             content_table.addView(it)
  175.         }
  176.         runOnUiThread {
  177.             findViewById<ScrollView>(R.id.scrollView).addView(content_table)
  178.             findViewById<ProgressBar>(R.id.progressBar).visibility = View.INVISIBLE
  179.         }
  180.     }
  181.  
  182.     private fun getTrainNumber(timetable: Timetable): List<Int> {
  183.         val tn: MutableList<Int> = mutableListOf()
  184.         checkNotNull(timetable.route).track_sections.forEach {
  185.             it.timetable_entries.forEach {
  186.                 val number = it.train_number
  187.                 if (number !in tn) {
  188.                     tn.add(number)
  189.                 }
  190.             }
  191.         }
  192.         return tn
  193.     }
  194.  
  195.     private fun getTrainKindType(timetable: Timetable): MutableMap<Int,String> {
  196.         data class TrainName(
  197.             val kinds: MutableList<String>,
  198.             val types: MutableList<String>
  199.         )
  200.         val _tn = mutableMapOf<Int,TrainName>()
  201.         val tn = mutableMapOf<Int,String>()
  202.         checkNotNull(timetable.route).track_sections.forEach {
  203.             it.timetable_entries.forEach {
  204.                 val number = it.train_number
  205.                 val type = it.train_type.trim()
  206.                 val kind = it.train_kind.trim()
  207.                 if (number in _tn) {
  208.                     if (type !in checkNotNull(_tn[number]).types) {
  209.                         checkNotNull(_tn[number]).types.add(type)
  210.                     }
  211.                     if (kind !in checkNotNull(_tn[number]).kinds) {
  212.                         checkNotNull(_tn[number]).kinds.add(kind)
  213.                     }
  214.                 }
  215.                 else
  216.                 {
  217.                     _tn[number] = TrainName(mutableListOf(kind), mutableListOf(type))
  218.                 }
  219.             }
  220.         }
  221.         _tn.forEach{
  222.             tn[it.key] = "${it.value.types.joinToString(" ")} ${it.value.kinds.joinToString(" / ")}"
  223.         }
  224.         return tn
  225.     }
  226.  
  227.     private fun getTrainNames(timetable: Timetable): List<String> {
  228.         val tn = mutableListOf<String>()
  229.         val tkt = getTrainKindType(timetable)
  230.         getTrainNumber(timetable).forEach{
  231.             tn.add("${tkt[it]} $it")
  232.         }
  233.         return tn
  234.     }
  235.  
  236.     private fun getRouteDescriptions(timetable: Timetable): List<String> {
  237.         data class Train(
  238.             var number: Int,
  239.             var type: String,
  240.             var kind: String
  241.         )
  242.         val _trains: MutableMap<Int,MutableList<String>> = mutableMapOf()
  243.         val trains: MutableList<String> = mutableListOf()
  244.         val last_train = Train(0,"","")
  245.         var first_station = ""
  246.         var last_station = ""
  247.         var last_train_number = 0
  248.         checkNotNull(timetable.route).track_sections.forEach {
  249.             it.timetable_entries.forEach {
  250.                 val actual_train = Train(
  251.                     it.train_number,
  252.                     it.train_type,
  253.                     it.train_kind
  254.                 )
  255.                 if (actual_train != last_train) {
  256.                     last_train.apply {
  257.                         this.number = actual_train.number
  258.                         this.type = actual_train.type
  259.                         this.kind = actual_train.kind
  260.                     }
  261.                     if(first_station.isNotEmpty()) {
  262.                         if(last_train_number in _trains) {
  263.                             checkNotNull(_trains[last_train_number]).add("$first_station - ${it.point_name}")
  264.                         }
  265.                         else {
  266.                             _trains[last_train_number] = mutableListOf()
  267.                             checkNotNull(_trains[last_train_number]).add("$first_station - ${it.point_name}")
  268.                         }
  269.                     }
  270.                     if(last_train_number > 0 && last_train_number != it.train_number) {
  271.                         val last_route = "$first_station - ${it.point_name}"
  272.                         if(last_route !in checkNotNull(_trains[last_train_number])) {
  273.                             checkNotNull(_trains[last_train_number]).add(last_route)
  274.                         }
  275.                     }
  276.                     last_train_number = it.train_number
  277.                     first_station = it.point_name
  278.                 }
  279.                 last_station = it.point_name
  280.             }
  281.         }
  282.         val last_route = "$first_station - $last_station"
  283.         if(last_train_number in _trains) {
  284.             if (last_route !in checkNotNull(_trains[last_train_number])) {
  285.                 checkNotNull(_trains[last_train_number]).add(last_route)
  286.             }
  287.         }
  288.         else
  289.         {
  290.             _trains[last_train_number] = mutableListOf()
  291.             checkNotNull(_trains[last_train_number]).add(last_route)
  292.         }
  293.         _trains.forEach {
  294.             trains.add(it.value.joinToString(" / "))
  295.         }
  296.         return(trains)
  297.     }
  298.  
  299.     data class ColumnText (
  300.         val col1: String,
  301.         val col2: String,
  302.         val col2a: String,
  303.         val col3: String,
  304.         val col3_up: String,
  305.         val col5: String,
  306.         val col5_up: String,
  307.         val col6: String,
  308.         val col6_up: String,
  309.         val col7: String,
  310.         val col7_up: String,
  311.         val col8: String,
  312.         val col8_up: String,
  313.         val col8_bo: String,
  314.         val col10: String
  315.     )
  316.  
  317.     data class Strings (
  318.         val symbol_pics: SymbolPics,
  319.         val column_text: ColumnText
  320.     )
  321.  
  322.     data class MakeStringResponse(
  323.         val strings: Strings,
  324.         val lastArrHour: Int,
  325.         val lastDepHour: Int,
  326.         val lastSpeed: Int
  327.     )
  328.  
  329.     private fun calcTimeForMillis(millis: Long): TimetableTime {
  330.         val sec = millis.toFloat()/1000f
  331.         val seconds = round(sec%60).toInt()
  332.         val minutes = round((sec/(60))%60).toInt()
  333.         val hours = round((sec/(3600))%24).toInt()
  334.         return TimetableTime(hours,minutes,seconds)
  335.     }
  336.  
  337.     private fun makeStrings(timetableEntry: TimetableEntry, arr: Int, dep: Int, speed: Int): MakeStringResponse {
  338.         var lastArrHour = arr
  339.         var lastDepHour = dep
  340.         var lastSpeed = speed
  341.         var track_string = ""
  342.         if (timetableEntry.track != null) {
  343.             track_string = timetableEntry.track.toString()
  344.         }
  345.  
  346.         var travel_time_string = ""
  347.         var travel_time_up_string = ""
  348.         if (timetableEntry.travel_time != null) {
  349.             travel_time_string = (timetableEntry.travel_time.hours*60+timetableEntry.travel_time.minutes).toString()
  350.             if (timetableEntry.travel_time.seconds > 0) {
  351.                 travel_time_up_string = ((timetableEntry.travel_time.seconds / 6f).roundToInt()).toString()
  352.             }
  353.         }
  354.  
  355.         var arrival_string = ""
  356.         var arrival_up_string = ""
  357.         if (timetableEntry.arrival != null) {
  358.             var str_hours = timetableEntry.arrival.hours.toString()
  359.             if (str_hours.length == 1) {
  360.                 str_hours = "0$str_hours"
  361.             }
  362.             var str_minutes = timetableEntry.arrival.minutes.toString()
  363.             if (str_minutes.length == 1) {
  364.                 str_minutes = "0$str_minutes"
  365.             }
  366.             val hours = timetableEntry.arrival.hours
  367.             if (hours != lastArrHour) {
  368.                 lastArrHour = hours
  369.                 arrival_string = "$str_hours $str_minutes"
  370.             } else {
  371.                 arrival_string = str_minutes
  372.             }
  373.             if (timetableEntry.arrival.seconds > 0) {
  374.                 arrival_up_string = ((timetableEntry.arrival.seconds / 6f).roundToInt()).toString()
  375.             }
  376.         }
  377.  
  378.         var stay_string = ""
  379.         var stay_up_string = ""
  380.         if (timetableEntry.departure != null && timetableEntry.arrival != null) {
  381.             val cal_arr = Calendar.getInstance()
  382.             cal_arr.set(Calendar.HOUR, timetableEntry.arrival.hours)
  383.             cal_arr.set(Calendar.MINUTE, timetableEntry.arrival.minutes)
  384.             cal_arr.set(Calendar.SECOND, timetableEntry.arrival.seconds)
  385.             val cal_dep = Calendar.getInstance()
  386.             cal_dep.set(Calendar.HOUR, timetableEntry.departure.hours)
  387.             cal_dep.set(Calendar.MINUTE, timetableEntry.departure.minutes)
  388.             cal_dep.set(Calendar.SECOND, timetableEntry.departure.seconds)
  389.             val diff = calcTimeForMillis(cal_dep.timeInMillis - cal_arr.timeInMillis)
  390.             if (diff.hours != 0 || diff.minutes != 0 || diff.seconds != 0) {
  391.                 stay_string = "${diff.minutes}"
  392.                 if (diff.hours != 0) {
  393.                     stay_string = "${diff.hours} $stay_string"
  394.                 }
  395.                 if (diff.seconds != 0) {
  396.                     stay_up_string = ((diff.seconds / 6f).roundToInt()).toString()
  397.                 }
  398.             }
  399.         }
  400.  
  401.         var departure_string = ""
  402.         var departure_up_string = ""
  403.         if (timetableEntry.departure != null) {
  404.             var str_hours = timetableEntry.departure.hours.toString()
  405.             if (str_hours.length == 1) {
  406.                 str_hours = "0$str_hours"
  407.             }
  408.             var str_minutes = timetableEntry.departure.minutes.toString()
  409.             if (str_minutes.length == 1) {
  410.                 str_minutes = "0$str_minutes"
  411.             }
  412.             val hours = timetableEntry.departure.hours
  413.             if (hours != lastDepHour) {
  414.                 lastDepHour = hours
  415.                 departure_string = "$str_hours $str_minutes"
  416.             } else {
  417.                 departure_string = str_minutes
  418.             }
  419.             if (timetableEntry.departure.seconds > 0) {
  420.                 departure_up_string = ((timetableEntry.departure.seconds / 6f).roundToInt()).toString()
  421.             }
  422.         }
  423.  
  424.  
  425.         var speed_string = ""
  426.         var brake_percent1 = ""
  427.         var brake_percent2: String? = null
  428.         var col8_up = ""
  429.         var col8_bo = ""
  430.  
  431.         val speed = timetableEntry.maxSpeed
  432.         if (lastSpeed != speed) {
  433.             speed_string = "$speed/"
  434.             val sa = timetable.shared_attributes
  435.             if (sa != null) {
  436.                 val bp = sa.brake_percents[timetableEntry.brake_percents_id]
  437.                 if (bp != null) {
  438.                     brake_percent1 = bp.percent1.toString()
  439.                     if (bp.percent2 != null) {
  440.                         brake_percent2 = bp.percent2.toString()
  441.                     }
  442.                 }
  443.             }
  444.  
  445.             if (brake_percent2 == null) {
  446.                 speed_string += brake_percent1
  447.             } else {
  448.                 col8_up = brake_percent1
  449.                 col8_bo = brake_percent2
  450.             }
  451.             lastSpeed = speed
  452.         }
  453.  
  454.         val col10 = timetableEntry.trains.joinToString(",")
  455.  
  456.         return MakeStringResponse(
  457.             Strings(
  458.                 timetableEntry.symbol_pics,
  459.                 ColumnText(
  460.                     timetableEntry.point_name,
  461.                     "",
  462.                     track_string,
  463.                     travel_time_string,
  464.                     travel_time_up_string,
  465.                     arrival_string,
  466.                     arrival_up_string,
  467.                     stay_string,
  468.                     stay_up_string,
  469.                     departure_string,
  470.                     departure_up_string,
  471.                     speed_string,
  472.                     col8_up,
  473.                     col8_bo,
  474.                     col10
  475.                 )
  476.             ),
  477.             lastArrHour,
  478.             lastDepHour,
  479.             lastSpeed
  480.         )
  481.     }
  482.  
  483.     private fun getStringForSymbols(symbol: MutableList<Int>): String {
  484.         var ret_str = ""
  485.         return  ret_str
  486.     }
  487.  
  488.     private fun makeRowView(strings: Strings, hasD3cols: Boolean, isLastRow: Boolean): View {
  489.         val row = TableRow(this)
  490.         val rowParams = TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT)
  491.         rowParams.gravity = Gravity.CENTER_HORIZONTAL
  492.         row.layoutParams = rowParams
  493.         val inflater = LayoutInflater.from(this)
  494.         val lp = TableRow.LayoutParams(
  495.             TableRow.LayoutParams.WRAP_CONTENT,
  496.             TableRow.LayoutParams.WRAP_CONTENT,
  497.             1f
  498.         )
  499.         lp.gravity = Gravity.LEFT
  500.         val c1 = inflater.inflate(R.layout.sjr_cell, null)
  501.         c1.layoutParams = lp
  502.         c1.findViewById<TextView>(R.id.main).text = strings.column_text.col1
  503.  
  504.         val div1 = View(this)
  505.         div1.layoutParams = TableRow.LayoutParams(
  506.             1,
  507.             TableRow.LayoutParams.MATCH_PARENT
  508.         )
  509.  
  510.         val c2 = inflater.inflate(R.layout.sjr_cell, null)
  511.         c2.layoutParams = TableRow.LayoutParams(
  512.             TableRow.LayoutParams.WRAP_CONTENT,
  513.             TableRow.LayoutParams.WRAP_CONTENT,
  514.             1f
  515.         )
  516.         c2.findViewById<TextView>(R.id.main).text = strings.column_text.col2
  517.         val c2_sb = c2.findViewById<TextView>(R.id.symbolBefore)
  518.         c2_sb.visibility = View.VISIBLE
  519.         c2_sb.text = getStringForSymbols(strings.symbol_pics.col2)
  520.  
  521.  
  522.         val div2 = View(this)
  523.         div2.layoutParams = TableRow.LayoutParams(
  524.             1,
  525.             TableRow.LayoutParams.MATCH_PARENT
  526.         )
  527.  
  528.         val c2a = inflater.inflate(R.layout.sjr_cell, null)
  529.         c2a.layoutParams = TableRow.LayoutParams(
  530.             TableRow.LayoutParams.WRAP_CONTENT,
  531.             TableRow.LayoutParams.WRAP_CONTENT,
  532.             1f
  533.         )
  534.         c2a.findViewById<TextView>(R.id.main).text = strings.column_text.col2a
  535.         val c2a_sb = c2a.findViewById<TextView>(R.id.symbolBefore)
  536.         c2a_sb.visibility = View.VISIBLE
  537.         c2a_sb.text = getStringForSymbols(strings.symbol_pics.col2a)
  538.  
  539.  
  540.         val div2a = View(this)
  541.         div2a.layoutParams = TableRow.LayoutParams(
  542.             1,
  543.             TableRow.LayoutParams.MATCH_PARENT
  544.         )
  545.  
  546.         val c3 = inflater.inflate(R.layout.sjr_cell, null)
  547.         c3.layoutParams = TableRow.LayoutParams(
  548.             TableRow.LayoutParams.WRAP_CONTENT,
  549.             TableRow.LayoutParams.WRAP_CONTENT,
  550.             1f
  551.         )
  552.         val c3_main = c3.findViewById<TextView>(R.id.main)
  553.         c3_main.text = strings.column_text.col3
  554.         c3_main.setTypeface(c3_main.typeface, Typeface.BOLD)
  555.         val c3_up = c3.findViewById<TextView>(R.id.up)
  556.         if (strings.column_text.col3_up.isNotEmpty()) {
  557.             c3_up.visibility = View.VISIBLE
  558.             c3_up.text = strings.column_text.col3_up
  559.         } else {
  560.             c3_up.visibility = View.INVISIBLE
  561.             c3_up.text = "5"
  562.         }
  563.         c3_up.setTypeface(c3_up.typeface, Typeface.BOLD)
  564.  
  565.         val div3 = View(this)
  566.         div3.layoutParams = TableRow.LayoutParams(
  567.             1,
  568.             TableRow.LayoutParams.MATCH_PARENT
  569.         )
  570.  
  571.         val c5 = inflater.inflate(R.layout.sjr_cell_time, null)
  572.         c5.layoutParams = TableRow.LayoutParams(
  573.             TableRow.LayoutParams.WRAP_CONTENT,
  574.             TableRow.LayoutParams.WRAP_CONTENT,
  575.             1f
  576.         )
  577.         val c5_hh = c5.findViewById<TextView>(R.id.hh)
  578.         val c5_mm = c5.findViewById<TextView>(R.id.mm)
  579.         val c5_up = c5.findViewById<TextView>(R.id.up)
  580.  
  581.         val arr = strings.column_text.col5
  582.         if (arr.split(" ").size > 1) {
  583.             c5_hh.text = arr.split(" ")[0]
  584.             c5_mm.text = arr.split(" ")[1]
  585.         } else {
  586.             c5_hh.text = "00"
  587.             c5_hh.visibility = View.INVISIBLE
  588.             c5_mm.text = arr
  589.         }
  590.         if (strings.column_text.col5_up.isNotEmpty()) {
  591.             c5_up.text = strings.column_text.col5_up
  592.         } else {
  593.             c5_up.visibility = View.INVISIBLE
  594.             c5_up.text = "5"
  595.         }
  596.         c5_hh.setTypeface(c5_hh.typeface, Typeface.BOLD)
  597.         c5_mm.setTypeface(c5_mm.typeface, Typeface.BOLD)
  598.         c5_up.setTypeface(c5_up.typeface, Typeface.BOLD)
  599.         val c5_sb = c5.findViewById<TextView>(R.id.symbolBefore)
  600.         c5_sb.text = getStringForSymbols(strings.symbol_pics.col5)
  601.         c5_sb.visibility = View.VISIBLE
  602.  
  603.  
  604.         val div5 = View(this)
  605.         div5.layoutParams = TableRow.LayoutParams(
  606.             1,
  607.             TableRow.LayoutParams.MATCH_PARENT
  608.         )
  609.  
  610.         val c6 = inflater.inflate(R.layout.sjr_cell, null)
  611.         c6.layoutParams = TableRow.LayoutParams(
  612.             TableRow.LayoutParams.WRAP_CONTENT,
  613.             TableRow.LayoutParams.WRAP_CONTENT,
  614.             1f
  615.         )
  616.         val c6_symString = getStringForSymbols(strings.symbol_pics.col6)
  617.         if (c6_symString.isNotEmpty()) {
  618.             val sb = c6.findViewById<TextView>(R.id.symbolBefore)
  619.             c6.findViewById<TextView>(R.id.main).visibility = View.GONE
  620.             c6.findViewById<TextView>(R.id.up).visibility = View.GONE
  621.             sb.visibility = View.VISIBLE
  622.             sb.text = c6_symString
  623.         } else {
  624.             c6.findViewById<TextView>(R.id.main).text = strings.column_text.col6
  625.             val up = c6.findViewById<TextView>(R.id.up)
  626.             if (strings.column_text.col6_up.isNotEmpty()) {
  627.                 up.visibility = View.VISIBLE
  628.                 up.text = strings.column_text.col6_up
  629.             } else {
  630.                 up.visibility = View.INVISIBLE
  631.                 up.text = "5"
  632.             }
  633.         }
  634.  
  635.         val div6 = View(this)
  636.         div6.layoutParams = TableRow.LayoutParams(
  637.             1,
  638.             TableRow.LayoutParams.MATCH_PARENT
  639.         )
  640.  
  641.         val c7 = inflater.inflate(R.layout.sjr_cell_time, null)
  642.         c7.layoutParams = TableRow.LayoutParams(
  643.             TableRow.LayoutParams.WRAP_CONTENT,
  644.             TableRow.LayoutParams.WRAP_CONTENT,
  645.             1f
  646.         )
  647.         val c7_hh = c7.findViewById<TextView>(R.id.hh)
  648.         val c7_mm = c7.findViewById<TextView>(R.id.mm)
  649.         val c7_up = c7.findViewById<TextView>(R.id.up)
  650.  
  651.         val dep = strings.column_text.col7
  652.         if (dep.split(" ").size > 1) {
  653.             c7_hh.text = dep.split(" ")[0]
  654.             c7_mm.text = dep.split(" ")[1]
  655.         } else {
  656.             c7_hh.text = "00"
  657.             c7_hh.visibility = View.INVISIBLE
  658.             c7_mm.text = dep
  659.         }
  660.         if (strings.column_text.col7_up.isNotEmpty()) {
  661.             c7_up.text = strings.column_text.col7_up
  662.         } else {
  663.             c7_up.visibility = View.INVISIBLE
  664.             c7_up.text = "5"
  665.         }
  666.         c7_hh.setTypeface(c7_hh.typeface, Typeface.BOLD)
  667.         c7_mm.setTypeface(c7_mm.typeface, Typeface.BOLD)
  668.         c7_up.setTypeface(c7_up.typeface, Typeface.BOLD)
  669.         val c7_sb = c7.findViewById<TextView>(R.id.symbolBefore)
  670.         c7_sb.visibility = View.VISIBLE
  671.         c7_sb.text = getStringForSymbols(strings.symbol_pics.col7)
  672.  
  673.         val div7 = View(this)
  674.         div7.layoutParams = TableRow.LayoutParams(
  675.             1,
  676.             TableRow.LayoutParams.MATCH_PARENT
  677.         )
  678.  
  679.         val c8 = inflater.inflate(R.layout.sjr_cell, null)
  680.         c8.layoutParams = TableRow.LayoutParams(
  681.             TableRow.LayoutParams.WRAP_CONTENT,
  682.             TableRow.LayoutParams.WRAP_CONTENT,
  683.             1f
  684.         )
  685.         val c8_main = c8.findViewById<TextView>(R.id.main)
  686.         c8_main.text = strings.column_text.col8
  687.         c8_main.setTypeface(c8_main.typeface, Typeface.BOLD)
  688.         val c8_up = c8.findViewById<TextView>(R.id.up)
  689.         c8_up.visibility = View.VISIBLE
  690.         c8_up.text = strings.column_text.col8_up
  691.         val c8_dn = c8.findViewById<TextView>(R.id.down)
  692.         c8_dn.visibility = View.VISIBLE
  693.         c8_dn.text = strings.column_text.col8_bo
  694.         val c8_sa = c8.findViewById<TextView>(R.id.symbolAfter)
  695.         c8_sa.visibility = View.VISIBLE
  696.         c8_sa.text = getStringForSymbols(strings.symbol_pics.col8)
  697.  
  698.         val div8 = View(this)
  699.         div8.layoutParams = TableRow.LayoutParams(
  700.             1,
  701.             TableRow.LayoutParams.MATCH_PARENT
  702.         )
  703.  
  704.         val c10 = inflater.inflate(R.layout.sjr_cell, null)
  705.         c10.layoutParams = TableRow.LayoutParams(
  706.             TableRow.LayoutParams.WRAP_CONTENT,
  707.             TableRow.LayoutParams.WRAP_CONTENT,
  708.             1f
  709.         )
  710.         c10.findViewById<TextView>(R.id.main).text = strings.column_text.col10
  711.         c10.findViewById<TextView>(R.id.up).visibility = View.GONE
  712.         val c10_sa = c10.findViewById<TextView>(R.id.symbolAfter)
  713.         c10_sa.visibility = View.VISIBLE
  714.         c10_sa.text = getStringForSymbols(strings.symbol_pics.col10)
  715.  
  716.         if (contrast.nightTheme) {
  717.             val color = ContextCompat.getColor(this, R.color.colorPrimary)
  718.             div1.setBackgroundColor(color)
  719.             div2.setBackgroundColor(color)
  720.             div2a.setBackgroundColor(color)
  721.             div3.setBackgroundColor(color)
  722.             div5.setBackgroundColor(color)
  723.             div6.setBackgroundColor(color)
  724.             div7.setBackgroundColor(color)
  725.             div8.setBackgroundColor(color)
  726.         }
  727.         else
  728.         {
  729.             val color = ContextCompat.getColor(this, R.color.colorPrimaryDark)
  730.             div1.setBackgroundColor(color)
  731.             div2.setBackgroundColor(color)
  732.             div2a.setBackgroundColor(color)
  733.             div3.setBackgroundColor(color)
  734.             div5.setBackgroundColor(color)
  735.             div6.setBackgroundColor(color)
  736.             div7.setBackgroundColor(color)
  737.             div8.setBackgroundColor(color)
  738.         }
  739.  
  740.         row.addView(c1)
  741.         row.addView(div1)
  742.         row.addView(c2)
  743.         row.addView(div2)
  744.         if (hasD3cols) {
  745.             row.addView(c2a)
  746.             row.addView(div2a)
  747.         }
  748.         row.addView(c3)
  749.         row.addView(div3)
  750.         row.addView(c5)
  751.         row.addView(div5)
  752.         row.addView(c6)
  753.         row.addView(div6)
  754.         row.addView(c7)
  755.         row.addView(div7)
  756.         row.addView(c8)
  757.         row.addView(div8)
  758.         if (hasD3cols) {
  759.             row.addView(c10)
  760.         }
  761.  
  762.         return row
  763.     }
  764.  
  765.     private fun makeRowViewAsynchronnous(strings: Strings, hasD3cols: Boolean, isLastRow: Boolean): View {
  766.         val row = TableRow(this)
  767.         val rowParams = TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT)
  768.         rowParams.gravity = Gravity.CENTER_HORIZONTAL
  769.         row.layoutParams = rowParams
  770.         runOnUiThread {
  771.             val inflater = AsyncLayoutInflater(this)
  772.             val lp = TableRow.LayoutParams(
  773.                 TableRow.LayoutParams.WRAP_CONTENT,
  774.                 TableRow.LayoutParams.WRAP_CONTENT,
  775.                 1f
  776.             )
  777.             lp.gravity = Gravity.LEFT
  778.             val c1 = inflater.inflate(R.layout.sjr_cell, row) { view, _, parent ->
  779.                 view.layoutParams = lp
  780.                 view.findViewById<TextView>(R.id.main).text = strings.column_text.col1
  781.                 checkNotNull(parent).addView(view)
  782.             }
  783.  
  784.             val div1 = View(this)
  785.             div1.layoutParams = TableRow.LayoutParams(
  786.                 1,
  787.                 TableRow.LayoutParams.MATCH_PARENT
  788.             )
  789.  
  790.             val c2 = inflater.inflate(R.layout.sjr_cell, row) { view, _, parent ->
  791.                 view.layoutParams = TableRow.LayoutParams(
  792.                     TableRow.LayoutParams.WRAP_CONTENT,
  793.                     TableRow.LayoutParams.WRAP_CONTENT,
  794.                     1f
  795.                 )
  796.                 view.findViewById<TextView>(R.id.main).text = strings.column_text.col2
  797.                 val sb = view.findViewById<TextView>(R.id.symbolBefore)
  798.                 sb.visibility = View.VISIBLE
  799.                 sb.text = getStringForSymbols(strings.symbol_pics.col2)
  800.                 checkNotNull(parent).addView(div1)
  801.                 checkNotNull(parent).addView(view)
  802.             }
  803.  
  804.             val div2 = View(this)
  805.             div2.layoutParams = TableRow.LayoutParams(
  806.                 1,
  807.                 TableRow.LayoutParams.MATCH_PARENT
  808.             )
  809.  
  810.             if (hasD3cols) {
  811.                 val c2a = inflater.inflate(R.layout.sjr_cell, row) { view, _, parent ->
  812.                     view.layoutParams = TableRow.LayoutParams(
  813.                         TableRow.LayoutParams.WRAP_CONTENT,
  814.                         TableRow.LayoutParams.WRAP_CONTENT,
  815.                         1f
  816.                     )
  817.                     view.findViewById<TextView>(R.id.main).text = strings.column_text.col2a
  818.                     val sb = view.findViewById<TextView>(R.id.symbolBefore)
  819.                     sb.visibility = View.VISIBLE
  820.                     sb.text = getStringForSymbols(strings.symbol_pics.col2a)
  821.                     checkNotNull(parent).addView(div2)
  822.                     checkNotNull(parent).addView(view)
  823.                 }
  824.             }
  825.  
  826.             val div2a = View(this)
  827.             div2a.layoutParams = TableRow.LayoutParams(
  828.                 1,
  829.                 TableRow.LayoutParams.MATCH_PARENT
  830.             )
  831.  
  832.             val c3 = inflater.inflate(R.layout.sjr_cell, row) { view, _, parent ->
  833.                 view.layoutParams = TableRow.LayoutParams(
  834.                     TableRow.LayoutParams.WRAP_CONTENT,
  835.                     TableRow.LayoutParams.WRAP_CONTENT,
  836.                     1f
  837.                 )
  838.                 val main = view.findViewById<TextView>(R.id.main)
  839.                 main.text = strings.column_text.col3
  840.                 main.setTypeface(main.typeface, Typeface.BOLD)
  841.                 val up = view.findViewById<TextView>(R.id.up)
  842.                 if (strings.column_text.col3_up.isNotEmpty()) {
  843.                     up.visibility = View.VISIBLE
  844.                     up.text = strings.column_text.col3_up
  845.                 } else {
  846.                     up.visibility = View.INVISIBLE
  847.                     up.text = "5"
  848.                 }
  849.                 up.setTypeface(up.typeface, Typeface.BOLD)
  850.  
  851.                 if (hasD3cols) {
  852.                     checkNotNull(parent).addView(div2a)
  853.                 } else {
  854.                     checkNotNull(parent).addView(div2)
  855.                 }
  856.                 checkNotNull(parent).addView(view)
  857.             }
  858.  
  859.             val div3 = View(this)
  860.             div3.layoutParams = TableRow.LayoutParams(
  861.                 1,
  862.                 TableRow.LayoutParams.MATCH_PARENT
  863.             )
  864.  
  865.             val c5 = inflater.inflate(R.layout.sjr_cell_time, row) { view, _, parent ->
  866.                 view.layoutParams = TableRow.LayoutParams(
  867.                     TableRow.LayoutParams.WRAP_CONTENT,
  868.                     TableRow.LayoutParams.WRAP_CONTENT,
  869.                     1f
  870.                 )
  871.                 val hh = view.findViewById<TextView>(R.id.hh)
  872.                 val mm = view.findViewById<TextView>(R.id.mm)
  873.                 val up = view.findViewById<TextView>(R.id.up)
  874.  
  875.                 val arr = strings.column_text.col5
  876.                 if (arr.split(" ").size > 1) {
  877.                     hh.text = arr.split(" ")[0]
  878.                     mm.text = arr.split(" ")[1]
  879.                 } else {
  880.                     hh.text = "00"
  881.                     hh.visibility = View.INVISIBLE
  882.                     mm.text = arr
  883.                 }
  884.                 if (strings.column_text.col5_up.isNotEmpty()) {
  885.                     up.text = strings.column_text.col5_up
  886.                 } else {
  887.                     up.visibility = View.INVISIBLE
  888.                     up.text = "5"
  889.                 }
  890.                 hh.setTypeface(hh.typeface, Typeface.BOLD)
  891.                 mm.setTypeface(mm.typeface, Typeface.BOLD)
  892.                 up.setTypeface(up.typeface, Typeface.BOLD)
  893.                 val sb = view.findViewById<TextView>(R.id.symbolBefore)
  894.                 sb.text = getStringForSymbols(strings.symbol_pics.col5)
  895.                 sb.visibility = View.VISIBLE
  896.                 checkNotNull(parent).addView(div3)
  897.                 checkNotNull(parent).addView(view)
  898.             }
  899.  
  900.             val div5 = View(this)
  901.             div5.layoutParams = TableRow.LayoutParams(
  902.                 1,
  903.                 TableRow.LayoutParams.MATCH_PARENT
  904.             )
  905.  
  906.             val c6 = inflater.inflate(R.layout.sjr_cell, row) { view, _, parent ->
  907.                 view.layoutParams = TableRow.LayoutParams(
  908.                     TableRow.LayoutParams.WRAP_CONTENT,
  909.                     TableRow.LayoutParams.WRAP_CONTENT,
  910.                     1f
  911.                 )
  912.                 val c6_symString = getStringForSymbols(strings.symbol_pics.col6)
  913.                 if (c6_symString.isNotEmpty()) {
  914.                     val sb = view.findViewById<TextView>(R.id.symbolBefore)
  915.                     view.findViewById<TextView>(R.id.main).visibility = View.GONE
  916.                     view.findViewById<TextView>(R.id.up).visibility = View.GONE
  917.                     sb.visibility = View.VISIBLE
  918.                     sb.text = c6_symString
  919.                 } else {
  920.                     view.findViewById<TextView>(R.id.main).text = strings.column_text.col6
  921.                     val up = view.findViewById<TextView>(R.id.up)
  922.                     if (strings.column_text.col6_up.isNotEmpty()) {
  923.                         up.visibility = View.VISIBLE
  924.                         up.text = strings.column_text.col6_up
  925.                     } else {
  926.                         up.visibility = View.INVISIBLE
  927.                         up.text = "5"
  928.                     }
  929.                 }
  930.                 checkNotNull(parent).addView(div5)
  931.                 checkNotNull(parent).addView(view)
  932.             }
  933.  
  934.             val div6 = View(this)
  935.             div6.layoutParams = TableRow.LayoutParams(
  936.                 1,
  937.                 TableRow.LayoutParams.MATCH_PARENT
  938.             )
  939.  
  940.             val c7 = inflater.inflate(R.layout.sjr_cell_time, row) { view, _, parent ->
  941.                 view.layoutParams = TableRow.LayoutParams(
  942.                     TableRow.LayoutParams.WRAP_CONTENT,
  943.                     TableRow.LayoutParams.WRAP_CONTENT,
  944.                     1f
  945.                 )
  946.                 val hh = view.findViewById<TextView>(R.id.hh)
  947.                 val mm = view.findViewById<TextView>(R.id.mm)
  948.                 val up = view.findViewById<TextView>(R.id.up)
  949.  
  950.                 val dep = strings.column_text.col7
  951.                 if (dep.split(" ").size > 1) {
  952.                     hh.text = dep.split(" ")[0]
  953.                     mm.text = dep.split(" ")[1]
  954.                 } else {
  955.                     hh.text = "00"
  956.                     hh.visibility = View.INVISIBLE
  957.                     mm.text = dep
  958.                 }
  959.                 if (strings.column_text.col7_up.isNotEmpty()) {
  960.                     up.text = strings.column_text.col7_up
  961.                 } else {
  962.                     up.visibility = View.INVISIBLE
  963.                     up.text = "5"
  964.                 }
  965.                 hh.setTypeface(hh.typeface, Typeface.BOLD)
  966.                 mm.setTypeface(mm.typeface, Typeface.BOLD)
  967.                 up.setTypeface(up.typeface, Typeface.BOLD)
  968.                 val sb = view.findViewById<TextView>(R.id.symbolBefore)
  969.                 sb.visibility = View.VISIBLE
  970.                 sb.text = getStringForSymbols(strings.symbol_pics.col7)
  971.                 checkNotNull(parent).addView(div6)
  972.                 checkNotNull(parent).addView(view)
  973.             }
  974.  
  975.             val div7 = View(this)
  976.             div7.layoutParams = TableRow.LayoutParams(
  977.                 1,
  978.                 TableRow.LayoutParams.MATCH_PARENT
  979.             )
  980.  
  981.             val c8 = inflater.inflate(R.layout.sjr_cell, row) { view, _, parent ->
  982.                 view.layoutParams = TableRow.LayoutParams(
  983.                     TableRow.LayoutParams.WRAP_CONTENT,
  984.                     TableRow.LayoutParams.WRAP_CONTENT,
  985.                     1f
  986.                 )
  987.                 val main = view.findViewById<TextView>(R.id.main)
  988.                 main.text = strings.column_text.col8
  989.                 main.setTypeface(main.typeface, Typeface.BOLD)
  990.                 val up = view.findViewById<TextView>(R.id.up)
  991.                 up.visibility = View.VISIBLE
  992.                 up.text = strings.column_text.col8_up
  993.                 val dn = view.findViewById<TextView>(R.id.down)
  994.                 dn.visibility = View.VISIBLE
  995.                 dn.text = strings.column_text.col8_bo
  996.                 val sa = view.findViewById<TextView>(R.id.symbolAfter)
  997.                 sa.visibility = View.VISIBLE
  998.                 sa.text = getStringForSymbols(strings.symbol_pics.col8)
  999.                 checkNotNull(parent).addView(div7)
  1000.                 checkNotNull(parent).addView(view)
  1001.             }
  1002.  
  1003.             val div8 = View(this)
  1004.             div8.layoutParams = TableRow.LayoutParams(
  1005.                 1,
  1006.                 TableRow.LayoutParams.MATCH_PARENT
  1007.             )
  1008.  
  1009.             if (hasD3cols) {
  1010.                 val c10 = inflater.inflate(R.layout.sjr_cell, row) { view, _, parent ->
  1011.                     view.layoutParams = TableRow.LayoutParams(
  1012.                         TableRow.LayoutParams.WRAP_CONTENT,
  1013.                         TableRow.LayoutParams.WRAP_CONTENT,
  1014.                         1f
  1015.                     )
  1016.                     view.findViewById<TextView>(R.id.main).text = strings.column_text.col10
  1017.                     view.findViewById<TextView>(R.id.up).visibility = View.GONE
  1018.                     val sa = view.findViewById<TextView>(R.id.symbolAfter)
  1019.                     sa.visibility = View.VISIBLE
  1020.                     sa.text = getStringForSymbols(strings.symbol_pics.col10)
  1021.                     checkNotNull(parent).addView(div8)
  1022.                     checkNotNull(parent).addView(view)
  1023.                     if (isLastRow) {
  1024.                         findViewById<ProgressBar>(R.id.progressBar).visibility = View.INVISIBLE
  1025.                     }
  1026.                 }
  1027.             }
  1028.  
  1029.             if (contrast.nightTheme) {
  1030.                 val color = ContextCompat.getColor(this, R.color.colorPrimary)
  1031.                 div1.setBackgroundColor(color)
  1032.                 div2.setBackgroundColor(color)
  1033.                 div2a.setBackgroundColor(color)
  1034.                 div3.setBackgroundColor(color)
  1035.                 div5.setBackgroundColor(color)
  1036.                 div6.setBackgroundColor(color)
  1037.                 div7.setBackgroundColor(color)
  1038.                 if (hasD3cols) {
  1039.                     div8.setBackgroundColor(color)
  1040.                 }
  1041.             }
  1042.             else
  1043.             {
  1044.                 val color = ContextCompat.getColor(this, R.color.colorPrimaryDark)
  1045.                 div1.setBackgroundColor(color)
  1046.                 div2.setBackgroundColor(color)
  1047.                 div2a.setBackgroundColor(color)
  1048.                 div3.setBackgroundColor(color)
  1049.                 div5.setBackgroundColor(color)
  1050.                 div6.setBackgroundColor(color)
  1051.                 div7.setBackgroundColor(color)
  1052.                 if (hasD3cols) {
  1053.                     div8.setBackgroundColor(color)
  1054.                 }
  1055.             }
  1056.         }
  1057.         return row
  1058.     }
  1059.  
  1060.     private fun generateRows(timetable: Timetable): List<View> {
  1061.         val viewList: MutableList<View> = mutableListOf()
  1062.         var lastArrHour = -1
  1063.         var lastDepHour = -1
  1064.         var lastSpeed = -1
  1065.         checkNotNull(timetable.route).track_sections.forEachIndexed { tsIndex, trackSection ->
  1066.             if (trackSection.line_name != "?" || isShowAllChecked || tsIndex == checkNotNull(timetable.route).track_sections.size-1) {
  1067.                 trackSection.timetable_entries.forEachIndexed { teIndex, timetableEntry ->
  1068.                     if ((teIndex == trackSection.timetable_entries.size-1 || isShowAllChecked || timetableEntry.stopping) && timetableEntry.point_name.isNotEmpty()) {
  1069.                         val response = makeStrings(timetableEntry, lastArrHour, lastDepHour, lastSpeed)
  1070.                         lastArrHour = response.lastArrHour
  1071.                         lastDepHour = response.lastDepHour
  1072.                         lastSpeed = response.lastSpeed
  1073.                         viewList.add(makeRowView(response.strings, timetable.D3, teIndex == trackSection.timetable_entries.size-1))
  1074.                     }
  1075.                 }
  1076.             }
  1077.         }
  1078.         return viewList
  1079.     }
  1080.  
  1081.     private fun parseXML(`is`: InputStream): Timetable? {
  1082.         val parser = TimetableXmlParser()
  1083.         return parser.parse(`is`)
  1084.     }
  1085.  
  1086.     override fun onBackPressed() {
  1087.         contrast.unregisterListener()
  1088.         handler.removeCallbacks(clockRunnable)
  1089.         finish()
  1090.         super.onBackPressed()
  1091.         //startActivity(Intent(this, landing_screen::class.java))
  1092.     }
  1093.  
  1094.     override fun onResume() {
  1095.         // Register a listener for the sensor.
  1096.         super.onResume()
  1097.         clockRunnable.run()
  1098.         contrast.onResume()
  1099.     }
  1100.  
  1101.     override fun onPause() {
  1102.         // Be sure to unregister the sensor when the activity pauses.
  1103.         contrast.unregisterListener()
  1104.         handler.removeCallbacks(clockRunnable)
  1105.         super.onPause()
  1106.     }
  1107.  
  1108.     override fun onStop() {
  1109.         // Be sure to unregister the sensor when the activity pauses.
  1110.         contrast.unregisterListener()
  1111.         handler.removeCallbacks(clockRunnable)
  1112.         super.onStop()
  1113.     }
  1114.  
  1115.     override fun onRestart() {
  1116.         contrast.onRestart()
  1117.         handler.removeCallbacks(clockRunnable)
  1118.         super.onRestart()
  1119.     }
  1120. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement