r/androiddev • • Sep 16 '18

Why does Android development feel like hell?

[deleted] — view deleted post

203 Upvotes

174 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Sep 16 '18

[deleted] — view deleted comment

9

u/Zhuinden Sep 16 '18

We used Groupie with RecyclerView and its support for ExpandableGroups and it was surprisingly straightforward to use.

1

u/ArmoredPancake Sep 16 '18

What do you want to do with it?

0

u/[deleted] Sep 16 '18

[deleted] — view deleted comment

1

u/[deleted] Sep 17 '18

I'd probably just use a RecyclerView, I guess you just have to implement getItemCount and also get the right child for the position, depending on the expanded state of your items. Just set the item's left margin to something * level of nested and it should look like a tree, I think. Something like that should work, I hope.

1

u/[deleted] Sep 16 '18

`OnCreateView` seems to work for just getting a TextView from the navigation drawer:

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View {
val view = inflater.inflate(R.layout.main_fragment, container, false)
val textView: TextView = view.findViewById(R.id.text)
textView.text = "Definitely working"
return view
}

<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true">
<TextView
android:id="@+id/text"
android:text="Hi!"
android:layout_gravity="center"
android:textAlignment="center"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.google.android.material.navigation.NavigationView>

0

u/[deleted] Sep 16 '18

[deleted] — view deleted comment

1

u/[deleted] Sep 17 '18

May Flutter save your soul.