Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking out every service of the project #2

Open
wants to merge 34 commits into
base: next
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
18a57d9
convert Marquee java to kt and apply kotlin plugin
lynring24 Jul 22, 2017
7132a98
convert text.LogTextBox1 java to kt
lynring24 Jul 22, 2017
9d24dc9
convert LogTextBox && Link java to kt
lynring24 Jul 22, 2017
92054df
found </a> missing
lynring24 Jul 22, 2017
48bfdd1
modified a depreciated Html.fromHtml() by version
lynring24 Jul 22, 2017
eb2138c
convert SeekBar java to kt
lynring24 Jul 29, 2017
2d22fac
converted AlarmController java to kt
lynring24 Jul 29, 2017
4baef90
removed comment
lynring24 Aug 11, 2017
01b8e36
used by lazy for t2(textView)
lynring24 Aug 11, 2017
b1d8c18
used lazy for t3 (textView)
lynring24 Aug 11, 2017
fed790f
used lazy for val t4
lynring24 Aug 11, 2017
88ec3ae
used lazy to init var mText and removed !!.apend
lynring24 Aug 11, 2017
3793084
use Kotlin synthetic property instead of java calendar.set()
lynring24 Aug 11, 2017
f965748
apply plugin: 'kotlin-android-extensions'
lynring24 Aug 11, 2017
b3a28ad
used extention code instead of findViewById
lynring24 Aug 11, 2017
1ae905e
convert AlarmService to kt
lynring24 Aug 11, 2017
aa830bf
FragmentAlertDialog converted to kt
lynring24 Aug 12, 2017
294f902
simplify DialogInterface.OnClickListener with Lamda
lynring24 Aug 12, 2017
5c595f5
add string resource for Fragment Alert Dialog msg
lynring24 Aug 12, 2017
9fd3753
used extention code instead of findViewById
lynring24 Aug 12, 2017
957b74d
applied lamda to onClickListener
lynring24 Aug 12, 2017
fe87cba
used kotlin properies instead
lynring24 Aug 12, 2017
829252c
fixed FragmentAlertDialog::doPositiceClick to (activity as Fragment) …
lynring24 Aug 12, 2017
dad4a72
Convert AlarmService_service to kotlin
lynring24 Aug 26, 2017
94cabb8
Convert IsolatedService to Kotlin
lynring24 Aug 26, 2017
f186edd
Convert IsolatedService2 to Kotlin
lynring24 Aug 26, 2017
df13761
Convert LocalService to Kotlin
lynring24 Aug 26, 2017
5f54bf2
Import Context
lynring24 Aug 26, 2017
45480b8
Convert LocalServiceActivies to Kotlin
lynring24 Aug 26, 2017
61d55d8
Convert NotificationBackgroundService to Kotlin
lynring24 Aug 26, 2017
a5e599a
changed to extension code
lynring24 Aug 26, 2017
c980368
Convert NotifyingController to Kotlin
lynring24 Aug 26, 2017
a0398a3
Convert NotifyingService to Kotlin
lynring24 Aug 26, 2017
9c90694
Convert ServiceStartArguments to Kotlin
lynring24 Aug 26, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 30 additions & 27 deletions mobile/src/main/java/com/example/android/apis/text/Link.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Link : Activity() {
// respond to user input. To make them active, you need to
// call setMovementMethod() on the TextView object.

val t2 :TextView by lazy {
val t2 by lazy {
findViewById<View>(R.id.text2) as TextView
}
t2.movementMethod = LinkMovementMethod.getInstance()
Expand All @@ -58,36 +58,39 @@ class Link : Activity() {
// illustrate how you might display text that came from a
// dynamic source (eg, the network).

val t3 = findViewById<View>(R.id.text3) as TextView
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
t3.text = Html.fromHtml(
"<b>text3: Constructed from HTML programmatically.</b> Text with a " +
"<a href=\"http://www.google.com\">link</a> " +
"created in the Java source code using HTML.", Html.FROM_HTML_MODE_LEGACY)
val t3 by lazt {
findViewById<View>(R.id.text3) as TextView
}
else{
t3.text = Html.fromHtml(
"<b>text3: Constructed from HTML programmatically.</b> Text with a " +
"<a href=\"http://www.google.com\">link</a> " +
"created in the Java source code using HTML.")
}
t3.movementMethod = LinkMovementMethod.getInstance()
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
t3.text = Html.fromHtml(
"<b>text3: Constructed from HTML programmatically.</b> Text with a " +
"<a href=\"http://www.google.com\">link</a> " +
"created in the Java source code using HTML.", Html.FROM_HTML_MODE_LEGACY)
}
else{
t3.text = Html.fromHtml(
"<b>text3: Constructed from HTML programmatically.</b> Text with a " +
"<a href=\"http://www.google.com\">link</a> " +
"created in the Java source code using HTML.")
}
t3.movementMethod = LinkMovementMethod.getInstance()

// text4 illustrates constructing a styled string containing a
// link without using HTML at all. Again, for a fixed string
// you should probably be using a string resource, not a
// hardcoded value.
// text4 illustrates constructing a styled string containing a
// link without using HTML at all. Again, for a fixed string
// you should probably be using a string resource, not a
// hardcoded value.

val ss = SpannableString(
"text4: Manually created spans. Click here to dial the phone.")
val ss = SpannableString(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setSpan 을 Apply로 하는 방법도 가능해요

"text4: Manually created spans. Click here to dial the phone.")

ss.setSpan(StyleSpan(Typeface.BOLD), 0, 30,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
ss.setSpan(URLSpan("tel:4155551212"), 31 + 6, 31 + 10,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
ss.setSpan(StyleSpan(Typeface.BOLD), 0, 30,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
ss.setSpan(URLSpan("tel:4155551212"), 31 + 6, 31 + 10,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)

val t4 = findViewById<View>(R.id.text4) as TextView
t4.text = ss
t4.movementMethod = LinkMovementMethod.getInstance()
val t4 = findViewById<View>(R.id.text4) as TextView
t4.text = ss
t4.movementMethod = LinkMovementMethod.getInstance()
}
}
}