Example usage for android.graphics.drawable.shapes OvalShape OvalShape

List of usage examples for android.graphics.drawable.shapes OvalShape OvalShape

Introduction

In this page you can find the example usage for android.graphics.drawable.shapes OvalShape OvalShape.

Prototype

public OvalShape() 

Source Link

Usage

From source file:cl.gisred.android.MantCatastroActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    LicenseResult licenseResult = ArcGISRuntime.setClientId(CLIENT_ID);
    LicenseLevel licenseLevel = ArcGISRuntime.License.getLicenseLevel();

    if (licenseResult == LicenseResult.VALID && licenseLevel == LicenseLevel.BASIC) {
        //Toast.makeText(getApplicationContext(), "Licencia bsica vlida", Toast.LENGTH_SHORT).show();
    } else if (licenseResult == LicenseResult.VALID && licenseLevel == LicenseLevel.STANDARD) {
        //Toast.makeText(getApplicationContext(), "Licencia standard vlida", Toast.LENGTH_SHORT).show();
    }//from  w w w. j  a va  2s .co m

    setContentView(R.layout.activity_mant_catastro);

    Toolbar toolbar = (Toolbar) findViewById(R.id.apptool);
    setSupportActionBar(toolbar);

    /*Get Credenciales String*/
    Bundle bundle = getIntent().getExtras();
    usuar = bundle.getString("usuario");
    passw = bundle.getString("password");
    modulo = bundle.getString("modulo");
    empresa = bundle.getString("empresa");

    //Set Credenciales
    setCredenciales(usuar, passw);

    //Set Mapa
    setMap(R.id.map, 0xffffff, 0xffffff, 10, 10, false, true);
    choices = 0;

    if (Build.VERSION.SDK_INT >= 23)
        verifPermisos();
    else
        initGeoposition();

    setLayersURL(this.getResources().getString(R.string.url_Mapabase), "MAPABASE");
    setLayersURL(this.getResources().getString(R.string.url_token), "TOKENSRV");
    setLayersURL(this.getResources().getString(R.string.url_EquiposLinea), "EQUIPOS_LINEA");
    setLayersURL(this.getResources().getString(R.string.url_TRAMOS), "TRAMOS");
    setLayersURL(this.getResources().getString(R.string.url_EquiposPTO), "EQUIPOS_PTO");
    setLayersURL(this.getResources().getString(R.string.url_Nodos), "NODOS");
    setLayersURL(this.getResources().getString(R.string.url_Luminarias), "LUMINARIAS");
    setLayersURL(this.getResources().getString(R.string.url_Clientes), "CLIENTES");
    setLayersURL(this.getResources().getString(R.string.url_Concesiones), "CONCESIONES");
    setLayersURL(this.getResources().getString(R.string.url_Direcciones), "DIRECCIONES");
    setLayersURL(this.getResources().getString(R.string.url_medidores), "MEDIDORES");
    setLayersURL(this.getResources().getString(R.string.url_Stx), "STX");
    setLayersURL(this.getResources().getString(R.string.url_ECSE_varios), "ECSE");
    setLayersURL(this.getResources().getString(R.string.url_Electrodependientes), "ELECTRODEP");

    //Agrega layers dinmicos.
    addLayersToMap(credenciales, "DYNAMIC", "MAPABASECHQ", din_urlMapaBase, null, true);
    addLayersToMap(credenciales, "DYNAMIC", "SED", din_urlEquiposPunto, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "SSEE", din_urlEquiposPunto, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "SALIDAALIM", din_urlEquiposPunto, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "REDMT", din_urlTramos, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "REDBT", din_urlTramos, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "REDAP", din_urlTramos, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "POSTES", din_urlNodos, null, true);
    addLayersToMap(credenciales, "DYNAMIC", "EQUIPOS_LINEA", din_urlEquiposLinea, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "EQUIPOS_PTO", din_urlEquiposPunto, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "LUMINARIAS", din_urlLuminarias, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "CLIENTES", din_urlClientes, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "MEDIDORES", din_urlMedidores, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "CONCESIONES", din_urlConcesiones, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "DIRECCIONES", din_urlDirecciones, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "EMPALMES", din_urlClientes, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "REDSTX", din_urlStx, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "TORRESSTX", din_urlStx, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "ENCUESTADO", din_urlECSE, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "REEMPLAZO", din_urlECSE, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "ELECTRODEP", din_urlElectroDep, null, false);

    //Aade Layer al Mapa
    myMapView.addLayer(mRoadBaseMaps, 0);
    myMapView.addLayer(LySED, 1);
    myMapView.addLayer(LySSEE, 2);
    myMapView.addLayer(LySALIDAALIM, 3);
    myMapView.addLayer(LyPOSTES, 4);
    myMapView.addLayer(LyREDMT, 5);
    myMapView.addLayer(LyREDBT, 6);
    myMapView.addLayer(LyREDAP, 7);
    myMapView.addLayer(LyEQUIPOSLINEA, 8);
    myMapView.addLayer(LyEQUIPOSPTO, 9);
    myMapView.addLayer(LyLUMINARIAS, 10);
    myMapView.addLayer(LyCLIENTES, 11);
    myMapView.addLayer(LyMEDIDORES, 12);
    myMapView.addLayer(LyCONCESIONES, 13);
    myMapView.addLayer(LyDIRECCIONES, 14);
    myMapView.addLayer(LyEMPALMES, 15);
    myMapView.addLayer(LyREDSTX, 16);
    myMapView.addLayer(LyTORRESSTX, 17);
    myMapView.addLayer(LyENCUESTA, 18);
    myMapView.addLayer(LyREEMPLAZO, 19);
    myMapView.addLayer(LyELECTRODEP, 20);

    final FloatingActionButton btnGps = (FloatingActionButton) findViewById(R.id.action_gps);
    btnGps.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
            if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
                alertNoGps();
            }
            toogleGps(v);
        }
    });

    btnGps.setOnLongClickListener(new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View v) {
            Toast.makeText(getApplicationContext(), "Funcin Gps", Toast.LENGTH_SHORT).show();
            return true;
        }
    });

    final FloatingActionButton btnVerData = (FloatingActionButton) findViewById(R.id.action_ver_data);
    btnVerData.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            toogleData(v);
        }
    });

    btnVerData.setOnLongClickListener(new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View v) {
            Toast.makeText(getApplicationContext(), "Ver Datos", Toast.LENGTH_SHORT).show();
            return true;
        }
    });

    drawOk = new ShapeDrawable(new OvalShape());
    drawOk.getPaint().setColor(getResources().getColor(R.color.colorPrimary));

    drawNo = new ShapeDrawable(new OvalShape());
    drawNo.getPaint().setColor(getResources().getColor(R.color.black_overlay));

    menuMultipleActions = (FloatingActionsMenu) findViewById(R.id.multiple_actions);

    fabShowDialog = (FloatingActionButton) findViewById(R.id.action_show_dialog);
    if (fabShowDialog != null)
        fabShowDialog.setVisibility(View.GONE);

    fabShowForm = (FloatingActionButton) findViewById(R.id.action_show_form);
    if (fabShowForm != null)
        fabShowForm.setVisibility(View.GONE);

    fabVerCapas = (FloatingActionButton) findViewById(R.id.action_ver_capa);
    if (fabVerCapas != null)
        fabVerCapas.setVisibility(View.GONE);

    fabNavRoute = (FloatingActionButton) findViewById(R.id.action_nav_route);
    if (fabNavRoute != null) {
        fabNavRoute.setVisibility(View.GONE);
        fabNavRoute.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (myMapView != null && myMapView.getCallout().isShowing()) {
                    Point p = (Point) GeometryEngine.project(myMapView.getCallout().getCoordinates(), wm, egs);
                    Util.QueryNavigation(MantCatastroActivity.this, p);
                }
            }
        });

        fabNavRoute.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View v) {
                Toast.makeText(getApplicationContext(), "Ir a Ruta", Toast.LENGTH_SHORT).show();
                return true;
            }
        });
    }
    if (modulo.replace(" ", "_").equals(modMantenimiento)) {

        setLayersURL(this.getResources().getString(R.string.srv_MantCatastro), "SRV_MANT_CATASTRO");
        setLayersURL(this.getResources().getString(R.string.srv_Postes), "SRV_POSTES");
        setLayersURL(this.getResources().getString(R.string.srv_Direcciones), "SRV_DIRECCIONES");

        addLayersToMap(credenciales, "FEATURE", "ADDMANTCATASTRO", srv_mantCatastro, null, true);
        addLayersToMap(credenciales, "FEATURE", "ADDPOSTE", srv_urlPostes, null, true);
        addLayersToMap(credenciales, "FEATURE", "ADDADDRESS", srv_urlDireccion, null, true);

        myMapView.addLayer(LyAddMantCatastro, 21);
        myMapView.addLayer(LyAddPoste, 22);
        myMapView.addLayer(LyAddDireccion, 23);

        arrayTipoEdif = getResources().getStringArray(R.array.tipo_edificacion);
        arrayEstado = getResources().getStringArray(R.array.estado_lectura);
        arrayUserCosenza = getResources().getStringArray(R.array.user_cosenza);

        arrayWidgets = bundle.getStringArrayList("widgets");
        arrayModulos = bundle.getStringArrayList("modulos");

        formMant = new Dialog(MantCatastroActivity.this);
        fabShowForm.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                bMapTap = false;
                bCallOut = false;
                myMapView.getCallout().hide();
                formMant.show();
            }
        });

        if (arrayModulos != null && arrayModulos.size() > 0
                && arrayModulos.contains(empresa + "@" + modIngreso)) {

            arrayTipoPoste = getResources().getStringArray(R.array.tipo_poste);
            arrayTension = getResources().getStringArray(R.array.tipo_tension);
            arrayTipoEdif = getResources().getStringArray(R.array.tipo_edificacion);
            arrayMedidor = getResources().getStringArray(R.array.tipo_medidor);
            arrayEmpalme = getResources().getStringArray(R.array.tipo_empalme);
            arrayTecMedidor = getResources().getStringArray(R.array.tec_medidor);
            arrayTipoCnr = getResources().getStringArray(R.array.tipo_cnr);
            arrayTipoFase = getResources().getStringArray(R.array.fase_conexion);

            dialogCrear = new Dialog(MantCatastroActivity.this);

            fabShowDialog.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    bMapTap = false;
                    bCallOut = false;
                    myMapView.getCallout().hide();

                    if (oUbicacion != null) {
                        btnUbicacion.setColorFilter(Color.BLACK);
                        setEnabledDialog(true);
                    }
                    dialogCrear.show();
                    if (mSeleccionLayer != null && myMapView.getLayerByID(mSeleccionLayer.getID()) != null)
                        myMapView.removeLayer(mSeleccionLayer);
                }
            });

            fabVerCapas.setVisibility(View.VISIBLE);
            fabVerCapas.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    toogleCapas(v);
                }
            });

            fabVerCapas.setOnLongClickListener(new View.OnLongClickListener() {
                @Override
                public boolean onLongClick(View v) {
                    Toast.makeText(getApplicationContext(), "Ver Capas de Ingreso", Toast.LENGTH_SHORT).show();
                    return true;
                }
            });

            final FloatingActionButton actionA = (FloatingActionButton) findViewById(R.id.action_a);
            final FloatingActionButton actionB = (FloatingActionButton) findViewById(R.id.action_b);
            final FloatingActionButton actionC = (FloatingActionButton) findViewById(R.id.action_c);
            final FloatingActionButton actionD = (FloatingActionButton) findViewById(R.id.action_d);

            setOpcion(actionA, null);
            setOpcion(actionB, null);
            setOpcion(actionC, modIngreso + "_TECNO");
            setOpcion(actionD, modIngreso + "_CNR");

            setLayersURL(this.getResources().getString(R.string.srv_Clientes), "SRV_CLIENTES");
            setLayersURL(this.getResources().getString(R.string.srv_Union_012), "SRV_UNIONES");
            setLayersURL(din_urlTramos, "TRAMOS");
            setLayersURL(this.getResources().getString(R.string.url_Mapabase), "SRV_CALLES");
            setLayersURL(this.getResources().getString(R.string.srv_ClientesCnr), "SRV_CLIENTESCNR");

            addLayersToMap(credenciales, "FEATURE", "ADDCLIENTE", srv_urlClientes, null, true);
            addLayersToMap(credenciales, "FEATURE", "ADDUNION", srv_urlUnion012, null, true);
            addLayersToMap(credenciales, "FEATURE", "ASOCTRAMO", LyREDBT.getUrl(), null, false);
            addLayersToMap(credenciales, "FEATURE", "ASOCCALLE", srv_calles, null, false);
            addLayersToMap(credenciales, "FEATURE", "ADDCLIENTECNR", srv_urlClientesCnr, null, true);

            myMapView.addLayer(LyAddCliente, 24);
            myMapView.addLayer(LyAddUnion, 25);
            myMapView.addLayer(LyAsocTramo, 26);
            myMapView.addLayer(LyAsocCalle, 27);
            myMapView.addLayer(LyAddClienteCnr, 28);

            setLayerAddToggle(false);
        } else {
            bIngCliente = false;
            menuMultipleActions.setVisibility(View.GONE);
            //Informar al usuario que carece de permisos para ver y usar la capa de ingreso clientes comun
        }
    }
}

