Should I use two recyclerViews or more in this case? - kotlin

I'm trying to build my first app (a quiz game) and I'm using recyclerViews.
And the thing is that when I open the activity I'm able to see two recyclerViews and I have to press on the items in the second recyclerView in order to change the items from the first recyclerView.
The quiz has 6 steps and I can use these 2 recyclerViews for all of them.
But by doing that I get in my opinion a bit too much code for only 2 recyclerViews because even if the logic is the same, l work with different items in every step and I have to duplicate the code for their particular needs.
I can also create more recyclerViews, 6 or 12 for all the steps like every step has its own recyclerViews.
But by doing that I get more code.
What is better, to use 2 recyclerViews for all 6 steps and to work with their items, or to use more recyclerViews and then make them appear and disappear at the right time?
Thank you in advance.

Related

Custom odoo module - how to make a table

I am creating a custom module with additional part numbers on a separate tab in the products screen. I have built the module, but am having trouble figuring out how to display the information so it matches the layout in the attached image. I have tried tree view but have not been able to get the fields on the same line. Can this only be accomplished through css or is there a table view that I am not aware of?
I also need to make sure that all of the information in row 1 stays tethered together for additional forms, etc. My plan is to make the field names for each row end with a different number (i.e. x_mfrname1,x_mfrpn1,x_mfrname2,x_mfrpn2, etc.). Can somebody please just tell me if I am on the right track. This is the initial Odoo setup for a client of mine and I don't want them to come back to me down the line and find out I forgot something. I have been scouring the internet and reading a few books but I am not completely confident.
Here is a link to a layout of what I am talking about:
MFG Part Number Tab
Thanks!
class sub_part_details(models.Model)
_name='sub.part.detail'
primary_pn=fields.Boolean('Primary P/N')
obsolete=fields.Boolean('Obsolete')
pn=fields.Char('P/N')
desc=fields.Char('Description')
upgrade=fields.Char('Upgrade')
part_detail_id=fields.Many2one('part.details')
class part_details(models.Model)
_name='part.details'
cat=fields.Char('CAT')
sub_ass=fields.Char('Subassembly')
main_ass=fields.Char('Main Assembly')
notes=fields.Text('Notes')
sub_details_ids=fields.One2Many(''sub.part.detail','part_detail_id')
It might be helpful

ListView with backward forward navigation and limited elements

In Sencha, how to create a DataView or List component which renders only 1 item at a time and contains prev/next buttons to navigate data?
Store has pagination enabled to pull only 5 records at a time. Out of these 5 records I want to display only 1 record at a time on the view and with navigation buttons to move forward/backwards. Is there a built-in component for this requirement?
I see few SO posts (Sencha Touch limit number of items in list) suggesting to use 2 stores (DisplayStore to slice the actual data). This didn't work for me. I tested this with static data in the actual store. It still renders all the data in the list. Moreover I am looking for forward/backward navigation buttons too.
If there is no such built-in component (at least close enough), I want to create one for my needs. Please suggest.
You should go with a filter, and two buttons.
The handler for the next button could be alike
var number= list.getStore().first().getId()
list.filter('id', number+1)
If there is anyway to increase a number for the next valid item. Otherwise you need a counter of your current selected item and increase that.

SDK2: drag and drop between two grids

Using SDK2, I've got two grids that are sorted by rank, so you can re-rank by dragging and dropping in each grid.
I would also like to drag and drop between the two grids-- imagine two team backlogs and you want to take a ranked story from one team and rank it in another team's backlog.
This seems like it would be common so is there a good example of how to do this with a Rally Grid?
I'm starting to read the following:
http://docs.sencha.com/extjs/4.2.1/#!/guide/drag_and_drop
But there always seem to be a few gotcha's, and for example I'm not sure how to not break the current drag drop within the grid.
SDK 2.0rc1 is built on Ext 4.1.1a- the drag and drop functionality should be similar though. You should be able to do this in an app as long as both the grids are in the same app. This is a limitation due to the fact that apps run in an iframe in Rally and you can't drag and drop across the iframe boundary.
All you should need to do is pass enableRanking true at construction of your grid. You also will probably need to include Rank in your fetch.

Add Queries to Team Favourites in the Process Template - TFS2012

We are using the Agile Process Template of TFS2012 (slightly modified) and I want to add queries to Team Favourites in the template so that they will be automatically added on creation of a new team project. We want to see the same queries for every team project.
I have modified the template so that instead of the 3 Iterations being created (Iteration 1, Iteration 2 & Iteration 3), it just creates a single Iteration named 'Current'. I have then updated all of my queries to point to the 'Current' iteration instead of Iteration 1. Now I need to add these queries to Team Favourites so that they display on the web screens automatically.
Can this be done?
Thanks
Pretty sure that queries are relative to one team project, and one only.
Displaying queries on the Team Favorites section can be achieved by following these steps:
From the team home page, click the link for View work items
In the work item page left pane, find the query that you want to show
Right click on the query name
Select 'Add to team favorites'"
Also see the following article, the section on Shared Queries:
http://msdn.microsoft.com/en-us/library/dd286695.aspx

Virtual TableViewer sorting causes selection problems

Our application is an RCP appliction and needs to display table of several thousands items. For this reason, we're using SWT.VIRTUAL in our TableViewer. That works pretty well except for selection.
We're having following issue :
Our TableViewer support sorting and filtering. When we use a virtual tableviewer, changing the selection does not preserve the current selected item but the row currently selected.This leads to another item being selected.
e.g: If Item 'A' present at the 5th row is selected by user and sorting is performed, then after sorting the Item at the 5th row gets selected instead of the Item 'A'.
Using a non virtual TableViewer, everything works fine.
We tried to go into debug and found out that the cache from the AbstractTableViewer.VirtualManager class seems to be up to date with the model.
Forcing the cache to be used in the AbstractTableViewer.virtualSetSelectionToWidget() can be a possible approach.
We have tried to implement a solution suggested in https://bugs.eclipse.org/bugs/show_bug.cgi?id=338696. However it didn't work.
Please suggest some pointers or alternative work around.
Thanks for the answers.
As a workaround for working with huge tables I would suggest you to take a look at the Nattable project http://www.eclipse.org/nattable/. It supports everything you need (sorting, filtering, tree structured elements, lazy loading etc.). We successfully use it in our project, where it is necessary to display hundreds of thousands elements as a tree with around 160 columns. It also has some pretty cool styling features, which can make your table more user-friendly and interactive. Hope this helps