Android Open Source - game_guess_lib Dialog Modal






From Project

Back to project page game_guess_lib.

License

The source code is released under:

MIT License

If you think the Android project game_guess_lib 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 com.wkmf.guess.lib.common.dialog;
/*w ww.j  a  v  a2 s  .  c om*/
import android.app.Dialog;
import android.content.Context;
import android.view.Window;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

import com.wkmf.guess.lib.R;

import java.util.ArrayList;
import java.util.List;

public class DialogModal {

  //propiedades
  private Context context;
  //lista de elementos que se mostrar
  private List<DialogElement> elements = new ArrayList<DialogElement>();
  //dialog
  private Dialog dialog;

  //constructores
  public DialogModal(Context context){
    this.context = context;
    initialize();
  }
  public DialogModal(Context context, List<DialogElement> elements){
    this.context = context;
    this.elements = elements;
    initialize();
  }

  //inicializamos objeto
  private void initialize(){
    dialog = new Dialog(context);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.dialog_modal_help);
    dialog.setCanceledOnTouchOutside(true);
  }

  //mtodo para aadir un elemento
  public void addElement(DialogElement element){
    this.elements.add(element);
  }
  //mtodos para mostrar el dialog
  public void show(OnItemClickListener onClick){
    //preparamos la lista
    final ListView dialogList = (ListView)dialog.findViewById(R.id.dialog_modal_list);
    //seteamos el adaptador
    dialogList.setAdapter(new DialogModalListAdapter(this.context, elements));
    //seteamos la accion
    dialogList.setOnItemClickListener(onClick);
    //mostramos el dialogo
    dialog.show();
  }
  public void show(OnItemClickListener onClick, List<DialogElement> extraElements){
    //preparamos la lista extra
    final ListView extraDialogList = (ListView)dialog.findViewById(R.id.dialog_modal_list_extra);
    //seteamos el adaptador
    extraDialogList.setAdapter(new DialogModalListAdapter(this.context, extraElements));
    //seteamos la accion
    extraDialogList.setOnItemClickListener(onClick);
    //lanzamos la comn
    show(onClick);
  }
  //cerramos
  public void dismiss(){
    dialog.dismiss();
  }

}




Java Source Code List

com.android.vending.billing.util.Base64DecoderException.java
com.android.vending.billing.util.Base64.java
com.android.vending.billing.util.IabException.java
com.android.vending.billing.util.IabHelper.java
com.android.vending.billing.util.IabResult.java
com.android.vending.billing.util.Inventory.java
com.android.vending.billing.util.Purchase.java
com.android.vending.billing.util.Security.java
com.android.vending.billing.util.SkuDetails.java
com.wkmf.guess.lib.common.Constants.java
com.wkmf.guess.lib.common.ads.GuessGameAdsListener.java
com.wkmf.guess.lib.common.ads.GuessGameAds.java
com.wkmf.guess.lib.common.api.GuessApi.java
com.wkmf.guess.lib.common.api.GuessRestApi.java
com.wkmf.guess.lib.common.async.DownloadTask.java
com.wkmf.guess.lib.common.dialog.DialogElement.java
com.wkmf.guess.lib.common.dialog.DialogModalListAdapter.java
com.wkmf.guess.lib.common.dialog.DialogModal.java
com.wkmf.guess.lib.data.GuessGameBDDHandler.java
com.wkmf.guess.lib.data.GuessSQL.java
com.wkmf.guess.lib.impl.GuessGameBaseApp.java
com.wkmf.guess.lib.impl.GuessGameImageDownload.java
com.wkmf.guess.lib.impl.GuessGameInterface.java
com.wkmf.guess.lib.purchase.items.GuessGameItems.java
com.wkmf.guess.lib.screen.GuessLevelScreen.java
com.wkmf.guess.lib.screen.GuessMainScreen.java
com.wkmf.guess.lib.screen.GuessQuestionScreen.java
com.wkmf.guess.lib.screen.adapter.LevelsAdapter.java
com.wkmf.guess.lib.screen.adapter.QuestionsAdapter.java
com.wkmf.guess.lib.service.GuessGameService.java
com.wkmf.guess.lib.service.GuessGameUpdater.java
com.wkmf.guess.lib.service.ServiceStarter.java
com.wkmf.guess.lib.structure.GuessConfig.java
com.wkmf.guess.lib.structure.GuessDrawable.java
com.wkmf.guess.lib.structure.GuessGame.java
com.wkmf.guess.lib.structure.GuessLevelType.java
com.wkmf.guess.lib.structure.GuessLevel.java
com.wkmf.guess.lib.structure.GuessQuestion.java