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
class LocalDateConverter { | |
@TypeConverter | |
fun fromTimestamp(value: Long): LocalDate? { | |
return if (value < 0) null | |
else Instant.ofEpochMilli(value) | |
.atZone(ZoneId.systemDefault()) | |
.toLocalDate() | |
} |
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
//How to use | |
CustomOutlinedText( | |
textValue = uiState.email, | |
testTag = "username_field", | |
hintTextId = R.string.hint_enter_email, | |
labelTextId = R.string.hint_email, | |
keyboardOptions = KeyboardOptions.Default.copy( | |
keyboardType = KeyboardType.Email, | |
imeAction = ImeAction.Next | |
), |
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
object SampleData { | |
fun getSampleTasks(): List<TaskModel> { | |
return listOf( | |
TaskModel( | |
title = "Complete project proposal", | |
dueDate = LocalDate.parse("2023-02-25"), | |
priority = Priority.HIGH, | |
hasReminder = true, | |
isCompleted = false, | |
createdDate = LocalDateTime.now(), |
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
package com.theozgurr.apparchitecture.ui.register | |
import androidx.compose.animation.ExperimentalAnimationApi | |
import androidx.compose.ui.ExperimentalComposeUiApi | |
import androidx.compose.ui.test.assertIsDisplayed | |
import androidx.compose.ui.test.junit4.createAndroidComposeRule | |
import androidx.compose.ui.test.onNodeWithTag | |
import androidx.compose.ui.test.onNodeWithText | |
import androidx.compose.ui.test.onRoot | |
import androidx.navigation.NavHostController |
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
package com.theozgurr.apparchitecture.common | |
import androidx.compose.animation.ExperimentalAnimationApi | |
import androidx.compose.ui.ExperimentalComposeUiApi | |
import androidx.compose.ui.test.junit4.AndroidComposeTestRule | |
import androidx.compose.ui.test.onNodeWithTag | |
import androidx.compose.ui.test.performClick | |
import androidx.compose.ui.test.performTextInput | |
import androidx.test.ext.junit.rules.ActivityScenarioRule | |
import com.theozgurr.apparchitecture.ui.MainActivity |
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
<?xml version="1.0" encoding="utf-8"?> | |
<ScrollView 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="@android:color/white" | |
android:fillViewport="true" | |
android:paddingStart="@dimen/dp_32" | |
android:paddingEnd="@dimen/dp_32" |
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
/** | |
* Recursive method for resolving redirects. Resolves at most MAX_REDIRECTS times. | |
* | |
* @param url a URL | |
* @param remainingRedirects loop counter | |
* @return instance of URLConnection | |
* @throws IOException if connection fails | |
*/ | |
protected boolean createConnection(URL url, int remainingRedirects) throws IOException { | |
HttpURLConnection connection = (HttpURLConnection) url.openConnection(); |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Troypoint</title> | |
<base href="/"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="icon" type="image/x-icon" href="favicon.ico"> | |
</head> |
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
<html> | |
<head> | |
<title>aa</title> | |
<script src="script.js" ></script> | |
<body> | |
<input id="totalPrice" /> | |
<button type="button" onclick="calculateTotal()"> | |
Calculate |
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
function calculateTotal(){ | |
var price = parseFloat(document.getElementById("totalPrice").value); | |
var tax = price * 8.4 / 100; | |
var totalPrice = price + tax; | |
alert("Total price: " + totalPrice); | |
} |
NewerOlder