How to change PreferenceActivity screens' properties

joseluis

Active Member
Licensed User
Longtime User
Hi, I'm using AHPreferenceActivity to show the preferences, and I intend for all of the preferences screens to be: Fullscreen, no title bar, and use a light theme.

So I put this in the Manifest Editor:
B4X:
AddApplicationText(
   <activity android:name="anywheresoftware.b4a.objects.preferenceactivity"
   android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen"></activity>)

And it works, but only for the main PreferenceActivity screen, not the child screens. Since I don't know their activity name, and the only inheritable property seems to be the background color. Not the fullscreen flag, nor the title visibility (and not even the text color which remains white and therefore unreadable against the inherited white background).

I tried fetching the activity name using Reflection, without success. Does anybody know how to fetch the activity names I need? Or another way to look at my problem?

Thank you
 

joseluis

Active Member
Licensed User
Longtime User
Ok more info.

If I put this line in the Manifest Editor:
B4X:
SetApplicationAttribute(android:theme, "@android:style/Theme.Light.NoTitleBar.Fullscreen")

Then all the activities got that theme except for -guess what- the Preferences SubScreens.

I'm smelling I'm gonna have to do my own preferences module. :eek:
 
Upvote 0

joseluis

Active Member
Licensed User
Longtime User
I've attached your original PreferencesActivity example. Left the only relevant part in this case (the wifi intent), and added another sub-screen from my project, just so you can see what I'm talking about.

I modified the manifest file using the editor, and now the theme is White, fullscreen, no titlebar, but it doesn't show well in any of the sub-screens.

The AHPreferencesActivity is based on your code, so it should be very similar to the original library, with some added candy.

Thank you for the help, I appreciate it.
 

Attachments

  • PreferencesScreensTest.zip
    6.6 KB · Views: 223
Last edited:
Upvote 0

joseluis

Active Member
Licensed User
Longtime User
I see. This helps me make the decision of coding my own preferences module.

If I end up making it flexible enough for any app, then I'll share it on the forum.
 
Upvote 0
Top