Шаблон для разработки
Some checks failed
Merge core/template-android-project to this repo / merge-if-needed (push) Failing after 15s
Some checks failed
Merge core/template-android-project to this repo / merge-if-needed (push) Failing after 15s
This commit is contained in:
12
app/src/main/res/layout/activity_main.xml
Normal file
12
app/src/main/res/layout/activity_main.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<!-- TODO: Реализовать фрагмент для навигации. Должен растягиваться по родительскому объекту, иметь id "nav_host_fragment" и обозначить параметр navGraph "nav_graph" -->
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
31
app/src/main/res/layout/fragment_first.xml
Normal file
31
app/src/main/res/layout/fragment_first.xml
Normal file
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".FirstFragment">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="First Fragment"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|center"
|
||||
android:orientation="vertical">
|
||||
<Button
|
||||
android:id="@+id/fromFirstToSecond"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Second" />
|
||||
<Button
|
||||
android:id="@+id/fromFirstToThird"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Third" />
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
14
app/src/main/res/layout/fragment_second.xml
Normal file
14
app/src/main/res/layout/fragment_second.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".SecondFragment">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Second Fragment"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
</FrameLayout>
|
26
app/src/main/res/layout/fragment_third.xml
Normal file
26
app/src/main/res/layout/fragment_third.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ThirdFragment">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Third Fragment"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|center"
|
||||
android:orientation="vertical">
|
||||
<Button
|
||||
android:id="@+id/fromThirdToFirst"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Second" />
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
29
app/src/main/res/navigation/nav_graph.xml
Normal file
29
app/src/main/res/navigation/nav_graph.xml
Normal file
@ -0,0 +1,29 @@
|
||||
<?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"
|
||||
android:id="@+id/nav_graph"
|
||||
app:startDestination="@id/firstFragment">
|
||||
<fragment
|
||||
android:id="@+id/firstFragment"
|
||||
android:name="ru.myitschool.work.FirstFragment"
|
||||
android:label="First Fragment">
|
||||
<action
|
||||
android:id="@+id/action_firstFragment_to_secondFragment"
|
||||
app:destination="@id/secondFragment" />
|
||||
<action
|
||||
android:id="@+id/action_firstFragment_to_thirdFragment"
|
||||
app:destination="@id/thirdFragment" />
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/secondFragment"
|
||||
android:name="ru.myitschool.work.SecondFragment"
|
||||
android:label="Second Fragment"/>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/thirdFragment"
|
||||
android:name="ru.myitschool.work.ThirdFragment"
|
||||
android:label="Third Fragment">
|
||||
<!-- TODO: Создать переход из третьего фрагмента в первый с id "action_thirdFragment_to_firstFragment" -->
|
||||
</fragment>
|
||||
</navigation>
|
@ -1,3 +1,4 @@
|
||||
<resources>
|
||||
<string name="app_name">Work</string>
|
||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||
</resources>
|
@ -5,7 +5,7 @@
|
||||
-->
|
||||
<data-extraction-rules>
|
||||
<cloud-backup>
|
||||
<!-- TODO: Use <include> and <exclude> to control what is backed up.
|
||||
<!--
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
-->
|
||||
|
Reference in New Issue
Block a user