I try to hide a span in my code using bootstrap.
I only want it to show up in browsers and not on mobile devices
<div class="hidden-md-down"><span id="logo-textosp">aenean luctus</span></div>
But it's not working
any ideas?
I try to hide a span in my code using bootstrap.
I only want it to show up in browsers and not on mobile devices
<div class="hidden-md-down"><span id="logo-textosp">aenean luctus</span></div>
But it's not working
any ideas?
My question would be the following: Can I detect the position of the screen scroll with javascript?
Hello, a javascript function or method that detects that my website is displayed on the web or on a mobile device.
I try to minify my css code to improve my web loading. I have tried using css clean and minify css, but the code that it returns is always commented out. Some help?
I have a need to find a solution to a problem with app_name
my android project.
The idea is that I should be able to have app_name
both for English and for Spanish, but it only allows me for one. Any way out?
I am loading some values in JSON and I would like to control and delete the duplicates:
public void loadEventos(){
SharedPreferences prefs = getSharedPreferences(getString(R.string.gamedata), Context.MODE_PRIVATE);
String data=prefs.getString("eventos","");
eventos.clear();
if(!data.isEmpty()) {
try {
JSONObject jo = new JSONObject(data);
if(jo.has("eventos")){
JSONArray ja=jo.getJSONArray("eventos");
for (int i = 0; i < ja.length(); i++) {
if (!ja.getString(i).isEmpty()) {
Evento ev=new Evento(ja.getString(i));
Log.d(GLOBALES.TAG,"eventosString="+eventos.get(i).toString());
Log.d(GLOBALES.TAG,"eventosArray="+ja.getString(i));
if(ev.getFinalizacion()>System.currentTimeMillis()) {
eventos.add(ev);
}
}
}
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}
It's my first time using a thread and I would like to implement it in such a way that it calls a method every x seconds:
new Thread(new Runnable() {
public void run() {
try {
metodoallamar();
Thread.sleep(10000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}).start();
In my method I have a Random variable:
public Bitmap getBmp(int nunidades,boolean base){
Bitmap bmp = Bitmap.createBitmap(ladoWidth * nunidades, ladoHeight, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bmp);
int nbase = 0;
int nespacio = 0;
if(base){
if(baseinicial != null){
canvas.drawBitmap(baseinicial,0,0,null);
nbase = 1;
}
for(;nbase < nunidades;nbase++){
canvas.drawBitmap(baserepeticion,nbase*ladoWidth,0,null);
}
}else {
//adornos
if(!type.equalsIgnoreCase("Columnas")){
int random = rnd.nextInt(adornos.size());
ObjetoAdorno obj = new ObjetoAdorno(adornos.get(random).getTiles());
ObjetoAdorno objf = new ObjetoAdorno();
objf.setAdornos(obj.getAdornos());
int tile = obj.getnAdornos();
Log.d(GLOBALES.TAG,"espacio="+nunidades);
Log.d(GLOBALES.TAG,"random="+random);
Log.d(GLOBALES.TAG,"tile="+tile);
if(nunidades> tile){
Log.d(GLOBALES.TAG,"hay espacio");
for(;nespacio < nunidades;nespacio++){
baseadornos.add(baserepeticion);
if(tile > 1){
for(int i=0;i<tile;i++){
baseadornos.add(objf.getAdornos().get(i));
}
}else{
baseadornos.add(objf.getAdornos().get(0));
}
}
}else{
Log.d(GLOBALES.TAG,"No hay espacio");
for(;nespacio < nunidades;nespacio++){
baseadornos.add(baserepeticion);
}
}
}else{
for(;nbase < nunidades;nbase++){
baseadornos.add(baserepeticion);
}
}
for(int i=0;i < nunidades;i++){
canvas.drawBitmap(baseadornos.get(i),i*ladoWidth,0,null);
}
}
return bmp;
}
The problem is that the value of random is always the same
In my activity I call a setText
:
tvdato.setText(String.valueOf("BIEN"));
I would like to know a method to make it provisional, that is, to last for a few seconds drawn on the screen.
Hi, I would like to display a text (especially letters) on my canvas. The idea is that every time you call the oncliklistener of the view, a letter is displayed on the screen.
I've seen that it might work with 'Canvas.drawText' Any ideas?
I have the following onDraw
:
public void onDraw(Canvas canvas) {
paint = new Paint();
paint.setColor(Color.RED);
canvas.drawRect(rectangulo,paint);
}
I would like to know how to implement so that it was not just Color.RED
random colors.
Something like an array with various colors and the set color calls it?
This is my code:
private static final int[] colores = {Color.GREEN,Color.BLUE,Color.RED};
In the constructor:
r = new Random();
num = r.nextInt(3);
and the Ondraw:
public void onDraw(Canvas canvas) {
paint = new Paint();
paint.setColor(colores[num]);
canvas.drawRect(rectangulo,paint);
}
How could I place a rectangle at the bottom of the screen?:
private void cargarJuego() {
r = new Rect(100,100,200,200);
escenario = new Escenario(r);
setContentView(new GameView(this,escenario));
}
I want to perform the concatenation of two String
:
String nombre = adornoF.getNombre();
String prefijo = ga.getsid();
String all = nombre + prefijo;
As long getNombre()
as getsid()
they return a String
.
Is it ok or is there a better way?
I am working with an app in AndroidStudio. What code could I implement so that when the back is called to exit the app, it tells me if I want to exit it or not?
I am working in Android Studio and I want to make a gradient of a canvas in a onDraw
; This is the gameview code:
protected void onDraw(Canvas canvas) {
canvas.drawColor(Color.GREEN); //Color fondo
}
How can the gradient be applied to the canvas in the method onDraw
?