Skip to content
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

redesign application ui #132

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d8dac06
feat: change ui
icai May 16, 2024
6e403ec
feat: i18n chinese
icai May 16, 2024
0378562
feat: theme color extend
icai May 17, 2024
cb4b905
feat: change ui
icai May 19, 2024
ce85035
Merge remote-tracking branch 'fork/main'
icai May 19, 2024
68868f3
fix
icai May 19, 2024
8160369
feat: SystemBar
icai May 19, 2024
2eabb32
feat: searchbar
icai May 19, 2024
65c1f62
feat: change ui
icai May 20, 2024
ab1194d
feat: change ui
icai May 20, 2024
112de66
feat: ListBox
icai May 20, 2024
b9cba7f
Merge remote-tracking branch 'fork/main'
icai May 20, 2024
9d8e37e
fix
icai May 20, 2024
aada9f4
fix
icai May 20, 2024
c27fb0d
fix: containerColor
icai May 20, 2024
05718af
feat: fun Modifier.bottomBorder
icai May 20, 2024
44ca333
fix
icai May 21, 2024
7a6f0a7
feat: Modifier fun
icai May 21, 2024
2926dc2
feat: overScroll effect
icai May 21, 2024
98d2390
feat: border style
icai May 22, 2024
b6714c6
feat: bottomBorder for list
icai May 22, 2024
e0138c2
feat: switch size
icai May 22, 2024
06f26ed
Merge branch 'forkmain'
icai Jun 16, 2024
ff95ac0
fix: review improvement
icai Jun 28, 2024
5522699
feat: add IndexedLazyColumn compose
icai Jun 28, 2024
77a187b
feat: alphabet index compose
icai Jul 3, 2024
49dfd14
fix
icai Jul 3, 2024
56b57cc
feat: dialog background
icai Jul 3, 2024
aee59e1
revert: undo iconImage column
icai Jul 19, 2024
d38206f
fix: toke near zero shaking bug
icai Jul 22, 2024
a6709c7
feat: LazyAlphabetIndexRow compose
icai Jul 22, 2024
22c483f
feat: LazyAlphabetIndexColumn bug
icai Jul 25, 2024
10d5e43
fix: LazyAlphabetIndexRow bug
icai Jul 28, 2024
8d479fa
fix: reset identityHash
icai Jul 30, 2024
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
6 changes: 3 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ android {
compileSdk = 34
defaultConfig {
applicationId = "com.pilot51.voicenotify"
minSdk = 21
minSdk = 24
pilot51 marked this conversation as resolved.
Show resolved Hide resolved
targetSdk = 34
versionName = "1.4.0-beta"
versionCode = 29
Expand Down Expand Up @@ -106,7 +106,7 @@ android {
generateLocaleConfig = true
}

applicationVariants.all {
applicationVariants.all {
outputs.all {
this as BaseVariantOutputImpl
outputFileName = "VoiceNotify_v${defaultConfig.versionName}-${name}_$gitCommitHash.apk"
Expand All @@ -120,7 +120,7 @@ dependencies {
implementation("androidx.compose.material3:material3:1.3.0-beta01")
implementation("androidx.compose.material:material-icons-extended-android:1.6.7")
implementation("androidx.compose.ui:ui-tooling-preview:1.6.7")
debugImplementation("androidx.compose.ui:ui-tooling:1.6.7")
debugImplementation("androidx.compose.ui:ui-tooling:1.6.7")
implementation("androidx.navigation:navigation-compose:2.7.7")
implementation("androidx.glance:glance-appwidget:1.0.0")
implementation("androidx.preference:preference-ktx:1.2.1")
Expand Down
106 changes: 56 additions & 50 deletions app/schemas/com.pilot51.voicenotify.db.AppDatabase/1.json
pilot51 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,52 +1,58 @@
{
"formatVersion": 1,
"database": {
"version": 1,
"identityHash": "1d73ff7d95b81686c7f6de6408254734",
"entities": [
{
"tableName": "apps",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `package` TEXT NOT NULL, `name` TEXT NOT NULL COLLATE NOCASE, `is_enabled` INTEGER)",
"fields": [
{
"fieldPath": "id",
"columnName": "_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "packageName",
"columnName": "package",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "label",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "isEnabled",
"columnName": "is_enabled",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"_id"
"formatVersion": 1,
"database": {
"version": 1,
"identityHash": "10896f7f2edd7a5e91670d81d13c009c",
"entities": [
{
"tableName": "apps",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `package` TEXT NOT NULL, `name` TEXT NOT NULL COLLATE NOCASE, `is_enabled` INTEGER, `sortLetter` TEXT NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "packageName",
"columnName": "package",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "label",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "isEnabled",
"columnName": "is_enabled",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "sortLetter",
"columnName": "sortLetter",
"affinity": "TEXT",
"notNull": true
}
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '1d73ff7d95b81686c7f6de6408254734')"
]
}
}
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"_id"
]
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '10896f7f2edd7a5e91670d81d13c009c')"
]
}
}
12 changes: 9 additions & 3 deletions app/schemas/com.pilot51.voicenotify.db.AppDatabase/2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"formatVersion": 1,
"database": {
"version": 2,
"identityHash": "ae7f6f1a5c600a07f3be1875546a6874",
"identityHash": "b22a90d85b20cfe9a8ddd00924d4ac34",
"entities": [
{
"tableName": "apps",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`package` TEXT NOT NULL, `name` TEXT NOT NULL COLLATE NOCASE, `is_enabled` INTEGER, PRIMARY KEY(`package`))",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`package` TEXT NOT NULL, `name` TEXT NOT NULL COLLATE NOCASE, `is_enabled` INTEGER, `sortLetter` TEXT NOT NULL, PRIMARY KEY(`package`))",
"fields": [
{
"fieldPath": "packageName",
Expand All @@ -25,6 +25,12 @@
"columnName": "is_enabled",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "sortLetter",
"columnName": "sortLetter",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
Expand Down Expand Up @@ -202,7 +208,7 @@
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'ae7f6f1a5c600a07f3be1875546a6874')"
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'b22a90d85b20cfe9a8ddd00924d4ac34')"
]
}
}
117 changes: 56 additions & 61 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,65 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2011-2023 Mark Injerd
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="internalOnly">

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
<application
android:name=".VNApplication"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/Theme">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

http://www.apache.org/licenses/LICENSE-2.0
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="internalOnly">
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<uses-feature
android:name="android.hardware.bluetooth"
android:required="false" />
<application
android:name=".VNApplication"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
android:theme="@android:style/Theme.Material.NoActionBar">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".Service"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"
android:exported="true">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
</intent-filter>
</service>
<receiver
android:name=".AppWidgetReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/appwidget_info" />
</receiver>
</application>
</manifest>
<receiver
android:name=".AppWidgetReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/appwidget_info" />
</receiver>

<service
android:name=".Service"
android:exported="true"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
</intent-filter>
</service>
</application>
<uses-feature
pilot51 marked this conversation as resolved.
Show resolved Hide resolved
android:name="android.hardware.bluetooth"
android:required="false" />

<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission
android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.VIBRATE" />

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

</manifest>
50 changes: 50 additions & 0 deletions app/src/main/java/com/pilot51/voicenotify/AlphabetIndexHelper.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package com.pilot51.voicenotify

import android.icu.text.AlphabeticIndex
import android.os.Build
import android.os.LocaleList
import androidx.annotation.RequiresApi
import java.util.Locale

/**
* Help to get a alphabetic of a char.
*
* Use:
* ```
* val sectionName = AlphabeticIndexHelper.computeSectionName(Locale.CHINESE, "神")
* log: sectionName = "S"
* ```
*/
object AlphabeticIndexHelper {
@JvmStatic
fun computeSectionName(c: CharSequence): String {
return computeSectionName(Locale.getDefault(), c)
}

@JvmStatic
fun computeCNSectionName(c: CharSequence): String = computeSectionName(
LocaleList(Locale.CHINESE, Locale.SIMPLIFIED_CHINESE), c
)

@JvmStatic
fun computeSectionName(locale: Locale, c: CharSequence): String {
return AlphabeticIndex<Any>(locale).buildImmutableIndex().let {
it.getBucket(it.getBucketIndex(c)).label
}
}

@JvmStatic
fun computeSectionName(localeList: LocaleList, c: CharSequence): String {
val primaryLocale = if (localeList.isEmpty) Locale.ENGLISH else localeList[0]
val ai = AlphabeticIndex<Any>(primaryLocale)
for (index in 1 until localeList.size()) {
ai.addLabels(localeList[index])
}
return ai.buildImmutableIndex().let {
it.getBucket(it.getBucketIndex(c)).label
}
}

@JvmStatic
fun isStartsWithDigit(c: CharSequence): Boolean = Character.isDigit(c[0])
}
Loading