Initial commit: Minimal Flutter timer with push notifications

This commit is contained in:
Developer
2026-01-09 00:20:38 +08:00
commit 2a2f718a4b
26 changed files with 1050 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.timer">
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<application
android:label="Таймер"
android:name="${applicationName}"
android:icon="@drawable/ic_launcher_foreground">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<receiver
android:name="com.dexterous.flutterlocalnotifications.NotificationActionReceiver"
android:exported="false">
<intent-filter>
<action android:name="ACTION_NOTIFICATION_TRIGGERED" />
</intent-filter>
</receiver>
</application>
</manifest>

View File

@@ -0,0 +1,24 @@
package com.example.timer;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Launch Flutter activity using reflection
try {
Class<?> flutterActivityClass = Class.forName("io.flutter.embedding.android.FlutterActivity");
Intent intent = new Intent(this, flutterActivityClass);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
} catch (ClassNotFoundException e) {
// FlutterActivity not found - handle gracefully
e.printStackTrace();
}
finish();
}
}

View File

@@ -0,0 +1,16 @@
<?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="#FFFFFF"
android:pathData="M54,30
A24,24 0 1,1 53.99,30
M54,36
A18,18 0 1,0 54.01,36"/>
<path
android:fillColor="#FFFFFF"
android:pathData="M54,42 L54,54 L66,54"/>
</vector>

View File

@@ -0,0 +1,5 @@
<?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"/>
</adaptive-icon>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="#6200EE"
android:pathData="M0,0h48v48h-48z"/>
<path
android:fillColor="#FFFFFF"
android:pathData="M24,8
A16,16 0 1,1 23.99,8
M24,12
A12,12 0 1,0 24.01,12"/>
<path
android:fillColor="#FFFFFF"
android:strokeWidth="2"
android:pathData="M24,16 L24,24 L32,24"/>
</vector>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="#6200EE"
android:pathData="M0,0h48v48h-48z"/>
<path
android:fillColor="#FFFFFF"
android:pathData="M24,8
A16,16 0 1,1 23.99,8
M24,12
A12,12 0 1,0 24.01,12"/>
<path
android:fillColor="#FFFFFF"
android:strokeWidth="2"
android:pathData="M24,16 L24,24 L32,24"/>
</vector>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="#6200EE"
android:pathData="M0,0h48v48h-48z"/>
<path
android:fillColor="#FFFFFF"
android:pathData="M24,8
A16,16 0 1,1 23.99,8
M24,12
A12,12 0 1,0 24.01,12"/>
<path
android:fillColor="#FFFFFF"
android:strokeWidth="2"
android:pathData="M24,16 L24,24 L32,24"/>
</vector>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="#6200EE"
android:pathData="M0,0h48v48h-48z"/>
<path
android:fillColor="#FFFFFF"
android:pathData="M24,8
A16,16 0 1,1 23.99,8
M24,12
A12,12 0 1,0 24.01,12"/>
<path
android:fillColor="#FFFFFF"
android:strokeWidth="2"
android:pathData="M24,16 L24,24 L32,24"/>
</vector>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="#6200EE"
android:pathData="M0,0h48v48h-48z"/>
<path
android:fillColor="#FFFFFF"
android:pathData="M24,8
A16,16 0 1,1 23.99,8
M24,12
A12,12 0 1,0 24.01,12"/>
<path
android:fillColor="#FFFFFF"
android:strokeWidth="2"
android:pathData="M24,16 L24,24 L32,24"/>
</vector>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<color name="ic_launcher_background">#6200EE</color>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">@android:color/white</item>
</style>
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">@android:color/white</item>
</style>
</resources>