Android 手機衛士--導航介面3、4和功能列表介面跳轉邏輯處理,android4和

來源:互聯網
上載者:User

Android 手機衛士--導航介面3、4和功能列表介面跳轉邏輯處理,android4和

剛剛花了一點時間,將導航介面3、4的布局和相應的跳轉邏輯寫了一下:

Setup3Activity代碼如下:

/** * Created by wuyudong on 2016/10/10. */public class Setup3Activity extends Activity{    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.activity_setup3);    }    public void nextPage(View view) {        Intent intent = new Intent(getApplicationContext(), Setup4Activity.class);        startActivity(intent);        finish();    }    public void prePage(View view) {        Intent intent = new Intent(getApplicationContext(), Setup2Activity.class);        startActivity(intent);        finish();    }}

對應的布局檔案activity_setup3.xml:

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="vertical">    <TextView        style="@style/TitleStyle"        android:text="3.設定安全號碼" />    <TextView        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:textColor="#000"        android:textSize="18sp"        android:layout_margin="5dp"        android:text="sim卡變更後\n就會發送警示簡訊安全號碼" />    <EditText        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:id="@+id/et_phone_number"        android:hint="請輸入電話號碼"        />    <Button        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:id="@+id/bt_select_number"        android:text="選擇連絡人"        android:background="@drawable/selector_number_btn"        />    <!-- 讓內部點的空間水平置中 -->    <LinearLayout        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:gravity="center_horizontal">        <ImageView            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:background="@android:drawable/presence_invisible" />        <ImageView            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:background="@android:drawable/presence_invisible" />        <ImageView            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:background="@android:drawable/presence_online" />        <ImageView            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:background="@android:drawable/presence_invisible" />    </LinearLayout>    <RelativeLayout        android:layout_width="match_parent"        android:layout_height="match_parent">        <!-- 圖片選取器,在選中和未選中的過程中,切換展示圖片 -->        <Button style="@style/preBtn" />        <Button style="@style/nextBtn" />        <ImageView            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:background="@drawable/phone"            android:layout_centerVertical="true"            android:layout_centerHorizontal="true" />    </RelativeLayout></LinearLayout>

Setup4Activity代碼如下:

/** * Created by wuyudong on 2016/10/10. */public class Setup4Activity extends Activity{    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.activity_setup4);    }   public void nextPage(View view) {        Intent intent = new Intent(getApplicationContext(), SetupOverActivity.class);        startActivity(intent);        finish();        SpUtil.putBoolean(this, ConstantValue.SETUP_OVER, true);    }    public void prePage(View view) {        Intent intent = new Intent(getApplicationContext(), Setup3Activity.class);        startActivity(intent);        finish();    }}

對應的布局檔案activity_setup4.xml:

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="vertical">    <TextView        style="@style/TitleStyle"        android:text="4.恭喜您,設定完成" />    <CheckBox        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="防盜保護已關閉"        />    <!-- 讓內部點的空間水平置中 -->    <LinearLayout        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:gravity="center_horizontal">        <ImageView            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:background="@android:drawable/presence_invisible" />        <ImageView            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:background="@android:drawable/presence_invisible" />        <ImageView            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:background="@android:drawable/presence_invisible" />        <ImageView            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:background="@android:drawable/presence_online" />    </LinearLayout>    <RelativeLayout        android:layout_width="match_parent"        android:layout_height="match_parent">        <ImageView            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:layout_centerInParent="true"            android:background="@drawable/phone" />        <!-- 圖片選取器,在選中和未選中的過程中,切換展示圖片 -->        <Button style="@style/preBtn" />        <Button style="@style/nextBtn"            android:text="設定完成"            />    </RelativeLayout></LinearLayout>

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.