From source file:cl.gisred.android.InspActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    LicenseResult licenseResult = ArcGISRuntime.setClientId(CLIENT_ID);
    LicenseLevel licenseLevel = ArcGISRuntime.License.getLicenseLevel();

    if (licenseResult == LicenseResult.VALID && licenseLevel == LicenseLevel.BASIC) {
        //Toast.makeText(getApplicationContext(), "Licencia bsica vlida", Toast.LENGTH_SHORT).show();
    } else if (licenseResult == LicenseResult.VALID && licenseLevel == LicenseLevel.STANDARD) {
        //Toast.makeText(getApplicationContext(), "Licencia standard vlida", Toast.LENGTH_SHORT).show();
    }/*  www .j a  v  a2  s  .  co m*/

    setContentView(R.layout.activity_insp);

    Toolbar toolbar = (Toolbar) findViewById(R.id.apptool);
    setSupportActionBar(toolbar);

    /*Get Credenciales String*/
    Bundle bundle = getIntent().getExtras();
    usuar = bundle.getString("usuario");
    passw = bundle.getString("password");
    modulo = bundle.getString("modulo");
    empresa = bundle.getString("empresa");

    //Set Credenciales
    setCredenciales(usuar, passw);

    //Set Mapa
    setMap(R.id.map, 0xffffff, 0xffffff, 10, 10, false, true);
    choices = 0;

    if (Build.VERSION.SDK_INT >= 23)
        verifPermisos();
    else
        initGeoposition();

    setLayersURL(this.getResources().getString(R.string.url_Mapabase), "MAPABASE");
    setLayersURL(this.getResources().getString(R.string.url_token), "TOKENSRV");
    setLayersURL(this.getResources().getString(R.string.url_EquiposLinea), "EQUIPOS_LINEA");
    setLayersURL(this.getResources().getString(R.string.url_TRAMOS), "TRAMOS");
    setLayersURL(this.getResources().getString(R.string.url_EquiposPTO), "EQUIPOS_PTO");
    setLayersURL(this.getResources().getString(R.string.url_Nodos), "NODOS");
    setLayersURL(this.getResources().getString(R.string.url_Luminarias), "LUMINARIAS");
    setLayersURL(this.getResources().getString(R.string.url_Clientes), "CLIENTES");
    setLayersURL(this.getResources().getString(R.string.url_Concesiones), "CONCESIONES");
    setLayersURL(this.getResources().getString(R.string.url_Direcciones), "DIRECCIONES");
    setLayersURL(this.getResources().getString(R.string.url_medidores), "MEDIDORES");
    setLayersURL(this.getResources().getString(R.string.url_Stx), "STX");
    setLayersURL(this.getResources().getString(R.string.url_ECSE_varios), "ECSE");
    setLayersURL(this.getResources().getString(R.string.url_Electrodependientes), "ELECTRODEP");

    //Agrega layers dinmicos.
    addLayersToMap(credenciales, "DYNAMIC", "MAPABASECHQ", din_urlMapaBase, null, true);
    addLayersToMap(credenciales, "DYNAMIC", "SED", din_urlEquiposPunto, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "SSEE", din_urlEquiposPunto, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "SALIDAALIM", din_urlEquiposPunto, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "REDMT", din_urlTramos, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "REDBT", din_urlTramos, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "REDAP", din_urlTramos, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "POSTES", din_urlNodos, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "EQUIPOS_LINEA", din_urlEquiposLinea, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "EQUIPOS_PTO", din_urlEquiposPunto, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "LUMINARIAS", din_urlLuminarias, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "CLIENTES", din_urlClientes, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "MEDIDORES", din_urlMedidores, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "CONCESIONES", din_urlConcesiones, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "DIRECCIONES", din_urlDirecciones, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "EMPALMES", din_urlClientes, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "REDSTX", din_urlStx, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "TORRESSTX", din_urlStx, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "ENCUESTADO", din_urlECSE, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "REEMPLAZO", din_urlECSE, null, false);
    addLayersToMap(credenciales, "DYNAMIC", "ELECTRODEP", din_urlElectroDep, null, false);

    //Aade Layer al Mapa
    myMapView.addLayer(mRoadBaseMaps, 0);
    myMapView.addLayer(LySED, 1);
    myMapView.addLayer(LySSEE, 2);
    myMapView.addLayer(LySALIDAALIM, 3);
    myMapView.addLayer(LyPOSTES, 4);
    myMapView.addLayer(LyREDMT, 5);
    myMapView.addLayer(LyREDBT, 6);
    myMapView.addLayer(LyREDAP, 7);
    myMapView.addLayer(LyEQUIPOSLINEA, 8);
    myMapView.addLayer(LyEQUIPOSPTO, 9);
    myMapView.addLayer(LyLUMINARIAS, 10);
    myMapView.addLayer(LyCLIENTES, 11);
    myMapView.addLayer(LyMEDIDORES, 12);
    myMapView.addLayer(LyCONCESIONES, 13);
    myMapView.addLayer(LyDIRECCIONES, 14);
    myMapView.addLayer(LyEMPALMES, 15);
    myMapView.addLayer(LyREDSTX, 16);
    myMapView.addLayer(LyTORRESSTX, 17);
    myMapView.addLayer(LyENCUESTA, 18);
    myMapView.addLayer(LyREEMPLAZO, 19);
    myMapView.addLayer(LyELECTRODEP, 20);

    final FloatingActionButton btnGps = (FloatingActionButton) findViewById(R.id.action_gps);
    btnGps.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
            if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
                alertNoGps();
            }
            toogleGps(v);
        }
    });

    btnGps.setOnLongClickListener(new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View v) {
            Toast.makeText(getApplicationContext(), "Funcin Gps", Toast.LENGTH_SHORT).show();
            return true;
        }
    });

    final FloatingActionButton btnVerData = (FloatingActionButton) findViewById(R.id.action_ver_data);
    btnVerData.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            toogleData(v);
        }
    });

    btnVerData.setOnLongClickListener(new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View v) {
            Toast.makeText(getApplicationContext(), "Ver Datos", Toast.LENGTH_SHORT).show();
            return true;
        }
    });

    drawOk = new ShapeDrawable(new OvalShape());
    drawOk.getPaint().setColor(getResources().getColor(R.color.colorPrimary));

    drawNo = new ShapeDrawable(new OvalShape());
    drawNo.getPaint().setColor(getResources().getColor(R.color.black_overlay));

    menuInspeccionActions = (FloatingActionsMenu) findViewById(R.id.inspection_actions);
    menuMultipleActions = (FloatingActionsMenu) findViewById(R.id.multiple_actions);

    fabShowDialog = (FloatingActionButton) findViewById(R.id.action_show_dialog);
    if (fabShowDialog != null)
        fabShowDialog.setVisibility(View.GONE);

    fabShowForm = (FloatingActionButton) findViewById(R.id.action_show_form);
    if (fabShowForm != null)
        fabShowForm.setVisibility(View.GONE);

    fabVerCapas = (FloatingActionButton) findViewById(R.id.action_ver_capa);
    if (fabVerCapas != null)
        fabVerCapas.setVisibility(View.GONE);

    fabNavRoute = (FloatingActionButton) findViewById(R.id.action_nav_route);
    if (fabNavRoute != null) {
        fabNavRoute.setVisibility(View.GONE);
        fabNavRoute.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (myMapView != null && myMapView.getCallout().isShowing()) {
                    Point p = (Point) GeometryEngine.project(myMapView.getCallout().getCoordinates(), wm, egs);
                    Util.QueryNavigation(InspActivity.this, p);
                }
            }
        });

        fabNavRoute.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View v) {
                Toast.makeText(getApplicationContext(), "Ir a Ruta", Toast.LENGTH_SHORT).show();
                return true;
            }
        });
    }
    if (modulo.replace(" ", "_").equals(modInspeccion)) {
        dateFormatter = new SimpleDateFormat("dd-MM-yyyy", Locale.US);

        arrayTipoFaseInsp = getResources().getStringArray(R.array.fase_conexion_insp);
        arrayMarca = getResources().getStringArray(R.array.marca);
        arrayTipoMarca = getResources().getStringArray(R.array.tipo_marca);
        arrayFirmante = getResources().getStringArray(R.array.situacion_firmante);

        arrayWidgets = bundle.getStringArrayList("widgets");
        arrayModulos = bundle.getStringArrayList("modulos");
        final String sForm = bundle.getString("form");

        if (sForm.contains("TELEMEDIDA")) {
            arrayMarcaTM = getResources().getStringArray(R.array.marca_tm);
            arrayTipoMarcaTM = getResources().getStringArray(R.array.tipo_marca_tm);
        }

        formCrear = new Dialog(InspActivity.this);
        fabShowForm.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //bMapTap = false;
                //bCallOut = false;
                //myMapView.getCallout().hide();
                formCrear.show();
            }
        });

        FloatingActionButton oFabForm = (FloatingActionButton) findViewById(R.id.action_form);
        oFabForm.setIconDrawable(drawOk);
        oFabForm.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                abrirFormInsp(v, sForm);
            }
        });

        FloatingActionButton oFabView = (FloatingActionButton) findViewById(R.id.action_view);
        oFabView.setIconDrawable(drawOk);
        oFabView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                abrirEsquema(v);
            }
        });

        FloatingActionButton oFabDenuncio = (FloatingActionButton) findViewById(R.id.action_denuncio);
        oFabDenuncio.setIconDrawable(drawNo);
        oFabDenuncio.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //abrirFormDenuncio(v);
                Snackbar.make(v, "No tiene acceso a sta opcin", Snackbar.LENGTH_SHORT).show();
                menuInspeccionActions.collapse();
            }
        });

        if (arrayModulos != null && arrayModulos.size() > 0
                && arrayModulos.contains(empresa + "@" + modIngreso)) {

            arrayTipoPoste = getResources().getStringArray(R.array.tipo_poste);
            arrayTension = getResources().getStringArray(R.array.tipo_tension);
            arrayTipoEdif = getResources().getStringArray(R.array.tipo_edificacion);
            arrayMedidor = getResources().getStringArray(R.array.tipo_medidor);
            arrayEmpalme = getResources().getStringArray(R.array.tipo_empalme);
            arrayTecMedidor = getResources().getStringArray(R.array.tec_medidor);
            arrayTipoCnr = getResources().getStringArray(R.array.tipo_cnr);
            arrayTipoFase = getResources().getStringArray(R.array.fase_conexion);

            dialogCrear = new Dialog(InspActivity.this);

            fabShowDialog.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    bMapTap = false;
                    bCallOut = false;
                    myMapView.getCallout().hide();

                    if (oUbicacion != null) {
                        btnUbicacion.setColorFilter(Color.BLACK);
                        setEnabledDialog(true);
                    }
                    dialogCrear.show();
                    if (mSeleccionLayer != null && myMapView.getLayerByID(mSeleccionLayer.getID()) != null)
                        myMapView.removeLayer(mSeleccionLayer);
                }
            });

            fabVerCapas.setVisibility(View.VISIBLE);
            fabVerCapas.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    toogleCapas(v);
                }
            });

            fabVerCapas.setOnLongClickListener(new View.OnLongClickListener() {
                @Override
                public boolean onLongClick(View v) {
                    Toast.makeText(getApplicationContext(), "Ver Capas de Ingreso", Toast.LENGTH_SHORT).show();
                    return true;
                }
            });

            final FloatingActionButton actionA = (FloatingActionButton) findViewById(R.id.action_a);
            final FloatingActionButton actionB = (FloatingActionButton) findViewById(R.id.action_b);
            final FloatingActionButton actionC = (FloatingActionButton) findViewById(R.id.action_c);
            final FloatingActionButton actionD = (FloatingActionButton) findViewById(R.id.action_d);

            setOpcion(actionA, null);
            setOpcion(actionB, null);
            setOpcion(actionC, modIngreso + "_TECNO");
            setOpcion(actionD, modIngreso + "_CNR");

            setLayersURL(this.getResources().getString(R.string.srv_Postes), "SRV_POSTES");
            setLayersURL(this.getResources().getString(R.string.srv_Direcciones), "SRV_DIRECCIONES");
            setLayersURL(this.getResources().getString(R.string.srv_Clientes), "SRV_CLIENTES");
            setLayersURL(this.getResources().getString(R.string.srv_Union_012), "SRV_UNIONES");
            setLayersURL(din_urlTramos, "TRAMOS");
            setLayersURL(this.getResources().getString(R.string.url_Mapabase), "SRV_CALLES");
            setLayersURL(this.getResources().getString(R.string.srv_ClientesCnr), "SRV_CLIENTESCNR");

            addLayersToMap(credenciales, "FEATURE", "ADDPOSTE", srv_urlPostes, null, true);
            addLayersToMap(credenciales, "FEATURE", "ADDADDRESS", srv_urlDireccion, null, true);
            addLayersToMap(credenciales, "FEATURE", "ADDCLIENTE", srv_urlClientes, null, true);
            addLayersToMap(credenciales, "FEATURE", "ADDUNION", srv_urlUnion012, null, true);
            addLayersToMap(credenciales, "FEATURE", "ASOCTRAMO", LyREDBT.getUrl(), null, false);
            addLayersToMap(credenciales, "FEATURE", "ASOCCALLE", srv_calles, null, false);
            addLayersToMap(credenciales, "FEATURE", "ADDCLIENTECNR", srv_urlClientesCnr, null, true);

            myMapView.addLayer(LyAddPoste, 21);
            myMapView.addLayer(LyAddDireccion, 22);
            myMapView.addLayer(LyAddCliente, 23);
            myMapView.addLayer(LyAddUnion, 24);
            myMapView.addLayer(LyAsocTramo, 25);
            myMapView.addLayer(LyAsocCalle, 26);
            myMapView.addLayer(LyAddClienteCnr, 27);

            setLayerAddToggle(false);
        } else {
            menuMultipleActions.setVisibility(View.GONE);
        }

    } else {
        menuInspeccionActions.setVisibility(View.GONE);
    }
}

