android


Vector Assert assigned color not working in smartphone


In Android studio I created vector asset image and set color as white it shows fine in preview and also working fine in AVD. If I installed it in smart phone it shows black color. Images are linked below.
Vector code for brands image assert code
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="70dp"
android:height="70dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#color/white"
android:pathData="M21.41,11.58l-9,-9C12.05,2.22 11.55,2 11,2L4,2c-1.1,0 -2,0.9 -2,2v7c0,0.55 0.22,1.05 0.59,1.42l9,9c0.36,0.36 0.86,0.58 1.41,0.58 0.55,0 1.05,-0.22 1.41,-0.59l7,-7c0.37,-0.36 0.59,-0.86 0.59,-1.41 0,-0.55 -0.23,-1.06 -0.59,-1.42zM5.5,7C4.67,7 4,6.33 4,5.5S4.67,4 5.5,4 7,4.67 7,5.5 6.33,7 5.5,7zM17.27,15.27L13,19.54l-4.27,-4.27C8.28,14.81 8,14.19 8,13.5c0,-1.38 1.12,-2.5 2.5,-2.5 0.69,0 1.32,0.28 1.77,0.74l0.73,0.72 0.73,-0.73c0.45,-0.45 1.08,-0.73 1.77,-0.73 1.38,0 2.5,1.12 2.5,2.5 0,0.69 -0.28,1.32 -0.73,1.77z" />
</vector>
Vector code for favorites image assert code
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="70dp"
android:height="70dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#color/white"
android:pathData="M16.5,3c-1.74,0 -3.41,0.81 -4.5,2.09C10.91,3.81 9.24,3 7.5,3 4.42,3 2,5.42 2,8.5c0,3.78 3.4,6.86 8.55,11.54L12,21.35l1.45,-1.32C18.6,15.36 22,12.28 22,8.5 22,5.42 19.58,3 16.5,3zM12.1,18.55l-0.1,0.1 -0.1,-0.1C7.14,14.24 4,11.39 4,8.5 4,6.5 5.5,5 7.5,5c1.54,0 3.04,0.99 3.57,2.36h1.87C13.46,5.99 14.96,5 16.5,5c2,0 3.5,1.5 3.5,3.5 0,2.89 -3.14,5.74 -7.9,10.05z"/>
</vector>
module:appbuild gradle code
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.binarystore.project1"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:design:25.3.0'
compile 'com.android.support:recyclerview-v7:25.3.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:support-v4:25.3.0'
//For cardview
compile 'com.android.support:cardview-v7:25.3.0'
//For Google Map
compile 'com.google.android.gms:play-services-maps:10.2.1'
//For Floating button menu
compile 'com.github.clans:fab:1.6.4'
compile group: 'com.github.VyacheslavShmakin', name: 'material-searchview', version: '1.1.0'
testCompile 'junit:junit:4.12'
compile project(':customfont')
}
need like this
but shown like this
Your vector image path is not proper(rendering issue), please delete the vector assets and try to upload again.
Else you have to create new vector asset, better to create new vector asset
In your layout file at the Views where you display your icons just set:
android:tint="#android:color/white"
This should fix your problem
<vector xmlns:android=enter code here"http://schemas.android.com/apk/res/android"
android:width="70dp"
android:height="70dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M21.41,11.58l-9,-9C12.05,2.22 11.55,2 11,2L4,2c-1.1,0 -2,0.9 -2,2v7c0,0.55 0.22,1.05 0.59,1.42l9,9c0.36,0.36 0.86,0.58 1.41,0.58 0.55,0 1.05,-0.22 1.41,-0.59l7,-7c0.37,-0.36 0.59,-0.86 0.59,-1.41 0,-0.55 -0.23,-1.06 -0.59,-1.42zM5.5,7C4.67,7 4,6.33 4,5.5S4.67,4 5.5,4 7,4.67 7,5.5 6.33,7 5.5,7zM17.27,15.27L13,19.54l-4.27,-4.27C8.28,14.81 8,14.19 8,13.5c0,-1.38 1.12,-2.5 2.5,-2.5 0.69,0 1.32,0.28 1.77,0.74l0.73,0.72 0.73,-0.73c0.45,-0.45 1.08,-0.73 1.77,-0.73 1.38,0 2.5,1.12 2.5,2.5 0,0.69 -0.28,1.32 -0.73,1.77z" />
</vector>

Related Links

Error: Could not find class file for 'com.test ndk.Hello World'
Alternative for retrieving Data From WebServices Using AyncTasks
What happens to shared data when the app is uninstall
Cannot resolve symbol AppCompatActivity - Support v7 libraries aren't recognized?
How adding two buttons at the end of listview in the seconde activity?
BadTockenException in Speech-to-Text popup inside PopupWindow
toggle switch in recyclerview programatically
Unable to load class OutputFileTask with Android Studio 1.2 and Gradle 1.2.2
[Video Call]Cannot recall the Video Chat
RecyclerView: No adapter attached; skipping layout [duplicate]
ImageView vs Canvas
Google Cloud Messaging Notifications on users multiple devices
Picasso image load incredibly laggy in android listview?
showDialog in button Listview adapter
How to retrieve data from a database and display it in textview for android? Asynctask doesnt load my data?
Dynamically change custom list item background

Categories

HOME
cobalt
checkstyle
css3
jax-rs
flex
interface
apache-spark-mllib
yahoo-finance
gradient
rendering
visual-studio-emulator
regular-language
nuget-package
openstreetmap
google-chrome-app
comsol
symmetricds
mongodb-csharp
capistrano3
linear-algebra
job-scheduling
intershop
google-picker
enterprise-miner
apache2.4
lilypond
simpleitk
spring-async
dpdk
r-mice
easeljs
highstock
google-api-client
quantlib
gitlab-api
dst
complex-numbers
zend-debugger
left-join
catch-unit-test
papaparse
joomla2.5
modernizr
connection-pool
filesystemwatcher
loading
typesafe-config
chef-solo
dcmtk
wmp
parser-generator
angular-http
wc
plan-9
proget
spring-integration-sftp
magic-draw
gpg-signature
google-photos
branch-prediction
pocketsphinx-android
reachability
donations
cubism.js
redistributable
flex4.6
mongodb-php
mta
mapinfo
clipboard.js
android-wake-lock
data-protection
exim4
forwarding
ons-api
doctype
node-serialport
zxspectrum
variadic-templates
mdichild
ignite-ui
radiant
android-framework
multitasking
unit-of-work
sentestingkit
boost-msm
veracity
boost-signals
extconf.rb
infobright
virtualpathprovider
convention
vs-android
int64
firefox-3
mathematical-typesetting
appliance

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App