Re: [android-developers] Re: Embeded ListViews

2016-01-23 Thread TreKing
On Fri, Jan 22, 2016 at 8:00 PM, Matt Fach  wrote:

> Hey thank you again for replying!  I really appreciate it.
> Lemme add the pictures.  Can you maybe explain this in more detail?
> "Again, if you need to represent a hierarchical structure (think file
> system) then you could very simply have a single activity that has a list
> of items, where clicking any item starts a new instance of the same
> activity with the list containing the children of the previously selected
> node. "
>

If you have a class MyListActivity, then when you open the app you start
like this:

MyListActivity (instance 1)
+-> ListView
+--> Item 1
+--> Item 2
+--> .

Now if you click on Item 1  you get a second instance of MyListActivity,
with the list containing the children nodes of Item 1

MyListActivity (instance 2)
+-> ListView
+--> Item 1 Subitem 1
+--> Item 2 Subitem 2
+--> .

Now if you click on Item 1 subitem 2, you get a third instance of
MyListActivity, with the list containing the children node of Item 1
Subitem 2.

And so on so forth.

Back to the file system example, this is akin to viewing your desktop and
list of all files and folders on your desktop, then clicking a folder and
viewing the files and folders that are contained there. Same view, same
interactions, just different data being operated on. Make sense?

Now then, this assumes that all of the data is of the same type (in this
case "Folder"). If the thing you click on describes something different
(say ".java file") then you will of course have to navigate to a different
screen that has a different display. So, using your own images as an
example, if you started on the first screen (MyListActivity) and selected
the first item, that would lead to MyDetailActivity for the selected item
(Aniracetam).

Basically what I want is for the user to be able to navigate though all the
> categories and discover different drugs.  for instance the users will get
> a list view of a bunch of different drug categories arranged by
> pharmacology.  Then the user can enter into one of those drug types.  Then
> in the next screen will be another list of that specific drug type broken
> down into more categories.  So multilevel listviews.  I don't really like
> the "expandable" listviews where it all shows on one screen.  It kinda
> looks sloppy
>

Good, I agree that would be sloppy, but that's what you described in your
first post. "ListView within Listviews" or "multilevel ListViews" sounds
like you want them embedded in each other in the same screen. What you're
looking for, what I'm describing, and what you are now describing, having
the user navigate to a next screen on selecting something, is "drilling
down".


> So, I am sure there is a much better way of approaching this.  Again, I
> was a little confused to your response I put in quotes.  Could you maybe go
> into a little more detail of what I should do to obtain this?  Or a better
> idea, ect..
>
> Do you understand basically what I am trying to do with my app?
>

This really sounds like a fairly straightforward drill-down list,
potentially ending in a detail screen (for the leaf node). There should be
more than enough info on the interwebs to get you going, assuming you get
your terms right. A few things to research:

   - ListView - displaying a simple list, selecting an item in the list,
   starting a new activity and passing it parameters
   - RecyclerView - same concepts
   - "master detail" flow
   - "drill down" flow

If you're still stuck, then provide specifics of what exactly you're stuck
on and we can help further.

On Fri, Jan 22, 2016 at 9:27 PM, Mark Phillips 
 wrote:

> As the user drills down into your data (ie selects an element from the
> list), all you need to change is the data displayed in the same listview.


Note that if you use this strategy, pressing back would immediately exit
the app, instead of "going back" as the expected default behavior. The
typical pattern is to launch a new activity on the stack (or a fragment if
that floats your boat) with the new data and let the system handle the back
navigation for you.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CANCScghG0b6Y2asLeCV8nB_gH%2B2YDc75it7fEHeu_-RjSUOdCw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Embeded ListViews

