mikescandy / calligraphy-xamarin Goto Github PK
View Code? Open in Web Editor NEWA port of the Android Calligraphy library to Xamarin.Android
License: Apache License 2.0
A port of the Android Calligraphy library to Xamarin.Android
License: Apache License 2.0
How can I use it in PCL app without creating new native layouts?
Hello,
First off, this is a great Library. Very handy!
I'm having issues getting it to work with MvvmCross, I get the following error
[Calligraphy] Exception of type 'Android.Views.InflateException' was thrown.
Weird thing is that it works on the splashscreen view, but now the firstview that MvvmCross creates.
Any ideas?
Could you please update to fix this issue:
chrisjenx/Calligraphy#155
Thanks
I tried to update app to android 10 api level 30, app crashing with below error.
[AndroidRuntime] Caused by: android.view.InflateException: Binary XML file line #17 in com.logesh.admin:layout/abc_screen_simple: Binary XML file line #17 in com.logesh.admin:layout/abc_screen_simple: Error inflating class android.support.v7.widget.FitWindowsLinearLayout
[AndroidRuntime] Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.reflect.Field.get(java.lang.Object)' on a null object reference
I get this error when using Calligraphy together with AppCompat in a simple project
Error inflating class android.support.v7.widget.Toolbar
Error inflating class android.widget.TextView
Error inflating class
In a larger project i also get this error before the inflate messages
The Activity's LayoutInflater already has a Factory installed so we can not install AppCompat's
I suspect it's the CalligraphyContextWrapper clashing with AppCompat's factory wrapper
TestSetup:
Calligraphy verison 1.0.0
AppCompat version 23.1.1.0
Activity
[Activity(Label = "@string/ApplicationName", MainLauncher = false, Theme = "@style/Public", ScreenOrientation = ScreenOrientation.Portrait)]
public class test : Activity
{
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.test);
}
protected override void AttachBaseContext(Context @base)
{
base.AttachBaseContext(new CalligraphyContextWrapper(@base));
}
}
Activity layout
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:elevation="0dp">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="test"
android:textColor="@android:color/white"
android:textSize="34sp"
android:padding="8dp"
android:layout_gravity="center" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
App
[Application]
public class App : Application
{
private const string LOG_TAG = "test";
protected App(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
{
}
public App()
{
}
public override void OnCreate()
{
base.OnCreate();
Log.Debug(LOG_TAG, "App Create");
Calligraphy.CalligraphyConfig.InitDefault("fonts/Roboto-Light.ttf", Calligraphy.Resource.Attribute.fontPath);
}
}
Don't know if the issue is in Calligraphy or AppCompat
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.