SimplePopupTable.java 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package de.tudarmstadt.informatik.hostage.ui2.popup;
  2. import android.content.Context;
  3. import android.view.View;
  4. import android.widget.LinearLayout;
  5. import android.widget.TextView;
  6. import de.tudarmstadt.informatik.hostage.R;
  7. /**
  8. * Created by Julien on 13.02.14.
  9. */
  10. public class SimplePopupTable extends AbstractPopup {
  11. private String title;
  12. /**
  13. * Set the popup title.
  14. * @param title string
  15. */
  16. public void setTitle(String title){
  17. this.title = title;
  18. if (this.getPopupView() != null) this.configureView(this.getPopupView());
  19. }
  20. /**
  21. * Returns the popup title.
  22. * @return String title.
  23. */
  24. public String getTitle(){
  25. return this.title;
  26. }
  27. /**
  28. * Constructor
  29. * @param context the context
  30. * @param listener user event listener
  31. */
  32. public SimplePopupTable(Context context, OnPopupItemClickListener listener){
  33. super(context, listener);
  34. }
  35. @Override
  36. public LinearLayout getScrollableItemLayout() {
  37. return (LinearLayout) this.getRootView().findViewById(R.id.item_scroll_layout);
  38. }
  39. @Override
  40. public int getLayoutId(){
  41. return R.layout.simple_popup_table;
  42. }
  43. @Override
  44. void configureView(View view){
  45. TextView titleView = (TextView) view.findViewById(R.id.title_text_view);
  46. titleView.setText(this.title);
  47. }
  48. }