@Override
        public void onClick(View v) {

          if (v != null) {
            final int position =
                ((ExpandableListActivity) context).getExpandableListView().getPositionForView(v)
                    - 1; // Give the position of parent view
            Log.d("" + position, "checkposition");
            final long packedPosition =
                ((ExpandableListActivity) context)
                    .getExpandableListView()
                    .getExpandableListPosition(position);
            Log.d("" + packedPosition, "checkposition");
            ((ExpandableListActivity) context).getExpandableListView();

            // final int packedPosition =
            // ((ExpandableListActivity)context).getExpandableListView().getExpandableListPosition(position);
            final int groupPosition = ExpandableListView.getPackedPositionGroup(packedPosition);
            if (groupPosition != AdapterView.INVALID_POSITION) {

              mCallBack = (OnGroupClickListener) ((Activity) context);
              mCallBack.OnGroupClick(
                  groupPosition, groupItem.get(groupPosition).getDescription().toString(), "copy");
            }
          }
        }
 @Override
 protected void onPause() {
   super.onPause();
   if (operationTask != null) {
     operationTask.cancel(true);
   }
 }
Esempio n. 3
0
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    setupViewComponent();
  }
Esempio n. 4
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   this.setTitle("С¹ø·¹");
   mAdapter = new qiangzixiaochi(this);
   setListAdapter(mAdapter);
   registerForContextMenu(this.getExpandableListView());
 }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.expandablelistview);
   userPresenter = new UserPresenter(this);
   initView();
   userPresenter.getUserInfo();
 }
Esempio n. 6
0
 @Override
 protected void onDestroy() {
   // TODO Auto-generated method stub
   super.onDestroy();
   if (contactsManagerDbAdapter != null) {
     contactsManagerDbAdapter.close();
     contactsManagerDbAdapter = null;
   }
 }
