Skip to content

Commit d91588b

Browse files
committed
test constraint layout
1 parent 9db2ce6 commit d91588b

File tree

6 files changed

+88
-6
lines changed

6 files changed

+88
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.engineer.imitate.ui.activity
2+
3+
import androidx.appcompat.app.AppCompatActivity
4+
import android.os.Bundle
5+
import com.engineer.imitate.R
6+
import kotlinx.android.synthetic.main.activity_c_l.*
7+
8+
class CLActivity : AppCompatActivity() {
9+
override fun onCreate(savedInstanceState: Bundle?) {
10+
super.onCreate(savedInstanceState)
11+
setContentView(R.layout.activity_c_l)
12+
bottom.layoutResource = R.layout.activity_c_l_bottom
13+
bottom.inflate()
14+
}
15+
}

imitate/src/main/java/com/engineer/imitate/ui/fragments/EntranceFragment.kt

+12-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ class EntranceFragment : Fragment() {
7272
.countable(true)
7373
.capture(true)
7474
.captureStrategy(
75-
CaptureStrategy(true, requireContext().packageName + ".fileprovider")
75+
CaptureStrategy(
76+
true,
77+
requireContext().packageName + ".fileprovider"
78+
)
7679
)
7780
.maxSelectable(9)
7881
.restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
@@ -184,6 +187,14 @@ class EntranceFragment : Fragment() {
184187
)
185188
)
186189
}
190+
constraintLayout_ll2.setOnClickListener {
191+
startActivity(
192+
Intent(
193+
context,
194+
CLActivity::class.java
195+
)
196+
)
197+
}
187198
fragment_manager.setOnClickListener {
188199
startActivity(
189200
Intent(

imitate/src/main/module/AndroidManifest.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,20 @@
1010
<application
1111
android:name=".ImitateApplication"
1212
android:icon="@mipmap/ic_launcher"
13-
android:roundIcon="@mipmap/ic_launcher_round"
1413
android:label="@string/app_name"
15-
android:supportsRtl="true"
1614
android:requestLegacyExternalStorage="true"
15+
android:roundIcon="@mipmap/ic_launcher_round"
16+
android:supportsRtl="true"
1717
android:theme="@style/MyAppTheme"
1818
android:usesCleartextTraffic="true"
1919
android:windowSoftInputMode="adjustResize|stateHidden"
2020
tools:targetApi="q">
21+
<activity android:name=".ui.activity.CLActivity"></activity>
2122
<activity
2223
android:name=".ui.FantasySplashActivity"
2324
android:exported="true"
2425
android:noHistory="true"
25-
android:theme="@style/SplashTheme" >
26+
android:theme="@style/SplashTheme">
2627
<intent-filter>
2728
<action android:name="android.intent.action.MAIN" />
2829
<action android:name="android.intent.action.VIEW" />
@@ -63,8 +64,7 @@
6364
<activity
6465
android:name=".KotlinRootActivity"
6566
android:label="@string/app_name"
66-
android:theme="@style/MyAppTheme">
67-
</activity>
67+
android:theme="@style/MyAppTheme"></activity>
6868
<activity
6969
android:name=".ui.activity.FinalActivity"
7070
android:exported="true"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
tools:context=".ui.activity.CLActivity">
8+
9+
<TextView
10+
android:id="@+id/text"
11+
android:text="111111111"
12+
android:textSize="22sp"
13+
android:textColor="@color/black"
14+
android:layout_width="match_parent"
15+
android:layout_height="wrap_content"
16+
app:layout_constraintBottom_toTopOf="@id/bottom" />
17+
18+
19+
<ViewStub
20+
android:id="@+id/bottom"
21+
android:layout_width="match_parent"
22+
android:layout_height="wrap_content"
23+
app:layout_constraintBottom_toBottomOf="parent" />
24+
25+
</androidx.constraintlayout.widget.ConstraintLayout>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:layout_width="match_parent"
6+
android:layout_height="56dp"
7+
android:background="#2196F3"
8+
android:gravity="center"
9+
tools:context=".ui.activity.CLActivity">
10+
11+
<TextView
12+
android:id="@+id/text"
13+
android:layout_width="wrap_content"
14+
android:layout_height="wrap_content"
15+
android:text="BOTTOM"
16+
android:textColor="@color/white"
17+
android:textSize="32sp" />
18+
19+
20+
</LinearLayout>

imitate/src/main/res/layout/fragment_entrance.xml

+11
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,17 @@
8181
android:text="constraintLayout_layout"
8282
android:textColor="?android:attr/textColorPrimary" />
8383

84+
<com.google.android.material.button.MaterialButton
85+
android:id="@+id/constraintLayout_ll2"
86+
android:layout_width="match_parent"
87+
android:layout_height="wrap_content"
88+
android:layout_margin="4dp"
89+
90+
android:gravity="center"
91+
android:padding="10dp"
92+
android:text="constraintLayout_layout2"
93+
android:textColor="?android:attr/textColorPrimary" />
94+
8495
<com.google.android.material.button.MaterialButton
8596
android:id="@+id/fragment_manager"
8697
android:layout_width="match_parent"

0 commit comments

Comments
 (0)