This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var items by remember { | |
mutableStateOf((0 until 1000).toList()) | |
} | |
val scope = rememberCoroutineScope() | |
ItemList( | |
items = items, | |
onItemClick = { | |
// scope 안에서 데이터를 변경하면 key가 재역할을 하지 못한다. ViewModel에서 데이터를 변경해도 마찬가지일 것. rememberUpdatedState()의 개념이 힌트일지도 모르겠다. | |
// LazyColumn에선 key가 재역할을 못하더라도 화면에 보여지는 항목들만 Recomposition 대상으로 삼기 때문에 성능문제가 크진 않다. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : AppCompatActivity() { | |
private val compositeDisposable = CompositeDisposable() | |
@SuppressLint("CheckResult") | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
val nicknameInputField = findViewById<EditText>(R.id.nicknameInputField) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : AppCompatActivity() { | |
private var isButtonClickProcessing = false | |
@SuppressLint("CheckResult") | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
val nicknameInputField = findViewById<EditText>(R.id.nicknameInputField) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String newVersion = ""; | |
try { | |
Document document = Jsoup.connect("https://play.google.com/store/apps/details?id=" + cxt.getPackageName()).timeout(5000).get(); | |
if (document != null) { | |
newVersion = document.select(".hAyfc .htlgb").get(7).ownText(); | |
} | |
} catch (Exception e) { | |
e.printStackTrace(); | |
/*가끔 select()를 호출할 때 | |
jsoup의 처리문제인지 앱버전을 담고있는 div를 못찾는 경우가 발생하기 때문에 |