Skip to content

Commit

Permalink
update UI
Browse files Browse the repository at this point in the history
  • Loading branch information
MFM-347 committed Jan 25, 2025
1 parent a9634f5 commit 545348e
Show file tree
Hide file tree
Showing 46 changed files with 656 additions and 2,605 deletions.
25 changes: 8 additions & 17 deletions app/src/main/java/dev/mfm/app/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,19 @@
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import com.google.android.material.color.DynamicColors;
import dev.mfm.app.databinding.ActivityMainBinding;

public class MainActivity extends AppCompatActivity {
private ActivityMainBinding binding;

private ActivityMainBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
DynamicColors.applyToActivityIfAvailable(this);
binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
Switch darkModeSwitch = findViewById(R.id.darkModeSwitch);
darkModeSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> {
AppCompatDelegate.setDefaultNightMode(
isChecked
? AppCompatDelegate.MODE_NIGHT_YES
: AppCompatDelegate.MODE_NIGHT_NO
);
});
}
binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
}

@Override
protected void onDestroy() {
Expand Down
44 changes: 0 additions & 44 deletions app/src/main/res/drawable-v24/ic_launcher_foreground.xml

This file was deleted.

205 changes: 0 additions & 205 deletions app/src/main/res/drawable/ic_launcher_background.xml

This file was deleted.

Binary file added app/src/main/res/drawable/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/theme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/font/exo2.ttf
Binary file not shown.
104 changes: 68 additions & 36 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,42 +1,74 @@
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:textSize="16sp">
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="match_parent"
android:padding="24dp"
android:background="?attr/colorSurface">

<com.google.android.material.card.MaterialCardView
android:id="@+id/cardView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:padding="16dp"
app:cardCornerRadius="16dp"
app:cardElevation="8dp"
app:cardBackgroundColor="?attr/colorSurface"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">

<ImageView
android:id="@+id/appIcon"
android:layout_width="64dp"
android:layout_height="64dp"
android:contentDescription="@string/app_name"
android:src="@mipmap/ic_launcher"
android:layout_marginTop="16dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<ImageView
android:id="@+id/appIcon"
android:layout_width="80dp"
android:layout_height="80dp"
android:contentDescription="@string/app_name"
android:src="@drawable/icon"
android:layout_gravity="center"
android:tint="?attr/colorPrimary" />
</com.google.android.material.card.MaterialCardView>

<com.google.android.material.textview.MaterialTextView
android:id="@+id/appName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textAppearance="?attr/textAppearanceHeadline6"
android:fontFamily="sans-serif-medium"
android:textStyle="bold"
android:layout_marginTop="16dp"
app:layout_constraintTop_toBottomOf="@id/cardView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:textColor="?attr/colorOnSurface" />

<com.google.android.material.textview.MaterialTextView
android:id="@+id/appName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textSize="20sp"
android:textStyle="bold"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/appIcon"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />

<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/darkModeSwitch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginEnd="12dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/appDetails"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_details"
android:textAppearance="?attr/textAppearanceBody1"
android:fontFamily="sans-serif"
android:lineSpacingExtra="4dp"
android:layout_marginTop="8dp"
android:paddingHorizontal="24dp"
app:layout_constraintTop_toBottomOf="@id/appName"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:textColor="?attr/colorOnSurfaceVariant" />
<com.google.android.material.button.MaterialButton
android:id="@+id/getStartedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Get Started"
style="@style/Widget.MaterialComponents.Button"
app:cornerRadius="50dp"
android:layout_marginTop="24dp"
app:layout_constraintTop_toBottomOf="@id/appDetails"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:textColor="?attr/colorOnPrimary" />

</androidx.constraintlayout.widget.ConstraintLayout>
Loading

0 comments on commit 545348e

Please sign in to comment.