That’s a transition for my blog: from now, articles will be written in English! (sorry for all the English langage mistakes, it’s the beginning).
Number of different topics for this week: 6
|Shortcuts to topics|
|Prevent the Gmail to Inbox redirection|
|Chrome useful shortcuts : new / close tabs|
|Hum, build.gradle problem|
|Retrieve the dimensions for an SVG element|
|Use a custom font in your Android app|
|Anchors in your markdown file|
I was unpleasantly surprise to see that my Gmail account was redirected automatically to Inbox, without my knowing! To prevent this behaviour, you have to go to your Inbox page, in the left panel select “Settings” et uncheck the automatic redirection Redirect Gmail to inbox.google.com.
- Cmd + T to open a new tab
- Cmd + W to close the current tab
Error:(1, 1) A problem occurred evaluating project ':app'. > Failed to apply plugin [id 'com.android.application'] > Could not create plugin of type 'AppPlugin'.
It’s simply because I’ve loaded an old project and my gradle settings had been modified without my knowing… The solution is also to change this settings:
- Android Studio > Preferences > Build, Execution, Deployment > Gradle
Check the Use default gradle build wrapper (recommended). If the problem persist, I’ve a second solution : go to this link (http://tools.android.com/tech-docs/new-build-system) and get the latest plugin version number and edit your version number in your build.gradle file from your project (classpath ‘com.android.tools.build:gradle:2.2.0-alpha4’ for example).
An example of use…
var element = document.getElementById("box"); var elementbBox = element.getBBox();
To use a custom font, it’s pretty simple. You only have to copy/paste the .tff in the assets folder from your project (this folder location is very important).
Now, you can use it in the activity class like this:
Typeface tfCustom = Typeface.createFromAsset(getAssets(),"Roboto.ttf"); tvHelloWorld.setTypeface(tfCustom); // tvHelloWorld is a TextView for example
A good practise is to create a subfolder “fonts” in the assets folder.
Now, add an hyperlink to the word you want to shortcut to this anchor: