How To Custom Corner Size on theme in material ShapeableImageView - rounded-corners

I want Custom Corner Size on a theme in material ShapeableImageViewDemo Image
Actually, I want to like this Image
topLeftRadius="#dimen/_24sdp"
bottomLeftRadius="#dimen/_24sdp"
bottomRightRadius="#dimen/_12sdp"
topRightRadius="#dimen/_12sdp
this is my material ShapeableImageView
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="#dimen/_120sdp"
android:layout_gravity="center"
app:shapeAppearanceOverlay="#style/roundedImageView"
android:layout_height="#dimen/_180sdp"
android:src="#drawable/thumbnail"/>
this is my themes.xml:
<style name="roundedImageView" parent="">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">#dimen/_10sdp</item>
</style>

Related

Theme ActionBar text title color issue with MaterialComponents.DayNight.DarkActionBar

I am struggling to set the dark and light mode theme color's for the title text and the background color.
My themes.xml code:
<style name="Theme.Main" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<item name="android:textColorPrimary">#color/colorAccent</item> //PrefScreen text
<item name="android:textColorSecondary">#color/colorAccent</item> //PrefScreen summary
<item name="colorPrimary">#color/background_dark</item> //ActionBar background
<item name="colorSecondary">#color/colorPrimary</item> //fab outline, PrefCategory
<item name="colorOnSecondary">#color/OnSecN</item> //fab icon
<item name="android:windowLightStatusBar" tools:targetApi="23">false</item>
<item name="android:statusBarColor" tools:targetApi="l">#color/background_dark</item>
<item name="android:backgroundTint">#color/background_dark</item>
</style>
Theme is applied in AndroidManifest.xml to application.
I have tried textColor and titleTextColor.

SnackBar style changed after using material components

Because I wanted to use material input edit text, I had to change my style to
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar.Bridge">
But my SnackBar style has changed, before it (which I was using AppCompat) my SnackBar was show in different mode, I mean, It came up from bottom and after a while it goes down, but now it is shown like a simple toast, it fade-in and then fade-out,
how can I use material component without having any change in my view styles?
Add following lines into styles.xml BaseTheme:
<resources>
<style name="BaseTheme" parent="Theme.MaterialComponents.Light.NoActionBar.Bridge">
...
<item name="snackbarStyle">#style/Widget.MaterialComponents.Snackbar</item>
<item name="snackbarButtonStyle">#style/Widget.MaterialComponents.Button.TextButton.Snackbar</item>
<item name="snackbarTextViewStyle">#style/Widget.MaterialComponents.Snackbar.TextView</item>
</style>
</resources>

Customise style of image select react native image picker

How do you change the colour of the react-native-image-picker choose from library screen?
I have added the following to styles.xml
<style name="AppTheme" parent="Theme.AppCompat">
<item name="android:actionBarStyle">#e7bd61</item>
<item name="android:colorPrimary">#e7bd61</item>
<item name="android:colorPrimaryDark">#e7bd61</item>
<item name="android:colorAccent">#e7bd61</item>
<item name="android:textColor">#e7bd61</item>
<item name="android:statusBarColor">#color/blue</item>
</style>
This code allows the Dialog to be styled however doesn't allow styling on the choose from library screen.

Naviagation Page is not setting BarBackgroundColor in XAML

Below is the code for XAML for customNavigation in Xamarin. The bar color is not set but Bar text color is set. And this is only happening in Android, iOS works fine.
<NavigationPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="DSXMobile.Views.CustomNavigationView"
BarBackgroundColor="Red"
BarTextColor="Black">
</NavigationPage>
Can anyone please help me ?
This is a known issue,
From Xamarin forums https://forums.xamarin.com/discussion/88569/barbackgroundcolor-refusing-to-get-set-on-android-but-bartextcolor-is-fine
"If you are using FormsAppCompatActivity
This is a bug in XF if you're using the FormsAppCompatActivity.
The workaround is to set android:background in your applications' layout file used for FormsAppCompatActivity.ToolbarResource.
Set this value to anything, example: android:background="#00000000"
Then XF will style it with whatever colour is in your XAML style later.
Really dumb bug, hope it gets sorted soon."
Another reference:
https://forums.xamarin.com/discussion/37657/how-to-change-the-nav-bar-background-color-on-android
Two annoying Custom Renderer Solutions:
https://forums.xamarin.com/discussion/17811/tabbedpage-tabbar-background-color-tint
https://forums.xamarin.com/discussion/59828/change-barbackgroundcolor-dynamically
Like the other answer says its a bug but i don't know if it should be called a bug because android is doing what it does picking the theme that you have assigned to its activity in your styles.xml now what you can do is make that same change in your styles.xml my theme something like this :
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="MyTheme" parent="MyTheme.Base">
</style>
<style name="DrawerArrowStyle"
parent="#style/Widget.AppCompat.DrawerArrowToggle">
<item name="spinBars">true</item>
<item name="color">#FFFFFF</item>
</style>
<style name="MyTheme.Base"
parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">#003399</item>
<item name="colorPrimaryDark">#003399</item>
<item name="colorControlHighlight">#003399</item>
<item name="colorAccent">#012348</item>
<item name="drawerArrowStyle">#style/DrawerArrowStyle</item>
</style>
</resources>
Changing the colors in here will change it there aswell for eg ColorPrimary is your toolbar color

Appcelerator Titanium: How do I change SearchView colors on Android? (hintText and cross icon)

I have a SearchView which is dark and its hinttext and its cross icon are black, so I want to set the color of these two things to white.
I am using a custom theme for Android but it does nothing to the SearchView. This is how my custom theme xml file looks like:
<resources>
<style name="Theme.MyApp" parent="#style/Theme.AppCompat.Light.DarkActionBar">
<item name="android:spinnerItemStyle">#style/MySpinnerItem</item>
<item name="android:actionBarStyle">#style/SearchViewTheme</item>
</style>
<style name="SearchViewTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:textColorPrimary">#FFFFFF</item>
<item name="android:textColorSecondary">#FFFFFF</item>
<item name="android:textColorHint">#CCCCCC</item>
</style>
<style name="MySpinnerItem" parent="#android:style/Widget.TextView.SpinnerItem">
<item name="android:paddingTop">10dp</item>
<item name="android:paddingBottom">10dp</item>
<item name="android:paddingLeft">10dp</item>
<item name="android:textSize">14dp</item>
</style>
</resources>
I found a solution. If anyone wants to know what I did:
I just deleted this line:
<item name="android:actionBarStyle">#style/SearchViewTheme</item>
And then, I added this to the .tss file where the SearchView is:
"Window[platform=android]" : {
theme : "SearchViewTheme"
}