Esempio n. 7
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   mContext = this;
   // Set up our adapter
   mAdapter = new MyExpandableListAdapter();
   setListAdapter(mAdapter);
   registerForContextMenu(getExpandableListView());
 }
 /*
  * (non-Javadoc)
  *
  * @see android.app.Activity#onCreateOptionsMenu(android.view.Menu)
  */
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   super.onCreateOptionsMenu(menu);
   if (!widgetConfig) {
     MenuInflater inflater = getMenuInflater();
     inflater.inflate(R.menu.chooser_menu, menu);
   }
   return !widgetConfig;
 }
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);

    MenuItem item;
    item = menu.add(0, MENU_CLEAR_HISTORY, 0, R.string.Commons_ClearHistory);
    item.setIcon(R.drawable.ic_menu_delete);

    return true;
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setTitle(R.string.HistoryListActivity_Title);

    registerForContextMenu(getExpandableListView());

    fillData();
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // List<TravelWarning> travelWarnings = new ArrayList<TravelWarning>();
    // Set up our adapter
    mAdapter = new MyExpandableListAdapter();
    setListAdapter(mAdapter);
    registerForContextMenu(getExpandableListView());
  }
 /** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   widgetConfig =
       getIntent().getAction().equals("com.bubblesworth.soundboard.APPWIDGET_CONFIGURE");
   new GetCategoryCursor().execute();
   if (widgetConfig) {
     setResult(RESULT_CANCELED);
   } else {
     registerForContextMenu(getExpandableListView());
     setVolumeControlStream(AudioManager.STREAM_MUSIC);
   }
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getExpandableListView().setGroupIndicator(null); // Removes group indicator from group views

    // Shuffle the list to help show how groups are no longer being sorted
    List<MovieItem> movies = new ArrayList<>(MovieContent.ITEM_LIST);
    Collections.shuffle(movies);

    // Create our adapter and set it.
    DemoAdapter adapter = new DemoAdapter(this, movies);
    setListAdapter(adapter);
  }
  @Override
  public void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    getExpandableListView().setFastScrollEnabled(true);

    LibraryActivity parentActivity = (LibraryActivity) getParent();
    int serverId = parentActivity.getIntent().getExtras().getInt(LibraryActivity.SERVER_ID);

    TuneStreamerApp app = (TuneStreamerApp) getApplication();
    mLibrary = app.getServer(serverId).getMainLibrary();

    setListAdapter(new ArtistListAdapter(this, mLibrary));
  }
 @SuppressWarnings("unchecked")
 @Override
 protected void onResume() {
   super.onResume();
   if (asyncLoader == null || asyncLoader.getResult() == null) {
     Object indexes = getLastNonConfigurationInstance();
     asyncLoader = new LoadLocalIndexTask();
     if (indexes instanceof List<?>) {
       asyncLoader.setResult((List<LocalIndexInfo>) indexes);
     } else {
       asyncLoader.execute(this);
     }
   }
 }
Esempio n. 16
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (MainApplication.isOnline(getApplicationContext())) {
      setContentView(R.layout.activity_store);

      DataManager.fetchStoreData(
          new DataManager.VolleyCallback() {
            @Override
            public void onSuccess(String result) {
              try {
                data = new JSONObject(result);
                populateStore();
              } catch (JSONException e) {
                e.printStackTrace();
              }
            }
          });
    } else {
      setContentView(R.layout.offline_screen);
      Button retryConnectionButton = (Button) findViewById(R.id.retryConnectionButton);
      retryConnectionButton.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View v) {
              if (MainApplication.isOnline(getApplicationContext())) {
                setContentView(R.layout.activity_store);
                DataManager.fetchStoreData(
                    new DataManager.VolleyCallback() {
                      @Override
                      public void onSuccess(String result) {
                        try {
                          data = new JSONObject(result);
                          populateStore();
                        } catch (JSONException e) {
                          e.printStackTrace();
                        }
                      }
                    });
              }
            }
          });
    }
  }
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.time_results);
   results = TrainerApplication.getResults();
   List<Date> days = results.getOneTimeWorkoutModel().getAllDays();
   Log.i("mirinda1", "" + doGroupList(days));
   ExpandableListAdapter listAdapter =
       new SimpleExpandableListAdapter(
           this,
           doGroupList(days),
           R.layout.time_r_group_row,
           new String[] {TIME},
           new int[] {android.R.id.text1},
           doChildList(days),
           R.layout.time_r_child_row,
           new String[] {TIME, DRILLNAME, COUNT},
           new int[] {R.id.text, android.R.id.text1, android.R.id.text2});
   setListAdapter(listAdapter);
 }
Esempio n. 18
0
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.main);
    getExpandableListView().setBackgroundResource(R.drawable.default_bg);
    registerForContextMenu(getExpandableListView());

    contactsManagerDbAdapter = new ContactsManagerDbAdater(this);
    contactsManagerDbAdapter.open();

    initMyAdapter();

    initPopupWindow();

    getExpandableListView().setCacheColorHint(0); // 拖动时避免出现黑色
    getExpandableListView().setDivider(null); // 去掉每项下面的黑线(分割线)
    // 自定义下拉图标
    getExpandableListView()
        .setGroupIndicator(getResources().getDrawable(R.drawable.expander_ic_folder));
  }
  @Override
  public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);

    ExpandableListView.ExpandableListContextMenuInfo info =
        (ExpandableListView.ExpandableListContextMenuInfo) menuInfo;

    int type = ExpandableListView.getPackedPositionType(info.packedPosition);
    int group = ExpandableListView.getPackedPositionGroup(info.packedPosition);
    int child = ExpandableListView.getPackedPositionChild(info.packedPosition);

    if (type == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {

      HistoryItem item = (HistoryItem) getExpandableListAdapter().getChild(group, child);
      menu.setHeaderTitle(item.getTitle());

      menu.add(0, MENU_OPEN_IN_TAB, 0, R.string.HistoryListActivity_MenuOpenInTab);
      menu.add(0, MENU_COPY_URL, 0, R.string.BookmarksHistoryActivity_MenuCopyLinkUrl);
      menu.add(0, MENU_SHARE, 0, R.string.Main_MenuShareLinkUrl);
      menu.add(0, MENU_DELETE_FROM_HISTORY, 0, R.string.HistoryListActivity_MenuDelete);
    }
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.local_index);
    settings = OsmandSettings.getOsmandSettings(this);
    descriptionLoader = new LoadLocalIndexDescriptionTask();
    listAdapter = new LocalIndexesAdapter();

    findViewById(R.id.DownloadButton)
        .setOnClickListener(
            new View.OnClickListener() {

              @Override
              public void onClick(View v) {
                asyncLoader.setResult(null);
                startActivity(new Intent(LocalIndexesActivity.this, DownloadIndexActivity.class));
              }
            });

    getExpandableListView()
        .setOnCreateContextMenuListener(
            new View.OnCreateContextMenuListener() {
              @Override
              public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
                long packedPos = ((ExpandableListContextMenuInfo) menuInfo).packedPosition;
                int group = ExpandableListView.getPackedPositionGroup(packedPos);
                int child = ExpandableListView.getPackedPositionChild(packedPos);
                if (child >= 0 && group >= 0) {
                  final LocalIndexInfo point = (LocalIndexInfo) listAdapter.getChild(group, child);
                  showContextMenu(point);
                }
              }
            });

    setListAdapter(listAdapter);
    updateDescriptionTextWithSize();
  }
  public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.selected_elv_main);
    db = SightWordsReaderDb.getInstance(this);

    try {

      Intent intent = getIntent();
      Bundle b = intent.getExtras();
      sightWordList = b.getParcelable("sightWordList");

      ExpandableAppAdapter expListAdapter =
          new ExpandableAppAdapter(this, createGroupList(), createChildListWithLetters());

      setListAdapter(expListAdapter);

    } catch (Exception e) {
      System.out.println("Errrr +++ " + e.getMessage());
      throw new RuntimeException("Hello, McFly...look in the logs!");
    }
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.medical_remedy_main);

    expList = getExpandableListView();
    expList.setAdapter(new MaleMedicalRemedyExpAdapterHand(this));

    expList.setOnGroupExpandListener(
        new OnGroupExpandListener() {
          public void onGroupExpand(int groupPosition) {
            Log.e("onGroupExpand", "OK" + groupPosition);
          }
        });

    expList.setOnGroupCollapseListener(
        new OnGroupCollapseListener() {
          public void onGroupCollapse(int groupPosition) {
            Log.e("onGroupCollapse", "OK" + groupPosition);
          }
        });

    expList.setOnChildClickListener(
        new OnChildClickListener() {
          public boolean onChildClick(
              ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
            // TODO Auto-generated method stub
            Log.e("OnChildClickListener", "OK");
            TextView tvchild = (TextView) v.findViewById(R.id.tvPlayerName);
            Log.e("OnChildClickListener", tvchild.getText().toString());
            Intent in = new Intent("com.MedicalRemedy.android.DISP");
            in.putExtra("title", arrGroupelements[groupPosition]);
            in.putExtra("text", arrChildelements[groupPosition][childPosition]);
            startActivity(in);
            return false;
          }
        });
  }
 public void onContentChanged() {
   System.out.println("onContentChanged");
   super.onContentChanged();
 }
 /*
  * (non-Javadoc)
  *
  * @see android.app.ExpandableListActivity#onCreateContextMenu(android.view.
  * ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo)
  */
 @Override
 public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
   super.onCreateContextMenu(menu, v, menuInfo);
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(R.menu.chooser_context_menu, menu);
 }
