protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
- sosPresenter = new SOSPresenter(this);
+ //sosPresenter = new SOSPresenter(this);
//监听状态变化
- initObserver();
+ //initObserver();
}
@Override
<?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello World!"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintLeft_toLeftOf="parent"
- app:layout_constraintRight_toRightOf="parent"
- app:layout_constraintTop_toTopOf="parent" />
-</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
+ <include
+ layout="@layout/include_calling"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:visibility="gone" />
+
+
+ <include
+ layout="@layout/include_error"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:visibility="gone" />
+
+ <include
+ layout="@layout/include_no_sos_number"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+
+</FrameLayout>
\ No newline at end of file
<?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">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:gravity="center_horizontal"
+ android:orientation="vertical">
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="20dp"
+ android:src="@drawable/calling_anim" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="10dp"
+ android:text="@string/calling_text"
+ android:textColor="#EA9A45"
+ android:textSize="28sp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/urgent_text"
+ android:textColor="@color/white"
+ android:textSize="36sp" />
+
+ </LinearLayout>
</FrameLayout>
\ No newline at end of file
<?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">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:gravity="center_horizontal"
+ android:orientation="vertical">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="10dp"
+ android:text="@string/call_error_text"
+ android:textColor="#EC2E35"
+ android:textSize="28sp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/urgent_text"
+ android:textColor="@color/white"
+ android:textSize="36sp" />
+
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="20dp"
+ android:src="@mipmap/icon_cancel" />
+
+ </LinearLayout>
</FrameLayout>
\ No newline at end of file
--- /dev/null
+<?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">
+
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:gravity="center_horizontal"
+ android:orientation="vertical">
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="20dp"
+ android:src="@mipmap/icon_no_sim_card" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/no_sim_text"
+ android:textColor="@color/white"
+ android:textSize="36sp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/set_up_sim_text"
+ android:textColor="@color/white"
+ android:textSize="36sp" />
+
+ </LinearLayout>
+
+</FrameLayout>
\ No newline at end of file
<?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">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:gravity="center_horizontal"
+ android:orientation="vertical">
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="20dp"
+ android:src="@mipmap/icon_no_sos_number" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/no_urgent_number_text"
+ android:textColor="@color/white"
+ android:textSize="36sp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/set_up_sos_number_text"
+ android:textColor="@color/white"
+ android:textSize="36sp" />
+
+ </LinearLayout>
</FrameLayout>
\ No newline at end of file
--- /dev/null
+<resources>
+ <string name="app_name">ICSOS</string>
+ <string name="calling_text">Calling…</string>
+ <string name="call_error_text">呼叫失败</string>
+ <string name="no_sim_text">当前没有SIM卡</string>
+ <string name="set_up_sim_text">请立即安装</string>
+ <string name="no_urgent_number_text">当前没有紧急联系人</string>
+ <string name="set_up_sos_number_text">请立即设置</string>
+</resources>
\ No newline at end of file
--- /dev/null
+<resources>
+ <string name="app_name">ICSOS</string>
+ <string name="calling_text">正在呼叫…</string>
+ <string name="call_error_text">呼叫失败</string>
+ <string name="no_sim_text">当前没有SIM卡</string>
+ <string name="set_up_sim_text">请立即安装</string>
+ <string name="no_urgent_number_text">当前没有紧急联系人</string>
+ <string name="set_up_sos_number_text">请立即设置</string>
+</resources>
\ No newline at end of file
+++ /dev/null
-<resources xmlns:tools="http://schemas.android.com/tools">
- <!-- Base application theme. -->
- <style name="Theme.ICSOS" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
- <!-- Primary brand color. -->
- <item name="colorPrimary">@color/purple_200</item>
- <item name="colorPrimaryVariant">@color/purple_700</item>
- <item name="colorOnPrimary">@color/black</item>
- <!-- Secondary brand color. -->
- <item name="colorSecondary">@color/teal_200</item>
- <item name="colorSecondaryVariant">@color/teal_200</item>
- <item name="colorOnSecondary">@color/black</item>
- <!-- Status bar color. -->
- <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
- <!-- Customize your theme here. -->
- </style>
-</resources>
\ No newline at end of file
<resources>
<string name="app_name">ICSOS</string>
+ <string name="calling_text">正在呼叫…</string>
+ <string name="urgent_text">紧急服务</string>
+ <string name="call_error_text">呼叫失败</string>
+ <string name="no_sim_text">当前没有SIM卡</string>
+ <string name="set_up_sim_text">请立即安装</string>
+ <string name="no_urgent_number_text">当前没有紧急联系人</string>
+ <string name="set_up_sos_number_text">请立即设置</string>
</resources>
\ No newline at end of file
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
- <style name="Theme.ICSOS" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
+ <style name="Theme.ICSOS" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
- <!-- Status bar color. -->
- <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
- <!-- Customize your theme here. -->
+ <item name="android:background">@color/black</item>
+ <item name="android:textStyle">bold</item>
</style>
</resources>
\ No newline at end of file