B4A Library Preferences - Material Design Preferences

This library provides a framework to create nice looking Material Design Preferences down to API9. It uses this GitHub project to fix some bugs in the android support preferences stuff. It also adds some nice features like simple icon tinting, simple menu list preferences and a color picker.

For a guide on how to implement settings for Material Design read this.

Installation:
  • Extract all of the PreferencesLibX_XX.zip file to your additional libraries folder. These are .xml, .jar, 4 .aar files.
  • Requires AppCompat library.
  • Requires B4A 6.31+
minimum SDK Version: 14
Needs support library 27

If you are updating you can delete the old library aar files.

Your Support:

Creating libraries and wrappers for existing library projects is a lot of work. The use of this library is totally free and you even don't need to mention in your app that you use it.

But if you use this library in your projects and you think it is useful to you please consider to make a donation:


Thanks very much for your support.

Usage:

You need to use AppCompat Library together with this library.
Don't forget to add the Preference library to your project.

1. Enhance your theme in manifest editor
Add a preferenceTheme item and the two items for the IconTint:
B4X:
CreateResource(values, theme.xml,
<resources>
    <style name="MyAppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimary">#0098FF</item>
        <item name="colorPrimaryDark">#007CF5</item>
        <item name="colorAccent">#FF5522</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="preferenceTheme">@style/PreferenceThemeOverlay.Material</item>
        <item name="asp_preferenceIconTint">?colorAccent</item>
        <item name="asp_preferenceDialogIconTint">?asp_preferenceIconTint</item>
        <item name="windowActionModeOverlay">true</item>
    </style>
</resources>
)

2. Extend from AppCompatPreferenceActivity
B4X:
#Extends: de.amberhome.preferences.AppCompatPreferenceActivity

3. Add PreferenceView to your Layout (with designer or by code)


4. Load the Layout in Activity_Create() as normal

5. Create your Preference elements in PreferenceView_Ready() event.

See the example for detailed usage.

The example has minSdkVersion set to 14. This is because the MaterialDateTimePicker needs this. The Preference library itself will work with a minimal SDK version of 9.

The example projects additionally needs MaterialDateTimePicker, XMLLayoutBuilder and DateUtils libraries.

Reference:

History:
V1.00:
  • Initial version
V1.01:
  • Fix: Change packagename to anywheresoftware.b4a.orbjects to reduce resource fields
V1.10:
  • New: MultiSelectListPreference
V1.11
  • Fix: Removed DialogMessage property from dialogs with lists (not supported)
  • Fix: Added missing properties to MultiSelectPreference
V1.12
  • Fix: PreferenceCategory.AddMultiSelectListPreference() should work now
  • Fix: AddPreference() should work with all preferences
  • New: Added RemoveKey() to PreferenceManager
  • Fix: Remove internal resource files
V1.14
  • Fix: Fix crash on screen rotation
  • Fix: Updated to support-preferences library 1.2.7 (fixes crash with ringtone manager on Samsung devices, fixes memory leak)
  • New: Better support for CharSequences
V2.00
  • Fix: Updated to support-preferences library 2.2.0 (fixes crashes with support libraries 27)
V3.00
  • Fix: Should work with androidx support libraries.
  • Fix: Updated to support-prefernces library 3.0.0dev
  • Attention: Removed RingtonePreference since it is not supported by androidx support library anymore!
ToDo:
  • Currently there is nearly no popup help.

Erel:

With B4A v13+ you need to add:
B4X:
#AdditionalJar: androidx.customview:customview-poolingcontainer
#MultiDex: true
 

Attachments

  • PreferencesLib2_0.zip
    405.7 KB · Views: 895
  • PreferencesExample1_12.zip
    19.7 KB · Views: 756
  • PreferencesLib3_0.zip
    427.2 KB · Views: 921
  • PreferencesExample2_00.zip
    19.8 KB · Views: 673
Last edited by a moderator:

wimpie3

Well-Known Member
Licensed User
Longtime User
I will check out the example and see if the behavior is the same.
 

corwin42

Expert
Licensed User
Longtime User

corwin42

Expert
Licensed User
Longtime User
See the material design guidelines for Settings. There is nothing like a popup defined.

If a setting needs futher explanation the setting should be put on its own page (activity) with a detailed description. This is explained in the design guide (See the screen with magnification gestures).
 

johndb

Active Member
Licensed User
Longtime User
Is it possible to have different sets of preferences in the same application?
A quick and dirty method would be add a prefix to the preference name where the prefix would define the "set" but is there a better way such as defining the name of the preference file?
 
Last edited:

wroyw

Member
Licensed User
I get this errors when I build the example ...

