Skip to content

Instantly share code, notes, and snippets.

View Giussep07's full-sized avatar

Giussep Ricardo Cachaya Giussep07

View GitHub Profile
@Giussep07
Giussep07 / HomeworkAssignment2.kt
Created March 23, 2025 21:31
Homework Assignment 2
// TodoItemType
sealed interface TodoItemType {
data class Todo(
val id: Int,
val title: String,
val description: String,
val isChecked: Boolean = false
): TodoItemType
data class AddTodo(val title: String = "", val description: String = ""): TodoItemType
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Check if there is a user logged in (database)
// If there is a user logged in, go to home screen
// If there is no user logged in, go to onboarding screen
UserDao userDao = UserDao();
List<UserEntity> users = await userDao.getAllUsers();
if (users.isNotEmpty) {
@Giussep07
Giussep07 / SomeFragment.kt
Last active May 4, 2020 16:51
Marker animation
class SomeFragment : Fragment() {
private val overshootInterpolator = OvershootInterpolator()
private var googleMap: GoogleMap? = null
private lateinit var fusedLocationClient: FusedLocationProviderClient
...
private val callback = OnMapReadyCallback { googleMap ->
this.googleMap = googleMap
@Giussep07
Giussep07 / HomeFragment.kt
Last active April 21, 2020 22:52
CustomSearchview
class HomeFragment : Fragment(), SearchView.OnSearchView {
private lateinit var searchView: SearchView
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
...
setHasOptionsMenu(true)
val constraintSet = ConstraintSet()
// clonamos el constrainSet del padre del elemento que vamos a modificar
constraintSet.clone(binding.containerVideoCall)
// Obtenemos el id del elemento a modificar
val id = binding.surfaceRender.id
// Cambiamos el margen
constraintSet.setMargin(id, ConstraintSet.END, Utils.dpToPx(context!!, 16f))
// Mi pez primero tenes que decirle al fragmento que va a tener menú
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
setHasOptionsMenu(true) <-- This line
}
//Aquí inflas el menú
fun showDialogToInformPermission(
context: Context,
fragmentManager: FragmentManager,
icon: Int,
message: Int,
accept: () -> Unit,
cancel: () -> Unit
) {
val dialog = PermissionDialogFragment.newInstance(
@Giussep07
Giussep07 / starUML.md
Created December 3, 2017 22:22 — forked from trandaison/starUML.md
Get full version of StarUML

StarUML

Download: StarUML.io

Crack

Source: jorgeancal

After installing StartUML successfully, modify LicenseManagerDomain.js as follow:

/**