Skip to content

Commit 24cc91e

Browse files
committed
picture in picture UI polish
Change-Id: Ic96223188796d711e444cfe67c3f30af7b3c0688 Signed-off-by: AbdAlMoniem AlHifnawy <hifnawy_moniem@hotmail.com>
1 parent 80f7c11 commit 24cc91e

22 files changed

+440
-863
lines changed

.github/workflows/build_release_variant.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
echo $releaseApk
4848
echo ARTIFACT_NAME=$(basename $releaseApk) >> $GITHUB_ENV
4949
echo ARTIFACT_PATH=$releaseApk >> $GITHUB_ENV
50-
50+
5151
- name: Create Artifact ${{ env.ARTIFACT_NAME }}
5252
uses: actions/upload-artifact@v4
5353
with:

.github/workflows/codacy_security_scan.yml

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,41 @@
1-
# This workflow uses actions that are not certified by GitHub.
2-
# They are provided by a third-party and are governed by
3-
# separate terms of service, privacy policy, and support
4-
# documentation.
5-
6-
# This workflow checks out code, performs a Codacy security scan
7-
# and integrates the results with the
8-
# GitHub Advanced Security code scanning feature. For more information on
9-
# the Codacy security scan action usage and parameters, see
10-
# https://github.com/codacy/codacy-analysis-cli-action.
11-
# For more information on Codacy Analysis CLI in general, see
12-
# https://github.com/codacy/codacy-analysis-cli.
13-
141
name: Codacy Security Scan
152
run-name: ${{ github.workflow }} ${{ github.event.repository.updated_at}}
163

174
on:
185
push:
196
branches: [ "main" ]
207
pull_request:
21-
# The branches below must be a subset of the branches above
228
branches: [ "main" ]
239
schedule:
24-
- cron: '34 19 * * 5'
10+
- cron: '00 00 * * 5'
2511

2612
permissions:
2713
contents: read
2814

2915
jobs:
3016
codacy-security-scan:
17+
name: Codacy Security Scan
18+
runs-on: ubuntu-latest
19+
3120
permissions:
3221
contents: read # for actions/checkout to fetch code
3322
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
3423
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
35-
name: Codacy Security Scan
36-
runs-on: ubuntu-latest
24+
3725
steps:
38-
# Checkout the repository to the GitHub Actions runner
3926
- name: Checkout code
4027
uses: actions/checkout@v4
4128

42-
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
4329
- name: Run Codacy Analysis CLI
4430
uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b
4531
with:
46-
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
47-
# You can also omit the token and run the tools that support default configurations
4832
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
4933
verbose: true
5034
output: results.sarif
5135
format: sarif
52-
# Adjust severity of non-security issues
5336
gh-code-scanning-compat: true
54-
# Force 0 exit code to allow SARIF file generation
55-
# This will handover control about PR rejection to the GitHub side
5637
max-allowed-issues: 2147483647
5738