B4X:
B4A version: 6.80 BETA #1
Parsing code.    (0.00s)
Compiling code.    (0.02s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.00s)
Generating R file.    Error
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res9\res\values-v21\values-v21.xml:4: error: Error: No resource found that matches the given name: attr 'android:stateListAnimator'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res9\res\values\values.xml:311: error: Error: No resource found that matches the given name: attr 'android:elevation'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-ldltr-v21\values-ldltr-v21.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner.Underlined'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v23\values-v23.xml:37: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner.Underlined'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:17: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Inverse'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:19: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large.Inverse'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:25: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium.Inverse'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:32: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small.Inverse'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:216: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:218: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar.Horizontal'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:176: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.AutoCompleteTextView'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:189: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.EditText'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:10: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:264: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Material.Notification'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:276: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Material.Notification.Title'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body1'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:9: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body2'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:11: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Caption'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:12: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display1'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:13: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display2'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:14: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display3'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:15: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display4'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:16: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Headline'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:18: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:20: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:22: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:24: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:26: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Menu'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:27: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.SearchResult.Subtitle'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:29: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.SearchResult.Title'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:31: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:33: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Subhead'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:34: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Title'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:35: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:37: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle.Inverse'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:39: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:41: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title.Inverse'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:43: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Subtitle'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:45: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Title'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:47: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:53: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:55: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:57: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:58: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.TextView.SpinnerItem'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:59: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:61: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:106: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:110: error: Error: No resource found that matches the given name: attr 'android:colorButtonNormal'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:108: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:109: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:107: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:104: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:105: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:113: error: Error: No resource found that matches the given name: attr 'android:windowElevation'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:153: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:157: error: Error: No resource found that matches the given name: attr 'android:colorButtonNormal'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:155: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:156: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:154: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:151: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:152: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:160: error: Error: No resource found that matches the given name: attr 'android:windowElevation'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:163: error: Error: No resource found that matches the given name: attr 'android:windowElevation'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:165: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabText'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:167: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabView'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:169: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:171: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.CloseMode'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:174: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.Overflow'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:179: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:180: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Borderless'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:181: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Borderless.Colored'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v23\values-v23.xml:33: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Borderless.Colored'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:184: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Small'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:185: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ButtonBar'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:186: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.CompoundButton.CheckBox'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:187: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.CompoundButton.RadioButton'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:188: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.DropDownItem.Spinner'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:192: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ImageButton'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:193: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:195: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:197: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabView'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:199: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.PopupMenu'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:203: error: Error: No resource found that matches the given name: attr 'android:overlapAnchor'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:205: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListPopupWindow'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:207: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:208: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView.DropDown'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:210: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.PopupMenu'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:214: error: Error: No resource found that matches the given name: attr 'android:overlapAnchor'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:220: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.RatingBar'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:221: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.SeekBar'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:222: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:223: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.TextView.SpinnerItem'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:224: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Toolbar.Button.Navigation'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:232: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:236: error: Error: No resource found that matches the given name: attr 'android:colorButtonNormal'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:234: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:235: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:233: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:230: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:231: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:240: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.NoActionBar'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:252: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light.NoActionBar'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:265: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Material.Notification.Info'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v21\values-v21.xml:272: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Material.Notification.Time'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v23\values-v23.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Menu'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v23\values-v23.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v23\values-v23.xml:34: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v23\values-v23.xml:35: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.RatingBar.Indicator'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v23\values-v23.xml:36: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.RatingBar.Small'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v24\values-v24.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v24\values-v24.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v25\values-v25.xml:5: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.NoActionBar'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res7\res\values-v25\values-v25.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light.NoActionBar'.
Y:\Android\Projekte\MaterialPreferences\Objects\bin\extra\res5\res\values\values.xml:130: error: Error: No resource found that matches the given name: attr 'android:stateListAnimator'.
 

wroyw

Member
Licensed User
Okay thank you, now it works.

Works the Preferences lib also on a davice with API 14 ?
 

corwin42

Expert
Licensed User
Longtime User
Okay thank you, now it works.

Works the Preferences lib also on a davice with API 14 ?

Minimum API level for the library iself is 9 (see first post).
 

SandroB4A

Member
Licensed User
Longtime User
Hi all,

I've used this wonderfull lib in my app and I'm very satisfied of it except for a little problem when the keyboard popup (I've the same behaviour on the lib example).

When I edit a text preference the softkey keyboard popup as expected but when I click on NOWAY or OK buttons the numeric pad doesn't disappear but becomes a standard keyboard.

I must click on FATTO (done) before

Honestly I wouldn't know what to check, any advice?

Tks
 

Toky Olivier

Active Member
Licensed User
Longtime User
@corwin42 - Thank you so much for this library and all material design library you've shared.
I have one question with the AddListPreference function: how to use CSBuilder to show formatted Item please?

I used this code but doesn't work, the typeface remain unchanged in the preference activity:

B4X:
    Dim lstSigneZodiaque As ListPreference
    Dim cs() As String = Array As String("","","")
    Dim csb As CSBuilder
    Dim ty As Typeface
    ty = Typeface.LoadFromAssets("velezodiac.ttf")
    csb.Initialize.Typeface(ty).Append("P Y S Q T").PopAll
    cs(0) = csb
    csb.Initialize.Typeface(ty).Append("p y s q t").PopAll
    cs(1) = csb
    csb.Initialize.Typeface(ty).Append("B K E C F").PopAll
    cs(2) = csb
    lstSigneZodiaque = cat1.AddListPreference("","IconeSigneZodiaque", "Kisary mifanaraka amin'ny andro","Misafidiana anaty lisitra", "0", Array As String(0, 1, 2), cs)

Thank you so much
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…