团队冲刺二(2)

5月26日

朴远东:学习线程,尝试解决文本文件获取板块的显示问题。尝试了多个方法未能成功,在编写上出现了一些调用错误,正在排查。

张宏伟:换了下拉框模式,放弃了implements接口,重写了方法

package com.itheima.cloudnotes.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;

import androidx.appcompat.app.AppCompatActivity;

import com.itheima.cloudnotes.R;

public class SpinnerActivity extends AppCompatActivity
{
private EditText edit_advice_txt;
private Button btn_advice_submit;
private String advice_txt;
private Spinner mProSpinner;
private ArrayAdapter<String>mProAdapter;
private String[]mStringArray;
@Override
protected void onCreate (Bundle savedInstanceStats)
{
super.onCreate(savedInstanceStats);
setContentView(R.layout.layout_advice);
edit_advice_txt=findViewById(R.id.advice_txt);
btn_advice_submit=findViewById(R.id.advice_submit);
mProSpinner=(Spinner) findViewById(R.id.spinner_advice);
init();
}
private void init()
{
mProSpinner=(Spinner)findViewById(R.id.spinner_advice);
mStringArray=getResources().getStringArray(R.array.advice_name);
mProAdapter=new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,mStringArray);
mProSpinner.setPrompt("选择你需要的服务类型");
mProAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
mProSpinner.setAdapter(mProAdapter);
mProSpinner.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
}

}

王兵兵:学习了ButterKnife框架,减少了代码的重复量,避免了重复使用findViewByid来寻找VIEW的id加快了运行速度,是界面更加简洁

 

 

posted @ 2020-05-26 20:03  峦码  阅读(110)  评论(0编辑  收藏  举报