From source file:org.chromium.chrome.browser.download.DownloadNotificationService.java

private Bitmap getLargeNotificationIcon(Bitmap bitmap) {
    Resources resources = mContext.getResources();
    int height = (int) resources.getDimension(android.R.dimen.notification_large_icon_height);
    int width = (int) resources.getDimension(android.R.dimen.notification_large_icon_width);
    final OvalShape circle = new OvalShape();
    circle.resize(width, height);/*from ww w.  ja v  a 2  s. c om*/
    final Paint paint = new Paint();
    paint.setColor(ApiCompatibilityUtils.getColor(resources, R.color.google_blue_grey_500));

    final Bitmap result = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
    Canvas canvas = new Canvas(result);
    circle.draw(canvas, paint);
    float leftOffset = (width - bitmap.getWidth()) / 2f;
    float topOffset = (height - bitmap.getHeight()) / 2f;
    if (leftOffset >= 0 && topOffset >= 0) {
        canvas.drawBitmap(bitmap, leftOffset, topOffset, null);
    } else {
        // Scale down the icon into the notification icon dimensions
        canvas.drawBitmap(bitmap, new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()),
                new Rect(0, 0, width, height), null);
    }
    return result;
}

From source file:com.ncode.android.apps.schedo.ui.EventDetailActivity.java

