Coder Social home page Coder Social logo

fontbinding's People

Contributors

ed-george avatar httpdispatch avatar johnugwuadi avatar lisawray avatar

Stargazers

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

Watchers

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

fontbinding's Issues

Font cache checks for wrong name

In the font cache the font is stored in the cache with the filename, but when this font is needed for another time the containsKey checks for the alias of the font.

Example:
fontFilename: MyFont-SemiBold.otf
stored in cache: fontFilename
checked: filename (myfont-semibold) [which is the alias]

Should it work to use this method with Design Support components and custom layouts?

In my project I have both a TabLayout and a NavigationDrawer.

For the TabLayout I inflate each tab as a custom layout. Like this:

LinearLayout appTab = (LinearLayout) LayoutInflater.from(activity).inflate(R.layout.custom_tab, null);
TextView appCardsTextView = (TextView) appTab.findViewById(R.id.tab_text);
appCardsTextView.setText("Application");
ImageView appCardsImageView = (ImageView) appTab.findViewById(R.id.tab_icon);
appCardsImageView.setImageResource(R.drawable.ic_application);
tabLayout.getTabAt(0).setCustomView(appTab);

custom_tab.xml:

<?xml version="1.0" encoding="utf-8"?>
<layout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <data>
    </data>

    <LinearLayout
        android:layout_height="match_parent"
        android:layout_width="match_parent"
        android:orientation="vertical"
        android:gravity="center_vertical|center_horizontal">

        <ImageView
            android:layout_width="34dp"
            android:layout_height="34dp"
            android:id="@+id/tab_icon"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:id="@+id/tab_text"
            android:textColor="@color/white"
            android:textSize="@dimen/tab_label"
            android:text="testing"
            app:font="@{`lato_hairline`}" <---- NOT WORKING!
        />

    </LinearLayout>

</layout>

Is there a way to make it set the font in a situation like this through XML?
I found a workaround setting it through Java that I use for now:
appCardsTextView.setTypeface(FontCache.getInstance(appCardsTextView.getContext()).get("lato_hairline"));
But for XML it does not bind to the BindingAdapter

I have the same problem for my NavigationView (sidebar) where I might have to get each item and set it through Java as well.

Thanks.

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.