Skip to content

Commit

Permalink
add listview but didnt show
Browse files Browse the repository at this point in the history
  • Loading branch information
Sag0ld authored and phildupuis committed Mar 25, 2018
1 parent d91f160 commit 5637a91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package com.mirego.csmapapplication.fragment

import android.support.v4.app.Fragment
import android.os.Bundle
import android.support.constraint.ConstraintLayout
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.ListView
import com.mirego.csmapapplication.R
import com.mirego.csmapapplication.component.LostObjectsAdapter
import kotlinx.android.synthetic.*


class ListSegmentFragment : Fragment() {
Expand All @@ -20,11 +20,11 @@ class ListSegmentFragment : Fragment() {
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_list, container, false)
val frameLayout = view.findViewById(R.id.fragmentRoot) as FrameLayout
val constraintLayout = view.findViewById(R.id.container) as ConstraintLayout
val listView = ListView(context)
val adapter = LostObjectsAdapter(context!!, ArrayList())
listView.adapter = adapter
frameLayout.addView(listView)
constraintLayout.addView(listView)
return view
}
}
3 changes: 2 additions & 1 deletion android/app/src/main/res/layout/fragment_piece.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:id="@+id/container">


<android.support.v7.widget.CardView
Expand Down

0 comments on commit 5637a91

Please sign in to comment.