ReadyDev
...
# Ouvrir le menu nouveau projet
File > New > Project
# Sélectionner le type d'activité
Phone and Tablet > No Activity
Next
# Définir les informations du projet
Name > rdv_android
Package name > com.ready.app
Save location > v01
Language > Java
Minimum SDK > API 24 ("Nougat"; Android 7.0)
Build configuration language > Kotlin DSL (build.gradle.kts)[Recommended]
Finish
...... res/layout/activity_main.xml java/com/ready/app/MainActivity.java ...
...
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
......
<?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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
</androidx.constraintlayout.widget.ConstraintLayout>
...... Menu > Run > Run 'app' ...
... app/res/drawable/background.jpg ...
...
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
tools:context=".MainActivity">
</androidx.constraintlayout.widget.ConstraintLayout>
...... Menu > Run > Run 'app' ...
... app/res/drawable/icon.png ...
...
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="15dp"
android:layout_marginTop="30dp"
android:orientation="vertical"
tools:ignore="UselessParent">
<ImageView
android:layout_width="130dp"
android:layout_height="130dp"
android:layout_gravity="center"
android:importantForAccessibility="no"
android:src="@drawable/icon" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
...... Menu > Run > Run 'app' ...
...
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button btnRun = findViewById(R.id.btnRun);
btnRun.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(getApplicationContext(), "btnRun onClick...", Toast.LENGTH_LONG).show();
}
});
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="15dp"
android:layout_marginTop="30dp"
android:orientation="vertical"
tools:ignore="UselessParent">
<ImageView
android:layout_width="130dp"
android:layout_height="130dp"
android:layout_gravity="center"
android:importantForAccessibility="no"
android:src="@drawable/icon" />
<Button
android:id="@+id/btnRun"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Run"
tools:ignore="HardcodedText"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
...... Menu > Run > Run 'app' ...
...
# Ouvrir le fichier de configuration Gradle application
Gradle Scripts > build.gradle.kts (Module :app)
...
# Configurer la liaison de données
...
android {
...
buildFeatures {
viewBinding = true
}
}
...
# Synchroniser un projet avec les fichiers Gradle
......
public class MainActivity extends AppCompatActivity {
private ActivityMainBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
binding.btnRun.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(getApplicationContext(), "btnRun onClick...", Toast.LENGTH_LONG).show();
}
});
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="15dp"
android:layout_marginTop="30dp"
android:orientation="vertical"
tools:ignore="UselessParent">
<TextView
android:id="@+id/idTVHeading"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/lblTitle"
android:textAlignment="center"
android:textSize="30sp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
...... Menu > Run > Run 'app' ...
...
public class MainActivity extends AppCompatActivity {
private ActivityMainBinding binding;
private final String[] m_titles = {"Accueil", "Cours", "Tutoriels", "Applications"};
private int m_count = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
setSupportActionBar(binding.toolBar);
Objects.requireNonNull(getSupportActionBar()).setTitle(m_titles[m_count]);
binding.btnRun.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(++m_count >= m_titles.length) {
m_count = 0;
}
Objects.requireNonNull(getSupportActionBar()).setTitle(m_titles[m_count]);
}
});
}
}
......
<?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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:theme="@style/Theme.Rdv_android.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolBar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/Theme.Rdv_android.PopupOverlay" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
......
<resources xmlns:tools="http://schemas.android.com/tools">
...
<style name="Theme.Rdv_android.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="Theme.Rdv_android.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="Theme.Rdv_android.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Rdv_android"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.Rdv_android.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
...... Menu > Run > Run 'app' ...
... app/java/com/ready/app/HomeFragment.java app/java/com/ready/app/CourseFragment.java app/java/com/ready/app/TutorialFragment.java app/java/com/ready/app/ApplicationFragment.java ... app/res/layout/fragment_home.xml app/res/layout/fragment_course.xml app/res/layout/fragment_tutorial.xml app/res/layout/fragment_application.xml ...
...
public class MainActivity extends AppCompatActivity {
private ActivityMainBinding binding;
private int m_count = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityMainBinding binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
showFragment(0);
binding.btnRun.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (++m_count >= 4) {
m_count = 0;
}
showFragment(m_count);
}
});
}
private void showFragment(int _pos) {
Fragment fragment = null;
switch (_pos) {
case 0:
fragment = new HomeFragment();
break;
case 1:
fragment = new CourseFragment();
break;
case 2:
fragment = new TutorialFragment();
break;
case 3:
fragment = new ApplicationFragment();
break;
}
getSupportFragmentManager().beginTransaction().replace(R.id.frameLayout, fragment)
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.commit();
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:theme="@style/Theme.Rdv_android.AppBarOverlay">
<Button
android:id="@+id/btnRun"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/btnRun" />
<FrameLayout
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
......
public class HomeFragment extends Fragment {
public HomeFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_home, container, false);
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".HomeFragment">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Accueil"
android:textSize="30sp"
tools:ignore="HardcodedText" />
</FrameLayout>
......
public class CourseFragment extends Fragment {
public CourseFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_course, container, false);
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".CourseFragment">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Cours"
android:textSize="30sp"
tools:ignore="HardcodedText" />
</FrameLayout>
......
public class TutorialFragment extends Fragment {
public TutorialFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_tutorial, container, false);
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".TutorialFragment">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Tutoriel"
android:textSize="30sp"
tools:ignore="HardcodedText" />
</FrameLayout>
......
public class ApplicationFragment extends Fragment {
public ApplicationFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_application, container, false);
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ApplicationFragment">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Application"
android:textSize="30sp"
tools:ignore="HardcodedText" />
</FrameLayout>
...... Menu > Run > Run 'app' ...
... app/java/com/ready/app/HomeFragment.java app/java/com/ready/app/CourseFragment.java app/java/com/ready/app/TutorialFragment.java app/java/com/ready/app/ApplicationFragment.java ... app/res/layout/fragment_home.xml app/res/layout/fragment_course.xml app/res/layout/fragment_tutorial.xml app/res/layout/fragment_application.xml ...
...
public class MainActivity extends AppCompatActivity {
private ActivityMainBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityMainBinding binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
showFragment(0);
binding.tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
showFragment(tab.getPosition());
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
}
private void showFragment(int _pos) {
Fragment fragment = null;
switch (_pos) {
case 0:
fragment = new HomeFragment();
break;
case 1:
fragment = new CourseFragment();
break;
case 2:
fragment = new TutorialFragment();
break;
case 3:
fragment = new ApplicationFragment();
break;
}
getSupportFragmentManager().beginTransaction().replace(R.id.frameLayout, fragment)
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.commit();
}
}
......
<?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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:theme="@style/Theme.Rdv_android.AppBarOverlay">
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#008080"
app:tabIndicatorColor="#000000"
app:tabSelectedTextColor="#FFFFFF">
<com.google.android.material.tabs.TabItem
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Accueil"
tools:ignore="HardcodedText" />
<com.google.android.material.tabs.TabItem
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Cours"
tools:ignore="HardcodedText" />
<com.google.android.material.tabs.TabItem
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Tutoriel"
tools:ignore="HardcodedText" />
<com.google.android.material.tabs.TabItem
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="App"
tools:ignore="HardcodedText" />
</com.google.android.material.tabs.TabLayout>
<FrameLayout
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
...... Menu > Run > Run 'app' ...
... # Créer les fragments # Pour gérer les contenus de la vue principale ... app/java/com/ready/app/HomeFragment.java app/java/com/ready/app/CourseFragment.java app/java/com/ready/app/TutorialFragment.java app/java/com/ready/app/ApplicationFragment.java ... app/res/layout/fragment_home.xml app/res/layout/fragment_course.xml app/res/layout/fragment_tutorial.xml app/res/layout/fragment_application.xml ...
... # Créer les Vector Asset # Pour gérer les icônes des éléments de menu ... app/res/drawable/baseline_add_home_24.xml app/res/drawable/baseline_add_to_photos_24.xml app/res/drawable/baseline_assignment_24.xml app/res/drawable/baseline_computer_24.xml ...
... # Créer le fichier de ressource navigation ... app/res/navigation/navigation_main.xml ... # Ajouter les fragments # Pour lister les contenus de navigation de la vue principale # Afin d'établir les liens entre la vue de navigation et la vue principale ... navigation_main.xml > fragment_home.xml navigation_main.xml > fragment_course.xml navigation_main.xml > fragment_tutorial.xml navigation_main.xml > fragment_application.xml ...
... # Créer le fichier de ressource menu ... app/res/menu/menu_main.xml app/res/menu/menu_setting.xml ... # Ajouter les fragments # Pour lister les éléments de menu de la vue de navigation ... menu_main.xml > fragment_home.xml menu_main.xml > fragment_course.xml menu_main.xml > fragment_tutorial.xml menu_main.xml > fragment_application.xml ...
... # Créer l'en-tête de la vue de navigation # Pour afficher les informations sur l'application app/res/layout/nav_header_main.xml ... # Créer la barre d'outils de la vue principale # Pour afficher le titre de la vue principale app/res/layout/app_bar_main.xml ... # Créer la barre d'outils de la vue principale # Pour afficher le contenu de la vue principale app/res/layout/content_main.xml ...
...
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
...
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.Rdv_android.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
......
<resources xmlns:tools="http://schemas.android.com/tools">
...
<style name="Theme.Rdv_android.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
...
<style name="Theme.Rdv_android.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="Theme.Rdv_android.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
......
<?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=".ui.home.HomeFragment">
<TextView
android:id="@+id/text_home"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
......
public class MainActivity extends AppCompatActivity {
private ActivityMainBinding binding;
private AppBarConfiguration mAppBarConfiguration;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityMainBinding binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
setSupportActionBar(binding.appBarMain.toolBar);
DrawerLayout drawerLayout = binding.drawerLayout;
NavigationView navigationView = binding.navigationView;
mAppBarConfiguration = new AppBarConfiguration.Builder(
R.id.homeFragment, R.id.courseFragment, R.id.tutorialFragment, R.id.applicationFragment)
.setOpenableLayout(drawerLayout)
.build();
NavController navController = Navigation.findNavController(this, R.id.navHostFragment);
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
NavigationUI.setupWithNavController(navigationView, navController);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_setting, menu);
return true;
}
@Override
public boolean onSupportNavigateUp() {
NavController navController = Navigation.findNavController(this, R.id.navHostFragment);
return NavigationUI.navigateUp(navController, mAppBarConfiguration)
|| super.onSupportNavigateUp();
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout 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:id="@+id/drawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".MainActivity"
tools:openDrawer="start">
<include
android:id="@+id/appBarMain"
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.google.android.material.navigation.NavigationView
android:id="@+id/navigationView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/menu_main" />
</androidx.drawerlayout.widget.DrawerLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<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"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Theme.Rdv_android.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolBar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/Theme.Rdv_android.PopupOverlay" />
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_main" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
......
<?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"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/app_bar_main">
<fragment
android:id="@+id/navHostFragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/navigation_main" />
</androidx.constraintlayout.widget.ConstraintLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<navigation 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"
app:startDestination="@id/homeFragment">
<fragment
android:id="@+id/homeFragment"
android:name="com.ready.app.HomeFragment"
android:label="Accueil"
tools:layout="@layout/fragment_home" />
<fragment
android:id="@+id/courseFragment"
android:name="com.ready.app.CourseFragment"
android:label="Cours"
tools:layout="@layout/fragment_course" />
<fragment
android:id="@+id/tutorialFragment"
android:name="com.ready.app.TutorialFragment"
android:label="Tutoriel"
tools:layout="@layout/fragment_tutorial" />
<fragment
android:id="@+id/applicationFragment"
android:name="com.ready.app.ApplicationFragment"
android:label="Application"
tools:layout="@layout/fragment_application" />
</navigation>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="176dp"
android:background="#005050"
android:gravity="bottom"
android:orientation="vertical"
android:paddingLeft="16dp"
android:paddingTop="16dp"
android:paddingRight="16dp"
android:paddingBottom="8dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<ImageView
android:layout_width="70dp"
android:layout_height="70dp"
android:contentDescription="Navigation Header"
android:paddingTop="8dp"
app:srcCompat="@drawable/icon"
tools:ignore="HardcodedText" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:text="ReadyDev"
android:textSize="18sp"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
tools:ignore="HardcodedText" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Plateforme de développement continu"
android:textSize="14sp"
tools:ignore="HardcodedText" />
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<group
android:id="@+id/group1"
android:checkableBehavior="single">
<item
android:id="@+id/homeFragment"
android:icon="@drawable/baseline_add_home_24"
android:title="Accueil"
tools:ignore="HardcodedText" />
<item
android:id="@+id/courseFragment"
android:icon="@drawable/baseline_assignment_24"
android:title="Cours"
tools:ignore="HardcodedText" />
<item
android:id="@+id/tutorialFragment"
android:icon="@drawable/baseline_add_to_photos_24"
android:title="Tutoriel"
tools:ignore="HardcodedText" />
</group>
<group
android:id="@+id/group2"
android:checkableBehavior="single">
<item
android:id="@+id/applicationFragment"
android:icon="@drawable/baseline_computer_24"
android:title="Application"
tools:ignore="HardcodedText" />
</group>
</menu>
...... Menu > Run > Run 'app' ...
...
# Ouvrir le menu nouveau projet
File > New > Project
# Sélectionner le type d'activité
Phone and Tablet > No Activity
Next
# Définir les informations du projet
Name > rdv_android
Package name > com.ready.app
Save location > v01
Language > Kotlin
Minimum SDK > API 24 ("Nougat"; Android 7.0)
Build configuration language > Kotlin DSL (build.gradle.kts)[Recommended]
Finish
...... res/layout/activity_main.xml java/com/ready/app/MainActivity.kt ...
...
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
}
......
<?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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
</androidx.constraintlayout.widget.ConstraintLayout>
...... Menu > Run > Run 'app' ...
... # Ouvrir le menu Nouvelle Activité Android app > [nom-langage] > [nom-package] > Clic droit > New > Activity > Empty Views Activity # Définir les informations sur l'activité Activity Name > MainActivity Cocher > Generate a Layout File Layout Name > activity_main Cocher > Launcher Activity Package name > [nom-package] Source Language > [nom-langage] Finish ...
... # Ouvrir le menu Nouvelle Activité Android app > [nom-langage] > [nom-package] > Clic droit > New > Activity > Navigation Drawer Views Activity # Définir les informations sur l'activité Activity Name > MainActivity Cocher > Generate a Layout File Layout Name > activity_main Cocher > Launcher Activity Package name > [nom-package] Source Language > [nom-langage] Finish ...
...
public class MainActivity extends AppCompatActivity {
private AppBarConfiguration mAppBarConfiguration;
private ActivityMainBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
setSupportActionBar(binding.appBarMain.toolbar);
binding.appBarMain.fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null)
.setAnchorView(R.id.fab).show();
}
});
DrawerLayout drawer = binding.drawerLayout;
NavigationView navigationView = binding.navView;
mAppBarConfiguration = new AppBarConfiguration.Builder(
R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow)
.setOpenableLayout(drawer)
.build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
NavigationUI.setupWithNavController(navigationView, navController);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onSupportNavigateUp() {
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
return NavigationUI.navigateUp(navController, mAppBarConfiguration)
|| super.onSupportNavigateUp();
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout 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:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
android:id="@+id/app_bar_main"
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />
</androidx.drawerlayout.widget.DrawerLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="@dimen/nav_header_height"
android:background="@drawable/side_nav_bar"
android:gravity="bottom"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/nav_header_desc"
android:paddingTop="@dimen/nav_header_vertical_spacing"
app:srcCompat="@mipmap/ic_launcher_round" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/nav_header_vertical_spacing"
android:text="@string/nav_header_title"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/nav_header_subtitle" />
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_home"
android:icon="@drawable/ic_menu_camera"
android:title="@string/menu_home" />
<item
android:id="@+id/nav_gallery"
android:icon="@drawable/ic_menu_gallery"
android:title="@string/menu_gallery" />
<item
android:id="@+id/nav_slideshow"
android:icon="@drawable/ic_menu_slideshow"
android:title="@string/menu_slideshow" />
</group>
</menu>
......
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
app:showAsAction="never" />
</menu>
......
<?xml version="1.0" encoding="utf-8"?>
<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"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Theme.Rdv_android.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/Theme.Rdv_android.PopupOverlay" />
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_main" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginEnd="@dimen/fab_margin"
android:layout_marginBottom="16dp"
app:srcCompat="@android:drawable/ic_dialog_email" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
......
<?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"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/app_bar_main">
<fragment
android:id="@+id/nav_host_fragment_content_main"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/mobile_navigation" />
</androidx.constraintlayout.widget.ConstraintLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<navigation 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:id="@+id/mobile_navigation"
app:startDestination="@+id/nav_home">
<fragment
android:id="@+id/nav_home"
android:name="com.ready.app.ui.home.HomeFragment"
android:label="@string/menu_home"
tools:layout="@layout/fragment_home" />
<fragment
android:id="@+id/nav_gallery"
android:name="com.ready.app.ui.gallery.GalleryFragment"
android:label="@string/menu_gallery"
tools:layout="@layout/fragment_gallery" />
<fragment
android:id="@+id/nav_slideshow"
android:name="com.ready.app.ui.slideshow.SlideshowFragment"
android:label="@string/menu_slideshow"
tools:layout="@layout/fragment_slideshow" />
</navigation>
......
<?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=".ui.home.HomeFragment">
<TextView
android:id="@+id/text_home"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
......
<?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=".ui.gallery.GalleryFragment">
<TextView
android:id="@+id/text_gallery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
......
<?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=".ui.slideshow.SlideshowFragment">
<TextView
android:id="@+id/text_slideshow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
...... # Ouvrir le menu Device Manager Menu > Tools > Device Manager # Ouvrir le Virtual Device Configuration Add a new device > Create Virtual Device # Définir les informations sur l'appareil Category > Phone Name > Pixel 9 Pro XL Next # Définir les informations sur l'image Release Name > R API > 30 ABI > x86 xABI > armeabi-v7a Target > Android 11.0 (Google Play) Next # Définir les informations sur le nom AVD Name > Pixel 9 Pro XL API 30 Startup orientation > Portrait Finish ...
... C:\Users\tiaka\.android\avd\Pixel_7_Pro_API_30.avd C:\Users\tiaka\.android\avd\Pixel_9_API_30.avd C:\Users\tiaka\.android\avd\Pixel_9_Pro_XL_API_30.avd ...
... # Ouvrir le menu Configure Vector Asset app > res > drawable > Clic droit > New > Vector Asset # Définir les informations sur le Vector Asset Clip art > Rechercher > arrow back > OK Color > #FFFFFF Next Source set > main src/main/res Output directories > res/drawable/baseline_arrow_back_24.xml Finish ...
... # Ouvrir le menu New Android Component app > java > [nom-package] > Clic droit > New > Fragment > Fragment (Blank) # Définir les informations sur le fragment Fragment Name > [nom-fragment] Fragment Layout Name > [nom-layout-fragment] Source Language > [nom-langage] Finish ... # Cela crée les fichiers source et layout ... app/java/com/ready/app/[nom-fragment] app/res/layout/[nom-layout-fragment] ...
... # Ouvrir le menu New Resource Directory app > res > Clic droit > New > Android Resource Directory # Définir les informations sur le répertoire de ressource navigation Directory name > navigation Resource type > navigation Source set > main (src/main/res) OK ...
...
# Ouvrir le fichier de configuration Gradle application
Gradle Scripts > build.gradle.kts (Module :app)
...
# Configurer les fichiers de ressources navigation
...
dependencies {
...
implementation(libs.androidx.navigation.fragment.ktx)
implementation(libs.androidx.navigation.ui.ktx)
...
}
...
# Synchroniser le projet avec les fichiers Gradle
...... # Ouvrir le menu New Resource File app > res > navaigation > Clic droit > New > Navigation Resource File # Définir les informations sur le fichier de ressource navigation File name > navigation_main Root element > navigation Source set > main (src/main/res) Directory name > navigation OK > OK ...
... # Ouvrir le menu New Resource Directory app > res > Clic droit > New > Android Resource Directory # Définir les informations sur le répertoire de ressource menu Directory name > menu Resource type > menu Source set > main (src/main/res) OK ...
... # Ouvrir le menu New Resource File app > res > menu > Clic droit > New > Menu Resource File # Définir les informations sur le fichier de ressource menu File name > menu_main Root element > menu Source set > main (src/main/res) Directory name > menu OK > OK ...
... # Ouvrir le menu New Resource File app > res > layout > Clic droit > New > Layout Resource File # Définir les informations sur le fichier de ressource layout File name > [nom-fichier-layout] Root element > [nom-classe-layout] Source set > main (src/main/res) Directory name > layout OK > OK ...
... # Ouvrir le fichier de ressource navigation app > res > navigation > navigation_main.xml ... # Ajouter un fragment au fichier de ressource navigation Navigation ... New Destination (+) > [nom-fragment] ...
...
<?xml version="1.0" encoding="utf-8"?>
<navigation 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:id="@+id/navigation_main"
app:startDestination="@id/homeFragment">
<fragment
android:id="@+id/homeFragment"
android:name="com.ready.app.HomeFragment"
android:label="fragment_home"
tools:layout="@layout/fragment_home" />
<fragment
android:id="@+id/courseFragment"
android:name="com.ready.app.CourseFragment"
android:label="fragment_course"
tools:layout="@layout/fragment_course" />
<fragment
android:id="@+id/tutorialFragment"
android:name="com.ready.app.TutorialFragment"
android:label="fragment_tutorial"
tools:layout="@layout/fragment_tutorial" />
<fragment
android:id="@+id/applicationFragment"
android:name="com.ready.app.ApplicationFragment"
android:label="fragment_application"
tools:layout="@layout/fragment_application" />
</navigation>
...... # Ouvrir le fichier de ressource menu app > res > menu > menu_main.xml ... # Ajouter une balise group # Ajouter une balise item lié au fragment ...
...
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<group android:checkableBehavior="single">
<item
android:id="@+id/homeFragment"
android:icon="@drawable/baseline_add_home_24"
android:title="Accueil"
tools:ignore="HardcodedText" />
<item
android:id="@+id/courseFragment"
android:icon="@drawable/baseline_assignment_24"
android:title="Cours"
tools:ignore="HardcodedText" />
<item
android:id="@+id/tutorialFragment"
android:icon="@drawable/baseline_add_to_photos_24"
android:title="Tutoriel"
tools:ignore="HardcodedText" />
<item
android:id="@+id/applicationFragment"
android:icon="@drawable/baseline_computer_24"
android:title="Application"
tools:ignore="HardcodedText" />
</group>
</menu>
...... # Ouvrir l'assistant de mises à jour Menu > Tools > Android SDK Upgrade Assistant # Continuer les mises à jour Suivre les instruction > Mettre à jour > Android SDK ...
... # Ouvrir l'assistant de mises à jour Menu > Tools > AGP Upgrade Assistant # Continuer les mises à jour Suivre les instruction > Mettre à jour > AGP ...
... # Ouvrir le code du Layout app > res > layout > [nom-layout-xml] > Double Clic # Ouvrir la vue Code [nom-layout-xml] > [panneau-des-vues] > [Code] # Ouvrir la vue Conception [nom-layout-xml] > [panneau-des-vues] > [Design] # Ouvrir les 2 vues [nom-layout-xml] > [panneau-des-vues] > [Split] ...
... # Reformater le code XML d'un layout app > res > layout > activity_layout.xml > Clic droit > Reformat Code # Sélectionner les options Cocher > Optimize imports Cocher > Rearrange entries Cocher > Cleanup code OK ...
... # Renommer le fragment app > java > [nom-package] > [nom-fragment] > Clic droit > Refactor > Rename # Sélectionner les options Cocher > Search in comments and strings Cocher > Rename tests Cocher > Rename variables Cocher > Search for text occurrences Cocher > Rename inheritors # Définir la portée Scope > Project Files Refactor > Do refactor ...
... # Renommer le fragment app > res > layout > [nom-fragment] > Clic droit > Refactor > Rename # Sélectionner les options Cocher > Search in comments and strings # Définir la portée Scope > Project Files Refactor ...
... # Copier une image sur l'ordinateur Windows > [dossier-image] > [nom-image] > Touche (Ctrl + C) # Coller l'image dans le dossier drawable Android Studio > app > res > drawable > Touche (Ctrl + V) New name > [nom-image] To directory > [dossier-drawable] OK ...
... # Ouvrir la fenêtre de configuration [contenu-layout-xml] > [texte-en-warning] > [souris-au-dessus] > Extract string resource # Définir les informations sur la ressource Resource name > [nom-ressource] Resource value > [valeur-ressource] File name > [nom-fichier-ressource] OK ...
... # Importer la classe [contenu-code-source] > [classe-en-erreur] > [souris-au-dessus] > Import class ...
... # Synchroniser le projet avec les fichiers Gradle Menu > File > Sync Project with Gradle Files # Vérifier que la synchronisation a réussi [outil] > Build > Sync > [icone-finish-en-vert] ...