Skip to content

Commit

Permalink
[Android] add app welcome page (#766)
Browse files Browse the repository at this point in the history
* Remove redundant code for segmentation.

* Classification Documentation and example improvement.

* Ocr Documentation and example improvement.

* 1.detection、face、seg module add "svPreview.enableCamera();".
2.java/android add fastdepolyUi module.

* examples/vision/ to add OCRv3.

* Modify UI directory name.

* Refresh examples\vision,change OCR README.md

* Update ui module

* Update ui module

* [Android] add enableCamera method.

* [Android] add welcome page.

* [Android] add text:“Power by EasyEdge”.

Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com>
  • Loading branch information
WinterGeng and DefTruth authored Dec 1, 2022
1 parent 11995e5 commit 0d53ebb
Show file tree
Hide file tree
Showing 16 changed files with 617 additions and 2 deletions.
8 changes: 6 additions & 2 deletions java/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".ocr.OcrMainActivity">
<activity android:name=".segmentation.SegmentationWelcomeActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".ocr.OcrSettingsActivity"
android:name=".segmentation.SegmentationMainActivity"
android:label="Settings">
</activity>
<activity
android:name=".segmentation.SegmentationSettingsActivity"
android:label="Settings">
</activity>
</application>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.baidu.paddle.fastdeploy.app.examples.classification;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.baidu.paddle.fastdeploy.app.examples.R;

public class ClassificationWelcomeActivity extends Activity {

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
);
getWindow().setStatusBarColor(Color.TRANSPARENT);
}
setContentView(R.layout.classification_welcome);
}

public void startActivity(View view) {
Intent intent = new Intent(ClassificationWelcomeActivity.this, ClassificationMainActivity.class);
startActivity(intent);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.baidu.paddle.fastdeploy.app.examples.detection;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.baidu.paddle.fastdeploy.app.examples.R;

public class DetectionWelcomeActivity extends Activity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
);
getWindow().setStatusBarColor(Color.TRANSPARENT);
}
setContentView(R.layout.detection_welcome);
}

public void startActivity(View view) {
Intent intent = new Intent(DetectionWelcomeActivity.this, DetectionMainActivity.class);
startActivity(intent);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.baidu.paddle.fastdeploy.app.examples.facedet;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.baidu.paddle.fastdeploy.app.examples.R;

public class FaceDetWelcomeActivity extends Activity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
);
getWindow().setStatusBarColor(Color.TRANSPARENT);
}
setContentView(R.layout.facedet_welcome);
}

public void startActivity(View view) {
Intent intent = new Intent(FaceDetWelcomeActivity.this, FaceDetMainActivity.class);
startActivity(intent);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.baidu.paddle.fastdeploy.app.examples.keypointdetection;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.baidu.paddle.fastdeploy.app.examples.R;

public class KeyPointDetectionWelcomeActivity extends Activity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
);
getWindow().setStatusBarColor(Color.TRANSPARENT);
}
setContentView(R.layout.keypointdetection_welcome);
}

public void startActivity(View view) {
Intent intent = new Intent(KeyPointDetectionWelcomeActivity.this, KeyPointDetectionMainActivity.class);
startActivity(intent);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.baidu.paddle.fastdeploy.app.examples.ocr;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.baidu.paddle.fastdeploy.app.examples.R;

public class OcrWelcomeActivity extends Activity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
);
getWindow().setStatusBarColor(Color.TRANSPARENT);
}
setContentView(R.layout.ocr_welcome);
}

public void startActivity(View view) {
Intent intent = new Intent(OcrWelcomeActivity.this, OcrMainActivity.class);
startActivity(intent);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.baidu.paddle.fastdeploy.app.examples.segmentation;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.baidu.paddle.fastdeploy.app.examples.R;

public class SegmentationWelcomeActivity extends Activity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
);
getWindow().setStatusBarColor(Color.TRANSPARENT);
}
setContentView(R.layout.segmentation_welcome);
}

public void startActivity(View view) {
Intent intent = new Intent(SegmentationWelcomeActivity.this, SegmentationMainActivity.class);
startActivity(intent);
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions java/android/app/src/main/res/layout/classification_welcome.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:background="@drawable/main_bk"
/>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/model_text"
android:layout_width="320dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="120dp"
android:background="@color/colorStartBtn"
android:gravity="center"
android:text="FastDeploy-Classification"
android:textColor="@color/colorTextWrite"
android:textSize="25sp" />

<TextView
android:id="@+id/baidu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/model_text"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:text="百度"
android:textColor="@color/colorTextWrite"
android:textSize="22sp" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/baidu"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="Power by EasyEdge"
android:textColor="@color/colorTextWrite"
android:textSize="22sp" />

<Button

android:id="@+id/start_ui_activity"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="50dp"
android:background="@drawable/round_corner_btn"
android:text="@string/start_ui_activity"
android:textColor="@color/colorTextWrite"
android:textSize="22sp"
android:onClick="startActivity"/>


</RelativeLayout>
</FrameLayout>



70 changes: 70 additions & 0 deletions java/android/app/src/main/res/layout/detection_welcome.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:background="@drawable/main_bk"
/>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/model_text"
android:layout_width="320dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="120dp"
android:background="@color/colorStartBtn"
android:gravity="center"
android:text="FastDeploy-Detection"
android:textColor="@color/colorTextWrite"
android:textSize="25sp" />

<TextView
android:id="@+id/baidu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/model_text"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:text="百度"
android:textColor="@color/colorTextWrite"
android:textSize="22sp" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/baidu"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="Power by EasyEdge"
android:textColor="@color/colorTextWrite"
android:textSize="22sp" />

<Button
android:id="@+id/start_ui_activity"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="50dp"
android:background="@drawable/round_corner_btn"
android:text="@string/start_ui_activity"
android:textColor="@color/colorTextWrite"
android:textSize="22sp"
android:onClick="startActivity"/>


</RelativeLayout>
</FrameLayout>



Loading

0 comments on commit 0d53ebb

Please sign in to comment.