Added weather conditions, fixed the thread for finding locations and added options to disable weather and battery indicators.

This commit is contained in:
ottoptj 2024-08-04 22:41:58 +03:00
commit 71af6d7d49
8 changed files with 121 additions and 460 deletions

View file

@ -14,7 +14,7 @@ class BatteryReceiver(private val activity: MainActivity) : BroadcastReceiver()
val level = it.getIntExtra(BatteryManager.EXTRA_LEVEL, -1)
val scale = it.getIntExtra(BatteryManager.EXTRA_SCALE, -1)
val batteryPct = level * 100 / scale.toFloat()
activity.modifyDate("${batteryPct.toInt()}%", 2)
activity.modifyDate("${batteryPct.toInt()}%", 3)
}
}

View file

@ -35,9 +35,15 @@ class LocationFragment : Fragment(), LocationListAdapter.OnItemClickListener {
val searchView = view.findViewById<EditText>(R.id.locationSearch)
adapter = LocationListAdapter(requireContext(), weatherSystem.getSearchedLocations(
searchView.text.toString()
), this)
var locationList = mutableListOf<Map<String, String>>()
CoroutineScope(Dispatchers.IO).launch {
locationList = weatherSystem.getSearchedLocations(
searchView.text.toString()
)
}
adapter = LocationListAdapter(requireContext(), locationList, this)
val recyclerView = view.findViewById<RecyclerView>(R.id.locationrecycler)
val appMenuEdgeFactory = AppMenuEdgeFactory(requireActivity())

View file

@ -71,7 +71,7 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
private var weatherJob: Job? = null
val cameraIntent = Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE)
val phoneIntent = Intent(Intent.ACTION_DIAL)
private lateinit var batteryReceiver: BatteryReceiver
private var batteryReceiver: BatteryReceiver? = null
private var appActionMenu = AppActionMenu()
private val sharedPreferenceManager = SharedPreferenceManager()
@ -98,6 +98,8 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
private val uiUtils = UIUtils()
private var isBatteryReceiverRegistered = false
@SuppressLint("ClickableViewAccessibility")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@ -150,7 +152,11 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
uiUtils.setAllColors(binding.homeView, Color.parseColor(preferences.getString("textColor", "#FFF3F3F3")))
batteryReceiver = BatteryReceiver.register(this, this@MainActivity)
registerBatteryReceiver()
if (!preferences.getBoolean("battery_enabled", false)) {
unregisterBatteryReceiver()
}
binding.homeView.setOnTouchListener { _, event ->
gestureDetector.onTouchEvent(event)
@ -176,9 +182,15 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
weatherJob?.cancel()
weatherJob = CoroutineScope(Dispatchers.IO).launch {
while (true) {
if (preferences.getBoolean("gps_location", false)) {
withContext(Dispatchers.Main) {
weatherSystem.setGpsLocation(this@MainActivity)
}
}
val currentWeather = weatherSystem.getTemp(this@MainActivity)
withContext(Dispatchers.Main) {
modifyDate(currentWeather, 3)
modifyDate(currentWeather, 2)
}
delay(300000)
}
@ -228,6 +240,40 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
uiUtils.setAllColors(binding.homeView, Color.parseColor(preferences?.getString(key, "#FFF3F3F3")))
setSearchColors()
}
"weather_enabled" -> {
if (preferences?.getBoolean(key, false) == true) {
startWeatherMonitor()
}
else {
weatherJob?.cancel()
modifyDate("", 2)
}
}
"battery_enabled" -> {
if (preferences?.getBoolean(key, false) == true) {
registerBatteryReceiver()
}
else {
unregisterBatteryReceiver()
modifyDate("", 3)
}
}
}
}
private fun registerBatteryReceiver() {
if (!isBatteryReceiverRegistered) {
batteryReceiver = BatteryReceiver.register(this, this@MainActivity)
isBatteryReceiverRegistered = true
}
}
private fun unregisterBatteryReceiver() {
if (isBatteryReceiverRegistered) {
unregisterReceiver(batteryReceiver)
isBatteryReceiverRegistered = false
}
}
@ -238,7 +284,7 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
// Your code here
searchView.setTextColor(Color.parseColor(preferences.getString("textColor", "#FFF3F3F3")))
searchView.setHintTextColor(uiUtils.setAlpha(Color.parseColor(preferences.getString("textColor", "#FFF3F3F3")), "A9"))
searchView.compoundDrawables[0].colorFilter =
searchView.compoundDrawables[0].mutate().colorFilter =
BlendModeColorFilter(Color.parseColor(preferences.getString("textColor", "#FFF3F3F3")), BlendMode.SRC_ATOP)
// Remove the listener
@ -261,19 +307,22 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
override fun onStop() {
super.onStop()
job?.cancel()
weatherJob?.cancel()
}
override fun onDestroy() {
super.onDestroy()
job?.cancel()
unregisterReceiver(batteryReceiver)
unregisterBatteryReceiver()
preferences.unregisterOnSharedPreferenceChangeListener(this)
}
override fun onStart() {
super.onStart()
startTask()
startWeatherMonitor()
if (preferences.getBoolean("weather_enabled", false)) {
startWeatherMonitor()
}
// Keyboard is sometimes open when going back to the app, so close it.
closeKeyboard()
@ -734,7 +783,7 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
shortcuts.children.forEach {
if (it is TextView) {
when (preferences?.getString("shortcutSize", "medium")) {
when (preferences.getString("shortcutSize", "medium")) {
"small" -> {
it.setPadding(
it.paddingLeft,

View file

@ -30,6 +30,10 @@ class WeatherSystem {
println("Location obtained")
locationManager.removeUpdates(this)
}
override fun onFlushComplete(requestCode: Int) {
super.onFlushComplete(requestCode)
}
}
if (ContextCompat.checkSelfPermission(activity, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
@ -42,19 +46,16 @@ class WeatherSystem {
}
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0f, locationListener)
locationManager.requestLocationUpdates(LocationManager.FUSED_PROVIDER, 0, 0f, locationListener)
val currentLocation = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER)
val currentLocation = locationManager.getLastKnownLocation(LocationManager.FUSED_PROVIDER)
if (currentLocation != null) {
sharedPreferenceManager.setWeatherLocation(activity, "latitude=${currentLocation.latitude}&longitude=${currentLocation.longitude}", sharedPreferenceManager.getWeatherRegion(activity))
}
else {
Toast.makeText(activity, "Unable to get location", Toast.LENGTH_SHORT).show()
}
}
@ -100,7 +101,7 @@ class WeatherSystem {
val location = sharedPreferenceManager.getWeatherLocation(context)
if (location != null) {
if (location.isNotEmpty()) {
val url = URL("https://api.open-meteo.com/v1/forecast?$location&temperature_unit=${tempUnits}&current=temperature_2m")
val url = URL("https://api.open-meteo.com/v1/forecast?$location&temperature_unit=${tempUnits}&current=temperature_2m,weather_code")
with(url.openConnection() as HttpURLConnection) {
requestMethod = "GET"
@ -111,7 +112,28 @@ class WeatherSystem {
val currentData = jsonObject.getJSONObject("current")
currentWeather = currentData.getInt("temperature_2m").toString()
var weatherType = ""
when (currentData.getInt("weather_code")) {
0, 1 -> {
weatherType = "\uFE0E"
}
2, 3, 45, 48 -> {
weatherType = "\uFE0E"
}
51, 53, 55, 56, 57, 61, 63, 65, 67, 80, 81, 82 -> {
weatherType = "\uFE0E"
}
71, 73, 75, 77, 85, 86 -> {
weatherType = "\uFE0E"
}
95, 96, 99 -> {
weatherType = "\uFE0E"
}
}
currentWeather = "$weatherType ${currentData.getInt("temperature_2m").toString()}"
}
}

View file

@ -112,6 +112,7 @@
android:fontFamily="@null"
android:format12Hour="dd MMM yyyy"
android:format24Hour="dd MMM yyyy"
android:lineSpacingExtra="8sp"
android:paddingHorizontal="2dp"
android:textAlignment="textStart"
android:textAppearance="@android:style/TextAppearance.DeviceDefault"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/settingsLayout"
@ -17,444 +17,4 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<TextView
android:id="@+id/clock_alignment_label"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:clickable="false"
android:gravity="start"
android:paddingLeft="20dp"
android:paddingTop="20dp"
android:paddingRight="20dp"
android:paddingBottom="20dp"
android:text="Clock Alignment"
android:textAppearance="@android:style/TextAppearance.DeviceDefault"
android:textColor="#F3F3F3"
android:textSize="20sp"
android:visibility="visible" />
<Spinner
android:id="@+id/clock_alignment"
android:layout_width="0dp"
android:layout_height="0dp"
android:entries="@array/h_alignment_options"
android:spinnerMode="dropdown"
tools:layout_editor_absoluteX="250dp" />
<View
android:id="@+id/divider2"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
tools:layout_editor_absoluteY="66dp" />
<TextView
android:id="@+id/home_app_alignment_label"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:clickable="false"
android:gravity="start"
android:paddingLeft="20dp"
android:paddingTop="20dp"
android:paddingRight="20dp"
android:paddingBottom="20dp"
android:text="Home App Alignment"
android:textAppearance="@android:style/TextAppearance.DeviceDefault"
android:textColor="#F3F3F3"
android:textSize="20sp"
android:visibility="visible"
tools:layout_editor_absoluteY="67dp" />
<Spinner
android:id="@+id/home_app_alignment"
android:layout_width="0dp"
android:layout_height="0dp"
android:entries="@array/h_alignment_options"
android:spinnerMode="dropdown"
tools:layout_editor_absoluteX="250dp"
tools:layout_editor_absoluteY="67dp" />
<View
android:id="@+id/divider3"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
tools:layout_editor_absoluteY="134dp" />
<TextView
android:id="@+id/app_alignment_label"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:clickable="false"
android:gravity="start"
android:paddingLeft="20dp"
android:paddingTop="20dp"
android:paddingRight="20dp"
android:paddingBottom="20dp"
android:text="App Menu Alignment"
android:textAppearance="@android:style/TextAppearance.DeviceDefault"
android:textColor="#F3F3F3"
android:textSize="20sp"
android:visibility="visible"
tools:layout_editor_absoluteY="135dp" />
<Spinner
android:id="@+id/app_alignment"
android:layout_width="0dp"
android:layout_height="0dp"
android:entries="@array/h_alignment_options"
android:spinnerMode="dropdown"
tools:layout_editor_absoluteX="250dp"
tools:layout_editor_absoluteY="135dp" />
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
tools:layout_editor_absoluteY="202dp" />
<TextView
android:id="@+id/search_alignment_label"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:clickable="false"
android:gravity="start"
android:paddingLeft="20dp"
android:paddingTop="20dp"
android:paddingRight="20dp"
android:paddingBottom="20dp"
android:text="Search Bar Alignment"
android:textAppearance="@android:style/TextAppearance.DeviceDefault"
android:textColor="#F3F3F3"
android:textSize="20sp"
android:visibility="visible"
tools:layout_editor_absoluteY="202dp" />
<Spinner
android:id="@+id/search_alignment"
android:layout_width="0dp"
android:layout_height="0dp"
android:entries="@array/h_alignment_options"
android:spinnerMode="dropdown"
tools:layout_editor_absoluteX="250dp"
tools:layout_editor_absoluteY="202dp" />
<View
android:id="@+id/divider5"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
tools:layout_editor_absoluteY="270dp" />
<TextView
android:id="@+id/clock_size_label"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:clickable="false"
android:gravity="start"
android:paddingLeft="20dp"
android:paddingTop="20dp"
android:paddingRight="20dp"
android:paddingBottom="20dp"
android:text="Clock Size"
android:textAppearance="@android:style/TextAppearance.DeviceDefault"
android:textColor="#F3F3F3"
android:textSize="20sp"
android:visibility="visible"
tools:layout_editor_absoluteY="270dp" />
<Spinner
android:id="@+id/clock_size"
android:layout_width="0dp"
android:layout_height="0dp"
android:entries="@array/size_options"
android:spinnerMode="dropdown"
tools:layout_editor_absoluteX="250dp"
tools:layout_editor_absoluteY="270dp" />
<View
android:id="@+id/divider7"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
tools:layout_editor_absoluteY="337dp" />
<TextView
android:id="@+id/date_size_label"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:clickable="false"
android:gravity="start"
android:paddingLeft="20dp"
android:paddingTop="20dp"
android:paddingRight="20dp"
android:paddingBottom="20dp"
android:text="Date Size"
android:textAppearance="@android:style/TextAppearance.DeviceDefault"
android:textColor="#F3F3F3"
android:textSize="20sp"
android:visibility="visible"
tools:layout_editor_absoluteY="337dp" />
<Spinner
android:id="@+id/date_size"
android:layout_width="0dp"
android:layout_height="0dp"
android:entries="@array/size_options"
android:spinnerMode="dropdown"
tools:layout_editor_absoluteX="250dp"
tools:layout_editor_absoluteY="337dp" />
<View
android:id="@+id/divider8"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
tools:layout_editor_absoluteY="405dp" />
<TextView
android:id="@+id/shortcut_size_label"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:clickable="false"
android:gravity="start"
android:paddingLeft="20dp"
android:paddingTop="20dp"
android:paddingRight="20dp"
android:paddingBottom="20dp"
android:text="Shortcut Title Size"
android:textAppearance="@android:style/TextAppearance.DeviceDefault"
android:textColor="#F3F3F3"
android:textSize="20sp"
android:visibility="visible"
tools:layout_editor_absoluteY="405dp" />
<Spinner
android:id="@+id/shortcut_size"
android:layout_width="0dp"
android:layout_height="0dp"
android:entries="@array/size_options"
android:spinnerMode="dropdown"
tools:layout_editor_absoluteX="250dp"
tools:layout_editor_absoluteY="405dp" />
<View
android:id="@+id/divider4"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
tools:layout_editor_absoluteY="472dp" />
<TextView
android:id="@+id/app_size_label"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:clickable="false"
android:gravity="start"
android:paddingLeft="20dp"
android:paddingTop="20dp"
android:paddingRight="20dp"
android:paddingBottom="20dp"
android:text="App Menu Title Size"
android:textAppearance="@android:style/TextAppearance.DeviceDefault"
android:textColor="#F3F3F3"
android:textSize="20sp"
android:visibility="visible"
tools:layout_editor_absoluteY="472dp" />
<Spinner
android:id="@+id/app_size"
android:layout_width="0dp"
android:layout_height="0dp"
android:entries="@array/size_options"
android:spinnerMode="dropdown"
tools:layout_editor_absoluteX="250dp"
tools:layout_editor_absoluteY="472dp" />
<View
android:id="@+id/divider6"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
tools:layout_editor_absoluteY="539dp" />
<TextView
android:id="@+id/search_size_label"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:clickable="false"
android:gravity="start"
android:paddingLeft="20dp"
android:paddingTop="20dp"
android:paddingRight="20dp"
android:paddingBottom="20dp"
android:text="Search Bar Size"
android:textAppearance="@android:style/TextAppearance.DeviceDefault"
android:textColor="#F3F3F3"
android:textSize="20sp"
android:visibility="visible"
tools:layout_editor_absoluteY="539dp" />
<Spinner
android:id="@+id/search_size"
android:layout_width="0dp"
android:layout_height="0dp"
android:entries="@array/size_options"
android:spinnerMode="dropdown"
tools:layout_editor_absoluteX="250dp"
tools:layout_editor_absoluteY="539dp" />
<View
android:id="@+id/divider9"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
tools:layout_editor_absoluteY="607dp" />
<TextView
android:id="@+id/camera_label"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:clickable="false"
android:gravity="start"
android:paddingLeft="20dp"
android:paddingTop="20dp"
android:paddingRight="20dp"
android:paddingBottom="20dp"
android:text="Camera Swipe Left"
android:textAppearance="@android:style/TextAppearance.DeviceDefault"
android:textColor="#F3F3F3"
android:textSize="20sp"
android:visibility="visible"
tools:layout_editor_absoluteY="607dp" />
<Switch
android:id="@+id/camera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
tools:layout_editor_absoluteX="260dp"
tools:layout_editor_absoluteY="627dp" />
<View
android:id="@+id/divider10"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
tools:layout_editor_absoluteY="674dp" />
<TextView
android:id="@+id/contacts_label"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:clickable="false"
android:gravity="start"
android:paddingLeft="20dp"
android:paddingTop="20dp"
android:paddingRight="20dp"
android:paddingBottom="20dp"
android:text="Phone Swipe Right"
android:textAppearance="@android:style/TextAppearance.DeviceDefault"
android:textColor="#F3F3F3"
android:textSize="20sp"
android:visibility="visible"
tools:layout_editor_absoluteY="674dp" />
<Switch
android:id="@+id/contacts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
tools:layout_editor_absoluteX="260dp"
tools:layout_editor_absoluteY="694dp" />
<View
android:id="@+id/divider11"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
tools:layout_editor_absoluteY="742dp" />
<TextView
android:id="@+id/hidden_apps"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:clickable="false"
android:gravity="start"
android:paddingLeft="20dp"
android:paddingTop="20dp"
android:paddingRight="20dp"
android:paddingBottom="20dp"
android:text="Hidden Apps"
android:textAppearance="@android:style/TextAppearance.DeviceDefault"
android:textColor="#F3F3F3"
android:textSize="20sp"
android:visibility="visible"
tools:layout_editor_absoluteY="743dp" />
<View
android:id="@+id/divider12"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
tools:layout_editor_absoluteY="810dp" />
<TextView
android:id="@+id/weather_location"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:clickable="false"
android:gravity="start"
android:paddingLeft="20dp"
android:paddingTop="20dp"
android:paddingRight="20dp"
android:paddingBottom="20dp"
android:text="Weather Location"
android:textAppearance="@android:style/TextAppearance.DeviceDefault"
android:textColor="#F3F3F3"
android:textSize="20sp"
android:visibility="visible"
tools:layout_editor_absoluteY="810dp" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/manual_city"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center"
android:layout_weight="0.3"
android:background="#89000000"
android:gravity="center"
android:insetTop="0dp"
android:insetBottom="0dp"
android:paddingHorizontal="20dp"
android:text="Set Manually"
android:textAppearance="@android:style/TextAppearance.DeviceDefault"
android:textColor="#F3F3F3"
android:textSize="16sp"
tools:layout_editor_absoluteX="250dp"
tools:layout_editor_absoluteY="810dp" />
<ImageView
android:id="@+id/imageView"
android:layout_width="0dp"
android:layout_height="0dp"
android:paddingVertical="15dp"
app:srcCompat="@android:drawable/ic_menu_mylocation"
tools:layout_editor_absoluteX="382dp"
tools:layout_editor_absoluteY="810dp" />
<View
android:id="@+id/divider13"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
tools:layout_editor_absoluteY="810dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
</LinearLayout>

View file

@ -47,12 +47,14 @@
<string-array name="bg_options">
<item>Transparent</item>
<item>Black</item>
<item>Grey</item>
<item>White</item>
</string-array>
<string-array name="bg_values">
<item>#00000000</item>
<item>#FF000000</item>
<item>#FF1B1B1B</item>
<item>#FFD6D6D6</item>
</string-array>

View file

@ -138,15 +138,23 @@
android:layout_height="wrap_content"
app:allowDividerAbove="false"
app:title="Weather">
<SwitchPreference
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:defaultValue="false"
android:title="Weather"
app:key="weather_enabled" />
<SwitchPreference
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:defaultValue="false"
android:title="GPS Location"
app:dependency="weather_enabled"
app:key="gps_location" />
<Preference
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:dependency="weather_enabled"
app:key="manual_location"
app:selectable="true"
app:title="Set Manual Location" />
@ -154,6 +162,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:defaultValue="celsius"
app:dependency="weather_enabled"
app:entries="@array/temp_units"
app:entryValues="@array/unit_values"
app:key="tempUnits"
@ -172,5 +181,17 @@
app:selectable="true"
app:title="Manage Hidden Apps" />
</PreferenceCategory>
<PreferenceCategory
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:allowDividerAbove="false"
app:title="Battery">
<SwitchPreference
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:defaultValue="false"
android:title="Battery Indicator"
app:key="battery_enabled" />
</PreferenceCategory>
</PreferenceScreen>