android - background of progressbar show -


i'm reading qr codes bluetooth device , every time find simulates "enter" whenever detect enter key runs show progressbar. put dark background transparent when dialog or released. have not found way progressbar.

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layoutlectorbluetooth" android:background="@android:color/transparent" android:layout_width="match_parent" android:layout_height="match_parent" >  <edittext     android:id="@+id/lectura"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:background="@drawable/background_edittext"     android:inputtype="textfilter|textmultiline"     android:cursorvisible="false"     android:singleline="true"     android:lines="1"     android:scrollhorizontally="true"     android:layout_margintop="148dp" />    <imageview     android:id="@+id/imageview2"     android:layout_width="300dp"     android:layout_height="300dp"     android:layout_alignparentleft="true"     android:src="@drawable/scan_trans" />  <textview     android:id="@+id/textoejemplo"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_below="@+id/imageview2"     android:layout_centerhorizontal="true"     android:layout_margintop="26dp"     android:text="escanea el e-ticket para validarlo."     android:textappearance="?android:attr/textappearancemedium" />  <textview     android:id="@+id/txtvalidando"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_below="@+id/textoejemplo"     android:layout_centerhorizontal="true"     android:layout_margintop="30dp"     android:text=""     android:visibility="gone"     android:textappearance="?android:attr/textappearancesmall" />  <progressbar     android:id="@+id/loader_prueba"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_below="@+id/textoejemplo"     android:layout_centerhorizontal="true"     android:visibility="gone"     android:indeterminate="true" />   </relativelayout> 

oncreate activity

    lectura = (edittext)findviewbyid(r.id.lectura);     lectura.setonkeylistener(new onkeylistener() {     public boolean onkey(view view, int keycode, keyevent keyevent)  {             //this!     findviewbyid(r.id.loader_prueba).setvisibility(view.visible); 

example

enter image description here

edit

enter image description here

there 2 things wrong approach:

  1. the @android:color/transparent attribute totally transparent in no color @ all. you'll want opaque black color
  2. if apply android:background progressbar won't cover whole window, instead you'll have add new view has both height , width set match_parent

edit: based on full layout posted now, add following (inside relativelayout):

<relativelayout> <!-- that's 1 have -->     <view         android:id="@+id/background_dim"         android:layout_height="match_parent"         android:layout_width="match_parent"         android:background="#42000000"         android:visibility="gone" /> </relativelayout> 

then need set view visible when showing progressbar:

findviewbyid(r.id.background_dim).setvisibility(view.visible); 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -