This repository was archived by the owner on Mar 4, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
java/top/itning/smpandroid/ui/activity Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 18
18
import androidx .annotation .NonNull ;
19
19
import androidx .appcompat .app .AlertDialog ;
20
20
import androidx .appcompat .app .AppCompatActivity ;
21
+ import androidx .appcompat .widget .AppCompatButton ;
21
22
22
23
import org .bytedeco .javacv .AndroidFrameConverter ;
23
24
import org .bytedeco .javacv .Frame ;
@@ -70,6 +71,8 @@ public class FaceActivity extends AppCompatActivity {
70
71
private Camera camera ;
71
72
@ BindView (R2 .id .sv )
72
73
SurfaceView surfaceView ;
74
+ @ BindView (R2 .id .btn_face )
75
+ AppCompatButton faceBtn ;
73
76
74
77
public FaceActivity () {
75
78
previewCallback = new PreviewCallbackImpl (this );
@@ -88,6 +91,12 @@ protected void onCreate(Bundle savedInstanceState) {
88
91
* 初始化资源和视图
89
92
*/
90
93
private void init () {
94
+ String btnName = getIntent ().getStringExtra ("btnName" );
95
+ if (btnName != null ) {
96
+ faceBtn .setText (btnName );
97
+ } else {
98
+ faceBtn .setText (R .string .face_do_btn_str );
99
+ }
91
100
checkHasFrontFaceCamera ();
92
101
initHaarcascadesData ();
93
102
initView ();
Original file line number Diff line number Diff line change @@ -207,7 +207,9 @@ protected void onDestroy() {
207
207
* @param view View
208
208
*/
209
209
public void handleRegisterFaceBtnClick (View view ) {
210
- startActivityForResult (new Intent (this , FaceActivity .class ), START_FACE_ACTIVITY_REQUEST_CODE );
210
+ Intent intent = new Intent (this , FaceActivity .class );
211
+ intent .putExtra ("btnName" , "点击注册" );
212
+ startActivityForResult (intent , START_FACE_ACTIVITY_REQUEST_CODE );
211
213
}
212
214
213
215
@ Override
Original file line number Diff line number Diff line change 17
17
android : src =" @drawable/face" />
18
18
19
19
<androidx .appcompat.widget.AppCompatButton
20
+ android : id =" @+id/btn_face"
20
21
android : layout_width =" wrap_content"
21
22
android : layout_height =" wrap_content"
22
23
android : layout_gravity =" bottom|center_horizontal"
27
28
android : paddingTop =" 16dp"
28
29
android : paddingEnd =" 32dp"
29
30
android : paddingBottom =" 16dp"
30
- android : text =" @string/face_do_btn_str"
31
31
android : textAppearance =" ?android:attr/textAppearanceLargeInverse"
32
32
android : textSize =" 16sp"
33
- android : theme =" @style/AppTheme" />
33
+ android : theme =" @style/AppTheme"
34
+ tools : text =" @string/face_do_btn_str" />
34
35
</merge >
You can’t perform that action at this time.
0 commit comments