? = null
148 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | # About
16 |
17 | The Algo Guide is an educative android app for studying data structures and algorithms. The app includes algorithm concepts and uses simple visual elements like charts, and other visual elements to simplify the understanding of the working of each algorithm like searching, sorting, etc. The app will also be included with code simultaneously to understand the concepts.
18 |
19 | # General Info
20 |
21 | - Different algorithm concepts
22 | - Visualise the best way to make it understandable
23 | - Embedded code to each algorithm concepts
24 | - Making user interface using Jetpack Compose
25 | - Implementing ViewModel concepts
26 |
27 |
28 | # Project Status
29 |
30 | 🚧🚧 Project is: In progress. check out the progress
31 |
32 |
33 | ## Tech stack
34 |
35 |
36 |
37 | | Mobile OS |
38 | Android |
39 |
40 |
41 | | Architecture |
42 | Clean Architecture |
43 |
44 |
45 | | Programming Language |
46 | Kotlin |
47 |
48 |
49 | | Database |
50 | Room |
51 |
52 |
53 | | API |
54 | DSA API |
55 |
56 |
57 | | UI Framework |
58 | Jetpack compose |
59 |
60 |
61 | | Push Notification |
62 | Firebase |
63 |
64 |
65 |
66 | ## Feature List
67 |
68 | - Offline access to lesson
69 | - Track lessen progress
70 | - Daily Goal setting and updating
71 | - Daily remainder setting and updating
72 | - Streak Count
73 | - Showing topic covered count
74 | - Showing lessen covered count
75 | - Showing new notification
76 | - Daily goal reached or not progress
77 |
78 | ## Wireframe
79 |
80 | The wireframes are designed using figma. You can view the wireframe by clicking [here](https://www.figma.com/file/hMSxpTN6UzOrkMeWLa5ofY/Algo-Guide-(Copy)?node-id=0%3A1)
81 |
82 | ## Colors
83 |
84 |
85 |
86 | | #17A1FA |
87 | #02F054 |
88 | #C7D909 |
89 | #F09A02 |
90 | #E61902 |
91 |
92 |
93 |
94 | ## Typography
95 |
96 | - Poppins
97 | - Roboto
98 |
99 | ## Prototype
100 |
101 | For getting details about prototype check out [here](https://www.figma.com/file/hMSxpTN6UzOrkMeWLa5ofY/Algo-Guide-(Copy)?node-id=128%3A98)
102 |
103 | ## Structure the app course
104 |
105 |
106 | ## To Do
107 |
108 | - [ ] API Development
109 | - [ ] Designing using jetpack compose
110 | - [ ] Ds And Algorithm codes - Check out the [ToDo.md](https://github.com/kodeflap/Algo_Guide/blob/master/ToDo.md)
111 | - [ ] Development
112 | - [ ] Unit Testing
113 |
114 | # Getting Started
115 |
116 | ## Prerequisites
117 |
118 | You need to know a basic understanding of
119 |
120 | - Android Fundamentals.
121 | - Kotlin language.
122 | - Clean architecture
123 | - Coroutines
124 |
125 | So let's get started.
126 |
127 | 1. Install Android studio
128 | 2. Install Android SDK(28)
129 |
130 | ### Installation
131 |
132 | 1. Fork the repo
133 | 2. Clone the repo
134 | 3. Start a new project as import from Version Control in android studio and paste the clone URL and finish.
135 | 4. Run your application.
136 |
137 | ## Contributing
138 |
139 | Contributions are always welcome!
140 | Contributions are what make the open-source project amazing. Which helps to learn, inspire, and found new modes in the development phase of a coder. Any contribution to this project is greatly appreciated.
141 | If you have any suggestion or found any issues please free to put your suggestion.
142 |
143 |
144 | If you like to contribute to the project you can check the [CONTRIBUTING.md](https://github.com/kodeflap/Algo_Guide/blob/master/CONTRIBUTING.md) to know how to contribute to the projet.
145 |
146 | That's all
147 |
148 | ## 💭 Needed any help and how to contact
149 |
150 | The project has also discussion section you can discuss an issue or can share your ideas. Let's make it as great
151 |
152 | Also check out the [discord](https://discord.gg/8zdFPzQh) to disucuss
153 |
154 | # Contributors
155 |
156 |
157 |
158 |
159 |
160 | Made with [contrib.rocks](https://contrib.rocks).
161 |
162 | # License
163 |
164 | [Apache license](LICENSE)
165 |
166 |
167 |
168 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | We as members, contributors, and leaders pledge to make participation in our
6 | community a harassment-free experience for everyone, regardless of age, body
7 | size, visible or invisible disability, ethnicity, sex characteristics, gender
8 | identity and expression, level of experience, education, socio-economic status,
9 | nationality, personal appearance, race, religion, or sexual identity
10 | and orientation.
11 |
12 | We pledge to act and interact in ways that contribute to an open, welcoming,
13 | diverse, inclusive, and healthy community.
14 |
15 | ## Our Standards
16 |
17 | Examples of behavior that contributes to a positive environment for our
18 | community include:
19 |
20 | * Demonstrating empathy and kindness toward other people
21 | * Being respectful of differing opinions, viewpoints, and experiences
22 | * Giving and gracefully accepting constructive feedback
23 | * Accepting responsibility and apologizing to those affected by our mistakes,
24 | and learning from the experience
25 | * Focusing on what is best not just for us as individuals, but for the
26 | overall community
27 |
28 | Examples of unacceptable behavior include:
29 |
30 | * The use of sexualized language or imagery, and sexual attention or
31 | advances of any kind
32 | * Trolling, insulting or derogatory comments, and personal or political attacks
33 | * Public or private harassment
34 | * Publishing others' private information, such as a physical or email
35 | address, without their explicit permission
36 | * Other conduct which could reasonably be considered inappropriate in a
37 | professional setting
38 |
39 | ## Enforcement Responsibilities
40 |
41 | Community leaders are responsible for clarifying and enforcing our standards of
42 | acceptable behavior and will take appropriate and fair corrective action in
43 | response to any behavior that they deem inappropriate, threatening, offensive,
44 | or harmful.
45 |
46 | Community leaders have the right and responsibility to remove, edit, or reject
47 | comments, commits, code, wiki edits, issues, and other contributions that are
48 | not aligned to this Code of Conduct, and will communicate reasons for moderation
49 | decisions when appropriate.
50 |
51 | ## Scope
52 |
53 | This Code of Conduct applies within all community spaces, and also applies when
54 | an individual is officially representing the community in public spaces.
55 | Examples of representing our community include using an official e-mail address,
56 | posting via an official social media account, or acting as an appointed
57 | representative at an online or offline event.
58 |
59 | ## Enforcement
60 |
61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
62 | reported to the community leaders responsible for enforcement at
63 | kodeflap@gmail.com.
64 | All complaints will be reviewed and investigated promptly and fairly.
65 |
66 | All community leaders are obligated to respect the privacy and security of the
67 | reporter of any incident.
68 |
69 | ## Enforcement Guidelines
70 |
71 | Community leaders will follow these Community Impact Guidelines in determining
72 | the consequences for any action they deem in violation of this Code of Conduct:
73 |
74 | ### 1. Correction
75 |
76 | **Community Impact**: Use of inappropriate language or other behavior deemed
77 | unprofessional or unwelcome in the community.
78 |
79 | **Consequence**: A private, written warning from community leaders, providing
80 | clarity around the nature of the violation and an explanation of why the
81 | behavior was inappropriate. A public apology may be requested.
82 |
83 | ### 2. Warning
84 |
85 | **Community Impact**: A violation through a single incident or series
86 | of actions.
87 |
88 | **Consequence**: A warning with consequences for continued behavior. No
89 | interaction with the people involved, including unsolicited interaction with
90 | those enforcing the Code of Conduct, for a specified period of time. This
91 | includes avoiding interactions in community spaces as well as external channels
92 | like social media. Violating these terms may lead to a temporary or
93 | permanent ban.
94 |
95 | ### 3. Temporary Ban
96 |
97 | **Community Impact**: A serious violation of community standards, including
98 | sustained inappropriate behavior.
99 |
100 | **Consequence**: A temporary ban from any sort of interaction or public
101 | communication with the community for a specified period of time. No public or
102 | private interaction with the people involved, including unsolicited interaction
103 | with those enforcing the Code of Conduct, is allowed during this period.
104 | Violating these terms may lead to a permanent ban.
105 |
106 | ### 4. Permanent Ban
107 |
108 | **Community Impact**: Demonstrating a pattern of violation of community
109 | standards, including sustained inappropriate behavior, harassment of an
110 | individual, or aggression toward or disparagement of classes of individuals.
111 |
112 | **Consequence**: A permanent ban from any sort of public interaction within
113 | the community.
114 |
115 | ## Attribution
116 |
117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118 | version 2.0, available at
119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120 |
121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct
122 | enforcement ladder](https://github.com/mozilla/diversity).
123 |
124 | [homepage]: https://www.contributor-covenant.org
125 |
126 | For answers to common questions about this code of conduct, see the FAQ at
127 | https://www.contributor-covenant.org/faq. Translations are available at
128 | https://www.contributor-covenant.org/translations.
129 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dlight/algoguide/dsa/tree/heap/Heap.kt:
--------------------------------------------------------------------------------
1 | package com.dlight.algoguide.dsa.tree.heap
2 |
3 | import java.util.*
4 |
5 | object MinHeap {
6 | @JvmStatic
7 | fun main(args: Array) {
8 | val sc = Scanner(System.`in`)
9 | print("Enter the Heap Capacity: ")
10 | val hCap: Int = sc.nextInt()
11 | val hp = Min_Heap(hCap)
12 | var flag = true
13 | var `val` = 0
14 | while (flag) {
15 | println()
16 | println("0. Exit")
17 | println("1 - Insert an Element")
18 | println("2 - Display the Heap")
19 | println("3 - Height of the Heap")
20 | println("4 - Current Heap Size")
21 | println("5 - minExtract()")
22 | println("6 - Delete Key")
23 | println("7 - Heap Sort")
24 | print("Enter Your Choice: ")
25 | val ch: Int = sc.nextInt()
26 | when (ch) {
27 | 0 -> flag = false
28 | 1 -> {
29 | print("Enter Value to be Inserted: ")
30 | `val` = sc.nextInt()
31 | hp.insert(`val`)
32 | }
33 | 2 -> hp.display()
34 | 3 -> println(
35 | "Height of Heap Tree = " + (Math.ceil(
36 | Math.log((hp.hSize + 1).toDouble()) / Math.log(
37 | 2.0
38 | )
39 | ).toInt() - 1)
40 | )
41 | 4 -> println("The Size of the Heap is = " + hp.hSize)
42 | 5 -> println(hp.minExtract())
43 | 6 -> {
44 | print("Enter Key to be Deleted: ")
45 | `val` = sc.nextInt()
46 | hp.minDeleteKey(`val`)
47 | }
48 | 7 -> {
49 | hp.hSize = hp.hCap
50 | println("Enter Elements of Unsorted Array:")
51 | var i = 0
52 | while (i < hp.hCap) {
53 | hp.hArr[i] = sc.nextInt()
54 | i++
55 | }
56 | hp.heapSort(hp.hArr)
57 | }
58 | else -> println("Invalid Choice")
59 | }
60 | }
61 | }
62 | }
63 |
64 | internal class Min_Heap(var hCap: Int) {
65 | var hArr: IntArray
66 | var hSize = 0
67 |
68 | init {
69 | hArr = IntArray(hCap)
70 | }
71 |
72 | fun parent(i: Int): Int {
73 | return (i - 1) / 2
74 | }
75 |
76 | fun left(i: Int): Int {
77 | return 2 * i + 1
78 | }
79 |
80 | fun right(i: Int): Int {
81 | return 2 * i + 2
82 | }
83 |
84 | fun swap(currI: Int, swI: Int) { // currentIndex, swapIndex
85 | val temp = hArr[currI]
86 | hArr[currI] = hArr[swI]
87 | hArr[swI] = temp
88 | }
89 |
90 | // START 1 - Insert an Element
91 | fun insert(`val`: Int) {
92 | if (hSize == hCap) {
93 | println("Heap Overflow")
94 | return
95 | }
96 | println("Value Inserted in Heap")
97 | hSize++
98 | var i = hSize - 1
99 | hArr[i] = `val`
100 |
101 | // if the new inserted node is less than its parent then swap them
102 | while (i != 0 && hArr[i] < hArr[parent(i)]) {
103 | swap(i, parent(i))
104 | i = parent(i)
105 | }
106 | }
107 |
108 | // END 1 - Insert an Element
109 | // START 2 - Display the Heap
110 | fun display() {
111 | for (i in 0 until hSize) print(hArr[i].toString() + " ")
112 | }
113 |
114 | // END 2 - Display the Heap
115 | // START 5 - minExtract()
116 | fun minExtract(): Int {
117 | if (hSize <= 0) {
118 | println("Empty heap")
119 | return -99999
120 | }
121 | if (hSize == 1) {
122 | hSize--
123 | return hArr[0]
124 | }
125 | val root = hArr[0]
126 | hArr[0] = hArr[hSize - 1]
127 | hSize--
128 | minHeapify(0)
129 | return root
130 | }
131 |
132 | fun minHeapify(i: Int) {
133 | val l = left(i)
134 | val r = right(i)
135 | var smallest = i
136 | if (l < hSize && hArr[l] < hArr[smallest]) smallest = l
137 | if (r < hSize && hArr[r] < hArr[smallest]) smallest = r
138 | if (smallest != i) {
139 | swap(i, smallest)
140 | minHeapify(smallest)
141 | }
142 | }
143 |
144 | // END 5 - minExtract()
145 | // START 6 - Delete Key
146 | fun minDeleteKey(i: Int) {
147 | if (i >= hSize) {
148 | println("Enter valid key")
149 | return
150 | }
151 | decreaseKey(i, Int.MIN_VALUE)
152 | minExtract()
153 | println("Value Deleted")
154 | }
155 |
156 | // this () will set the value in deletingIndex with minimum value than will keep
157 | // on swapping that deletingIndex value with its parents until it reaches root
158 | // then minExtract() will be called to remove the root(which is
159 | // Integer.MIN_VALUE) and heapify
160 | fun decreaseKey(i: Int, minVal: Int) {
161 | var i = i
162 | hArr[i] = minVal
163 | while (i != 0 && hArr[i] < hArr[parent(i)]) {
164 | swap(i, parent(i))
165 | i = parent(i)
166 | }
167 | }
168 |
169 | // END 6 - Delete Key
170 | // START 7 - Heap Sort
171 | fun heapSort(unsortedArr: IntArray) {
172 | System.out.println(
173 | """
174 |
175 | Unsorted Array = ${Arrays.toString(unsortedArr)}
176 | """.trimIndent()
177 | )
178 |
179 | // this will convert array into a min-heap array from bottom to top
180 | for (i in unsortedArr.size / 2 - 1 downTo 0) {
181 | minHeapify(i)
182 | }
183 |
184 | // actual heap sort starts
185 | val sortedArr = IntArray(unsortedArr.size)
186 | for (i in sortedArr.indices) {
187 | sortedArr[i] = minExtract()
188 | }
189 | System.out.println("Sorted Array = " + Arrays.toString(sortedArr))
190 | } // END 7 - Heap Sort
191 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/dlight/algoguide/feature_onboarding/use_cases/OnboardingPager.kt:
--------------------------------------------------------------------------------
1 | package com.dlight.algoguide.composables.onboarding_screen
2 |
3 | import androidx.annotation.FloatRange
4 | import androidx.compose.animation.core.animateDpAsState
5 | import androidx.compose.foundation.Image
6 | import androidx.compose.foundation.background
7 | import androidx.compose.foundation.layout.*
8 | import androidx.compose.foundation.shape.CircleShape
9 | import androidx.compose.foundation.shape.RoundedCornerShape
10 | import androidx.compose.material.MaterialTheme
11 | import androidx.compose.material.MaterialTheme.colors
12 | import androidx.compose.material.OutlinedButton
13 | import androidx.compose.material.Text
14 | import androidx.compose.runtime.Composable
15 | import androidx.compose.runtime.saveable.rememberSaveable
16 | import androidx.compose.ui.Alignment
17 | import androidx.compose.ui.Modifier
18 | import androidx.compose.ui.draw.clip
19 | import androidx.compose.ui.graphics.Color
20 | import androidx.compose.ui.res.painterResource
21 | import androidx.compose.ui.text.font.FontWeight
22 | import androidx.compose.ui.text.style.TextAlign
23 | import androidx.compose.ui.unit.dp
24 | import androidx.compose.ui.unit.sp
25 | import com.dlight.algoguide.feature_onboarding.data.OnboardingData
26 | import com.google.accompanist.pager.ExperimentalPagerApi
27 | import com.google.accompanist.pager.HorizontalPager
28 | import com.google.accompanist.pager.PagerState
29 |
30 |
31 | @ExperimentalPagerApi
32 | @Composable
33 | fun OnboardingPager(
34 | item: List,
35 | pagerState: PagerState,
36 | modifier: Modifier = Modifier
37 | ) {
38 | Box(modifier = modifier) {
39 | Column(horizontalAlignment = Alignment.CenterHorizontally) {
40 | HorizontalPager(state = pagerState) { page ->
41 | Column(
42 | modifier = Modifier
43 | .padding(top = 60.dp)
44 | .fillMaxWidth(),
45 | horizontalAlignment = Alignment.CenterHorizontally
46 | ) {
47 | // Image(
48 | // // painter = painterResource(id = item[page].image),
49 | // contentDescription = item[page].title,
50 | // modifier = Modifier
51 | // .height(250.dp)
52 | // .fillMaxWidth()
53 | // )
54 | Text(
55 | text = item[page].title,
56 | modifier = Modifier.padding(top = 50.dp),
57 | color = Color.White
58 | )
59 | Text(
60 | text = item[page].description,
61 | modifier = Modifier.padding(top = 50.dp),
62 | color = Color.White,
63 | fontSize = 18.sp,
64 | textAlign = TextAlign.Center
65 | )
66 | }
67 | }
68 | PagerIndicator(item.size, pagerState.currentPage)
69 | }
70 | Box(modifier = Modifier.align(Alignment.BottomCenter)) {
71 | BottomSection(pagerState.currentPage)
72 | }
73 | }
74 | }
75 | @ExperimentalPagerApi
76 | @Composable
77 | fun RememberPagerState(
78 | @androidx.annotation.IntRange(from = 0) pageCount: Int,
79 | @androidx.annotation.IntRange(from = 0) initialPage: Int = 0,
80 | @FloatRange(from = 0.0, to = 1.0) initialPagerOffset: Float = 0f,
81 | @androidx.annotation.IntRange(from = 1) initialOffscreenLimit: Int = 1,
82 | infiniteLoop: Boolean = false
83 | ): PagerState = rememberSaveable(saver = PagerState.Saver) {
84 | PagerState(
85 | pageCount = pageCount,
86 | currentPage = initialPage,
87 | currentPageOffset = initialPagerOffset,
88 | offscreenLimit = initialOffscreenLimit,
89 | infiniteLoop = infiniteLoop
90 | )
91 | }
92 |
93 | @Composable
94 | fun Indicator(isSelected: Boolean) {
95 | val width = animateDpAsState(targetValue = if (isSelected) 25.dp else 10.dp)
96 | Box(
97 | modifier = Modifier
98 | .padding(1.dp)
99 | .height(10.dp)
100 | .width(width.value)
101 | .clip(CircleShape)
102 | .background(
103 | if (isSelected) MaterialTheme.colors.primary else colors.background.copy(alpha = 0.5f)
104 | )
105 | )
106 | }
107 |
108 | @Composable
109 | fun SkipNextButton(
110 | text: String,
111 | modifier: Modifier
112 | ) {
113 | Text(
114 | text = text,
115 | color = Color.Black,
116 | modifier = modifier,
117 | fontSize = 18.sp,
118 | fontWeight = FontWeight.Medium
119 | )
120 | }
121 |
122 | @Composable
123 | fun BottomSection(currentPager: Int) {
124 | Row(
125 | modifier = Modifier
126 | .padding(bottom = 20.dp)
127 | .fillMaxWidth(),
128 | horizontalArrangement = if (currentPager != 2) Arrangement.SpaceBetween else Arrangement.Center
129 | ) {
130 | if (currentPager == 2) {
131 | OutlinedButton(
132 | onClick = { /*TODO*/ },
133 | shape = RoundedCornerShape(50)
134 | ) {
135 | Text(
136 | text = "Get Started",
137 | modifier = Modifier.padding(vertical = 8.dp, horizontal = 40.dp),
138 | color = Color.Black
139 | )
140 | }
141 | } else {
142 | SkipNextButton(
143 | "Skip", Modifier
144 | .padding(start = 20.dp)
145 | )
146 | SkipNextButton(
147 | "Next", Modifier
148 | .padding(end = 20.dp)
149 | )
150 | }
151 | }
152 | }
153 |
154 | @Composable
155 | fun PagerIndicator(size: Int, currentPage: Int) {
156 | Row(
157 | horizontalArrangement = Arrangement.SpaceBetween,
158 | modifier = Modifier.padding(top = 60.dp)
159 | ) {
160 | repeat(size) {
161 | Indicator(isSelected = it == currentPage)
162 | }
163 | }
164 | }
165 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 |
86 | # Determine the Java command to use to start the JVM.
87 | if [ -n "$JAVA_HOME" ] ; then
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89 | # IBM's JDK on AIX uses strange locations for the executables
90 | JAVACMD="$JAVA_HOME/jre/sh/java"
91 | else
92 | JAVACMD="$JAVA_HOME/bin/java"
93 | fi
94 | if [ ! -x "$JAVACMD" ] ; then
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96 |
97 | Please set the JAVA_HOME variable in your environment to match the
98 | location of your Java installation."
99 | fi
100 | else
101 | JAVACMD="java"
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 |
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 |
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 | MAX_FD_LIMIT=`ulimit -H -n`
111 | if [ $? -eq 0 ] ; then
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 | MAX_FD="$MAX_FD_LIMIT"
114 | fi
115 | ulimit -n $MAX_FD
116 | if [ $? -ne 0 ] ; then
117 | warn "Could not set maximum file descriptor limit: $MAX_FD"
118 | fi
119 | else
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 | fi
122 | fi
123 |
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 |
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 |
134 | JAVACMD=`cygpath --unix "$JAVACMD"`
135 |
136 | # We build the pattern for arguments to be converted via cygpath
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 | SEP=""
139 | for dir in $ROOTDIRSRAW ; do
140 | ROOTDIRS="$ROOTDIRS$SEP$dir"
141 | SEP="|"
142 | done
143 | OURCYGPATTERN="(^($ROOTDIRS))"
144 | # Add a user-defined pattern to the cygpath arguments
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 | fi
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 | i=0
150 | for arg in "$@" ; do
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153 |
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 | else
157 | eval `echo args$i`="\"$arg\""
158 | fi
159 | i=`expr $i + 1`
160 | done
161 | case $i in
162 | 0) set -- ;;
163 | 1) set -- "$args0" ;;
164 | 2) set -- "$args0" "$args1" ;;
165 | 3) set -- "$args0" "$args1" "$args2" ;;
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 | esac
173 | fi
174 |
175 | # Escape application args
176 | save () {
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 | echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 |
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 |
185 | exec "$JAVACMD" "$@"
186 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dlight/algoguide/dsa/linked_list/doubly_linked_list/DoublyLinkedList.kt:
--------------------------------------------------------------------------------
1 | package com.dlight.algoguide.dsa.linked_list.doubly_linked_list
2 |
3 | import java.util.*
4 |
5 |
6 | object Doubly_Linked_List {
7 | @JvmStatic
8 | fun main(args: Array) {
9 | val sc = Scanner(System.`in`)
10 | val list = Linkedlists()
11 | var flag = true
12 | var valu: Int
13 | var posi = 0
14 | while (flag) {
15 | println()
16 | println("1. Add item to the list at start")
17 | println("2. Add item to the list at last")
18 | println("3. Add item to the list at position")
19 | println("4. Delete First node")
20 | println("5. Delete last node")
21 | println("6. Delete node at position")
22 | println("7. Update node at position")
23 | println("8. Display Backward/Reverse link list")
24 | println("9. View List")
25 | println("10. Exit")
26 | println("Enter Choice")
27 | val choice: Int = sc.nextInt()
28 | when (choice) {
29 | 1 -> {
30 | println("Enter value")
31 | valu = sc.nextInt()
32 | list.insertAtFirst(valu)
33 | }
34 | 2 -> {
35 | println("Enter value")
36 | valu = sc.nextInt()
37 | list.insertAtLast(valu)
38 | }
39 | 3 -> {
40 | println("Enter value")
41 | valu = sc.nextInt()
42 | println("Enter position")
43 | posi = sc.nextInt()
44 | list.insertAtPos(valu, posi)
45 | }
46 | 4 -> list.deleteFirst()
47 | 5 -> list.deleteLast()
48 | 6 -> {
49 | println("Enter position")
50 | posi = sc.nextInt()
51 | list.deleteAtPos(posi)
52 | }
53 | 7 -> {
54 | println("Enter value")
55 | valu = sc.nextInt()
56 | println("Enter position")
57 | posi = sc.nextInt()
58 | list.updateData(valu, posi)
59 | }
60 | 8 -> list.reverseList()
61 | 9 -> list.viewList()
62 | 10 -> flag = false
63 | else -> println("invalid choice")
64 | }
65 | }
66 | }
67 | }
68 |
69 |
70 | internal class Linkedlists {
71 | internal inner class Node {
72 | var data = 0
73 | private var next: Node? = null
74 | private var prev: Node? = null
75 |
76 | fun setNext(n: Node?) {
77 | next = n
78 | }
79 |
80 | fun setPrev(n: Node?) {
81 | prev = n
82 | }
83 |
84 | fun getNext(): Node {
85 | return next!!
86 | }
87 |
88 | fun getPrev(): Node {
89 | return prev!!
90 | }
91 | }
92 |
93 | private var start: Node? = null
94 | var listSize = 0
95 | private set
96 | private var tail: Node? = null
97 |
98 | //reversing link list
99 | fun reverseList() {
100 | if (isEmpty) {
101 | println("Empty List")
102 | return
103 | }
104 | var t = tail
105 | while (t != null) {
106 | print(t.data.toString() + "|___|" + "-->")
107 | t = t.getPrev()
108 | }
109 | print("null")
110 | }
111 |
112 | val isEmpty: Boolean
113 | get() = if (start == null) true else false
114 |
115 | fun viewList() {
116 | if (isEmpty) {
117 | println("Empty List")
118 | return
119 | }
120 | var t = start
121 | while (t != null) {
122 | print(t.data.toString() + "|___|" + "-->")
123 | t = t.getNext()
124 | }
125 | print("null")
126 | }
127 |
128 | fun insertAtFirst(`val`: Int) {
129 | val n: Node = Node()
130 | n.data = `val`
131 | if (isEmpty) tail = n else start!!.setPrev(n)
132 | n.setNext(start)
133 | start = n
134 | listSize++
135 | }
136 |
137 | fun insertAtLast(`val`: Int) {
138 | val t = start
139 | val n: Node = Node()
140 | n.data = `val`
141 | if (t == null) start = n //if list is null
142 | else tail!!.setNext(n)
143 | n.setPrev(tail)
144 | tail = n
145 | listSize++
146 | }
147 |
148 | fun insertAtPos(`val`: Int, pos: Int) {
149 | if (start == null) {
150 | println("Empty list, Try Again")
151 | return
152 | }
153 | var t: Node = start as Node
154 | val n: Node = Node()
155 | n.data = `val`
156 | for (i in 1 until pos - 1) {
157 | t = t.getNext()
158 | }
159 | n.setNext(t.getNext())
160 | t.getNext().setPrev(n)
161 | t.setNext(n)
162 | n.setPrev(t)
163 | listSize++
164 | }
165 |
166 | fun updateData(`val`: Int, pos: Int) {
167 | if (isEmpty || pos > listSize || pos < 1) {
168 | println("Updation not possible")
169 | return
170 | }
171 | var t = start
172 | for (i in 1 until pos) {
173 | t = t!!.getNext()
174 | }
175 | t!!.data = `val`
176 | }
177 |
178 | fun deleteFirst() {
179 | if (start == null) {
180 | println("list is empty")
181 | return
182 | } else {
183 | val t: Node = start as Node
184 | start = start!!.getNext()
185 | t.setNext(null)
186 | t.setPrev(null)
187 | start!!.setPrev(null)
188 | listSize--
189 | }
190 | }
191 |
192 | fun deleteLast() {
193 | if (start == null) {
194 | println("list is empty")
195 | return
196 | } else {
197 | val t = tail
198 | tail = start!!.getPrev()
199 | t!!.setNext(null)
200 | t.setPrev(null)
201 | tail!!.setPrev(null)
202 | listSize--
203 | }
204 | }
205 |
206 | fun deleteAtPos(pos: Int) {
207 | if (isEmpty || pos > listSize || pos < 1) {
208 | println("Deletetion not possible")
209 | return
210 | } else {
211 | var t = start
212 | val t1: Node
213 | for (i in 1 until pos - 1) {
214 | t = t!!.getNext()
215 | }
216 | t1 = t!!.getNext()
217 | t.setNext(t1.getNext())
218 | t1.getNext().setPrev(t)
219 | t1.setNext(null)
220 | t1.setPrev(null)
221 | listSize--
222 | }
223 | }
224 | }
--------------------------------------------------------------------------------
/Resources.md:
--------------------------------------------------------------------------------
1 | # Awesome DS and Algorithm Resources
2 | ![Awesome][awesome-badge]
3 |
4 | Useful resources for developers to refer too! ⚡
5 |
6 | Resources are added frequently! ⚡
7 |
8 | Enjoy!
9 |
10 | If you like this repo, be sure to ⭐ it.
11 |
12 | Please read [`contributing guidelines`](./CONTRIBUTING.md) before submitting new resources.
13 |
14 | ---
15 |
16 | Initially created by [Montek](https://github.com/Montekkundan)
17 |
18 | ## Table of Contents
19 |
20 | - [YouTube links](#youtube-links)
21 | - [Tutorial links](#tutorial-links)
22 | - [Time and Space Complexity](#time-and-space-complexity)
23 | - [Websites](#websites)
24 | - [Others](#others)
25 |
26 | ## YouTube links:
27 |
28 | | Course name | language |
29 | |----------------------------------------------------------------------------------------------------------------------------------------------------|:---------|
30 | | [C++ Full Course C++ Tutorial Data Structures & Algorithms](https://www.youtube.com/watch?v=z9bZufPHFLU&list=PLfqMhTWNBTe0b2nM6JHVCnAkhQRGiZMSJ) | Hindi |
31 | | [Data Structures Easy to Advanced Course - Full Tutorial from a Google Engineer](https://www.youtube.com/watch?v=RBSGKlAvoiM) | English |
32 | | [Java + DSA + Interview Preparation Course](https://www.youtube.com/watch?v=rZ41y93P2Qo&list=PL9gnSGHSqcnr_DxHsP7AW9ftq0AtAyYqJ) | English |
33 | | [Data Structures and Algorithms Course in Hindi](https://www.youtube.com/watch?v=5_5oE5lgrhw&list=PLu0W_9lII9ahIappRPN0MCAgtOu3lQjQi) | Hindi |
34 |
35 |
36 | [⬆ back to top](#table-of-contents)
37 |
38 | ## Tutorial links:
39 |
40 | | Course name | Description |
41 | |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
42 | | [Algorithms Part 1 — Coursera](https://coursera.pxf.io/c/3294490/1164545/14726?u=https%3A%2F%2Fwww.coursera.org%2Flearn%2Falgorithms-part1) | It’s a two-part course, in which the first part covers basic data structures, sorting, and searching algorithms, and the second part focuses on the graph and string-processing algorithms. |
43 | | [Data Structure Free Udemy Course](https://click.linksynergy.com/deeplink?id=JVFxdTr9V80&mid=39197&murl=https%3A%2F%2Fwww.udemy.com%2Fdata-structures-part-1-lognacademy%2F) | The course covers well-known data structures such as dynamic arrays, linked lists, stacks, queues, and binary trees. |
44 | | [Easy to Advanced Data Structures](https://click.linksynergy.com/deeplink?id=JVFxdTr9V80&mid=39197&murl=https%3A%2F%2Fwww.udemy.com%2Fintroduction-to-data-structures%2F) | You will learn about the array, linked list, dynamic array, stack, queue, doubly linked list, priority queues, hash tables, binary search trees, Fenwick tree/binary indexed tree, AVL tree, and Indexed priority queue. |
45 | | [Graph Theory Algorithms](https://click.linksynergy.com/deeplink?id=JVFxdTr9V80&mid=39197&murl=https%3A%2F%2Fwww.udemy.com%2Fgraph-theory-algorithms%2F) | This provides a complete overview of graph theory algorithms in computer science and mathematics. |
46 | | [Dynamic Programming — I](https://click.linksynergy.com/deeplink?id=JVFxdTr9V80&mid=39197&murl=https%3A%2F%2Fwww.udemy.com%2Fdynamic-programming-i%2F) | If you are preparing for job interviews then apart from knowing data structures and algorithms, you should also learn about programming techniques like recursion, iteration, and dynamic programming. |
47 | | [Data Structures Concepts & Singly Linked List Implementation]() | You will learn to implement various linked list operations using the C programming language like finding a node, appending a node, deleting a node, adding a node to a position, traversing a linked list, and preparing a node. |
48 | | [ Introduction to Algorithms and Data structures in C++](https://click.linksynergy.com/deeplink?id=JVFxdTr9V80&mid=39197&murl=https%3A%2F%2Fwww.udemy.com%2Fintroduction-to-algorithms-and-data-structures-in-c%2F) | In this course, you will not only learn about fundamental data structures like an array and linked list, stack, and queue but you will also learn about practical techniques to solve algorithmic problems. |
49 | | [Data Structures in Java for Noobs (Lite Edition)](https://click.linksynergy.com/deeplink?id=JVFxdTr9V80&mid=39197&murl=https%3A%2F%2Fwww.udemy.com%2Fdata-structures-in-java-for-noobs-lite-edition-algorithms-beginners%2F) | You will learn about all the linked list operations and how to implement it using Java Programming language like adding a node, deleting a node from both beginning and end. Overall, a short course to focus on a linked list data structure. |
50 | | [ Getting Interview Ready — Data Structures](https://click.linksynergy.com/deeplink?id=JVFxdTr9V80&mid=39197&murl=https%3A%2F%2Fwww.udemy.com%2Fgetting-interview-ready-data-structures%2F) | This is a great course to learn data structure and algorithms if you are preparing for an interview and don’t have much time. The course is neither very long nor very short and just contains 3 hours’ worth of content. |
51 | | [Algorithms and Data Structures — Part 1](https://pluralsight.pxf.io/c/1193463/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fads-part1) | You will learn the trade-offs involved with choosing each data structure, along with traversal, retrieval, and update algorithms. |
52 |
53 |
54 | [⬆ back to top](#table-of-contents)
55 |
56 | ## Time and Space Complexity:
57 |
58 | | Course name | Language |
59 | |---------------------------------------------------------------------------------------------------|:---------|
60 | | [Introduction to Big O Notation and Time Complexity](https://www.youtube.com/watch?v=D6xkbGLQesk) | English |
61 | | [Time Complexity and Big O Notation (with notes)](https://www.youtube.com/watch?v=vgSKOMsjLbc) | Hindi |
62 |
63 |
64 | [⬆ back to top](#table-of-contents)
65 |
66 | ## Websites:
67 |
68 | 🚧 Work in progress....
69 |
70 | ## Others:
71 |
72 | 🚧 Work in progress...
73 |
74 | [awesome-badge]: https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg
--------------------------------------------------------------------------------
/app/src/main/java/com/dlight/algoguide/composables/streak_screen/StreakScreen.kt:
--------------------------------------------------------------------------------
1 | package com.dlight.algoguide.composables.streak_screen
2 |
3 | import androidx.compose.foundation.Image
4 | import androidx.compose.foundation.background
5 | import androidx.compose.foundation.layout.*
6 | import androidx.compose.material.Text
7 | import androidx.compose.runtime.Composable
8 | import androidx.compose.ui.Alignment
9 | import androidx.compose.ui.Modifier
10 | import androidx.compose.ui.graphics.Color
11 | import androidx.compose.ui.layout.ContentScale
12 | import androidx.compose.ui.res.painterResource
13 | import androidx.compose.ui.text.TextStyle
14 | import androidx.compose.ui.text.font.FontWeight
15 | import androidx.compose.ui.text.style.TextAlign
16 | import androidx.compose.ui.unit.dp
17 | import androidx.compose.ui.unit.sp
18 | import com.dlight.algoguide.R
19 |
20 | @Composable
21 | fun StreakCount() {
22 | Box(
23 | contentAlignment = Alignment.BottomCenter,
24 | modifier = Modifier
25 | .width(width = 375.dp)
26 | .height(height = 812.dp)
27 | .padding(start = 34.dp,
28 | end = 27.dp,
29 | top = 50.dp,
30 | bottom = 64.dp)
31 | .background(color = Color.White)
32 | ) {
33 | Box(
34 | modifier = Modifier
35 | .width(width = 146.dp)
36 | .height(height = 136.dp)
37 | .background(color = Color(0xffd9d9d9)))
38 | Box(
39 | modifier = Modifier
40 | .width(width = 300.dp)
41 | .height(height = 36.dp)
42 | .background(color = Color(0xffd9d9d9)))
43 | Box(
44 | modifier = Modifier
45 | .width(width = 100.dp)
46 | .height(height = 36.dp)
47 | .background(color = Color(0xff74f823)))
48 | Box(
49 | modifier = Modifier
50 | .width(width = 314.dp)
51 | .height(height = 150.dp)
52 | .background(color = Color(0xffd9d9d9)))
53 | Text(
54 | text = "Daily Progress",
55 | color = Color.Black,
56 | style = TextStyle(
57 | fontSize = 24.sp,
58 | fontWeight = FontWeight.Bold)
59 | )
60 | CalendarMonthJanuary()
61 | Text(
62 | text = " 5\n Topics",
63 | color = Color.Black,
64 | style = TextStyle(
65 | fontSize = 24.sp,
66 | fontWeight = FontWeight.Bold))
67 | Image(
68 | painter = painterResource(id = R.drawable.ic_play),
69 | contentDescription = "Open Book",
70 | contentScale = ContentScale.Inside,
71 | modifier = Modifier
72 | .width(width = 96.dp)
73 | .height(height = 50.dp))
74 | Image(
75 | painter = painterResource(id = R.drawable.ic_pause),
76 | contentDescription = "Local fire department",
77 | modifier = Modifier
78 | .size(size = 150.dp))
79 | Text(
80 | text = "20 days",
81 | color = Color.Black,
82 | style = TextStyle(
83 | fontSize = 40.sp,
84 | fontWeight = FontWeight.Bold))
85 | Box(
86 | modifier = Modifier
87 | .width(width = 146.dp)
88 | .height(height = 136.dp)
89 | .background(color = Color(0xffd9d9d9)))
90 | Text(
91 | text = " 10\nChapters",
92 | color = Color.Black,
93 | style = TextStyle(
94 | fontSize = 24.sp,
95 | fontWeight = FontWeight.Bold))
96 | Image(
97 | painter = painterResource(id = R.drawable.ic_pause),
98 | contentDescription = "Paper",
99 | contentScale = ContentScale.Inside,
100 | modifier = Modifier
101 | .width(width = 96.dp)
102 | .height(height = 50.dp))
103 | }
104 | }
105 |
106 | @Composable
107 | fun CalendarMonthJanuary() {
108 | Box(
109 | contentAlignment = Alignment.BottomStart,
110 | modifier = Modifier
111 | .width(width = 284.dp)
112 | .height(height = 230.dp)
113 | .padding(bottom = 20.dp)
114 | ) {
115 | Column(
116 | verticalArrangement = Arrangement.SpaceBetween,
117 | modifier = Modifier
118 | .fillMaxWidth()
119 | .height(height = 120.dp)
120 | ) {
121 | Row(
122 | horizontalArrangement = Arrangement.SpaceBetween,
123 | verticalAlignment = Alignment.CenterVertically,
124 | modifier = Modifier
125 | .width(width = 284.dp)
126 | ) {
127 | repeat(5) {
128 | ItemsWeekDeyWeekendNoActiveYesFillNoStrokNo()
129 | }
130 |
131 | ItemsWeekDeyWeekendYesActiveYesFillNoStrokNo()
132 | ItemsWeekDeyWeekendYesActiveYesFillNoStrokNo()
133 | }
134 | Row(
135 | horizontalArrangement = Arrangement.SpaceBetween,
136 | verticalAlignment = Alignment.CenterVertically,
137 | modifier = Modifier
138 | .width(width = 284.dp)
139 | ) {
140 | repeat(5) {
141 | ItemsNamberDeyWeekendNoActiveNoFillNoStrokNo()
142 | }
143 |
144 | ItemsNamberDeyWeekendYesActiveYesFillNoStrokNo()
145 | ItemsNamberDeyWeekendYesActiveYesFillNoStrokNo()
146 | }
147 | Row(
148 | horizontalArrangement = Arrangement.SpaceBetween,
149 | verticalAlignment = Alignment.CenterVertically,
150 | modifier = Modifier
151 | .width(width = 284.dp)
152 | ) {
153 | repeat(5) {
154 | ItemsNamberDeyWeekendNoActiveYesFillNoStrokNo()
155 | }
156 |
157 | ItemsNamberDeyWeekendYesActiveYesFillNoStrokNo()
158 | ItemsNamberDeyWeekendYesActiveYesFillNoStrokNo()
159 | }
160 | Row(
161 | horizontalArrangement = Arrangement.SpaceBetween,
162 | verticalAlignment = Alignment.CenterVertically,
163 | modifier = Modifier
164 | .width(width = 284.dp)
165 | ) {
166 | repeat(5) {
167 | ItemsNamberDeyWeekendNoActiveYesFillNoStrokNo()
168 | }
169 |
170 | ItemsNamberDeyWeekendYesActiveYesFillNoStrokNo()
171 | ItemsNamberDeyWeekendYesActiveYesFillNoStrokNo()
172 | }
173 | Row(
174 | horizontalArrangement = Arrangement.SpaceBetween,
175 | verticalAlignment = Alignment.CenterVertically,
176 | modifier = Modifier
177 | .width(width = 284.dp)
178 | ) {
179 | repeat(5) {
180 | ItemsNamberDeyWeekendNoActiveYesFillNoStrokNo()
181 | }
182 |
183 | ItemsNamberDeyWeekendYesActiveYesFillNoStrokNo()
184 | ItemsNamberDeyWeekendYesActiveYesFillNoStrokNo()
185 | }
186 | Row(
187 | horizontalArrangement = Arrangement.SpaceBetween,
188 | verticalAlignment = Alignment.CenterVertically,
189 | modifier = Modifier
190 | .width(width = 284.dp)
191 | ) {
192 | repeat(5) {
193 | ItemsNamberDeyWeekendNoActiveYesFillNoStrokNo()
194 | }
195 |
196 | ItemsNamberDeyWeekendYesActiveYesFillNoStrokNo()
197 | ItemsNamberDeyWeekendYesActiveYesFillNoStrokNo()
198 | }
199 | Row(
200 | horizontalArrangement = Arrangement.SpaceBetween,
201 | verticalAlignment = Alignment.CenterVertically,
202 | modifier = Modifier
203 | .width(width = 284.dp)
204 | ) {
205 | repeat(4) {
206 | ItemsNamberDeyWeekendNoActiveNoFillNoStrokNo()
207 | }
208 |
209 | ItemsNamberDeyWeekendYesActiveNoFillNoStrokNo()
210 | ItemsNamberDeyWeekendYesActiveNoFillNoStrokNo()
211 | }
212 | }
213 | }
214 | }
215 |
216 | @Composable
217 | fun ItemsWeekDeyWeekendNoActiveYesFillNoStrokNo() {
218 | Box(
219 | contentAlignment = Alignment.Center,
220 | modifier = Modifier
221 | .size(size = 22.dp)
222 | ) {
223 | Text(
224 | text = "Tu",
225 | color = Color(0xffb3b3b3),
226 | textAlign = TextAlign.Center,
227 | style = TextStyle(
228 | fontSize = 11.sp))
229 | }
230 | }
231 |
232 | @Composable
233 | fun ItemsWeekDeyWeekendYesActiveYesFillNoStrokNo() {
234 | Box(
235 | contentAlignment = Alignment.Center,
236 | modifier = Modifier
237 | .size(size = 22.dp)
238 | ) {
239 | Text(
240 | text = "Su",
241 | color = Color(0xff17a1fa),
242 | textAlign = TextAlign.Center,
243 | style = TextStyle(
244 | fontSize = 11.sp))
245 | }
246 | }
247 |
248 | @Composable
249 | fun ItemsNamberDeyWeekendNoActiveNoFillNoStrokNo() {
250 | Box(
251 | contentAlignment = Alignment.Center,
252 | modifier = Modifier
253 | .size(size = 22.dp)
254 | ) {
255 | Text(
256 | text = "2",
257 | color = Color(0xff616161),
258 | textAlign = TextAlign.Center,
259 | style = TextStyle(
260 | fontSize = 11.sp))
261 | }
262 | }
263 |
264 | @Composable
265 | fun ItemsNamberDeyWeekendYesActiveYesFillNoStrokNo() {
266 | Box(
267 | contentAlignment = Alignment.Center,
268 | modifier = Modifier
269 | .size(size = 22.dp)
270 | ) {
271 | Text(
272 | text = "30",
273 | color = Color(0xff17a1fa),
274 | textAlign = TextAlign.Center,
275 | style = TextStyle(
276 | fontSize = 11.sp))
277 | }
278 | }
279 |
280 | @Composable
281 | fun ItemsNamberDeyWeekendNoActiveYesFillNoStrokNo() {
282 | Box(
283 | contentAlignment = Alignment.Center,
284 | modifier = Modifier
285 | .size(size = 22.dp)
286 | ) {
287 | Text(
288 | text = "25",
289 | color = Color(0xffb3b3b3),
290 | textAlign = TextAlign.Center,
291 | style = TextStyle(
292 | fontSize = 11.sp))
293 | }
294 | }
295 |
296 | @Composable
297 | fun ItemsNamberDeyWeekendYesActiveNoFillNoStrokNo() {
298 | Box(
299 | contentAlignment = Alignment.Center,
300 | modifier = Modifier
301 | .size(size = 22.dp)
302 | ) {
303 | Text(
304 | text = "6",
305 | color = Color(0xff1270b0),
306 | textAlign = TextAlign.Center,
307 | style = TextStyle(
308 | fontSize = 11.sp))
309 | }
310 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [2023] [kodeflap]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------