Android Question How can i make these words more visible in clear black and white

Makumbi

Well-Known Member
Licensed User
This is my manifest editor
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:usesCleartextTraffic, "true")
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile(Macro, Core.NetworkClearText)
AddPermission(com.majeur.launcher.permission.UPDATE_BADGE)
AddPermission(com.sec.android.provider.badge.permission.READ)
AddPermission(com.sec.android.provider.badge.permission.WRITE)
AddPermission(com.htc.launcher.permission.READ_SETTINGS)
AddPermission(com.htc.launcher.permission.UPDATE_SHORTCUT)
AddPermission(com.anddoes.launcher.permission.UPDATE_COUNT)
AddPermission(com.majeur.launcher.permission.UPDATE_BADGE)
AddPermission(com.huawei.launcher3.permission.READ_SETTINGS)
AddPermission(com.huawei.launcher3.permission.WRITE_SETTINGS)
AddPermission(com.huawei.launcher2.permission.READ_SETTINGS)
AddPermission(com.huawei.launcher2.permission.READ_SETTINGS)
AddPermission(com.huawei.android.launcher.permission.WRITE_SETTINGS)
AddPermission(com.huawei.android.launcher.permission.READ_SETTINGS)
AddPermission(android.permission.READ_EXTERNAL_STORAGE)

CreateResource(values, colors.xml,
<resources>
    <color name="actionbar">#ff039be5</color>
    <color name="statusbar">#ff006db3</color>
    <color name="textColorPrimary">#ffffffff</color>
    <color name="navigationBar">#ff006db3</color>
</resources>
)
CreateResource(values-v20, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Material.Light">
         <item name="android:colorPrimary">@color/actionbar</item>
         <item name="android:colorPrimaryDark">@color/statusbar</item>
         <item name="android:textColorPrimary">@color/textColorPrimary</item>
         <item name="android:navigationBarColor">@color/navigationBar</item>
    </style>
</resources>
)



'End of default text.

below are my codes please
B4X:
#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Private xui As XUI
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Private CLV1 As CustomListView
    Private ImageView1 As B4XView
    Private lblTitle As B4XView
    Private lblContent As B4XView
    Private lblAction1 As Label
    Private lblAction2 As Label
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("noticeboard")


    Activity.AddMenuItem3("", "refresh", xui.LoadBitmapResize(File.DirAssets, "ic_cached_white_24dp.png", 32dip, 32dip, True), True)
    Activity.AddMenuItem3("", "done", xui.LoadBitmapResize(File.DirAssets, "ic_done_white_24dp.png", 32dip, 32dip, True), True)
    Dim bitmaps As List = Array("pexels-photo-446811.jpeg", "pexels-photo-571195.jpeg", _
        "pexels-photo-736212.jpeg", "pexels-photo-592798.jpeg")
    For i = 1 To 4
        Dim content As String = $"Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed Do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."$
        CLV1.Add(CreateItem(CLV1.AsView.Width, $"Anouncement #${i}"$, bitmaps.Get(i - 1), content), "")
    Next
End Sub



Private Sub CreateItem(Width As Int, Title As String, Image As String, Content As String) As Panel
    Dim p As B4XView = xui.CreatePanel("")
    Dim height As Int = 280dip
    If GetDeviceLayoutValues.ApproximateScreenSize < 4.5 Then height = 310dip
    p.SetLayoutAnimated(0, 0, 0, Width, height)
    p.LoadLayout("Card1")
    
    lblTitle.Text = Title
    lblContent.Text = Content
    'SetColorStateList(lblContent, xui.Color_Red,lblContent.TextColor)
    SetColorStateList(lblAction1, xui.Color_LightGray, lblAction1.TextColor)
    SetColorStateList(lblAction2, xui.Color_LightGray, lblAction2.TextColor)
    ImageView1.SetBitmap(xui.LoadBitmapResize(File.DirAssets, Image, ImageView1.Width, ImageView1.Height, True))
    Return p
End Sub



Sub SetColorStateList(Btn As Label,Pressed As Int,Enabled As Int)
    Dim States(2,1) As Int
    States(0,0) = 16842919    'Pressed
    States(1,0) = 16842910    'Enabled
    Dim CSL As JavaObject
    CSL.InitializeNewInstance("android.content.res.ColorStateList",Array(States,Array As Int(Pressed, Enabled)))
    Dim B1 As JavaObject = Btn
    B1.RunMethod("setTextColor",Array As Object(CSL))
End Sub
Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 

Attachments

  • Screenshot_1579633230.png
    Screenshot_1579633230.png
    113.1 KB · Views: 56
Top