Code Monkey home page Code Monkey logo

calligraphy-xamarin's People

Contributors

marukami avatar mikescandy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

calligraphy-xamarin's Issues

InflateException with MVVMCross

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?

Xamarin android crashing after upgrading to android 10

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

Error inflating class *

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.