网络请求图片

This commit is contained in:
nikiii 2024-06-20 12:12:13 +08:00
parent f90ca73d19
commit fd3476a67a
11 changed files with 192 additions and 159 deletions

View File

@ -44,9 +44,6 @@
<activity
android:name=".DealActivity"
android:exported="false" />
<activity
android:name=".LockerActivity"
android:exported="false" />
<activity
android:name=".PersonActivity"
android:exported="false" />
@ -72,9 +69,7 @@
<activity
android:name=".ThirdActivity"
android:exported="false" />
<activity
android:name=".SecondActivity"
android:exported="false" />
<activity
android:name=".FirstActivity"
android:exported="false" />

View File

@ -4,11 +4,11 @@ import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class LockerActivity extends AppCompatActivity {
public class ApproveActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_locker);
setContentView(R.layout.activity_approve);
}
}

View File

@ -10,6 +10,10 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;
public class Community1Fragment extends Fragment {
@ -21,6 +25,42 @@ public class Community1Fragment extends Fragment {
// Inflate the layout for this fragment
View view=inflater.inflate(R.layout.fragment_community1, container, false);
ImageView imageView25=view.findViewById(R.id.imageView25);
ImageView imageView26=view.findViewById(R.id.imageView26);
ImageView imageView27=view.findViewById(R.id.imageView27);
ImageView imageView28=view.findViewById(R.id.imageView28);
ImageView imageView29=view.findViewById(R.id.imageView29);
ImageView imageView31=view.findViewById(R.id.imageView31);
ImageView imageView32=view.findViewById(R.id.imageView32);
String imgUrl25="http://106.53.194.250:30089/i/2024/06/20/6673a095625ef.png";
Glide.with(this)
.load(imgUrl25)
.into(imageView25);
String imgUrl26="http://106.53.194.250:30089/i/2024/06/20/6673a0946efd6.png";
Glide.with(this)
.load(imgUrl26)
.into(imageView26);
String imgUrl27="http://106.53.194.250:30089/i/2024/06/20/6673a0948c940.png";
Glide.with(this)
.load(imgUrl27)
.into(imageView27);
String imgUrl28="http://106.53.194.250:30089/i/2024/06/20/6673a094a9bbf.png";
Glide.with(this)
.load(imgUrl28)
.into(imageView28);
String imgUrl29="http://106.53.194.250:30089/i/2024/06/20/6673a09682f40.png";
Glide.with(this)
.load(imgUrl29)
.into(imageView29);
String imgUrl31="http://106.53.194.250:30089/i/2024/06/20/6673a09507c3a.png";
Glide.with(this)
.load(imgUrl31)
.into(imageView31);
String imgUrl32="http://106.53.194.250:30089/i/2024/06/20/6673a095321ad.png";
Glide.with(this)
.load(imgUrl32)
.into(imageView32);
imageView25.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

View File

@ -7,6 +7,9 @@ import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
public class Community2Fragment extends Fragment {
@ -16,6 +19,41 @@ public class Community2Fragment extends Fragment {
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view=inflater.inflate(R.layout.fragment_community2, container, false);
ImageView imageView25=view.findViewById(R.id.imageView25);
ImageView imageView26=view.findViewById(R.id.imageView26);
ImageView imageView27=view.findViewById(R.id.imageView27);
ImageView imageView28=view.findViewById(R.id.imageView28);
ImageView imageView29=view.findViewById(R.id.imageView29);
ImageView imageView31=view.findViewById(R.id.imageView31);
ImageView imageView32=view.findViewById(R.id.imageView32);
String imgUrl25="http://106.53.194.250:30089/i/2024/06/20/6673a88eb749a.png";
Glide.with(this)
.load(imgUrl25)
.into(imageView25);
String imgUrl26="http://106.53.194.250:30089/i/2024/06/20/6673a88ece765.png";
Glide.with(this)
.load(imgUrl26)
.into(imageView26);
String imgUrl27="http://106.53.194.250:30089/i/2024/06/20/6673a88ea5927.png";
Glide.with(this)
.load(imgUrl27)
.into(imageView27);
String imgUrl28="http://106.53.194.250:30089/i/2024/06/20/6673abc42b374.png";
Glide.with(this)
.load(imgUrl28)
.into(imageView28);
String imgUrl29="http://106.53.194.250:30089/i/2024/06/20/6673a88e8f060.png";
Glide.with(this)
.load(imgUrl29)
.into(imageView29);
String imgUrl31="http://106.53.194.250:30089/i/2024/06/20/6673a88f11983.png";
Glide.with(this)
.load(imgUrl31)
.into(imageView31);
String imgUrl32="http://106.53.194.250:30089/i/2024/06/20/6673a88f016bf.png";
Glide.with(this)
.load(imgUrl32)
.into(imageView32);
return view;
}
}

View File

@ -7,6 +7,9 @@ import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
public class Community3Fragment extends Fragment {
@ -17,6 +20,41 @@ public class Community3Fragment extends Fragment {
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view=inflater.inflate(R.layout.fragment_community3, container, false);
ImageView imageView25=view.findViewById(R.id.imageView25);
ImageView imageView26=view.findViewById(R.id.imageView26);
ImageView imageView27=view.findViewById(R.id.imageView27);
ImageView imageView28=view.findViewById(R.id.imageView28);
ImageView imageView29=view.findViewById(R.id.imageView29);
ImageView imageView31=view.findViewById(R.id.imageView31);
ImageView imageView32=view.findViewById(R.id.imageView32);
String imgUrl25="http://106.53.194.250:30089/i/2024/06/20/6673aa174fcde.png";
Glide.with(this)
.load(imgUrl25)
.into(imageView25);
String imgUrl26="http://106.53.194.250:30089/i/2024/06/20/6673aa1679c60.png";
Glide.with(this)
.load(imgUrl26)
.into(imageView26);
String imgUrl27="http://106.53.194.250:30089/i/2024/06/20/6673aa1672e4a.png";
Glide.with(this)
.load(imgUrl27)
.into(imageView27);
String imgUrl28="http://106.53.194.250:30089/i/2024/06/20/6673aa1699710.png";
Glide.with(this)
.load(imgUrl28)
.into(imageView28);
String imgUrl29="http://106.53.194.250:30089/i/2024/06/20/6673aa16a1dfc.png";
Glide.with(this)
.load(imgUrl29)
.into(imageView29);
String imgUrl31="http://106.53.194.250:30089/i/2024/06/20/6673aa16a652a.png";
Glide.with(this)
.load(imgUrl31)
.into(imageView31);
String imgUrl32="http://106.53.194.250:30089/i/2024/06/20/6673aa16ef135.png";
Glide.with(this)
.load(imgUrl32)
.into(imageView32);
return view;
}
}

View File

@ -1,15 +0,0 @@
package com.example.myapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.app.DownloadManager;
import android.os.Bundle;
public class SecondActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
}
}