private void tryRenderTags() {
    if (mTagMetadata == null || mTagsString == null) {
        return;/*from w w w  .ja v  a 2 s.com*/
    }

    if (TextUtils.isEmpty(mTagsString)) {
        mTagsContainer.setVisibility(View.GONE);
    } else {
        mTagsContainer.setVisibility(View.VISIBLE);
        mTags.removeAllViews();
        LayoutInflater inflater = LayoutInflater.from(this);
        String[] tagIds = mTagsString.split(",");

        List<TagMetadata.Tag> tags = new ArrayList<TagMetadata.Tag>();
        for (String tagId : tagIds) {
            if (Config.Tags.SESSIONS.equals(tagId) || Config.Tags.SPECIAL_KEYNOTE.equals(tagId)) {
                continue;
            }

            TagMetadata.Tag tag = mTagMetadata.getTag(tagId);
            if (tag == null) {
                continue;
            }

            tags.add(tag);
        }

        if (tags.size() == 0) {
            mTagsContainer.setVisibility(View.GONE);
            return;
        }

        Collections.sort(tags, TagMetadata.TAG_DISPLAY_ORDER_COMPARATOR);

        for (final TagMetadata.Tag tag : tags) {
            TextView chipView = (TextView) inflater.inflate(R.layout.include_session_tag_chip, mTags, false);
            chipView.setText(tag.getName());

            if (Config.Tags.CATEGORY_TOPIC.equals(tag.getCategory())) {
                ShapeDrawable colorDrawable = new ShapeDrawable(new OvalShape());
                colorDrawable.setIntrinsicWidth(mTagColorDotSize);
                colorDrawable.setIntrinsicHeight(mTagColorDotSize);
                colorDrawable.getPaint().setStyle(Paint.Style.FILL);
                chipView.setCompoundDrawablesWithIntrinsicBounds(colorDrawable, null, null, null);
                colorDrawable.getPaint().setColor(tag.getColor());
            }

            chipView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    finish(); // TODO: better encapsulation
                    Intent intent = new Intent(EventDetailActivity.this, BrowseSessionsActivity.class)
                            .putExtra(BrowseSessionsActivity.EXTRA_FILTER_TAG, tag.getId())
                            .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
                    startActivity(intent);
                }
            });

            mTags.addView(chipView);
        }
    }
}

