Skip to content

Commit

Permalink
修改设置界面
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhoujunAndroid committed Nov 18, 2013
1 parent 112f922 commit 2363395
Show file tree
Hide file tree
Showing 7 changed files with 194 additions and 161 deletions.
Binary file removed baby/libs/Android_SDK_v1.2.jar
Binary file not shown.
Binary file removed baby/libs/pinyin4j-2.5.0.jar
Binary file not shown.
2 changes: 0 additions & 2 deletions baby/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@

# Project target.
target=android-8
android.library.reference.1=../weibo_sdk_source_code_20120307/com_weibo_android
android.library.reference.2=../renren_android_connect
267 changes: 148 additions & 119 deletions baby/res/layout/setting_activity.xml
Original file line number Diff line number Diff line change
@@ -1,142 +1,171 @@
<?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">
<include layout="@layout/common_title_bar" />


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

<LinearLayout
android:id="@+id/linearLayout1"
<include layout="@layout/common_title_bar" />

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="23dp"
android:background="@drawable/bg_setting"
android:layout_height="match_parent"
android:orientation="vertical" >

<LinearLayout
android:id="@+id/viewSetting"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingTop="10dp" >

<TextView
android:layout_width="0dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="23dp"
android:background="@drawable/bg_setting"
android:orientation="vertical" >

<LinearLayout
android:id="@+id/viewGrade"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/setting_activity_grade" />

<TextView
android:layout_width="wrap_content"
android:orientation="horizontal"
android:padding="12dp" >

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/gold"
android:textSize="@dimen/LargeTextSize"
android:text="@string/setting_activity_grade" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/setting_activity_btnright"
android:textSize="20sp" />
</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="@drawable/home_line_bit" />

<LinearLayout
android:id="@+id/viewRecommend"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:text="@string/setting_activity_btnright"
android:textSize="20sp" />
</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="@drawable/home_line_bit" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingTop="10dp" >

<TextView
android:layout_width="0dp"
android:orientation="horizontal"
android:padding="12dp" >

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/gold"
android:textSize="@dimen/LargeTextSize"
android:text="@string/setting_activity_opinion" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:text="@string/setting_activity_btnright"
android:textSize="20sp" />
</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="@drawable/home_line_bit" />

<LinearLayout
android:id="@+id/viewVersion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/setting_activity_opinion" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:text="@string/setting_activity_btnright"
android:textSize="20sp" />
</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="@drawable/home_line_bit" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingTop="10dp" >

<TextView
android:layout_width="0dp"
android:orientation="horizontal"
android:padding="12dp" >

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/gold"
android:textSize="@dimen/LargeTextSize"
android:text="@string/setting_activity_version" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="5dp"
android:text="@string/setting_activity_ver" />
</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="@drawable/home_line_bit" />

<LinearLayout
android:id="@+id/viewAbout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/setting_activity_version" />

<TextView
android:layout_width="wrap_content"
android:orientation="horizontal"
android:padding="12dp" >

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/gold"
android:textSize="@dimen/LargeTextSize"
android:text="@string/setting_activity_about" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:text="@string/setting_activity_btnright"
android:textSize="20sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="@drawable/home_line_bit" />

<LinearLayout
android:id="@+id/viewChangePassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingRight="5dp"
android:text="@string/setting_activity_ver" />
android:orientation="horizontal"
android:padding="12dp" >

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/gold"
android:textSize="@dimen/LargeTextSize"
android:text="修改密码" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:text="@string/setting_activity_btnright"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="@drawable/home_line_bit" />

<LinearLayout
<Button
android:id="@+id/btnLogout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingTop="10dp" >

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/setting_activity_about" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:text="@string/setting_activity_btnright"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>

<Button
android:id="@+id/btnSetting_exit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/linearLayout1"
android:layout_alignParentBottom="true"
android:layout_alignRight="@+id/linearLayout1"
android:background="#FF0000"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:text="@string/setting_activity_exit"
android:textColor="#FFFFFF" />

</RelativeLayout>
android:layout_alignLeft="@+id/viewSetting"
android:layout_alignParentBottom="true"
android:layout_alignRight="@+id/viewSetting"
android:background="#FF0000"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:text="@string/setting_activity_exit"
android:textColor="#FFFFFF" />
</RelativeLayout>

</LinearLayout>
80 changes: 42 additions & 38 deletions baby/src/com/keju/baby/activity/SettingActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,51 +8,55 @@

import com.keju.baby.R;
import com.keju.baby.activity.base.BaseActivity;
import com.keju.baby.util.AndroidUtil;

/**
* 设置界面
*
* @author Zhoujun
* @version 创建时间:2013-10-25 下午3:06:51
*/
public class SettingActivity extends BaseActivity {
private long exitTime;
private Button btnLeft,btnRight;
private TextView tvTitle;
private long exitTime;
private Button btnLeft, btnRight;
private TextView tvTitle;

private View viewGrade, viewRecommend,viewVersion, viewAbout,viewChangePassword;

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.setting_activity);
findView();
fillData();

}
private void findView() {

btnLeft=(Button)findViewById(R.id.btnLeft);
btnRight=(Button)findViewById(R.id.btnRight);
tvTitle=(TextView)findViewById(R.id.tvTitle);
}
/**
* 数据填充
*/
private void fillData() {

btnLeft.setVisibility(View.GONE);
btnRight.setVisibility(View.GONE);
tvTitle.setText("设置");
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// TODO Auto-generated method stub
if(keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN){
if((System.currentTimeMillis()-exitTime) > 2000){
showLongToast("再按一次返回键退出");
exitTime = System.currentTimeMillis();
} else {
finish();
System.exit(0);
}
return true;
}
return super.onKeyDown(keyCode, event);
super.onCreate(savedInstanceState);
setContentView(R.layout.setting_activity);
findView();
fillData();
}

private void findView() {
btnLeft = (Button) findViewById(R.id.btnLeft);
btnRight = (Button) findViewById(R.id.btnRight);
tvTitle = (TextView) findViewById(R.id.tvTitle);
}

/**
* 数据填充
*/
private void fillData() {
btnLeft.setVisibility(View.GONE);
btnRight.setVisibility(View.GONE);
tvTitle.setText("设置");
}

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
if ((System.currentTimeMillis() - exitTime) > 2000) {
showLongToast("再按一次返回键退出");
exitTime = System.currentTimeMillis();
} else {
AndroidUtil.exitApp(this);
finish();
}
return true;
}
return super.onKeyDown(keyCode, event);
}
}
Loading

0 comments on commit 2363395

Please sign in to comment.