Code Source Android Studio
Code Source Android Studio
SPLASH SCREEN
<GridLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10sp"
android:rowCount="5"
android:columnCount="2">
<ImageButton
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/android2"/>
<ImageButton
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/android3"/>
<ImageButton
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/android2"/>
<ImageButton
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/android3"/>
</GridLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
VIDEO
public class MainActivity extends AppCompatActivity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<VideoView
android:id="@+id/video"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
LIEN
<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=".MainActivity2">
<GridLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10sp"
android:columnCount="2"
android:rowCount="5"
tools:layout_editor_absoluteX="13dp"
tools:layout_editor_absoluteY="80dp">
<Button
android:id="@+id/button1"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:layout_gravity="fill"
android:layout_margin="5sp"
android:onClick="taxi"
android:text="Taxi"
android:textSize="20sp"
android:textStyle="bold"
app:backgroundTint="@color/teal_700"
app:cornerRadius="30dp"
app:iconGravity="end" />
<Button
android:id="@+id/button2"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:layout_gravity="fill"
android:layout_margin="5sp"
android:backgroundTint="?attr/colorSecondaryVariant"
android:fontFamily="monospace"
android:onClick="rest"
android:text="Restaurants"
android:textSize="18sp"
android:textStyle="bold"
app:cornerRadius="30dp" />
<Button
android:id="@+id/button3"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:layout_gravity="fill"
android:layout_margin="5sp"
android:backgroundTint="@color/purple_500"
android:onClick="covoi"
android:text="covoiturage"
android:textSize="18sp"
android:textStyle="bold"
app:cornerRadius="30dp" />
<Button
android:id="@+id/button4"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:layout_gravity="fill"
android:layout_margin="5sp"
android:backgroundTint="@color/purple_200"
android:onClick="depanne"
android:text="Depannage"
android:textSize="18sp"
android:textStyle="bold"
app:cornerRadius="30dp" />
<Button
android:id="@+id/button5"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:layout_gravity="fill"
android:layout_margin="5sp"
android:backgroundTint="@color/material_on_background_emphasis_medium"
android:onClick="page5"
android:text="Hebergement"
android:textSize="18sp"
android:textStyle="bold"
app:cornerRadius="30dp" />
<Button
android:id="@+id/button6"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:layout_gravity="fill"
android:layout_margin="5sp"
android:onClick="page6"
android:text="SERVICES"
android:textSize="18sp"
android:textStyle="bold"
app:cornerRadius="30dp" />
<Button
android:id="@+id/button7"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:layout_gravity="fill"
android:layout_margin="5sp"
android:backgroundTint="@android:color/holo_orange_light"
android:onClick="page7"
android:text="Evenements"
android:textSize="18sp"
android:textStyle="bold"
app:cornerRadius="30dp" />
<Button
android:id="@+id/button8"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:layout_gravity="fill"
android:layout_margin="5sp"
android:backgroundTint="@color/black"
android:onClick="page8"
android:text="Livraisons"
android:textSize="18sp"
android:textStyle="bold"
app:cornerRadius="30dp" />
</GridLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
LISTE D’ELEMENTS
JAVA
public class MainActivity4 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main4);
getSupportActionBar().hide();//cacher la barre des titres
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
if(i == 0)
{
startActivity(new Intent(MainActivity4.this,MainActivity5.class));
}
else if(i == 1)
{
startActivity(new Intent(MainActivity4.this,MainActivity6.class));
}
else
{
}
}
});
}
}
XML
<?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=".MainActivity4">
<ListView
android:id="@+id/listview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
Liste
xml
<?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=".MainActivity4">
<ListView
android:id="@+id/listview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
Java
public class MainActivity4 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main4);
getSupportActionBar().hide();//cacher la barre des titres
}
}
});
}
}