Skip to content

Commit

Permalink
Create App
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaiserdragon2 committed Nov 5, 2023
1 parent 486852f commit 630ce57
Show file tree
Hide file tree
Showing 36 changed files with 786 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
69 changes: 69 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
}

android {
namespace = "de.kaiserdragon.weathershortcut"
compileSdk = 33

defaultConfig {
applicationId = "de.kaiserdragon.weathershortcut"
minSdk = 24
targetSdk = 33
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.3"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}

dependencies {

implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1")
implementation("androidx.activity:activity-compose:1.7.0")
implementation(platform("androidx.compose:compose-bom:2023.03.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")
}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
30 changes: 30 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.WeatherShortcut"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true"
android:autoRemoveFromRecents="true"
android:launchMode="singleTask"
android:label="@string/app_name"
android:theme="@style/Theme.WeatherShortcut">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Binary file added app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions app/src/main/java/de/kaiserdragon/weathershortcut/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package de.kaiserdragon.weathershortcut;
import android.content.ComponentName
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.widget.Button
import androidx.activity.ComponentActivity


class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val shortcutIntent = Intent().apply {
action = Intent.ACTION_VIEW
data = Uri.parse("https://...") // Replace with the correct URL
component = ComponentName.unflattenFromString("com.google.android.googlequicksearchbox/com.google.android.apps.search.weather.WeatherExportedActivity")
}
startActivity(shortcutIntent)
finish()
}
}



170 changes: 170 additions & 0 deletions app/src/main/res/drawable/ic_launcher_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
32 changes: 32 additions & 0 deletions app/src/main/res/drawable/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="48"
android:viewportHeight="48">
<group android:scaleX="0.570625"
android:scaleY="0.570625"
android:translateX="10.305"
android:translateY="10.305">
<path
android:strokeWidth="1"
android:pathData="M27.964,40.536 L24,44.5l-6.004,-6.004H9.504V30.004h0L3.5,24l6.004,-6.004V9.504h8.491L24,3.5l6.004,6.004h8.491v8.491L44.5,24l-3.011,3.011"
android:strokeLineJoin="round"
android:fillColor="#e5c600"
android:strokeColor="#e5c600"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="m29.808,36.764a7.727,7.727 0,1 1,6.705 3.887l-12.037,-0.163a4.636,4.636 0,0 1,0 -9.273l4.505,-0.014"
android:strokeLineJoin="round"
android:fillColor="#ffdbdbdb"
android:strokeColor="#ffdbdbdb"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="M20.064,19.587H26.28a6.248,6.248 0,0 1,-6.095 6.398q-0.06,0.002 -0.121,0.002a6.4,6.4 0,0 1,0 -12.799,6.302 6.302,0 0,1 3.173,0.842"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#ffffff"
android:strokeLineCap="round"/>
</group>
</vector>
16 changes: 16 additions & 0 deletions app/src/main/res/drawable/ic_launcher_monochrome.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:pathData="M24,3.5L17.996,9.504L9.504,9.504L9.504,17.996L3.5,24L9.504,30.004L9.504,38.496L17.996,38.496L24,44.5L27.471,41.029L24.477,40.988C22.806,40.988 21.489,40.343 20.625,39.371C19.761,38.399 19.34,37.122 19.34,35.852C19.34,34.581 19.761,33.304 20.625,32.332C21.489,31.36 22.805,30.715 24.475,30.715L28.662,30.701C29.062,29.342 29.722,28.076 30.711,27.092C31.922,25.888 33.502,25.043 35.23,24.762C36.959,24.48 38.835,24.761 40.639,25.807C41.08,26.062 41.483,26.346 41.85,26.65L44.5,24L38.496,17.996L38.496,9.504L30.004,9.504L24,3.5zM20.059,12.688A0.5,0.5 0,0 1,20.063 12.688C21.264,12.683 22.445,12.996 23.486,13.596A0.5,0.5 0,0 1,23.67 14.279A0.5,0.5 0,0 1,22.986 14.463C22.098,13.951 21.091,13.683 20.066,13.688C16.833,13.73 14.244,16.352 14.244,19.586C14.244,22.821 16.835,25.446 20.07,25.486C20.104,25.486 20.138,25.485 20.172,25.484C23.179,25.412 25.507,23.031 25.693,20.086L20.064,20.086A0.5,0.5 0,0 1,19.564 19.586A0.5,0.5 0,0 1,20.064 19.086L26.279,19.086A0.5,0.5 0,0 1,26.779 19.574C26.869,23.294 23.917,26.394 20.197,26.484C20.154,26.486 20.11,26.486 20.066,26.486A0.5,0.5 0,0 1,20.059 26.486C16.287,26.439 13.244,23.357 13.244,19.586C13.244,15.815 16.287,12.735 20.059,12.688zM36.525,25.646C36.134,25.643 35.748,25.674 35.371,25.736C33.862,25.986 32.487,26.736 31.416,27.801C29.274,29.931 28.388,33.279 30.242,36.516A0.5,0.5 0,0 1,30.057 37.197A0.5,0.5 0,0 1,29.375 37.012C28.359,35.238 28.094,33.402 28.357,31.703L24.479,31.715A0.5,0.5 0,0 0,24.477 31.715C23.056,31.715 22.054,32.23 21.373,32.996C20.692,33.762 20.34,34.804 20.34,35.852C20.34,36.9 20.692,37.941 21.373,38.707C22.054,39.473 23.056,39.988 24.477,39.988A0.5,0.5 0,0 1,24.482 39.988L28.459,40.041L41.139,27.361C40.832,27.115 40.501,26.883 40.137,26.672C38.927,25.971 37.7,25.655 36.525,25.646z"
android:strokeLineJoin="round"
android:fillColor="#010101"
android:strokeLineCap="round"/>
<path
android:pathData="m29.808,36.764a7.727,7.727 0,1 1,6.705 3.887l-12.037,-0.163a4.636,4.636 0,0 1,0 -9.273l4.505,-0.014"
android:strokeLineJoin="round"
android:fillColor="#000000"
android:strokeLineCap="round"/>
</vector>
6 changes: 6 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_monochrome" />
</adaptive-icon>
6 changes: 6 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_monochrome" />
</adaptive-icon>
Binary file added app/src/main/res/mipmap-hdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file added app/src/main/res/mipmap-mdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file added app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file added app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file added app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 630ce57

Please sign in to comment.