Skip to content

Instantly share code, notes, and snippets.

View AlexGabor's full-sized avatar

Alexandru Gabor AlexGabor

View GitHub Profile
@AlexGabor
AlexGabor / LoginScreenExample.kt
Created August 30, 2022 14:38
state holder instead of vm
@Composable
fun LoginScreen(
modifier: Modifier = Modifier,
state: LoginScreenState = rememberLoginScreenState(),
) {
// ...
}
@Composable
fun rememberLoginScreenState(
DE91 1000 0000 0123 4567 89
@AlexGabor
AlexGabor / basic.cpp
Last active September 17, 2019 16:10
C++ basic statements
#include <iostream>
using namespace std;
int main () {
// write your stuff here
int x; // declare variable for a an "integer" value
float x; // declare variable for a "real" value
<androidx.constraintlayout.motion.widget.MotionLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutDescription="@xml/scene">
@AlexGabor
AlexGabor / layout.xml
Created August 17, 2019 07:58
ConstraintLayout header and list
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/header"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@AlexGabor
AlexGabor / scene.xml
Created August 16, 2019 17:00
Transition
<Transition
motion:constraintSetEnd="@+id/end"
motion:constraintSetStart="@+id/start">
<OnSwipe
motion:onTouchUp="stop"
motion:dragDirection="dragUp"
motion:touchAnchorId="@+id/header" />
</Transition>
@AlexGabor
AlexGabor / scene.xml
Created August 16, 2019 16:56
ConstraintSet end
<ConstraintSet android:id="@+id/end">
<Constraint
android:id="@+id/header"
android:layout_width="0dp"
android:layout_height="wrap_content"
motion:layout_constraintEnd_toEndOf="parent"
motion:layout_constraintStart_toStartOf="parent"
motion:layout_constraintBottom_toTopOf="parent" />
</ConstraintSet>
@AlexGabor
AlexGabor / scene.xml
Created August 16, 2019 16:53
ConstraintSet start
<ConstraintSet android:id="@+id/start">
<Constraint
android:id="@+id/header"
android:layout_width="0dp"
android:layout_height="wrap_content"
motion:layout_constraintEnd_toEndOf="parent"
motion:layout_constraintStart_toStartOf="parent"
motion:layout_constraintTop_toTopOf="parent" />
</ConstraintSet>
package ro.oneandonly.bookstore.service;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import ro.oneandonly.bookstore.domain.Book;
import ro.oneandonly.bookstore.domain.validators.ValidatorException;
import ro.oneandonly.bookstore.repository.Repository;
package ro.oneandonly.bookstore.util;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import org.jdom2.input.SAXBuilder;
import org.jdom2.output.Format;
import org.jdom2.output.XMLOutputter;
import ro.oneandonly.bookstore.domain.BaseEntity;