Skip to content

Commit d94bfe7

Browse files
committed
fix magicindicator so that the viewpager for tunnel in portrait mode expands correctly
1 parent c433e6f commit d94bfe7

2 files changed

Lines changed: 18 additions & 11 deletions

File tree

app/src/main/java/net/i2p/android/i2ptunnel/TunnelsContainer.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
107107
mNewTunnel = v.findViewById(R.id.promoted_action);
108108
mNewTunnel.setVisibility(showActions() ? View.VISIBLE : View.GONE);
109109

110-
// Initialize ViewPager adapter
111-
mFragPagerAdapter = new TunnelsPagerAdapter(getChildFragmentManager());
112-
mViewPager.setAdapter(mFragPagerAdapter);
113-
114110
if (v.findViewById(R.id.detail_fragment) != null) {
115111
mTwoPane = true;
116112
}
@@ -122,8 +118,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
122118
savedInstanceState, FRAGMENT_SERVER);
123119
}
124120

125-
setupMagicIndicator();
126-
127121
return v;
128122
}
129123

app/src/main/res/layout/container_with_add_onepane.xml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,25 @@
44
android:layout_width="match_parent"
55
android:layout_height="match_parent">
66

7-
<!-- The main content view -->
8-
<androidx.viewpager.widget.ViewPager
9-
android:id="@+id/pager"
7+
<LinearLayout
108
android:layout_width="match_parent"
11-
android:layout_height="0dp"
12-
android:layout_alignParentBottom="true" />
9+
android:layout_height="match_parent"
10+
android:orientation="vertical">
11+
12+
<net.lucode.hackware.magicindicator.MagicIndicator
13+
android:id="@+id/magic_indicator"
14+
android:layout_width="match_parent"
15+
android:layout_height="@dimen/pager_indicator_height"
16+
android:theme="@style/MagicIndicator" />
17+
18+
<!-- The main content view -->
19+
<androidx.viewpager.widget.ViewPager
20+
android:id="@+id/pager"
21+
android:layout_width="match_parent"
22+
android:layout_height="0dp"
23+
android:layout_weight="1" />
24+
25+
</LinearLayout>
1326

1427
<net.i2p.android.ext.floatingactionbutton.AddFloatingActionButton
1528
android:id="@+id/promoted_action"

0 commit comments

Comments
 (0)