Skip to content
This repository has been archived by the owner on Dec 2, 2019. It is now read-only.

Commit

Permalink
Migrate to Android X
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvnagarajan committed Nov 3, 2019
1 parent c71dfe5 commit a9a6f19
Show file tree
Hide file tree
Showing 31 changed files with 52 additions and 120 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ to your ProGuard rules file.
## Usage
#### Instantiating
```java
import com.leocardz.link.preview.library.TextCrawler;
import com.leocardz.linkpreview.sample.library.TextCrawler;
// ...
// Create an instance of the TextCrawler to parse your url into a preview.
TextCrawler textCrawler = new TextCrawler();
Expand Down
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
compileSdkVersion 29

dexOptions {
jumboMode = true
}

defaultConfig {
applicationId "com.leocardz.link.preview"
minSdkVersion 11
targetSdkVersion 23
minSdkVersion 14
targetSdkVersion 29
versionCode 1
versionName "1.1"
}
Expand All @@ -23,8 +23,8 @@ android {
}

dependencies {
implementation project(":library")
implementation 'com.android.support:appcompat-v7:23.1.1'
implementation project(':linkpreview')
implementation 'androidx.appcompat:appcompat:1.1.0'

implementation 'com.koushikdutta.urlimageviewhelper:urlimageviewhelper:1.0.4'
implementation 'org.jsoup:jsoup:1.11.3'
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.leocardz.link.preview"
package="com.leocardz.linkpreview.sample"
android:installLocation="preferExternal">

<uses-permission android:name="android.permission.INTERNET" />
Expand All @@ -12,7 +12,7 @@
android:screenOrientation="portrait"
android:theme="@style/App.Theme">
<activity
android:name=".Main"
android:name="com.leocardz.linkpreview.sample.Main"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/App.Theme">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package com.leocardz.link.preview;
package com.leocardz.linkpreview.sample;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
Expand All @@ -26,9 +25,9 @@

import com.koushikdutta.urlimageviewhelper.UrlImageViewCallback;
import com.koushikdutta.urlimageviewhelper.UrlImageViewHelper;
import com.leocardz.link.preview.library.LinkPreviewCallback;
import com.leocardz.link.preview.library.SourceContent;
import com.leocardz.link.preview.library.TextCrawler;
import com.leocardz.linkpreview.sample.library.LinkPreviewCallback;
import com.leocardz.linkpreview.sample.library.SourceContent;
import com.leocardz.linkpreview.sample.library.TextCrawler;

import java.util.List;
import java.util.Random;
Expand All @@ -40,7 +39,7 @@


@SuppressWarnings("unused")
public class Main extends ActionBarActivity {
public class Main extends Activity {

private EditText editText, editTextTitlePost, editTextDescriptionPost;
private Button submitButton, postButton, randomButton;
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
69 changes: 0 additions & 69 deletions library/LinkPreview.iml

This file was deleted.

File renamed without changes.
6 changes: 3 additions & 3 deletions library/build.gradle → linkpreview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ android {
compileSdkVersion 29

defaultConfig {
minSdkVersion 9
minSdkVersion 14
targetSdkVersion 29
versionCode 1
versionName "1.3.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand All @@ -29,7 +29,7 @@ dependencies {
implementation 'io.reactivex.rxjava2:rxjava:2.2.12'

androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'org.mockito:mockito-android:2.22.0'
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.leocardz.link.preview.library;
package com.leocardz.linkpreview.sample.library;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.leocardz.link.preview.library;
package com.leocardz.linkpreview.sample.library;

import java.util.concurrent.CountDownLatch;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.leocardz.link.preview.library;
package com.leocardz.linkpreview.sample.library;

import android.os.AsyncTask;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.leocardz.link.preview.library;
package com.leocardz.linkpreview.sample.library;

import android.support.test.runner.AndroidJUnit4;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import com.leocardz.link.preview.library.url.UrlExtractionStrategy;
import com.leocardz.linkpreview.sample.library.url.UrlExtractionStrategy;

import org.jsoup.nodes.Document;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.leocardz.link.preview.library">
package="com.leocardz.linkpreview.sample.library">

<uses-permission android:name="android.permission.INTERNET" />
</manifest>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.leocardz.link.preview.library
package com.leocardz.linkpreview.sample.library

import org.jsoup.nodes.Document
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.leocardz.link.preview.library;
package com.leocardz.linkpreview.sample.library;

import org.jsoup.nodes.Document;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.leocardz.link.preview.library;
package com.leocardz.linkpreview.sample.library;

import android.graphics.Bitmap;
import android.widget.ImageView;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.leocardz.link.preview.library
package com.leocardz.linkpreview.sample.library

/**
* @author dhruvaraj nagarajan
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.leocardz.link.preview.library
package com.leocardz.linkpreview.sample.library

import android.os.AsyncTask
import com.leocardz.link.preview.library.url.DefaultUrlExtractionStrategy
import com.leocardz.link.preview.library.url.UrlExtractionStrategy
import com.leocardz.linkpreview.sample.library.url.DefaultUrlExtractionStrategy
import com.leocardz.linkpreview.sample.library.url.UrlExtractionStrategy

/**
* @author dhruvaraj nagarajan
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.leocardz.link.preview.library
package com.leocardz.linkpreview.sample.library

import com.leocardz.link.preview.library.url.DefaultUrlExtractionStrategy
import com.leocardz.link.preview.library.url.UrlExtractionStrategy
import com.leocardz.linkpreview.sample.library.url.DefaultUrlExtractionStrategy
import com.leocardz.linkpreview.sample.library.url.UrlExtractionStrategy
import io.reactivex.Observable

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.leocardz.link.preview.library
package com.leocardz.linkpreview.sample.library

import com.leocardz.link.preview.library.Util.extendedTrim
import com.leocardz.link.preview.library.url.UrlExtractionStrategy
import com.leocardz.linkpreview.sample.library.Util.extendedTrim
import com.leocardz.linkpreview.sample.library.url.UrlExtractionStrategy
import org.jsoup.Jsoup
import org.jsoup.UnsupportedMimeTypeException
import org.jsoup.nodes.Document
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.leocardz.link.preview.library
package com.leocardz.linkpreview.sample.library

import org.jsoup.nodes.Document
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.leocardz.link.preview.library;
package com.leocardz.linkpreview.sample.library;

/**
* Callback that is invoked with before and after the loading of a link preview
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.leocardz.link.preview.library;
package com.leocardz.linkpreview.sample.library;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.leocardz.link.preview.library;
package com.leocardz.linkpreview.sample.library;

import java.net.URL;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.leocardz.link.preview.library;
package com.leocardz.linkpreview.sample.library;

import java.util.ArrayList;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.leocardz.link.preview.library
package com.leocardz.linkpreview.sample.library

import io.reactivex.Observable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.leocardz.link.preview.library
package com.leocardz.linkpreview.sample.library

/**
* @author dhruvaraj nagarajan
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.leocardz.link.preview.library.url;
package com.leocardz.linkpreview.sample.library.url;

import com.leocardz.link.preview.library.SearchUrls;
import com.leocardz.link.preview.library.TextCrawler;
import com.leocardz.linkpreview.sample.library.SearchUrls;
import com.leocardz.linkpreview.sample.library.TextCrawler;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.leocardz.link.preview.library.url;
package com.leocardz.linkpreview.sample.library.url;

import java.util.List;

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':app', ':library'
include ':app', ':linkpreview'

0 comments on commit a9a6f19

Please sign in to comment.