Skip to content

Instantly share code, notes, and snippets.

View graffiti75's full-sized avatar
🏠
Working from home

Rodrigo Cericatto graffiti75

🏠
Working from home
View GitHub Profile
@graffiti75
graffiti75 / .How to track Location in Android
Last active April 21, 2023 04:29
How to track the user location in Android, using Kotlin, and dealing with ACCESS_FINE_LOCATION and ACCESS_BACKGROUND_LOCATION permissions
Changing name of this Gist.
/*
* Copyright 2018, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.7.20'
repositories {
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
@graffiti75
graffiti75 / MainActivity.kt
Created October 14, 2021 21:54
[ Medium ] Activity Lifecycle in Android
class MainActivity : AppCompatActivity() {
private val TAG = "MainActivity"
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
override fun onStart() {
@graffiti75
graffiti75 / activity_rundemannen.xml
Created August 4, 2021 18:25
Tour Guide App - 3079590 - Fixing unnecessary blank lines in the code
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="false">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@graffiti75
graffiti75 / play_store_workflow.yml
Created July 16, 2021 21:36
Continuous Delivery for Android Using GitHub Actions
name: Deploy to Play Store
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
@graffiti75
graffiti75 / check_and_deploy.yml
Created July 9, 2021 02:16
Continuous Delivery for Android Using GitHub Actions
##1: Creates a workflow named Test and deploy.
name: Test and deploy
## Actions that will be executed when you push code currently none
on:
push:
tags:
- 'v*'
pull_request:
branches:
@graffiti75
graffiti75 / activity_history_of_rewa.xml
Last active June 18, 2021 18:48
Tour Guide App - 2999011 - Fixing background of ScrollView
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white" <<<<<------------------------- HERE
tools:context=".HistoryOfRewa">
<ScrollView
android:layout_width="match_parent"
@graffiti75
graffiti75 / activity_main.xml
Created June 17, 2021 21:32
Build A Screen App - 2997662 - Fixing layout using ScrollView
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
@graffiti75
graffiti75 / activity_main.xml
Last active June 14, 2021 00:52
Build A Screen App - 2989582 - Fixing layout using FrameLayout and transparency colors
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/costa_background"
tools:context=".MainActivity">
<FrameLayout
android:layout_width="match_parent"