mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-23 14:31:30 +01:00
Name adjustments and minor fixes
+ Fix `top-margin` in the choose activity + Rename `ViewPager` files for Settings to contain the string 'Settings' + Rename `firstStartup` to `Tutorial` + Remove unused library imports in `SettingsActivity.kt`
This commit is contained in:
parent
09738cd648
commit
b46c9d76d3
9 changed files with 10 additions and 22 deletions
|
@ -24,7 +24,7 @@
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".FirstStartupActivity"
|
<activity android:name=".TutorialActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
tools:ignore="LockedOrientationActivity">
|
tools:ignore="LockedOrientationActivity">
|
||||||
</activity>
|
</activity>
|
||||||
|
|
|
@ -86,7 +86,7 @@ class MainActivity : AppCompatActivity(),
|
||||||
|
|
||||||
// First Startup
|
// First Startup
|
||||||
if (!sharedPref.getBoolean("startedBefore", false)){
|
if (!sharedPref.getBoolean("startedBefore", false)){
|
||||||
startActivity(Intent(this, FirstStartupActivity::class.java))
|
startActivity(Intent(this, TutorialActivity::class.java))
|
||||||
tooltipTimer.cancel()
|
tooltipTimer.cancel()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +1,15 @@
|
||||||
package com.finnmglas.launcher
|
package com.finnmglas.launcher
|
||||||
|
|
||||||
import android.Manifest
|
|
||||||
import android.app.AlertDialog
|
|
||||||
import android.content.*
|
import android.content.*
|
||||||
import android.content.pm.PackageManager
|
|
||||||
import android.net.Uri
|
|
||||||
import android.os.Build
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.provider.MediaStore
|
|
||||||
import android.provider.Settings
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import android.widget.Toast
|
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.content.ContextCompat
|
|
||||||
import androidx.viewpager.widget.ViewPager
|
import androidx.viewpager.widget.ViewPager
|
||||||
import com.finnmglas.launcher.extern.*
|
import com.finnmglas.launcher.extern.*
|
||||||
import com.finnmglas.launcher.settings.SectionsPagerAdapter
|
import com.finnmglas.launcher.settings.SectionsPagerAdapter
|
||||||
import com.google.android.material.tabs.TabLayout
|
import com.google.android.material.tabs.TabLayout
|
||||||
import kotlinx.android.synthetic.main.activity_settings.*
|
import kotlinx.android.synthetic.main.activity_settings.*
|
||||||
import kotlinx.android.synthetic.main.fragment_settings_apps.*
|
|
||||||
import kotlinx.android.synthetic.main.fragment_settings_theme.*
|
|
||||||
|
|
||||||
|
|
||||||
class SettingsActivity : AppCompatActivity() {
|
class SettingsActivity : AppCompatActivity() {
|
||||||
|
|
|
@ -7,10 +7,10 @@ import android.util.TypedValue
|
||||||
import android.view.*
|
import android.view.*
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import com.finnmglas.launcher.extern.*
|
import com.finnmglas.launcher.extern.*
|
||||||
import kotlinx.android.synthetic.main.activity_firststartup.*
|
import kotlinx.android.synthetic.main.activity_tutorial.*
|
||||||
|
|
||||||
|
|
||||||
class FirstStartupActivity : AppCompatActivity(){
|
class TutorialActivity : AppCompatActivity(){
|
||||||
|
|
||||||
/** Variables for this activity */
|
/** Variables for this activity */
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ class FirstStartupActivity : AppCompatActivity(){
|
||||||
else -> R.style.finnmglasTheme
|
else -> R.style.finnmglasTheme
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
setContentView(R.layout.activity_firststartup)
|
setContentView(R.layout.activity_tutorial)
|
||||||
|
|
||||||
if (getSavedTheme(this) == "custom") {
|
if (getSavedTheme(this) == "custom") {
|
||||||
activity_firststartup_app_bar.setBackgroundColor(dominantColor)
|
activity_firststartup_app_bar.setBackgroundColor(dominantColor)
|
|
@ -13,7 +13,7 @@ import androidx.fragment.app.Fragment
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import com.finnmglas.launcher.FirstStartupActivity
|
import com.finnmglas.launcher.TutorialActivity
|
||||||
import com.finnmglas.launcher.R
|
import com.finnmglas.launcher.R
|
||||||
import com.finnmglas.launcher.extern.*
|
import com.finnmglas.launcher.extern.*
|
||||||
import kotlinx.android.synthetic.main.fragment_settings_meta.*
|
import kotlinx.android.synthetic.main.fragment_settings_meta.*
|
||||||
|
@ -76,7 +76,7 @@ class SettingsFragmentMeta : Fragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fragment_settings_meta_view_tutorial_btn.setOnClickListener {
|
fragment_settings_meta_view_tutorial_btn.setOnClickListener {
|
||||||
startActivity(Intent(this.context, FirstStartupActivity::class.java))
|
startActivity(Intent(this.context, TutorialActivity::class.java))
|
||||||
}
|
}
|
||||||
|
|
||||||
// prompting for settings-reset confirmation
|
// prompting for settings-reset confirmation
|
||||||
|
|
|
@ -5,7 +5,7 @@ import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.Transformations
|
import androidx.lifecycle.Transformations
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
|
|
||||||
class PageViewModel : ViewModel() {
|
class SettingsPageViewModel : ViewModel() {
|
||||||
|
|
||||||
private val _index = MutableLiveData<Int>()
|
private val _index = MutableLiveData<Int>()
|
||||||
val text: LiveData<String> = Transformations.map(_index) {
|
val text: LiveData<String> = Transformations.map(_index) {
|
|
@ -61,10 +61,9 @@
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/activity_choose_apps_recycler_view"
|
android:id="@+id/activity_choose_apps_recycler_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="0dp"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_marginLeft="16dp"
|
||||||
android:layout_marginTop="86dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:layout_marginRight="16dp"
|
android:layout_marginRight="16dp"
|
||||||
android:scrollbars="vertical"
|
android:scrollbars="vertical"
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/colorPrimary"
|
android:background="?attr/colorPrimary"
|
||||||
android:onClick="clickAnywhere"
|
android:onClick="clickAnywhere"
|
||||||
tools:context=".FirstStartupActivity">
|
tools:context=".TutorialActivity">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/activity_firststartup_app_bar"
|
android:id="@+id/activity_firststartup_app_bar"
|
Loading…
Add table
Reference in a new issue