main module cardLayout add coverUp view
This commit is contained in:
@@ -72,6 +72,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
private View mEntrance;
|
||||
private FrameLayout mFloatingLayout;
|
||||
private FrameLayout mCoverUpLayout;
|
||||
private FrameLayout mCardCoverUpBottomLayout;
|
||||
private View mLeftShadowFrame;
|
||||
private View mTopShadowFrame;
|
||||
|
||||
@@ -208,6 +209,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mLeftShadowFrame = findViewById( R.id.module_main_id_map_left_shadow_frame );
|
||||
mTopShadowFrame = findViewById( R.id.module_main_id_map_top_shadow_frame );
|
||||
mCoverUpLayout = findViewById( R.id.module_main_id_cover_up );
|
||||
mCardCoverUpBottomLayout = findViewById( R.id.module_main_id_card_cover_up_bottom );
|
||||
|
||||
WindowViewHandler.init( mFloatingLayout );
|
||||
}
|
||||
@@ -324,6 +326,8 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mCardsContainer.setPageTransformer( true, new VerticalStackTransformer( this ) );
|
||||
mCardsContainer.setAdapter( mCardModulesAdapter );
|
||||
|
||||
mCardCoverUpBottomLayout.setVisibility(View.VISIBLE);
|
||||
|
||||
mCardStartShowTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.view.View;
|
||||
|
||||
import com.mogo.module.main.R;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
public class VerticalStackTransformer extends VerticalBaseTransformer {
|
||||
|
||||
@@ -15,7 +16,7 @@ public class VerticalStackTransformer extends VerticalBaseTransformer {
|
||||
|
||||
public VerticalStackTransformer( Context context ) {
|
||||
this.context = context;
|
||||
spaceBetweenFirAndSecHeight = context.getResources().getDimensionPixelSize( R.dimen.module_main_card_card_shadow_height_div );
|
||||
spaceBetweenFirAndSecHeight = 0;
|
||||
spaceBetweenFirAndSecWith = context.getResources().getDimensionPixelSize( R.dimen.module_main_card_card_shadow_width_div );
|
||||
}
|
||||
|
||||
@@ -34,6 +35,7 @@ public class VerticalStackTransformer extends VerticalBaseTransformer {
|
||||
page.setClickable( true );
|
||||
} else {
|
||||
float scale = ( float ) ( page.getWidth() - spaceBetweenFirAndSecWith * position ) / ( float ) ( page.getWidth() );
|
||||
Logger.d("VerticalStackTransformer","scale :" + scale);
|
||||
//控制下面卡片的可见度
|
||||
page.setAlpha( 1.0f );
|
||||
//控制停止滑动切换的时候,只有最上面的一张卡片可以点击
|
||||
|
||||
Reference in New Issue
Block a user