mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-23 06:21:31 +01:00
Fix older API onclicks
This commit is contained in:
parent
dc1238e4e0
commit
a56cec7f9e
9 changed files with 19 additions and 9 deletions
|
@ -11,7 +11,7 @@
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/darkTheme">
|
android:theme="@style/finnmglasTheme">
|
||||||
|
|
||||||
<activity android:name=".MainActivity"
|
<activity android:name=".MainActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
|
|
|
@ -27,6 +27,9 @@ class ChooseActivity : AppCompatActivity() {
|
||||||
|
|
||||||
setContentView(R.layout.activity_choose)
|
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 bundle = intent.extras
|
||||||
val action = bundle!!.getString("action") // why choose an app
|
val action = bundle!!.getString("action") // why choose an app
|
||||||
val forApp = bundle.getString("forApp") // which app we choose
|
val forApp = bundle.getString("forApp") // which app we choose
|
||||||
|
|
|
@ -44,6 +44,9 @@ class FirstStartupActivity : AppCompatActivity(){
|
||||||
defaultApps = resetSettings(sharedPref, this) // UP, DOWN, RIGHT, LEFT, VOLUME_UP, VOLUME_DOWN
|
defaultApps = resetSettings(sharedPref, this) // UP, DOWN, RIGHT, LEFT, VOLUME_UP, VOLUME_DOWN
|
||||||
else
|
else
|
||||||
app_bar.visibility = View.VISIBLE
|
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 */
|
/** Touch- and Key-related functions to navigate */
|
||||||
|
|
|
@ -51,10 +51,7 @@ class MainActivity : AppCompatActivity(),
|
||||||
showSettingsIcon()
|
showSettingsIcon()
|
||||||
|
|
||||||
// As older APIs somehow do not recognize the xml defined onClick
|
// As older APIs somehow do not recognize the xml defined onClick
|
||||||
findViewById<View>(R.id.settingstooltip).setOnClickListener() {
|
settingstooltip.setOnClickListener() { openSettings() }
|
||||||
openSettings()
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
// First Startup
|
// First Startup
|
||||||
if (!sharedPref.getBoolean("startedBefore", false)){
|
if (!sharedPref.getBoolean("startedBefore", false)){
|
||||||
|
|
|
@ -32,6 +32,9 @@ class SettingsActivity : AppCompatActivity() {
|
||||||
viewPager.adapter = sectionsPagerAdapter
|
viewPager.adapter = sectionsPagerAdapter
|
||||||
val tabs: TabLayout = findViewById(R.id.tabs)
|
val tabs: TabLayout = findViewById(R.id.tabs)
|
||||||
tabs.setupWithViewPager(viewPager)
|
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?) {
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<com.finnmglas.launcher.FontAwesome
|
<com.finnmglas.launcher.FontAwesome
|
||||||
android:id="@+id/close_settings"
|
android:id="@+id/close_chooser"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
|
|
|
@ -8,7 +8,9 @@
|
||||||
android:background="?attr/colorPrimary"
|
android:background="?attr/colorPrimary"
|
||||||
android:gravity="center|top"
|
android:gravity="center|top"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="32sp"
|
android:paddingTop="16sp"
|
||||||
|
android:paddingLeft="32sp"
|
||||||
|
android:paddingRight="32sp"
|
||||||
tools:context=".SettingsActivity">
|
tools:context=".SettingsActivity">
|
||||||
|
|
||||||
<TableLayout
|
<TableLayout
|
||||||
|
|
|
@ -8,7 +8,9 @@
|
||||||
android:background="?attr/colorPrimary"
|
android:background="?attr/colorPrimary"
|
||||||
android:gravity="center|top"
|
android:gravity="center|top"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="32sp"
|
android:paddingTop="16sp"
|
||||||
|
android:paddingLeft="32sp"
|
||||||
|
android:paddingRight="32sp"
|
||||||
tools:context=".SettingsActivity">
|
tools:context=".SettingsActivity">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingLeft="32sp"
|
android:paddingLeft="32sp"
|
||||||
android:paddingTop="32sp"
|
android:paddingTop="16sp"
|
||||||
android:paddingRight="32sp"
|
android:paddingRight="32sp"
|
||||||
tools:context=".SettingsActivity">
|
tools:context=".SettingsActivity">
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue