forked from hzuapps/android-labs-2018
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
95 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 62 additions & 2 deletions
64
...cord/main/java/edu/soft1614080902329/password_record/soft1614080902329RecordActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,73 @@ | ||
package edu.soft1614080902329.password_record; | ||
|
||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.AdapterView; | ||
import android.widget.BaseAdapter; | ||
import android.widget.Button; | ||
import android.widget.ListView; | ||
import android.widget.TextView; | ||
import android.widget.Toast; | ||
|
||
public class soft1614080902329RecordActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_soft1614080902329_record); | ||
ListView LvPassList = findViewById(R.id.pass_list); | ||
Button newPass = findViewById(R.id.new_pass); | ||
newPass.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
Toast.makeText(soft1614080902329RecordActivity.this,"newPass",Toast.LENGTH_SHORT).show(); | ||
// Intent intent = new Intent(); | ||
// intent.setClass(soft1614080902329RecordActivity.this, soft1614080902329RecordActivity.class); | ||
// soft1614080902329RecordActivity.this.startActivity(intent); | ||
} | ||
}); | ||
LvPassList.setAdapter(new passAdapter()); | ||
|
||
LvPassList.setOnItemClickListener(new AdapterView.OnItemClickListener() { | ||
@Override | ||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { | ||
Toast.makeText(soft1614080902329RecordActivity.this,position + "ok",Toast.LENGTH_SHORT).show(); | ||
} | ||
}); | ||
} | ||
|
||
private class passAdapter extends BaseAdapter { | ||
|
||
@Override | ||
public int getCount() { | ||
return 50; | ||
} | ||
|
||
@Override | ||
public Object getItem(int position) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public long getItemId(int position) { | ||
return 0; | ||
} | ||
|
||
|
||
@Override | ||
public View getView(int position, View convertView, ViewGroup parent) { | ||
TextView tvMsg; | ||
if(convertView == null){ | ||
tvMsg = new TextView(soft1614080902329RecordActivity.this); | ||
}else { | ||
tvMsg = (TextView) convertView; | ||
} | ||
tvMsg.setText((position + 1) + " QQ密码"); | ||
tvMsg.setTextSize(32); | ||
tvMsg.setPadding(50,50,0,50); | ||
return tvMsg; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# 第4次实验 | ||
|
||
## 1.实验目标 | ||
* 实现ListView显示密码Item | ||
* 加入新增按钮 | ||
|
||
## 2.实验步骤 | ||
* 设置ListView,获取ListView,通过适配器进行对象循环使用,通过监听每一个Item的获取对应的position,为数据存储做基础 | ||
* 添加按钮,实现监听,用土司检测功能完整性,为数据存储做准备 | ||
|
||
## 3.实验结果 | ||
* 实验截图 | ||
 | ||
|
||
## 4.实验体会 | ||
* 百度是万能的,一个百度不行,那就再来一个谷歌 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#1 第1次实验 | ||
# 第1次实验 | ||
|
||
## 1.实验目标 | ||
* 搭建Android 3.1 开发环境 | ||
|