首页实现页面切换
@@ -1,9 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activity.HomeActivity">
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
<com.example.myapplication.util.NoSlideViewPager
|
||||
android:id="@+id/no_slide_view_pager"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tab_layout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
app:tabRippleColor="@android:color/transparent"
|
||||
app:tabIndicatorHeight="0dp"
|
||||
app:tabTextColor="#F0686666"
|
||||
app:tabSelectedTextColor="#000000"
|
||||
android:background="#ffff"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout >
|
||||
@@ -8,6 +8,7 @@
|
||||
tools:context=".activity.MainActivity">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="启动页"
|
||||
|
||||
24
app/src/main/res/layout/item_tab.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_title"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/img_title"
|
||||
app:layout_constraintStart_toStartOf="@+id/img_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/img_title" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
6
app/src/main/res/layout/login_activity.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
16
app/src/main/res/layout/management_fragment.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/frame_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
BIN
app/src/main/res/mipmap-hdpi/article.png
Normal file
|
After Width: | Height: | Size: 600 B |
BIN
app/src/main/res/mipmap-hdpi/article_select.png
Normal file
|
After Width: | Height: | Size: 425 B |
BIN
app/src/main/res/mipmap-hdpi/bg.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 6.7 KiB |
BIN
app/src/main/res/mipmap-hdpi/map.png
Normal file
|
After Width: | Height: | Size: 316 B |
BIN
app/src/main/res/mipmap-hdpi/map_select.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
app/src/main/res/mipmap-hdpi/mine.png
Normal file
|
After Width: | Height: | Size: 426 B |
BIN
app/src/main/res/mipmap-hdpi/mine_select.png
Normal file
|
After Width: | Height: | Size: 269 B |
BIN
app/src/main/res/mipmap-hdpi/task.png
Normal file
|
After Width: | Height: | Size: 282 B |
BIN
app/src/main/res/mipmap-hdpi/task_select.png
Normal file
|
After Width: | Height: | Size: 320 B |
BIN
app/src/main/res/mipmap-ldpi/article.png
Normal file
|
After Width: | Height: | Size: 600 B |
BIN
app/src/main/res/mipmap-ldpi/article_select.png
Normal file
|
After Width: | Height: | Size: 425 B |
BIN
app/src/main/res/mipmap-ldpi/bg.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
app/src/main/res/mipmap-ldpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-ldpi/map.png
Normal file
|
After Width: | Height: | Size: 316 B |
BIN
app/src/main/res/mipmap-ldpi/map_select.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
app/src/main/res/mipmap-ldpi/mine.png
Normal file
|
After Width: | Height: | Size: 426 B |
BIN
app/src/main/res/mipmap-ldpi/mine_select.png
Normal file
|
After Width: | Height: | Size: 269 B |
BIN
app/src/main/res/mipmap-ldpi/task.png
Normal file
|
After Width: | Height: | Size: 282 B |
BIN
app/src/main/res/mipmap-ldpi/task_select.png
Normal file
|
After Width: | Height: | Size: 320 B |
BIN
app/src/main/res/mipmap-mdpi/article.png
Normal file
|
After Width: | Height: | Size: 600 B |
BIN
app/src/main/res/mipmap-mdpi/article_select.png
Normal file
|
After Width: | Height: | Size: 425 B |
BIN
app/src/main/res/mipmap-mdpi/bg.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 4.3 KiB |
BIN
app/src/main/res/mipmap-mdpi/map.png
Normal file
|
After Width: | Height: | Size: 316 B |
BIN
app/src/main/res/mipmap-mdpi/map_select.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
app/src/main/res/mipmap-mdpi/mine.png
Normal file
|
After Width: | Height: | Size: 426 B |
BIN
app/src/main/res/mipmap-mdpi/mine_select.png
Normal file
|
After Width: | Height: | Size: 269 B |
BIN
app/src/main/res/mipmap-mdpi/task.png
Normal file
|
After Width: | Height: | Size: 282 B |
BIN
app/src/main/res/mipmap-mdpi/task_select.png
Normal file
|
After Width: | Height: | Size: 320 B |
BIN
app/src/main/res/mipmap-xhdpi/article.png
Normal file
|
After Width: | Height: | Size: 600 B |
BIN
app/src/main/res/mipmap-xhdpi/article_select.png
Normal file
|
After Width: | Height: | Size: 425 B |
BIN
app/src/main/res/mipmap-xhdpi/bg.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/res/mipmap-xhdpi/map.png
Normal file
|
After Width: | Height: | Size: 316 B |
BIN
app/src/main/res/mipmap-xhdpi/map_select.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
app/src/main/res/mipmap-xhdpi/mine.png
Normal file
|
After Width: | Height: | Size: 426 B |
BIN
app/src/main/res/mipmap-xhdpi/mine_select.png
Normal file
|
After Width: | Height: | Size: 269 B |
BIN
app/src/main/res/mipmap-xhdpi/task.png
Normal file
|
After Width: | Height: | Size: 282 B |
BIN
app/src/main/res/mipmap-xhdpi/task_select.png
Normal file
|
After Width: | Height: | Size: 320 B |
BIN
app/src/main/res/mipmap-xxhdpi/article.png
Normal file
|
After Width: | Height: | Size: 600 B |
BIN
app/src/main/res/mipmap-xxhdpi/article_select.png
Normal file
|
After Width: | Height: | Size: 425 B |
BIN
app/src/main/res/mipmap-xxhdpi/bg.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 21 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/map.png
Normal file
|
After Width: | Height: | Size: 316 B |
BIN
app/src/main/res/mipmap-xxhdpi/map_select.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
app/src/main/res/mipmap-xxhdpi/mine.png
Normal file
|
After Width: | Height: | Size: 426 B |
BIN
app/src/main/res/mipmap-xxhdpi/mine_select.png
Normal file
|
After Width: | Height: | Size: 269 B |
BIN
app/src/main/res/mipmap-xxhdpi/task.png
Normal file
|
After Width: | Height: | Size: 282 B |
BIN
app/src/main/res/mipmap-xxhdpi/task_select.png
Normal file
|
After Width: | Height: | Size: 320 B |
BIN
app/src/main/res/mipmap-xxxhdpi/article.png
Normal file
|
After Width: | Height: | Size: 600 B |
BIN
app/src/main/res/mipmap-xxxhdpi/article_select.png
Normal file
|
After Width: | Height: | Size: 425 B |
BIN
app/src/main/res/mipmap-xxxhdpi/bg.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 35 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/map.png
Normal file
|
After Width: | Height: | Size: 316 B |
BIN
app/src/main/res/mipmap-xxxhdpi/map_select.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
app/src/main/res/mipmap-xxxhdpi/mine.png
Normal file
|
After Width: | Height: | Size: 426 B |
BIN
app/src/main/res/mipmap-xxxhdpi/mine_select.png
Normal file
|
After Width: | Height: | Size: 269 B |
BIN
app/src/main/res/mipmap-xxxhdpi/task.png
Normal file
|
After Width: | Height: | Size: 282 B |
BIN
app/src/main/res/mipmap-xxxhdpi/task_select.png
Normal file
|
After Width: | Height: | Size: 320 B |
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/nav_graph"
|
||||
app:startDestination="@id/FirstFragment">
|
||||
|
||||
<fragment
|
||||
android:id="@+id/FirstFragment"
|
||||
android:name="com.example.myapplication.activity.FirstFragment"
|
||||
android:label="@string/first_fragment_label"
|
||||
tools:layout="@layout/fragment_first">
|
||||
|
||||
<action
|
||||
android:id="@+id/action_FirstFragment_to_SecondFragment"
|
||||
app:destination="@id/SecondFragment" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/SecondFragment"
|
||||
android:name="com.example.myapplication.activity.SecondFragment"
|
||||
android:label="@string/second_fragment_label"
|
||||
tools:layout="@layout/fragment_second">
|
||||
|
||||
<action
|
||||
android:id="@+id/action_SecondFragment_to_FirstFragment"
|
||||
app:destination="@id/FirstFragment" />
|
||||
</fragment>
|
||||
</navigation>
|
||||
@@ -1,5 +1,5 @@
|
||||
<resources>
|
||||
<string name="app_name">MyApplication</string>
|
||||
<string name="app_name">navinfo</string>
|
||||
<string name="title_activity_home">HomeActivity</string>
|
||||
<!-- Strings used for fragments for navigation -->
|
||||
<string name="first_fragment_label">First Fragment</string>
|
||||
|
||||