From source file:com.google.samples.apps.iosched.ui.SessionDetailActivity.java

private void tryRenderTags() {
    if (mTagMetadata == null || mTagsString == null) {
        return;//from w  w  w  .  j a  v  a 2s  .  co  m
    }

    if (TextUtils.isEmpty(mTagsString)) {
        mTagsContainer.setVisibility(View.GONE);
    } else {
        mTagsContainer.setVisibility(View.VISIBLE);
        mTags.removeAllViews();
        LayoutInflater inflater = LayoutInflater.from(this);
        String[] tagIds = mTagsString.split(",");

        List<TagMetadata.Tag> tags = new ArrayList<TagMetadata.Tag>();
        for (String tagId : tagIds) {
            if (Config.Tags.SESSIONS.equals(tagId) || Config.Tags.SPECIAL_KEYNOTE.equals(tagId)) {
                continue;
            }

            TagMetadata.Tag tag = mTagMetadata.getTag(tagId);
            if (tag == null) {
                continue;
            }

            tags.add(tag);
        }

        if (tags.size() == 0) {
            mTagsContainer.setVisibility(View.GONE);
            return;
        }

        Collections.sort(tags, TagMetadata.TAG_DISPLAY_ORDER_COMPARATOR);

        for (final TagMetadata.Tag tag : tags) {
            TextView chipView = (TextView) inflater.inflate(R.layout.include_session_tag_chip, mTags, false);
            chipView.setText(tag.getName());

            if (Config.Tags.CATEGORY_TOPIC.equals(tag.getCategory())) {
                ShapeDrawable colorDrawable = new ShapeDrawable(new OvalShape());
                colorDrawable.setIntrinsicWidth(mTagColorDotSize);
                colorDrawable.setIntrinsicHeight(mTagColorDotSize);
                colorDrawable.getPaint().setStyle(Paint.Style.FILL);
                chipView.setCompoundDrawablesWithIntrinsicBounds(colorDrawable, null, null, null);
                colorDrawable.getPaint().setColor(tag.getColor());
            }

            chipView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    finish(); // TODO: better encapsulation
                    Intent intent = new Intent(SessionDetailActivity.this, BrowseSessionsActivity.class)
                            .putExtra(BrowseSessionsActivity.EXTRA_FILTER_TAG, tag.getId())
                            .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
                    startActivity(intent);
                }
            });

            mTags.addView(chipView);
        }
    }
}