Esempio n. 25
0
 public EndlessListAdapter(ExpandableListActivity activity, int progressItemLayoutResId) {
   this(activity, activity.getExpandableListView(), progressItemLayoutResId);
 }
 @Override
 protected void onDestroy() {
   super.onDestroy();
   asyncLoader.cancel(true);
   descriptionLoader.cancel(true);
 }
Esempio n. 27
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    ExpandableListAdapter adapter =
        new BaseExpandableListAdapter() {

          private TextView getTextView() {
            AbsListView.LayoutParams lp =
                new AbsListView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 64);
            TextView textView = new TextView(SelectCityActivity.this);
            textView.setLayoutParams(lp);
            textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
            textView.setPadding(36, 0, 0, 0);
            textView.setTextSize(20);
            return textView;
          }

          @Override
          public boolean isChildSelectable(int groupPosition, int childPosition) {
            // TODO Auto-generated method stub
            return true;
          }

          @Override
          public boolean hasStableIds() {
            // TODO Auto-generated method stub
            return true;
          }

          @Override
          public View getGroupView(
              int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
            // TODO Auto-generated method stub
            LinearLayout ll = new LinearLayout(SelectCityActivity.this);
            ll.setOrientation(0);
            ImageView logo = new ImageView(SelectCityActivity.this);
            logo.setImageResource(logos[groupPosition]);
            ll.addView(logo);
            TextView textView = getTextView();
            textView.setText(getGroup(groupPosition).toString());
            ll.addView(textView);
            return ll;
          }

          @Override
          public long getGroupId(int groupPosition) {
            // TODO Auto-generated method stub
            return groupPosition;
          }

          @Override
          public int getGroupCount() {
            // TODO Auto-generated method stub
            return provinces.length;
          }

          @Override
          public Object getGroup(int groupPosition) {
            // TODO Auto-generated method stub
            return provinces[groupPosition];
          }

          @Override
          public int getChildrenCount(int groupPosition) {
            // TODO Auto-generated method stub
            return cites[groupPosition].length;
          }

          @Override
          public View getChildView(
              int groupPosition,
              int childPosition,
              boolean isLastChild,
              View convertView,
              ViewGroup parent) {
            // TODO Auto-generated method stub

            TextView textView = getTextView();
            textView.setText(getChild(groupPosition, childPosition).toString());
            return textView;
          }

          @Override
          public long getChildId(int groupPosition, int childPosition) {
            // TODO Auto-generated method stub
            return childPosition;
          }

          @Override
          public Object getChild(int groupPosition, int childPosition) {
            // TODO Auto-generated method stub
            return cites[groupPosition][childPosition];
          }
        };

    setListAdapter(adapter);
    getExpandableListView()
        .setOnChildClickListener(
            new OnChildClickListener() {

              @Override
              public boolean onChildClick(
                  ExpandableListView parent,
                  View source,
                  int groupPosition,
                  int childPosition,
                  long id) {
                // TODO Auto-generated method stub
                Intent intent = getIntent();
                intent.putExtra("city", cites[groupPosition][childPosition]);
                SelectCityActivity.this.setResult(0, intent);
                SelectCityActivity.this.finish();
                return false;
              }
            });
  }