-
Notifications
You must be signed in to change notification settings - Fork 66
redesign application ui #132
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
Open
icai
wants to merge
34
commits into
pilot51:main
Choose a base branch
from
icai:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 23 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
d8dac06
feat: change ui
icai 6e403ec
feat: i18n chinese
icai 0378562
feat: theme color extend
icai cb4b905
feat: change ui
icai ce85035
Merge remote-tracking branch 'fork/main'
icai 68868f3
fix
icai 8160369
feat: SystemBar
icai 2eabb32
feat: searchbar
icai 65c1f62
feat: change ui
icai ab1194d
feat: change ui
icai 112de66
feat: ListBox
icai b9cba7f
Merge remote-tracking branch 'fork/main'
icai 9d8e37e
fix
icai aada9f4
fix
icai c27fb0d
fix: containerColor
icai 05718af
feat: fun Modifier.bottomBorder
icai 44ca333
fix
icai 7a6f0a7
feat: Modifier fun
icai 2926dc2
feat: overScroll effect
icai 98d2390
feat: border style
icai b6714c6
feat: bottomBorder for list
icai e0138c2
feat: switch size
icai 06f26ed
Merge branch 'forkmain'
icai ff95ac0
fix: review improvement
icai 5522699
feat: add IndexedLazyColumn compose
icai 77a187b
feat: alphabet index compose
icai 49dfd14
fix
icai 56b57cc
feat: dialog background
icai aee59e1
revert: undo iconImage column
icai d38206f
fix: toke near zero shaking bug
icai a6709c7
feat: LazyAlphabetIndexRow compose
icai 22c483f
feat: LazyAlphabetIndexColumn bug
icai 10d5e43
fix: LazyAlphabetIndexRow bug
icai 8d479fa
fix: reset identityHash
icai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 56 additions & 50 deletions
106
app/schemas/com.pilot51.voicenotify.db.AppDatabase/1.json
pilot51 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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')" | ||
| ] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.
Outdated
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
50
app/src/main/java/com/pilot51/voicenotify/AlphabetIndexHelper.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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]) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.