Closed yuxingfafu closed 5 years ago
Hey, Thanks :)
Sorry to say but there is no support for grid layout in BoardView. You are welcome to fork and try and add it yourself however.
DragListView supports gridlayout which you can see in the sample app, but then you won't get the paging feature like in BoardView.
BR Magnus
thanks you very much! how DragListView could drag or sort with page? could you help me?
https://github.com/zhuguohui/PageGridView https://github.com/GcsSloop/pager-layoutmanager
i am not familiar with code, could you add the function for DragListView ,if so, it could work like launcher:
thanks you very much:)
Actually when I think about it I think it is easiest to add grid support to the BoardView. I will take a look at it. I will go on vacation in 3 days however so if it is trickier than I think you gonna have to wait until I come back.
thank you very much :) at the same time i will try my idea, try could modify it by myself. thank you very much. i look forward your new version could done like launcher:)
I just released version 1.6.5. Here I added support to provide an own layout manager when adding a column. In the sample app you can now switch between grid and list in the overflow menu to try it out.
It will not give you a launcher layout with holes in it but it will give you a grid. If you want one with holes in it you need to implement your own layoutmanager and provide when adding a column.
BR Magnus
thank you,i will have a try :)
thank a lot,woxblom i found there 2 question;like the gif pic show,could you help ,
1.if column=4,row=4, and i drop one page to second page, the second item is all realy 16 items, i should not move success. should move failed. i read some code ,but i cound not find where to control it
2.scoller to left or right is too sensitive, i just move a little left of right , it will scoll to left page or right page. i try to modify code float scrollEdge = getResources().getDisplayMetrics().widthPixels * (isPortrait ? 0.18f : 0.14f); but not efftct
You call setBoardCallback on BoardView and implement that interface to choose which items can move and where they can be dropped.
Yeah I agree it is to sensitive. I have made an update which makes it better. I changed 0.18 to 0.06. So it is the correct place you tried to change. Version 1.6.6 should be out soon with the change.
thanks a lot, i will hava a try the second question. but for the first question,i also have a doubt, the interface BoardCallback as flow.how could i just the original and target item on which page, how could i get the current page item nums? ` mBoardView.setBoardCallback(new BoardView.BoardCallback() { @Override public boolean canDragItemAtPosition(int column, int dragPoon) { Log.d("1111111111",column+","+dragPoon); // Add logic here to prevent an item to be dragged return true; }
@Override
public boolean canDropItemAtPosition(int oldColumn, int oldRow, int newColumn, int newRow) {
Log.d("22222222",oldColumn+","+oldColumn);
Log.d("2222222",newColumn+","+newRow);
// Add logic here to prevent an item to be dropped
return true;
}
`});````
sorry,i also i other question, if i want to persistence the data to sqlite or SharedPreferences,how get the BoardView the datasoure ,and save it, and when i reboot phone, I wanto read the persistence data(sqllite or SharedPreferences) and set the persistence data for BoardView ,if so it could keep the original sort as well
You have the source already as you are sending in the adapters for the diffferent columns. It is that source you will have to check.
About persistence, I think you need to google that yourself for a bit as that is a big question and not part of this lib.
BR Magnus
thanks a lot. i try to modify the animation when long clicked to drag,but not effect,(i want to add shake with all items like launcher ios ) the class DragItem startDrag and endDrag method. i try to hide the mRealDragView with startDrag,and show mRealDragView with endDrag ,like gif below ,could give me some tips? thanks you :)
Sorry I don't really know. You will have to experiment with the lib and see what you can achieve.
thank you, i will try my idea.
i found other question;when lib boardview on Landscape ,for example the phone width is 1280,the height is 800.
so i modify the code
class BoardView onFinishInflate method
mColumnWidth = 1280; i write it hard code.
scoll betwen page not effect. it may stay the middle area between two page.
I don't think you should hard code stuff. Use the real width taken from the view in that case.
for this questtion.i try ,found when draging on one page,i will easyly drop to other page. is there reason with mColumnWidth = (int) (res.getDisplayMetrics().widthPixels ); i modify
i try modify mColumnWidth = (int) (res.getDisplayMetrics().widthPixels ); also have the question ,could help me to analysis
No the reason is the value on line 369. The lower value the less sensitive it is.
how the appropriate it should be? float scrollEdge = getResources().getDisplayMetrics().widthPixels * (isPortrait ? 0.06f : 0.14f);
I works for me if is set the width to mColumnWidth = (int) (res.getDisplayMetrics().widthPixels ); and then change setSnapToColumnInLandscape to true. Then I can switch pages without any problem.
You will have to try different values yourself. If you set it to 0 then you need to move the finger all the way to the edge.
thank you, i try my idea,but also have a question with animation ,could help me check some code, if convenient, i send code to you email?
If it is an isolated question about animation you can post it here. I don't have time to do deep analysis of bigger stuff unfortunately.
thank you very much
the zip code is below DragListView.zip
the animation gif is follow:
So what is your question about the animation? :)
en,
and the sensitive i modify as your code ,it's ok now
with the animation, could add a function as follow: when long click trigger drag, it add a empty page, if so , could drag the item long clicked to a new empty page. :) thanks you
That is specific features regarding implementing a home screen. I will not add that to the main lib but you can fork the lib and add it yourself.
Will close this issue now.
first of all,thank you very much:) thank you for your work.
i want to how BoardView or DragListView customer column and rows like launcher? i want to user it to develop a view like launcher,andr sort icons like ios desk,at the same time could drag between pages.
thanks a lot:)
could this can help me? thanks you very much :)