AleksandraLebedeva 1 年之前
父節點
當前提交
7beb36a8f4

+ 1 - 0
.idea/gradle.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
 <project version="4">
+  <component name="GradleMigrationSettings" migrationVersion="1" />
   <component name="GradleSettings">
   <component name="GradleSettings">
     <option name="linkedExternalProjectsSettings">
     <option name="linkedExternalProjectsSettings">
       <GradleProjectSettings>
       <GradleProjectSettings>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>

+ 3 - 0
app/build.gradle

@@ -29,6 +29,9 @@ android {
 }
 }
 
 
 dependencies {
 dependencies {
+    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+    implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
+
 
 
     implementation 'androidx.appcompat:appcompat:1.5.1'
     implementation 'androidx.appcompat:appcompat:1.5.1'
     implementation 'com.google.android.material:material:1.7.0'
     implementation 'com.google.android.material:material:1.7.0'

+ 10 - 2
app/src/main/AndroidManifest.xml

@@ -2,8 +2,9 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools">
     xmlns:tools="http://schemas.android.com/tools">
 
 
-    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
-    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.INTERNET" />
+
     <application
     <application
         android:allowBackup="true"
         android:allowBackup="true"
         android:dataExtractionRules="@xml/data_extraction_rules"
         android:dataExtractionRules="@xml/data_extraction_rules"
@@ -16,6 +17,13 @@
         tools:targetApi="31">
         tools:targetApi="31">
         <activity
         <activity
             android:name=".MainActivity"
             android:name=".MainActivity"
+            android:exported="false">
+            <meta-data
+                android:name="android.app.lib_name"
+                android:value="" />
+        </activity>
+        <activity
+            android:name=".Autorezation"
             android:exported="true">
             android:exported="true">
             <intent-filter>
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <action android:name="android.intent.action.MAIN" />

+ 34 - 0
app/src/main/java/com/example/test/Autorezation.java

@@ -0,0 +1,34 @@
+package com.example.test;
+
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+public class Autorezation extends AppCompatActivity {
+
+    Button btnAdm, btnGost;
+    EditText Log, Password;
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_autorezation);
+
+        Log = findViewById(R.id.Log);
+        Password = findViewById(R.id.Password);
+        btnAdm = findViewById(R.id.btnAdm);
+        btnGost = findViewById(R.id.btnGost);
+    }
+
+    public void Adm(View view)
+    {
+
+        if(Log.getText().toString().matches(" "))
+        {
+
+        }
+    }
+
+}

+ 95 - 0
app/src/main/java/com/example/test/DataModal.java