From source file:com.saarang.samples.apps.iosched.ui.SessionDetailActivity.java

private void tryRenderTags() {
    if (mTagMetadata == null || mTagsString == null) {
        return;/* w  w  w  .  j a  v a  2 s  . c  om*/
    }

    if (TextUtils.isEmpty(mTagsString)) {
        mTagsContainer.setVisibility(View.GONE);
    } else {
        mTagsContainer.setVisibility(View.VISIBLE);
        mTags.removeAllViews();
        LayoutInflater inflater = LayoutInflater.from(this);
        String[] tagIds = mTagsString.split(",");

        List<TagMetadata.Tag> tags = new ArrayList<TagMetadata.Tag>();
        for (String tagId : tagIds) {
            if (Config.Tags.SESSIONS.equals(tagId) || Config.Tags.SPECIAL_KEYNOTE.equals(tagId)) {
                continue;
            }

            TagMetadata.Tag tag = mTagMetadata.getTag(tagId);
            if (tag == null) {
                continue;
            }

            tags.add(tag);
        }

        if (tags.size() == 0) {
            mTagsContainer.setVisibility(View.GONE);
            return;
        }

        Collections.sort(tags, TagMetadata.TAG_DISPLAY_ORDER_COMPARATOR);

        for (final TagMetadata.Tag tag : tags) {
            TextView chipView = (TextView) inflater
                    .inflate(com.saarang.samples.apps.iosched.R.layout.include_session_tag_chip, mTags, false);
            chipView.setText(tag.getName());

            if (Config.Tags.CATEGORY_TOPIC.equals(tag.getCategory())) {
                ShapeDrawable colorDrawable = new ShapeDrawable(new OvalShape());
                colorDrawable.setIntrinsicWidth(mTagColorDotSize);
                colorDrawable.setIntrinsicHeight(mTagColorDotSize);
                colorDrawable.getPaint().setStyle(Paint.Style.FILL);
                chipView.setCompoundDrawablesWithIntrinsicBounds(colorDrawable, null, null, null);
                colorDrawable.getPaint().setColor(tag.getColor());
            }

            chipView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    finish(); // TODO: better encapsulation
                    Intent intent = new Intent(SessionDetailActivity.this, BrowseSessionsActivity.class)
                            .putExtra(BrowseSessionsActivity.EXTRA_FILTER_TAG, tag.getId())
                            .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
                    startActivity(intent);
                }
            });

            mTags.addView(chipView);
        }
    }
}

