Java Code Examples for android.database.DataSetObserver

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project apps-for-android, under directory /Panoramio/src/com/google/android/panoramio/.

Source file: ImageManager.java

  22 
vote

/** 
 * Called when something changes in our data set. Cleans up any weak references that are no longer valid along the way.
 */
private void notifyObservers(){
  final ArrayList<WeakReference<DataSetObserver>> observers=mObservers;
  final int count=observers.size();
  for (int i=count - 1; i >= 0; i--) {
    WeakReference<DataSetObserver> weak=observers.get(i);
    DataSetObserver obs=weak.get();
    if (obs != null) {
      obs.onChanged();
    }
 else {
      observers.remove(i);
    }
  }
}
 

Example 2

From project 2Degrees-Toolbox, under directory /ActionBarSherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  21 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 3

From project ActionBarSherlock, under directory /library/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  21 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 4

From project AmDroid, under directory /AmDroid/src/main/java/com/jaeckel/amenoid/cwac/adapter/.

Source file: AdapterWrapper.java

  21 
vote

/** 
 * Constructor wrapping a supplied ListAdapter
 */
public AdapterWrapper(ListAdapter wrapped){
  super();
  this.wrapped=wrapped;
  wrapped.registerDataSetObserver(new DataSetObserver(){
    public void onChanged(){
      notifyDataSetChanged();
    }
    public void onInvalidated(){
      notifyDataSetInvalidated();
    }
  }
);
}
 

Example 5

From project frameworks_opt, under directory /mailcommon/java/com/android/mailcommon/.

Source file: MergedAdapter.java

  21 
vote

public MergedAdapter(){
  mObserver=new DataSetObserver(){
    @Override public void onChanged(){
      notifyDataSetChanged();
    }
  }
;
}
 

Example 6

From project iPhoroidUI, under directory /src/org/klab/iphoroid/widget/listview/.

Source file: AdapterWrapper.java

  21 
vote

/** 
 * Constructor wrapping a supplied ListAdapter
 */
public AdapterWrapper(ListAdapter wrapped){
  super();
  this.wrapped=wrapped;
  wrapped.registerDataSetObserver(new DataSetObserver(){
    public void onChanged(){
      notifyDataSetChanged();
    }
    public void onInvalidated(){
      notifyDataSetInvalidated();
    }
  }
);
}
 

Example 7

From project NotePad, under directory /src/com/nononsenseapps/ui/.

Source file: ListPagerAdapter.java

  21 
vote

public ListPagerAdapter(Context context,final FragmentManager fm,final ExtrasCursorAdapter wrappedAdapter,final int countAdjust){
  super(context,fm);
  this.wrappedAdapter=wrappedAdapter;
  this.countAdjust=countAdjust;
  subObserver=new DataSetObserver(){
    @Override public void onChanged(){
      notifyDataSetChanged();
    }
    @Override public void onInvalidated(){
    }
  }
;
  if (wrappedAdapter != null)   wrappedAdapter.registerDataSetObserver(subObserver);
}
 

Example 8

From project platform_packages_apps_browser, under directory /src/com/android/browser/.

Source file: NavTabScroller.java

  21 
vote

protected void setAdapter(BaseAdapter adapter,int selection){
  mAdapter=adapter;
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      handleDataChanged();
    }
    @Override public void onInvalidated(){
      super.onInvalidated();
    }
  }
);
  handleDataChanged(selection);
}
 

Example 9

From project Amantech, under directory /Android/action_bar_sherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 10

From project andlytics, under directory /actionbarsherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 11

From project androidZenWriter, under directory /library/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 12

From project Common-Sense-Net-2, under directory /AndroidBarSherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 13

From project cw-omnibus, under directory /external/ActionBarSherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 14

From project DeskSMS, under directory /ActionBarSherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 15

From project dmix, under directory /ActionBarSherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 16

From project dreamDroid, under directory /libraries/ABS/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 17

From project examples_2, under directory /SearchView/actionbarsherlock-lib/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 18

From project farebot, under directory /libs/ActionBarSherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 19

From project finch, under directory /libs/JakeWharton-ActionBarSherlock-2eabf25/library/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 20

From project GnucashMobile, under directory /com_actionbarsherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 21

From project Google-Tasks-Client, under directory /actionbarsherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 22

From project HSR-Timetable, under directory /ActionBarSherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 23

From project iosched_3, under directory /android/src/com/google/android/apps/iosched/ui/widget/.

Source file: SimpleSectionedListAdapter.java

  20 
vote

public SimpleSectionedListAdapter(Context context,int sectionResourceId,ListAdapter baseAdapter){
  mLayoutInflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mSectionResourceId=sectionResourceId;
  mBaseAdapter=baseAdapter;
  mBaseAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      mValid=!mBaseAdapter.isEmpty();
      notifyDataSetChanged();
    }
    @Override public void onInvalidated(){
      mValid=false;
      notifyDataSetInvalidated();
    }
  }
);
}
 

Example 24

From project IRC-Client, under directory /actionbarsherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 25

From project MensaUPB, under directory /libs/ActionbarSherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 26

