Android Open Source - UniApp Pop Up Window






From Project

Back to project page UniApp.

License

The source code is released under:

MIT License

If you think the Android project UniApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package it.nic.uniapp;
//from   www  .jav a2 s.  c  o  m


import it.nic.uniapp.db.EsameEntity;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.view.Display;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ListView;
import android.widget.PopupWindow;




public class PopUpWindow extends PopupWindow {
  
  private Button btnClose = null;
  private ListView lista = null;
  private List<EsameEntity>esami = null;
  
  public PopUpWindow(Context context, Activity activity) {
    
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View layout = inflater.inflate(R.layout.popup_window, (ViewGroup) activity.findViewById(R.id.popup__element));

    Display display = activity.getWindowManager().getDefaultDisplay();
    int width = display.getWidth();
    int height = display.getHeight();
    this.setHeight(height - height / 3);
    this.setWidth(width - width / 4);
    
    this.showAtLocation(layout, Gravity.CENTER, 0, 0);

    this.btnClose = (Button)activity.findViewById(R.id.popup__btnclose);
    
    this.btnClose.setOnClickListener(btn_OnClickListener);
    
  }

  private void OnClick(View view) {
    String tag = view.getTag() != null ? (String) view.getTag() : null;

    if (tag != null && tag.equals("popup__btnclose")) {
      this.dismiss();
    }
    
  }
    
    

  private OnClickListener btn_OnClickListener = new OnClickListener() {
    public void onClick(View view) {
      OnClick(view);
    }

  };

}




Java Source Code List

it.nic.uniapp.AddEsame.java
it.nic.uniapp.CalendarioEsami.java
it.nic.uniapp.FunzioniEsami.java
it.nic.uniapp.ListaEsami.java
it.nic.uniapp.MainActivity.java
it.nic.uniapp.PopUpWindow.java
it.nic.uniapp.UpdateEsame.java
it.nic.uniapp.adapters.EsameAdapter.java
it.nic.uniapp.adapters.GridCellAdapter.java
it.nic.uniapp.cmp.EsameRowControl.java
it.nic.uniapp.core.Constants.java
it.nic.uniapp.core.PageLoader.java
it.nic.uniapp.db.DBHandler.java
it.nic.uniapp.db.DatabaseConfigUtil.java
it.nic.uniapp.db.DatabaseHelper.java
it.nic.uniapp.db.EsameEntity.java
it.nic.uniapp.db.IDBHandler.java
it.nic.uniapp.util.Util.java