重构离线地图页面

This commit is contained in:
qiji4215 2023-06-08 11:07:15 +08:00
parent 999052507a
commit 8310f4b7e7

View File

@ -7,92 +7,72 @@
android:background="@color/bg_left_pannel"
tools:context=".ui.fragment.offlinemap.OfflineMapFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/title_layout"
android:layout_width="match_parent"
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/offline_map_back"
style="@style/btn_round"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
style="@style/left_pannel_title_layout">
android:layout_marginTop="5dp"
android:background="@drawable/selector_bg_round_button"
android:foreground="@drawable/ripple_btn_press"
android:src="@drawable/ic_baseline_keyboard_arrow_left_24"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/offline_map_back"
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="离线地图"
android:textColor="@color/default_blue_text_color"
android:textSize="16sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/offline_map_tab_layout"
android:layout_width="match_parent"
android:layout_height="26dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="11dp"
android:layout_marginRight="8dp"
android:background="@color/transparent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title"
app:tabBackground="@drawable/selector_bg_gradient_checkbox"
app:tabGravity="center"
app:tabIndicator="@null"
app:tabIndicatorHeight="0dp"
app:tabMaxWidth="150dp"
app:tabMinWidth="150dp"
app:tabMode="scrollable"
app:tabPaddingEnd="6dp"
app:tabPaddingStart="6dp"
app:tabSelectedTextColor="@color/white"
app:tabTextAppearance="@style/TabLayoutTextStyle"
app:tabTextColor="@color/black">
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="5dp"
app:layout_constraintBottom_toBottomOf="parent"
android:background="@drawable/selector_bg_round_button"
android:foreground="@drawable/ripple_btn_press"
style="@style/btn_round"
android:src="@drawable/ic_baseline_keyboard_arrow_left_24">
android:text="下载管理" />
</androidx.appcompat.widget.AppCompatImageView>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_title"
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/left_pannel_title_font"
android:text="离线地图"
android:textColor="@color/highFontColor"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent">
android:text="城市列表" />
</com.google.android.material.tabs.TabLayout>
</androidx.appcompat.widget.AppCompatTextView>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.cardview.widget.CardView
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/offline_map_viewpager"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@id/title_layout"
android:layout_marginTop="10dp"
app:layout_constraintBottom_toBottomOf="parent"
style="@style/default_card_view">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.tabs.TabLayout
android:id="@+id/offline_map_tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/transparent"
app:tabBackground="@drawable/selector_bg_gradient_checkbox"
app:tabTextColor="@color/black"
app:tabGravity="center"
app:tabPadding="0dp"
app:tabIndicator="@null"
app:tabMode="scrollable"
app:tabMinWidth="120dp"
app:tabIndicatorHeight="0dp"
app:tabSelectedTextColor="@color/white"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/title_layout">
<com.google.android.material.tabs.TabItem
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="下载管理" />
<com.google.android.material.tabs.TabItem
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="城市列表" />
</com.google.android.material.tabs.TabLayout>
app:layout_constraintTop_toBottomOf="@id/offline_map_tab_layout" />
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/offline_map_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/offline_map_tab_layout" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>