release 0.5.0 #35
@ -23,10 +23,12 @@
 | 
				
			|||||||
package org.mosad.seil0.projectlaogai
 | 
					package org.mosad.seil0.projectlaogai
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import android.app.PendingIntent
 | 
					import android.app.PendingIntent
 | 
				
			||||||
 | 
					import android.content.Context
 | 
				
			||||||
import android.content.Intent
 | 
					import android.content.Intent
 | 
				
			||||||
import android.content.IntentFilter
 | 
					import android.content.IntentFilter
 | 
				
			||||||
import android.graphics.Color
 | 
					import android.graphics.Color
 | 
				
			||||||
import android.nfc.NfcAdapter
 | 
					import android.nfc.NfcAdapter
 | 
				
			||||||
 | 
					import android.nfc.NfcManager
 | 
				
			||||||
import android.nfc.tech.NfcA
 | 
					import android.nfc.tech.NfcA
 | 
				
			||||||
import android.os.Bundle
 | 
					import android.os.Bundle
 | 
				
			||||||
import android.view.Menu
 | 
					import android.view.Menu
 | 
				
			||||||
@ -58,6 +60,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
 | 
				
			|||||||
    private lateinit var pendingIntent: PendingIntent
 | 
					    private lateinit var pendingIntent: PendingIntent
 | 
				
			||||||
    private lateinit var intentFiltersArray: Array<IntentFilter>
 | 
					    private lateinit var intentFiltersArray: Array<IntentFilter>
 | 
				
			||||||
    private lateinit var techListsArray: Array<Array<String>>
 | 
					    private lateinit var techListsArray: Array<Array<String>>
 | 
				
			||||||
 | 
					    private var useNFC = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    override fun onCreate(savedInstanceState: Bundle?) {
 | 
					    override fun onCreate(savedInstanceState: Bundle?) {
 | 
				
			||||||
        Aesthetic.attach(this)
 | 
					        Aesthetic.attach(this)
 | 
				
			||||||
@ -99,6 +102,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
 | 
				
			|||||||
    override fun onResume() {
 | 
					    override fun onResume() {
 | 
				
			||||||
        super.onResume()
 | 
					        super.onResume()
 | 
				
			||||||
        Aesthetic.resume(this)
 | 
					        Aesthetic.resume(this)
 | 
				
			||||||
 | 
					        if(useNFC)
 | 
				
			||||||
            adapter.enableForegroundDispatch(this, pendingIntent, intentFiltersArray, techListsArray)
 | 
					            adapter.enableForegroundDispatch(this, pendingIntent, intentFiltersArray, techListsArray)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -106,6 +110,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
 | 
				
			|||||||
    override fun onPause() {
 | 
					    override fun onPause() {
 | 
				
			||||||
        super.onPause()
 | 
					        super.onPause()
 | 
				
			||||||
        Aesthetic.pause(this)
 | 
					        Aesthetic.pause(this)
 | 
				
			||||||
 | 
					        if(useNFC)
 | 
				
			||||||
            adapter.disableForegroundDispatch(this)
 | 
					            adapter.disableForegroundDispatch(this)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -189,6 +194,11 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private fun initForegroundDispatch() {
 | 
					    private fun initForegroundDispatch() {
 | 
				
			||||||
 | 
					        val nfcManager = this.getSystemService(Context.NFC_SERVICE) as NfcManager
 | 
				
			||||||
 | 
					        val nfcAdapter = nfcManager.defaultAdapter
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (nfcAdapter != null) {
 | 
				
			||||||
 | 
					            useNFC = true
 | 
				
			||||||
            intentFiltersArray = arrayOf(IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED).apply { addDataType("*/*") })
 | 
					            intentFiltersArray = arrayOf(IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED).apply { addDataType("*/*") })
 | 
				
			||||||
            techListsArray = arrayOf(arrayOf(NfcA::class.java.name))
 | 
					            techListsArray = arrayOf(arrayOf(NfcA::class.java.name))
 | 
				
			||||||
            adapter = NfcAdapter.getDefaultAdapter(this)
 | 
					            adapter = NfcAdapter.getDefaultAdapter(this)
 | 
				
			||||||
@ -196,7 +206,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
 | 
				
			|||||||
                this, 0,
 | 
					                this, 0,
 | 
				
			||||||
                Intent(this, javaClass).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0
 | 
					                Intent(this, javaClass).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,7 @@
 | 
				
			|||||||
This release 0.5.0 is called  "artistical Apollon".
 | 
					This release 0.5.0 is called  "artistical Apollon".
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* new: it's now possible to choos a theme (light, dark or balck)
 | 
					* new: it's now possible to choos a theme (light, dark or balck)
 | 
				
			||||||
* change: updated some libs, updated kotlin to 1.3.40
 | 
					* new: you can now check your current mensa card balance
 | 
				
			||||||
 | 
					* change: updated some libs, updated kotlin to 1.3.41
 | 
				
			||||||
* fix: the mensa should now show the correct meals on sunday/monday
 | 
					* fix: the mensa should now show the correct meals on sunday/monday
 | 
				
			||||||
 | 
					* fix: the timetable should now show the correct on the sunday/monday change
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user