Skip to content

Commit

Permalink
Merge pull request #7 from sschueller/refactor
Browse files Browse the repository at this point in the history
API Update and refactor
  • Loading branch information
sschueller authored Aug 1, 2020
2 parents 980fa3d + c48c019 commit 9a31273
Show file tree
Hide file tree
Showing 32 changed files with 630 additions and 805 deletions.
72 changes: 60 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@ repositories {
}

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
compileSdkVersion 29
buildToolsVersion '29.0.3'

useLibrary 'android.test.runner'
useLibrary 'android.test.base'
useLibrary 'android.test.mock'

defaultConfig {
applicationId "net.schueller.instarepost"
minSdkVersion 19
targetSdkVersion 28
versionCode 174
versionName "1.7.4"
targetSdkVersion 29
versionCode 200
versionName "2.0.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
Expand All @@ -34,9 +39,16 @@ android {
applicationVariants.all { variant ->
variant.resValue "string", "versionName", variant.versionName
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
}

dependencies {
implementation 'androidx.preference:preference:1.1.1'


// if Java use this. If using Kotlin do NOT use this.
annotationProcessor "com.github.Raizlabs.DBFlow:dbflow-processor:${dbflow_version}"
Expand All @@ -50,17 +62,53 @@ dependencies {

implementation fileTree(include: ['*.jar'], dir: 'libs')

testImplementation 'junit:junit:4.12'

implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.github.sschueller:android-ClipboardManagerCompat:-SNAPSHOT'
implementation 'org.jsoup:jsoup:1.12.1'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.github.paolorotolo:appintro:4.1.0'
implementation 'com.joanzapata.iconify:android-iconify-fontawesome:2.2.2' // (v4.5)
implementation("com.squareup.okhttp3:okhttp:4.3.1")
implementation('com.squareup.okhttp3:okhttp:4.8.0')

// Testing-only dependencies
testImplementation 'junit:junit:4.13'

// Core library
androidTestImplementation 'androidx.test:core:1.2.0'

// AndroidJUnitRunner and JUnit Rules
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'

// Assertions
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.ext:truth:1.2.0'
androidTestImplementation 'com.google.truth:truth:1.0.1'

// Espresso dependencies
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-accessibility:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-web:3.2.0'
androidTestImplementation 'androidx.test.espresso.idling:idling-concurrent:3.2.0'

// The following Espresso dependency can be either "implementation"
// or "androidTestImplementation", depending on whether you want the
// dependency to appear on your APK's compile classpath or the test APK
// classpath.
androidTestImplementation 'androidx.test.espresso:espresso-idling-resource:3.2.0'

testImplementation 'androidx.test:core:1.2.0'
testImplementation 'androidx.test.ext:junit:1.1.1'
testImplementation 'org.robolectric:robolectric:4.3.1'
testImplementation 'androidx.test.espresso:espresso-core:3.2.0'
testImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
testImplementation 'androidx.test.ext:truth:1.2.0'

}
40 changes: 21 additions & 19 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,29 @@
package="net.schueller.instarepost">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Get permission for reliable local dispatching on non-Google Play devices. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />

<application
android:largeHeap="true"
android:theme="@style/Theme.AppCompat"
android:name=".InstarepostApplication"
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:name="net.schueller.instarepost.InstarepostApplication"
android:largeHeap="true"
android:networkSecurityConfig="@xml/network_security_config"
android:fullBackupContent="true">
android:supportsRtl="true">
<activity
android:name=".activities.SettingsActivity"
android:label="@string/title_activity_settings" />

<uses-library android:name="org.apache.http.legacy" android:required="false"/>
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />

<service android:name=".services.CBWatcherService" />

Expand All @@ -32,40 +37,37 @@
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />

<category android:name="android.intent.category.DEFAULT" />

<data android:mimeType="text/plain" />
</intent-filter>
</activity>

<receiver android:name=".receivers.RepostReceiver" />

<receiver android:name=".receivers.ShareReceiver" />

<receiver android:name=".receivers.DownloadReceiver"
android:exported="true" >
<receiver
android:name=".receivers.DownloadReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.DOWNLOAD_COMPLETE"/>
<action android:name="android.intent.action.DOWNLOAD_COMPLETE" />
</intent-filter>
</receiver>

<activity
android:name=".activities.SettingsActivity"
android:label="@string/title_activity_settings"/>

<activity android:name="net.schueller.instarepost.activities.IntroActivity"
android:name=".activities.IntroActivity"
android:label="@string/app_intro" />

<!-- content intent provider to share files outside app -->
<provider
android:name="android.support.v4.content.FileProvider"
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
android:resource="@xml/provider_paths" />
</provider>

</application>

</manifest>
4 changes: 4 additions & 0 deletions app/src/main/java/net/schueller/instarepost/AppDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ public class AppDatabase {

@Migration(version = 2, database = AppDatabase.class)
public static class Migration2 extends AlterTableMigration<Post> {

public Migration2(Class<Post> table) {
super(table);
}

@Override
public void onPreMigrate() {
addColumn(SQLiteType.INTEGER, "userId");
Expand Down Expand Up @@ -150,9 +152,11 @@ public void migrate(DatabaseWrapper database) {

@Migration(version = 6, database = AppDatabase.class)
public static class Migration4 extends AlterTableMigration<Post> {

public Migration4(Class<Post> table) {
super(table);
}

@Override
public void onPreMigrate() {
addColumn(SQLiteType.INTEGER, "status");
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@

import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.github.paolorotolo.appintro.AppIntro2;
import com.github.paolorotolo.appintro.AppIntroFragment;

import net.schueller.instarepost.R;

public class IntroActivity extends AppIntro2 {

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down
Loading

0 comments on commit 9a31273

Please sign in to comment.