Skip to content

Commit

Permalink
Merge pull request #54 from tomfong/post-v2.8.0-dev
Browse files Browse the repository at this point in the history
3.0.0
  • Loading branch information
tomfong authored Sep 23, 2022
2 parents 7cf23c7 + 0ae5f16 commit 07b99da
Show file tree
Hide file tree
Showing 43 changed files with 4,018 additions and 3,494 deletions.
26 changes: 10 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,9 @@ You are welcomed to help translate the app into more languages (refer to this <a

### Build the project (Android)

1. Run ```npm install``` to install all dependencies
2. Run ```npm run sync``` and ```npm run copy:an```
3. In ```android/app/src/main/res/values/styles.xml```, change

```xml
<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
<item name="android:background">#00a5aa</item>
</style>
```
1. Run ```npm install``` to install all dependencies.
2. Run ```npm run build:an``` or ```npm run build:ios``` (for first time).
3. Run ```npm run sync``` and ```npm run copy:an``` or ```npm run copy:ios```.

### Contributors

Expand All @@ -128,16 +122,16 @@ Thank you the following contributors who have made the app better!

```sh
Ionic CLI : 6.20.1
Ionic Framework : @ionic/angular 6.2.7
@angular-devkit/build-angular : 13.3.9
Ionic Framework : @ionic/angular 6.2.8
@angular-devkit/build-angular : 14.2.3
@angular-devkit/schematics : 13.3.9
@angular/cli : 13.3.9
@angular/cli : 14.2.3
@ionic/angular-toolkit : 6.1.0

Capacitor CLI : 3.8.0
@capacitor/android : 3.8.0
@capacitor/core : 3.8.0
@capacitor/ios : 3.8.0
Capacitor CLI : 4.3.0
@capacitor/android : 4.3.0
@capacitor/core : 4.3.0
@capacitor/ios : 4.3.0

NodeJS : v16.15.1
npm : 8.11.0
Expand Down
7 changes: 7 additions & 0 deletions android/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "com.tomfong.simpleqr"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 2080000
versionName "2.8.0"
versionCode 3000000
versionName "3.0.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand All @@ -30,6 +30,8 @@ repositories {
}

dependencies {
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
implementation project(':capacitor-android')
Expand Down
4 changes: 2 additions & 2 deletions android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}

Expand Down
14 changes: 12 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,23 @@
<provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"></meta-data>
</provider>

<service
android:name=".MyQSTileService"
android:label="@string/app_name"
android:icon="@drawable/ic_baseline_qr_code_24"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
android:exported="true">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>

</application>

<!-- Permissions -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-sdk tools:overrideLibrary="com.google.zxing.client.android" />
</manifest>
18 changes: 17 additions & 1 deletion android/app/src/main/java/com/tomfong/simpleqr/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,20 @@

import com.getcapacitor.BridgeActivity;

public class MainActivity extends BridgeActivity {}
public class MainActivity extends BridgeActivity {

static boolean active = false;

@Override
public void onStart() {
super.onStart();
active = true;
}

@Override
public void onStop() {
super.onStop();
active = false;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package com.tomfong.simpleqr;

import android.content.Intent;
import android.os.Build;
import android.service.quicksettings.Tile;
import android.service.quicksettings.TileService;
import android.util.Log;

import androidx.annotation.RequiresApi;

@RequiresApi(api = Build.VERSION_CODES.N)
public class MyQSTileService extends TileService {

// Called when the user adds your tile.
@Override
public void onTileAdded() {
super.onTileAdded();
Log.println(Log.INFO,"MyQSTileService","onTileAdded");
}

// Called when your app can update your tile.
@Override
public void onStartListening() {
super.onStartListening();
Log.println(Log.INFO,"MyQSTileService","onStartListening");
Tile tile = this.getQsTile();
if (MainActivity.active) {
tile.setState(Tile.STATE_ACTIVE);
} else {
tile.setState(Tile.STATE_INACTIVE);
}
tile.updateTile();
}

// Called when your app can no longer update your tile.
@Override
public void onStopListening() {
super.onStopListening();
Log.println(Log.INFO,"MyQSTileService","onStopListening");
}

// Called when the user taps on your tile in an active or inactive state.
@Override
public void onClick() {
super.onClick();
Log.println(Log.INFO,"MyQSTileService","onClick");
Tile tile = this.getQsTile();
Intent intent = new Intent(this.getApplicationContext(), MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivityAndCollapse(intent);
tile.setState(Tile.STATE_ACTIVE);
tile.updateTile();
}

// Called when the user removes your tile.
@Override
public void onTileRemoved() {
super.onTileRemoved();
Log.println(Log.INFO,"MyQSTileService","onTileRemoved");
}
}
15 changes: 15 additions & 0 deletions android/app/src/main/res/drawable/ic_baseline_qr_code_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M3,11h8V3H3V11zM5,5h4v4H5V5z"/>
<path android:fillColor="@android:color/white" android:pathData="M3,21h8v-8H3V21zM5,15h4v4H5V15z"/>
<path android:fillColor="@android:color/white" android:pathData="M13,3v8h8V3H13zM19,9h-4V5h4V9z"/>
<path android:fillColor="@android:color/white" android:pathData="M19,19h2v2h-2z"/>
<path android:fillColor="@android:color/white" android:pathData="M13,13h2v2h-2z"/>
<path android:fillColor="@android:color/white" android:pathData="M15,15h2v2h-2z"/>
<path android:fillColor="@android:color/white" android:pathData="M13,17h2v2h-2z"/>
<path android:fillColor="@android:color/white" android:pathData="M15,19h2v2h-2z"/>
<path android:fillColor="@android:color/white" android:pathData="M17,17h2v2h-2z"/>
<path android:fillColor="@android:color/white" android:pathData="M17,13h2v2h-2z"/>
<path android:fillColor="@android:color/white" android:pathData="M19,15h2v2h-2z"/>
</vector>
7 changes: 3 additions & 4 deletions android/app/src/main/res/values-zh-rCN/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.NoActionBar">
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:background">@null</item>
</style>


<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
<item name="android:background">#00a5aa</item>
<style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
<item name="android:background">@drawable/splash</item>
</style>
</resources>
6 changes: 3 additions & 3 deletions android/app/src/main/res/values-zh-rSG/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.NoActionBar">
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:background">@null</item>
</style>


<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
<item name="android:background">#00a5aa</item>
<style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
<item name="android:background">@drawable/splash</item>
</style>
</resources>
6 changes: 3 additions & 3 deletions android/app/src/main/res/values-zh-rTW/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.NoActionBar">
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:background">@null</item>
</style>


<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
<item name="android:background">#00a5aa</item>
<style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
<item name="android:background">@drawable/splash</item>
</style>
</resources>
6 changes: 3 additions & 3 deletions android/app/src/main/res/values-zh/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.NoActionBar">
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:background">@null</item>
</style>


<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
<item name="android:background">#00a5aa</item>
<style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
<item name="android:background">@drawable/splash</item>
</style>
</resources>
6 changes: 3 additions & 3 deletions android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.NoActionBar">
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:background">@null</item>
</style>


<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
<item name="android:background">#00a5aa</item>
<style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
<item name="android:background">@drawable/splash</item>
</style>
</resources>
9 changes: 5 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ buildscript {

repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.google.gms:google-services:4.3.13'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -20,10 +20,11 @@ apply from: "variables.gradle"
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
26 changes: 14 additions & 12 deletions android/variables.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
ext {
minSdkVersion = 23
compileSdkVersion = 31
targetSdkVersion = 31
androidxActivityVersion = '1.2.0'
androidxAppCompatVersion = '1.2.0'
androidxCoordinatorLayoutVersion = '1.1.0'
androidxCoreVersion = '1.3.2'
androidxFragmentVersion = '1.3.0'
junitVersion = '4.13.1'
androidxJunitVersion = '1.1.2'
androidxEspressoCoreVersion = '3.3.0'
cordovaAndroidVersion = '7.0.0'
minSdkVersion = 22
compileSdkVersion = 32
targetSdkVersion = 32
androidxActivityVersion = '1.4.0'
androidxAppCompatVersion = '1.4.2'
androidxCoordinatorLayoutVersion = '1.2.0'
androidxCoreVersion = '1.8.0'
androidxFragmentVersion = '1.4.1'
junitVersion = '4.13.2'
androidxJunitVersion = '1.1.3'
androidxEspressoCoreVersion = '3.4.0'
cordovaAndroidVersion = '10.1.1'
coreSplashScreenVersion = '1.0.0-rc01'
androidxWebkitVersion = '1.4.0'
}
6 changes: 4 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"defaultProject": "app",
"newProjectRoot": "projects",
"projects": {
"app": {
Expand Down Expand Up @@ -162,7 +161,10 @@
}
},
"cli": {
"defaultCollection": "@ionic/angular-toolkit"
"schematicCollections": [
"@ionic/angular-toolkit"
],
"analytics": false
},
"schematics": {
"@ionic/angular-toolkit:component": {
Expand Down
4 changes: 4 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/3000000.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* Upgraded framework, improved performance and fixed known bugs.
* Support quick access tile in the Quick Settings panel.
* More customizable UI.
* Removed Read/Write Contacts permission.
Loading

0 comments on commit 07b99da

Please sign in to comment.