@@ -0,0 +1,95 @@
+package com.example.test;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class DataModal implements Parcelable {
+
+    private  Integer Kod_teacher;
+    private String Name;
+    private String Surname;
+    private String Patronymic;
+    private String Subject;
+    private String Image;
+
+    public DataModal(Integer Kod_teacher, String Name,
+                     String Surname, String Patronymic,
+                     String Subject, String Image)
+    {
+        this.Kod_teacher = Kod_teacher;
+        this.Name = Name;
+        this.Surname = Surname;
+        this.Patronymic = Patronymic;
+        this.Subject = Subject;
+        this.Image = Image;
+    }
+
+    protected DataModal(Parcel in) {
+        Kod_teacher = in.readInt();
+        Name = in.readString();
+        Surname = in.readString();
+        Patronymic = in.readString();
+        Subject = in.readString();
+        Image = in.readString();
+    }
+
+    public Integer getKod_teacher(){return Kod_teacher; }
+    public String getName(){return Name;}
+    public String getSurname(){return Surname;}
+    public String getPatronymic(){return Patronymic;}
+    public String getSubject(){return Subject;}
+    public String getImage(){return Image;}
+
+
+    public void  setKod_teacher(Integer Kod_teacher)
+    {
+        this.Kod_teacher = Kod_teacher;
+    }
+    public void  setName(String Name)
+    {
+        this.Name = Name;
+    }
+    public void  setSurname(String Surname)
+    {
+        this.Surname = Surname;
+    }
+    public void  setPatronymic(String Patronymic)
+    {
+        this.Patronymic = Patronymic;
+    }
+    public void  setSubject(String Subject)
+    {
+        this.Subject = Subject;
+    }
+    public void  setImage(String Image)
+    {
+        this.Image = Image;
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeInt(Kod_teacher);
+        dest.writeString(Name);
+        dest.writeString(Surname);
+        dest.writeString(Patronymic);
+        dest.writeString(Subject);
+        dest.writeString(Image);
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public static final Creator<DataModal> CREATOR = new Creator<DataModal>() {
+        @Override
+        public DataModal createFromParcel(Parcel in) {
+            return new DataModal(in);
+        }
+
+        @Override
+        public DataModal[] newArray(int size) {
+            return new DataModal[size];
+        }
+    };
+}

+ 10 - 0
app/src/main/java/com/example/test/RetrofotAPI.java

@@ -0,0 +1,10 @@
+package com.example.test;
+
+import retrofit2.Call;
+import retrofit2.http.Body;
+import retrofit2.http.POST;
+
+public interface RetrofotAPI {
+    @POST("Users")
+    Call<DataModal> createPost(@Body DataModal dataModal);
+}

+ 40 - 0
app/src/main/res/layout/activity_autorezation.xml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout 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=".Autorezation"
+    android:orientation="vertical">
+
+<LinearLayout
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+    <EditText
+
+        android:layout_width="100dp"
+        android:layout_height="wrap_content"
+        android:id="@+id/Log"
+        >
+    </EditText>
+    <EditText
+        android:layout_width="100dp"
+        android:layout_height="wrap_content"
+        android:inputType="textPassword"
+        android:id="@+id/Password"
+        >
+    </EditText>
+    <Button
+        android:id="@+id/btnAdm"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="войти как автор"></Button>
+    <Button
+        android:id="@+id/btnGost"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="Войти как гость"></Button>
+</LinearLayout>
+
+</RelativeLayout>

+ 20 - 7
app/src/main/res/layout/activity_main.xml

@@ -1,18 +1,31 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_height="match_parent"
     tools:context=".MainActivity">
     tools:context=".MainActivity">
 
 
+
     <TextView
     <TextView
+        style="@style/textstyle"
         android:layout_width="wrap_content"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
-        android:text="Hello World!"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
+        android:layout_above="@+id/List"
+        android:layout_alignParentStart="true"
+        android:layout_alignParentTop="true"
+        android:layout_alignParentEnd="true"
+        android:layout_marginStart="183dp"
+        android:layout_marginTop="93dp"
+        android:layout_marginEnd="159dp"
+        android:layout_marginBottom="85dp"
+        android:text="Заголовок"></TextView>
+
+    <ListView
+            android:id="@+id/List"
+            android:layout_width="match_parent"
+            android:layout_height="518dp"
+            android:layout_alignParentBottom="true"
+            android:layout_marginBottom="16dp" />
 
 
-</androidx.constraintlayout.widget.ConstraintLayout>
+</RelativeLayout>

+ 51 - 0
app/src/main/res/layout/mask.xml

@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+   >
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical">
+
+        <ImageView
+            android:layout_width="150dp"
+            android:layout_height="150dp"
+            android:id="@+id/image"
+            android:layout_gravity="center"
+            android:src="@drawable/ic_launcher_background"></ImageView>
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:id="@+id/Fam"
+            android:layout_gravity="center"
+            android:text="Фамилия"
+            style="@style/textstyle"></TextView>
+
+        <TextView
+            android:id="@+id/Name"
+            android:layout_gravity="center"
+            android:text="Фамилия"
+         style="@style/textstyle"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"></TextView>
+        <TextView
+            android:id="@+id/Patronymic"
+            android:layout_gravity="center"
+            android:text="Фамилия"
+            style="@style/textstyle"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"></TextView>
+        <TextView
+            android:id="@+id/Subject"
+            android:layout_gravity="center"
+            android:text="Фамилия"
+            style="@style/textstyle"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"></TextView>
+
+
+    </LinearLayout>
+
+</LinearLayout>

+ 3 - 0
app/src/main/res/values/colors.xml

@@ -7,4 +7,7 @@
     <color name="teal_700">#FF018786</color>
     <color name="teal_700">#FF018786</color>
     <color name="black">#FF000000</color>
     <color name="black">#FF000000</color>
     <color name="white">#FFFFFFFF</color>
     <color name="white">#FFFFFFFF</color>
+
+    <color name="test">#5A0606</color>
+    <color name="test2">#FFA2A2</color>
 </resources>
 </resources>

+ 8 - 0
app/src/main/res/values/stylr.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <style name="textstyle">
+        <item name="android:textColor">@color/test</item>
+        <item name="android:textSize">14dp</item>
+    </style>
+</resources>