Commit bb778c5b authored by donia's avatar donia

detailActivity-smsButton

parent 182d2f13
...@@ -5,6 +5,9 @@ import com.example.tpleboncoin.databinding.ActivityDetailScreenBinding; ...@@ -5,6 +5,9 @@ import com.example.tpleboncoin.databinding.ActivityDetailScreenBinding;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import com.example.tpleboncoin.R; import com.example.tpleboncoin.R;
import com.example.tpleboncoin.models.Annonce; import com.example.tpleboncoin.models.Annonce;
...@@ -27,5 +30,14 @@ public class DetailScreen extends AppCompatActivity { ...@@ -27,5 +30,14 @@ public class DetailScreen extends AppCompatActivity {
binding.descriptionTextView4.setText(annonce.getDescription()); binding.descriptionTextView4.setText(annonce.getDescription());
binding.titreTextView.setText(annonce.getTitre()); binding.titreTextView.setText(annonce.getTitre());
} }
binding.smsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
Intent smsIntent = new Intent(Intent.ACTION_MAIN);
smsIntent.addCategory(Intent.CATEGORY_APP_MESSAGING);
startActivity(smsIntent);
}
});
} }
} }
\ No newline at end of file
<vector android:alpha="0.95" android:autoMirrored="true"
android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M20,2L4,2c-1.1,0 -1.99,0.9 -1.99,2L2,22l4,-4h14c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM18,14L6,14v-2h12v2zM18,11L6,11L6,9h12v2zM18,8L6,8L6,6h12v2z"/>
</vector>
<?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" <androidx.coordinatorlayout.widget.CoordinatorLayout 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" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
tools:context=".ui.detailScreen">
<com.google.android.material.appbar.AppBarLayout
<ImageView android:id="@+id/appbar"
android:id="@+id/imageView"
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="282dp" android:layout_height="161dp">
android:layout_marginStart="33dp"
app:layout_constraintStart_toStartOf="parent" <com.google.android.material.appbar.CollapsingToolbarLayout
tools:layout_editor_absoluteY="96dp" /> android:layout_width="match_parent"
android:layout_height="157dp"
<TextView app:contentScrim="?attr/colorPrimary"
android:id="@+id/titreTextView" app:layout_scrollFlags="scroll|exitUntilCollapsed"
android:layout_width="0dp"
android:layout_height="42dp" app:toolbarId="@+id/toolbar">
android:layout_marginTop="52dp"
android:text="Titre"
android:textSize="34sp" <androidx.appcompat.widget.Toolbar
app:layout_constraintStart_toStartOf="@+id/descriptionTextView4" android:id="@+id/toolbar"
app:layout_constraintTop_toBottomOf="@+id/imageView" /> android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"></androidx.appcompat.widget.Toolbar>
<TextView </com.google.android.material.appbar.CollapsingToolbarLayout>
android:id="@+id/prixTextView" </com.google.android.material.appbar.AppBarLayout>
android:layout_width="107dp"
android:layout_height="0dp" <androidx.core.widget.NestedScrollView
android:layout_marginTop="143dp" android:layout_width="match_parent"
android:layout_marginEnd="28dp" android:layout_height="match_parent"
android:text="10,33€"
android:textAlignment="textStart"
android:textSize="34sp" app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
<TextView android:layout_height="match_parent"
android:id="@+id/adresseTextView" tools:context=".ui.detailScreen">
android:layout_width="wrap_content"
android:layout_height="wrap_content" <ImageView
android:layout_marginStart="22dp" android:id="@+id/imageView"
android:layout_marginTop="28dp" android:layout_width="0dp"
android:text="TextView" android:layout_height="250dp"
android:textSize="16sp" android:layout_marginStart="28dp"
android:textStyle="italic" android:layout_marginTop="32dp"
app:layout_constraintStart_toStartOf="@+id/titreTextView" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titreTextView" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/descriptionTextView4" android:id="@+id/titreTextView"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="130dp" android:layout_height="42dp"
android:layout_marginStart="54dp" android:layout_marginStart="4dp"
android:layout_marginTop="32dp" android:layout_marginTop="16dp"
android:layout_marginEnd="54dp" android:text="Titre"
android:text="TextView" android:textColor="#000000"
android:textAlignment="center" android:textSize="34sp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="@+id/descriptionTextView4"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/imageView" />
app:layout_constraintTop_toBottomOf="@+id/adresseTextView" />
<TextView
</androidx.constraintlayout.widget.ConstraintLayout> android:id="@+id/prixTextView"
\ No newline at end of file android:layout_width="107dp"
android:layout_height="0dp"
android:layout_marginTop="108dp"
android:layout_marginEnd="32dp"
android:text="10,33€"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="#673AB7"
android:textSize="29sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/adresseTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginTop="12dp"
android:text="TextView"
android:textAlignment="center"
android:textColor="#673AB7"
android:textSize="16sp"
android:textStyle="italic"
app:layout_constraintStart_toStartOf="@+id/titreTextView"
app:layout_constraintTop_toBottomOf="@+id/titreTextView" />
<TextView
android:id="@+id/descriptionTextView4"
android:layout_width="0dp"
android:layout_height="130dp"
android:layout_marginStart="54dp"
android:layout_marginTop="28dp"
android:layout_marginEnd="54dp"
android:text="TextView"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="#000000"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/adresseTextView" />
<Button
android:id="@+id/smsButton"
android:layout_width="131dp"
android:layout_height="47dp"
android:layout_marginStart="144dp"
android:layout_marginTop="26dp"
android:layout_marginEnd="10dp"
android:paddingLeft="10dp"
android:paddingTop="5dp"
android:paddingEnd="5dp"
android:paddingRight="5dp"
android:paddingBottom="5dp"
android:text="Contacter"
android:textSize="11sp"
app:icon="@drawable/baseline_message_24"
app:layout_constraintBottom_toTopOf="@+id/titreTextView"
app:layout_constraintEnd_toEndOf="@+id/prixTextView"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/imageView"
app:layout_constraintTop_toBottomOf="@+id/prixTextView"
app:layout_constraintVertical_bias="0.0" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment