#DIALOG : GradientDrawable In CustomDialog

novembro 18, 2018     doido 2.0     1 Comments

#DIALOG : GradientDrawable In CustomDialog

VAMOS APRENDE A USAR GRADIENTDRAWABLE NO CUSTOM DIALOG RAPIDO E FACIL, SE VOCÊ NÃO SABE COMO FAZER O CUSTOM DIALOG RECOMENDO QUE VEJA O TUTORIAL DE COMO FAZER UM CUSTOM DIALOG. CREATE YOU CUSTOM DIALOG IN SKETCHWARE 1: Primeiro Abra seu projeto com um diálogo customizado já feito. ________________ 2:  Va Ate o customView do customDialog Veja o...

#DIALOG : CustomDialog

novembro 17, 2018     doido 2.0     4 Comments

#DIALOG : CustomDialog

VAMOS FAZER UM DIALOGO PARECIDO COM ESSE HOJE !!! APENAS 20 PASSOS BEM EXPLICADOS PARA NINGUEM ERRA NA HORA DE FAZER UM DIALOGO PERSONALIZADO 1: Abra o seu projeto no sketchware. _______________ 2: Abra o menur de Layouts. _______________ 3: Depois de Abri o Menu Aperte en CUSTOM VIEW. ________________ 4: Depois Aperte no Ícone de mais ao lado do...

CREATE WIDGET ;

agosto 31, 2018     doido 2.0     0 Comments

CREATE WIDGET ;

//EditText final EditText myedit = new EditText(ProjectinActivity.this); myedit.setHint("Your Hint"); myedit.setLayoutParams(new LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.WRAP_CONTENT, android.widget.LinearLayout.LayoutParams.WRAP_CONTENT)); mylinear.addView(myedit); //TextView final TextView mytext = new TextView(ProjectinActivity.this); mytext.setText("Your Text"); mytext.setTextColor(0xFF000000); mytext.setLayoutParams(new LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.WRAP_CONTENT, android.widget.LinearLayout.LayoutParams.WRAP_CONTENT)); mylinear.addView(mytext); //Button final Button mybutton = new Button(ProjectinActivity.this); mybutton.setText("Your Button"); mybutton.setLayoutParams(new LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.WRAP_CONTENT, android.widget.LinearLayout.LayoutParams.WRAP_CONTENT)); mylinear.addView(mybutton); //ProgressBar(Cicle) linear1 is an LinearLayout and MainActivity is your activity ProgressBar msg = new ProgressBar(MainActivity.this);  linear1.addView(msg); //ProgressBar  ProgressBar tp...

PORTRAIT ORIENTATION OF THE SCREEN ;

agosto 26, 2018     doido 2.0     0 Comments

PORTRAIT ORIENTATION OF THE SCREEN ;

setRequestedOrientation(android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); ...

LANDSCAPE ORIENTATION OF THE SCREEN ;

agosto 24, 2018     doido 2.0     0 Comments

LANDSCAPE ORIENTATION OF THE SCREEN ;

setRequestedOrientation(android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); ...

EDITTEXT SELECT ALL ON FOCUS;

agosto 24, 2018     doido 2.0     0 Comments

EDITTEXT SELECT ALL ON FOCUS;

edittext1.setSelectAllOnFocus(true); ...

TEXT OF THE VOICE ;

agosto 23, 2018     doido 2.0     0 Comments

TEXT OF THE VOICE ;

final android.speech.tts.TextToSpeech t1 = new android.speech.tts.TextToSpeech(getApplicationContext(), new android.speech.tts.TextToSpeech.OnInitListener() { @Override  public void onInit(int status) {  if(status == android.speech.tts.TextToSpeech.ERROR) { Toast.makeText(getApplicationContext(), "Error",Toast.LENGTH_SHORT).show();   }   }   } );   button1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View _v) {  String sentence = edittext1.getText().toString();  Toast.makeText(getApplicationContext(), sentence,Toast.LENGTH_SHORT).show(); t1.speak(sentence,android.speech.tts.TextToSpeech.QUEUE_FLUSH, null);  }  } ); ...

ONCLICKLISTENER IS ONTOUCHLISTENER ;

WIDGET.setOnTouchListener(new OnTouchListener() { PointF DownPT = new PointF(); PointF StartPT = new PointF(); @Override public boolean onTouch(View v, MotionEvent event) { int eid = event.getAction(); switch (eid) {

case MotionEvent.ACTION_MOVE : PointF mv=new PointF( event.getX() - DownPT.x, event.getY() - DownPT.y); img.setX((int)(StartPT.x+mv.x)); img.setY((int)(StartPT.y+mv.y)); StartPT= new PointF(img.getX(), img.getY()); break;

case MotionEvent.ACTION_DOWN : DownPT.x = event.getX(); DownPT.y = event.getY(); StartPT = new PointF(img.getX(), img.getY() ); break;

case MotionEvent.ACTION_UP : float distance = DownPT.x - event.getX(); if (distance == 0) { //block } break; default : break;} return true;} });

TOAST LONG MESSAGE ;

agosto 22, 2018     doido 2.0     0 Comments

TOAST LONG MESSAGE ;

Toast.makeText(getApplicationContext(), "Your Message", Toast.LENGTH_LONG).show(); ...

SET TEXT COLOR RGB :

agosto 22, 2018     doido 2.0     1 Comments

SET TEXT COLOR RGB :

textview1.setTextColor(Color.rgb(73,82,178)); ...

SET TEXT COLOR HEX :

agosto 22, 2018     doido 2.0     0 Comments

SET TEXT COLOR HEX :

textview1.setTextColor(Color.parseColor("#000000")); ...

DIALOG SET CANCELABLE :

agosto 22, 2018     doido 2.0     0 Comments

DIALOG SET CANCELABLE :

mydialog.setCancelable(false); ...

SHOW EDITTEXT DIALOG :

agosto 22, 2018     doido 2.0     0 Comments

SHOW EDITTEXT DIALOG :

LinearLayout mylayout = new LinearLayout(this); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); mylayout.setLayoutParams(params); mylayout.setOrientation(LinearLayout.VERTICAL); final EditText myedittext = new EditText(this);  myedittext.setLayoutParams(new LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT, android.widget.LinearLayout.LayoutParams.WRAP_CONTENT)); mylayout.addView(myedittext); mydialogcomp.setView(mylayout); ...

EDITTEXT DISABLE SUGGESTIONS ( MULTI LINE ) :

agosto 22, 2018     doido 2.0     0 Comments

EDITTEXT DISABLE SUGGESTIONS ( MULTI LINE ) :

edittext1.setRawInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); ...

EDITTEXT DISABLE SUGGESTIONS ( SINGLE LINE ) :

agosto 22, 2018     doido 2.0     0 Comments

EDITTEXT DISABLE SUGGESTIONS ( SINGLE LINE ) :

edittext1.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); ...