mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-22 22:11:27 +01:00
use system wallpaper
This commit is contained in:
parent
bb36eddee6
commit
7c945aa6c2
2 changed files with 4 additions and 19 deletions
|
@ -46,6 +46,7 @@ class HomeActivity: UIObject, AppCompatActivity(),
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
this.setTheme(android.R.style.Theme_Wallpaper_NoTitleBar_Fullscreen)
|
||||||
// Initialise globals
|
// Initialise globals
|
||||||
launcherPreferences = this.getSharedPreferences(
|
launcherPreferences = this.getSharedPreferences(
|
||||||
getString(R.string.preference_file_key), Context.MODE_PRIVATE)
|
getString(R.string.preference_file_key), Context.MODE_PRIVATE)
|
||||||
|
@ -104,9 +105,6 @@ class HomeActivity: UIObject, AppCompatActivity(),
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
|
||||||
if (home_background_image != null && getSavedTheme(this) == "custom")
|
|
||||||
home_background_image.setImageBitmap(background)
|
|
||||||
|
|
||||||
// Applying the date / time format (changeable in settings)
|
// Applying the date / time format (changeable in settings)
|
||||||
val dFormat = launcherPreferences.getInt(PREF_DATE_FORMAT, 0)
|
val dFormat = launcherPreferences.getInt(PREF_DATE_FORMAT, 0)
|
||||||
val upperFMT = resources.getStringArray(R.array.settings_launcher_time_formats_upper)
|
val upperFMT = resources.getStringArray(R.array.settings_launcher_time_formats_upper)
|
||||||
|
@ -215,9 +213,9 @@ class HomeActivity: UIObject, AppCompatActivity(),
|
||||||
|
|
||||||
override fun applyTheme() {
|
override fun applyTheme() {
|
||||||
|
|
||||||
home_container.setBackgroundColor(dominantColor)
|
// home_container.setBackgroundColor(dominantColor)
|
||||||
|
|
||||||
if (launcherPreferences.getString(PREF_WALLPAPER, "") != "") {
|
/*if (launcherPreferences.getString(PREF_WALLPAPER, "") != "") {
|
||||||
try {
|
try {
|
||||||
background = MediaStore.Images.Media.getBitmap(
|
background = MediaStore.Images.Media.getBitmap(
|
||||||
this.contentResolver, Uri.parse(
|
this.contentResolver, Uri.parse(
|
||||||
|
@ -229,10 +227,7 @@ class HomeActivity: UIObject, AppCompatActivity(),
|
||||||
// Background image was deleted or something unexpected happened
|
// Background image was deleted or something unexpected happened
|
||||||
if (background == null) resetToDefaultTheme(this)
|
if (background == null) resetToDefaultTheme(this)
|
||||||
|
|
||||||
home_background_image.visibility = View.VISIBLE
|
}*/
|
||||||
} else {
|
|
||||||
home_background_image.visibility = View.INVISIBLE
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setOnClicks() {
|
override fun setOnClicks() {
|
||||||
|
|
|
@ -7,19 +7,9 @@
|
||||||
android:id="@+id/home_container"
|
android:id="@+id/home_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/colorPrimary"
|
|
||||||
android:longClickable="false"
|
android:longClickable="false"
|
||||||
tools:context=".HomeActivity">
|
tools:context=".HomeActivity">
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/home_background_image"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
tools:ignore="ContentDescription" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/home_upper_view"
|
android:id="@+id/home_upper_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
Loading…
Add table
Reference in a new issue