mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-23 06:21:31 +01:00
Fix older API alerts, Add titlebar to tutorial (on replay)
This commit is contained in:
parent
c81e6c06bc
commit
dc1238e4e0
10 changed files with 71 additions and 13 deletions
|
@ -42,6 +42,8 @@ class FirstStartupActivity : AppCompatActivity(){
|
|||
|
||||
if (isFirstTime)
|
||||
defaultApps = resetSettings(sharedPref, this) // UP, DOWN, RIGHT, LEFT, VOLUME_UP, VOLUME_DOWN
|
||||
else
|
||||
app_bar.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
/** Touch- and Key-related functions to navigate */
|
||||
|
@ -67,6 +69,10 @@ class FirstStartupActivity : AppCompatActivity(){
|
|||
loadMenu(this)
|
||||
}
|
||||
|
||||
fun backToSettings(view: View){
|
||||
finish()
|
||||
}
|
||||
|
||||
/** Touch- and Key-related functions to navigate */
|
||||
|
||||
private fun loadMenu(context :Context) { // Context needed for packageManager
|
||||
|
@ -94,7 +100,6 @@ class FirstStartupActivity : AppCompatActivity(){
|
|||
editor.putLong("firstStartup", System.currentTimeMillis() / 1000L) // record first startup timestamp
|
||||
editor.apply()
|
||||
}
|
||||
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,10 +38,6 @@ class MainActivity : AppCompatActivity(),
|
|||
val sharedPref = this.getSharedPreferences(
|
||||
getString(R.string.preference_file_key), Context.MODE_PRIVATE)
|
||||
|
||||
// First Startup
|
||||
if (!sharedPref.getBoolean("startedBefore", false))
|
||||
startActivity(Intent(this, FirstStartupActivity::class.java))
|
||||
|
||||
// Flags
|
||||
window.setFlags(
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
||||
|
@ -60,6 +56,11 @@ class MainActivity : AppCompatActivity(),
|
|||
true
|
||||
}
|
||||
|
||||
// First Startup
|
||||
if (!sharedPref.getBoolean("startedBefore", false)){
|
||||
startActivity(Intent(this, FirstStartupActivity::class.java))
|
||||
tooltipTimer.cancel()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStart(){
|
||||
|
|
|
@ -135,7 +135,7 @@ class SettingsActivity : AppCompatActivity() {
|
|||
}
|
||||
// on older sdk: manage app details
|
||||
else {
|
||||
AlertDialog.Builder(this)
|
||||
AlertDialog.Builder(this, R.style.AlertDialogCustom)
|
||||
.setTitle(getString(R.string.alert_cant_choose_launcher))
|
||||
.setMessage(getString(R.string.alert_cant_choose_launcher_message))
|
||||
.setPositiveButton(android.R.string.yes,
|
||||
|
@ -159,7 +159,7 @@ class SettingsActivity : AppCompatActivity() {
|
|||
|
||||
// Show a dialog prompting for confirmation
|
||||
fun resetSettingsClick(view: View) {
|
||||
AlertDialog.Builder(this)
|
||||
AlertDialog.Builder(this, R.style.AlertDialogCustom)
|
||||
.setTitle(getString(R.string.settings_reset))
|
||||
.setMessage(getString(R.string.settings_reset_message))
|
||||
.setPositiveButton(android.R.string.yes,
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:theme="@style/AppTheme.AppBarOverlay"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:custom="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -9,6 +10,54 @@
|
|||
android:onClick="clickAnywhere"
|
||||
tools:context=".FirstStartupActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:visibility="invisible"
|
||||
custom:layout_constraintEnd_toEndOf="parent"
|
||||
custom:layout_constraintStart_toStartOf="parent"
|
||||
custom:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:minHeight="?actionBarSize"
|
||||
android:padding="@dimen/appbar_padding"
|
||||
android:text="@string/tutorial_title"
|
||||
android:textAppearance="@style/TextAppearance.Widget.AppCompat.Toolbar.Title"
|
||||
custom:layout_constraintEnd_toEndOf="parent"
|
||||
custom:layout_constraintStart_toStartOf="parent"
|
||||
custom:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.finnmglas.launcher.FontAwesome
|
||||
android:id="@+id/close_tutorial"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="true"
|
||||
android:onClick="backToSettings"
|
||||
android:paddingLeft="16sp"
|
||||
android:paddingRight="16sp"
|
||||
android:text="@string/fa_close_window"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:textSize="22sp"
|
||||
custom:layout_constraintBottom_toBottomOf="parent"
|
||||
custom:layout_constraintEnd_toEndOf="parent"
|
||||
custom:layout_constraintTop_toTopOf="parent"
|
||||
custom:type="solid" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/heading"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -53,7 +52,8 @@
|
|||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
app:tabTextColor="?attr/android:textColor" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
<string name="choose_not_removed_toast">Die App konnte nicht entfernt werden</string>
|
||||
|
||||
<!-- FirstStartup Activity -->
|
||||
<string name="tutorial_title">Tutorial</string>
|
||||
<string-array name="intro">
|
||||
<!--item> heading | infoText | hintText | size | format </item-->
|
||||
<item>|Nimm dir kurz Zeit und lerne, wie du diesen Launcher verwendest!\n\n|— Tippe um weiterzukommen —|36F|0</item>
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
<string name="choose_not_removed_toast">Impossible de supprimer l\'application</string>
|
||||
|
||||
<!-- FirstStartup Activity -->
|
||||
<string name="tutorial_title">Le Tutoriel</string>
|
||||
<string-array name="intro">
|
||||
<!--item> heading | infoText | hintText | size | format </item-->
|
||||
<item>|Prenez un moment et apprenez à utiliser ce lanceur!\n\n|— Appuyez pour continuer —|36F|0</item>
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
<string name="choose_not_removed_toast">Unable to remove application</string>
|
||||
|
||||
<!-- FirstStartup Activity -->
|
||||
<string name="tutorial_title">Tutorial</string>
|
||||
<string-array name="intro">
|
||||
<!--item> heading | infoText | hintText | size | format </item-->
|
||||
<item>|Take a few seconds to learn how to use this Launcher!\n\n|— Tap anywhere to continue —|36F|0</item>
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
<style name="darkTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/darkTheme_background_color</item>
|
||||
<item name="colorPrimaryDark">@color/darkTheme_background_color</item>
|
||||
<item name="android:colorBackground">@color/darkTheme_background_color</item>
|
||||
|
||||
<item name="colorAccent">@color/darkTheme_accent_color</item>
|
||||
|
||||
|
@ -30,6 +29,8 @@
|
|||
<item name="android:windowDisablePreview">true</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||
<style name="AlertDialogCustom" parent="Theme.AppCompat.Light.Dialog.Alert">
|
||||
<item name="android:textColor">#000000</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Add table
Reference in a new issue