简体   繁体   中英

Android: different components for different screens

I need to create an application similar to file browser - with opportunity to move through the files tree and looking into files.

What I want - is to make one app for both phone and tablet.

On tablet I want it to look like "Split View Based Application" on IPad On phone I want to have something like a button which shows the activity with files tree (which will be on the left on tablet)

Is it possible? I need to have a tablet-only-oriented activity with two groups (left one - for files tree, right - for file preview)

I already read about "Supporting multiple screens" on android dev. But they speak about different layouts of same components on different types of screen - I want to add there few "tablet-only" and "phone-only" components...

Or it's a dead-end?

It is definitely possible. I recommend Fragments for this task. They were introduced with honeycomb and are exactly for this kind of reusable UI parts you have in mind. There is also a compatibility lib for lower android versions (I believe down to 1.6.) inside ANDROID-SDK/extras/android/compatibility.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM