-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3393528
commit 163fda7
Showing
8 changed files
with
1,393 additions
and
0 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
app/src/main/java/com/modarb/android/ui/menu/activities/AppAppearanceActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.modarb.android.ui.menu.activities | ||
|
||
import android.content.Intent | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import android.view.View | ||
import android.widget.CheckBox | ||
import com.modarb.android.R | ||
|
||
class AppAppearanceActivity : AppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_app_appearance) | ||
|
||
val imageView = findViewById<View>(R.id.backButton) | ||
imageView.setOnClickListener { | ||
val intent = Intent(this, SettingActivity::class.java) | ||
startActivity(intent) | ||
} | ||
|
||
|
||
val checkBoxSystemDefault = findViewById<CheckBox>(R.id.checkBoxSystemDefault) | ||
val checkBoxLightTheme = findViewById<CheckBox>(R.id.checkBoxLightTheme) | ||
val checkBoxDarkTheme = findViewById<CheckBox>(R.id.checkBoxDarkTheme) | ||
|
||
checkBoxSystemDefault.setOnClickListener { | ||
if (checkBoxSystemDefault.isChecked) { | ||
checkBoxLightTheme.isChecked = false | ||
checkBoxDarkTheme.isChecked = false | ||
checkBoxSystemDefault.setButtonDrawable(R.drawable.theme_checkbox) | ||
} else { | ||
checkBoxSystemDefault.buttonDrawable = null | ||
} | ||
} | ||
|
||
checkBoxLightTheme.setOnClickListener { | ||
if (checkBoxLightTheme.isChecked) { | ||
checkBoxSystemDefault.isChecked = false | ||
checkBoxDarkTheme.isChecked = false | ||
checkBoxLightTheme.setButtonDrawable(R.drawable.theme_checkbox) | ||
} else { | ||
checkBoxLightTheme.buttonDrawable = null | ||
} | ||
} | ||
|
||
checkBoxDarkTheme.setOnClickListener { | ||
if (checkBoxDarkTheme.isChecked) { | ||
checkBoxSystemDefault.isChecked = false | ||
checkBoxLightTheme.isChecked = false | ||
checkBoxDarkTheme.setButtonDrawable(R.drawable.theme_checkbox) | ||
} else { | ||
checkBoxDarkTheme.buttonDrawable = null | ||
} | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/modarb/android/ui/menu/activities/NotificationActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.modarb.android.ui.menu.activities | ||
|
||
import android.content.Intent | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import android.view.View | ||
import com.modarb.android.R | ||
import com.modarb.android.ui.home.HomeActivity | ||
|
||
class NotificationActivity : AppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_notification) | ||
|
||
val imageView = findViewById<View>(R.id.backButton) | ||
imageView.setOnClickListener { | ||
val intent = Intent(this, HomeActivity::class.java) | ||
startActivity(intent) | ||
} | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
app/src/main/java/com/modarb/android/ui/menu/activities/ReminderActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package com.modarb.android.ui.menu.activities | ||
|
||
import android.content.Intent | ||
import android.content.res.ColorStateList | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import android.view.View | ||
import androidx.core.content.ContextCompat | ||
import androidx.appcompat.widget.SwitchCompat | ||
import com.modarb.android.R | ||
|
||
class ReminderActivity : AppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_reminder) | ||
|
||
val imageView = findViewById<View>(R.id.backButton) | ||
imageView.setOnClickListener { | ||
val intent = Intent(this, MenuActivity::class.java) | ||
startActivity(intent) | ||
} | ||
|
||
val mealsSwitch: SwitchCompat = findViewById(R.id.mealsSwitch) | ||
val workoutSwitch: SwitchCompat = findViewById(R.id.workoutSwitch) | ||
val challengesSwitch: SwitchCompat = findViewById(R.id.challengesSwitch) | ||
val feedPostsSwitch: SwitchCompat = findViewById(R.id.feedPostsSwitch) | ||
|
||
|
||
mealsSwitch.setOnCheckedChangeListener { _, isChecked -> | ||
if (isChecked) { | ||
mealsSwitch.trackTintList = ColorStateList.valueOf(ContextCompat.getColor(this, R.color.green)) | ||
} else { | ||
mealsSwitch.trackTintList = ColorStateList.valueOf(ContextCompat.getColor(this, R.color.gray_75)) | ||
} | ||
} | ||
|
||
workoutSwitch.setOnCheckedChangeListener { _, isChecked -> | ||
if (isChecked) { | ||
workoutSwitch.trackTintList = ColorStateList.valueOf(ContextCompat.getColor(this, R.color.green)) | ||
} else { | ||
workoutSwitch.trackTintList = ColorStateList.valueOf(ContextCompat.getColor(this, R.color.gray_75)) | ||
} | ||
} | ||
|
||
challengesSwitch.setOnCheckedChangeListener { _, isChecked -> | ||
if (isChecked) { | ||
challengesSwitch.trackTintList = ColorStateList.valueOf(ContextCompat.getColor(this, R.color.green)) | ||
} else { | ||
challengesSwitch.trackTintList = ColorStateList.valueOf(ContextCompat.getColor(this, R.color.gray_75)) | ||
} | ||
} | ||
|
||
feedPostsSwitch.setOnCheckedChangeListener { _, isChecked -> | ||
if (isChecked) { | ||
feedPostsSwitch.trackTintList = ColorStateList.valueOf(ContextCompat.getColor(this, R.color.green)) | ||
} else { | ||
feedPostsSwitch.trackTintList = ColorStateList.valueOf(ContextCompat.getColor(this, R.color.gray_75)) | ||
} | ||
} | ||
|
||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
app/src/main/java/com/modarb/android/ui/menu/activities/SettingActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.modarb.android.ui.menu.activities | ||
|
||
import android.content.Intent | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import android.view.View | ||
import com.modarb.android.R | ||
|
||
class SettingActivity : AppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_setting) | ||
|
||
val imageView = findViewById<View>(R.id.backButton) | ||
imageView.setOnClickListener { | ||
val intent = Intent(this, MenuActivity::class.java) | ||
startActivity(intent) | ||
} | ||
val cardView = findViewById<View>(R.id.appAppearanceCardView) | ||
cardView.setOnClickListener { | ||
startActivity(Intent(this, AppAppearanceActivity::class.java)) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
<?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" | ||
android:background="@color/black" | ||
tools:context=".ui.menu.activities.NotificationActivity"> | ||
|
||
|
||
<ImageView | ||
android:id="@+id/backButton" | ||
android:layout_width="70dp" | ||
android:layout_height="50dp" | ||
android:layout_marginStart="4dp" | ||
android:layout_marginTop="20dp" | ||
android:scaleType="center" | ||
android:src="@drawable/baseline_arrow_back_24" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
tools:ignore="ContentDescription" /> | ||
|
||
<TextView | ||
android:id="@+id/textView" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="20dp" | ||
android:fontFamily="@font/montserrat" | ||
android:padding="8dp" | ||
android:text="@string/app_appearance" | ||
android:textColor="@color/secondary_200" | ||
android:textSize="24sp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.312" | ||
app:layout_constraintStart_toEndOf="@+id/backButton" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<View | ||
android:id="@+id/lineView" | ||
android:layout_width="380dp" | ||
android:layout_height="2dp" | ||
android:layout_marginTop="4dp" | ||
android:background="@color/grey_400" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/textView" /> | ||
|
||
<TextView | ||
android:id="@+id/textView2" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="24dp" | ||
android:layout_marginTop="32dp" | ||
android:gravity="start" | ||
android:text="@string/select_theme" | ||
android:textColor="@color/gray_92" | ||
android:textSize="20sp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.0" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/textView" /> | ||
|
||
<androidx.cardview.widget.CardView | ||
android:id="@+id/systemDefaultCardView" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="16dp" | ||
android:layout_marginTop="12dp" | ||
android:layout_marginEnd="16dp" | ||
android:backgroundTint="@color/gray_700" | ||
android:clipToPadding="true" | ||
app:cardCornerRadius="15dp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/textView2"> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<TextView | ||
android:id="@+id/textView3" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="24dp" | ||
android:layout_marginTop="12dp" | ||
android:layout_marginBottom="12dp" | ||
android:gravity="start" | ||
android:text="@string/system_default" | ||
android:textColor="@color/gray_92" | ||
android:textSize="20sp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.0" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<CheckBox | ||
android:id="@+id/checkBoxSystemDefault" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="8dp" | ||
android:button="@drawable/theme_checkbox" | ||
android:textColor="@color/white" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="1.0" | ||
app:layout_constraintStart_toEndOf="@+id/textView3" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</androidx.cardview.widget.CardView> | ||
|
||
|
||
<androidx.cardview.widget.CardView | ||
android:id="@+id/lightThemCardView" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="16dp" | ||
android:layout_marginTop="12dp" | ||
android:layout_marginEnd="16dp" | ||
android:backgroundTint="@color/gray_700" | ||
android:clipToPadding="true" | ||
app:cardCornerRadius="15dp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/systemDefaultCardView"> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<TextView | ||
android:id="@+id/textView4" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="24dp" | ||
android:layout_marginTop="12dp" | ||
android:layout_marginBottom="12dp" | ||
android:gravity="start" | ||
android:text="@string/light_theme" | ||
android:textColor="@color/gray_92" | ||
android:textSize="20sp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.0" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<CheckBox | ||
android:id="@+id/checkBoxLightTheme" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="8dp" | ||
android:button="@drawable/theme_checkbox" | ||
android:textColor="@color/white" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="1.0" | ||
app:layout_constraintStart_toEndOf="@+id/textView4" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</androidx.cardview.widget.CardView> | ||
|
||
<androidx.cardview.widget.CardView | ||
android:id="@+id/darkThemCardView" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="16dp" | ||
android:layout_marginTop="12dp" | ||
android:layout_marginEnd="16dp" | ||
android:backgroundTint="@color/gray_700" | ||
android:clipToPadding="true" | ||
app:cardCornerRadius="15dp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/lightThemCardView"> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<TextView | ||
android:id="@+id/textView5" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="24dp" | ||
android:layout_marginTop="12dp" | ||
android:layout_marginBottom="12dp" | ||
android:gravity="start" | ||
android:text="@string/dark_theme" | ||
android:textColor="@color/gray_92" | ||
android:textSize="20sp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.0" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<CheckBox | ||
android:id="@+id/checkBoxDarkTheme" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="8dp" | ||
android:button="@drawable/theme_checkbox" | ||
android:textColor="@color/white" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="1.0" | ||
app:layout_constraintStart_toEndOf="@+id/textView5" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</androidx.cardview.widget.CardView> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
Oops, something went wrong.