How to override the CellStyle value in excel dart package? - android

I am using excel dart package to create and edit excel files. I am trying to make my excel file look attractive by giving colors to excel cells.
I read the documentation here and tried to do like this :
CellStyle color1 = CellStyle(
fontColorHex: "#Ffffff",
backgroundColorHex: "#80ff00",
fontFamily: getFontFamily(FontFamily.Calibri),
);
CellStyle color2 = CellStyle(
fontColorHex: "#Ffffff",
backgroundColorHex: "#Ea4a73",
fontFamily: getFontFamily(FontFamily.Calibri),
);
var cell = sheetObject.cell(CellIndex.indexByString("A1"));
//changing cell style to color 1
cell.CellStyle = color1;
//now again changing cell style to color 2
cell.CellStyle = color2;
Problem with this:
When I try to change the cellStyle to color2 it persist the old values of color1. Why this is happening and how can I fix this, Is there any property to remove the cellStyle first and then assigning to new CellStyle. Thanks in advance

The issue I found was that cell.CellStyle should be cell.cellStyle. if that was a mistake while adding code here, Then for your information, the current code works for me without any issue. try to delete the excel file been exported and clean the project and run the code again.

Related

Material Design Icons (JS SVG) Vuetify.js - append-icon not displaying using mdiSvg

