import android.content.Context;\r
import android.os.Build;\r
import android.os.Bundle;\r
+import android.os.SystemProperties;\r
import android.util.Log;\r
import android.view.MotionEvent;\r
import android.view.View;\r
public class shutdown_activity extends BaseActivity {\r
\r
String TAG = "shutdown_activity";\r
- ImageButton btn_yes;\r
- ImageButton btn_no;\r
+ Button btn_yes;\r
+ Button btn_no;\r
\r
\r
@Override\r
protected void onCreate(Bundle savedInstanceState) {\r
super.onCreate(savedInstanceState);\r
- setContentView(R.layout.activity_shutdown_activity);\r
+ //判断是不是fzd的,如果是fzd的,那么显示防走丢的关机界面\r
+ String protocolNum = SystemProperties.get("persist.sys.protocol_no");\r
+ if ("3".equals(protocolNum)) {\r
+ setContentView(R.layout.activity_fzd_shutdown);\r
+ } else {\r
+ setContentView(R.layout.activity_shutdown_activity);\r
+ }\r
setclicklistener(true);\r
if (FTUtils.isA9()) {\r
btn_yes.setVisibility(View.GONE);\r
}\r
\r
private void setclicklistener(boolean b) {\r
- btn_yes = (ImageButton) findViewById(R.id.btn_yes);\r
- btn_no = (ImageButton) findViewById(R.id.btn_no);\r
+ btn_yes = (Button) findViewById(R.id.btn_yes);\r
+ btn_no = (Button) findViewById(R.id.btn_no);\r
if (b) {\r
btn_yes.setClickable(true);\r
btn_yes.setEnabled(true);\r
btn_yes.setOnClickListener(new View.OnClickListener() {\r
@Override\r
public void onClick(View v) {\r
- findViewById(R.id.bottom_tbn_container).setVisibility(View.GONE);\r
- findViewById(R.id.shutdownText).setVisibility(View.GONE);\r
+ View viewById = findViewById(R.id.bottom_tbn_container);\r
+ if (viewById != null) {\r
+ viewById.setVisibility(View.GONE);\r
+ }\r
+ View viewById1 = findViewById(R.id.shutdownText);\r
+ if (viewById1 != null) {\r
+ viewById1.setVisibility(View.GONE);\r
+ }\r
//log("shutdown");\r
finish();\r
try {\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/fzd_cancel_press" android:state_pressed="true" />
+ <item android:drawable="@drawable/fzd_cancel_normal" />
+
+</selector>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/fzd_save_mode_press" android:state_pressed="true" />
+ <item android:drawable="@drawable/fzd_save_mode_normal" />
+
+</selector>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/fzd_shutdown_press" android:state_pressed="true" />
+ <item android:drawable="@drawable/fzd_shutdown_normal" />
+
+</selector>
\ 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="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:layout_marginLeft="55dp"
+ android:layout_marginRight="55dp"
+ android:orientation="vertical">
+
+ <Button
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="10dp"
+ android:background="@drawable/fzd_save_mode_selector"
+ android:text="@string/save_mode_text"
+ android:textColor="@color/white"
+ android:textSize="30sp" />
+
+ <Button
+ android:id="@+id/btn_yes"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/fzd_shutdown_selector"
+ android:text="@string/shutdown_text"
+ android:textColor="@color/white"
+ android:textSize="30sp" />
+
+ <Button
+ android:id="@+id/btn_no"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="10dp"
+ android:background="@drawable/fzd_cancel_selector"
+ android:text="@string/cancel_text"
+ android:textColor="@color/white"
+ android:textSize="30sp" />
+
+ </LinearLayout>
+
+
+</FrameLayout>
\ No newline at end of file
<string name="meter">Meters</string>
<string name="factory_temp_format_text">%1$.2f</string>
<string name="power_off">shutdown</string>
+ <string name="save_mode_text">超级省电模式</string>
+ <string name="shutdown_text">关机</string>
+ <string name="cancel_text">取消</string>
</resources>