Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
android:supportsRtl="true"
android:theme="@style/Theme.SyncVision"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
53 changes: 53 additions & 0 deletions app/src/main/java/com/example/syncvision/MainActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.example.syncvision;

import android.os.Bundle;
import android.view.View;
import android.widget.Switch;
import androidx.activity.EdgeToEdge;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class MainActivity extends AppCompatActivity {

private Switch switch_btn;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this);
setContentView(R.layout.activity_main);

switch_btn = findViewById(R.id.switcher); // Initialize the Switch

// Apply window insets listener to adjust padding
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets;
});

// Set click listener for the switch
switch_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
toggleNightMode();
}
});
}

private void toggleNightMode() {
boolean isNightModeOn = AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_YES;

if (isNightModeOn) {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
switch_btn.setText("Enable Dark Mode");
} else {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
switch_btn.setText("Disable Dark Mode");
}
}
}
4 changes: 4 additions & 0 deletions app/src/main/res/color/dark_primary_dark_color.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

</selector>
4 changes: 4 additions & 0 deletions app/src/main/res/color/grey_2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

</selector>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/baseline_account_circle_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#00BCD4" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">

<path android:fillColor="@color/teal_200" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,5c1.66,0 3,1.34 3,3s-1.34,3 -3,3 -3,-1.34 -3,-3 1.34,-3 3,-3zM12,19.2c-2.5,0 -4.71,-1.28 -6,-3.22 0.03,-1.99 4,-3.08 6,-3.08 1.99,0 5.97,1.09 6,3.08 -1.29,1.94 -3.5,3.22 -6,3.22z"/>

</vector>
187 changes: 187 additions & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
<?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"
tools:ignore="ExtraText">

<Switch
android:id="@+id/switcher"
android:layout_width="50dp"
android:layout_height="50dp"
android:gravity="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/imageView"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />


<TextView
android:id="@+id/textView"
style="@style/Input"

android:layout_width="wrap_content"
android:layout_height="wrap_content"

android:text="@string/signup_str"
android:textSize="34sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.336" />

<ImageView
android:id="@+id/imageView"
style="@style/Input"
android:layout_width="286dp"

android:layout_height="155dp"
app:layout_constraintBottom_toTopOf="@+id/textView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.496"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.901"
app:srcCompat="@drawable/baseline_account_circle_24" />

<EditText
android:id="@+id/editTextTextPassword"
style="@style/Input"
android:layout_width="256dp"
android:layout_height="60dp"
android:layout_marginBottom="292dp"
android:ems="10"
android:hint="@string/enter_password"

android:inputType="textPassword"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.896"
app:layout_constraintStart_toStartOf="parent" />

<EditText
android:id="@+id/editTextTextPassword2"
style="@style/Input"

android:layout_width="256dp"
android:layout_height="60dp"
android:ems="10"
android:hint="@string/password2"
android:inputType="textPassword"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.896"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editTextTextPassword"
app:layout_constraintVertical_bias="0.0" />


<Button
android:id="@+id/button"
style="@style/Input"
android:layout_width="167dp"
android:layout_height="82dp"
android:background="@color/grey"
android:hint="@string/sign_up"
android:textColor="#E6EDF3"
android:textColorHint="#F6F3F3"
android:textColorLink="#AA362D"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editTextTextPassword2"
app:layout_constraintVertical_bias="0.0" />

<TextView
android:id="@+id/textView6"
style="@style/Input"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/have_account"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

app:layout_constraintTop_toBottomOf="@+id/button"
app:layout_constraintVertical_bias="0.0" />

<EditText
android:id="@+id/editTextText2"
style="@style/Input"
android:layout_width="256dp"
android:layout_height="60dp"
android:hint="@string/last_name"
android:inputType="text"
app:layout_constraintBottom_toTopOf="@+id/editTextTextPassword"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.896"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView"
app:layout_constraintVertical_bias="1.0" />

<EditText
android:id="@+id/editTextText3"
style="@style/Input"
android:layout_width="256dp"
android:layout_height="60dp"
android:layout_marginBottom="8dp"
android:ems="10"
android:hint="@string/first_name"

android:inputType="text"
app:layout_constraintBottom_toTopOf="@+id/editTextText2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.903"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView"
app:layout_constraintVertical_bias="1.0" />

<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/editTextTextPassword"
app:layout_constraintHorizontal_bias="0.9"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/switcher"
app:layout_constraintVertical_bias="0.575"
app:srcCompat="@drawable/lock" />

<ImageView
android:id="@+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/editTextTextPassword2"
app:layout_constraintHorizontal_bias="0.9"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.681"
app:srcCompat="@drawable/lock" />

<EditText
android:id="@+id/editTextText"
android:layout_width="105dp"
android:layout_height="50dp"
android:ems="10"
android:hint="@string/sign_login"
android:inputType="text"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView6"
app:layout_constraintVertical_bias="0.0" />

</androidx.constraintlayout.widget.ConstraintLayout>
2 changes: 2 additions & 0 deletions app/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>


</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
<color name="white">#FFFFFFFF</color>
<color name="purple_main">#6C63FF</color>
<color name="grey">#979A9A</color>
<color name="grey_2">#ced4da</color>

</resources>
7 changes: 7 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@
<string name="start_body">Where ideas transform into reality, connections flourish, and creativity knows no limits.</string>
<string name="start_btn">Let`s get started!</string>
<string name="login_str">Let`s get you Login!</string>
<string name="signup_str">Sign Here</string>
<string name="login_text">Enter Information below</string>
<string name="enter_email">Enter Email</string>
<string name="enter_password">Enter Password</string>
<string name="recover_password">Recover Password?</string>
<string name="sign_in">Sign In</string>
<string name="sign_up">Sign Up</string>
<string name="don_t_have_an_account">Don`t have an account?</string>
<string name="have_account">Already have an account? </string>
<string name="sign_login">Login Here</string>
<string name="let_s_register">Let`s Register</string>
<string name="first_name">Enter FirstName</string>
<string name="last_name">Enter LastName</string>
<string name="password2">Confirm Password</string>
</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
<item name="android:background">@drawable/round_grey</item>
<item name="android:layout_marginHorizontal">30dp</item>
<item name="android:drawablePadding">5dp</item>

</style>
<!-- Base application theme. -->

</resources>
4 changes: 4 additions & 0 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
<!--light mode -->
</style>
<!-- Base application theme. -->


</resources>