Skip to content

Commit

Permalink
alignement changé pour les contenus du tuto
Browse files Browse the repository at this point in the history
  • Loading branch information
Celestial04 committed Sep 3, 2024
1 parent 5fb3f48 commit 45a5f5f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 56 deletions.
4 changes: 2 additions & 2 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 1 addition & 39 deletions app/src/main/java/com/bouillie/web/tuto_1.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,20 @@

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import com.boullie.web.R;
import com.google.android.gms.tasks.Task;
import com.google.android.material.color.DynamicColors;
import com.google.android.play.core.appupdate.AppUpdateInfo;
import com.google.android.play.core.appupdate.AppUpdateManager;
import com.google.android.play.core.appupdate.AppUpdateManagerFactory;
import com.google.android.play.core.install.model.AppUpdateType;
import com.google.android.play.core.install.model.UpdateAvailability;

public class tuto_1 extends AppCompatActivity {
private int selectedTheme;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int savedTheme = getSharedPreferences("PREFERENCE", MODE_PRIVATE).getInt("selected_theme", NONE);

int selectedTheme;
if (savedTheme != NONE) {
selectedTheme = savedTheme;
}else{
Expand All @@ -33,24 +26,6 @@ protected void onCreate(Bundle savedInstanceState) {
setTheme(selectedTheme);
DynamicColors.applyToActivitiesIfAvailable(this.getApplication());
setContentView(R.layout.tuto_1);
AppUpdateManager appUpdateManager = AppUpdateManagerFactory.create(this);

// Returns an intent object that you use to check for an update.
Task<AppUpdateInfo> appUpdateInfoTask = appUpdateManager.getAppUpdateInfo();

// Checks that the platform will allow the specified type of update.
appUpdateInfoTask.addOnSuccessListener(appUpdateInfo -> {
if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE) {
appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE);
}// This example applies an immediate update. To apply a flexible update
// instead, pass in AppUpdateType.FLEXIBLE
// Request the update.
});
DynamicColors.applyToActivitiesIfAvailable(getApplication());
if (getIntent().getBooleanExtra("EXIT", false)) {
finish();

}
Button btn = findViewById(R.id.button4);
btn.setOnClickListener(v -> {
Intent intent = new Intent(tuto_1.this, tuto_2.class);
Expand All @@ -60,17 +35,4 @@ protected void onCreate(Bundle savedInstanceState) {
});
}


@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LOW_PROFILE);
}

}

}
9 changes: 6 additions & 3 deletions app/src/main/res/layout/tuto_1.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
<?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:layout_editor_absoluteY="81dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
tools:layout_editor_absoluteX="1dp"
tools:layout_editor_absoluteY="1dp">
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<TextView
android:layout_width="match_parent"
Expand Down
14 changes: 8 additions & 6 deletions app/src/main/res/layout/tuto_2.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<?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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
tools:layout_editor_absoluteX="1dp"
tools:layout_editor_absoluteY="1dp">
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<TextView
android:layout_width="match_parent"
Expand Down Expand Up @@ -45,7 +47,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Large" />

<Space
android:layout_width="61dp"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />

Expand Down
13 changes: 7 additions & 6 deletions app/src/main/res/layout/tuto_3.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<?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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".tuto_3">
android:layout_height="match_parent">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
tools:layout_editor_absoluteX="1dp"
tools:layout_editor_absoluteY="1dp">
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<TextView
android:layout_width="match_parent"
Expand Down

0 comments on commit 45a5f5f

Please sign in to comment.