Git Product home page Git Product logo

android-text's Introduction

android-text's People

Contributors

antoniolg avatar codingjeremy avatar florina-muntenescu avatar jimandreas avatar siyamed 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-text's Issues

The app should not crash during onCreate() (NPE: MainActivity.onCreate(MainActivity.java:48))

The TextStyling-Java project build (on the top of c1663ac) crashes with the following stacktrace:

com.android.example.text.styling E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.android.example.text.styling, PID: 3843
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.example.text.styling/com.android.example.text.styling.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.FileDescriptor android.os.ParcelFileDescriptor.getFileDescriptor()' on a null object reference

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.FileDescriptor android.os.ParcelFileDescriptor.getFileDescriptor()' on a null object reference
at android.support.v4.graphics.TypefaceCompatUtil.mmap(TypefaceCompatUtil.java:98)
at android.support.v4.graphics.TypefaceCompatApi24Impl.createFromFontInfo(TypefaceCompatApi24Impl.java:140)
at android.support.v4.graphics.TypefaceCompat.createFromFontInfo(TypefaceCompat.java:167)
at android.support.v4.provider.FontsContractCompat.getFontInternal(FontsContractCompat.java:190)
at android.support.v4.provider.FontsContractCompat.getFontSync(FontsContractCompat.java:244)
at android.support.v4.graphics.TypefaceCompat.createFromResourcesFamilyXml(TypefaceCompat.java:124)
at android.support.v4.content.res.ResourcesCompat.loadFont(ResourcesCompat.java:390)
at android.support.v4.content.res.ResourcesCompat.loadFont(ResourcesCompat.java:336)
at android.support.v4.content.res.ResourcesCompat.getFont(ResourcesCompat.java:205)
at com.android.example.text.styling.MainActivity.onCreate(MainActivity.java:48)

getColor(id) is deprecated in marshmallow api 23

The getColor(id) call is used in the androidTest: MarkdownBuilderTest.java

The test fails when run on emulators at version 22 and below. The path forward is to use the ContextCompat call which conveniently sorts out which call to use.

from: support-compat-27.0.2-sources.jar!\android\support\v4\content\ContextCompat.java

public static final int getColor(@NonNull Context context, @ColorRes int id) {
    if (Build.VERSION.SDK_INT >= 23) {
        return context.getColor(id);
    } else {
        return context.getResources().getColor(id);
    }
}

For reference:
https://stackoverflow.com/questions/31590714/getcolorint-id-deprecated-on-android-6-0-marshmallow-api-23

Line separator can be two characters on windows

Some tests fail in the junit tests as there is an assumption that the line separator for the system is one character. While this is true for Android devices, junit tests run on the host system. On windows the separator is two characters long. This suggests that the line separator needs to be a parameter:

-            endOfParagraph++;
+            endOfParagraph += LINE_SEPARATOR.length();

List of line separators:
https://stackoverflow.com/questions/426397/do-line-endings-differ-between-windows-and-linux

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.