2016-01-22 Thread Matt Fach
Thanks for responding!!   It seems like I had a hard time conveying what I 
want to do.  Basically I want to have multilevel listviews.  I have only 
got it where I can embed one list view in a list view.  Do you know of any 
good tutorials that show how to do this?  This is basically a reference 
guide to a bunch of pharmacological drugs.  It is all arranged in different 
categories by different pharmacology types.  So if you look at the graph, 
every node is going to be a list view, but the children at all the drugs 
which will have a description of the drugs.  I attached a couple pics of 
how the app look like so you have a better idea of what I am trying to do. 
Sorry if my terminology is off.  But the issue I have right now i that I 
can only go down 3 nodes deep.  
If you could point me in the correct direction of how to get a correct data 
structure set up, or can point me to great tutorials on this, that would be 
awesome.  
Thanks

On Thursday, January 21, 2016 at 11:42:08 PM UTC-8, Matt Fach wrote:
>
>
> 
>
>
> 
> Hello everyone.
>
> I am trying to make embedded list views.  Anyone know of any good 
> tutorials around?  I can't find a single youtube video on this or even an 
> article written on how to do this.  I have a very large graph with a bunch 
> of nodes that I wannt turn into a navigational interface with listviews. 
>  Attatched is a picture of what I want to turn into an android app.  The 
> very bottom nodes all the children will all be fragmented activities.  
> So I basically want to do this
>
> -ListView
>  --ListView
> ---ListView
>ListView
>-Activity
>-Activity
> ListView
>-Activity
>-Activity
> ect...
> I was thinking of putting all the data in a JSON file and parsing that 
> into listviews?  But then again, I have no idea how to do this.
> Any help would be great. 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/fd44d702-4903-4d14-9b61-31334a44eedd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Re: Embeded ListViews

2016-01-22 Thread TreKing
On Fri, Jan 22, 2016 at 5:05 PM, Matt Fach  wrote:

> Thanks for responding!!
>

Sure thing holmes.


> It seems like I had a hard time conveying what I want to do.  Basically I
> want to have multilevel listviews.  I have only got it where I can embed
> one list view in a list view.  Do you know of any good tutorials that show
> how to do this?
>

You can look at ExpandableListView

for a built in widget that supports one level of depth and see if you can
modify it for your needs.
You may even be able to bend ReyclerView

to
do your bidding.

However, neither this is going to be easy, or even likely doable.
Attempting to have a listview that itself has a list of listviews, each of
which themselves have lists of listviews, is just going to lead to you
having yourself a bad day.

Again, if you need to represent a hierarchical structure (think file
system) then you could very simply have a single activity that has a list
of items, where clicking any item starts a new instance of the same
activity with the list containing the children of the previously selected
node.


> So if you look at the graph, every node is going to be a list view, but
> the children at all the drugs which will have a description of the drugs.
>

That wasn't clear.


> I attached a couple pics of how the app look like so you have a better
> idea of what I am trying to do.
>

I see no pics attached.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CANCScgiCMw2zwR-V1vb6jz--WVg_Kfuxkex06MUrRKzWkiuk4g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Re: Embeded ListViews

2016-01-22 Thread Matt Fach
Thank you for that!!!   

First off, I never thought of implementing it that way.  I know you said to 
use google, but what would I search in google to find a tutorial on how to 
simply change the data in the list view?  I'm not very good on terminology, 
so researching can be kinda tough for me.

Also, I completely understand what you are saying about the navigation 
issue.  To be honest, I sorta want to keep it this way, but the issue you 
brought up about having to click back to get to the home screen seems like 
an issue I have to look into.  I was told to put this all into a JSON file 
and have it read off of that to make the list views.  I still seem a little 
confused on how this is to be implemented.  I wouldn't know where to put 
the graph data.   I have each drug description all in my strings file, but 
as far as making the navigation with one list view, I feel a little lost on 
this.  Maybe if you know if any good youtube videos or online tutorials on 
this exact thy of thing, that would be great.  

Thank you again for answering! 

