Android Open Source - InfoWallpaper Select Configuration Dialog






From Project

Back to project page InfoWallpaper.

License

The source code is released under:

MIT License

If you think the Android project InfoWallpaper 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.andreashedin.general;
// w w w.  j a va 2 s  . com
import java.util.ArrayList;

import com.andreashedin.infowallpaper.R;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class SelectConfigurationDialog extends Dialog implements android.view.View.OnClickListener, OnItemClickListener {

  public interface SelectConfigurationListener {
    void configurationSelected(String str, int from);
  }
  
  SelectConfigurationListener mListener;
  ArrayList<String> mList;
  int mFrom;
  
  public SelectConfigurationDialog(Context context, SelectConfigurationListener listener, ArrayList<String> list, int from) {
    super(context);
    
    mListener = listener;
    mList = list;
    mFrom = from;
  }

  protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.select_configuration);
        
        ListView list = (ListView)findViewById(R.id.ListView02);
        list.setOnItemClickListener(this);
        
        ArrayAdapter<String> listAdapter = new ArrayAdapter<String>(getContext(), R.layout.list_item, mList);
        list.setAdapter(listAdapter);
        
        setTitle(R.string.selectConfigurationTitle);
  }
  
  @Override
  public void onBackPressed() {
    cancel();
  }

  @Override
  public void onClick(View arg0) {
    cancel();
  }

  @Override
  public void onItemClick(AdapterView<?> list, View view, int pos, long id) {
    String val = (String)list.getItemAtPosition(pos);
    mListener.configurationSelected(val, mFrom);
    dismiss();    
  }
}




Java Source Code List

com.andreashedin.general.ColorPickerDialog.java
com.andreashedin.general.CustomizeInfoDialog.java
com.andreashedin.general.EnterStringDialog.java
com.andreashedin.general.PickItemDialog.java
com.andreashedin.general.PositionInfosDialog.java
com.andreashedin.general.SelectConfigurationDialog.java
com.andreashedin.general.TextSizeDialog.java
com.andreashedin.general.WeatherSettingsDialog.java
com.andreashedin.infowallpaper.Background.java
com.andreashedin.infowallpaper.BatteryDataCollector.java
com.andreashedin.infowallpaper.ColorHandler.java
com.andreashedin.infowallpaper.ConfigHandler.java
com.andreashedin.infowallpaper.CurrentSongDataCollector.java
com.andreashedin.infowallpaper.DataCollector.java
com.andreashedin.infowallpaper.DateTimeDataCollector.java
com.andreashedin.infowallpaper.DisplayValuePair.java
com.andreashedin.infowallpaper.InfoData.java
com.andreashedin.infowallpaper.InfoItem.java
com.andreashedin.infowallpaper.LiveInfoSettings.java
com.andreashedin.infowallpaper.LiveInfoWallpaper.java
com.andreashedin.infowallpaper.PhoneStatusDataCollector.java
com.andreashedin.infowallpaper.Phone.java
com.andreashedin.infowallpaper.SaveLoadData.java
com.andreashedin.infowallpaper.Screen.java
com.andreashedin.infowallpaper.WeatherDataCollector.java
com.andreashedin.infowallpaper.WeatherHandler.java