Android Question [SOLVED] ViewsEx Switch View Appearance

Computersmith64

Well-Known Member
Licensed User
Longtime User
I'm trying to use the Switch view in the ViewsEx library, however it's showing up as the old square switch on my Android 8.1 device instead of the rounded style it should be. I can't see any properties that would change the appearance of it. My implementation is simply to put it on an activity in Visual Designer, then run the app.

Am I missing something?

- Colin.
 

Computersmith64

Well-Known Member
Licensed User
Longtime User
Yep - here it is:

B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="27"/>
<supports-screens android:largeScreens="true" 
    android:normalScreens="true" 
    android:smallScreens="true" 
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.

AddApplicationText(
<meta-data android:name="com.google.android.gms.games.APP_ID"
android:value="@string/app_id" />
<meta-data android:name="com.google.android.gms.version" 
android:value="@integer/google_play_services_version" />
)

'************ Google Play Services Base ************
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)

'************ Firebase Base ************
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)

'************ Firebase Analytics ************
CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)

'************ Firebase Ads *****************
CreateResourceFromFile(Macro, FirebaseAdMob.FirebaseAds)

'************ Crashlytics ************
 AddApplicationText(
 <provider
            android:name="com.crashlytics.android.CrashlyticsInitProvider"
            android:authorities="$PACKAGE$.crashlyticsinitprovider"
            android:exported="false"
            android:initOrder="100" />
           )
         
CreateResource(values, com_crashlytics_build_id.xml,
<resources xmlns:tools="http://schemas.android.com/tools">
<string tools:ignore="UnusedResources,,TypographyDashes" name="com.crashlytics.android.build_id"
   translatable="false">cc7c8eddb7024f38a1b4491ef214b8f7</string>
</resources>)

SetApplicationAttribute(android:theme, "@style/MyAppTheme")

& the theme (because I suspect that's what you're interested in) is:

?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyAppTheme" parent="@android:style/Theme.Holo.Light"></style>
</resources>

- Colin
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
Sorted it. It was because I didn't have a values-v21 folder with a theme in the project.

- Colin.
 
Upvote 0
Top