B4A Library AppCompat - Make Material Design apps compatible with older Android versions

Discussion in 'Additional libraries, classes and official updates' started by corwin42, Dec 19, 2014.

  1. corwin42

    corwin42 Expert Licensed User

    What do you want to do exactly? Make ACSearchView compatible with RTL languages?
     
  2. mshafiee110

    mshafiee110 Active Member Licensed User

    yes,I want to,ACSearchView is compatible with rtl language.and move from right to left.
    I changed the gravity of MSMaterialDrawer,from left to right with xml files.but i am unable to change gravity of ACSearchView.
    MSMaterialDrawer(change gravity from left to right)
     
  3. joneden

    joneden Active Member Licensed User

  4. joneden

    joneden Active Member Licensed User

    Sorry my bad, although it had worked I forgot that I needed to update the libs in the custom libs folder with the newer SDK files. I'm a dumbass

    3. Copy v4 and v7 support libraries from <...>\android-sdk\extras\android\support\v7\appcompat\libs to your CustomLibs folder
     
  5. migrec

    migrec Member Licensed User

    Hey @corwin42, with support library 23.1 setelevation method seem to not work.
    This is my code: AppCompat1.SetElevation(actionbar, 4dip) where actionbar is an ACToolbarDark
    if i Log appcompat1.getelevation(actionbar) i get 0
    is this something you could look at?
     
  6. FrankDev

    FrankDev Active Member Licensed User

    hi... is there an example for the ACSpinner ?
    is the font changeable ? (Name)
     
  7. shashkiranr

    shashkiranr Active Member Licensed User

    Hi All,

    I am using Theme.AppCompat.Light.NoActionBar as my parent theme. When the search view is activated, the back arrow is coming in black. I need to change the color to white. Any suggestions how to do that?

    Edit : I got it :)

    Code:
    <style name="MyAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name=
    "homeAsUpIndicator">@drawable/name  of the icon in resouce folder (the arrow image)</item>
    </style>
    Best,
    SK
     
    Last edited: Dec 27, 2015
  8. Reids

    Reids Member Licensed User

    I got error this while running the sample, no error while compiling, I've read every page on this thread, follow the instruction
    > update the latest sdk & android extra
    > makesure the latest b4a_appcompat file by deleting old file
    > copy android-support-v4.jar & android-support-v7-appcompat.jar to library folder
    > use android-sdk\platforms\android-23\android.jar while compiling
    but error still there, I don't know what I'm missing at

    Code:
    threadid=1thread exiting with uncaught exception (group=0x419ecce0)
    FATAL 
    EXCEPTION: main
    Process: de.amberhome.appcompat.example2, PID: 
    13517
    java.lang.NoSuchFieldError: android.support.v7.appcompat.R$styleable.ActionBarWindow
        at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:
    106)
        at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:
    57)
        at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:
    99)
        at de.amberhome.appcompat.example2.main.onCreate(main.java:
    33)
        at android.app.Activity.performCreate(
    Activity.java:5231)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
    1087)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
    2169)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
    2271)
        at android.app.ActivityThread.access$
    800(ActivityThread.java:144)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:
    1205)
        at android.os.Handler.dispatchMessage(Handler.java:
    102)
        at android.os.Looper.loop(Looper.java:
    136)
        at android.app.ActivityThread.main(ActivityThread.java:
    5146)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:
    515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:
    732)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
    566)
        at dalvik.system.NativeStart.main(Native Method)
      Force finishing 
    activity de.amberhome.appcompat.example2/.main
    Screenshot 
    max retries 4 of Token{41e84e58 ActivityRecord{41ffb368 u0 de.amberhome.appcompat.example2/.main t47 f}} appWin=Window{41e148a8 u0 Starting de.amberhome.appcompat.example2} drawState=4
    Screenshot failure taking screenshot for (720x1280) to layer 21015
    Received broadcast action=android.intent.action.PACKAGE_ADDED and uri=de.amberhome.appcompat.example2
    I google up "java.lang.NoSuchFieldError: android.support.v7.appcompat.R$styleable.ActionBarWindow" maybe problem with android-support-v7-appcompat.jar?
    but I already using the latest android-support-v7-appcompat.jar
     
  9. androh

    androh Member Licensed User

    Is AppCompat.SetClickEffect method working?
    I don't see any effect.
     
  10. corwin42

    corwin42 Expert Licensed User

    Yes, see attached project.
     

    Attached Files:

    androh likes this.
  11. androh

    androh Member Licensed User

    I want to ripple effect on switch view. But including text, whole row.
    How can I do that?

    Edit: That's ok. I did that very easy with your example :)
    Example attached.
     

    Attached Files:

    Last edited: Jan 12, 2016
  12. migrec

    migrec Member Licensed User

    I recently wrote that setelevation is not working with support lib 23.1 installed.
    And this doesn't work either:
    Code:
    actionbar.PopupTheme = actionbar.THEME_LIGHT
    Does anyone have knowledge regarding this issue?
     
  13. corwin42

    corwin42 Expert Licensed User

    Be aware that SetElevation() does not work with every View. If it does not work with the View you want then you can put the view on a Panel and set the elevation for the Panel.

    PopupTheme should work. Please provide an example project to show that it does not work. I don't have time to create a testcase myself for all bug reports.
     
    migrec likes this.
  14. migrec

    migrec Member Licensed User

    Solved the popup theme just by changing the theme from .noactionbar to theme.appcompat.light, but about the setelevation, it doesnt even work with the toolbar, i remeber it did before.
     
  15. corwin42

    corwin42 Expert Licensed User

    It should work with the ToolBar. Be aware that it only works on Android 5.0 and above.
     
  16. shashkiranr

    shashkiranr Active Member Licensed User

    Hi All,

    I want to use a drawable for the thumb of the seekbar, how should one write the xml attributes to change it? I was referring to the google doc in the below link but I am getting an xml error.

    https://chromium.googlesource.com/a...pport/v7/appcompat/res/values/styles_base.xml

    I am using the sample theme given in the example.
    Any suggestions appreciated. Need to change the seekbar thumb drawable using xml attribute
    Code:
    android:thumb
    Best,
    SK
     
  17. migrec

    migrec Member Licensed User

    Sorry but it doesn't, my phone is running 6.0.1 it works with a few other views but not the toolbar
     
  18. Alisson

    Alisson Active Member Licensed User

    corwin2 your exemple result the error in the xml:

    upload_2016-1-29_10-52-29.png

    This my manifest editor:

    upload_2016-1-29_10-52-59.png

    This is my code xml:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <!--
      ~ Copyright (C) 
    2015 The Android Open Source Project
      ~
      ~ Licensed under the Apache License, Version 
    2.0 (the "License");
      ~ you may 
    not use this file except in compliance with the License.
      ~ You may obtain a copy of the License at
      ~
      ~      http://www.apache.org/licenses/LICENSE-
    2.0
      ~
      ~ Unless required by applicable law 
    or agreed to in writing, software
      ~ distributed under the License 
    is distributed on an "AS IS" BASIS,
      ~ WITHOUT WARRANTIES 
    OR CONDITIONS OF ANY KIND, either express or implied.
      ~ See the License 
    for the specific language governing permissions and
      ~ limitations under the License.
      -->

    <resources>

        <style name=
    "Base.Theme.AppCompat" parent="Base.V22.Theme.AppCompat" />
        <style name=
    "Base.Theme.AppCompat.Light" parent="Base.V22.Theme.AppCompat.Light" />

        <style name=
    "Base.V22.Theme.AppCompat" parent="Base.V21.Theme.AppCompat">
            <item name=
    "actionModeShareDrawable">?android:attr/actionModeShareDrawable</item>
        </style>

        <style name=
    "Base.V22.Theme.AppCompat.Light" parent="Base.V21.Theme.AppCompat.Light">
            <item name=
    "actionModeShareDrawable">?android:attr/actionModeShareDrawable</item>
        </style>

    </resources>
    You know solve the error?

    I wait your feedback.

    Thanks very much!
     
  19. corwin42

    corwin42 Expert Licensed User

    A workaround would be to place the Toolbar on a panel and elevate the panel.

    No. Everything I can say is that there is an error in your setup. Please check that really everything is up to date and that you use v23 android.jar. See the troubleshooting guide in the first post of the Appcompat library thread.
     
    lemonisdead and DonManfred like this.
  20. Alisson

    Alisson Active Member Licensed User

    Corwin42, thanks very much!!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice