开源软件名称(OpenSource Name):cricklet/Android-PanesLibrary开源软件地址(OpenSource Url):https://github.com/cricklet/Android-PanesLibrary开源编程语言(OpenSource Language):Java 100.0%开源软件介绍(OpenSource Introduction):Disclaimer: unfortunately, I don't do Android dev anymore, so I can't maintain this library. PanesLibraryThis library makes it easy to make native Android apps with multi-pane tablet layouts. On the phone, the app appears as a conventional app with a sliding menu and a content pane where fragments are stacked on top of each other. On the tablet, the menu and all other fragments appear in dynamically added panes of varying sizes. ExampleExampleActivity demonstrates all the necessary configuration for using PanesActivity. ExampleFragment uses a layout with two TextViews and a Button. The TextViews hold the index of the fragment and the length of time it's been alive. This is used to demonstrate that fragments are correctly retained on activity restarts. The Button has a callback which creates a new fragment and adds it to the parent activity. Using PanesLibraryMake sure you have the most up-to-date support library and ActionBarSherlock. Have your activity extend PanesActivity. Then, add fragments to the activity using the following functions:
You also need to provide a PaneSizer. This object allows you to programatically set the width of each pane based on the type of Fragment/View you want to place inside the pane. You should also implement updateFragment(...). This is run whenever a fragment is added (even on activity restarts). Fragments are added onto a stack where the 0th fragment is the menu. Here's an example of what this means:
Note: PanesActivity requires you to use fragments. If you don't use fragments, you can still use PanesLayout manually. PanesLayout (this controls the tablet layout)The hierarchy of a PanesLayout looks like this:
A PanesLayout can hold any number of panes. Each pane is made up of a PaneScrollView (which allows the pane contents to slide left & right), a PaneView (which provides padding on the left of the content), and some content (i.e. fragment). Variables associated with each pane:
To add/remove/get panes:
Listeners/delegates:
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论