- Learning Concurrency in Kotlin
- Miguel Angel Castiblanco Torres
- 88字
- 2021-08-05 10:46:48
Adding UI elements
Now we can start adding some UI elements to do some testing. First, let's update the layout of MainActivity, which is located in res/layout/activity_main.xml. For now, just adding a ProgressBar will do, so let's replace the contents of the ConstraintLayout so that a ProgressBar is located in the middle of the screen:
<android.support.constraint.ConstraintLayout ...>
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
By running the application, you will now only see the circular progress bar infinitely spinning. Let's use that spinner to see how the wrong handling of threads can affect the UI.
推薦閱讀
- ExtGWT Rich Internet Application Cookbook
- 小程序實戰視頻課:微信小程序開發全案精講
- Oracle Database In-Memory(架構與實踐)
- Java Web基礎與實例教程(第2版·微課版)
- Apache Hive Essentials
- FreeSWITCH 1.6 Cookbook
- 深入理解Java7:核心技術與最佳實踐
- 云計算通俗講義(第3版)
- Effective Python Penetration Testing
- MongoDB,Express,Angular,and Node.js Fundamentals
- Learning Node.js for .NET Developers
- Python:Deeper Insights into Machine Learning
- Flink技術內幕:架構設計與實現原理
- 大學計算機應用基礎(Windows 7+Office 2010)(IC3)
- Hands-On Data Visualization with Bokeh