main module cardLayout add coverUp view

This commit is contained in:
unknown
2020-02-14 15:57:40 +08:00
parent b6718f7d9d
commit 5708415eec
7 changed files with 22 additions and 1 deletions

View File

@@ -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();
}

View File

@@ -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 );
//控制停止滑动切换的时候,只有最上面的一张卡片可以点击

Binary file not shown.

After

Width:  |  Height:  |  Size: 918 B

View File

@@ -58,6 +58,7 @@
android:clipToPadding="false"
android:overScrollMode="never"
android:paddingBottom="@dimen/module_main_card_container_paddingBottom" />
<!-- 应用入口-->
<FrameLayout
android:id="@+id/module_main_id_apps_fragment_container"
@@ -67,6 +68,17 @@
app:layout_constraintTop_toTopOf="parent">
</FrameLayout>
<FrameLayout
android:id="@+id/module_main_id_card_cover_up_bottom"
android:layout_width="match_parent"
android:layout_height="20px"
android:visibility="gone"
android:layout_marginTop="@dimen/module_main_card_cover_up_margin"
android:layout_marginLeft="15px"
android:layout_marginRight="15px"
android:background="@drawable/module_main_card_cover_up_bottom"/>
</FrameLayout>
<!--快捷操作浮层-->

View File

@@ -11,4 +11,5 @@
<dimen name="module_main_card_card_shadow_width_div">20px</dimen>
<dimen name="module_main_card_card_shadow_height_div">10px</dimen>
<dimen name="module_main_top_shadow_height">144px</dimen>
<dimen name="module_main_card_cover_up_margin">352px</dimen>
</resources>

View File

@@ -11,4 +11,5 @@
<dimen name="module_main_card_card_shadow_width_div">30px</dimen>
<dimen name="module_main_card_card_shadow_height_div">15px</dimen>
<dimen name="module_main_top_shadow_height">270px</dimen>
<dimen name="module_main_card_cover_up_margin">660px</dimen>
</resources>

View File

@@ -11,4 +11,5 @@
<dimen name="module_main_card_card_shadow_width_div">30px</dimen>
<dimen name="module_main_card_card_shadow_height_div">15px</dimen>
<dimen name="module_main_top_shadow_height">270px</dimen>
<dimen name="module_main_card_cover_up_margin">352px</dimen>
</resources>