设置界面增加 "一键修复下载" 按钮

This commit is contained in:
huangzhuanghua
2016-08-18 12:00:37 +08:00
parent 9c29be3378
commit 04851d5df3
2 changed files with 56 additions and 47 deletions

View File

@ -121,6 +121,7 @@ public class SettingActivity extends BaseActivity implements OnClickListener {
init(contentView, "设置");
findViewById(R.id.setting_cv_fix_download).setOnClickListener(this);
findViewById(R.id.setting_rl_autoinstall).setOnClickListener(this);
findViewById(R.id.setting_rl_autodelete).setOnClickListener(this);
findViewById(R.id.setting_rl_deletedata).setOnClickListener(this);
@ -128,13 +129,7 @@ public class SettingActivity extends BaseActivity implements OnClickListener {
findViewById(R.id.setting_rl_update).setOnClickListener(this);
findViewById(R.id.setting_rl_feedback).setOnClickListener(this);
findViewById(R.id.setting_rl_cache).setOnClickListener(this);
findViewById(R.id.setting_rl_font_size).setOnClickListener(this);
if (AppController.get("user", false) != null) {
findViewById(R.id.setting_tv_account).setOnClickListener(this);
} else {
findViewById(R.id.setting_tv_account).setVisibility(View.GONE);
}
findViewById(R.id.setting_cv_font_size).setOnClickListener(this);
setting_tv_version.setText("当前版本V"
+ PackageUtils.getVersion(getApplicationContext()));
@ -210,6 +205,9 @@ public class SettingActivity extends BaseActivity implements OnClickListener {
switch (v.getId()) {
case R.id.actionbar_rl_back:
finish();
break;
case R.id.setting_cv_fix_download:
break;
case R.id.setting_rl_autoinstall:
setting_sb_autoinstall.performClick();
@ -244,7 +242,7 @@ public class SettingActivity extends BaseActivity implements OnClickListener {
DialogUtils.showDisclaimerDialog(this, content);
}
break;
case R.id.setting_rl_font_size:
case R.id.setting_cv_font_size:
fontSize();
break;

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_color"
@ -13,10 +14,38 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.CardView xmlns:app="http://schemas.android.com/apk/res-auto"
<android.support.v7.widget.CardView
android:id="@+id/setting_cv_fix_download"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/cardview_mar_left"
android:layout_marginRight="@dimen/cardview_mar_left"
android:layout_marginTop="13dp"
android:layout_marginBottom="1dp"
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground"
app:cardCornerRadius="0dp"
app:cardElevation="2dp"
app:cardUseCompatPadding="true"
app:cardBackgroundColor="#FF4E00">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="10dp"
android:gravity="center"
android:text="一键修复下载"
android:textSize="18dp"
android:textColor="#FFFFFF"/>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="@+id/setting_cv_font_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/cardview_mar_left"
@ -30,11 +59,9 @@
android:layout_marginBottom="5dp">
<RelativeLayout
android:id="@+id/setting_rl_font_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/reuse_listview_item_style"
android:padding="13dp">
android:padding="10dp">
<TextView
android:layout_width="wrap_content"
@ -56,7 +83,7 @@
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView xmlns:app="http://schemas.android.com/apk/res-auto"
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/cardview_mar_left"
@ -72,26 +99,12 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/setting_tv_account"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/reuse_listview_item_style"
android:padding="10dp"
android:text="账户安全设置"
android:textSize="16sp"
android:visibility="gone"/>
<RelativeLayout
android:id="@+id/setting_rl_autoinstall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:background="@drawable/reuse_listview_item_style"
android:paddingRight="10dp"
android:paddingLeft="10dp"
android:paddingBottom="5dp"
android:paddingTop="5dp">
android:background="@drawable/reuse_list_item_style"
android:padding="10dp">
<TextView
android:id="@+id/setting_tv_autoinstall"
@ -123,21 +136,20 @@
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#ededed"></View>
android:background="#ededed"/>
<RelativeLayout
android:id="@+id/setting_rl_autodelete"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:background="@drawable/reuse_listview_item_style"
android:background="@drawable/reuse_list_item_style"
android:padding="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="安装完成自动删除安装包"
android:text="安装完成自动删除安装包"
android:textColor="#333333"
android:textSize="16sp" />
@ -154,13 +166,13 @@
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#ededed"></View>
android:background="#ededed"/>
<RelativeLayout
android:id="@+id/setting_rl_deletedata"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/reuse_listview_item_style"
android:background="@drawable/reuse_list_item_style"
android:padding="10dp">
<TextView
@ -184,7 +196,7 @@
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView xmlns:app="http://schemas.android.com/apk/res-auto"
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/cardview_mar_left"
@ -206,7 +218,7 @@
android:id="@+id/setting_rl_autoupdate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/reuse_listview_item_style"
android:background="@drawable/reuse_list_item_style"
android:padding="10dp">
<TextView
@ -230,14 +242,13 @@
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#ededed"></View>
android:background="#ededed"/>
<RelativeLayout
android:id="@+id/setting_rl_update"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/reuse_listview_item_style"
android:padding="13dp">
android:padding="10dp">
<TextView
android:layout_width="wrap_content"
@ -261,14 +272,14 @@
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#ededed"></View>
android:background="#ededed"/>
<RelativeLayout
android:id="@+id/setting_rl_cache"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/reuse_listview_item_style"
android:padding="13dp">
android:background="@drawable/reuse_list_item_style"
android:padding="10dp">
<TextView
android:layout_width="wrap_content"
@ -292,7 +303,7 @@
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView xmlns:app="http://schemas.android.com/apk/res-auto"
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/cardview_mar_left"
@ -307,7 +318,7 @@
android:id="@+id/setting_rl_feedback"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/reuse_listview_item_style"
android:background="@drawable/reuse_list_item_style"
android:padding="10dp">
<TextView
@ -332,7 +343,7 @@
android:id="@+id/setting_tv_disclaimer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/reuse_listview_item_style"
android:background="@drawable/reuse_list_item_style"
android:padding="10dp"
android:text="免责声明"
android:textSize="16sp"