[UI] scrollable gridview
This commit is contained in:
parent
8747e44ae6
commit
743c74b2f2
|
@ -5,8 +5,8 @@ import android.provider.BaseColumns
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.GridView
|
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
|
import androidx.gridlayout.widget.GridLayout
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple [Fragment] subclass.
|
* A simple [Fragment] subclass.
|
||||||
|
@ -41,7 +41,7 @@ class StorageFragment : Fragment() {
|
||||||
val netWeight = getDouble(getColumnIndexOrThrow(ProductContract.ProductEntry.PRODUCT_NET_WEIGHT))
|
val netWeight = getDouble(getColumnIndexOrThrow(ProductContract.ProductEntry.PRODUCT_NET_WEIGHT))
|
||||||
val pictureFilename = getString(getColumnIndexOrThrow(ProductContract.ProductEntry.IMAGE_FILENAME))
|
val pictureFilename = getString(getColumnIndexOrThrow(ProductContract.ProductEntry.IMAGE_FILENAME))
|
||||||
|
|
||||||
getView()?.findViewById<GridView>(R.id.contentGridLayout)?.addView(
|
getView()?.findViewById<GridLayout>(R.id.contentGridLayout)?.addView(
|
||||||
AbstractProductView(
|
AbstractProductView(
|
||||||
requireActivity(),
|
requireActivity(),
|
||||||
requireContext(),
|
requireContext(),
|
||||||
|
@ -51,6 +51,7 @@ class StorageFragment : Fragment() {
|
||||||
category = 1
|
category = 1
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
// getView()?.findViewById<GridView>(R.id.contentGridLayout)?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools" android:layout_width="300dp"
|
xmlns:tools="http://schemas.android.com/tools" android:layout_width="200dp"
|
||||||
android:layout_height="300dp">
|
android:layout_height="200dp">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="300dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="300dp" android:id="@+id/productLayout">
|
android:layout_height="match_parent" android:id="@+id/productLayout" android:outlineProvider="bounds">
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="179dp" app:srcCompat="@android:drawable/ic_btn_speak_now"
|
android:layout_height="100dp" app:srcCompat="@android:drawable/ic_btn_speak_now"
|
||||||
android:id="@+id/productPicture"
|
android:id="@+id/productPicture"
|
||||||
app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"/>
|
app:layout_constraintEnd_toEndOf="parent"/>
|
||||||
|
|
|
@ -4,17 +4,15 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".StorageFragment">
|
tools:context=".StorageFragment">
|
||||||
<androidx.gridlayout.widget.GridLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent" android:id="@+id/contentGridLayout" app:columnCount="2"
|
|
||||||
app:rowCount="100">
|
|
||||||
|
|
||||||
</androidx.gridlayout.widget.GridLayout>
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"
|
<androidx.gridlayout.widget.GridLayout
|
||||||
android:orientation="vertical" android:id="@+id/contentLayout"/>
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" android:id="@+id/contentGridLayout" app:columnCount="2"
|
||||||
|
app:rowCount="100" android:nestedScrollingEnabled="true">
|
||||||
|
|
||||||
|
</androidx.gridlayout.widget.GridLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
Loading…
Reference in New Issue