View File

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout 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"
android:id="@+id/drawerlayout"
tools:context=".LockerActivity">
tools:context=".ApproveActivity">
</androidx.drawerlayout.widget.DrawerLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,62 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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=".SecondActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="401dp"
android:layout_height="143dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView6"
android:layout_width="106dp"
android:layout_height="86dp"
android:layout_marginStart="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:text="肖神农"
app:layout_constraintStart_toEndOf="@+id/imageView6"
app:layout_constraintTop_toTopOf="@+id/imageView6" />
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:text="主任医师"
app:layout_constraintStart_toEndOf="@+id/textView5"
app:layout_constraintTop_toTopOf="@+id/textView5" />
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="深圳市罗湖区妇幼保健区"
app:layout_constraintStart_toStartOf="@+id/textView5"
app:layout_constraintTop_toBottomOf="@+id/textView5" />
<TextView
android:id="@+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:text="儿科"
app:layout_constraintBottom_toBottomOf="@+id/textView7"
app:layout_constraintStart_toEndOf="@+id/textView7" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -11,64 +11,65 @@
<ImageView
android:id="@+id/imageView25"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:src="@drawable/pet1"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView26"
android:layout_width="215dp"
android:layout_height="323dp"
android:src="@drawable/pet2"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/imageView25" />
<ImageView
android:id="@+id/imageView27"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:src="@drawable/pet3"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
android:layout_marginTop="10dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView25" />
<ImageView
android:id="@+id/imageView28"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/pet4"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/imageView27"
app:layout_constraintTop_toBottomOf="@+id/imageView26" />
<ImageView
android:id="@+id/imageView29"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:src="@drawable/pet5"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView27" />
<ImageView
android:id="@+id/imageView31"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:src="@drawable/pet6"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
android:layout_marginTop="15dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/imageView29"
app:layout_constraintTop_toBottomOf="@+id/imageView28" />
<ImageView
android:id="@+id/imageView32"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:src="@drawable/pet7"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
android:layout_marginTop="15dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView29" />

View File

@ -11,64 +11,62 @@
<ImageView
android:id="@+id/imageView25"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:src="@drawable/pet1"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView26"
android:layout_width="215dp"
android:layout_height="323dp"
android:src="@drawable/grass"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/imageView25" />
<ImageView
android:id="@+id/imageView27"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
android:layout_marginTop="20dp"
android:src="@drawable/pet3"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView25" />
<ImageView
android:id="@+id/imageView28"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/pet4"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/imageView27"
app:layout_constraintTop_toBottomOf="@+id/imageView26" />
<ImageView
android:id="@+id/imageView29"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
android:layout_marginTop="20dp"
android:src="@drawable/pet5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView27" />
<ImageView
android:id="@+id/imageView31"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:src="@drawable/pet6"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/imageView29"
app:layout_constraintTop_toBottomOf="@+id/imageView28" />
<ImageView
android:id="@+id/imageView32"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
android:layout_marginTop="20dp"
android:src="@drawable/pet7"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView29" />

View File

@ -11,62 +11,63 @@
<ImageView
android:id="@+id/imageView25"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:src="@drawable/pet1"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView26"
android:layout_width="215dp"
android:layout_height="323dp"
android:src="@drawable/grass"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/imageView25" />
<ImageView
android:id="@+id/imageView27"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
android:layout_marginTop="20dp"
android:src="@drawable/grasss"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView25" />
<ImageView
android:id="@+id/imageView28"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/pet4"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/imageView27"
app:layout_constraintTop_toBottomOf="@+id/imageView26" />
<ImageView
android:id="@+id/imageView29"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
android:layout_marginTop="20dp"
android:src="@drawable/pet5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView27" />
<ImageView
android:id="@+id/imageView31"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:layout_height="320dp"
android:scaleType="fitXY"
android:layout_marginTop="20dp"
android:src="@drawable/pet6"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/imageView29"
app:layout_constraintTop_toBottomOf="@+id/imageView28" />
<ImageView
android:id="@+id/imageView32"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:layout_height="200dp"
android:scaleType="fitXY"
android:layout_marginTop="20dp"
android:src="@drawable/pet7"
app:layout_constraintStart_toStartOf="parent"