From source file:com.google.samples.apps.iosched.ui.SessionDetailFragment.java

private void tryRenderTags() {
    if (mTagMetadata == null || mTagsString == null || !isAdded()) {
        return;//from   w  w  w  . j  av a  2  s .co  m
    }

    if (TextUtils.isEmpty(mTagsString)) {
        mTagsContainer.setVisibility(View.GONE);
    } else {
        mTagsContainer.setVisibility(View.VISIBLE);
        mTags.removeAllViews();
        LayoutInflater inflater = LayoutInflater.from(getActivity());
        String[] tagIds = mTagsString.split(",");

        List<TagMetadata.Tag> tags = new ArrayList<TagMetadata.Tag>();
        for (String tagId : tagIds) {
            if (Config.Tags.SESSIONS.equals(tagId) || Config.Tags.SPECIAL_KEYNOTE.equals(tagId)) {
                continue;
            }

            TagMetadata.Tag tag = mTagMetadata.getTag(tagId);
            if (tag == null) {
                continue;
            }

            tags.add(tag);
        }

        if (tags.size() == 0) {
            mTagsContainer.setVisibility(View.GONE);
            return;
        }

        Collections.sort(tags, TagMetadata.TAG_DISPLAY_ORDER_COMPARATOR);

        for (final TagMetadata.Tag tag : tags) {
            TextView chipView = (TextView) inflater.inflate(R.layout.include_session_tag_chip, mTags, false);
            chipView.setText(tag.getName());

            if (Config.Tags.CATEGORY_TOPIC.equals(tag.getCategory())) {
                ShapeDrawable colorDrawable = new ShapeDrawable(new OvalShape());
                colorDrawable.setIntrinsicWidth(mTagColorDotSize);
                colorDrawable.setIntrinsicHeight(mTagColorDotSize);
                colorDrawable.getPaint().setStyle(Paint.Style.FILL);
                chipView.setCompoundDrawablesWithIntrinsicBounds(colorDrawable, null, null, null);
                colorDrawable.getPaint().setColor(tag.getColor());
            }

            chipView.setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View view) {
                    getActivity().finish(); // TODO: better encapsulation
                    Intent intent = new Intent(getActivity(), BrowseSessionsActivity.class)
                            .putExtra(BrowseSessionsActivity.EXTRA_FILTER_TAG, tag.getId())
                            .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
                    startActivity(intent);
                }
            });

            mTags.addView(chipView);
        }
    }
}