58-
# Upload the SARIF file generated in the previous step
5939
- name: Upload SARIF results file
6040
uses: github/codeql-action/upload-sarif@v3
6141
with:
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: CodeQL Security Scan
2+
run-name: ${{ github.workflow }} ${{ github.event.repository.updated_at}}
3+
4+
on:
5+
push:
6+
branches: [ "main" ]
7+
pull_request:
8+
branches: [ "main" ]
9+
schedule:
10+
- cron: "00 00 * * 5"
11+
12+
jobs:
13+
analyze:
14+
name: 'CodeQL Security Scan: Analyze (${{ matrix.language }})'
15+
runs-on: ubuntu-latest
16+
17+
permissions:
18+
security-events: write # required for all workflows
19+
packages: read # required to fetch internal or private CodeQL packs
20+
actions: read # only required for workflows in private repositories
21+
contents: read
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
include:
27+
- language: java-kotlin
28+
build-mode: manual
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
34+
- name: Create local.properties
35+
run: |
36+
echo ${{ secrets.SIGNING_KEY }} | base64 -d > release_keystore.jks
37+
38+
keystoreFile=$(realpath release_keystore.jks)
39+
40+
echo "keystoreFile: $keystoreFile"
41+
42+
echo "storePassword=${{ secrets.KEY_STORE_PASSWORD }}" >> local.properties
43+
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> local.properties
44+
echo "keyAlias=release_key" >> local.properties
45+
echo "storeFile=$keystoreFile" >> local.properties
46+
47+
- name: Setup Java
48+
uses: actions/setup-java@v4
49+
with:
50+
distribution: 'adopt'
51+
java-version: 21
52+
53+
- name: Validate Gradle Wrapper
54+
uses: gradle/wrapper-validation-action@v2.1.3
55+
56+
- name: Initialize CodeQL
57+
uses: github/codeql-action/init@v3
58+
with:
59+
languages: ${{ matrix.language }}
60+
build-mode: ${{ matrix.build-mode }}
61+
62+
- name: Build App
63+
if: matrix.build-mode == 'manual'
64+
run: bash gradlew :app:assembleDebug
65+
66+
- name: Get APK Name
67+
run: |
68+
apk=$(find app/build/outputs/apk/debug/*.apk)
69+
echo $apk
70+
echo APK_PATH=$apk >> $GITHUB_ENV
71+
72+
- name: Create Artifacts
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: build_artifacts
76+
path: ${{ env.APK_PATH }}
77+
if-no-files-found: error
78+
79+
- name: Perform CodeQL Analysis
80+
uses: github/codeql-action/analyze@v3
81+
with:
82+
category: "/language:${{matrix.language}}"

.github/workflows/publish_release_by_tag.yml

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
required: true
1010
type: choice
1111
options:
12+
- v2.0.1
1213
- v2.0.0
1314
- v1.8.0
1415
- v1.7.5
@@ -40,9 +41,7 @@ on:
4041
- v1.1.1
4142
- v1.1
4243
- v1.0
43-
44-
permissions: { }
45-
44+
permissions: {}
4645
jobs:
4746
publish-release-by-tag:
4847
name: Publish Release By Tag
@@ -52,7 +51,19 @@ jobs:
5251
uses: actions/checkout@v4
5352
with:
5453
ref: refs/tags/${{ inputs.releaseTag }}
54+
- name: Get Commit Message
55+
run: |
56+
gitTopLevel="$(git rev-parse --show-toplevel)"
57+
versionCodeFilter="\(versionCode\s\+=\s\+\)\([[:digit:]]\+\)"
58+
versionCode=$(git show "$tag:app/build.gradle.kts" | grep versionCode | sed -e "s/$versionCodeFilter/\2/" | xargs)
59+
60+
cat "$gitTopLevel/fastlane/metadata/android/en-US/changelogs/$versionCode.txt"
5561
62+
{
63+
echo 'COMMIT_MESSAGE<<EOF'
64+
cat "$gitTopLevel/fastlane/metadata/android/en-US/changelogs/$versionCode.txt"
65+
echo EOF
66+
} >> $GITHUB_ENV
5667
- name: Create local.properties
5768
run: |
5869
echo ${{ secrets.SIGNING_KEY }} | base64 -d > release_keystore.jks
@@ -65,49 +76,29 @@ jobs:
6576
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> local.properties
6677
echo "keyAlias=release_key" >> local.properties
6778
echo "storeFile=$keystoreFile" >> local.properties
68-
6979
- name: Setup Java
7080
uses: actions/setup-java@v4
7181
with:
7282
distribution: 'adopt'
7383
java-version: 21
74-
7584
- name: Validate Gradle Wrapper
7685
uses: gradle/wrapper-validation-action@v2.1.3
77-
7886
- name: Build APKs
7987
run: |
8088
ls
8189
bash gradlew app:assembleRelease
82-
8390
- name: Get Release APK Name
8491
run: |
8592
releaseApk=$(find app/build/outputs/apk/release/*.apk)
8693
echo $releaseApk
8794
echo ARTIFACT_NAME=$(basename $releaseApk) >> $GITHUB_ENV
8895
echo ARTIFACT_PATH=$releaseApk >> $GITHUB_ENV
89-
9096
- name: Create Artifact ${{ env.ARTIFACT_NAME }}
9197
uses: actions/upload-artifact@v4
9298
with:
9399
name: ${{ env.ARTIFACT_NAME }}
94100
path: ${{ env.ARTIFACT_PATH }}
95101
if-no-files-found: error
96-
97-
- name: Get Commit Message
98-
run: |
99-
gitTopLevel="$(git rev-parse --show-toplevel)"
100-
versionCodeFilter="\(versionCode\s\+=\s\+\)\([[:digit:]]\+\)"
101-
versionCode=$(git show "$tag:app/build.gradle.kts" | grep versionCode | sed -e "s/$versionCodeFilter/\2/" | xargs)
102-
103-
cat "$gitTopLevel/fastlane/metadata/android/en-US/changelogs/$versionCode.txt"
104-
105-
{
106-
echo 'COMMIT_MESSAGE<<EOF'
107-
cat "$gitTopLevel/fastlane/metadata/android/en-US/changelogs/$versionCode.txt"
108-
echo EOF
109-
} >> $GITHUB_ENV
110-
111102
- name: Publish Release ${{ github.ref_name }}
112103
uses: svenstaro/upload-release-action@v2
113104
with:
@@ -119,4 +110,4 @@ jobs:
119110
make_latest: true
120111
body: ${{ env.COMMIT_MESSAGE }}
121112
release_name: ${{ inputs.releaseTag }}
122-
repo_token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
113+
repo_token: ${{ secrets.RELEASE_GITHUB_TOKEN }}

.github/workflows/publish_release_on_tag.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ jobs:
1919
- name: Checkout ${{ github.ref }}
2020
uses: actions/checkout@v4
2121

22+
- name: Get Commit Message
23+
run: |
24+
gitTopLevel="$(git rev-parse --show-toplevel)"
25+
versionCodeFilter="\(versionCode\s\+=\s\+\)\([[:digit:]]\+\)"
26+
versionCode=$(git show "$tag:app/build.gradle.kts" | grep versionCode | sed -e "s/$versionCodeFilter/\2/" | xargs)
27+
28+
cat "$gitTopLevel/fastlane/metadata/android/en-US/changelogs/$versionCode.txt"
29+
30+
{
31+
echo 'COMMIT_MESSAGE<<EOF'
32+
cat "$gitTopLevel/fastlane/metadata/android/en-US/changelogs/$versionCode.txt"
33+
echo EOF
34+
} >> $GITHUB_ENV
35+
2236
- name: Create local.properties
2337
run: |
2438
echo ${{ secrets.SIGNING_KEY }} | base64 -d > release_keystore.jks
@@ -58,20 +72,6 @@ jobs:
5872
path: ${{ env.ARTIFACT_PATH }}
5973
if-no-files-found: error
6074

61-
- name: Get Commit Message
62-
run: |
63-
gitTopLevel="$(git rev-parse --show-toplevel)"
64-
versionCodeFilter="\(versionCode\s\+=\s\+\)\([[:digit:]]\+\)"
65-
versionCode=$(git show "$tag:app/build.gradle.kts" | grep versionCode | sed -e "s/$versionCodeFilter/\2/" | xargs)
66-
67-
cat "$gitTopLevel/fastlane/metadata/android/en-US/changelogs/$versionCode.txt"
68-
69-
{
70-
echo 'COMMIT_MESSAGE<<EOF'
71-
cat "$gitTopLevel/fastlane/metadata/android/en-US/changelogs/$versionCode.txt"
72-
echo EOF
73-
} >> $GITHUB_ENV
74-
7575
- name: Publish Release ${{ github.ref_name }}
7676
uses: svenstaro/upload-release-action@v2
7777
with:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ captures
77
.externalNativeBuild
88
.cxx
99
local.properties
10+
11+
**/*~

app/build.gradle.kts

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import com.android.build.api.dsl.ApplicationBuildType
22
import com.android.build.gradle.internal.api.BaseVariantOutputImpl
33
import java.io.FileInputStream
4-
import java.time.LocalDateTime
5-
import java.time.format.DateTimeFormatter
64
import java.util.Properties
75

86
/**
@@ -15,30 +13,6 @@ import java.util.Properties
1513
*/
1614
private val packageName = "com.hifnawy.caffeinate"
1715

18-
/**
19-
* A DateTimeFormatter for formatting the current date and time.
20-
*
21-
* This formatter is used to generate a string representation of the current date and time
22-
* in the format "dd/MMM/yyyy_hh:mm:ss.S a". This format is used to log the start of the build
23-
* process.
24-
*
25-
* @see LocalDateTime
26-
* @see DateTimeFormatter
27-
*/
28-
private val dateTimeFormatter = DateTimeFormatter.ofPattern("dd/MMM/yyyy_hh:mm:ss.S a")
29-
30-
/**
31-
* The current date and time at the start of the build process.
32-
*
33-
* This field is used to generate a string representation of the current date and time
34-
* in the format "dd/MMM/yyyy_hh:mm:ss.S a". This format is used to log the start of the build
35-
* process.
36-
*
37-
* @see LocalDateTime
38-
* @see DateTimeFormatter
39-
*/
40-
private val buildDateAndTime = LocalDateTime.now()
41-
4216
/**
4317
* The file object representing the local.properties file in the root project directory.
4418
*
@@ -65,8 +39,6 @@ private var isDebuggingEnabled = false
6539
*/
6640
private var isSigningConfigEnabled = false
6741

68-
project.logger.lifecycle("INFO: Build Started at: ${buildDateAndTime.format(dateTimeFormatter)}")
69-
7042
plugins {
7143
alias(libs.plugins.androidApplication)
7244
alias(libs.plugins.jetbrainsKotlinAndroid)
@@ -115,12 +87,10 @@ android {
11587
minSdk = 24
11688
compileSdk = 35
11789
targetSdk = 35
118-
versionCode = 31
119-
versionName = "2.0.0"
90+
versionCode = 32
91+
versionName = "2.0.1"
12092

12193
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
122-
123-
buildConfigField("String", "BUILD_DATE_AND_TIME", "\"${buildDateAndTime.format(dateTimeFormatter)}\"")
12494
}
12595

12696
sourceSets.forEach { sourceSet ->
@@ -240,6 +210,7 @@ dependencies {
240210
implementation(libs.assent)
241211
implementation(libs.gson)
242212
implementation(libs.materialNumberPicker)
213+
implementation(libs.circulardurationview)
243214

244215
testImplementation(libs.junit)
245216
androidTestImplementation(libs.androidxJunit)

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
2828
android:exported="true"
2929
android:launchMode="singleTask"
30-
android:supportsPictureInPicture="true"
31-
android:resizeableActivity="true">
30+
android:resizeableActivity="true"
31+
android:supportsPictureInPicture="true">
3232
<intent-filter>
3333
<action android:name="android.intent.action.MAIN" />
3434
<action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" />

0 commit comments

Comments
 (0)