Skip to content

Instantly share code, notes, and snippets.

View arriolac's full-sized avatar
🌍

Chris Arriola arriolac

🌍
View GitHub Profile
// Copyright 2022 Google LLC.
// SPDX-License-Identifier: Apache-2.0
val singapore = LatLng(1.35, 103.87)
val cameraPositionState = rememberCameraPositionState {
position = CameraPosition.fromLatLngZoom(singapore, 11f)
}
Box(Modifier.fillMaxSize()) {
GoogleMap(
modifier = Modifier.matchParentSize(),
@arriolac
arriolac / GoogleMapMarker.kt
Created June 1, 2022 19:34
GoogleMapMarker.kt
// Copyright 2022 Google LLC.
// SPDX-License-Identifier: Apache-2.0
GoogleMap(modifier = Modifier.fillMaxSize()) {
Marker(
state = MarkerState(LatLng(1.35, 103.87)),
title = "Marker in Singapore",
onClick = { Log.d("Marker", "Marker was clicked") }
)
}
@arriolac
arriolac / GoogleMapProperties.kt
Created June 1, 2022 19:33
GoogleMapProperties.kt
// Copyright 2022 Google LLC.
// SPDX-License-Identifier: Apache-2.0
GoogleMap(
properties = MapProperties(isBuildingEnabled = true)
// …
)
// Copyright 2022 Google LLC.
// SPDX-License-Identifier: Apache-2.0
GoogleMap(
uiSettings = MapUiSettings(compassEnabled = false, mapToolbarEnabled = true)
// …
)
@arriolac
arriolac / GoogleMapAnimate.kt
Created May 16, 2022 16:47
Maps Compose Snippets
// Copyright 2022 Google LLC.
// SPDX-License-Identifier: Apache-2.0
val singapore = LatLng(1.35, 103.87)
val cameraPositionState = rememberCameraPositionState {
position = CameraPosition.fromLatLngZoom(singapore, 11f)
}
Box(Modifier.fillMaxSize()) {
GoogleMap(
modifier = Modifier.matchParentSize(),

Keybase proof

I hereby claim:

  • I am arriolac on github.
  • I am chrisarriola (https://keybase.io/chrisarriola) on keybase.
  • I have a public key ASBSQlNOoGj57_pr5_Rn2ei1zRfC6Xm4GHkigxYOwjIXCQo

To claim this, I am signing this object:

@arriolac
arriolac / ActionBarDrawerToggle.java
Created February 23, 2016 20:44
ActionBarDrawerToggle with no animation
new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close) {
@Override public void onDrawerSlide(View drawerView, float slideOffset) {
super.onDrawerSlide(drawerView, 0);
}
};
@arriolac
arriolac / FlatIterator.java
Last active January 6, 2016 20:01
An Iterator that flattens iterating over a list of Iterators.
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
/**
* An Iterator that flattens iterating over a list of Iterators.
*
* Created by chris on 1/5/16.
*/
@arriolac
arriolac / CustomView.java
Last active January 18, 2024 19:53
Saving state on configuration changes for a custom view.
package com.operator.android;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import android.view.View;
/**
* A custom {@link View} that demonstrates how to save/restore instance state.
*/
@arriolac
arriolac / DrawingViewArchitecture.md
Created September 7, 2015 16:57
DrawingView Architecture

This is the proposed architecture for implementing drawing on text, photos and videos on Leo.

DrawingView

  • This is the custom view that will display the drawing created by the user.
  • Will be the View on "top" (relative to z-axis) of all the other views in AddTextActivity except the top bar Views.
  • Notes:
    • overrides onTouchEvent(...)
    • has a method called setEnabled(boolean enabled)
      • enabled value will be returned by onTouchEvent(...). this means that it will intercept all touch events when enabled.
  • Note: this will be toggled by the compose views (enabled when in drawing mode, disabled when not in drawing mode).