Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmontemagno committed Sep 20, 2013
0 parents commit 080f118
Show file tree
Hide file tree
Showing 33 changed files with 1,186 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .gitattributes
@@ -0,0 +1,22 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
215 changes: 215 additions & 0 deletions .gitignore
@@ -0,0 +1,215 @@
#################
## Eclipse
#################

*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath


#################
## Visual Studio
#################

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results

[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.Publish.xml
*.pubxml

# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
App_Data/*.mdf
App_Data/*.ldf

#############
## Windows detritus
#############

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac crap
.DS_Store


#############
## Python
#############

*.py[co]

# Packages
*.egg
*.egg-info
dist/
build/
eggs/
parts/
var/
sdist/
develop-eggs/
.installed.cfg

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox

#Translations
*.mo

#Mr Developer
.mr.developer.cfg
82 changes: 82 additions & 0 deletions README.md
@@ -0,0 +1,82 @@


XamDroid.RobotoText
================

Implementation backwards compatibility Roboto font in any control!.


## Demo

![Sample](https://raw.github.com/jamesmontemagno/XamDroid.RobotoText/master/Screenshots/Sample.png)

## Getting started

### Installing the library
Add library to your project or clone it and do the following:
* Add all fonts into Asses/fonts and ensure they are marked as `AndroidAsset` as the build action
* Add RobotoTextView and feel free to change the namespace
* Add the custom attributes in the attrs.xml in your Resources/Values folder.

### Usage
In any layout that you wish to use the Roboto Font simply include a new `xmlns`

```
xmlns:local="http://schemas.android.com/apk/res-auto"
```

Then create a new RobotoTextView
```
<com.refractored.controls.RobotoTextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
local:typeface="roboto_thin"
android:text="Roboto Thin"
android:textAppearance="?android:attr/textAppearanceMedium" />
```

The most important part is: `local:typeface`

Valid options are:
* roboto_thin
* roboto_thin_italic
* roboto_light
* roboto_light_italic
* roboto_regular
* roboto_medium
* roboto_medium_italic
* roboto_bold
* roboto_bold_italic
* roboto_black
* roboto_black_italic
* roboto_condensed
* roboto_condensed_italic
* roboto_condensed_bold
* roboto_condensed_bold_italic

### Expanding
You can apply this same concept to any other control such as a CheckedTextView.

## Development:

Ported and Maintained by:
James Montemagno ([@JamesMontemagno](http://www.twitter.com/jamesmontemagno))

Original Concept on ([Stack Overflow](http://stackoverflow.com/questions/4395309/android-want-to-set-custom-fonts-for-whole-application-not-runtime/9199258#9199258))


## License

Copyright 2013 James Montemagno

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
36 changes: 36 additions & 0 deletions RobotoText/Activity1.cs
@@ -0,0 +1,36 @@
/*
* Copyright (C) 2013 @JamesMontemagno http://www.montemagno.com http://www.refractored.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

using Android.App;
using Android.OS;

namespace com.refractored.controls
{
[Activity(Label = "RobotoText", MainLauncher = true, Icon = "@drawable/icon")]
public class Activity1 : Activity
{
int count = 1;

protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);

// Set our view from the "main" layout resource
this.SetContentView(Resource.Layout.Main);
}
}
}

19 changes: 19 additions & 0 deletions RobotoText/Assets/AboutAssets.txt
@@ -0,0 +1,19 @@
Any raw assets you want to be deployed with your application can be placed in
this directory (and child directories) and given a Build Action of "AndroidAsset".

These files will be deployed with you package and will be accessible using Android's
AssetManager, like this:

public class ReadAsset : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);

InputStream input = Assets.Open ("my_asset.txt");
}
}

Additionally, some Android functions will automatically load asset files:

Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
Binary file added RobotoText/Assets/fonts/Roboto-Black.ttf
Binary file not shown.
Binary file added RobotoText/Assets/fonts/Roboto-BlackItalic.ttf
Binary file not shown.
Binary file added RobotoText/Assets/fonts/Roboto-Bold.ttf
Binary file not shown.
Binary file added RobotoText/Assets/fonts/Roboto-BoldCondensed.ttf
Binary file not shown.
Binary file not shown.
Binary file added RobotoText/Assets/fonts/Roboto-BoldItalic.ttf
Binary file not shown.
Binary file added RobotoText/Assets/fonts/Roboto-Condensed.ttf
Binary file not shown.
Binary file not shown.
Binary file added RobotoText/Assets/fonts/Roboto-Italic.ttf
Binary file not shown.
Binary file added RobotoText/Assets/fonts/Roboto-Light.ttf
Binary file not shown.
Binary file added RobotoText/Assets/fonts/Roboto-LightItalic.ttf
Binary file not shown.
Binary file added RobotoText/Assets/fonts/Roboto-Medium.ttf
Binary file not shown.
Binary file added RobotoText/Assets/fonts/Roboto-MediumItalic.ttf
Binary file not shown.
Binary file added RobotoText/Assets/fonts/Roboto-Regular.ttf
Binary file not shown.
Binary file added RobotoText/Assets/fonts/Roboto-Thin.ttf
Binary file not shown.
Binary file added RobotoText/Assets/fonts/Roboto-ThinItalic.ttf
Binary file not shown.
5 changes: 5 additions & 0 deletions RobotoText/Properties/AndroidManifest.xml
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" />
<application></application>
</manifest>

0 comments on commit 080f118

Please sign in to comment.