Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
OrangeHap committed May 12, 2018
1 parent 10fbfa1 commit d6ada38
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 16 deletions.
1 change: 1 addition & 0 deletions soft1614080902329/Password_Record/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".soft1614080902329RecordActivity"></activity>
</application>

</manifest>
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;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="edu.soft1614080902329.password_record.soft1614080902329RecordActivity">

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

<TextView
android:id="@+id/title_sys"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="跳转成功"
android:textSize="32dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="80px"
<ListView
android:id="@+id/pass_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>

</LinearLayout>

<Button
android:id="@+id/new_pass"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:textColor="#4edc50"
android:background="#303f9f"
android:text="+"
android:textSize="38dp" />
</RelativeLayout>
</android.support.constraint.ConstraintLayout>
16 changes: 16 additions & 0 deletions soft1614080902329/Password_Record/report4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 第4次实验

## 1.实验目标
* 实现ListView显示密码Item
* 加入新增按钮

## 2.实验步骤
* 设置ListView,获取ListView,通过适配器进行对象循环使用,通过监听每一个Item的获取对应的position,为数据存储做基础
* 添加按钮,实现监听,用土司检测功能完整性,为数据存储做准备

## 3.实验结果
* 实验截图
![实验截图](https://github.com/OrangeHap/android-labs-2018/blob/master/soft1614080902329/lab3_1.png)

## 4.实验体会
* 百度是万能的,一个百度不行,那就再来一个谷歌
Binary file added soft1614080902329/lab4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion soft1614080902329/report1.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#1 第1次实验
# 第1次实验

## 1.实验目标
* 搭建Android 3.1 开发环境
Expand Down

0 comments on commit d6ada38

Please sign in to comment.