nestjs-firebase-admin 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nvmrc +1 -0
- package/SECURITY.md +21 -0
- package/dist/modules/admin/admin.service.js +5 -1
- package/dist/modules/admin/types/admin.type.d.ts +2 -2
- package/examples/android/java/.idea/.name +1 -0
- package/examples/android/java/.idea/compiler.xml +6 -0
- package/examples/android/java/.idea/google-java-format.xml +6 -0
- package/examples/android/java/.idea/gradle.xml +19 -0
- package/examples/android/java/.idea/misc.xml +10 -0
- package/examples/android/java/.idea/vcs.xml +6 -0
- package/examples/android/java/app/build.gradle +46 -0
- package/examples/android/java/app/proguard-rules.pro +21 -0
- package/examples/android/java/app/src/androidTest/java/com/example/nestjs_firebase_admin/ExampleInstrumentedTest.java +26 -0
- package/examples/android/java/app/src/main/AndroidManifest.xml +32 -0
- package/examples/android/java/app/src/main/java/com/example/nestjs_firebase_admin/FirstFragment.java +47 -0
- package/examples/android/java/app/src/main/java/com/example/nestjs_firebase_admin/MainActivity.java +102 -0
- package/examples/android/java/app/src/main/java/com/example/nestjs_firebase_admin/SecondFragment.java +47 -0
- package/examples/android/java/app/src/main/res/drawable/ic_launcher_background.xml +170 -0
- package/examples/android/java/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +30 -0
- package/examples/android/java/app/src/main/res/layout/activity_main.xml +34 -0
- package/examples/android/java/app/src/main/res/layout/content_main.xml +19 -0
- package/examples/android/java/app/src/main/res/layout/fragment_first.xml +28 -0
- package/examples/android/java/app/src/main/res/layout/fragment_second.xml +27 -0
- package/examples/android/java/app/src/main/res/menu/menu_main.xml +10 -0
- package/examples/android/java/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
- package/examples/android/java/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
- package/examples/android/java/app/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- package/examples/android/java/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- package/examples/android/java/app/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- package/examples/android/java/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- package/examples/android/java/app/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- package/examples/android/java/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- package/examples/android/java/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- package/examples/android/java/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- package/examples/android/java/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- package/examples/android/java/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- package/examples/android/java/app/src/main/res/navigation/nav_graph.xml +28 -0
- package/examples/android/java/app/src/main/res/values/colors.xml +10 -0
- package/examples/android/java/app/src/main/res/values/dimens.xml +3 -0
- package/examples/android/java/app/src/main/res/values/strings.xml +12 -0
- package/examples/android/java/app/src/main/res/values/themes.xml +25 -0
- package/examples/android/java/app/src/main/res/values-land/dimens.xml +3 -0
- package/examples/android/java/app/src/main/res/values-night/themes.xml +16 -0
- package/examples/android/java/app/src/main/res/values-w1240dp/dimens.xml +3 -0
- package/examples/android/java/app/src/main/res/values-w600dp/dimens.xml +3 -0
- package/examples/android/java/app/src/main/res/xml/backup_rules.xml +13 -0
- package/examples/android/java/app/src/main/res/xml/data_extraction_rules.xml +19 -0
- package/examples/android/java/app/src/test/java/com/example/nestjs_firebase_admin/ExampleUnitTest.java +17 -0
- package/examples/android/java/build.gradle +9 -0
- package/examples/android/java/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/examples/android/java/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/examples/android/java/gradle.properties +21 -0
- package/examples/android/java/gradlew +185 -0
- package/examples/android/java/gradlew.bat +89 -0
- package/examples/android/java/settings.gradle +16 -0
- package/package.json +16 -13
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
v16.17.1
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
Use this section to tell people about which versions of your project are
|
|
6
|
+
currently being supported with security updates.
|
|
7
|
+
|
|
8
|
+
| Version | Supported |
|
|
9
|
+
| ------- | ------------------ |
|
|
10
|
+
| 5.1.x | :white_check_mark: |
|
|
11
|
+
| 5.0.x | :x: |
|
|
12
|
+
| 4.0.x | :white_check_mark: |
|
|
13
|
+
| < 4.0 | :x: |
|
|
14
|
+
|
|
15
|
+
## Reporting a Vulnerability
|
|
16
|
+
|
|
17
|
+
Use this section to tell people how to report a vulnerability.
|
|
18
|
+
|
|
19
|
+
Tell them where to go, how often they can expect to get an update on a
|
|
20
|
+
reported vulnerability, what to expect if the vulnerability is accepted or
|
|
21
|
+
declined, etc.
|
|
@@ -11,11 +11,15 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
14
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
18
|
exports.AdminService = void 0;
|
|
16
19
|
const common_1 = require("@nestjs/common");
|
|
17
20
|
const rxjs_1 = require("rxjs");
|
|
18
21
|
const app_1 = require("firebase-admin/app");
|
|
22
|
+
const firebase_admin_1 = __importDefault(require("firebase-admin"));
|
|
19
23
|
const admin_constants_1 = require("./admin.constants");
|
|
20
24
|
let AdminService = class AdminService {
|
|
21
25
|
constructor(options) {
|
|
@@ -34,7 +38,7 @@ let AdminService = class AdminService {
|
|
|
34
38
|
return (0, app_1.getApp)();
|
|
35
39
|
}
|
|
36
40
|
initializeApp() {
|
|
37
|
-
return (0, app_1.initializeApp)(Object.assign({}, this.options));
|
|
41
|
+
return (0, app_1.initializeApp)(Object.assign(Object.assign({}, this.options), { credential: firebase_admin_1.default.credential.cert(this.options.credential) }));
|
|
38
42
|
}
|
|
39
43
|
initializeAppObservable() {
|
|
40
44
|
return new rxjs_1.Observable(subscriber => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { Agent } from 'node:http';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ServiceAccount } from 'firebase-admin/app';
|
|
4
4
|
export declare type AdminConfig = {
|
|
5
|
-
credential:
|
|
5
|
+
credential: ServiceAccount;
|
|
6
6
|
databaseURL?: string;
|
|
7
7
|
databaseAuthVariableOverride?: object | null;
|
|
8
8
|
serviceAccountId?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nestjs-firebase-admin
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="GradleMigrationSettings" migrationVersion="1" />
|
|
4
|
+
<component name="GradleSettings">
|
|
5
|
+
<option name="linkedExternalProjectsSettings">
|
|
6
|
+
<GradleProjectSettings>
|
|
7
|
+
<option name="testRunner" value="GRADLE" />
|
|
8
|
+
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
|
9
|
+
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
10
|
+
<option name="modules">
|
|
11
|
+
<set>
|
|
12
|
+
<option value="$PROJECT_DIR$" />
|
|
13
|
+
<option value="$PROJECT_DIR$/app" />
|
|
14
|
+
</set>
|
|
15
|
+
</option>
|
|
16
|
+
</GradleProjectSettings>
|
|
17
|
+
</option>
|
|
18
|
+
</component>
|
|
19
|
+
</project>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
|
4
|
+
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
|
|
5
|
+
<output url="file://$PROJECT_DIR$/build/classes" />
|
|
6
|
+
</component>
|
|
7
|
+
<component name="ProjectType">
|
|
8
|
+
<option name="id" value="Android" />
|
|
9
|
+
</component>
|
|
10
|
+
</project>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
plugins {
|
|
2
|
+
id 'com.android.application'
|
|
3
|
+
id 'com.google.gms.google-services'
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
android {
|
|
7
|
+
namespace 'com.example.nestjs_firebase_admin'
|
|
8
|
+
compileSdk 32
|
|
9
|
+
|
|
10
|
+
defaultConfig {
|
|
11
|
+
applicationId "com.example.nestjs_firebase_admin"
|
|
12
|
+
minSdk 21
|
|
13
|
+
targetSdk 32
|
|
14
|
+
versionCode 1
|
|
15
|
+
versionName "1.0"
|
|
16
|
+
|
|
17
|
+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
buildTypes {
|
|
21
|
+
release {
|
|
22
|
+
minifyEnabled false
|
|
23
|
+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
compileOptions {
|
|
27
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
28
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
29
|
+
}
|
|
30
|
+
buildFeatures {
|
|
31
|
+
viewBinding true
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
dependencies {
|
|
36
|
+
|
|
37
|
+
implementation 'androidx.appcompat:appcompat:1.5.1'
|
|
38
|
+
implementation 'com.google.android.material:material:1.6.1'
|
|
39
|
+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
40
|
+
implementation 'androidx.navigation:navigation-fragment:2.5.2'
|
|
41
|
+
implementation 'androidx.navigation:navigation-ui:2.5.2'
|
|
42
|
+
implementation 'com.google.firebase:firebase-messaging:23.0.8'
|
|
43
|
+
testImplementation 'junit:junit:4.13.2'
|
|
44
|
+
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
|
45
|
+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
|
46
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Add project specific ProGuard rules here.
|
|
2
|
+
# You can control the set of applied configuration files using the
|
|
3
|
+
# proguardFiles setting in build.gradle.
|
|
4
|
+
#
|
|
5
|
+
# For more details, see
|
|
6
|
+
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
7
|
+
|
|
8
|
+
# If your project uses WebView with JS, uncomment the following
|
|
9
|
+
# and specify the fully qualified class name to the JavaScript interface
|
|
10
|
+
# class:
|
|
11
|
+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
12
|
+
# public *;
|
|
13
|
+
#}
|
|
14
|
+
|
|
15
|
+
# Uncomment this to preserve the line number information for
|
|
16
|
+
# debugging stack traces.
|
|
17
|
+
#-keepattributes SourceFile,LineNumberTable
|
|
18
|
+
|
|
19
|
+
# If you keep the line number information, uncomment this to
|
|
20
|
+
# hide the original source file name.
|
|
21
|
+
#-renamesourcefileattribute SourceFile
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
package com.example.nestjs_firebase_admin;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
|
|
5
|
+
import androidx.test.platform.app.InstrumentationRegistry;
|
|
6
|
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
|
7
|
+
|
|
8
|
+
import org.junit.Test;
|
|
9
|
+
import org.junit.runner.RunWith;
|
|
10
|
+
|
|
11
|
+
import static org.junit.Assert.*;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Instrumented test, which will execute on an Android device.
|
|
15
|
+
*
|
|
16
|
+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
17
|
+
*/
|
|
18
|
+
@RunWith(AndroidJUnit4.class)
|
|
19
|
+
public class ExampleInstrumentedTest {
|
|
20
|
+
@Test
|
|
21
|
+
public void useAppContext() {
|
|
22
|
+
// Context of the app under test.
|
|
23
|
+
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
|
24
|
+
assertEquals("com.example.nestjs_firebase_admin", appContext.getPackageName());
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
xmlns:tools="http://schemas.android.com/tools">
|
|
4
|
+
|
|
5
|
+
<application
|
|
6
|
+
android:allowBackup="true"
|
|
7
|
+
android:dataExtractionRules="@xml/data_extraction_rules"
|
|
8
|
+
android:fullBackupContent="@xml/backup_rules"
|
|
9
|
+
android:icon="@mipmap/ic_launcher"
|
|
10
|
+
android:label="@string/app_name"
|
|
11
|
+
android:roundIcon="@mipmap/ic_launcher_round"
|
|
12
|
+
android:supportsRtl="true"
|
|
13
|
+
android:theme="@style/Theme.Nestjsfirebaseadmin"
|
|
14
|
+
tools:targetApi="31">
|
|
15
|
+
<activity
|
|
16
|
+
android:name=".MainActivity"
|
|
17
|
+
android:exported="true"
|
|
18
|
+
android:label="@string/app_name"
|
|
19
|
+
android:theme="@style/Theme.Nestjsfirebaseadmin.NoActionBar">
|
|
20
|
+
<intent-filter>
|
|
21
|
+
<action android:name="android.intent.action.MAIN" />
|
|
22
|
+
|
|
23
|
+
<category android:name="android.intent.category.LAUNCHER" />
|
|
24
|
+
</intent-filter>
|
|
25
|
+
|
|
26
|
+
<meta-data
|
|
27
|
+
android:name="android.app.lib_name"
|
|
28
|
+
android:value="" />
|
|
29
|
+
</activity>
|
|
30
|
+
</application>
|
|
31
|
+
|
|
32
|
+
</manifest>
|
package/examples/android/java/app/src/main/java/com/example/nestjs_firebase_admin/FirstFragment.java
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
package com.example.nestjs_firebase_admin;
|
|
2
|
+
|
|
3
|
+
import android.os.Bundle;
|
|
4
|
+
import android.view.LayoutInflater;
|
|
5
|
+
import android.view.View;
|
|
6
|
+
import android.view.ViewGroup;
|
|
7
|
+
|
|
8
|
+
import androidx.annotation.NonNull;
|
|
9
|
+
import androidx.fragment.app.Fragment;
|
|
10
|
+
import androidx.navigation.fragment.NavHostFragment;
|
|
11
|
+
|
|
12
|
+
import com.example.nestjs_firebase_admin.databinding.FragmentFirstBinding;
|
|
13
|
+
|
|
14
|
+
public class FirstFragment extends Fragment {
|
|
15
|
+
|
|
16
|
+
private FragmentFirstBinding binding;
|
|
17
|
+
|
|
18
|
+
@Override
|
|
19
|
+
public View onCreateView(
|
|
20
|
+
LayoutInflater inflater, ViewGroup container,
|
|
21
|
+
Bundle savedInstanceState
|
|
22
|
+
) {
|
|
23
|
+
|
|
24
|
+
binding = FragmentFirstBinding.inflate(inflater, container, false);
|
|
25
|
+
return binding.getRoot();
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
|
|
30
|
+
super.onViewCreated(view, savedInstanceState);
|
|
31
|
+
|
|
32
|
+
binding.buttonFirst.setOnClickListener(new View.OnClickListener() {
|
|
33
|
+
@Override
|
|
34
|
+
public void onClick(View view) {
|
|
35
|
+
NavHostFragment.findNavController(FirstFragment.this)
|
|
36
|
+
.navigate(R.id.action_FirstFragment_to_SecondFragment);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@Override
|
|
42
|
+
public void onDestroyView() {
|
|
43
|
+
super.onDestroyView();
|
|
44
|
+
binding = null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
package/examples/android/java/app/src/main/java/com/example/nestjs_firebase_admin/MainActivity.java
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
package com.example.nestjs_firebase_admin;
|
|
2
|
+
|
|
3
|
+
import static com.google.firebase.messaging.Constants.TAG;
|
|
4
|
+
|
|
5
|
+
import android.os.Bundle;
|
|
6
|
+
|
|
7
|
+
import com.google.android.gms.tasks.OnCompleteListener;
|
|
8
|
+
import com.google.android.gms.tasks.Task;
|
|
9
|
+
import com.google.android.material.snackbar.Snackbar;
|
|
10
|
+
|
|
11
|
+
import androidx.annotation.NonNull;
|
|
12
|
+
import androidx.appcompat.app.AppCompatActivity;
|
|
13
|
+
|
|
14
|
+
import android.util.Log;
|
|
15
|
+
import android.view.View;
|
|
16
|
+
|
|
17
|
+
import androidx.navigation.NavController;
|
|
18
|
+
import androidx.navigation.Navigation;
|
|
19
|
+
import androidx.navigation.ui.AppBarConfiguration;
|
|
20
|
+
import androidx.navigation.ui.NavigationUI;
|
|
21
|
+
|
|
22
|
+
import com.example.nestjs_firebase_admin.databinding.ActivityMainBinding;
|
|
23
|
+
import com.google.firebase.messaging.FirebaseMessaging;
|
|
24
|
+
|
|
25
|
+
import android.view.Menu;
|
|
26
|
+
import android.view.MenuItem;
|
|
27
|
+
import android.widget.Toast;
|
|
28
|
+
|
|
29
|
+
public class MainActivity extends AppCompatActivity {
|
|
30
|
+
|
|
31
|
+
private AppBarConfiguration appBarConfiguration;
|
|
32
|
+
private ActivityMainBinding binding;
|
|
33
|
+
|
|
34
|
+
@Override
|
|
35
|
+
protected void onCreate(Bundle savedInstanceState) {
|
|
36
|
+
super.onCreate(savedInstanceState);
|
|
37
|
+
|
|
38
|
+
binding = ActivityMainBinding.inflate(getLayoutInflater());
|
|
39
|
+
setContentView(binding.getRoot());
|
|
40
|
+
|
|
41
|
+
setSupportActionBar(binding.toolbar);
|
|
42
|
+
|
|
43
|
+
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
|
|
44
|
+
appBarConfiguration = new AppBarConfiguration.Builder(navController.getGraph()).build();
|
|
45
|
+
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
|
|
46
|
+
|
|
47
|
+
binding.fab.setOnClickListener(new View.OnClickListener() {
|
|
48
|
+
@Override
|
|
49
|
+
public void onClick(View view) {
|
|
50
|
+
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
|
51
|
+
.setAction("Action", null).show();
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
FirebaseMessaging.getInstance().getToken()
|
|
55
|
+
.addOnCompleteListener(new OnCompleteListener<String>() {
|
|
56
|
+
@Override
|
|
57
|
+
public void onComplete(@NonNull Task<String> task) {
|
|
58
|
+
if (!task.isSuccessful()) {
|
|
59
|
+
Log.w(TAG, "Fetching FCM registration token failed", task.getException());
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Get new FCM registration token
|
|
64
|
+
String token = task.getResult();
|
|
65
|
+
Log.d(TAG, token);
|
|
66
|
+
// Log and toast
|
|
67
|
+
//String msg = getString(R.string.msg_token_fmt, token);
|
|
68
|
+
//Log.d(TAG, msg);
|
|
69
|
+
//Toast.makeText(MainActivity.this, msg, Toast.LENGTH_SHORT).show();
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@Override
|
|
75
|
+
public boolean onCreateOptionsMenu(Menu menu) {
|
|
76
|
+
// Inflate the menu; this adds items to the action bar if it is present.
|
|
77
|
+
getMenuInflater().inflate(R.menu.menu_main, menu);
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@Override
|
|
82
|
+
public boolean onOptionsItemSelected(MenuItem item) {
|
|
83
|
+
// Handle action bar item clicks here. The action bar will
|
|
84
|
+
// automatically handle clicks on the Home/Up button, so long
|
|
85
|
+
// as you specify a parent activity in AndroidManifest.xml.
|
|
86
|
+
int id = item.getItemId();
|
|
87
|
+
|
|
88
|
+
//noinspection SimplifiableIfStatement
|
|
89
|
+
if (id == R.id.action_settings) {
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return super.onOptionsItemSelected(item);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@Override
|
|
97
|
+
public boolean onSupportNavigateUp() {
|
|
98
|
+
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
|
|
99
|
+
return NavigationUI.navigateUp(navController, appBarConfiguration)
|
|
100
|
+
|| super.onSupportNavigateUp();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
package com.example.nestjs_firebase_admin;
|
|
2
|
+
|
|
3
|
+
import android.os.Bundle;
|
|
4
|
+
import android.view.LayoutInflater;
|
|
5
|
+
import android.view.View;
|
|
6
|
+
import android.view.ViewGroup;
|
|
7
|
+
|
|
8
|
+
import androidx.annotation.NonNull;
|
|
9
|
+
import androidx.fragment.app.Fragment;
|
|
10
|
+
import androidx.navigation.fragment.NavHostFragment;
|
|
11
|
+
|
|
12
|
+
import com.example.nestjs_firebase_admin.databinding.FragmentSecondBinding;
|
|
13
|
+
|
|
14
|
+
public class SecondFragment extends Fragment {
|
|
15
|
+
|
|
16
|
+
private FragmentSecondBinding binding;
|
|
17
|
+
|
|
18
|
+
@Override
|
|
19
|
+
public View onCreateView(
|
|
20
|
+
LayoutInflater inflater, ViewGroup container,
|
|
21
|
+
Bundle savedInstanceState
|
|
22
|
+
) {
|
|
23
|
+
|
|
24
|
+
binding = FragmentSecondBinding.inflate(inflater, container, false);
|
|
25
|
+
return binding.getRoot();
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
|
|
30
|
+
super.onViewCreated(view, savedInstanceState);
|
|
31
|
+
|
|
32
|
+
binding.buttonSecond.setOnClickListener(new View.OnClickListener() {
|
|
33
|
+
@Override
|
|
34
|
+
public void onClick(View view) {
|
|
35
|
+
NavHostFragment.findNavController(SecondFragment.this)
|
|
36
|
+
.navigate(R.id.action_SecondFragment_to_FirstFragment);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@Override
|
|
42
|
+
public void onDestroyView() {
|
|
43
|
+
super.onDestroyView();
|
|
44
|
+
binding = null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
android:width="108dp"
|
|
4
|
+
android:height="108dp"
|
|
5
|
+
android:viewportWidth="108"
|
|
6
|
+
android:viewportHeight="108">
|
|
7
|
+
<path
|
|
8
|
+
android:fillColor="#3DDC84"
|
|
9
|
+
android:pathData="M0,0h108v108h-108z" />
|
|
10
|
+
<path
|
|
11
|
+
android:fillColor="#00000000"
|
|
12
|
+
android:pathData="M9,0L9,108"
|
|
13
|
+
android:strokeWidth="0.8"
|
|
14
|
+
android:strokeColor="#33FFFFFF" />
|
|
15
|
+
<path
|
|
16
|
+
android:fillColor="#00000000"
|
|
17
|
+
android:pathData="M19,0L19,108"
|
|
18
|
+
android:strokeWidth="0.8"
|
|
19
|
+
android:strokeColor="#33FFFFFF" />
|
|
20
|
+
<path
|
|
21
|
+
android:fillColor="#00000000"
|
|
22
|
+
android:pathData="M29,0L29,108"
|
|
23
|
+
android:strokeWidth="0.8"
|
|
24
|
+
android:strokeColor="#33FFFFFF" />
|
|
25
|
+
<path
|
|
26
|
+
android:fillColor="#00000000"
|
|
27
|
+
android:pathData="M39,0L39,108"
|
|
28
|
+
android:strokeWidth="0.8"
|
|
29
|
+
android:strokeColor="#33FFFFFF" />
|
|
30
|
+
<path
|
|
31
|
+
android:fillColor="#00000000"
|
|
32
|
+
android:pathData="M49,0L49,108"
|
|
33
|
+
android:strokeWidth="0.8"
|
|
34
|
+
android:strokeColor="#33FFFFFF" />
|
|
35
|
+
<path
|
|
36
|
+
android:fillColor="#00000000"
|
|
37
|
+
android:pathData="M59,0L59,108"
|
|
38
|
+
android:strokeWidth="0.8"
|
|
39
|
+
android:strokeColor="#33FFFFFF" />
|
|
40
|
+
<path
|
|
41
|
+
android:fillColor="#00000000"
|
|
42
|
+
android:pathData="M69,0L69,108"
|
|
43
|
+
android:strokeWidth="0.8"
|
|
44
|
+
android:strokeColor="#33FFFFFF" />
|
|
45
|
+
<path
|
|
46
|
+
android:fillColor="#00000000"
|
|
47
|
+
android:pathData="M79,0L79,108"
|
|
48
|
+
android:strokeWidth="0.8"
|
|
49
|
+
android:strokeColor="#33FFFFFF" />
|
|
50
|
+
<path
|
|
51
|
+
android:fillColor="#00000000"
|
|
52
|
+
android:pathData="M89,0L89,108"
|
|
53
|
+
android:strokeWidth="0.8"
|
|
54
|
+
android:strokeColor="#33FFFFFF" />
|
|
55
|
+
<path
|
|
56
|
+
android:fillColor="#00000000"
|
|
57
|
+
android:pathData="M99,0L99,108"
|
|
58
|
+
android:strokeWidth="0.8"
|
|
59
|
+
android:strokeColor="#33FFFFFF" />
|
|
60
|
+
<path
|
|
61
|
+
android:fillColor="#00000000"
|
|
62
|
+
android:pathData="M0,9L108,9"
|
|
63
|
+
android:strokeWidth="0.8"
|
|
64
|
+
android:strokeColor="#33FFFFFF" />
|
|
65
|
+
<path
|
|
66
|
+
android:fillColor="#00000000"
|
|
67
|
+
android:pathData="M0,19L108,19"
|
|
68
|
+
android:strokeWidth="0.8"
|
|
69
|
+
android:strokeColor="#33FFFFFF" />
|
|
70
|
+
<path
|
|
71
|
+
android:fillColor="#00000000"
|
|
72
|
+
android:pathData="M0,29L108,29"
|
|
73
|
+
android:strokeWidth="0.8"
|
|
74
|
+
android:strokeColor="#33FFFFFF" />
|
|
75
|
+
<path
|
|
76
|
+
android:fillColor="#00000000"
|
|
77
|
+
android:pathData="M0,39L108,39"
|
|
78
|
+
android:strokeWidth="0.8"
|
|
79
|
+
android:strokeColor="#33FFFFFF" />
|
|
80
|
+
<path
|
|
81
|
+
android:fillColor="#00000000"
|
|
82
|
+
android:pathData="M0,49L108,49"
|
|
83
|
+
android:strokeWidth="0.8"
|
|
84
|
+
android:strokeColor="#33FFFFFF" />
|
|
85
|
+
<path
|
|
86
|
+
android:fillColor="#00000000"
|
|
87
|
+
android:pathData="M0,59L108,59"
|
|
88
|
+
android:strokeWidth="0.8"
|
|
89
|
+
android:strokeColor="#33FFFFFF" />
|
|
90
|
+
<path
|
|
91
|
+
android:fillColor="#00000000"
|
|
92
|
+
android:pathData="M0,69L108,69"
|
|
93
|
+
android:strokeWidth="0.8"
|
|
94
|
+
android:strokeColor="#33FFFFFF" />
|
|
95
|
+
<path
|
|
96
|
+
android:fillColor="#00000000"
|
|
97
|
+
android:pathData="M0,79L108,79"
|
|
98
|
+
android:strokeWidth="0.8"
|
|
99
|
+
android:strokeColor="#33FFFFFF" />
|
|
100
|
+
<path
|
|
101
|
+
android:fillColor="#00000000"
|
|
102
|
+
android:pathData="M0,89L108,89"
|
|
103
|
+
android:strokeWidth="0.8"
|
|
104
|
+
android:strokeColor="#33FFFFFF" />
|
|
105
|
+
<path
|
|
106
|
+
android:fillColor="#00000000"
|
|
107
|
+
android:pathData="M0,99L108,99"
|
|
108
|
+
android:strokeWidth="0.8"
|
|
109
|
+
android:strokeColor="#33FFFFFF" />
|
|
110
|
+
<path
|
|
111
|
+
android:fillColor="#00000000"
|
|
112
|
+
android:pathData="M19,29L89,29"
|
|
113
|
+
android:strokeWidth="0.8"
|
|
114
|
+
android:strokeColor="#33FFFFFF" />
|
|
115
|
+
<path
|
|
116
|
+
android:fillColor="#00000000"
|
|
117
|
+
android:pathData="M19,39L89,39"
|
|
118
|
+
android:strokeWidth="0.8"
|
|
119
|
+
android:strokeColor="#33FFFFFF" />
|
|
120
|
+
<path
|
|
121
|
+
android:fillColor="#00000000"
|
|
122
|
+
android:pathData="M19,49L89,49"
|
|
123
|
+
android:strokeWidth="0.8"
|
|
124
|
+
android:strokeColor="#33FFFFFF" />
|
|
125
|
+
<path
|
|
126
|
+
android:fillColor="#00000000"
|
|
127
|
+
android:pathData="M19,59L89,59"
|
|
128
|
+
android:strokeWidth="0.8"
|
|
129
|
+
android:strokeColor="#33FFFFFF" />
|
|
130
|
+
<path
|
|
131
|
+
android:fillColor="#00000000"
|
|
132
|
+
android:pathData="M19,69L89,69"
|
|
133
|
+
android:strokeWidth="0.8"
|
|
134
|
+
android:strokeColor="#33FFFFFF" />
|
|
135
|
+
<path
|
|
136
|
+
android:fillColor="#00000000"
|
|
137
|
+
android:pathData="M19,79L89,79"
|
|
138
|
+
android:strokeWidth="0.8"
|
|
139
|
+
android:strokeColor="#33FFFFFF" />
|
|
140
|
+
<path
|
|
141
|
+
android:fillColor="#00000000"
|
|
142
|
+
android:pathData="M29,19L29,89"
|
|
143
|
+
android:strokeWidth="0.8"
|
|
144
|
+
android:strokeColor="#33FFFFFF" />
|
|
145
|
+
<path
|
|
146
|
+
android:fillColor="#00000000"
|
|
147
|
+
android:pathData="M39,19L39,89"
|
|
148
|
+
android:strokeWidth="0.8"
|
|
149
|
+
android:strokeColor="#33FFFFFF" />
|
|
150
|
+
<path
|
|
151
|
+
android:fillColor="#00000000"
|
|
152
|
+
android:pathData="M49,19L49,89"
|
|
153
|
+
android:strokeWidth="0.8"
|
|
154
|
+
android:strokeColor="#33FFFFFF" />
|
|
155
|
+
<path
|
|
156
|
+
android:fillColor="#00000000"
|
|
157
|
+
android:pathData="M59,19L59,89"
|
|
158
|
+
android:strokeWidth="0.8"
|
|
159
|
+
android:strokeColor="#33FFFFFF" />
|
|
160
|
+
<path
|
|
161
|
+
android:fillColor="#00000000"
|
|
162
|
+
android:pathData="M69,19L69,89"
|
|
163
|
+
android:strokeWidth="0.8"
|
|
164
|
+
android:strokeColor="#33FFFFFF" />
|
|
165
|
+
<path
|
|
166
|
+
android:fillColor="#00000000"
|
|
167
|
+
android:pathData="M79,19L79,89"
|
|
168
|
+
android:strokeWidth="0.8"
|
|
169
|
+
android:strokeColor="#33FFFFFF" />
|
|
170
|
+
</vector>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
+
xmlns:aapt="http://schemas.android.com/aapt"
|
|
3
|
+
android:width="108dp"
|
|
4
|
+
android:height="108dp"
|
|
5
|
+
android:viewportWidth="108"
|
|
6
|
+
android:viewportHeight="108">
|
|
7
|
+
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
|
8
|
+
<aapt:attr name="android:fillColor">
|
|
9
|
+
<gradient
|
|
10
|
+
android:endX="85.84757"
|
|
11
|
+
android:endY="92.4963"
|
|
12
|
+
android:startX="42.9492"
|
|
13
|
+
android:startY="49.59793"
|
|
14
|
+
android:type="linear">
|
|
15
|
+
<item
|
|
16
|
+
android:color="#44000000"
|
|
17
|
+
android:offset="0.0" />
|
|
18
|
+
<item
|
|
19
|
+
android:color="#00000000"
|
|
20
|
+
android:offset="1.0" />
|
|
21
|
+
</gradient>
|
|
22
|
+
</aapt:attr>
|
|
23
|
+
</path>
|
|
24
|
+
<path
|
|
25
|
+
android:fillColor="#FFFFFF"
|
|
26
|
+
android:fillType="nonZero"
|
|
27
|
+
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
|
28
|
+
android:strokeWidth="1"
|
|
29
|
+
android:strokeColor="#00000000" />
|
|
30
|
+
</vector>
|