Skip to content

Commit aaa1986

Browse files
committed
update demo
1 parent 18abdc1 commit aaa1986

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

app/src/main/java/moe/codeest/ecardflowdemo/PagerFragment.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import android.view.LayoutInflater;
1111
import android.view.View;
1212
import android.view.ViewGroup;
13-
import android.widget.FrameLayout;
1413
import android.widget.ImageView;
1514
import android.widget.TextView;
1615
import android.widget.Toast;
@@ -24,7 +23,6 @@
2423
public class PagerFragment extends Fragment{
2524

2625
private ImageView ivBack;
27-
private FrameLayout llContainer;
2826
private RecyclerView rvContent;
2927
private TextView tvBtn;
3028

@@ -42,7 +40,6 @@ public static PagerFragment newInstance() {
4240
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
4341
View mView = inflater.inflate(R.layout.fragment_pager, null);
4442
ivBack = (ImageView) mView.findViewById(R.id.iv_back);
45-
llContainer = (FrameLayout) mView.findViewById(R.id.ll_container);
4643
rvContent = (RecyclerView) mView.findViewById(R.id.rv_content);
4744
tvBtn = (TextView) mView.findViewById(R.id.tv_btn);
4845
return mView;
@@ -120,11 +117,11 @@ public static int dp2px(Context context, float dpValue) {
120117
}
121118

122119
private void pageExpandAnim() {
123-
llContainer.animate().scaleX(0.9f).setDuration(700).start();
120+
rvContent.animate().scaleX(0.9f).setDuration(700).start();
124121
}
125122

126123
private void pageShrinkAnim() {
127-
llContainer.animate().scaleX(1).setDuration(700).start();
124+
rvContent.animate().scaleX(1).setDuration(700).start();
128125
}
129126

130127
public interface OnPageListener {

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

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,11 @@
6060
/>
6161
</RelativeLayout>
6262

63-
<FrameLayout
64-
android:id="@+id/ll_container"
65-
android:orientation="vertical"
66-
android:background="@android:color/transparent"
63+
<android.support.v7.widget.RecyclerView
64+
android:id="@+id/rv_content"
6765
android:layout_width="match_parent"
68-
android:layout_height="wrap_content">
66+
android:layout_height="match_parent"
67+
android:scrollbars="none">
6968

70-
<android.support.v7.widget.RecyclerView
71-
android:id="@+id/rv_content"
72-
android:layout_width="match_parent"
73-
android:layout_height="wrap_content"
74-
android:scrollbars="none">
75-
76-
</android.support.v7.widget.RecyclerView>
77-
</FrameLayout>
69+
</android.support.v7.widget.RecyclerView>
7870
</LinearLayout>

0 commit comments

Comments
 (0)