Skip to content

Commit 8603145

Browse files
committed
1.0 v beta
1 parent d0ace2e commit 8603145

18 files changed

+76
-111
lines changed

.gradle/8.0/checksums/checksums.lock

0 Bytes
Binary file not shown.
2.15 KB
Binary file not shown.
7.17 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

.gradle/8.0/fileHashes/fileHashes.bin

4.98 KB
Binary file not shown.
0 Bytes
Binary file not shown.
680 Bytes
Binary file not shown.
Binary file not shown.
317 KB
Binary file not shown.

.gradle/file-system.probe

0 Bytes
Binary file not shown.

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'com.android.application'
33
id 'org.jetbrains.kotlin.android'
4+
id 'com.google.gms.google-services'
45
}
56

67
android {

app/src/main/AndroidManifest.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
77
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
88
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
9-
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" tools:ignore="ScopedStorage" />
10-
11-
9+
<uses-permission
10+
android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
11+
tools:ignore="ScopedStorage" />
1212

1313
<queries>
1414
<package android:name="org.telegram.messenger" />
@@ -24,6 +24,9 @@
2424
android:supportsRtl="true"
2525
android:theme="@style/Theme.ToDoList"
2626
tools:targetApi="31">
27+
<activity
28+
android:name=".signupActivity"
29+
android:exported="false" />
2730
<activity
2831
android:name=".ViewTasksActivity"
2932
android:exported="false"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.zerodev.todo
2+
3+
import androidx.appcompat.app.AppCompatActivity
4+
import android.os.Bundle
5+
6+
class signupActivity : AppCompatActivity() {
7+
override fun onCreate(savedInstanceState: Bundle?) {
8+
super.onCreate(savedInstanceState)
9+
setContentView(R.layout.activity_signup)
10+
}
11+
}

app/src/main/java/com/zerodev/todo/ui/settings/SettingsFragment.kt

Lines changed: 7 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
44
import android.app.AlertDialog
55
import android.content.Context
66
import android.content.DialogInterface
7+
import android.content.Intent
78
import android.content.SharedPreferences
89
import android.graphics.Color
910
import android.os.Bundle
@@ -17,8 +18,11 @@ import androidx.fragment.app.Fragment
1718
import androidx.lifecycle.ViewModelProvider
1819
import com.anggrayudi.storage.SimpleStorageHelper
1920
import com.google.android.material.snackbar.Snackbar
21+
import com.google.firebase.FirebaseApp
22+
import com.google.firebase.auth.FirebaseAuth
2023
import com.zerodev.todo.Data.NotifSounds
2124
import com.zerodev.todo.databinding.FragmentSettingsBinding
25+
import com.zerodev.todo.signupActivity
2226
import java.io.File
2327
import java.io.FileOutputStream
2428
import java.io.IOException
@@ -50,6 +54,8 @@ class SettingsFragment : Fragment() {
5054
val settingsPref = context?.getSharedPreferences("settings", Context.MODE_PRIVATE)
5155
val notifSounds = context?.let { NotifSounds(it) }
5256
val notifSoundArray = notifSounds?.soundArray
57+
val intent = Intent(this.requireContext(), signupActivity::class.java)
58+
startActivity(intent)
5359
if (settingsPref != null) {
5460
settingsViewModel.setSharedPref(settingsPref)
5561
}
@@ -65,27 +71,8 @@ class SettingsFragment : Fragment() {
6571
" ${notifImportance[settingsPref.getInt("notifImportance", 0)]}"
6672
}
6773
// backup list click
68-
binding.backuplist.setOnClickListener {
69-
/*
70-
if (ContextCompat.checkSelfPermission(
71-
requireContext(),
72-
Manifest.permission.WRITE_EXTERNAL_STORAGE
73-
) != PackageManager.PERMISSION_GRANTED
74-
) {
75-
ActivityCompat.requestPermissions(
76-
requireActivity(),
77-
arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE),
78-
WRITE_EXTERNAL_STORAGE_REQUEST_CODE
79-
)
80-
} else {
81-
saveToFile("it worked")
82-
}
83-
84-
*/
8574

8675

87-
}
88-
8976
// notif sound click listener
9077
binding.notifSound.setOnClickListener {
9178
//set notification sound
@@ -126,7 +113,7 @@ class SettingsFragment : Fragment() {
126113
notifImportance,
127114
settingsPref.getInt("notifImportance", 0)
128115
) { dialog, index ->
129-
settingsPref?.edit()?.putInt("notifImportance", index)
116+
settingsPref.edit()?.putInt("notifImportance", index)
130117
?.apply()
131118
val snackbar = view?.let { it1 ->
132119
Snackbar.make(
@@ -161,44 +148,9 @@ class SettingsFragment : Fragment() {
161148
}
162149
}
163150

164-
private fun saveToFile(text: String) {
165-
val directoryPath =
166-
Environment.getExternalStorageDirectory().absolutePath + "/TodoList/Backup"
167-
val fileName = "Backup.json"
168-
169-
val directory = File(directoryPath)
170-
171-
if (!directory.exists()) {
172-
directory.mkdirs() // Create the directory if it doesn't exist
173-
}
174151

175-
val file = File(directory, fileName)
176152

177-
try {
178-
file.createNewFile()
179153

180-
val fileOutputStream = FileOutputStream(file)
181-
fileOutputStream.write(text.toByteArray())
182-
fileOutputStream.close()
183-
184-
// File saved successfully
185-
Toast.makeText(requireContext(), "File saved successfully", Toast.LENGTH_SHORT).show()
186-
} catch (e: IOException) {
187-
e.printStackTrace()
188-
// Handle the exception
189-
Toast.makeText(requireContext(), "Error saving file", Toast.LENGTH_SHORT).show()
190-
}
191-
}
192-
193-
private fun checkPermission(): Boolean {
194-
var permissionGranted = false
195-
registerForActivityResult(
196-
ActivityResultContracts.RequestPermission()
197-
) { isGranted: Boolean ->
198-
permissionGranted = isGranted
199-
}
200-
return permissionGranted
201-
}
202154

203155

204156
override fun onDestroyView() {
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
tools:context=".signupActivity">
8+
9+
<TextView
10+
android:id="@+id/textView11"
11+
android:layout_width="wrap_content"
12+
android:layout_height="wrap_content"
13+
android:text="Sign Up to Todo List"
14+
android:textSize="30sp"
15+
app:layout_constraintBottom_toBottomOf="parent"
16+
app:layout_constraintEnd_toEndOf="parent"
17+
app:layout_constraintStart_toStartOf="parent"
18+
app:layout_constraintTop_toTopOf="parent"
19+
app:layout_constraintVertical_bias="0.104" />
20+
21+
<TextView
22+
android:id="@+id/textView12"
23+
android:layout_width="wrap_content"
24+
android:layout_height="wrap_content"
25+
android:text="By Signing up , you will agree to our Privacy Policy"
26+
android:textSize="16sp"
27+
app:layout_constraintBottom_toBottomOf="parent"
28+
app:layout_constraintEnd_toEndOf="parent"
29+
app:layout_constraintHorizontal_bias="0.498"
30+
app:layout_constraintStart_toStartOf="parent"
31+
app:layout_constraintTop_toBottomOf="@+id/textView11"
32+
app:layout_constraintVertical_bias="0.048" />
33+
34+
<com.google.android.gms.common.SignInButton
35+
android:id="@+id/sign_in_button"
36+
android:layout_width="match_parent"
37+
android:layout_height="50dp"
38+
android:layout_margin="50dp"
39+
app:layout_constraintBottom_toBottomOf="parent"
40+
app:layout_constraintEnd_toEndOf="parent"
41+
app:layout_constraintHorizontal_bias="0.494"
42+
app:layout_constraintStart_toStartOf="parent"
43+
app:layout_constraintTop_toBottomOf="@+id/textView12"
44+
app:layout_constraintVertical_bias="0.519" />
45+
46+
</androidx.constraintlayout.widget.ConstraintLayout>

app/src/main/res/layout/fragment_settings.xml

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -20,58 +20,6 @@
2020
android:layout_height="wrap_content"
2121
android:orientation="vertical">
2222

23-
<TextView
24-
android:layout_width="match_parent"
25-
android:layout_height="wrap_content"
26-
android:layout_margin="5dp"
27-
android:text="Backup"
28-
android:textColor="@color/black"
29-
android:textSize="18sp" />
30-
31-
<androidx.constraintlayout.widget.ConstraintLayout
32-
android:id="@+id/backuplist"
33-
android:layout_width="match_parent"
34-
android:layout_height="50dp"
35-
android:layout_margin="5dp"
36-
android:background="@drawable/settings_items_back"
37-
android:padding="10dp">
38-
39-
<TextView
40-
android:layout_width="wrap_content"
41-
android:layout_height="wrap_content"
42-
android:text="Backup todo List to device"
43-
android:textColor="@color/white"
44-
android:textSize="20dp"
45-
app:layout_constraintBottom_toBottomOf="parent"
46-
app:layout_constraintEnd_toEndOf="parent"
47-
app:layout_constraintHorizontal_bias="0.049"
48-
app:layout_constraintStart_toStartOf="parent"
49-
app:layout_constraintTop_toTopOf="parent"
50-
app:layout_constraintVertical_bias="0.516" />
51-
</androidx.constraintlayout.widget.ConstraintLayout>
52-
53-
<androidx.constraintlayout.widget.ConstraintLayout
54-
android:layout_width="match_parent"
55-
android:layout_height="50dp"
56-
android:layout_margin="5dp"
57-
android:background="@drawable/settings_items_back"
58-
android:padding="10dp">
59-
60-
<TextView
61-
android:id="@+id/textView6"
62-
android:layout_width="wrap_content"
63-
android:layout_height="wrap_content"
64-
android:text="Recover todo List to device"
65-
android:textColor="@color/white"
66-
android:textSize="20dp"
67-
app:layout_constraintBottom_toBottomOf="parent"
68-
app:layout_constraintEnd_toEndOf="parent"
69-
app:layout_constraintHorizontal_bias="0.049"
70-
app:layout_constraintStart_toStartOf="parent"
71-
app:layout_constraintTop_toTopOf="parent"
72-
app:layout_constraintVertical_bias="0.516" />
73-
</androidx.constraintlayout.widget.ConstraintLayout>
74-
7523
<TextView
7624
android:layout_width="match_parent"
7725
android:layout_height="wrap_content"

build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
1+
buildscript {
2+
dependencies {
3+
classpath 'com.google.gms:google-services:4.4.0'
4+
}
5+
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
26
plugins {
37
id 'com.android.application' version '7.3.1' apply false
48
id 'org.jetbrains.kotlin.android' version '1.9.0' apply false

0 commit comments

Comments
 (0)