设置页面修改
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
package com.ydd.sportfaceid.config;
|
||||
|
||||
import android.content.Context;
|
||||
import com.ydd.sportfaceid.netty.message.DeviceType;
|
||||
|
||||
public class SDAppConfig {
|
||||
|
||||
public static SDAppConfig config = null;
|
||||
private Context mContext;
|
||||
/**
|
||||
* 场馆ID
|
||||
*/
|
||||
private Integer venueId;
|
||||
private DeviceType deviceType;
|
||||
|
||||
public static SDAppConfig getInstance(){
|
||||
synchronized (SDAppConfig.class){
|
||||
@@ -23,4 +29,19 @@ public class SDAppConfig {
|
||||
}
|
||||
}
|
||||
|
||||
public Integer getVenueId() {
|
||||
return venueId;
|
||||
}
|
||||
|
||||
public void setVenueId(Integer venueId) {
|
||||
this.venueId = venueId;
|
||||
}
|
||||
|
||||
public DeviceType getDeviceType() {
|
||||
return deviceType;
|
||||
}
|
||||
|
||||
public void setDeviceType(DeviceType deviceType) {
|
||||
this.deviceType = deviceType;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,71 +3,56 @@ package com.ydd.sportfaceid.setting;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import android.widget.TextView;
|
||||
import com.ydd.sportfaceid.R;
|
||||
import com.ydd.sportfaceid.config.SDAppConfig;
|
||||
import com.ydd.sportfaceid.main.SDBaseActivity;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.OnClick;
|
||||
import com.ydd.sportfaceid.netty.message.DeviceType;
|
||||
|
||||
public class SDSettingActivity extends SDBaseActivity {
|
||||
|
||||
|
||||
// @BindView(R.id.camer_check_1)
|
||||
// ImageView camer_check_1_image_view;
|
||||
@BindView(R.id.venue_cell)
|
||||
TextView venue_cell;
|
||||
|
||||
// @BindView(R.id.camer_check_2)
|
||||
// ImageView camer_check_2_image_view;
|
||||
@BindView(R.id.device_type_cell)
|
||||
TextView device_type_cell;
|
||||
|
||||
|
||||
private int selectedCameraIndex;
|
||||
private Integer venueId;
|
||||
/**
|
||||
* 设备类型 ENTER / OUT
|
||||
*/
|
||||
private String deviceType;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_sdsetting);
|
||||
|
||||
this.configView();
|
||||
this.configData();
|
||||
}
|
||||
|
||||
|
||||
private void configView(){
|
||||
// this.camer_check_1_image_view.setVisibility(View.GONE);
|
||||
// this.camer_check_2_image_view.setVisibility(View.GONE);
|
||||
private void setConfig(){
|
||||
Integer venueId = Integer.parseInt(venue_cell.getText().toString());
|
||||
DeviceType deviceType = DeviceType.valueOf(device_type_cell.getText().toString());
|
||||
SDAppConfig.getInstance().setVenueId(venueId);
|
||||
SDAppConfig.getInstance().setDeviceType(deviceType);
|
||||
}
|
||||
private void configData(){
|
||||
this.setSelectedCameraIndex(SDAppConfig.getInstance().getCurrent_selected_camera());
|
||||
}
|
||||
public void setSelectedCameraIndex(int selectedCameraIndex) {
|
||||
this.selectedCameraIndex = selectedCameraIndex;
|
||||
if (this.selectedCameraIndex == 0 ){
|
||||
// this.camer_check_2_image_view.setVisibility(View.GONE);
|
||||
// this.camer_check_1_image_view.setVisibility(View.VISIBLE);
|
||||
}else if (this.selectedCameraIndex == 1){
|
||||
// this.camer_check_2_image_view.setVisibility(View.VISIBLE);
|
||||
// this.camer_check_1_image_view.setVisibility(View.GONE);
|
||||
}
|
||||
SDAppConfig.getInstance().setCurrent_selected_camera(selectedCameraIndex);
|
||||
}
|
||||
|
||||
|
||||
public void onGoToMainAction(){
|
||||
finish();
|
||||
}
|
||||
|
||||
@OnClick({R.id.back_button,R.id.camer_cell_1, R.id.camer_cell_2}) void onCilck(View view){
|
||||
@OnClick({R.id.back_button,R.id.confirm_button}) void onCilck(View view){
|
||||
switch (view.getId()){
|
||||
case R.id.back_button:
|
||||
this.onGoToMainAction();
|
||||
break;
|
||||
case R.id.camer_cell_1:
|
||||
this.setSelectedCameraIndex(0);
|
||||
break;
|
||||
case R.id.camer_cell_2:
|
||||
this.setSelectedCameraIndex(1);
|
||||
break;
|
||||
case R.id.confirm_button:
|
||||
setConfig();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/camera_stting_type_title"
|
||||
android:text="@string/camera_setting_type_title"
|
||||
android:layout_centerVertical="true"/>
|
||||
</RelativeLayout>
|
||||
<RelativeLayout
|
||||
@@ -49,7 +49,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<LinearLayout
|
||||
android:id="@+id/camer_cell_1"
|
||||
android:id="@+id/venue_cell"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:paddingLeft="10dp"
|
||||
@@ -74,7 +74,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<LinearLayout
|
||||
android:id="@+id/camer_cell_2"
|
||||
android:id="@+id/device_type_cell"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:paddingLeft="10dp"
|
||||
@@ -92,6 +92,10 @@
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
<Button
|
||||
android:text="确定变更"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" android:id="@+id/confirm_button"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@@ -3,7 +3,7 @@
|
||||
<string name="top_line_info1">预订信息如下</string>
|
||||
<string name="well_string1">新用户注册</string>
|
||||
<string name="setting">设置</string>
|
||||
<string name="camera_stting_type_title">请选择场馆,以及门禁类型</string>
|
||||
<string name="camera_setting_type_title">请选择场馆,以及门禁类型</string>
|
||||
<string name="stranger_info_string">您好 \n 您尚未注册成为本智能运动场用户 \n请扫描门禁上张贴的场馆二维码进行注册后再试</string>
|
||||
<string name="stranger_info_detail_string">如遇注册用户无法识别请联系场馆管理人员</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user