个人信息添加
This commit is contained in:
@@ -78,7 +78,6 @@ dependencies {
|
||||
//picker
|
||||
implementation 'com.contrarywind:Android-PickerView:4.1.6'
|
||||
|
||||
|
||||
//okhttp 网络通信库
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
|
||||
// json解析库
|
||||
|
||||
@@ -57,7 +57,8 @@
|
||||
<activity android:name=".modules.RecipeActivity.RecipeActivity" />
|
||||
<activity
|
||||
android:name=".LoginActivity"
|
||||
android:label="@string/title_activity_login"></activity>
|
||||
android:label="@string/title_activity_login" />
|
||||
<activity android:name=".modules.addinformation.AddInformationActivity"></activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -6,9 +6,18 @@ import android.os.Bundle;
|
||||
|
||||
import com.example.ninefourone.nutritionmaster.bean.MyUser;
|
||||
|
||||
import com.example.ninefourone.nutritionmaster.bean.Occupation;
|
||||
import com.example.ninefourone.nutritionmaster.utils.ConstantUtils;
|
||||
import com.example.ninefourone.nutritionmaster.utils.WebUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.orhanobut.logger.AndroidLogAdapter;
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.Response;
|
||||
|
||||
|
||||
/**
|
||||
@@ -70,6 +79,7 @@ public class NutritionMaster extends Application {
|
||||
|
||||
}
|
||||
});
|
||||
initOccupations();
|
||||
}
|
||||
|
||||
public static NutritionMaster getInstance() {
|
||||
@@ -94,6 +104,27 @@ public class NutritionMaster extends Application {
|
||||
user.setNickName("ScorpioMiku");
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化职业常量
|
||||
*/
|
||||
private void initOccupations() {
|
||||
|
||||
WebUtils.getAllOccupations(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
Occupation[] occupations = new Gson().fromJson(response.body().string(), Occupation[].class);
|
||||
for (int i = 0; i < occupations.length; i++) {
|
||||
ConstantUtils.occupationList.add(occupations[i].getOccupation_name());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -51,13 +51,13 @@ public class CardAdapter extends RecyclerView.Adapter<CardHolder> {
|
||||
* 右划
|
||||
*/
|
||||
public void swipe2Right() {
|
||||
Logger.d("右划");
|
||||
// Logger.d("右划");
|
||||
}
|
||||
|
||||
/**
|
||||
* 左划
|
||||
*/
|
||||
public void swipe2left() {
|
||||
Logger.d("左划");
|
||||
// Logger.d("左划");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
import com.example.ninefourone.nutritionmaster.NutritionMaster;
|
||||
import com.example.ninefourone.nutritionmaster.bean.MyUser;
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
@@ -91,4 +92,17 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
protected void upUser(MyUser user) {
|
||||
NutritionMaster.user = user;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
backChangeData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 填写完信息返回Activity调用
|
||||
*/
|
||||
protected void backChangeData() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.example.ninefourone.nutritionmaster.base;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
|
||||
import com.example.ninefourone.nutritionmaster.NutritionMaster;
|
||||
import com.example.ninefourone.nutritionmaster.bean.MyUser;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2018/10/1.
|
||||
*/
|
||||
|
||||
public abstract class BaseDialog extends AlertDialog.Builder {
|
||||
|
||||
protected AlertDialog dialog;
|
||||
|
||||
public BaseDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
protected void upUser(MyUser user) {
|
||||
NutritionMaster.user = user;
|
||||
}
|
||||
|
||||
public void showDialog() {
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -39,10 +39,19 @@ public class MyUser {
|
||||
private String occupation_name;
|
||||
private List<?> groups;
|
||||
private List<?> user_permissions;
|
||||
private int age;
|
||||
|
||||
private float weight = 0;
|
||||
private float height = 0;
|
||||
|
||||
public int getAge() {
|
||||
return age;
|
||||
}
|
||||
|
||||
public void setAge(int age) {
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public float getWeight() {
|
||||
return weight;
|
||||
}
|
||||
@@ -163,6 +172,14 @@ public class MyUser {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
if (sex.equals("男")) {
|
||||
this.sex = 1;
|
||||
} else {
|
||||
this.sex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public String getOccupation_name() {
|
||||
return occupation_name;
|
||||
}
|
||||
@@ -206,6 +223,10 @@ public class MyUser {
|
||||
", occupation_name='" + occupation_name + '\'' +
|
||||
", groups=" + groups +
|
||||
", user_permissions=" + user_permissions +
|
||||
", user_age=" + age +
|
||||
", user_sex=" + sex +
|
||||
", user_height=" + height +
|
||||
", user_weight=" + weight +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,9 @@ import com.example.ninefourone.nutritionmaster.base.BaseActivity;
|
||||
import com.example.ninefourone.nutritionmaster.bean.Occupation;
|
||||
import com.example.ninefourone.nutritionmaster.camera.FoodMaterialCamera;
|
||||
import com.example.ninefourone.nutritionmaster.modules.addinformation.AddActivity;
|
||||
import com.example.ninefourone.nutritionmaster.modules.addinformation.AddInformationActivity;
|
||||
import com.example.ninefourone.nutritionmaster.modules.information.InformationActivity;
|
||||
import com.example.ninefourone.nutritionmaster.ui.InformationDialog;
|
||||
import com.example.ninefourone.nutritionmaster.ui.NoScrollViewPager;
|
||||
import com.example.ninefourone.nutritionmaster.utils.ConstantUtils;
|
||||
import com.example.ninefourone.nutritionmaster.utils.MessageUtils;
|
||||
@@ -52,6 +55,7 @@ import com.mxn.soul.flowingdrawer_core.FlowingDrawer;
|
||||
import com.nightonke.boommenu.BoomButtons.HamButton;
|
||||
import com.nightonke.boommenu.BoomButtons.OnBMClickListener;
|
||||
import com.nightonke.boommenu.BoomMenuButton;
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -109,7 +113,6 @@ public class MainActivity extends BaseActivity {
|
||||
@BindView(R.id.show_information)
|
||||
LinearLayout showInformation;
|
||||
|
||||
private OptionsPickerView pickerView;
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
@@ -137,13 +140,12 @@ public class MainActivity extends BaseActivity {
|
||||
// Logger.i("openRatio=" + openRatio + " ,offsetPixels=" + offsetPixels);
|
||||
}
|
||||
});
|
||||
initInforView();
|
||||
initPicker();
|
||||
// initInforView();
|
||||
initSpiderView();
|
||||
initViewPager();
|
||||
initSearchView();
|
||||
initBMB();
|
||||
initOccupations();
|
||||
// initOccupations();
|
||||
|
||||
}
|
||||
|
||||
@@ -305,23 +307,6 @@ public class MainActivity extends BaseActivity {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化picker
|
||||
*/
|
||||
private void initPicker() {
|
||||
pickerView = new OptionsPickerBuilder(MainActivity.this, new OnOptionsSelectListener() {
|
||||
@Override
|
||||
public void onOptionsSelect(int options1, int options2, int options3, View v) {
|
||||
final int option = options1;
|
||||
userOccupationText.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
userOccupationText.setText(ConstantUtils.occupationList.get(option));
|
||||
}
|
||||
});
|
||||
}
|
||||
}).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化悬浮按钮
|
||||
@@ -349,6 +334,7 @@ public class MainActivity extends BaseActivity {
|
||||
* 初始化个人信息界面(UI)
|
||||
*/
|
||||
private void initInforView() {
|
||||
// Logger.d(NutritionMaster.user.toString());
|
||||
adderInfor.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);
|
||||
if (NutritionMaster.user.getHeight() != 0) {
|
||||
showInformation.setVisibility(View.VISIBLE);
|
||||
@@ -358,13 +344,6 @@ public class MainActivity extends BaseActivity {
|
||||
adderInfor.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
adderInfor.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -400,36 +379,25 @@ public class MainActivity extends BaseActivity {
|
||||
case R.id.information_layout:
|
||||
break;
|
||||
case R.id.user_occupation_text:
|
||||
pickerView.show();
|
||||
|
||||
break;
|
||||
case R.id.adder_infor:
|
||||
Intent i = new Intent(MainActivity.this, AddInformationActivity.class);
|
||||
startActivity(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化职业常量
|
||||
*/
|
||||
private void initOccupations() {
|
||||
if (userOccupationText.getText().equals("请选择您的职业")) {
|
||||
WebUtils.getAllOccupations(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
Occupation[] occupations = new Gson().fromJson(response.body().string(), Occupation[].class);
|
||||
for (int i = 0; i < occupations.length; i++) {
|
||||
// Logger.d(occupations[i].getOccupation_name());
|
||||
ConstantUtils.occupationList.add(occupations[i].getOccupation_name());
|
||||
}
|
||||
pickerView.setPicker(ConstantUtils.occupationList);
|
||||
}
|
||||
});
|
||||
@Override
|
||||
protected void backChangeData() {
|
||||
super.backChangeData();
|
||||
initInforView();
|
||||
if (NutritionMaster.user.getOccupation_name() == null) {
|
||||
|
||||
} else {
|
||||
userOccupationText.setText("职业: " + NutritionMaster.user.getOccupation_name());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
package com.example.ninefourone.nutritionmaster.modules.addinformation;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||
import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
|
||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||
import com.example.ninefourone.nutritionmaster.NutritionMaster;
|
||||
import com.example.ninefourone.nutritionmaster.R;
|
||||
import com.example.ninefourone.nutritionmaster.base.BaseActivity;
|
||||
import com.example.ninefourone.nutritionmaster.bean.MyUser;
|
||||
import com.example.ninefourone.nutritionmaster.modules.MainActivity;
|
||||
import com.example.ninefourone.nutritionmaster.utils.ConstantUtils;
|
||||
import com.example.ninefourone.nutritionmaster.utils.MessageUtils;
|
||||
|
||||
public class AddInformationActivity extends BaseActivity {
|
||||
private TextView ageTextView;
|
||||
private TextView heightTextView;
|
||||
private TextView weightTextView;
|
||||
private TextView sexTextView;
|
||||
private TextView occupationTextView;
|
||||
|
||||
private ImageView ageImageView;
|
||||
private ImageView sexImageView;
|
||||
private ImageView heightImageView;
|
||||
private ImageView weightImageView;
|
||||
private ImageView occupationImageView;
|
||||
|
||||
private Button okButton;
|
||||
|
||||
private OptionsPickerView agePicker;
|
||||
private OptionsPickerView weightPicker;
|
||||
private OptionsPickerView heightPicker;
|
||||
private OptionsPickerView sexPicker;
|
||||
private OptionsPickerView occupationPicker;
|
||||
|
||||
private Context context;
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.add_information_activity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initViews(Bundle savedInstanceState) {
|
||||
|
||||
context = this;
|
||||
ageImageView = findViewById(R.id.age_image_view);
|
||||
sexImageView = findViewById(R.id.sex_image_view);
|
||||
heightImageView = findViewById(R.id.height_image_view);
|
||||
weightImageView = findViewById(R.id.weight_image_view);
|
||||
occupationImageView = findViewById(R.id.occupation_image_view);
|
||||
|
||||
|
||||
ageTextView = findViewById(R.id.age_text_view);
|
||||
sexTextView = findViewById(R.id.sex_text_view);
|
||||
weightTextView = findViewById(R.id.weight_text_view);
|
||||
heightTextView = findViewById(R.id.height_text_view);
|
||||
occupationTextView = findViewById(R.id.occupation_text_view);
|
||||
|
||||
okButton = findViewById(R.id.ok_button);
|
||||
|
||||
occupationPicker = new OptionsPickerBuilder(context, new OnOptionsSelectListener() {
|
||||
@Override
|
||||
public void onOptionsSelect(int options1, int options2, int options3, View v) {
|
||||
occupationTextView.setText(ConstantUtils.occupationList.get(options1));
|
||||
}
|
||||
}).build();
|
||||
occupationPicker.setPicker(ConstantUtils.occupationList);
|
||||
|
||||
agePicker = new OptionsPickerBuilder(context, new OnOptionsSelectListener() {
|
||||
@Override
|
||||
public void onOptionsSelect(int options1, int options2, int options3, View v) {
|
||||
ageTextView.setText(ConstantUtils.ageList.get(options1));
|
||||
}
|
||||
}).build();
|
||||
agePicker.setPicker(ConstantUtils.ageList);
|
||||
agePicker.setSelectOptions(25);
|
||||
|
||||
|
||||
sexPicker = new OptionsPickerBuilder(context, new OnOptionsSelectListener() {
|
||||
@Override
|
||||
public void onOptionsSelect(int options1, int options2, int options3, View v) {
|
||||
sexTextView.setText(ConstantUtils.sexList.get(options1));
|
||||
}
|
||||
}).build();
|
||||
sexPicker.setPicker(ConstantUtils.sexList);
|
||||
|
||||
|
||||
heightPicker = new OptionsPickerBuilder(context, new OnOptionsSelectListener() {
|
||||
@Override
|
||||
public void onOptionsSelect(int options1, int options2, int options3, View v) {
|
||||
heightTextView.setText(ConstantUtils.heightList.get(options1));
|
||||
}
|
||||
}).build();
|
||||
heightPicker.setPicker(ConstantUtils.heightList);
|
||||
heightPicker.setSelectOptions(119);
|
||||
|
||||
weightPicker = new OptionsPickerBuilder(context, new OnOptionsSelectListener() {
|
||||
@Override
|
||||
public void onOptionsSelect(int options1, int options2, int options3, View v) {
|
||||
weightTextView.setText(ConstantUtils.weightList.get(options1));
|
||||
}
|
||||
}).build();
|
||||
weightPicker.setPicker(ConstantUtils.weightList);
|
||||
weightPicker.setSelectOptions(59);
|
||||
|
||||
|
||||
occupationImageView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
occupationPicker.show();
|
||||
}
|
||||
});
|
||||
|
||||
ageImageView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
agePicker.show();
|
||||
}
|
||||
});
|
||||
sexImageView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
sexPicker.show();
|
||||
}
|
||||
});
|
||||
heightImageView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
heightPicker.show();
|
||||
}
|
||||
});
|
||||
weightImageView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
weightPicker.show();
|
||||
}
|
||||
});
|
||||
|
||||
okButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
MyUser user = NutritionMaster.user;
|
||||
if (ageTextView.getText().toString().equals("年龄") || weightTextView.getText().toString().equals("体重")
|
||||
|| sexTextView.getText().toString().equals("性别") || heightTextView.getText().toString().equals("身高")||
|
||||
occupationTextView.getText().toString().equals("职业")) {
|
||||
MessageUtils.MakeToast("请点击图片填写所有信息");
|
||||
} else {
|
||||
user.setHeight(Integer.valueOf(heightTextView.getText().toString().split("c")[0]));
|
||||
user.setWeight(Integer.valueOf(weightTextView.getText().toString().split("k")[0]));
|
||||
user.setAge(Integer.valueOf(ageTextView.getText().toString().split("岁")[0]));
|
||||
user.setSex(sexTextView.getText().toString());
|
||||
user.setOccupation_name(occupationTextView.getText().toString());
|
||||
// Logger.d(user.toString());
|
||||
upUser(user);
|
||||
MessageUtils.MakeToast("信息填写成功");
|
||||
finish();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initToolBar() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPointerCaptureChanged(boolean hasCapture) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.example.ninefourone.nutritionmaster.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
|
||||
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||
import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
|
||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||
import com.example.ninefourone.nutritionmaster.R;
|
||||
import com.example.ninefourone.nutritionmaster.base.BaseDialog;
|
||||
import com.example.ninefourone.nutritionmaster.utils.ConstantUtils;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2018/10/1.
|
||||
*/
|
||||
|
||||
public class InformationDialog extends BaseDialog {
|
||||
|
||||
|
||||
private TextView ageTextView;
|
||||
private TextView heightTextView;
|
||||
private TextView weightTextView;
|
||||
private TextView sexTextView;
|
||||
|
||||
private ImageView ageImageView;
|
||||
private ImageView sexImageView;
|
||||
private ImageView heightImageView;
|
||||
private ImageView weightImageView;
|
||||
|
||||
private Button okButton;
|
||||
|
||||
private OptionsPickerView agePicker;
|
||||
private OptionsPickerView weightPicker;
|
||||
private OptionsPickerView heightPicker;
|
||||
private OptionsPickerView sexPicker;
|
||||
|
||||
|
||||
public InformationDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
dialog = create();
|
||||
|
||||
|
||||
View view = View.inflate(context, R.layout.add_information_activity, null);
|
||||
dialog.setView(view);
|
||||
|
||||
ageImageView = view.findViewById(R.id.age_image_view);
|
||||
sexImageView = view.findViewById(R.id.sex_image_view);
|
||||
heightImageView = view.findViewById(R.id.height_image_view);
|
||||
weightImageView = view.findViewById(R.id.weight_image_view);
|
||||
|
||||
|
||||
ageTextView = view.findViewById(R.id.age_text_view);
|
||||
sexTextView = view.findViewById(R.id.sex_text_view);
|
||||
weightTextView = view.findViewById(R.id.weight_text_view);
|
||||
heightTextView = view.findViewById(R.id.height_text_view);
|
||||
|
||||
okButton = view.findViewById(R.id.ok_button);
|
||||
|
||||
agePicker = new OptionsPickerBuilder(context, new OnOptionsSelectListener() {
|
||||
@Override
|
||||
public void onOptionsSelect(int options1, int options2, int options3, View v) {
|
||||
ageTextView.setText(ConstantUtils.ageList.get(options1));
|
||||
}
|
||||
}).build();
|
||||
agePicker.setPicker(ConstantUtils.ageList);
|
||||
|
||||
|
||||
sexPicker = new OptionsPickerBuilder(context, new OnOptionsSelectListener() {
|
||||
@Override
|
||||
public void onOptionsSelect(int options1, int options2, int options3, View v) {
|
||||
sexTextView.setText(ConstantUtils.ageList.get(options1));
|
||||
}
|
||||
}).build();
|
||||
sexPicker.setPicker(ConstantUtils.sexList);
|
||||
|
||||
|
||||
heightPicker = new OptionsPickerBuilder(context, new OnOptionsSelectListener() {
|
||||
@Override
|
||||
public void onOptionsSelect(int options1, int options2, int options3, View v) {
|
||||
heightTextView.setText(ConstantUtils.ageList.get(options1));
|
||||
}
|
||||
}).build();
|
||||
heightPicker.setPicker(ConstantUtils.heightList);
|
||||
|
||||
|
||||
weightPicker = new OptionsPickerBuilder(context, new OnOptionsSelectListener() {
|
||||
@Override
|
||||
public void onOptionsSelect(int options1, int options2, int options3, View v) {
|
||||
weightTextView.setText(ConstantUtils.ageList.get(options1));
|
||||
}
|
||||
}).build();
|
||||
weightPicker.setPicker(ConstantUtils.weightList);
|
||||
|
||||
|
||||
ageImageView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
agePicker.show();
|
||||
}
|
||||
});
|
||||
sexImageView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
sexPicker.show();
|
||||
}
|
||||
});
|
||||
heightImageView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
heightPicker.show();
|
||||
}
|
||||
});
|
||||
weightImageView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
weightPicker.show();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -54,4 +54,26 @@ public class ConstantUtils {
|
||||
|
||||
public static ArrayList<String> occupationList = new ArrayList<>();
|
||||
|
||||
public static ArrayList<String> ageList = new ArrayList<>();
|
||||
|
||||
public static ArrayList<String> sexList = new ArrayList<>();
|
||||
|
||||
public static ArrayList<String> heightList = new ArrayList<>();
|
||||
|
||||
public static ArrayList<String> weightList = new ArrayList<>();
|
||||
|
||||
static {
|
||||
for (int i = 1; i <= 200; i++) {
|
||||
if (i < 100) {
|
||||
ageList.add(i + "岁");
|
||||
}
|
||||
heightList.add(i + 50 + "cm");
|
||||
if (i < 150) {
|
||||
weightList.add(i + "kg");
|
||||
}
|
||||
}
|
||||
sexList.add("男");
|
||||
sexList.add("女");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
11
app/src/main/res/drawable/ic_dialog_age.xml
Normal file
11
app/src/main/res/drawable/ic_dialog_age.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector android:height="24dp" android:viewportHeight="1024.0"
|
||||
android:viewportWidth="1024.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF6C6D" android:pathData="M512,1024Q-0,1024 0,512 0,0 512,0t512,512Q1024,1024 512,1024z"/>
|
||||
<path android:fillColor="#FFCA27" android:pathData="M699.9,461.1a77.9,77.9 0,0 0,-19.9 -30.4,93.9 93.9,0 0,0 -34.2,-20.4 109.4,109.4 0,0 0,-47.9 -4.5,137.9 137.9,0 0,0 -37.8,9.2 209.6,209.6 0,0 0,-37 18.7,204.5 204.5,0 0,0 -32.2,25.4 133.3,133.3 0,0 0,-23.5 29.9,218.8 218.8,0 0,0 -21,-33.5 297,297 0,0 0,-27.4 -31.6,242.3 242.3,0 0,0 -30.8,-26.2 213.9,213.9 0,0 0,-30 -18.2,133.4 133.4,0 0,0 -57.9,-11.2 81.6,81.6 0,0 0,-26.6 5,63.2 63.2,0 0,0 -21.3,12.8 123.3,123.3 0,0 0,-17.6 22.4,74.7 74.7,0 0,0 -10.1,26.2 65.8,65.8 0,0 0,1.4 28.5c2.5,9.8 24.4,88.8 153.4,121.8a97.7,97.7 0,0 0,46.5 0.6q-8,35.5 -12.9,71.5a609,609 0,0 0,-5.6 83.2c0,22.6 -0.3,41.9 -0.6,57.5s-0.8,28.2 -1.1,38q-1.1,13.9 -1.7,27.9h65.5q-1.7,-17.9 -2.8,-35.8c-0.8,-10.9 -1.4,-22.6 -2,-35.7q-0.8,-19.6 -0.8,-39.1a653.6,653.6 0,0 1,5 -81.8q4.6,-37 12.3,-73.4c159.6,18.2 204.4,-59.8 210.8,-70.1a78.8,78.8 0,0 0,11.8 -32.4,73 73,0 0,0 -4.2,-34.4z"/>
|
||||
<path android:fillColor="#FFCA27" android:pathData="M768.1,692a33,33 0,0 0,-8.4 -13,40.4 40.4,0 0,0 -14.5,-8.7 45.9,45.9 0,0 0,-20.3 -1.9,59.3 59.3,0 0,0 -16,3.9 88.7,88.7 0,0 0,-15.7 8,84.5 84.5,0 0,0 -13.7,10.8 56.9,56.9 0,0 0,-10 12.7,94.8 94.8,0 0,0 -8.9,-14.3 129.4,129.4 0,0 0,-11.6 -13.5,103.7 103.7,0 0,0 -13.1,-11.2 89.9,89.9 0,0 0,-12.7 -7.8,55.6 55.6,0 0,0 -12.2,-3.8 53.3,53.3 0,0 0,-12.3 -1,34 34,0 0,0 -11.3,2.2 25.8,25.8 0,0 0,-9 5.5,53.2 53.2,0 0,0 -7.5,9.5 31.8,31.8 0,0 0,-4.3 11.2,28.1 28.1,0 0,0 0.6,12.1c1.1,4.2 10.3,37.9 65.1,51.9a40.1,40.1 0,0 0,19.7 0.2q-3.4,15.2 -5.5,30.5a261,261 0,0 0,-2.4 35.5c0,9.6 -0.1,17.8 -0.2,24.5s-0.4,12 -0.5,16.2c-0.3,4 -0.5,7.9 -0.7,11.9h27.8q-0.7,-7.6 -1.2,-15.2c-0.4,-4.7 -0.6,-9.6 -0.8,-15.2s-0.4,-11.1 -0.4,-16.7a279.7,279.7 0,0 1,2.1 -34.9q2,-15.8 5.2,-31.4c67.7,7.8 86.7,-25.5 89.4,-29.9a33.6,33.6 0,0 0,5 -13.8,31.2 31.2,0 0,0 -1.8,-14.6z"/>
|
||||
<path android:fillColor="#FFFFFF" android:pathData="M362.2,180.6a51,51 0,0 0,102 0,48.1 48.1,0 0,0 -14.3,-34.2s-29.7,-28.8 -35.4,-62.3h-2.8c-5.7,33.5 -35.1,61.9 -35.1,61.9a49,49 0,0 0,-14.3 34.6z"/>
|
||||
<path android:fillColor="#FFFFFF" android:pathData="M843.1,547.6a32.8,32.8 0,0 0,65.6 0,31.5 31.5,0 0,0 -9.2,-22.2s-19.1,-18.7 -22.8,-40.5h-1.8c-3.7,21.8 -22.6,40.2 -22.6,40.2a32.1,32.1 0,0 0,-9.2 22.5z"/>
|
||||
<path android:fillColor="#FFFFFF" android:pathData="M92.7,455.2a36.4,36.4 0,1 0,62.6 -25.6s-21.2,-21.6 -25.3,-46.7h-2c-4.1,25.2 -25.1,46.4 -25.1,46.4a37.6,37.6 0,0 0,-10.2 25.9z"/>
|
||||
<path android:fillColor="#FFFFFF" android:pathData="M245.7,727.3a25.6,25.6 0,1 0,51 0,27.9 27.9,0 0,0 -7.2,-18.8s-14.9,-15.8 -17.7,-34.2H270.4c-2.9,18.4 -17.6,34 -17.6,34a28.4,28.4 0,0 0,-7.2 19z"/>
|
||||
<path android:fillColor="#FFFFFF" android:pathData="M697.4,363.1a25.5,25.5 0,1 0,51 0,27.8 27.8,0 0,0 -7.2,-18.8s-14.9,-15.8 -17.7,-34.2h-1.4c-2.9,18.4 -17.5,34 -17.5,34a28.3,28.3 0,0 0,-7.2 19z"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ic_dialog_sex.xml
Normal file
9
app/src/main/res/drawable/ic_dialog_sex.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<vector android:height="24dp" android:viewportHeight="1024.0"
|
||||
android:viewportWidth="1024.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#CFEB70" android:pathData="M419.5,245.1m-218.1,0a218.1,218.1 0,1 0,436.2 0,218.1 218.1,0 1,0 -436.2,0Z"/>
|
||||
<path android:fillColor="#313030" android:pathData="M541.5,232.7c-1.8,0 -3.6,-0.2 -5.3,-0.5a28.3,28.3 0,0 1,-5.1 -1.5,27.5 27.5,0 0,1 -4.7,-2.5 25.9,25.9 0,0 1,-4.1 -3.4,27.7 27.7,0 0,1 -3.4,-4.1 26.8,26.8 0,0 1,-2.5 -4.7,27.5 27.5,0 0,1 -1.6,-5.1 28.9,28.9 0,0 1,-0.5 -5.3c0,-1.8 0.2,-3.6 0.5,-5.3a28.4,28.4 0,0 1,4 -9.8,27.7 27.7,0 0,1 3.4,-4.1 27.7,27.7 0,0 1,4.1 -3.4,27.6 27.6,0 0,1 4.7,-2.5c1.7,-0.7 3.4,-1.2 5.1,-1.6a27.8,27.8 0,0 1,10.6 0c1.7,0.4 3.4,0.9 5.1,1.6a26.6,26.6 0,0 1,4.7 2.5,27.7 27.7,0 0,1 4.1,3.4 25.9,25.9 0,0 1,3.4 4.1c1,1.5 1.8,3 2.5,4.7 0.7,1.7 1.2,3.4 1.5,5.1 0.4,1.7 0.5,3.5 0.5,5.3 0,1.8 -0.2,3.6 -0.5,5.3a27.4,27.4 0,0 1,-1.5 5.1c-0.7,1.7 -1.5,3.2 -2.5,4.7a25.9,25.9 0,0 1,-3.4 4.1,25.9 25.9,0 0,1 -4.1,3.4c-1.5,1 -3,1.8 -4.7,2.5a27.4,27.4 0,0 1,-5.1 1.5c-1.7,0.4 -3.5,0.5 -5.3,0.5zM328.7,181.5a27,27 0,0 1,-19.2 -7.9c-10.6,-10.6 -10.6,-27.8 0,-38.4 54.6,-54.6 142.2,-60.7 203.7,-14 11.9,9 14.3,26.1 5.2,38 -9,11.9 -26.1,14.3 -38,5.2 -40,-30.3 -97,-26.4 -132.6,9.2a27,27 0,0 1,-19.2 7.9z"/>
|
||||
<path android:fillColor="#313030" android:pathData="M592.9,71.7c-95.6,-95.6 -251.2,-95.6 -346.8,0 -89.1,89.1 -95.1,230.3 -18.1,326.5l-112.8,112.8L115.2,474.5c0,-15 -12.1,-27.1 -27.1,-27.1s-27.1,12.1 -27.1,27.1v102c0,15 12.1,27.1 27.1,27.1h102c15,0 27.1,-12.1 27.1,-27.1s-12.1,-27.1 -27.1,-27.1L153.5,549.4l112.8,-112.8c43.3,34.8 96.8,53.7 153.1,53.7 65.5,0 127.1,-25.5 173.4,-71.8 46.3,-46.3 71.8,-107.9 71.8,-173.4s-25.5,-127.1 -71.8,-173.4zM554.5,380.1c-0,0 -0,0 0,0 -36.1,36.1 -84,55.9 -135,55.9s-99,-19.9 -135,-55.9c-74.5,-74.5 -74.5,-195.6 0,-270 37.2,-37.2 86.1,-55.8 135,-55.8 48.9,0 97.8,18.6 135,55.8 36.1,36.1 55.9,84 55.9,135s-19.9,99 -55.9,135z"/>
|
||||
<path android:fillColor="#FF5E8A" android:pathData="M599.4,778.9m-218.1,0a218.1,218.1 0,1 0,436.2 0,218.1 218.1,0 1,0 -436.2,0Z"/>
|
||||
<path android:fillColor="#313030" android:pathData="M477.4,845.5c-1.8,0 -3.6,-0.2 -5.3,-0.5a28.8,28.8 0,0 1,-5.1 -1.6,27.2 27.2,0 0,1 -4.7,-2.5 27.7,27.7 0,0 1,-4.1 -3.4,27.7 27.7,0 0,1 -3.4,-4.1 27.6,27.6 0,0 1,-2.5 -4.7,28.7 28.7,0 0,1 -1.5,-5.1 27.2,27.2 0,0 1,-0.5 -5.3c0,-1.8 0.2,-3.6 0.5,-5.3a27.4,27.4 0,0 1,1.5 -5.1c0.7,-1.7 1.5,-3.2 2.5,-4.7a27.7,27.7 0,0 1,3.4 -4.1,25.9 25.9,0 0,1 4.1,-3.4 27.6,27.6 0,0 1,4.7 -2.5,28.7 28.7,0 0,1 5.1,-1.5 26.8,26.8 0,0 1,10.6 0,27.4 27.4,0 0,1 5.1,1.5c1.7,0.7 3.2,1.5 4.7,2.5a25.9,25.9 0,0 1,4.1 3.4,25.9 25.9,0 0,1 3.4,4.1c1,1.5 1.8,3 2.5,4.7 0.7,1.6 1.2,3.3 1.5,5.1 0.4,1.7 0.5,3.5 0.5,5.3 0,1.8 -0.2,3.6 -0.5,5.3a28.7,28.7 0,0 1,-1.5 5.1c-0.7,1.6 -1.5,3.2 -2.5,4.7a25.9,25.9 0,0 1,-3.4 4.1,27.7 27.7,0 0,1 -4.1,3.4c-1.5,1 -3,1.8 -4.7,2.5 -1.6,0.7 -3.3,1.2 -5.1,1.6 -1.7,0.4 -3.5,0.5 -5.3,0.5zM599.2,934.2c-32.9,0 -65.9,-10.3 -93.6,-31.3 -11.9,-9 -14.3,-26.1 -5.2,-38 9,-11.9 26.1,-14.3 38,-5.2 40,30.3 97,26.4 132.6,-9.2 10.6,-10.6 27.8,-10.6 38.4,0 10.6,10.6 10.6,27.8 0,38.4 -30,30 -70,45.4 -110.1,45.4z"/>
|
||||
<path android:fillColor="#313030" android:pathData="M955.1,535.4l-36.9,-36.9 31.2,-31.2c10.6,-10.6 10.6,-27.8 0,-38.4 -10.6,-10.6 -27.8,-10.6 -38.4,0l-31.2,31.2 -36.9,-36.9c-10.6,-10.6 -27.8,-10.6 -38.4,0 -10.6,10.6 -10.6,27.8 0,38.4l36.9,36.9 -88.9,88.9c-43.3,-34.8 -96.8,-53.7 -153.1,-53.7 -65.5,0 -127.1,25.5 -173.4,71.8 -95.6,95.6 -95.6,251.2 0,346.8C473.8,1000.1 536.6,1024 599.4,1024s125.6,-23.9 173.4,-71.7c46.3,-46.3 71.8,-107.9 71.8,-173.4 0,-56.4 -18.9,-109.8 -53.7,-153.1l88.9,-88.9 36.9,36.9c5.3,5.3 12.2,7.9 19.2,7.9s13.9,-2.6 19.2,-7.9c10.6,-10.6 10.6,-27.8 0,-38.4zM734.4,913.9c-74.5,74.5 -195.6,74.5 -270,0s-74.5,-195.6 0,-270c36.1,-36.1 84,-55.9 135,-55.9 51,0 98.9,19.9 135,55.9l0,0 0,0c36.1,36.1 55.9,84 55.9,135 0,51 -19.9,99 -55.9,135z"/>
|
||||
</vector>
|
||||
11
app/src/main/res/drawable/ic_occupation.xml
Normal file
11
app/src/main/res/drawable/ic_occupation.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector android:height="24dp" android:viewportHeight="1024.0"
|
||||
android:viewportWidth="1024.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#EC7BB0" android:pathData="M571.2,257.6l20,-108.8H432.8l20,108.8 -89.6,581.6L512,992l148.8,-152.8z"/>
|
||||
<path android:fillColor="#0D1014" android:pathData="M591.2,148.8H432.8l20,108.8h118.4z"/>
|
||||
<path android:fillColor="#6A576D" android:pathData="M512,1000c-2.4,0 -4,-0.8 -5.6,-2.4l-148.8,-152.8c-1.6,-1.6 -2.4,-4 -2.4,-7.2l89.6,-580.8 -20,-107.2c-0.8,-2.4 0,-4.8 1.6,-6.4s4,-3.2 6.4,-3.2L592,140c2.4,0 4.8,0.8 6.4,3.2s2.4,4 1.6,6.4l-20,107.2 89.6,580.8c0,2.4 -0.8,4.8 -2.4,7.2l-148.8,152.8c-2.4,1.6 -4,2.4 -6.4,2.4zM372,836.8l140,144 140,-144 -88.8,-578.4L563.2,256l18.4,-99.2L442.4,156.8L460.8,256v2.4l-88.8,578.4z"/>
|
||||
<path android:fillColor="#6A576D" android:pathData="M571.2,265.6L452.8,265.6c-4,0 -7.2,-2.4 -8,-6.4L424,150.4c-0.8,-2.4 0,-4.8 1.6,-6.4s4,-3.2 6.4,-3.2h159.2c2.4,0 4.8,0.8 6.4,3.2s2.4,4 1.6,6.4l-20.8,108.8c0,3.2 -3.2,6.4 -7.2,6.4zM459.2,249.6h104.8l17.6,-92.8L442.4,156.8l16.8,92.8z"/>
|
||||
<path android:fillColor="#FFFFFF" android:pathData="M710.4,32L512,148.8l81.6,153.6L728,108.8z"/>
|
||||
<path android:fillColor="#6A576D" android:pathData="M593.6,310.4c-3.2,0 -5.6,-1.6 -7.2,-4L504.8,152c-2.4,-4 -0.8,-8.8 3.2,-10.4L706.4,24.8c2.4,-0.8 4.8,-0.8 7.2,0 2.4,0.8 4,3.2 4.8,5.6l17.6,76.8c0.8,2.4 0,4.8 -1.6,6.4L600,307.2c-0.8,1.6 -3.2,3.2 -6.4,3.2zM522.4,151.2l72,135.2 124.8,-180 -14.4,-62.4 -182.4,107.2z"/>
|
||||
<path android:fillColor="#FFFFFF" android:pathData="M313.6,32L512,148.8 430.4,302.4 296,108.8z"/>
|
||||
<path android:fillColor="#6A576D" android:pathData="M430.4,310.4c-2.4,0 -4.8,-1.6 -6.4,-3.2L289.6,113.6c-1.6,-1.6 -1.6,-4 -1.6,-6.4l17.6,-76.8c0.8,-2.4 2.4,-4.8 4.8,-5.6 2.4,-0.8 4.8,-0.8 7.2,0l198.4,116.8c4,2.4 4.8,7.2 3.2,10.4L437.6,306.4c-1.6,2.4 -4,4 -7.2,4zM304.8,107.2l124.8,180 72,-135.2L319.2,44.8l-14.4,62.4z"/>
|
||||
</vector>
|
||||
9
app/src/main/res/layout/activity_add_information.xml
Normal file
9
app/src/main/res/layout/activity_add_information.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.example.ninefourone.nutritionmaster.modules.addinformation.AddInformationActivity">
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
@@ -167,7 +167,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:gravity="center"
|
||||
android:text="请选择您的职业"
|
||||
android:text="请完善信息"
|
||||
android:textColor="#FFF" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
136
app/src/main/res/layout/add_information_activity.xml
Normal file
136
app/src/main/res/layout/add_information_activity.xml
Normal file
@@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="500dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="#faecec"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/occupation_image_view"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:src="@drawable/ic_occupation" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/occupation_text_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="职业"
|
||||
android:textSize="15sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/age_image_view"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:src="@drawable/ic_dialog_age" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="2dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sex_image_view"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:src="@drawable/ic_dialog_sex" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/age_text_view"
|
||||
android:layout_width="125dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="年龄"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sex_text_view"
|
||||
android:layout_width="125dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="性别"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="30dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="65dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/height_image_view"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:src="@drawable/ic_dialog_height" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="2dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/weight_image_view"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:src="@drawable/ic_dialog_weight" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/height_text_view"
|
||||
android:layout_width="125dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="身高"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/weight_text_view"
|
||||
android:layout_width="125dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="体重"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/ok_button"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:background="#efe7e7"
|
||||
android:text="确定" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,46 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="125dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="125dp"
|
||||
android:layout_height="125dp"
|
||||
android:src="ic_dialog_height" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="125dp"
|
||||
android:layout_height="125dp"
|
||||
android:src="ic_dialog_weight" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="125dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="身高"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="125dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="体重"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user