From source file:com.google.samples.apps.iosched.ui.CurrentSessionActivity.java

private void tryRenderTags() {
    if (mTagMetadata == null || mTagsString == null) {
        return;/*w  ww  .  j  a  v a 2 s .  c  o m*/
    }

    if (TextUtils.isEmpty(mTagsString)) {
        mTagsContainer.setVisibility(View.GONE);
    } else {
        mTagsContainer.setVisibility(View.VISIBLE);
        mTags.removeAllViews();
        LayoutInflater inflater = LayoutInflater.from(this);
        String[] tagIds = mTagsString.split(",");

        List<TagMetadata.Tag> tags = new ArrayList<TagMetadata.Tag>();
        for (String tagId : tagIds) {
            if (Config.Tags.SESSIONS.equals(tagId) || Config.Tags.SPECIAL_KEYNOTE.equals(tagId)) {
                continue;
            }

            TagMetadata.Tag tag = mTagMetadata.getTag(tagId);
            if (tag == null) {
                continue;
            }

            tags.add(tag);
        }

        if (tags.size() == 0) {
            mTagsContainer.setVisibility(View.GONE);
            return;
        }

        Collections.sort(tags, TagMetadata.TAG_DISPLAY_ORDER_COMPARATOR);

        for (final TagMetadata.Tag tag : tags) {
            TextView chipView = (TextView) inflater.inflate(R.layout.include_session_tag_chip, mTags, false);
            chipView.setText(tag.getName());

            if (Config.Tags.CATEGORY_TOPIC.equals(tag.getCategory())) {
                ShapeDrawable colorDrawable = new ShapeDrawable(new OvalShape());
                colorDrawable.setIntrinsicWidth(mTagColorDotSize);
                colorDrawable.setIntrinsicHeight(mTagColorDotSize);
                colorDrawable.getPaint().setStyle(Paint.Style.FILL);
                chipView.setCompoundDrawablesWithIntrinsicBounds(colorDrawable, null, null, null);
                colorDrawable.getPaint().setColor(tag.getColor());
            }

            chipView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    finish(); // TODO: better encapsulation
                    Intent intent = new Intent(CurrentSessionActivity.this, BrowseSessionsActivity.class)
                            .putExtra(BrowseSessionsActivity.EXTRA_FILTER_TAG, tag.getId())
                            .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
                    startActivity(intent);
                }
            });

            mTags.addView(chipView);
        }
    }
}