- Input: A connected, undirected graph G = (V , E) with positive edge weights.
- Output: A subset of edges E′ ⊆ E of minimum total weight such that the graph (V , E′) is connected.
The set E′ always forms a tree.
The set E′ always forms a tree.
private fun getLanguage(): String { | |
val lang = Locale.getDefault().language | |
val country = Locale.getDefault().country | |
val langTag = Locale.getDefault().toLanguageTag() | |
if(lang.contains("zh")) { | |
if(country == "TW") { | |
return "Traditional Chinese" | |
} else { | |
if(langTag.contains("Hant")) { | |
return "Traditional Chinese" |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:lineSpacingMultiplier="1.2"/> |
// Hide the keyboard. | |
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager | |
imm.hideSoftInputFromWindow(view.windowToken, 0) |
<?xml version="1.0" encoding="utf-8"?><!-- | |
~ Copyright 2018, The Android Open Source Project | |
~ | |
~ Licensed under the Apache License, Version 2.0 (the "License"); | |
~ you may not use this file except in compliance with the License. | |
~ You may obtain a copy of the License at | |
~ | |
~ http://www.apache.org/licenses/LICENSE-2.0 | |
~ | |
~ Unless required by applicable law or agreed to in writing, software |
Explicit Intents launch specific activity.
Implicit Intents specify WHAT you want done and system chooses activity.
Intent Action: the type of thing that the app wants to have done on its behalf, such as ACTION_VIEW, ACTION_DIAL or ACTION_EDIT
Intent Category adds a subtype to the action, such as CATEGORY_APP_MUSIC, CATEGORY_APP_GALLERY, CATEGORY_APP_MAPS, CATEGORY_APP_CALCULATOR, CATEGORY_APP_EMAIL, CATEGORY_APP_CALENDAR
**Intent Data Type (MIME Data Type) ** allows activities to support specific data types.
private fun ObjectAnimator.disableViewDuringAnimation(view: View) { | |
addListener(object : AnimatorListenerAdapter() { | |
override fun onAnimationStart(animation: Animator?) { | |
view.isEnabled = false | |
} | |
override fun onAnimationEnd(animation: Animator?) { | |
view.isEnabled = true | |
} | |
}) |