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
//Es es solo un Popup para mostrar información, no esperamos hacer algo con la respuesta | |
//de requerir recibir un input del usuario, debemos cambiar el "null" de la línea 11 por "this" | |
//y el activity debe implementar DialogInterface.OnClickListener | |
AlertDialog.Builder dialogInputUserBuilder = new AlertDialog.Builder(this); | |
dialogInputUserBuilder.setCancelable(false); | |
// fijamos el titulo del díalogo | |
dialogInputUserBuilder.setTitle("Ingrese un usuario"); | |
//asignamos una imagen de Android (de preferencia reemplazarla por de nuestro proyecyo) | |
dialogInputUserBuilder.setIcon(android.R.drawable.ic_input_add); | |
// fijamos el mensaje |
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"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/custom_dialog_layout_design_user_input" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
android:padding="16dp"> | |
<TextView | |
android:id="@+id/dialogTitleCiudad" |
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
import android.content.Context; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ArrayAdapter; | |
import android.widget.ImageView; | |
import android.widget.TextView; | |
import java.util.List; |
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
// a nivel de de la Clase | |
private CharSequence opcionesCiudad[] = new CharSequence[] {"Editar", "Eliminar"}; | |
AlertDialog.Builder alertDialogBuilderOpciones = new AlertDialog.Builder(this); | |
alertDialogBuilderOpciones.setCancelable(false); | |
alertDialogBuilderOpciones.setItems(opcionesCiudad,this); | |
alertDialogBuilderOpciones.setNegativeButton(R.string.Cancelar,this); | |
alertDialogBuilderOpciones.create().show(); |
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
public interface RecyclerViewItemClickListener { | |
public void onClick(View view, int position); | |
public void onLongClick(View view, int position); | |
} |
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"?> | |
<resources> | |
<!-- google's material design colours from | |
http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
<!--reds--> | |
<color name="md_red_50">#FFEBEE</color> | |
<color name="md_red_100">#FFCDD2</color> | |
<color name="md_red_200">#EF9A9A</color> |
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
//From: https://github.com/cgoldberg/netplot/blob/0cdac581460f70a3d39929ffb5a2635a9eb16320/src/Stopwatch.java | |
/* | |
* Copyright 2006 Corey Goldberg (cgoldberg _at_ gmail.com) | |
* | |
* This file is part of NetPlot. | |
* | |
* NetPlot is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 2 of the License, or |
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
/** | |
* Copyright 2017 Google Inc. All Rights Reserved. | |
* | |
* 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 |
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
import android.annotation.SuppressLint; | |
import android.arch.lifecycle.LiveData; | |
import android.content.Context; | |
import android.location.Location; | |
import com.google.android.gms.location.FusedLocationProviderClient; | |
import com.google.android.gms.location.LocationCallback; | |
import com.google.android.gms.location.LocationRequest; | |
import com.google.android.gms.location.LocationResult; | |
import com.google.android.gms.location.LocationServices; |
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
** | |
* All constants used by app | |
*/ | |
public class Constants { | |
private static final String PACKAGE_NAME = "com.xxxxxxxxxxxx.xxxxxxxxxxxxxx"; | |
public interface NOTIFICATION_ID { | |
public static int TRACKER_SERVICE = 00; | |
} |
OlderNewer