AleksandraLebedeva 1 year ago
parent
commit
4c4e853b5d

+ 17 - 0
.idea/deploymentTargetDropDown.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="deploymentTargetDropDown">
+    <runningDeviceTargetSelectedWithDropDown>
+      <Target>
+        <type value="RUNNING_DEVICE_TARGET" />
+        <deviceKey>
+          <Key>
+            <type value="SERIAL_NUMBER" />
+            <value value="30122822" />
+          </Key>
+        </deviceKey>
+      </Target>
+    </runningDeviceTargetSelectedWithDropDown>
+    <timeTargetWasSelectedWithDropDown value="2022-12-23T20:29:13.128252300Z" />
+  </component>
+</project>

+ 9 - 0
app/src/main/java/com/example/test/AdapterMask.java

@@ -1,6 +1,7 @@
 package com.example.test;
 
 import android.content.Context;
+import android.content.Intent;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
 import android.util.Base64;
@@ -71,6 +72,14 @@ public  class AdapterMask extends BaseAdapter {
 
         Images.setImageBitmap(getUserImage(dataModal.getImages()));
 
+        v.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                Intent intent = new Intent(mContext, Edit.class);
+                intent.putExtra(DataModal.class.getSimpleName(),dataModal);
+                mContext.startActivity(intent);
+            }
+        });
         return  v;
     }
 

+ 14 - 0
app/src/main/java/com/example/test/Add.java

@@ -1,14 +1,28 @@
 package com.example.test;
 
 import android.os.Bundle;
+import android.widget.ListView;
 
 import androidx.appcompat.app.AppCompatActivity;
 
+import java.util.ArrayList;
+import java.util.List;
+
 public class Add extends AppCompatActivity {
 
+
+    AdapterMask padapter;
+    List<DataModal> listlist = new ArrayList<>();
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_add);
+
+        ListView listt = findViewById(R.id.ListList);
+        padapter = new AdapterMask(Add.this, listlist);
+        listt.setAdapter(padapter);
+
     }
+
+
 }

+ 27 - 0
app/src/main/java/com/example/test/Edit.java

@@ -1,14 +1,41 @@
 package com.example.test;
 
+import android.content.Intent;
 import android.os.Bundle;
+import android.widget.EditText;
 
 import androidx.appcompat.app.AppCompatActivity;
 
 public class Edit extends AppCompatActivity {
 
+
+    Bundle arg;
+    DataModal dataModal;
+    EditText N,S,P,Sub;
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_edit);
+
+        arg = getIntent().getExtras();
+        dataModal = arg.getParcelable(DataModal.class.getSimpleName());
+
+        N = findViewById(R.id.N);
+        N.setText(dataModal.getName());
+        S = findViewById(R.id.S);
+        S.setText(dataModal.getSurname());
+        P = findViewById(R.id.P);
+        P.setText(dataModal.getPatronymic());
+        Sub = findViewById(R.id.Sub);
+        Sub.setText(dataModal.getSubject());
+
+
+    }
+
+    public  void btnBack()
+    {
+        Intent intent = new Intent(Edit.this, MainActivity.class);
+        startActivity(intent);
     }
+
 }

+ 11 - 0
app/src/main/res/layout/activity_add.xml

@@ -5,5 +5,16 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     tools:context=".Add">
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+        <ListView
+            android:id="@+id/ListList"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+
+            android:layout_alignParentBottom="true" />
+    </LinearLayout>
+
 
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 36 - 0
app/src/main/res/layout/activity_edit.xml

@@ -6,4 +6,40 @@
     android:layout_height="match_parent"
     tools:context=".Edit">
 
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        tools:ignore="MissingConstraint"
+        android:orientation="vertical"
+        >
+
+        <EditText
+            android:id="@+id/N"
+            style="@style/textstyle"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"></EditText>
+
+        <EditText
+            android:id="@+id/S"
+            style="@style/textstyle"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"></EditText>
+        <EditText
+            android:id="@+id/P"
+            style="@style/textstyle"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"></EditText>
+        <EditText
+            android:id="@+id/Sub"
+            style="@style/textstyle"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"></EditText>
+        <Button
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="Назад"
+            android:onClick="btnBack"
+            ></Button>
+    </LinearLayout>
+
 </androidx.constraintlayout.widget.ConstraintLayout>