glide
This commit is contained in:
parent
e4b0a5a09c
commit
9d87d6bea4
|
@ -40,4 +40,6 @@ dependencies {
|
||||||
androidTestImplementation(libs.espresso.core)
|
androidTestImplementation(libs.espresso.core)
|
||||||
implementation ("com.geyifeng.immersionbar:immersionbar:3.2.2")
|
implementation ("com.geyifeng.immersionbar:immersionbar:3.2.2")
|
||||||
implementation ("com.geyifeng.immersionbar:immersionbar-components:3.2.2")
|
implementation ("com.geyifeng.immersionbar:immersionbar-components:3.2.2")
|
||||||
|
implementation ("com.github.bumptech.glide:glide:4.15.1")
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,8 +1,9 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<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.INTERNET"/>
|
||||||
<application
|
<application
|
||||||
|
android:usesCleartextTraffic="true"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||||
android:fullBackupContent="@xml/backup_rules"
|
android:fullBackupContent="@xml/backup_rules"
|
||||||
|
|
|
@ -14,6 +14,10 @@ import androidx.core.graphics.Insets;
|
||||||
import androidx.core.view.ViewCompat;
|
import androidx.core.view.ViewCompat;
|
||||||
import androidx.core.view.WindowInsetsCompat;
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.bumptech.glide.RequestBuilder;
|
||||||
|
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||||
|
import com.bumptech.glide.request.RequestOptions;
|
||||||
import com.gyf.immersionbar.ImmersionBar;
|
import com.gyf.immersionbar.ImmersionBar;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
@ -26,6 +30,9 @@ public class MainActivity extends AppCompatActivity {
|
||||||
ImmersionBar.with(this).init();
|
ImmersionBar.with(this).init();
|
||||||
|
|
||||||
ImageView imageView2=findViewById(R.id.imageView2);
|
ImageView imageView2=findViewById(R.id.imageView2);
|
||||||
|
ImageView imageView=findViewById(R.id.imageView);
|
||||||
|
String url="http://106.53.194.250:30089/i/2024/06/12/66699fcd3fe03.png";
|
||||||
|
Glide.with(this).load(url).into(imageView);
|
||||||
imageView2.setOnClickListener(new View.OnClickListener() {
|
imageView2.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
|
@ -31,27 +31,16 @@
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/imageView"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="100dp"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout"
|
|
||||||
app:srcCompat="@drawable/img" />
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView2"
|
android:id="@+id/imageView2"
|
||||||
android:layout_width="95dp"
|
android:layout_width="95dp"
|
||||||
android:layout_height="95dp"
|
android:layout_height="95dp"
|
||||||
android:layout_marginTop="65dp"
|
android:layout_marginTop="80dp"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.498"
|
app:layout_constraintHorizontal_bias="0.498"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/imageView"
|
app:layout_constraintTop_toBottomOf="@+id/textView31"
|
||||||
app:srcCompat="@drawable/img_1" />
|
app:srcCompat="@drawable/img_1" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -66,4 +55,48 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/imageView2" />
|
app:layout_constraintTop_toBottomOf="@+id/imageView2" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imageView"
|
||||||
|
android:layout_width="34dp"
|
||||||
|
android:layout_height="34dp"
|
||||||
|
android:layout_marginStart="44dp"
|
||||||
|
android:layout_marginTop="120dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/constraintLayout"
|
||||||
|
tools:srcCompat="@tools:sample/avatars" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView31"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="50dp"
|
||||||
|
android:text="神话是众人的梦,梦是私人的神话"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/imageView" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView32"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginTop="32dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:background="#A39D9D"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/textView33"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView31" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView33"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="-17dp"
|
||||||
|
android:layout_marginEnd="36dp"
|
||||||
|
android:text="坎波"
|
||||||
|
android:textColor="#A39D9D"
|
||||||
|
android:textSize="21sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/textView32" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in New Issue