Skip to content

Commit

Permalink
Migrate to androidx
Browse files Browse the repository at this point in the history
  • Loading branch information
noties committed Jun 11, 2019
1 parent a2a5857 commit 9aade9d
Show file tree
Hide file tree
Showing 213 changed files with 555 additions and 647 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ features listed in [commonmark-spec] are supported
![stable](https://img.shields.io/maven-central/v/io.noties.markwon/core.svg?label=stable)
![snapshot](https://img.shields.io/nexus/s/https/oss.sonatype.org/io.noties.markwon/core.svg?label=snapshot)

```groovy
```kotlin
implementation "io.noties.markwon:core:${markwonVersion}"
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;

Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/io/noties/markwon/app/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import android.app.Application;
import android.content.Context;
import android.support.annotation.NonNull;

import androidx.annotation.NonNull;

import io.noties.debug.AndroidLogDebugOutput;
import io.noties.debug.Debug;
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/io/noties/markwon/app/AppBarItem.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package io.noties.markwon.app;

import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;

abstract class AppBarItem {

static class State {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/io/noties/markwon/app/AppModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import io.noties.markwon.syntax.Prism4jThemeDefault;
import okhttp3.Cache;
import okhttp3.OkHttpClient;
import ru.noties.prism4j.Prism4j;
import ru.noties.prism4j.annotations.PrismBundle;
import io.noties.prism4j.Prism4j;
import io.noties.prism4j.annotations.PrismBundle;

@Module
@PrismBundle(includeAll = true)
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/java/io/noties/markwon/app/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.Spanned;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import javax.inject.Inject;

import io.noties.markwon.Markwon;
import io.noties.debug.Debug;
import io.noties.markwon.Markwon;

public class MainActivity extends Activity {

Expand Down
7 changes: 4 additions & 3 deletions app/src/main/java/io/noties/markwon/app/MarkdownLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
import android.content.Context;
import android.net.Uri;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.TextUtils;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
Expand All @@ -20,11 +21,11 @@

import javax.inject.Inject;

import io.noties.debug.Debug;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;
import io.noties.debug.Debug;

@ActivityScope
public class MarkdownLoader {
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/java/io/noties/markwon/app/MarkdownRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
import android.net.Uri;
import android.os.Handler;
import android.os.SystemClock;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.Spanned;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;

Expand All @@ -31,7 +32,7 @@
import io.noties.markwon.syntax.SyntaxHighlightPlugin;
import io.noties.markwon.urlprocessor.UrlProcessor;
import io.noties.markwon.urlprocessor.UrlProcessorRelativeToAbsolute;
import ru.noties.prism4j.Prism4j;
import io.noties.prism4j.Prism4j;

@ActivityScope
public class MarkdownRenderer {
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/io/noties/markwon/app/Themes.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import android.content.Context;
import android.content.SharedPreferences;
import android.support.annotation.NonNull;

import androidx.annotation.NonNull;

import javax.inject.Inject;
import javax.inject.Singleton;
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/io/noties/markwon/app/UriProcessor.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package io.noties.markwon.app;

import android.net.Uri;
import android.support.annotation.NonNull;

import androidx.annotation.NonNull;

@SuppressWarnings("WeakerAccess")
public interface UriProcessor {
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/io/noties/markwon/app/UriProcessorImpl.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package io.noties.markwon.app;

import android.net.Uri;
import android.support.annotation.NonNull;

import androidx.annotation.NonNull;

import java.util.List;

Expand Down Expand Up @@ -32,7 +33,7 @@ public Uri process(@NonNull final Uri uri) {
.fragment(uri.getFragment())
.query(uri.getQuery());

for (String segment: segments) {
for (String segment : segments) {
final String part;
if ("blob".equals(segment)) {
part = "raw";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package io.noties.markwon.app;

import android.net.Uri;
import android.support.annotation.NonNull;
import android.text.TextUtils;

import androidx.annotation.NonNull;

import io.noties.markwon.urlprocessor.UrlProcessor;
import io.noties.markwon.urlprocessor.UrlProcessorRelativeToAbsolute;

Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/io/noties/markwon/app/Views.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package io.noties.markwon.app;

import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.view.View;

import androidx.annotation.IntDef;
import androidx.annotation.NonNull;

@SuppressWarnings("WeakerAccess")
public abstract class Views {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import io.noties.markwon.image.AsyncDrawable;
import io.noties.markwon.image.AsyncDrawableLoader;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package io.noties.markwon.app.gif;

import android.content.Context;
import android.support.annotation.NonNull;
import android.widget.TextView;

import androidx.annotation.NonNull;

import org.commonmark.node.Image;

import io.noties.markwon.AbstractMarkwonPlugin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

public class GifPlaceholder extends Drawable {

Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/io/noties/markwon/app/gif/GifProcessor.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package io.noties.markwon.app.gif;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.Spannable;
import android.text.Spanned;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import io.noties.markwon.image.AsyncDrawableSpan;
import pl.droidsonroids.gif.GifDrawable;

Expand Down
10 changes: 4 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,20 @@ ext {
'push-aar-gradle': 'https://raw.githubusercontent.com/noties/gradle-mvn-push/master/gradle-mvn-push-aar.gradle'
]

final def supportVersion = '28.0.0'
final def commonMarkVersion = '0.12.1'
final def daggerVersion = '2.10'

deps = [
'support-annotations' : "com.android.support:support-annotations:$supportVersion",
'support-app-compat' : "com.android.support:appcompat-v7:$supportVersion",
'support-recycler-view' : "com.android.support:recyclerview-v7:$supportVersion",
'x-annotations' : 'androidx.annotation:annotation:1.1.0',
'x-recycler-view' : 'androidx.recyclerview:recyclerview:1.0.0',
'commonmark' : "com.atlassian.commonmark:commonmark:$commonMarkVersion",
'commonmark-strikethrough': "com.atlassian.commonmark:commonmark-ext-gfm-strikethrough:$commonMarkVersion",
'commonmark-table' : "com.atlassian.commonmark:commonmark-ext-gfm-tables:$commonMarkVersion",
'android-svg' : 'com.caverock:androidsvg:1.2.1',
'android-gif' : 'pl.droidsonroids.gif:android-gif-drawable:1.2.14',
'jlatexmath-android' : 'ru.noties:jlatexmath-android:0.1.0',
'okhttp' : 'com.squareup.okhttp3:okhttp:3.9.0',
'prism4j' : 'ru.noties:prism4j:1.1.0',
'prism4j' : 'io.noties:prism4j:2.0.0',
'debug' : 'io.noties:debug:5.0.0@jar',
'adapt' : 'io.noties:adapt:2.0.0',
'dagger' : "com.google.dagger:dagger:$daggerVersion",
Expand All @@ -77,7 +75,7 @@ ext {
]

deps['annotationProcessor'] = [
'prism4j-bundler': 'ru.noties:prism4j-bundler:1.1.0',
'prism4j-bundler': 'io.noties:prism4j-bundler:2.0.0',
'dagger-compiler': "com.google.dagger:dagger-compiler:$daggerVersion"
]

Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ org.gradle.jvmargs=-Xmx5g -Dfile.encoding=UTF-8
#org.gradle.parallel=true
org.gradle.configureondemand=true

android.useAndroidX=true
android.enableJetifier=true
android.enableBuildCache=true
android.buildCacheDir=build/pre-dex-cache

Expand Down
2 changes: 1 addition & 1 deletion markwon-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ android {
dependencies {

deps.with {
api it['support-annotations']
api it['x-annotations']
api it['commonmark']
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package io.noties.markwon;

import android.support.annotation.NonNull;
import android.text.Spanned;
import android.widget.TextView;

import androidx.annotation.NonNull;

import org.commonmark.node.Node;
import org.commonmark.parser.Parser;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
import android.content.Intent;
import android.net.Uri;
import android.provider.Browser;
import android.support.annotation.NonNull;
import android.util.Log;
import android.view.View;

import androidx.annotation.NonNull;

import io.noties.markwon.core.spans.LinkSpan;

public class LinkResolverDef implements LinkSpan.Resolver {
Expand Down
5 changes: 3 additions & 2 deletions markwon-core/src/main/java/io/noties/markwon/Markwon.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package io.noties.markwon;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.Spanned;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import org.commonmark.node.Node;

import io.noties.markwon.core.CorePlugin;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package io.noties.markwon;

import android.content.Context;
import android.support.annotation.NonNull;
import android.widget.TextView;

import androidx.annotation.NonNull;

import org.commonmark.parser.Parser;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.noties.markwon;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import io.noties.markwon.core.MarkwonTheme;
import io.noties.markwon.core.spans.LinkSpan;
Expand Down
5 changes: 3 additions & 2 deletions markwon-core/src/main/java/io/noties/markwon/MarkwonImpl.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package io.noties.markwon;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.Spanned;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import org.commonmark.node.Node;
import org.commonmark.parser.Parser;

Expand Down
Loading

0 comments on commit 9aade9d

Please sign in to comment.