Skip to content

Commit

Permalink
Upgrade to android 10 (#5)
Browse files Browse the repository at this point in the history
* initial wip

* test organization

* fix bad package move

* intent is hit

* calling proper task

* successfully download default image

* panning

* feature parity

* cleanup

* resource cleanup

* actually async

* wip fix tests

* update tests
  • Loading branch information
ManApart authored Feb 6, 2022
1 parent 819a6f2 commit 1f7985d
Show file tree
Hide file tree
Showing 36 changed files with 304 additions and 510 deletions.
19 changes: 8 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.idea/
gradle/
*.zip
logs/
keys/
app/release/
.project
.settings/
.vscode/
app/.classpath
.cxx
local.properties
.idea/
2 changes: 1 addition & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/build
/build
58 changes: 33 additions & 25 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,39 +1,47 @@
apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}

android {
compileSdkVersion 25
compileSdk 32

defaultConfig {
applicationId "rak.pixellwp"
minSdkVersion 21
targetSdkVersion 25
versionCode 10
versionName "1.0.1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
minSdk 29
targetSdk 32
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
sourceSets {
test.java.srcDirs += 'src/test/kotlin'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:25.4.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:design:25.4.0'
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.9.0"

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

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.fasterxml.jackson.module:jackson-module-kotlin:2.11.1"
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0-RC")

testImplementation 'junit:junit:4.13.2'

androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package rak.pixellwp

import android.support.test.InstrumentationRegistry
import android.support.test.runner.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith
Expand All @@ -18,7 +18,7 @@ class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getTargetContext()
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("rak.pixellwp", appContext.packageName)
}
}
}
41 changes: 18 additions & 23 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="rak.pixellwp">

<uses-feature
Expand All @@ -13,18 +12,31 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application
android:name=".PixelLwpApp"
android:allowBackup="true"
android:icon="@mipmap/mirror_lake_logo_square"
android:icon="@mipmap/mirror_lake_logo"
android:usesCleartextTraffic="true"
android:label="@string/app_name"
android:roundIcon="@mipmap/mirror_lake_logo"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="AllowBackup,GoogleAppIndexingWarning">

android:theme="@style/Theme.PixelLwpApp">
<activity
android:name=".SetWallpaperActivity"
android:exported="true"
android:theme="@android:style/Theme.Material.Wallpaper.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".cycling.preferences.CyclingPreferenceActivity"
android:exported="true"
android:theme="@android:style/Theme.Material.Wallpaper.NoTitleBar" >
</activity>
<service
android:name=".cycling.CyclingWallpaperService"
android:enabled="true"
android:exported="true"
android:label="Cycling Wallpaper"
android:permission="android.permission.BIND_WALLPAPER" >
<intent-filter>
Expand All @@ -35,23 +47,6 @@
android:name="android.service.wallpaper"
android:resource="@xml/cycling_wallpaper" />
</service>

<activity
android:name=".cycling.preferences.CyclingPreferenceActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@android:style/Theme.Material.Wallpaper.NoTitleBar" >
</activity>

<activity
android:name=".SetWallpaperActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.Material.Wallpaper.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
28 changes: 0 additions & 28 deletions app/src/main/java/rak/pixellwp/PixelLwpApp.kt

This file was deleted.

12 changes: 7 additions & 5 deletions app/src/main/java/rak/pixellwp/SetWallpaperActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ class SetWallpaperActivity : Activity() {
finish()
}

private fun showCyclingWallpaper(){
private fun showCyclingWallpaper() {
val intent = Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER)
intent.putExtra(
WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT,
ComponentName(this, CyclingWallpaperService::class.java
))
WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT,
ComponentName(
this@SetWallpaperActivity, CyclingWallpaperService::class.java
)
)
startActivity(intent)
}
}
}
Loading

0 comments on commit 1f7985d

Please sign in to comment.