diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/MyQRCodeActivity.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/MyQRCodeActivity.java
index d884eb8a0a0cba2c9768ec5d441433d63728cce1..a3151b726a67cc4517eea576bbd12458f3d8a46f 100644
--- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/MyQRCodeActivity.java
+++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/MyQRCodeActivity.java
@@ -21,7 +21,6 @@ import android.widget.RelativeLayout;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
-import androidx.appcompat.widget.Toolbar;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mindspore.common.utils.AppTitleUtils;
@@ -47,10 +46,14 @@ public class MyQRCodeActivity extends AppCompatActivity {
private void init() {
appTitle = findViewById(R.id.segmentation_toolbar);
- appTitle.findViewById(R.id.title_black).setOnClickListener(view -> finish());
+ appTitle.setNavigationOnClickListener(view -> finish());
mMy_layout = (RelativeLayout) findViewById(R.id.my_relativelayout);
mQr_code_image = findViewById(R.id.img_origin);
- appTitle.findViewById(R.id.icon_more).setOnClickListener(new View.OnClickListener() {
+ setOnClickMore();
+ }
+
+ private void setOnClickMore(){
+ appTitle.setTitleRightThree(new View.OnClickListener() {
@Override
public void onClick(View view) {
LayoutInflater layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/webview/WebViewUtilsActivity.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/webview/WebViewUtilsActivity.java
index 8994c4f96245d1653c5d5c1888b9deeb0f6f0a5e..c7adabfa333923ca9ccfc7255cbd2059fe0ecb80 100644
--- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/webview/WebViewUtilsActivity.java
+++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/webview/WebViewUtilsActivity.java
@@ -52,8 +52,7 @@ public class WebViewUtilsActivity extends AppCompatActivity {
private void initView() {
progressBar = findViewById(R.id.progress);
appTitle = findViewById(R.id.mWebView_toolbar);
- appTitle.findViewById(R.id.title_black).setOnClickListener(view -> finish());
- titleName = appTitle.findViewById(R.id.title_name);
+ appTitle.setNavigationOnClickListener(view -> finish());
mWebView = findViewById(R.id.mWebView);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setDomStorageEnabled(true);
@@ -79,46 +78,46 @@ public class WebViewUtilsActivity extends AppCompatActivity {
private void showWebViewTitle(String mWebViewUrl) {
switch (mWebViewUrl) {
case MSLinkUtils.ME_STAR_URL:
- titleName.setText(R.string.me_up_title);
+ appTitle.setTitleText(R.string.me_up_title);
break;
case MSLinkUtils.BASE_URL:
- titleName.setText(R.string.me_official_title);
+ appTitle.setTitleText(R.string.me_official_title);
break;
case MSLinkUtils.ME_CODE_URL:
- titleName.setText(R.string.me_official_code_title);
+ appTitle.setTitleText(R.string.me_official_code_title);
break;
case MSLinkUtils.ME_HELP_URL:
- titleName.setText(R.string.me_qa_title);
+ appTitle.setTitleText(R.string.me_qa_title);
break;
case MSLinkUtils.COLLEGE_QUICK_APP:
- titleName.setText(R.string.title_college_broken_side);
+ appTitle.setTitleText(R.string.title_college_broken_side);
break;
case MSLinkUtils.COLLEGE_MAIN_FAQ:
- titleName.setText(R.string.title_college_faq);
+ appTitle.setTitleText(R.string.title_college_faq);
break;
case MSLinkUtils.COLLEGE_MAIN_ASK:
- titleName.setText(R.string.title_college_forum);
+ appTitle.setTitleText(R.string.title_college_forum);
break;
case MSLinkUtils.COLLEGE_MAIN_GATE:
- titleName.setText(R.string.college_quick_title);
+ appTitle.setTitleText(R.string.college_quick_title);
break;
case MSLinkUtils.COLLEGE_MAIN_CLOUD:
- titleName.setText(R.string.title_college_one_hour);
+ appTitle.setTitleText(R.string.title_college_one_hour);
break;
case MSLinkUtils.COLLEGE_QUICK_EXECUTE:
- titleName.setText(R.string.title_college_perform);
+ appTitle.setTitleText(R.string.title_college_perform);
break;
case MSLinkUtils.COLLEGE_QUICK_VIDEO:
- titleName.setText(R.string.title_college_video);
+ appTitle.setTitleText(R.string.title_college_video);
break;
case MSLinkUtils.COLLEGE_QUICK_TRAIN:
- titleName.setText(R.string.title_college_training);
+ appTitle.setTitleText(R.string.title_college_training);
break;
case MSLinkUtils.USER_PRIVACY_RULES:
- titleName.setText(R.string.me_user_agreements);
+ appTitle.setTitleText(R.string.me_user_agreements);
break;
default:
- titleName.setText(R.string.me_official_title);
+ appTitle.setTitleText(R.string.me_official_title);
break;
}
}
diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable-hdpi/guide_pages.jpg b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable-hdpi/guide_pages.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..0a75bb165d2677b9bbe3ce60c77ecbca249fe300
Binary files /dev/null and b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable-hdpi/guide_pages.jpg differ
diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable-hdpi/guide_pages.png b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable-hdpi/guide_pages.png
deleted file mode 100644
index f6ac25c7198e7d3d929ff53c5f9a839a7eb08c18..0000000000000000000000000000000000000000
Binary files a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable-hdpi/guide_pages.png and /dev/null differ
diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_my_qr_code.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_my_qr_code.xml
index fbfd44d8cbbc23913707237bce084c4f705269ef..3e055bd663b0b2c9dc9becef1debe58f77fa4a68 100644
--- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_my_qr_code.xml
+++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_my_qr_code.xml
@@ -15,7 +15,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
title:iconLeftBlack="@drawable/icon_back"
- title:iconMore="@drawable/icon_more"
+ title:iconRightThree="@drawable/icon_more"
title:nameTitle="@string/me_official_title" />
-
@@ -43,6 +45,7 @@
android:text="@string/title_splash_welcome"
android:textColor="@color/text_gray"
android:textSize="16sp"
+ android:maxLines="1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title" />
diff --git a/model_zoo/official/lite/MindSpore_inhand/common/src/main/java/com/mindspore/common/utils/AppTitleUtils.java b/model_zoo/official/lite/MindSpore_inhand/common/src/main/java/com/mindspore/common/utils/AppTitleUtils.java
index 8af770b1ed92c64e549faca21ead863ba73396b4..9e685f09bb7d4cd9c82b15fb99240f3c4d11a8f0 100644
--- a/model_zoo/official/lite/MindSpore_inhand/common/src/main/java/com/mindspore/common/utils/AppTitleUtils.java
+++ b/model_zoo/official/lite/MindSpore_inhand/common/src/main/java/com/mindspore/common/utils/AppTitleUtils.java
@@ -1,5 +1,6 @@
package com.mindspore.common.utils;
+import android.app.Activity;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
@@ -17,13 +18,36 @@ import retrofit2.http.HEAD;
public class AppTitleUtils extends LinearLayout {
-
private CharSequence nameTitle;
- private Drawable iconLeftBlack, iconCamera, iconHelp, iconMore, iconRecovery, iconInfo;
+ private Drawable iconLeftBlack, iconRightOne, iconRightTwo, iconRightThree;
private LinearLayout layout;
- private ImageView titleBlack, titleCamera, titleHelp, titleMore, titleRecovery, titleInfo;
+ private ImageView titleBlack, titleRightOne, titleRightTwo, titleRightThree;
private View titleLine;
+ private TextView titleName;
+
+ public void setNavigationOnClickListener(OnClickListener onClickListener) {
+ titleBlack.setOnClickListener(onClickListener);
+ }
+ public void setTitleRightOne(OnClickListener onClickListener) {
+ titleRightOne.setOnClickListener(onClickListener);
+ }
+
+ public void setTitleRightTwo(OnClickListener onClickListener) {
+ titleRightTwo.setOnClickListener(onClickListener);
+ }
+
+ public void setTitleRightThree(OnClickListener onClickListener) {
+ titleRightThree.setOnClickListener(onClickListener);
+ }
+
+ public void setTitleText(int tileTextId) {
+ titleName.setText((int) tileTextId);
+ }
+
+ public void setTitleText(String tileText) {
+ titleName.setText(tileText);
+ }
public AppTitleUtils(Context context) {
super(context);
@@ -35,11 +59,9 @@ public class AppTitleUtils extends LinearLayout {
nameTitle = ToolbarTile.getText(R.styleable.AppToolbarTile_nameTitle);
iconLeftBlack = ToolbarTile.getDrawable(R.styleable.AppToolbarTile_iconLeftBlack);
- iconCamera = ToolbarTile.getDrawable(R.styleable.AppToolbarTile_iconCamera);
- iconHelp = ToolbarTile.getDrawable(R.styleable.AppToolbarTile_iconHelp);
- iconMore = ToolbarTile.getDrawable(R.styleable.AppToolbarTile_iconMore);
- iconRecovery = ToolbarTile.getDrawable(R.styleable.AppToolbarTile_iconRecovery);
- iconInfo = ToolbarTile.getDrawable(R.styleable.AppToolbarTile_iconInfo);
+ iconRightOne = ToolbarTile.getDrawable(R.styleable.AppToolbarTile_iconRightOne);
+ iconRightTwo = ToolbarTile.getDrawable(R.styleable.AppToolbarTile_iconRightTwo);
+ iconRightThree = ToolbarTile.getDrawable(R.styleable.AppToolbarTile_iconRightThree);
ToolbarTile.recycle();
}
@@ -48,23 +70,18 @@ public class AppTitleUtils extends LinearLayout {
super.onFinishInflate();
layout = (LinearLayout) LayoutInflater.from(getContext()).inflate(R.layout.title_layout_utils, this, true);
- TextView titleName = layout.findViewById(R.id.title_name);
-
+ titleName = layout.findViewById(R.id.title_name);
titleBlack = layout.findViewById(R.id.title_black);
- titleCamera = layout.findViewById(R.id.icon_camera);
- titleHelp = layout.findViewById(R.id.icon_help);
- titleMore = layout.findViewById(R.id.icon_more);
- titleRecovery = layout.findViewById(R.id.icon_recovery);
- titleInfo = layout.findViewById(R.id.icon_info);
+ titleRightOne = layout.findViewById(R.id.icon_right_one);
+ titleRightTwo = layout.findViewById(R.id.icon_right_two);
+ titleRightThree = layout.findViewById(R.id.icon_right_three);
titleLine = layout.findViewById(R.id.title_line);
titleName.setText(nameTitle);
titleBlack.setImageDrawable(iconLeftBlack);
- titleCamera.setImageDrawable(iconCamera);
- titleHelp.setImageDrawable(iconHelp);
- titleMore.setImageDrawable(iconMore);
- titleRecovery.setImageDrawable(iconRecovery);
- titleInfo.setImageDrawable(iconInfo);
+ titleRightOne.setImageDrawable(iconRightOne);
+ titleRightTwo.setImageDrawable(iconRightTwo);
+ titleRightThree.setImageDrawable(iconRightThree);
}
}
diff --git a/model_zoo/official/lite/MindSpore_inhand/common/src/main/res/layout/title_layout_utils.xml b/model_zoo/official/lite/MindSpore_inhand/common/src/main/res/layout/title_layout_utils.xml
index 994abebb9e2cdf97e163bbf5081efc00ea1a3ca4..7fc1bd17fce9ae026b731f1ed272903eb429fc3b 100644
--- a/model_zoo/official/lite/MindSpore_inhand/common/src/main/res/layout/title_layout_utils.xml
+++ b/model_zoo/official/lite/MindSpore_inhand/common/src/main/res/layout/title_layout_utils.xml
@@ -29,7 +29,7 @@
android:textSize="16sp" />
-
-
-
-
-
-
-
-
-
+
+
+
diff --git a/model_zoo/official/lite/MindSpore_inhand/hms/src/main/java/com/mindspore/hms/gesturerecognition/StillHandGestureAnalyseActivity.java b/model_zoo/official/lite/MindSpore_inhand/hms/src/main/java/com/mindspore/hms/gesturerecognition/StillHandGestureAnalyseActivity.java
index 2dbc1fbc6596d9dc0f058c193e913e6d81200447..80ff91cd1f671fb4c43badb9588551cdc51af10d 100644
--- a/model_zoo/official/lite/MindSpore_inhand/hms/src/main/java/com/mindspore/hms/gesturerecognition/StillHandGestureAnalyseActivity.java
+++ b/model_zoo/official/lite/MindSpore_inhand/hms/src/main/java/com/mindspore/hms/gesturerecognition/StillHandGestureAnalyseActivity.java
@@ -88,7 +88,7 @@ public class StillHandGestureAnalyseActivity extends AppCompatActivity {
imgPreview = findViewById(R.id.img_origin);
textOriginImage = findViewById(R.id.tv_image);
appTitle = findViewById(R.id.activity_toolbar);
- appTitle.findViewById(R.id.title_black).setOnClickListener(view -> finish());
+ appTitle.setNavigationOnClickListener(view -> finish());
}
public void onClickPhoto(View view) {
diff --git a/model_zoo/official/lite/MindSpore_inhand/hms/src/main/java/com/mindspore/hms/textrecognition/TextRecognitionActivity.java b/model_zoo/official/lite/MindSpore_inhand/hms/src/main/java/com/mindspore/hms/textrecognition/TextRecognitionActivity.java
index f5c634fe5be18437daf17fbb6bc236b813906396..34d4a6baf2f490670852265e451734201f24646d 100644
--- a/model_zoo/official/lite/MindSpore_inhand/hms/src/main/java/com/mindspore/hms/textrecognition/TextRecognitionActivity.java
+++ b/model_zoo/official/lite/MindSpore_inhand/hms/src/main/java/com/mindspore/hms/textrecognition/TextRecognitionActivity.java
@@ -100,7 +100,7 @@ public class TextRecognitionActivity extends AppCompatActivity {
imgPreview = findViewById(R.id.img_origin);
textOriginImage = findViewById(R.id.tv_image);
appTitle = findViewById(R.id.segmentation_toolbar);
- appTitle.findViewById(R.id.title_black).setOnClickListener(view -> finish());
+ appTitle.setNavigationOnClickListener(view -> finish());
}
diff --git a/model_zoo/official/lite/MindSpore_inhand/hms/src/main/java/com/mindspore/hms/texttranslation/TextTranslationActivity.java b/model_zoo/official/lite/MindSpore_inhand/hms/src/main/java/com/mindspore/hms/texttranslation/TextTranslationActivity.java
index 2cefd415e4abd8f1f98b20236dcaf8d95532df99..895e271d3a5d4a216215687ce02fa531cb7ca764 100644
--- a/model_zoo/official/lite/MindSpore_inhand/hms/src/main/java/com/mindspore/hms/texttranslation/TextTranslationActivity.java
+++ b/model_zoo/official/lite/MindSpore_inhand/hms/src/main/java/com/mindspore/hms/texttranslation/TextTranslationActivity.java
@@ -103,7 +103,7 @@ public class TextTranslationActivity extends AppCompatActivity {
private void init() {
AppTitleUtils appTitle = findViewById(R.id.text_online_activity_toolbar);
- appTitle.findViewById(R.id.title_black).setOnClickListener(view -> finish());
+ appTitle.setNavigationOnClickListener(view -> finish());
mEditText = findViewById(R.id.text_edit);
mEditText.setMovementMethod(ScrollingMovementMethod.getInstance());
mTextView = findViewById(R.id.text_view);
diff --git a/model_zoo/official/lite/MindSpore_inhand/hms/src/main/res/values/colors.xml b/model_zoo/official/lite/MindSpore_inhand/hms/src/main/res/values/colors.xml
index 801ede1d51b38448031f7d2215fc34d9e0f7fb4e..24e4fd167c136aa7999eae57a9d05da9087d35dd 100644
--- a/model_zoo/official/lite/MindSpore_inhand/hms/src/main/res/values/colors.xml
+++ b/model_zoo/official/lite/MindSpore_inhand/hms/src/main/res/values/colors.xml
@@ -29,6 +29,7 @@
#FF40C4FF
#FF00B0FF
#66000000
+ #14141a
#66000000
diff --git a/model_zoo/official/lite/MindSpore_inhand/imageObject/src/main/java/com/mindspore/imageobject/imageclassification/ui/ImageCameraActivity.java b/model_zoo/official/lite/MindSpore_inhand/imageObject/src/main/java/com/mindspore/imageobject/imageclassification/ui/ImageCameraActivity.java
index 2cd4f560790f0c2c1a0a43c9dcc5e93de8c076bf..af317c967eae9e3c696af648a3b12d291a331eaa 100644
--- a/model_zoo/official/lite/MindSpore_inhand/imageObject/src/main/java/com/mindspore/imageobject/imageclassification/ui/ImageCameraActivity.java
+++ b/model_zoo/official/lite/MindSpore_inhand/imageObject/src/main/java/com/mindspore/imageobject/imageclassification/ui/ImageCameraActivity.java
@@ -78,15 +78,11 @@ public class ImageCameraActivity extends AppCompatActivity implements CameraPrev
boolean ret = imageTrackingMobile.loadModelFromBuf(IMAGE_SCENE_MS);
Log.d(TAG, "Loading model return value: " + ret);
cameraPreview.addImageRecognitionDataCallBack(this);
- appTitle.findViewById(R.id.title_black).setOnClickListener(view -> finish());
- titleOnClick();
- }
-
- private void titleOnClick() {
- appTitle.findViewById(R.id.icon_help).setOnClickListener(view -> {
+ appTitle.setNavigationOnClickListener(view -> finish());
+ appTitle.setTitleRightTwo(view -> {
showHelpDialog();
});
- appTitle.findViewById(R.id.icon_more).setOnClickListener(view -> {
+ appTitle.setTitleRightThree(view -> {
Utils.openBrowser(this, MSLinkUtils.HELP_IMAGE_CLASSIFICATION);
});
}
diff --git a/model_zoo/official/lite/MindSpore_inhand/imageObject/src/main/java/com/mindspore/imageobject/objectdetection/ui/ObjectCameraActivity.java b/model_zoo/official/lite/MindSpore_inhand/imageObject/src/main/java/com/mindspore/imageobject/objectdetection/ui/ObjectCameraActivity.java
index 20bca6b0e459fb65ebd28881ed3d3143043c4141..89208a57c49d453c0bbcccffeab5749138075a65 100644
--- a/model_zoo/official/lite/MindSpore_inhand/imageObject/src/main/java/com/mindspore/imageobject/objectdetection/ui/ObjectCameraActivity.java
+++ b/model_zoo/official/lite/MindSpore_inhand/imageObject/src/main/java/com/mindspore/imageobject/objectdetection/ui/ObjectCameraActivity.java
@@ -21,6 +21,7 @@ import android.text.TextUtils;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
+import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
@@ -87,15 +88,11 @@ public class ObjectCameraActivity extends AppCompatActivity implements CameraPre
Log.i(TAG, "init ObjectPhotoActivity info");
appTitle = findViewById(R.id.object_camera_toolbar);
- appTitle.findViewById(R.id.title_black).setOnClickListener(view -> finish());
- titleOnClick();
- }
-
- private void titleOnClick() {
- appTitle.findViewById(R.id.icon_help).setOnClickListener(view -> {
+ appTitle.setNavigationOnClickListener(view -> finish());
+ appTitle.setTitleRightTwo(view -> {
showHelpDialog();
});
- appTitle.findViewById(R.id.icon_more).setOnClickListener(view -> {
+ appTitle.setTitleRightThree(view -> {
Utils.openBrowser(this, MSLinkUtils.HELP_IMAGE_CLASSIFICATION);
});
}
diff --git a/model_zoo/official/lite/MindSpore_inhand/imageObject/src/main/res/layout/activity_image_camera.xml b/model_zoo/official/lite/MindSpore_inhand/imageObject/src/main/res/layout/activity_image_camera.xml
index d6765a337b3000e8d75ca9fd018dc407f687cc81..572eb96fcf92a1e049509fd61fd773f1b2b8cf6c 100644
--- a/model_zoo/official/lite/MindSpore_inhand/imageObject/src/main/res/layout/activity_image_camera.xml
+++ b/model_zoo/official/lite/MindSpore_inhand/imageObject/src/main/res/layout/activity_image_camera.xml
@@ -20,9 +20,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
- title:iconHelp="@drawable/icon_help"
+ title:iconRightTwo="@drawable/icon_help"
title:iconLeftBlack="@drawable/icon_back"
- title:iconMore="@drawable/icon_more"
+ title:iconRightThree="@drawable/icon_more"
title:nameTitle="@string/image_camera_title" />
im
appTitle = findViewById(R.id.camera_toolbar);
titleName = appTitle.findViewById(R.id.title_name);
- titleName.setText(CameraConstants.CAMERA_MODEL[model]);
- appTitle.findViewById(R.id.title_black).setOnClickListener(view -> finish());
+ appTitle.setTitleText(CameraConstants.CAMERA_MODEL[model]);
+ appTitle.setNavigationOnClickListener(view -> finish());
preImage = findViewById(R.id.preIamge);
cancleLayout = findViewById(R.id.cancleLayout);
diff --git a/model_zoo/official/lite/MindSpore_inhand/modelcamera/src/main/java/com/mindspore/modelcamera/ui/MainCameraActivity.java b/model_zoo/official/lite/MindSpore_inhand/modelcamera/src/main/java/com/mindspore/modelcamera/ui/MainCameraActivity.java
index 540e282dd30db9ea60452f0d53a0c3a430519075..08c82dba2b25ab11033e8c02335d33f5507af60b 100644
--- a/model_zoo/official/lite/MindSpore_inhand/modelcamera/src/main/java/com/mindspore/modelcamera/ui/MainCameraActivity.java
+++ b/model_zoo/official/lite/MindSpore_inhand/modelcamera/src/main/java/com/mindspore/modelcamera/ui/MainCameraActivity.java
@@ -33,10 +33,7 @@ import android.widget.TextView;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.appcompat.app.AppCompatActivity;
-import androidx.appcompat.widget.Toolbar;
import androidx.camera.core.CameraSelector;
-import androidx.core.graphics.drawable.RoundedBitmapDrawable;
-import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
@@ -79,7 +76,6 @@ public class MainCameraActivity extends AppCompatActivity implements ICameraPrev
private ImageButton btnCamera;
private NiceImageView imgGallery;
private Switch switchBtn;
- private TextView titleName;
private CommonCameraFragment styleFragment, segmentFragment, poseNetFragment, faceFragment;
@@ -112,9 +108,8 @@ public class MainCameraActivity extends AppCompatActivity implements ICameraPrev
private void init() {
appTitle = findViewById(R.id.camera_toolbar);
- appTitle.findViewById(R.id.title_black).setOnClickListener(view -> finish());
- titleName = appTitle.findViewById(R.id.title_name);
- titleName.setText(CameraConstants.CAMERA_MODEL[model]);
+ appTitle.setNavigationOnClickListener(view -> finish());
+ appTitle.setTitleText(CameraConstants.CAMERA_MODEL[model]);
viewPager = findViewById(R.id.viewPager);
mTabLayout = findViewById(R.id.tab_layout);
@@ -181,7 +176,7 @@ public class MainCameraActivity extends AppCompatActivity implements ICameraPrev
public void onTabSelected(TabLayout.Tab tab) {
Log.d(TAG, "onTabSelected: " + tab.getPosition());
model = tab.getPosition();
- titleName.setText(CameraConstants.CAMERA_MODEL[model]);
+ appTitle.setTitleText(CameraConstants.CAMERA_MODEL[model]);
viewPager.setCurrentItem(tab.getPosition(), true);
recoverItem();
View view = tab.getCustomView();