I can't get the append-icon to display on Android, when using PhoneGap to produce an APK from my dist.zip folder. At first, it wouldn't display icons at all then I switched over to mdiSvg as per the link (https://vuetifyjs.com/en/customization/icons/#install-material-design-icons-js-svg). After that, the v-icon started displaying when I inserted the {{ mdiClose }} and specifying the mdiClose iconfont and importing it in my .vue file.
I have tried mdi-eye, mdiEye also but no luck.
<v-icon color="primary">{{ mdiClose }}</v-icon>
<v-text-field
v-model="$v.password.$model"
:error-messages="passwordErrors"
label="Password"
:type="showPassword ? 'text' : 'password'"
required
:append-icon="showPassword ? 'visibility' : 'visibility_off'"
#click:append="showPassword = !showPassword"
></v-text-field>
visibility and visibility_off are not material design icons. Use eye and eye-off instead.
It works for me like this:
import {mdiClose,mdiEye,mdiEyeOff} from '#mdi/js';
...
data:()=>({
svgClose:mdiClose,
svgEye:mdiEye,
svgEyeOff:mdiEyeOff
})
in your vue file:
<v-icon color="primary">{{ svgClose }}</v-icon>
<v-text-field
v-model="$v.password.$model"
:error-messages="passwordErrors"
label="Password"
:type="showPassword ? 'text' : 'password'"
required
:append-icon="showPassword ? 'svgEye' : 'svgEyeOff'"
#click:append="showPassword = !showPassword"
></v-text-field>

Iconize Xamarin with Fontawesome

I'm new to Xamarin and I'm trying to use the Iconize NuGet package for Xamarin, but I'm not having much luck. At the moment I'm working with a simple Android app. I've installed Iconize per the instructions and, save for an error on the line:
FormsPlugin.Iconize.Droid.IconControls.Init(Resource.Id.toolbar, Resource.Id.tabs);
(the compiler didn't like the Resource.Id.toolbar or Resource.Id.tabs so I removed it) everything compiles and runs. However, when I try to add an IconButton with a Fontawesome image, I get "System.NullReferenceException: Object reference not set to an instance of an object." error that points back to
the line LoadApplication( new App() ); in the MainActivity.cs.
I'm trying to add the IconButton to a grid in code (not XAML) using
grid.Children.Add( new IconButton
{
Image = "fa-info-circle"
}, 3, 2 );
Any ideas on how to make this work? The examples on the Iconize page haven't been very useful and I haven't found any examples on Google.
Okay I finally found something that was useful. I found a clue on this page and some other information on the project issues page on Github.
Ultimately, to get the icon to display I used
grid.Children.Add( new IconButton
{
Text = "fa-info-circle",
}, 3, 2 );
It was the Text property and not the Image property that I should have used.
Hope this helpful to someone else.

react-native android fontFamily does not take effect

Question 1:
I add a fontFamily to index.android.js's welcome style, but it takes no effect. Does fontFamily actually work on android?
welcome:{
fontSize:20,
fontFamily:'roboto-thin',
textAlign:'center',
margin:10}
Question 2:
if fontFamily works on android, is there a way to load custom font from assets? Or is this some feature to be implemented by react-native?
For Android:
Custom fonts were added with 0.16.0-rc. So you need to have 0.16.0-rc version first and after that you can just download any fonts from the web.
Put your font files in projectfolder/android/app/src/main/assets/fonts/font_name.ttf
Remember to recompile which is: react-native run-android
And then you can use fontFamily: 'font_name' in your style.
Also note the following restrictions for custom Android fonts in react-native:
fonts must be placed in android/app/src/main/assets/fonts
only .ttf files are supported
The name of the file has to match the fontFamily exactly. For instance, if fontFamily is 'Source Sans Pro',
the file must be called Source Sans Pro.ttf (and NOT SourceSansPro.ttf). Any suffixes as mentioned in the following paragraph are automatically removed from the file.
When the font is in bold and/or italic, it must use on the following suffixes:
_bold (e.g. Source Sans Pro_bold.ttf)
_italic
_bold_italic
Hello this issue waist for me more than two days with "El+Messiri" font "https://fonts.google.com/specimen/El+Messiri"
i was doing every think write :
Put your font files in
projectfolder/android/app/src/main/assets/fonts/ElMessiri-Regular.ttf
Remember to recompile which is: react-native run-android And then
you can use fontFamily: 'ElMessiri-Regular' in your style.
but the fault was that am using fontWeight : 'bold' after fontFamily: 'ElMessiri-Regular' and the fontWeight was overiding the fontFamily because "El+Messiri" font has his own fontFamily bold wich is "ElMessiri-Bold"
I believe the following is a cleaner alternative to the methods already explained here:
Put all your fonts in you React-Native project directory
./assets/fonts/
Add the following line in your package.json
"rnpm": {
"assets": ["./assets/fonts"]
}
finally run in the terminal from your project directory
$ react-native link
to use it declare this way in your styles
fontFamily: 'your-font-name without extension'
If your font is Raleway-Bold.ttf then,
fontFamily: 'Raleway-Bold'
Source https://medium.com/#danielskripnik/how-to-add-and-remove-custom-fonts-in-react-native-b2830084b0e4
This feature has yet to be implemented. See the relevant issue on github here.
It seems like custom font was added, check out this commit:
https://github.com/facebook/react-native/commit/bfeaa6a4f531cfc18c097bc9ffb6a8dbe3ddc702
For those facing problems with iOS only - which sometimes does not recognize the fontFamily name correctly:
The only solution that solved my problem was to log all the fonts to find out correct naming
(make sure you do the steps below only after adding the assets/fonts and running the react-native link):
Anyway, to log them, open the appName.xcworkspace file with xcode and then edit AppDelegate.m putting this lines at the end of the didFinishLaunchingWithOptions method (and before the return statement):
for (NSString* family in [UIFont familyNames])
{
NSLog(#"%#", family);
for (NSString* name in [UIFont fontNamesForFamilyName: family])
{
NSLog(#" %#", name);
}
}
So, when you run the app (from xcode) it outputs something like this:
This way, I can use the fontFamily Barow-Light or Zapfino inside my react-native styles
Hope it helped!
I had an incredibly hard time with this, even after following all advice I found.
What worked for me: ensure the font file is named using only lowercase letters and underscores. Re-link. Done.
A lot of hair pulling has been done over this yet it isn't mentioned anywhere as far as I can see.

how can i use use local images in my titanium project

i'm trying to change my background of a window in titanium , unfortuantly its not working. i also tried to use many local images and they did't load. any help is highly appreciated
,How can use my resources ?
var win1 = Titanium.UI.createWindow({
title:'Hello',
backgroundImage:'back.png',
});
You can do that, just like that. backgroundImage is supported on window.
Just make sure you use the right path:
backgroundImage: Ti.FileSystem.resourcesDirectory + 'back.png'
Here I am assuming back.png (case sensitive) is actually in the resources directory root.

Change text on shape

Hi
is it possible to change the text of a shape? I have:
levelFraction = new Text(0, 300, mFont, "text", HorizontalAlign.CENTER);
then I add it to the scene:
scene.getTopLayer().addEntity(levelFraction);
but I don't see any method to change the text at runtime. Something like:
levelFraction.setText(...);
Is that possible?
if Sheet1.shapes(0).texteffect.text="Go" then
sheet1.shapes(0).texteffect.text="Stop"
else
sheet1.shapes(0).texteffect.text="Go"
end if
You could even call a sub based on the the value of the texteffect.text
I don't know anything about the AndEngine library, so this would just be a wild guess:
Could you perhaps use the ChangeableText (which extends Text) instead of Text? From the name it sounds like you should be able to change the text, and looking at the code it also have a couple of functions to set the text: ChangeableText source
font_texture_golbalValue = new Texture(128,64,TextureOptions.BILINEAR);
font4 = new Font(font_texture_golbalValue, Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD), textSize, true, Color.WHITE);
this.mEngine.getTextureManager().loadTexture(this.font_texture_golbalValue);
this.mEngine.getFontManager().loadFont(this.font4);
scoreval=new ChangeableText(24*CAMERA_WIDTH/100, score_postion, this.font2, ""+scoreValue,"Score##".length());
and You can use scorevalue.SetText();

Categories

Resources