From project mWater-Android-App, under directory /android/actionbarsherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 27

From project MyHeath-Android, under directory /actionbarlib/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 28

From project onebusaway-android, under directory /ActionBarSherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 29

From project open311-android, under directory /ActionBarSherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 30

From project RoboBinding, under directory /robobinding/src/main/java/org/robobinding/viewattribute/adapterview/.

Source file: OnItemSelectedAttribute.java

  20 
vote

@Override protected void bind(final Command command){
  adapterViewListeners.addOnItemSelectedListener(new OnItemSelectedListener(){
    @Override public void onItemSelected(    AdapterView<?> parent,    View view,    int position,    long id){
      ItemClickEvent itemClickEvent=new ItemClickEvent(parent,view,position,id);
      command.invoke(itemClickEvent);
    }
    @Override public void onNothingSelected(    AdapterView<?> parent){
      ItemClickEvent itemClickEvent=new ItemClickEvent(parent,null,AdapterView.INVALID_POSITION,0);
      command.invoke(itemClickEvent);
    }
  }
);
  view.getAdapter().registerDataSetObserver(new DataSetObserver(){
    public void onChanged(){
      int position=view.getSelectedItemPosition();
      if (position >= view.getCount())       return;
      ItemClickEvent itemClickEvent=new ItemClickEvent(view,view.getChildAt(position),position,0);
      command.invoke(itemClickEvent);
    }
  }
);
}
 

Example 31

From project Schedule, under directory /libs/android/sherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 32

From project SeriesGuide, under directory /ActionBarSherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 33

From project SMSSync, under directory /abslib/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 34

From project Something-Awful-Android, under directory /libraries/Sherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 35

From project The-Reverse-Recipe-Book, under directory /actionbarsherlock4.0/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 36

From project Unibeer, under directory /libs/sherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 37

From project XTrade, under directory /sherlock-bar/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 38

From project Yaaic, under directory /libs/ActionBarSherlock/src/com/actionbarsherlock/widget/.

Source file: ActivityChooserView.java

  20 
vote

/** 
 * Create a new instance.
 * @param context The application environment.
 * @param attrs A collection of attributes.
 * @param defStyle The default style to apply to this view.
 */
public ActivityChooserView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mContext=context;
  TypedArray attributesArray=context.obtainStyledAttributes(attrs,R.styleable.SherlockActivityChooserView,defStyle,0);
  mInitialActivityCount=attributesArray.getInt(R.styleable.SherlockActivityChooserView_initialActivityCount,ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT);
  Drawable expandActivityOverflowButtonDrawable=attributesArray.getDrawable(R.styleable.SherlockActivityChooserView_expandActivityOverflowButtonDrawable);
  attributesArray.recycle();
  LayoutInflater inflater=LayoutInflater.from(mContext);
  inflater.inflate(R.layout.abs__activity_chooser_view,this,true);
  mCallbacks=new Callbacks();
  mActivityChooserContent=(IcsLinearLayout)findViewById(R.id.abs__activity_chooser_view_content);
  mActivityChooserContentBackground=mActivityChooserContent.getBackground();
  mDefaultActivityButton=(FrameLayout)findViewById(R.id.abs__default_activity_button);
  mDefaultActivityButton.setOnClickListener(mCallbacks);
  mDefaultActivityButton.setOnLongClickListener(mCallbacks);
  mDefaultActivityButtonImage=(ImageView)mDefaultActivityButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButton=(FrameLayout)findViewById(R.id.abs__expand_activities_button);
  mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
  mExpandActivityOverflowButtonImage=(ImageView)mExpandActivityOverflowButton.findViewById(R.id.abs__image);
  mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable);
  mAdapter=new ActivityChooserViewAdapter();
  mAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      updateAppearance();
    }
  }
);
  Resources resources=context.getResources();
  mListPopupMaxWidth=Math.max(resources.getDisplayMetrics().widthPixels / 2,resources.getDimensionPixelSize(R.dimen.abs__config_prefDialogWidth));
}
 

Example 39

From project android-database-sqlcipher, under directory /src/net/sqlcipher/database/.

Source file: SQLiteCursor.java

  19 
vote

public void registerDataSetObserver(DataSetObserver observer){
  super.registerDataSetObserver(observer);
  if ((Integer.MAX_VALUE != mMaxRead || Integer.MAX_VALUE != mInitialRead) && mNotificationHandler == null) {
    queryThreadLock();
    try {
      mNotificationHandler=new MainThreadNotificationHandler();
      if (mPendingData) {
        notifyDataSetChange();
        mPendingData=false;
      }
    }
  finally {
      queryThreadUnlock();
    }
  }
}
 

Example 40

From project android-wheel, under directory /wheel/src/kankan/wheel/widget/adapters/.

Source file: AbstractWheelAdapter.java

  19 
vote

@Override public void registerDataSetObserver(DataSetObserver observer){
  if (datasetObservers == null) {
    datasetObservers=new LinkedList<DataSetObserver>();
  }
  datasetObservers.add(observer);
}
 

Example 41

From project android-wheel-datetime-picker, under directory /src/kankan/wheel/widget/adapters/.

