갤럭시 워치4 버스 어플 만들기 #2 Custom Listview 만들기
2022. 4. 30. 17:10ㆍProgramming/Android
결과화면
버스 이름과, 버스 시간 사이에 글씨체 차이가 있기를 바랐기에 Custom Listview를 만들어서 구현했다.
먼저, mainactivity 안에는 listview를 하나 생성해서 넣어둔다.
그리고 그 아래에다가 listview Layout.xml을 생성 구현한다.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/busID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="8106"
android:textSize="15dp"
android:layout_marginLeft="10dp"
android:textColor="@android:color/holo_orange_dark"/>
<TextView
android:id="@+id/firstBus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3정류장 전 / 3분 27초"
android:textSize="10dp"
android:layout_marginLeft="10dp"
android:textColor="@android:color/white"/>
<TextView
android:id="@+id/secondBus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="5정류장 전 / 3분 27초"
android:textSize="10dp"
android:layout_marginLeft="10dp"
android:textColor="@android:color/white"/>
</LinearLayout>
내가 원하는 점 : 버스 넘버, 첫 번째 버스가 오는 시간 , 두 번째 버스가 오는 시간을 원하기 때문에 String은 3개를 넣었다.
그 뒤에 뭐.. Adapter 만들고, listview를 채우고...
자세한 내용은 Github로 대신하겠다.
Github 주소
'Programming > Android' 카테고리의 다른 글
WhereMyBus_개인정보처리지침 (0) | 2022.06.12 |
---|---|
경기도 버스 노선 정보 (0) | 2022.05.18 |
갤럭시 워치4 버스 어플 만들기 #1 환경세팅 (0) | 2022.04.03 |
[JAVA] Foreground Service, send Intent object and thread (0) | 2021.02.20 |
[JAVA] Add Button in Notification (0) | 2021.02.20 |