优化了事件面板展示
启动页面展示,但是还是会出现加载进入后的图标下挫问题,待修复
This commit is contained in:
@@ -28,9 +28,16 @@ public class MainIndependentActivity extends MainActivity {
|
||||
@Override
|
||||
protected void initViews() {
|
||||
super.initViews();
|
||||
// 控制层
|
||||
FrameLayout.LayoutParams entranceParams = ( ( FrameLayout.LayoutParams ) mEntrance.getLayoutParams() );
|
||||
entranceParams.leftMargin = getResources().getDimensionPixelSize( R.dimen.module_main_entrance_fragment_container_marginLeft );
|
||||
mEntrance.setLayoutParams( entranceParams );
|
||||
|
||||
// 事件面板
|
||||
FrameLayout.LayoutParams eventPanelParams = ( ( FrameLayout.LayoutParams ) mEventPanel.getLayoutParams() );
|
||||
eventPanelParams.leftMargin = getResources().getDimensionPixelSize( R.dimen.module_main_entrance_fragment_container_marginLeft );
|
||||
mEntrance.setLayoutParams( eventPanelParams );
|
||||
|
||||
mLeftShadowFrame.setVisibility(View.VISIBLE);
|
||||
mApps.setVisibility( View.GONE );
|
||||
}
|
||||
|
||||
@@ -60,8 +60,9 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
// protected View mHeader;
|
||||
protected View mApps;
|
||||
protected View mEntrance;
|
||||
protected View mEventPanel;
|
||||
protected FrameLayout mFloatingLayout;
|
||||
protected FrameLayout mCoverUpLayout;
|
||||
protected View mCoverUpLayout;
|
||||
protected FrameLayout mLeftPanelLayout;
|
||||
protected View mLeftShadowFrame;
|
||||
private boolean mIsHomeKeyDown = false;
|
||||
@@ -79,6 +80,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
// mHeader = findViewById( R.id.module_main_id_header_fragment_container );
|
||||
mApps = findViewById( R.id.module_main_id_apps_fragment_container );
|
||||
mEntrance = findViewById( R.id.module_main_id_entrance_fragment_container );
|
||||
mEventPanel = findViewById( R.id.module_main_id_event_panel_fragment_container );
|
||||
mFloatingLayout = findViewById( R.id.module_main_id_floating_view );
|
||||
mLeftShadowFrame = findViewById( R.id.module_main_id_map_left_shadow_frame );
|
||||
mCoverUpLayout = findViewById( R.id.module_main_id_cover_up );
|
||||
@@ -94,6 +96,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
protected void hideLayout() {
|
||||
// mHeader.setVisibility( View.GONE );
|
||||
mEntrance.setVisibility( View.GONE );
|
||||
mEventPanel.setVisibility( View.GONE );
|
||||
mFloatingLayout.setVisibility( View.GONE );
|
||||
}
|
||||
|
||||
@@ -101,6 +104,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
protected void showLayout() {
|
||||
// mHeader.setVisibility( View.VISIBLE );
|
||||
mEntrance.setVisibility( View.VISIBLE );
|
||||
mEventPanel.setVisibility( View.VISIBLE );
|
||||
mFloatingLayout.setVisibility( View.VISIBLE );
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--黑色矩形 作为背景色-->
|
||||
<item>
|
||||
<shape>
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:centerX="0.6"
|
||||
android:endColor="#0B0F17"
|
||||
android:startColor="#171D2B"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
</item>
|
||||
<!--单独的slogan图片 并且设置下间距-->
|
||||
<!--如果使用svg可以直接 drawable-->
|
||||
<item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/mogo_slogan"
|
||||
android:tileMode="disabled" />
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -66,13 +66,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<FrameLayout
|
||||
<ImageView
|
||||
android:id="@+id/module_main_id_cover_up"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/module_main_launcher_bg"
|
||||
android:scaleType="centerCrop"
|
||||
android:background="@drawable/main_bitmap_splash_bg"
|
||||
android:visibility="visible"
|
||||
tools:visibility="gone" />
|
||||
/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_splash_container"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<item name="android:windowEnterAnimation">@null</item>
|
||||
<item name="android:windowExitAnimation">@null</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowBackground">@drawable/module_main_launcher_bg</item>
|
||||
<item name="android:windowBackground">@drawable/main_bitmap_splash_bg</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:windowAnimationStyle">@style/MainAnimation</item>
|
||||
<item name="checkboxStyle">@style/noCheckboxStyle</item>
|
||||
|
||||
@@ -4,7 +4,9 @@ import android.content.res.ColorStateList
|
||||
import android.graphics.Typeface
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.viewpager2.widget.ViewPager2
|
||||
import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback
|
||||
@@ -34,11 +36,11 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
|
||||
private var mediator: TabLayoutMediator? = null
|
||||
|
||||
private val activeColor: Int = android.graphics.Color.parseColor("#ff678f")
|
||||
private val normalColor: Int = android.graphics.Color.parseColor("#EE00FF")
|
||||
private val activeColor: Int = android.graphics.Color.parseColor("#FFFFFF")
|
||||
private val normalColor: Int = android.graphics.Color.parseColor("#65FFFFFF")
|
||||
|
||||
private val activeSize = 35
|
||||
private val normalSize = 30
|
||||
private val activeSize = 20
|
||||
private val normalSize = 20
|
||||
|
||||
private var selectPosition = 0
|
||||
|
||||
@@ -66,6 +68,12 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
//viewPager 页面切换监听
|
||||
vpEventPanel.registerOnPageChangeCallback(changeCallback)
|
||||
|
||||
/*TabLayout中间分界线*/
|
||||
val linearLayout: LinearLayout = tabLayout.getChildAt(0) as LinearLayout
|
||||
linearLayout.showDividers = LinearLayout.SHOW_DIVIDER_MIDDLE
|
||||
linearLayout.dividerDrawable = activity?.let { ContextCompat.getDrawable(it, R.drawable.bg_v2x_event_live_show) }
|
||||
linearLayout.dividerPadding = 30
|
||||
|
||||
//这里可以自定义TabView
|
||||
mediator = TabLayoutMediator(tabLayout, vpEventPanel, TabConfigurationStrategy { tab, position ->
|
||||
val tabView = TextView(context)
|
||||
|
||||
@@ -5,12 +5,13 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<com.mogo.module.v2x.view.RoundConstraintLayout
|
||||
android:id="@+id/clPanelContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/cardview_dark_background"
|
||||
android:background="#10121E"
|
||||
android:visibility="gone"
|
||||
app:roundLayoutRadius="@dimen/dp_40"
|
||||
tools:visibility="visible">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
@@ -21,12 +22,11 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:tabGravity="fill"
|
||||
app:tabIndicatorColor="#ff678f"
|
||||
app:tabIndicatorFullWidth="false"
|
||||
app:tabIndicatorHeight="2dp"
|
||||
app:tabMode="fixed"
|
||||
app:tabSelectedTextColor="#ff678f"
|
||||
app:tabTextColor="#EE00FF"
|
||||
app:tabMode="scrollable"
|
||||
app:tabSelectedTextColor="#FFFFFF"
|
||||
app:tabTextColor="#65FFFFFF"
|
||||
app:tabUnboundedRipple="true" />
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
@@ -38,7 +38,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tabLayout" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.mogo.module.v2x.view.RoundConstraintLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnShowOrHidePanels"
|
||||
|
||||
Reference in New Issue
Block a user