Create Activity that looks like PreferenceActivity - android

I need to make an Activity that will replace the PreferenceActivity. The reason is that we need to save the settings in the SQL. I need a way to style my settings screen to look exactly like the PreferencesActivity. Can someone give me a link to the code of the PreferenceActivity layout code on Android AOSP? or maybe how can I achieve that?

Related

preference activity UI for settings

I'm beginner in android , now I'm building an android application. .
I'm working in setting screen now and in my research i have seen so many applications that is using preference activity for the settings.So i started my setting page using preference activity. But in my case , my application settings have some options that don't need to save as preference. And that are also connecting with server and the EditTextPreference dialog will be also different. So i got confused in this case.
So what should i do? Do i have to change this to a LinearLayout?
Please help
The preference compat fragment and activity is there to make it simple to create an interface and save it to SharePreference. but you can't change much of the thing. I believe the sharepreference compat and component is itself has the listener when is changing. So let it save to preference even if you don't need it probably Ok. Also if your mockup or design for EditTextPreference is look different from native android then You can try use theme and style to change the look and feel of EditText just for preference only.
Also, You probably can use scrollview + constrainlayout or linearlayout to build it but you're make extra work such as save/load to/from preference, UI like sub preference ...etc. I would sugguest to go with Theme and Style but if your UI is completely different and can't be adapted with Preference then it left no choice. Constraint Layout would be better than LinearLayout.
The PreferenceFragment attached to a preference activity is the ideal way to have a settings screen. You will however need to implement the PreferenceChangeListener in the PreferenceFragment to listen for preference changes and save the changes. If you have options that do not need to be saved you can still add them to the xml and make them disabled by setting android:enabled = false.
EditTextPreferences can have their own UI feel by using the android:theme = #style/yourstyle and specifying the style you want in your styles.xml file
Goodluck.

Android static buttons tabs with options on click

Hello I want to do something like the picture below:
There you can see the "static tab" what I mean where said: "Comida, Refinar, Ordenar" This is what I want to make. I'm sure that somewhere is a theme where I can download example but I don't know where.
Then, when you click I need to open another windows like this:
How can I do something like this?
Thanks
A TabHost would work well with that, there are a lot of tutorials to help with the set up. Very simple in comparison to making that through a custom approach, which is necessary.

Is there UISwitch settings control in Android like iOS

I took a look at the preference activity that Android use for settings. i'm looking for something like UISwitch as shown in below image, does Android have one like this.
I can see the nearest control on Android preference settings is "list preference"
There is ToggleButton and CompoundButton (one extends the other).
But those have a different default display widget then what you are looking for. However either could be used along with your own drawable resources to create the "switch" type control that you are after.
But by default no the system does not include a widget that serves this function and looks the way you want it to.
No, In Android its called ToggleButton.
But still it can be developed by extending RadioButton placed in RadioGroup and giving its UI way you wanted.

Mixed ListActivity

I want to create a ListActivity that has both checkboxs and single selection groups. Like in the Sound Settins in the "Settings" application of android.
Anyone has link to a sample ?
To make a "settings" Activity you should use the Preferences framework. Check this small tutorial: you have to create a special layout and make a reference from code like this:
addPreferencesFromResource(R.xml.preferences);

Creating 'settings' view equivalent to the system views

I'd like to create a 'settings' tab in my Android application which will look like views in Android's system settings - for example like a Phone settings > Sound.
I'd like to achieve that headers, checkbox/radio list elements but I have no idea how to bite that.
When I create that UI elements in my XML definition of UI, they does not looks well.
Please suggest me a correct way to do that ane provide me some examples.
The magic word to search is preference
A random link to set you up : http://www.kaloer.com/android-preferences

Categories

Resources