Add DEV4.5/exo1_controle_2022
This commit is contained in:
37
DEV4.5/exo1_controle_2022
Normal file
37
DEV4.5/exo1_controle_2022
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
Fichier MainActivity.java
|
||||||
|
|
||||||
|
package com.example.organisation;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_main);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Fichier activity_main.xml (dans res/layout/)
|
||||||
|
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="20dp">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/blueView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:layout_weight="2"
|
||||||
|
android:background="#33B5E5"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/greenView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="#99CC00"/>
|
||||||
|
</LinearLayout>
|
||||||
Reference in New Issue
Block a user