On Friday, January 22, 2016 at 7:35:39 PM UTC-8, Mark Phillips wrote:
>
> Matt,
>
> Assuming your data has some sort of hierarchy (ie Graph_10.jpg), then you 
> only need one listview in an activity. As the user drills down into your 
> data (ie selects an element from the list), all you need to change is the 
> data displayed in the same listview. You don't need an infinite set of 
> nested listviews, you just need to change the data behind the listview.
>
> In a nutshell, a listview has a dataAdapter providing the data. Once the 
> user makes a selection in the list view, change the data in the adapter and 
> use notifyDataSetChanged on the listview and the data displayed will change 
> to the new data set. 
>
> There are lots of examples on how to do this - Google is your best friend 
> here. 
>
> As an aside, you may want to do some research on Android UI best 
> practices. Looking at your data graph, I see two potential problems with a 
> listview solution.
>
> 1. (breadth issue) You might end up with a listview having scores of 
> elements at a particular level, and few will be willing to scroll all the 
> way through that list to find what they want. You might want to take a look 
> at the google contacts app as one way to handle this particular problem. 
>
> 2. (depth issue) The other problem you face is it may take 10 or more 
> steps to drill down to the final piece of data. This is annoying to the 
> user in the number of clicks it takes to get to the bottom of the 
> hierarchy, as well as the difficulty of getting back to the top, the 
> middle, or somewhere else in that hierarchy. Very easy to get lost and 
> frustrated with this approach. 
>
> You may want to take a hard look at the real problem you are trying to 
> solve for the user with all this data and find a different UI strategy that 
> solves that problem.
>
> I hope that helps shed some light on your questions, and good luck! 
>
> Mark
>
> On Fri, Jan 22, 2016 at 7:00 PM, Matt Fach  > wrote:
>
>>
>> Hey thank you again for replying!  I really appreciate it.  
>> Lemme add the pictures.  Can you maybe explain this in more detail?
>> "Again, if you need to represent a hierarchical structure (think file 
>> system) then you could very simply have a single activity that has a list 
>> of items, where clicking any item starts a new instance of the same 
>> activity with the list containing the children of the previously selected 
>> node. "
>>
>> Basically what I want is for the user to be able to navigate though all 
>> the categories and discover different drugs.  for instance the users will 
>> get
>> a list view of a bunch of different drug categories arranged by 
>> pharmacology.  Then the user can enter into one of those drug types.  Then 
>> in the next screen will be another list of that specific drug type broken 
>> down into more categories.  So multilevel listviews.  I don't really like 
>> the "expandable" listviews where it all shows on one screen.  It kinda 
>> looks sloppy
>>
>> So, I am sure there is a much better way of approaching this.  Again, I 
>> was a little confused to your response I put in quotes.  Could you maybe go 
>> into a little more detail of what I should do to obtain this?  Or a better 
>> idea, ect..
>>
>> Do you understand basically what I am trying to do with my app? 
>>
>> Thank again!
>>
>> Again, lemme know if I didn't convey anything properly.  I suck at 
>> explaining stuff.  :P
>>
>>
>>
>> On Friday, January 22, 2016 at 3:56:52 PM UTC-8, TreKing wrote:
>>>
>>>
>>> On Fri, Jan 22, 2016 at 5:05 PM, Matt Fach  wrote:
>>>
 Thanks for responding!!

>>>
>>> Sure thing holmes.
>>>  
>>>
 It seems like I had a hard time conveying what I want to do.  Basically 
 I want to have multilevel listviews.  I have only got it where I can embed 
 one list view in a list view.  Do you know of any good tutorials 

Re: [android-developers] Re: Embeded ListViews

2016-01-22 Thread Mark Phillips
Matt,

Assuming your data has some sort of hierarchy (ie Graph_10.jpg), then you
only need one listview in an activity. As the user drills down into your
data (ie selects an element from the list), all you need to change is the
data displayed in the same listview. You don't need an infinite set of
nested listviews, you just need to change the data behind the listview.

