신기성

pushing practice done

...@@ -36,7 +36,8 @@ dependencies { ...@@ -36,7 +36,8 @@ dependencies {
36 implementation 'com.android.support:appcompat-v7:27.1.1' 36 implementation 'com.android.support:appcompat-v7:27.1.1'
37 implementation 'com.android.support:design:27.1.1' 37 implementation 'com.android.support:design:27.1.1'
38 38
39 - 39 + implementation 'com.google.firebase:firebase-analytics:17.2.0'
40 + implementation 'com.google.firebase:firebase-messaging:20.0.0'
40 41
41 testImplementation 'junit:junit:4.12' 42 testImplementation 'junit:junit:4.12'
42 androidTestImplementation 'androidx.test:runner:1.2.0' 43 androidTestImplementation 'androidx.test:runner:1.2.0'
......
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 package="com.example.vip"> 3 package="com.example.vip">
4 +
4 <application 5 <application
5 android:allowBackup="true" 6 android:allowBackup="true"
6 android:icon="@mipmap/ic_launcher" 7 android:icon="@mipmap/ic_launcher"
...@@ -8,14 +9,19 @@ ...@@ -8,14 +9,19 @@
8 android:roundIcon="@mipmap/ic_launcher_round" 9 android:roundIcon="@mipmap/ic_launcher_round"
9 android:supportsRtl="true" 10 android:supportsRtl="true"
10 android:theme="@style/NoActionBar"> 11 android:theme="@style/NoActionBar">
11 - <activity android:name=".SignInActivity"></activity> 12 + <activity android:name=".PushingTestActivity"></activity>
13 + <activity android:name=".SignInActivity" />
12 <activity android:name=".SignUpActivity" /> 14 <activity android:name=".SignUpActivity" />
13 - <activity android:name=".MainActivity"/> 15 + <activity android:name=".MainActivity" />
14 - <activity android:name=".SplashActivity" android:theme="@style/SplashTheme"> 16 + <activity
17 + android:name=".SplashActivity"
18 + android:theme="@style/SplashTheme">
15 <intent-filter> 19 <intent-filter>
16 <action android:name="android.intent.action.MAIN" /> 20 <action android:name="android.intent.action.MAIN" />
21 +
17 <category android:name="android.intent.category.LAUNCHER" /> 22 <category android:name="android.intent.category.LAUNCHER" />
18 </intent-filter> 23 </intent-filter>
19 </activity> 24 </activity>
20 </application> 25 </application>
26 +
21 </manifest> 27 </manifest>
...\ No newline at end of file ...\ No newline at end of file
......
1 +package com.example.vip
2 +
3 +import android.content.Intent
4 +import android.nfc.Tag
5 +import androidx.appcompat.app.AppCompatActivity
6 +import android.os.Bundle
7 +import android.util.Log
8 +import android.widget.Toast
9 +import com.google.android.gms.tasks.OnCompleteListener
10 +import com.google.firebase.iid.FirebaseInstanceId
11 +import kotlinx.android.synthetic.main.activity_main.*
12 +import kotlinx.android.synthetic.main.activity_pushing_test.*
13 +
14 +class PushingTestActivity : AppCompatActivity() {
15 +
16 + override fun onCreate(savedInstanceState: Bundle?) {
17 + super.onCreate(savedInstanceState)
18 + setContentView(R.layout.activity_pushing_test)
19 +
20 +
21 + intent.extras?.let {
22 + for (key in it.keySet()) {
23 + val value = intent.extras?.get(key)
24 + Log.d(TAG, "Key: $key Value: $value")
25 + }
26 + }
27 + confirmButton.setOnClickListener {
28 + FirebaseInstanceId.getInstance().instanceId
29 + .addOnCompleteListener(OnCompleteListener { task ->
30 + if (!task.isSuccessful) {
31 + Log.w(TAG, "getInstanceId failed", task.exception)
32 + return@OnCompleteListener
33 + }
34 +
35 + // Get new Instance ID token
36 + val token = task.result?.token
37 +
38 + // Log and toast
39 + val msg = getString(R.string.msg_token_fmt, token)
40 + Log.d(TAG, msg)
41 + Toast.makeText(baseContext, msg, Toast.LENGTH_SHORT).show()
42 + })
43 + }
44 + }
45 + companion object {
46 +
47 + private const val TAG = "MainActivity"
48 + }
49 +}
1 package com.example.vip 1 package com.example.vip
2 2
3 +import android.content.Intent
3 import android.os.Bundle 4 import android.os.Bundle
4 import android.view.Menu 5 import android.view.Menu
5 import android.view.MenuItem 6 import android.view.MenuItem
...@@ -16,6 +17,11 @@ class SignInActivity : AppCompatActivity() { ...@@ -16,6 +17,11 @@ class SignInActivity : AppCompatActivity() {
16 super.onCreate(savedInstanceState) 17 super.onCreate(savedInstanceState)
17 setContentView(R.layout.activity_signin) 18 setContentView(R.layout.activity_signin)
18 19
20 + testingButton.setOnClickListener {
21 + var intent = Intent(this, PushingTestActivity::class.java)
22 + startActivity(intent)
23 + }
24 +
19 val policyFieldList = ArrayList<PolicyFieldItem>() 25 val policyFieldList = ArrayList<PolicyFieldItem>()
20 26
21 policyFieldList.add( 27 policyFieldList.add(
......
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 + xmlns:app="http://schemas.android.com/apk/res-auto"
4 + xmlns:tools="http://schemas.android.com/tools"
5 + android:layout_width="match_parent"
6 + android:layout_height="match_parent"
7 + tools:context=".PushingTestActivity">
8 +
9 + <Button
10 + android:id="@+id/confirmButton"
11 + android:layout_width="wrap_content"
12 + android:layout_height="wrap_content"
13 + android:layout_marginEnd="321dp"
14 + android:layout_marginBottom="683dp"
15 + android:text="Confirm!"
16 + app:layout_constraintBottom_toBottomOf="parent"
17 + app:layout_constraintEnd_toEndOf="parent"
18 + app:layout_constraintStart_toStartOf="parent"
19 + app:layout_constraintTop_toTopOf="parent" />
20 +</androidx.constraintlayout.widget.ConstraintLayout>
...\ No newline at end of file ...\ No newline at end of file
...@@ -43,6 +43,12 @@ ...@@ -43,6 +43,12 @@
43 app:layout_constraintStart_toStartOf="parent" 43 app:layout_constraintStart_toStartOf="parent"
44 app:layout_constraintTop_toTopOf="parent"></androidx.viewpager.widget.ViewPager> 44 app:layout_constraintTop_toTopOf="parent"></androidx.viewpager.widget.ViewPager>
45 45
46 + <Button
47 + android:id="@+id/testingButton"
48 + android:layout_width="match_parent"
49 + android:layout_height="wrap_content"
50 + android:text="PushingPage" />
51 +
46 <androidx.recyclerview.widget.RecyclerView 52 <androidx.recyclerview.widget.RecyclerView
47 android:id="@+id/policyFieldRecyclerView" 53 android:id="@+id/policyFieldRecyclerView"
48 android:layout_width="match_parent" 54 android:layout_width="match_parent"
...@@ -57,7 +63,9 @@ ...@@ -57,7 +63,9 @@
57 android:layout_height="0dp" 63 android:layout_height="0dp"
58 android:layout_weight="1" 64 android:layout_weight="1"
59 android:id="@+id/fragmentContainer" 65 android:id="@+id/fragmentContainer"
60 - /> 66 + >
67 +
68 + </FrameLayout>
61 69
62 <com.google.android.material.bottomnavigation.BottomNavigationView 70 <com.google.android.material.bottomnavigation.BottomNavigationView
63 android:id="@+id/bottom_navigation" 71 android:id="@+id/bottom_navigation"
......
...@@ -12,9 +12,11 @@ ...@@ -12,9 +12,11 @@
12 <string name="title09">빈카테고리</string> 12 <string name="title09">빈카테고리</string>
13 <string name="title10">빈카테고리</string> 13 <string name="title10">빈카테고리</string>
14 14
15 - <string name= "alarm">Home</string> 15 + <string name="alarm">Home</string>
16 - <string name= "clock">추천정책</string> 16 + <string name="clock">추천정책</string>
17 - <string name= "timer">찜 목록</string> 17 + <string name="timer">찜 목록</string>
18 - <string name= "stopwatch">내 정보</string> 18 + <string name="stopwatch">내 정보</string>
19 +
20 + <string name="msg_token_fmt" translatable="false">InstanceID Token: %s</string>
19 21
20 </resources> 22 </resources>
......