├── .idea ├── .name ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── compiler.xml ├── AndroidProjectSystem.xml ├── migrations.xml ├── deploymentTargetSelector.xml ├── vcs.xml ├── gradle.xml ├── runConfigurations.xml ├── misc.xml └── caches │ └── deviceStreaming.xml ├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── attrs.xml │ │ │ │ └── styles.xml │ │ │ ├── drawable │ │ │ │ ├── gradient_background.xml │ │ │ │ ├── card_background.xml │ │ │ │ ├── battery_display_background.xml │ │ │ │ └── button_background.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── layout │ │ │ │ ├── dialog_gradient_settings.xml │ │ │ │ ├── dialog_power_settings.xml │ │ │ │ ├── dialog_color_picker.xml │ │ │ │ ├── dialog_basic_settings.xml │ │ │ │ ├── dialog_text_settings.xml │ │ │ │ ├── dialog_size_settings.xml │ │ │ │ ├── dialog_stripe_settings.xml │ │ │ │ ├── dialog_appearance_settings.xml │ │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── donkor │ │ │ └── demo │ │ │ ├── BatteryView.kt │ │ │ └── MainActivity.kt │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── donkor │ │ │ └── demo │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── donkor │ │ └── demo │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── screenshot ├── 1.webp ├── 2.webp ├── 3.webp ├── 4.webp ├── 5.webp ├── 6.webp └── 7.webp ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── settings.gradle ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── gradlew └── README.md /.idea/.name: -------------------------------------------------------------------------------- 1 | BatteryView -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /screenshot/1.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Donkor798/BatteryView/HEAD/screenshot/1.webp -------------------------------------------------------------------------------- /screenshot/2.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Donkor798/BatteryView/HEAD/screenshot/2.webp -------------------------------------------------------------------------------- /screenshot/3.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Donkor798/BatteryView/HEAD/screenshot/3.webp -------------------------------------------------------------------------------- /screenshot/4.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Donkor798/BatteryView/HEAD/screenshot/4.webp -------------------------------------------------------------------------------- /screenshot/5.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Donkor798/BatteryView/HEAD/screenshot/5.webp -------------------------------------------------------------------------------- /screenshot/6.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Donkor798/BatteryView/HEAD/screenshot/6.webp -------------------------------------------------------------------------------- /screenshot/7.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Donkor798/BatteryView/HEAD/screenshot/7.webp -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Donkor798/BatteryView/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Donkor798/BatteryView/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Donkor798/BatteryView/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Donkor798/BatteryView/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Donkor798/BatteryView/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Donkor798/BatteryView/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 电池视图演示 4 | 5 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/AndroidProjectSystem.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip 7 | -------------------------------------------------------------------------------- /.idea/migrations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/deploymentTargetSelector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/gradient_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/test/java/com/donkor/demo/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.donkor.demo; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/card_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | gradlePluginPortal() 6 | } 7 | } 8 | 9 | dependencyResolutionManagement { 10 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 11 | repositories { 12 | google() 13 | mavenCentral() 14 | } 15 | } 16 | 17 | rootProject.name = "BatteryView" 18 | include ':app' 19 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/donkor/demo/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.donkor.demo; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/battery_display_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in E:\Users\Android\sdk1/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | 10 | 11 | # ========== Android / Gradle 生成产物 ========== 12 | # 忽略所有模块的 build 目录 13 | **/build/ 14 | 15 | # Gradle 本地缓存 16 | .gradle/ 17 | 18 | # NDK/外部构建输出 19 | .externalNativeBuild/ 20 | .cxx/ 21 | 22 | # AS 截图与临时输出 23 | captures/ 24 | 25 | # ========== 开发工具配置 ========== 26 | # Android Studio/IntelliJ 27 | .idea/ 28 | *.iml 29 | 30 | # VS Code 31 | .vscode/ 32 | 33 | # ========== 本地环境与敏感文件 ========== 34 | # 本地 SDK/NDK 路径 35 | local.properties 36 | 37 | # 签名与密钥(请勿提交) 38 | *.keystore 39 | *.jks 40 | keystore.properties 41 | 42 | # Google 服务(若使用,避免泄露) 43 | google-services.json 44 | 45 | # ========== 二进制与日志 ========== 46 | *.apk 47 | *.ap_ 48 | *.aab 49 | *.dex 50 | *.class 51 | *.log 52 | 53 | # ========== 操作系统文件 ========== 54 | .DS_Store 55 | Thumbs.db 56 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | id 'org.jetbrains.kotlin.android' 4 | } 5 | 6 | android { 7 | compileSdkVersion 35 8 | 9 | namespace 'com.donkor.demo' 10 | 11 | defaultConfig { 12 | applicationId "com.donkor.demo" 13 | minSdkVersion 24 14 | targetSdkVersion 35 15 | versionCode 1 16 | versionName "1.0" 17 | } 18 | 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | 26 | compileOptions { 27 | sourceCompatibility JavaVersion.VERSION_17 28 | targetCompatibility JavaVersion.VERSION_17 29 | } 30 | 31 | kotlinOptions { 32 | jvmTarget = '17' 33 | } 34 | } 35 | 36 | dependencies { 37 | implementation fileTree(dir: 'libs', include: ['*.jar']) 38 | implementation 'androidx.core:core-ktx:1.12.0' 39 | implementation 'androidx.appcompat:appcompat:1.6.1' 40 | testImplementation 'junit:junit:4.13.2' 41 | } 42 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | org.gradle.parallel=true 18 | 19 | # AndroidX package structure to make it clearer which packages are bundled with the 20 | # Android operating system, and which are packaged with your app's APK 21 | android.useAndroidX=true 22 | 23 | # Enables namespacing of each library's R class so that its R class includes only the 24 | # resources declared in the library itself and none from the library's dependencies, 25 | # thereby reducing the size of the R class for that library 26 | android.nonTransitiveRClass=true -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #6366F1 6 | #4F46E5 7 | #8B5CF6 8 | 9 | 10 | #F8FAFC 11 | #1E293B 12 | #FFFFFF 13 | #334155 14 | 15 | 16 | #0F172A 17 | #64748B 18 | #94A3B8 19 | #FFFFFF 20 | 21 | 22 | #E2E8F0 23 | 24 | 25 | #10B981 26 | #F59E0B 27 | #EF4444 28 | #3B82F6 29 | 30 | 31 | #6366F1 32 | #8B5CF6 33 | 34 | 35 | #1A000000 36 | 37 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 17 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_gradient_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 18 | 19 | 20 | 28 | 29 | 30 | 37 | 38 |