In a nutshell, a listview has a dataAdapter providing the data. Once the
user makes a selection in the list view, change the data in the adapter and
use notifyDataSetChanged on the listview and the data displayed will change
to the new data set.

There are lots of examples on how to do this - Google is your best friend
here.

As an aside, you may want to do some research on Android UI best practices.
Looking at your data graph, I see two potential problems with a listview
solution.

1. (breadth issue) You might end up with a listview having scores of
elements at a particular level, and few will be willing to scroll all the
way through that list to find what they want. You might want to take a look
at the google contacts app as one way to handle this particular problem.

2. (depth issue) The other problem you face is it may take 10 or more steps
to drill down to the final piece of data. This is annoying to the user in
the number of clicks it takes to get to the bottom of the hierarchy, as
well as the difficulty of getting back to the top, the middle, or somewhere
else in that hierarchy. Very easy to get lost and frustrated with this
approach.

You may want to take a hard look at the real problem you are trying to
solve for the user with all this data and find a different UI strategy that
solves that problem.

I hope that helps shed some light on your questions, and good luck!

Mark

On Fri, Jan 22, 2016 at 7:00 PM, Matt Fach  wrote:

>
> Hey thank you again for replying!  I really appreciate it.
> Lemme add the pictures.  Can you maybe explain this in more detail?
> "Again, if you need to represent a hierarchical structure (think file
> system) then you could very simply have a single activity that has a list
> of items, where clicking any item starts a new instance of the same
> activity with the list containing the children of the previously selected
> node. "
>
> Basically what I want is for the user to be able to navigate though all
> the categories and discover different drugs.  for instance the users will
> get
> a list view of a bunch of different drug categories arranged by
> pharmacology.  Then the user can enter into one of those drug types.  Then
> in the next screen will be another list of that specific drug type broken
> down into more categories.  So multilevel listviews.  I don't really like
> the "expandable" listviews where it all shows on one screen.  It kinda
> looks sloppy
>
> So, I am sure there is a much better way of approaching this.  Again, I
> was a little confused to your response I put in quotes.  Could you maybe go
> into a little more detail of what I should do to obtain this?  Or a better
> idea, ect..
>
> Do you understand basically what I am trying to do with my app?
>
> Thank again!
>
> Again, lemme know if I didn't convey anything properly.  I suck at
> explaining stuff.  :P
>
>
>
> On Friday, January 22, 2016 at 3:56:52 PM UTC-8, TreKing wrote:
>>
>>
>> On Fri, Jan 22, 2016 at 5:05 PM, Matt Fach  wrote:
>>
>>> Thanks for responding!!
>>>
>>
>> Sure thing holmes.
>>
>>
>>> It seems like I had a hard time conveying what I want to do.  Basically
>>> I want to have multilevel listviews.  I have only got it where I can embed
>>> one list view in a list view.  Do you know of any good tutorials that show
>>> how to do this?
>>>
>>
>> You can look at ExpandableListView
>> 
>> for a built in widget that supports one level of depth and see if you can
>> modify it for your needs.
>> You may even be able to bend ReyclerView
>> 
>>  to
>> do your bidding.
>>
>> However, neither this is going to be easy, or even likely doable.
>> Attempting to have a listview that itself has a list of listviews, each of
>> which themselves have lists of listviews, is just going to lead to you
>> having yourself a bad day.
>>
>> Again, if you need to represent a hierarchical structure (think file
>> system) then you could very simply have a single activity that has a list
>> of items, where clicking any item starts a new instance of the same
>> activity with the list containing the children of the previously selected
>> node.
>>
>>
>>> So if you look at the graph, every node is going to be a list view, but
>>> the children at all the drugs which will have a description of the drugs.
>>>
>>
>> That wasn't clear.
>>
>>
>>> I attached a couple pics of how the app look like so you have a better
>>> idea of what I am trying to do.
>>>
>>
>> I