android - How to confine a ViewPager into a fragment rather than occupy the entire screen? -


The layout I'm working on is a classical two-pane master-detail layout. The menu in the left pane, pressing a menu item in the Dampen, shows the pieces being displayed. One of the menu items initiates the visual pager swiping structure. This ViewPager structure includes a ScreenSlideActivity and a ScreenSlidePageFragment classes. As the first class, standard, ViewPager object puts an indicator with the same type of methods like getItem and getFragment to the adiitter (screensailide pager adapters).

Everything works fine, except that the ViewPager is on the whole screen, compared to the right panel.

Q: How can I get a ViewPager to see itself in the right panel instead of capturing the entire screen? LinearLayout xmlns: android = "http://schemas.android.com/ apk / res / android" xmlns: tool = "http://schemas.android.com/tools" Android: layout_width = "match_parent" Android: layout_height = Android: layout_marginLeft = "16dp" Android: layout_marginRight = "16dp" Android: Baseline Allied = "Fotal" Android: Divider = "Android: ATR / Divider Horizontal" Android: Orientation = "Horizontal" Android: Show Dividers = " Medium "Tools: Reference =" Tactile "& gt; & Lt ;! - This layout is a two-way layout for item master / extension flow, for example an example of layout nicknames, res / values-large / refs.xml and res / values-sw600dp / refs.xml that refer to this two-panel version Along with the single-panel version of the layout. For more information on layout aliases, see: http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters - & gt; & Lt; LinearLayout Android: layout_width = "wrap_content" Android: layout_height = "match_parent" android: orientation = "vertical" & gt; & Lt; Android: layout_height = "match_parent" android: id = "@ + id / item_list" Android: name = "com.company.ItemListFragment" Android: layout_width = "match_parent" android: layout_height = "match_parent" android: layout_weight = "1" tool: layout = "@ Android: layout / list_content "/> & Lt; Android: layout_height = "wrap_content" Android: layout_marginLeft = "10dip" Android: layout_marginRight = "20dip" Android: layout_marginTop = "10dip" Android: layout_marginbottom: imageView android: id = "@ + id / imageView1" Android: layout_width = "wrap_content" = "20 dip" Android: src = "@drawable / icon" /> & Lt; / LinearLayout & gt; & Lt; FrameLayout Android: id = "@ + id / item_detail_container" Android: layout_width = "0dp" Android: layout_height = "match_parent" android: layout_weight = "3" /> & Lt; / LinearLayout & gt;

The menu item that closes the watch page does this:

  intent = new intent (this, ScreenSlide New Activity.class); StartActivity;   

I get a signal for a solution, but it is based on the excluded activity group (the solution at the grassroots level).

Any other means of using activities within the activity group or other activities have been excluded.

You do not have your visual page structure inside an activity,

Starting your activity with an intention from there you just pop your slice in place of your R.id.item_detail_container Instead of a simple

  FragmentTransaction transaction = getSupportFragmentManager () .beginTransaction (); ScreenSlideNewFragment Piece = New ScreenSlideNewFragment (); Transaction.replace (R.id.item_detail_container, fragment); Transaction.commit ();   

Changing the activity into one piece is straight forward because lifestyle is very similar.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -