Fix older API onclicks

This commit is contained in:
Finn M Glas 2020-05-22 23:32:21 +02:00
parent dc1238e4e0
commit a56cec7f9e
No known key found for this signature in database
GPG key ID: 25037A2E81AB459C
9 changed files with 19 additions and 9 deletions

View file

@ -11,7 +11,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/darkTheme">
android:theme="@style/finnmglasTheme">
<activity android:name=".MainActivity"
android:screenOrientation="portrait"

View file

@ -27,6 +27,9 @@ class ChooseActivity : AppCompatActivity() {
setContentView(R.layout.activity_choose)
// As older APIs somehow do not recognize the xml defined onClick
close_chooser.setOnClickListener() { finish() }
val bundle = intent.extras
val action = bundle!!.getString("action") // why choose an app
val forApp = bundle.getString("forApp") // which app we choose

View file

@ -44,6 +44,9 @@ class FirstStartupActivity : AppCompatActivity(){
defaultApps = resetSettings(sharedPref, this) // UP, DOWN, RIGHT, LEFT, VOLUME_UP, VOLUME_DOWN
else
app_bar.visibility = View.VISIBLE
// As older APIs somehow do not recognize the xml defined onClick
close_tutorial.setOnClickListener() { finish() }
}
/** Touch- and Key-related functions to navigate */

View file

@ -51,10 +51,7 @@ class MainActivity : AppCompatActivity(),
showSettingsIcon()
// As older APIs somehow do not recognize the xml defined onClick
findViewById<View>(R.id.settingstooltip).setOnClickListener() {
openSettings()
true
}
settingstooltip.setOnClickListener() { openSettings() }
// First Startup
if (!sharedPref.getBoolean("startedBefore", false)){

View file

@ -32,6 +32,9 @@ class SettingsActivity : AppCompatActivity() {
viewPager.adapter = sectionsPagerAdapter
val tabs: TabLayout = findViewById(R.id.tabs)
tabs.setupWithViewPager(viewPager)
// As older APIs somehow do not recognize the xml defined onClick
close_settings.setOnClickListener() { finish() }
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {

View file

@ -36,7 +36,7 @@
app:layout_constraintTop_toTopOf="parent" />
<com.finnmglas.launcher.FontAwesome
android:id="@+id/close_settings"
android:id="@+id/close_chooser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"

View file

@ -8,7 +8,9 @@
android:background="?attr/colorPrimary"
android:gravity="center|top"
android:orientation="vertical"
android:padding="32sp"
android:paddingTop="16sp"
android:paddingLeft="32sp"
android:paddingRight="32sp"
tools:context=".SettingsActivity">
<TableLayout

View file

@ -8,7 +8,9 @@
android:background="?attr/colorPrimary"
android:gravity="center|top"
android:orientation="vertical"
android:padding="32sp"
android:paddingTop="16sp"
android:paddingLeft="32sp"
android:paddingRight="32sp"
tools:context=".SettingsActivity">
<Button

View file

@ -9,7 +9,7 @@
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="32sp"
android:paddingTop="32sp"
android:paddingTop="16sp"
android:paddingRight="32sp"
tools:context=".SettingsActivity">