Skip to content

Implementation changes and extensions #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

76 changes: 62 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.kotlin.kapt'
id("org.jetbrains.dokka") version "$dokkaVersion"
}

android {
compileSdk 32
compileSdk 34

defaultConfig {
applicationId "ch.tiim.markdown_widget"
minSdk 24
targetSdk 32
targetSdk 34
versionCode 7
versionName "0.1.5-pre.1"

Expand All @@ -24,37 +28,81 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}
kotlin {
jvmToolchain(17)
}

buildFeatures {
viewBinding true
}
packagingOptions {
resources.excludes.add("META-INF/*")
}
namespace 'ch.tiim.markdown_widget'

testOptions {
unitTests.returnDefaultValues = true
}
}

android.applicationVariants.all { variant ->
variant.outputs.all {
android.applicationVariants.configureEach { variant ->
variant.outputs.configureEach {
outputFileName = "markdown-widget-${variant.name}-${variant.versionName}.apk"
}
}

apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.dagger.hilt.android'

kapt {
correctErrorTypes true
}

dependencies {
// implementation 'com.android.support:design:28.0.0'
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation "com.vladsch.flexmark:flexmark-all:$flexmarkVersion"
implementation 'androidx.webkit:webkit:1.11.0'
implementation 'androidx.activity:activity-ktx:1.9.0'

implementation 'com.vladsch.flexmark:flexmark-all:0.64.0'
implementation 'androidx.test:monitor:1.6.1'
implementation 'androidx.test:runner:1.5.2'// if you use the support libraries
implementation 'com.google.ar:core:1.43.0'
implementation "com.google.dagger:dagger-android:$daggerVersion"
implementation "com.google.dagger:dagger-android-support:$daggerVersion"
kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
implementation "com.google.dagger:hilt-android:$hiltAndroidVersion"
kapt "com.google.dagger:hilt-compiler:$hiltAndroidVersion"
implementation("cc.ekblad.konbini:konbini:0.1.3")

dokkaPlugin("org.jetbrains.dokka:android-documentation-plugin:$dokkaVersion")

// unit tests
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
testImplementation "org.mockito.kotlin:mockito-kotlin:5.3.1"
testImplementation "org.jsoup:jsoup:1.17.2"
// testImplementation "com.google.dagger:dagger:$daggerVersion"
// kaptTest "com.google.dagger:dagger-android-processor:$daggerVersion"
// kaptTest "com.google.dagger:dagger-compiler:$daggerVersion"
testImplementation "org.robolectric:robolectric:$robolectricVersion"
testImplementation "com.google.dagger:hilt-android-testing:$hiltAndroidVersion"
kaptTest "com.google.dagger:hilt-compiler:$hiltAndroidVersion"
testImplementation("cc.ekblad.konbini:konbini:0.1.3")

// android integration tests
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation "com.google.dagger:hilt-android-testing:$hiltAndroidVersion"
kaptAndroidTest "com.google.dagger:hilt-compiler:$hiltAndroidVersion"
}
5 changes: 5 additions & 0 deletions app/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
flexmarkVersion = 0.64.8
daggerVersion = 2.51.1
dokkaVersion = 1.9.20
hiltAndroidVersion=2.51.1
robolectricVersion=4.12.2
1 change: 1 addition & 0 deletions app/robolectric.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
application = HiltTestApplication::class
26 changes: 21 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ch.tiim.markdown_widget">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".Main"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MarkdownWidget">
android:theme="@style/Theme.MarkdownWidget"
android:usesCleartextTraffic="true" >

<meta-data android:name="android.webkit.WebView.EnableSafeBrowsing"
android:value="false" />

<receiver
android:name=".MarkdownFileWidget"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="android.appwidget.action.APPWIDGET_OPTIONS_CHANGED" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/markdown_file_widget_info" />
<meta-data android:name="LauncherMetadata.Requirements.Scrollable"
<meta-data
android:name="LauncherMetadata.Requirements.Scrollable"
android:value="true" />
</receiver>

Expand All @@ -30,15 +40,21 @@
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>

<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<action android:name="android.intent.action.EDIT" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<service
android:name=".MarkdownWidgetService"
android:permission="android.permission.BIND_REMOTEVIEWS" />

</application>
</manifest>
Loading