Skip to content

With this android library you are able to display DIFF in a TextView.

License

Notifications You must be signed in to change notification settings

03050903/GitDiffTextView

Repository files navigation

GitDiffTextView

With this android library you are able to display DIFF in a TextView.

GitDiffTextView

Usage

Add dependency to your build.gradle file:

    dependencies {
        compile 'com.github.alorma:diff-textview:1.3.0'
    }

Add GitDiffTextView to your layout:

<com.alorma.diff.lib.DiffTextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/diffTextView"/>

Add diff text:

DiffTextView diffTextView = (DiffTextView) findViewById(R.id.diffTextView);

String diffText = "@@ -29,6 +29,7 @@
        android:resource=\"@xml/searchable_repos\" />
    </activity>
    <activity android:name=\"com.alorma.github.ui.activity.ProfileActivity\" />
+   <activity android:name=\"com.alorma.github.ui.activity.CommitDetailActivity\" />
    <activity android:name=\"com.alorma.github.ui.activity.RepoDetailActivity\" />
    <activity android:name=\"com.alorma.github.ui.dialog.NewIssueCommentDialog\" />
-   <activity android:name=\"com.alorma.github.ui.activity.FileActivity\" />";

diffTextView.setMaxLines(5);

diffTextView.setText(diffText);

About

With this android library you are able to display DIFF in a TextView.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages