Toggle navigation
Toggle navigation
This project
Loading...
Sign in
장연우
/
WELLO
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
신기성
2019-11-04 22:28:17 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c83aa34b7ed08bfc960d48857a83be0e30bd1c24
c83aa34b
1 parent
5ab5a92d
pushing test done
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
1 deletions
vip/app/src/main/AndroidManifest.xml
vip/app/src/main/java/com/example/vip/InfoActivity.kt
vip/app/src/main/java/com/example/vip/PushingActivity.kt
vip/app/src/main/res/layout/activity_pushing.xml
vip/app/src/main/res/values/strings.xml
vip/app/src/main/AndroidManifest.xml
View file @
c83aa34
...
...
@@ -9,7 +9,8 @@
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/NoActionBar"
>
<activity
android:name=
".DetailActivity"
></activity>
<activity
android:name=
".PushingActivity"
></activity>
<activity
android:name=
".DetailActivity"
/>
<activity
android:name=
".InfoActivity"
/>
<activity
android:name=
".FavoritesActivity"
/>
<activity
android:name=
".RecommendActivity"
/>
...
...
@@ -27,6 +28,8 @@
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
...
...
vip/app/src/main/java/com/example/vip/InfoActivity.kt
View file @
c83aa34
package
com.example.vip
import
android.content.Intent
import
androidx.appcompat.app.AppCompatActivity
import
android.os.Bundle
import
android.widget.ImageView
import
android.widget.RatingBar
import
android.widget.TextView
import
kotlinx.android.synthetic.main.activity_info.*
class
InfoActivity
:
AppCompatActivity
()
{
...
...
@@ -22,5 +24,13 @@ class InfoActivity : AppCompatActivity() {
profilImage
.
setImageResource
(
R
.
drawable
.
image01
)
//temp
//pushing test start
InfoButtonSettings
.
setOnClickListener
{
var
intent
=
Intent
(
this
,
PushingActivity
::
class
.
java
)
startActivity
(
intent
)
}
//pushing test end
}
}
...
...
vip/app/src/main/java/com/example/vip/PushingActivity.kt
0 → 100644
View file @
c83aa34
package
com.example.vip
import
androidx.appcompat.app.AppCompatActivity
import
android.os.Bundle
import
android.util.Log
import
android.widget.Toast
import
com.google.firebase.messaging.FirebaseMessaging
import
kotlinx.android.synthetic.main.activity_pushing.*
class
PushingActivity
:
AppCompatActivity
()
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_pushing
)
subscribeButton
.
setOnClickListener
{
Log
.
d
(
TAG
,
"Subscribing to weather topic"
)
// [START subscribe_topics]
FirebaseMessaging
.
getInstance
().
subscribeToTopic
(
"news"
)
.
addOnCompleteListener
{
task
->
var
msg
=
getString
(
R
.
string
.
msg_subscribed
)
if
(!
task
.
isSuccessful
)
{
msg
=
getString
(
R
.
string
.
msg_subscribe_failed
)
}
Log
.
d
(
TAG
,
msg
)
Toast
.
makeText
(
baseContext
,
msg
,
Toast
.
LENGTH_SHORT
).
show
()
}
// [END subscribe_topics]
}
}
companion
object
{
private
const
val
TAG
=
"PushingActivity"
}
}
vip/app/src/main/res/layout/activity_pushing.xml
0 → 100644
View file @
c83aa34
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".PushingActivity"
>
<Button
android:id=
"@+id/subscribeButton"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"134dp"
android:layout_marginTop=
"332dp"
android:layout_marginEnd=
"189dp"
android:layout_marginBottom=
"351dp"
android:text=
"Button"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
vip/app/src/main/res/values/strings.xml
View file @
c83aa34
...
...
@@ -19,5 +19,7 @@
<string
name=
"msg_token_fmt"
translatable=
"false"
>
InstanceID Token: %s
</string>
<string
name=
"msg_subscribed"
translatable=
"false"
>
success!
</string>
<string
name=
"msg_subscribe_failed"
translatable=
"false"
>
fail!
</string>
</resources>
...
...
Please
register
or
login
to post a comment