use system wallpaper

This commit is contained in:
Josia Pietsch 2024-07-04 00:35:12 +02:00
parent bb36eddee6
commit 7c945aa6c2
Signed by: jrpie
GPG key ID: E70B571D66986A2D
2 changed files with 4 additions and 19 deletions

View file

@ -46,6 +46,7 @@ class HomeActivity: UIObject, AppCompatActivity(),
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
this.setTheme(android.R.style.Theme_Wallpaper_NoTitleBar_Fullscreen)
// Initialise globals
launcherPreferences = this.getSharedPreferences(
getString(R.string.preference_file_key), Context.MODE_PRIVATE)
@ -104,9 +105,6 @@ class HomeActivity: UIObject, AppCompatActivity(),
override fun onResume() {
super.onResume()
if (home_background_image != null && getSavedTheme(this) == "custom")
home_background_image.setImageBitmap(background)
// Applying the date / time format (changeable in settings)
val dFormat = launcherPreferences.getInt(PREF_DATE_FORMAT, 0)
val upperFMT = resources.getStringArray(R.array.settings_launcher_time_formats_upper)
@ -215,9 +213,9 @@ class HomeActivity: UIObject, AppCompatActivity(),
override fun applyTheme() {
home_container.setBackgroundColor(dominantColor)
// home_container.setBackgroundColor(dominantColor)
if (launcherPreferences.getString(PREF_WALLPAPER, "") != "") {
/*if (launcherPreferences.getString(PREF_WALLPAPER, "") != "") {
try {
background = MediaStore.Images.Media.getBitmap(
this.contentResolver, Uri.parse(
@ -229,10 +227,7 @@ class HomeActivity: UIObject, AppCompatActivity(),
// Background image was deleted or something unexpected happened
if (background == null) resetToDefaultTheme(this)
home_background_image.visibility = View.VISIBLE
} else {
home_background_image.visibility = View.INVISIBLE
}
}*/
}
override fun setOnClicks() {

View file

@ -7,19 +7,9 @@
android:id="@+id/home_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorPrimary"
android:longClickable="false"
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
android:id="@+id/home_upper_view"
android:layout_width="wrap_content"