Source file: AbstractWheelAdapter.java

  19 
vote

@Override public void registerDataSetObserver(DataSetObserver observer){
  if (datasetObservers == null) {
    datasetObservers=new LinkedList<DataSetObserver>();
  }
  datasetObservers.add(observer);
}
 

Example 42

From project android-wheel_1, under directory /wheel/src/kankan/wheel/widget/adapters/.

Source file: AbstractWheelAdapter.java

  19 
vote

@Override public void registerDataSetObserver(DataSetObserver observer){
  if (datasetObservers == null) {
    datasetObservers=new LinkedList<DataSetObserver>();
  }
  datasetObservers.add(observer);
}
 

Example 43

From project android_ioio_combination_lock, under directory /src/kankan/wheel/widget/adapters/.

Source file: AbstractWheelAdapter.java

  19 
vote

@Override public void registerDataSetObserver(DataSetObserver observer){
  if (datasetObservers == null) {
    datasetObservers=new LinkedList<DataSetObserver>();
  }
  datasetObservers.add(observer);
}
 

Example 44

From project android_packages_apps_Gallery3D, under directory /src/com/cooliris/media/.

Source file: SortCursor.java

  19 
vote

@Override public void registerDataSetObserver(DataSetObserver observer){
  int length=mCursors.length;
  for (int i=0; i < length; i++) {
    if (mCursors[i] != null) {
      mCursors[i].registerDataSetObserver(observer);
    }
  }
}
 

Example 45

From project android_packages_apps_QuickSearchBox, under directory /src/com/android/quicksearchbox/.

Source file: Suggestions.java

  19 
vote

/** 
 * Registers an observer that will be notified when the reported results or the done status changes.
 */
public void registerDataSetObserver(DataSetObserver observer){
  if (mClosed) {
    throw new IllegalStateException("registerDataSetObserver() when closed");
  }
  mDataSetObservable.registerObserver(observer);
}
 

Example 46

From project DownloadProvider, under directory /src/com/mozillaonline/providers/downloads/ui/.

Source file: DateSortedExpandableListAdapter.java

  19 
vote

@Override public void onChanged(){
  buildMap();
  for (  DataSetObserver o : mObservers) {
    o.onChanged();
  }
}
 

Example 47

From project GeekAlarm, under directory /android/src/kankan/wheel/widget/adapters/.

Source file: AbstractWheelAdapter.java

  19 
vote

@Override public void registerDataSetObserver(DataSetObserver observer){
  if (datasetObservers == null) {
    datasetObservers=new LinkedList<DataSetObserver>();
  }
  datasetObservers.add(observer);
}
 

Example 48

From project Locast-Android, under directory /src/org/jsharkey/blog/android/.

Source file: SeparatedListAdapter.java

  19 
vote

@Override public void registerDataSetObserver(DataSetObserver observer){
  super.registerDataSetObserver(observer);
  for (  final SectionHeader header : sections) {
    header.adapter.registerDataSetObserver(observer);
  }
}
 

Example 49

From project platform_packages_apps_music, under directory /src/com/android/music/.

Source file: SortCursor.java

  19 
vote

@Override public void registerDataSetObserver(DataSetObserver observer){
  int length=mCursors.length;
  for (int i=0; i < length; i++) {
    if (mCursors[i] != null) {
      mCursors[i].registerDataSetObserver(observer);
    }
  }
}
 

Example 50

From project platform_packages_providers_downloadprovider, under directory /ui/src/com/android/providers/downloads/ui/.

Source file: DateSortedExpandableListAdapter.java

  19 
vote

@Override public void onChanged(){
  buildMap();
  for (  DataSetObserver o : mObservers) {
    o.onChanged();
  }
}
 

Example 51

From project propoid, under directory /propoid-ui/src/main/java/propoid/ui/list/.

Source file: GenericAdapter.java

  19 
vote

/** 
 * Closes a wrapped  {@link Closeable} on removal of the last observer.
 * @param observer
 */
@Override public void unregisterDataSetObserver(DataSetObserver observer){
  if (!observers.remove(observer)) {
    throw new IllegalArgumentException();
  }
  if (observers.isEmpty() && (items instanceof Closeable)) {
    try {
      ((Closeable)items).close();
    }
 catch (    IOException ex) {
      throw new RuntimeException(ex);
    }
  }
}
 

Example 52

From project QuotaForAndroid, under directory /wheel/src/kankan/wheel/widget/adapters/.

Source file: AbstractWheelAdapter.java

  19 
vote

@Override public void registerDataSetObserver(DataSetObserver observer){
  if (datasetObservers == null) {
    datasetObservers=new LinkedList<DataSetObserver>();
  }
  datasetObservers.add(observer);
}
 

Example 53

From project yammp, under directory /src/org/yammp/util/.

Source file: SortCursor.java

  19 
vote

@Override public void registerDataSetObserver(DataSetObserver observer){
  int length=mCursors.length;
  for (int i=0; i < length; i++) {
    if (mCursors[i] != null) {
      mCursors[i].registerDataSetObserver(observer);
    }
  }
}