Java Code Examples for android.widget.ProgressBar

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 Airports, under directory /src/com/nadmm/airports/library/.

Source file: LibraryFragment.java

  18 
vote

protected void handleBook(Intent intent){
  String pdfName=intent.getStringExtra(LibraryService.BOOK_NAME);
  View row=mBookRowMap.get(pdfName);
  if (row != null) {
    String path=intent.getStringExtra(LibraryService.PDF_PATH);
    showStatus(row,path != null);
    if (path != null) {
      row.setTag(R.id.LIBRARY_PDF_PATH,path);
    }
    ProgressBar progressBar=(ProgressBar)row.findViewById(R.id.progress);
    progressBar.setVisibility(View.GONE);
  }
}
 

Example 2

From project Android-automation, under directory /Tmts_Java/src/com/taobao/tmts/framework/.

Source file: Tmts.java

  18 
vote

/** 
 * Return a  {@link TmtsProgressBar} by the given name.
 * @param name String name of view id, the string after @+id/ defined in layout files.
 * @return {@link TmtsProgressBar} with the given name.
 * @throws Exception Exception
 */
TmtsProgressBar getTmtsProgressBar(String name) throws Exception {
  Log.i(LOG_TAG,"getTmtsProgressBar: " + name);
  ProgressBar progressBar=(ProgressBar)getView(name,ProgressBar.class);
  printLog(progressBar,name,"progressBar");
  TmtsProgressBar tmtsProgressBar=new TmtsProgressBar(inst,progressBar);
  return tmtsProgressBar;
}
 

Example 3

From project BazaarUtils, under directory /src/com/congenialmobile/widget/.

Source file: LazyImageView.java

  18 
vote

private void initProgressBarLoadingView(Context context){
  WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
  DisplayMetrics metrics=new DisplayMetrics();
  wm.getDefaultDisplay().getMetrics(metrics);
  int width=(int)((float)metrics.density * 36);
  ProgressBar pBar=new ProgressBar(context);
  pBar.setLayoutParams(new LayoutParams(width,width,Gravity.CENTER));
  addView(pBar);
}
 

Example 4

From project beintoo-android-sdk, under directory /BeintooSDK/src/com/beintoo/activities/alliances/.

Source file: UserAlliance.java

  18 
vote

private ProgressBar progressLoading(){
  ProgressBar pb=new ProgressBar(getContext());
  pb.setIndeterminateDrawable(getContext().getResources().getDrawable(R.drawable.progress));
  TableLayout.LayoutParams params=new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT,TableLayout.LayoutParams.WRAP_CONTENT);
  params.setMargins(0,(int)(ratio * 100),0,0);
  params.gravity=Gravity.CENTER;
  params.height=(int)(ratio * 45);
  params.width=(int)(ratio * 45);
  pb.setLayoutParams(params);
  pb.setTag(1000);
  return pb;
}
 

Example 5

From project creamed_glacier_app_settings, under directory /src/com/android/settings/.

Source file: CryptKeeper.java

  18 
vote

private void encryptionProgressInit(){
  Log.d(TAG,"Encryption progress screen initializing.");
  if (mWakeLock == null) {
    Log.d(TAG,"Acquiring wakelock.");
    PowerManager pm=(PowerManager)getSystemService(Context.POWER_SERVICE);
    mWakeLock=pm.newWakeLock(PowerManager.FULL_WAKE_LOCK,TAG);
    mWakeLock.acquire();
  }
  ProgressBar progressBar=(ProgressBar)findViewById(R.id.progress_bar);
  progressBar.setIndeterminate(true);
  updateProgress();
}
 

Example 6

From project DiscogsForAndroid, under directory /src/com/discogs/activities/.

Source file: ArtistReleasesActivity.java

  18 
vote

private void showUI(){
  ProgressBar progressBar=(ProgressBar)findViewById(R.id.progressBar);
  progressBar.setVisibility(View.GONE);
  View content=findViewById(R.id.content);
  content.setVisibility(View.VISIBLE);
  setListAdapter(new ArtistReleaseEndlessAdapter(this,engine,releases,releasesUrl));
  loading=false;
}
 

Example 7

From project GraduationProject, under directory /G-Card/src/Hello/Tab/Widget/.

Source file: SetupActivity.java

  18 
vote

private void register(String account){
  ProgressBar progressBar=(ProgressBar)findViewById(R.id.progress_bar);
  progressBar.setVisibility(ProgressBar.VISIBLE);
  TextView textView=(TextView)findViewById(R.id.connecting_text);
  textView.setVisibility(ProgressBar.VISIBLE);
  SharedPreferences prefs=Prefs.get(this);
  SharedPreferences.Editor editor=prefs.edit();
  editor.putString("accountName",account);
  editor.commit();
}
 

Example 8

From project KeyboardTerm, under directory /src/tw/loli/lunaTerm/widgets/.

Source file: SeekBarPreference.java

  18 
vote

protected void onBindView(View view){
  super.onBindView(view);
  ProgressBar valuedisp=(ProgressBar)view.findViewById(R.id.pref_valuedisp);
  if (valuedisp != null) {
    valuedisp.setMax(100);
    valuedisp.setProgress(mValue);
  }
}
 

Example 9

From project Locast-Android, under directory /src/edu/mit/mobile/android/widget/.

Source file: ArrayProgressAdapter.java

  18 
vote

@Override public View getView(int position,View convertView,ViewGroup parent){
  final ProgressBar progress;
  if (convertView == null) {
    progress=new ProgressBar(mContext,null,android.R.attr.progressBarStyleHorizontal);
    progress.setIndeterminate(false);
  }
 else {
    progress=(ProgressBar)convertView;
  }
  final ProgressItem item=getItem(position);
  progress.setMax((int)item.max);
  progress.setProgress((int)item.value);
  return progress;
}
 

Example 10

From project lullaby, under directory /src/net/sileht/lullaby/.

Source file: AmpacheRequest.java

  18 
vote

private void hideProgress(){
  if (mContext != null) {
    ProgressBar p=(ProgressBar)((Activity)mContext).findViewById(R.id.progress);
    p.setVisibility(View.INVISIBLE);
  }
}
 

Example 11

From project LunaTerm, under directory /src/tw/loli/lunaTerm/widgets/.

Source file: SeekBarPreference.java

  18 
vote

protected void onBindView(View view){
  super.onBindView(view);
  ProgressBar valuedisp=(ProgressBar)view.findViewById(R.id.pref_valuedisp);
  if (valuedisp != null) {
    valuedisp.setMax(100);
    valuedisp.setProgress(mValue);
  }
}
 

Example 12

From project Android, under directory /AndroidNolesCore/src/fragment/.

Source file: BrowserDetailFragment.java

  17 
vote

@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  setHasOptionsMenu(true);
  mWebView=(WebView)getView().findViewById(R.id.webview);
  mWebView.getSettings().setSupportZoom(true);
  mWebView.getSettings().setBuiltInZoomControls(true);
  mWebView.setWebChromeClient(new WebChromeClient(){
    public void onProgressChanged(    WebView view,    int newProgress){
      final ProgressBar progress=(ProgressBar)getView().findViewById(R.id.empty_loading);
      progress.setProgress(newProgress);
      progress.setVisibility(View.VISIBLE);
      if (newProgress == 100) {
        progress.setVisibility(View.GONE);
      }
    }
  }
);
  mWebView.setWebViewClient(new WebViewClient(){
    public void onReceivedError(    WebView view,    int errorCode,    String description,    String failingUrl){
    }
  }
);
  mWebView.loadUrl(getArguments().getString("url"));
}
 

Example 13

From project Android-FFXIEQ, under directory /ffxieq/src/com/github/kanata3249/ffxieq/android/.

Source file: CharacterStatusView.java

  17 
vote

public boolean cacheStatusAsync(){
  if (mCharInfo.isCacheValid() && (mCharInfoToCompare == null || mCharInfoToCompare.isCacheValid()))   return false;
  final ProgressBar progress=(ProgressBar)findViewById(R.id.ProgressBar);
  if (progress != null) {
    progress.setVisibility(VISIBLE);
  }
  AsyncTask<Void,Void,Void> task=new AsyncTask<Void,Void,Void>(){
    @Override protected Void doInBackground(    Void... params){
synchronized (sObjLock) {
        mCharInfo.cacheStatusValues();
        if (mCharInfoToCompare != null)         mCharInfoToCompare.cacheStatusValues();
      }
      return null;
    }
    @Override protected void onPostExecute(    Void result){
      notifyDatasetChanged();
      if (progress != null)       progress.setVisibility(INVISIBLE);
    }
  }
;
  task.execute();
  return true;
}
 

Example 14

From project android-xbmcremote-sandbox, under directory /src/org/xbmc/android/remotesandbox/ui/base/.

Source file: ActionBarHelperBase.java

  17 
vote

/** 
 * Adds an action button to the compatibility action bar, using menu information from a  {@link android.view.MenuItem}. If the menu item ID is <code>menu_refresh</code>, the menu item's state can be changed to show a loading spinner using {@link com.example.android.actionbarcompat.ActionBarHelperBase#setRefreshActionItemState(boolean)}.
 */
private View addActionItemCompatFromMenuItem(final MenuItem item){
  final int itemId=item.getItemId();
  final ViewGroup actionBar=getActionBarCompat();
  if (actionBar == null) {
    return null;
  }
  ImageButton actionButton=new ImageButton(mActivity,null,itemId == android.R.id.home ? R.attr.actionbarCompatItemHomeStyle : R.attr.actionbarCompatItemStyle);
  actionButton.setLayoutParams(new ViewGroup.LayoutParams((int)mActivity.getResources().getDimension(itemId == android.R.id.home ? R.dimen.actionbar_compat_button_home_width : R.dimen.actionbar_compat_button_width),ViewGroup.LayoutParams.FILL_PARENT));
  if (itemId == R.id.menu_refresh) {
    actionButton.setId(R.id.actionbar_compat_item_refresh);
  }
  if (itemId != android.R.id.home || actionButton.getDrawable() == null) {
    actionButton.setImageDrawable(item.getIcon());
  }
  actionButton.setScaleType(ImageView.ScaleType.CENTER);
  actionButton.setContentDescription(item.getTitle());
  actionButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      mActivity.onMenuItemSelected(Window.FEATURE_OPTIONS_PANEL,item);
    }
  }
);
  actionBar.addView(actionButton);
  if (item.getItemId() == R.id.menu_refresh) {
    ProgressBar indicator=new ProgressBar(mActivity,null,R.attr.actionbarCompatProgressIndicatorStyle);
    final int buttonWidth=mActivity.getResources().getDimensionPixelSize(R.dimen.actionbar_compat_button_width);
    final int buttonHeight=mActivity.getResources().getDimensionPixelSize(R.dimen.actionbar_compat_height);
    final int progressIndicatorWidth=buttonWidth / 2;
    LinearLayout.LayoutParams indicatorLayoutParams=new LinearLayout.LayoutParams(progressIndicatorWidth,progressIndicatorWidth);
    indicatorLayoutParams.setMargins((buttonWidth - progressIndicatorWidth) / 2,(buttonHeight - progressIndicatorWidth) / 2,(buttonWidth - progressIndicatorWidth) / 2,0);
    indicator.setLayoutParams(indicatorLayoutParams);
    indicator.setVisibility(View.GONE);
    indicator.setId(R.id.actionbar_compat_item_refresh_progress);
    actionBar.addView(indicator);
  }
  return actionButton;
}
 

Example 15

From project AndroidDevWeekendDub-BookLibrary, under directory /src/org/curiouscreature/android/shelves/activity/.

Source file: AddBookActivity.java

  17 
vote

@Override public void onPreExecute(){
  disableSearchPanel();
  if (mSearchPanel == null) {
    mSearchPanel=((ViewStub)findViewById(R.id.stub_search)).inflate();
    ProgressBar progress=(ProgressBar)mSearchPanel.findViewById(R.id.progress);
    progress.setIndeterminate(true);
    ((TextView)findViewById(R.id.label_import)).setText(R.string.search_progress);
    final View cancelButton=mSearchPanel.findViewById(R.id.button_cancel);
    cancelButton.setOnClickListener(new View.OnClickListener(){
      public void onClick(      View v){
        onCancelSearch();
      }
    }
);
  }
  mBooksAdapter.clear();
  showPanel(mSearchPanel,true);
}
 

Example 16

From project androidquery, under directory /auth/com/androidquery/.

Source file: WebDialog.java

  17 
vote

private void setupProgress(RelativeLayout layout){
  Context context=getContext();
  ll=new LinearLayout(context);
  ProgressBar progress=new ProgressBar(context);
  int p=AQUtility.dip2pixel(context,30);
  LinearLayout.LayoutParams plp=new LinearLayout.LayoutParams(p,p);
  ll.addView(progress,plp);
  if (message != null) {
    TextView tv=new TextView(context);
    LinearLayout.LayoutParams tlp=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
    tlp.leftMargin=AQUtility.dip2pixel(context,5);
    tlp.gravity=0x10;
    tv.setText(message);
    ll.addView(tv,tlp);
  }
  RelativeLayout.LayoutParams lp=new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
  lp.addRule(RelativeLayout.CENTER_IN_PARENT);
  layout.addView(ll,lp);
}
 

Example 17

From project android_packages_apps_Gallery2, under directory /src/com/android/gallery3d/app/.

Source file: ManageCachePage.java

  17 
vote

private void refreshCacheStorageInfo(){
  ProgressBar progressBar=(ProgressBar)mFooterContent.findViewById(R.id.progress);
  TextView status=(TextView)mFooterContent.findViewById(R.id.status);
  progressBar.setMax(PROGRESS_BAR_MAX);
  long totalBytes=mCacheStorageInfo.getTotalBytes();
  long usedBytes=mCacheStorageInfo.getUsedBytes();
  long expectedBytes=mCacheStorageInfo.getExpectedUsedBytes();
  long freeBytes=mCacheStorageInfo.getFreeBytes();
  Activity activity=(Activity)mActivity;
  if (totalBytes == 0) {
    progressBar.setProgress(0);
    progressBar.setSecondaryProgress(0);
    String label=activity.getString(R.string.free_space_format,"-");
    status.setText(label);
  }
 else {
    progressBar.setProgress((int)(usedBytes * PROGRESS_BAR_MAX / totalBytes));
    progressBar.setSecondaryProgress((int)(expectedBytes * PROGRESS_BAR_MAX / totalBytes));
    String label=activity.getString(R.string.free_space_format,Formatter.formatFileSize(activity,freeBytes));
    status.setText(label);
  }
}
 

Example 18

From project AquaNotesTest, under directory /src/com/google/android/apps/iosched/util/.

Source file: ActivityHelper.java

  17 
vote

/** 
 * Adds an action button to the compatibility action bar, using menu information from a {@link MenuItem}. If the menu item ID is <code>menu_refresh</code>, the menu item's state can be changed to show a loading spinner using {@link ActivityHelper#setRefreshActionButtonCompatState(boolean)}.
 */
private View addActionButtonCompatFromMenuItem(final MenuItem item){
  final ViewGroup actionBar=getActionBarCompat();
  if (actionBar == null) {
    return null;
  }
  ImageView separator=new ImageView(mActivity,null,R.attr.actionbarCompatSeparatorStyle);
  separator.setLayoutParams(new ViewGroup.LayoutParams(2,ViewGroup.LayoutParams.FILL_PARENT));
  ImageButton actionButton=new ImageButton(mActivity,null,R.attr.actionbarCompatButtonStyle);
  actionButton.setId(item.getItemId());
  actionButton.setLayoutParams(new ViewGroup.LayoutParams((int)mActivity.getResources().getDimension(R.dimen.actionbar_compat_height),ViewGroup.LayoutParams.FILL_PARENT));
  actionButton.setImageDrawable(item.getIcon());
  actionButton.setScaleType(ImageView.ScaleType.CENTER);
  actionButton.setContentDescription(item.getTitle());
  actionButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      mActivity.onMenuItemSelected(Window.FEATURE_OPTIONS_PANEL,item);
    }
  }
);
  actionBar.addView(separator);
  actionBar.addView(actionButton);
  if (item.getItemId() == R.id.menu_refresh) {
    int buttonWidth=mActivity.getResources().getDimensionPixelSize(R.dimen.actionbar_compat_height);
    int buttonWidthDiv3=buttonWidth / 3;
    ProgressBar indicator=new ProgressBar(mActivity,null,R.attr.actionbarCompatProgressIndicatorStyle);
    LinearLayout.LayoutParams indicatorLayoutParams=new LinearLayout.LayoutParams(buttonWidthDiv3,buttonWidthDiv3);
    indicatorLayoutParams.setMargins(buttonWidthDiv3,buttonWidthDiv3,buttonWidth - 2 * buttonWidthDiv3,0);
    indicator.setLayoutParams(indicatorLayoutParams);
    indicator.setVisibility(View.GONE);
    indicator.setId(R.id.menu_refresh_progress);
    actionBar.addView(indicator);
  }
  return actionButton;
}
 

Example 19

From project BF3-Battlelog, under directory /src/com/ninetwozero/battlelog/adapter/.

Source file: WeaponListAdapter.java

  17 
vote

@Override public View getView(int position,View convertView,ViewGroup parent){
  WeaponDataWrapper base=getItem(position);
  WeaponStats data=base.getStats();
  double unlockProgress=base.getNumUnlocks() == 0 ? 1 : base.getNumUnlocked() / ((double)base.getNumUnlocks());
  if (convertView == null) {
    convertView=layoutInflater.inflate(R.layout.list_item_weapon,parent,false);
  }
  ((TextView)convertView.findViewById(R.id.text_title)).setText(data.getName());
  ((TextView)convertView.findViewById(R.id.text_sstars)).setText((int)data.getServiceStars() + "");
  ProgressBar progressBar=(ProgressBar)convertView.findViewById(R.id.progress_unlocks);
  TextView textProgress=(TextView)convertView.findViewById(R.id.text_progress);
  if (unlockProgress >= 1.0) {
    ((TextView)convertView.findViewById(R.id.text_status)).setText(R.string.info_unlocks_done);
    progressBar.setVisibility(View.GONE);
    textProgress.setVisibility(View.GONE);
  }
 else {
    progressBar.setMax(1000);
    progressBar.setProgress(((int)(unlockProgress * 1000)));
    progressBar.setVisibility(View.VISIBLE);
    textProgress.setText((Math.round(unlockProgress * 1000) / 10.0) + "%");
    textProgress.setVisibility(View.VISIBLE);
    ((TextView)convertView.findViewById(R.id.text_status)).setText(base.getNumUnlocks() + "/" + base.getNumUnlocks());
  }
  ((ImageView)convertView.findViewById(R.id.image_item)).setImageResource(DrawableResourceList.getWeapon(data.getGuid()));
  convertView.setTag(base);
  return convertView;
}
 

Example 20

From project Cloud-Shout, under directory /ckdgcloudshout-Android/src/com/cloudshout/.

Source file: PlayerActivity.java

  17 
vote

private void setUpProgressBar(){
  pbar=new ProgressBar(this,null,android.R.attr.progressBarStyleHorizontal);
  LinearLayout.LayoutParams layoutParams=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
  root.addView(pbar,layoutParams);
  pbar.setPadding(0,485,0,0);
  pbar.setMax(getLength(mediaList));
}
 

Example 21

From project conference-mobile-app, under directory /android-app/src/com/google/android/apps/iosched/util/.

Source file: ActivityHelper.java

  17 
vote

/** 
 * Adds an action button to the compatibility action bar, using menu information from a {@link MenuItem}. If the menu item ID is <code>menu_refresh</code>, the menu item's state can be changed to show a loading spinner using {@link ActivityHelper#setRefreshActionButtonCompatState(boolean)}.
 */
private View addActionButtonCompatFromMenuItem(final MenuItem item){
  final ViewGroup actionBar=getActionBarCompat();
  if (actionBar == null) {
    return null;
  }
  ImageView separator=new ImageView(mActivity,null,R.attr.actionbarCompatSeparatorStyle);
  separator.setLayoutParams(new ViewGroup.LayoutParams(2,ViewGroup.LayoutParams.FILL_PARENT));
  ImageButton actionButton=new ImageButton(mActivity,null,R.attr.actionbarCompatButtonStyle);
  actionButton.setId(item.getItemId());
  actionButton.setLayoutParams(new ViewGroup.LayoutParams((int)mActivity.getResources().getDimension(R.dimen.actionbar_compat_height),ViewGroup.LayoutParams.FILL_PARENT));
  actionButton.setImageDrawable(item.getIcon());
  actionButton.setScaleType(ImageView.ScaleType.CENTER);
  actionButton.setContentDescription(item.getTitle());
  actionButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      mActivity.onMenuItemSelected(Window.FEATURE_OPTIONS_PANEL,item);
    }
  }
);
  actionBar.addView(separator);
  actionBar.addView(actionButton);
  if (item.getItemId() == R.id.menu_refresh) {
    int buttonWidth=mActivity.getResources().getDimensionPixelSize(R.dimen.actionbar_compat_height);
    int buttonWidthDiv3=buttonWidth / 3;
    ProgressBar indicator=new ProgressBar(mActivity,null,R.attr.actionbarCompatProgressIndicatorStyle);
    LinearLayout.LayoutParams indicatorLayoutParams=new LinearLayout.LayoutParams(buttonWidthDiv3,buttonWidthDiv3);
    indicatorLayoutParams.setMargins(buttonWidthDiv3,buttonWidthDiv3,buttonWidth - 2 * buttonWidthDiv3,0);
    indicator.setLayoutParams(indicatorLayoutParams);
    indicator.setVisibility(View.GONE);
    indicator.setId(R.id.menu_refresh_progress);
    actionBar.addView(indicator);
  }
  return actionButton;
}
 

Example 22

From project cow, under directory /src/com/ad/cow/.

Source file: ExperienceActivity.java

  17 
vote

private void loadPreferences(){
  long currentTime=new Date().getTime();
  gv=GlobalVar.getInstance();
  time=gv.getExpTime();
  level=gv.getLevel();
  exp=gv.getExp();
  long diff=currentTime - time;
  float seconds=diff / 1000;
  float addExp=seconds * expPerSecond;
  exp=exp + addExp;
  gv.setExpTime(new Date().getTime());
  handleLevelUp();
  TextView levelView=(TextView)findViewById(R.id.level);
  levelView.setText(level + "");
  TextView experienceView=(TextView)findViewById(R.id.experience);
  experienceView.setText((int)xpSinceLastLevelUp() + "/" + (int)nettoXpNeededForLevel(level + 1));
  double percentByExp=nettoXpNeededForLevel(level + 1) / 100;
  double currentPercent=xpSinceLastLevelUp() / percentByExp;
  ProgressBar progressView=(ProgressBar)findViewById(R.id.progressBar1);
  progressView.setProgress((int)currentPercent);
}
 

Example 23

From project dcnyc10-android, under directory /android/src/com/lullabot/android/apps/iosched/util/.

Source file: ActivityHelper.java

  17 
vote

/** 
 * Adds an action button to the compatibility action bar, using menu information from a {@link MenuItem}. If the menu item ID is <code>menu_refresh</code>, the menu item's state can be changed to show a loading spinner using {@link ActivityHelper#setRefreshActionButtonCompatState(boolean)}.
 */
private View addActionButtonCompatFromMenuItem(final MenuItem item){
  final ViewGroup actionBar=getActionBarCompat();
  if (actionBar == null) {
    return null;
  }
  ImageView separator=new ImageView(mActivity,null,R.attr.actionbarCompatSeparatorStyle);
  separator.setLayoutParams(new ViewGroup.LayoutParams(2,ViewGroup.LayoutParams.FILL_PARENT));
  ImageButton actionButton=new ImageButton(mActivity,null,R.attr.actionbarCompatButtonStyle);
  actionButton.setId(item.getItemId());
  actionButton.setLayoutParams(new ViewGroup.LayoutParams((int)mActivity.getResources().getDimension(R.dimen.actionbar_compat_height),ViewGroup.LayoutParams.FILL_PARENT));
  actionButton.setImageDrawable(item.getIcon());
  actionButton.setScaleType(ImageView.ScaleType.CENTER);
  actionButton.setContentDescription(item.getTitle());
  actionButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      mActivity.onMenuItemSelected(Window.FEATURE_OPTIONS_PANEL,item);
    }
  }
);
  actionBar.addView(separator);
  actionBar.addView(actionButton);
  if (item.getItemId() == R.id.menu_refresh) {
    int buttonWidth=mActivity.getResources().getDimensionPixelSize(R.dimen.actionbar_compat_height);
    int buttonWidthDiv3=buttonWidth / 3;
    ProgressBar indicator=new ProgressBar(mActivity,null,R.attr.actionbarCompatProgressIndicatorStyle);
    LinearLayout.LayoutParams indicatorLayoutParams=new LinearLayout.LayoutParams(buttonWidthDiv3,buttonWidthDiv3);
    indicatorLayoutParams.setMargins(buttonWidthDiv3,buttonWidthDiv3,buttonWidth - 2 * buttonWidthDiv3,0);
    indicator.setLayoutParams(indicatorLayoutParams);
    indicator.setVisibility(View.GONE);
    indicator.setId(R.id.menu_refresh_progress);
    actionBar.addView(indicator);
  }
  return actionButton;
}
 

Example 24

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

Source file: DownloadAdapter.java

  17 
vote

public void bindView(View convertView){
  if (!(convertView instanceof DownloadItem)) {
    return;
  }
  long downloadId=mCursor.getLong(mIdColumnId);
  ((DownloadItem)convertView).setDownloadId(downloadId);
  retrieveAndSetIcon(convertView);
  String title=mCursor.getString(mTitleColumnId);
  long totalBytes=mCursor.getLong(mTotalBytesColumnId);
  long currentBytes=mCursor.getLong(mCurrentBytesColumnId);
  int status=mCursor.getInt(mStatusColumnId);
  if (title.length() == 0) {
    title=mResources.getString(R.string.missing_title);
  }
  setTextForView(convertView,R.id.download_title,title);
  int progress=getProgressValue(totalBytes,currentBytes);
  boolean indeterminate=status == DownloadManager.STATUS_PENDING;
  ProgressBar progressBar=(ProgressBar)convertView.findViewById(R.id.download_progress);
  progressBar.setIndeterminate(indeterminate);
  if (!indeterminate) {
    progressBar.setProgress(progress);
  }
  if (status == DownloadManager.STATUS_FAILED || status == DownloadManager.STATUS_SUCCESSFUL) {
    progressBar.setVisibility(View.GONE);
  }
 else {
    progressBar.setVisibility(View.VISIBLE);
  }
  setTextForView(convertView,R.id.size_text,getSizeText(totalBytes));
  setTextForView(convertView,R.id.status_text,mResources.getString(getStatusStringId(status)));
  setTextForView(convertView,R.id.last_modified_date,getDateString());
  CheckBox checkBox=(CheckBox)convertView.findViewById(R.id.download_checkbox);
  checkBox.setChecked(mDownloadSelectionListener.isDownloadSelected(downloadId));
}
 

Example 25

From project fauxclock, under directory /src/com/teamkang/fauxclock/.

Source file: AquireRootTask.java

  17 
vote

@Override protected void onProgressUpdate(Integer... progress){
  LayoutInflater inflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View layout=view;
  TextView status=(TextView)layout.findViewById(R.id.status);
  ProgressBar spinner=(ProgressBar)layout.findViewById(R.id.progressBar1);
  Log.d("EDT",(String)status.getText());
switch (progress[0]) {
case PROGRESS_AQUIRING_ROOT:
    status.setText("Aquiring root");
  break;
case PROGRESS_ROOT_AQUIRED:
status.setText("Root aquired!");
break;
case PROGRESS_ROOT_NOT_AQUIRED:
spinner.setVisibility(View.GONE);
status.setText("FauxClock needs root privaleges to run. Please make sure it has the proper permissions in SuperUser.");
break;
case PROGRESS_BUSYBOX_CHECKING:
spinner.setVisibility(View.VISIBLE);
status.setText("Checking for busybox");
break;
case PROGRESS_BUSYBOX_NOT_FOUND:
spinner.setVisibility(View.GONE);
status.setText("Busybox was not found. Please try and install it from the market.");
break;
case PROGRESS_BUSYBOX_FOUND:
spinner.setVisibility(View.GONE);
status.setText("Busybox was found!");
break;
case PROGRESS_DONE:
status.setText("Checks passed!");
break;
case PROGRESS_CHECKING_PERMS:
status.setText("Setting proper permissions");
break;
case PROGRESS_PERMS_ERROR:
status.setText("Error setting permissions. Please restart the app.");
break;
}
}
 

Example 26

From project gddsched2, under directory /trunk/android/src/com/google/android/apps/iosched2/util/.

Source file: ActivityHelper.java

  17 
vote

/** 
 * Adds an action button to the compatibility action bar, using menu information from a {@link MenuItem}. If the menu item ID is <code>menu_refresh</code>, the menu item's state can be changed to show a loading spinner using {@link ActivityHelper#setRefreshActionButtonCompatState(boolean)}.
 */
private View addActionButtonCompatFromMenuItem(final MenuItem item){
  final ViewGroup actionBar=getActionBarCompat();
  if (actionBar == null) {
    return null;
  }
  ImageView separator=new ImageView(mActivity,null,R.attr.actionbarCompatSeparatorStyle);
  separator.setLayoutParams(new ViewGroup.LayoutParams(2,ViewGroup.LayoutParams.FILL_PARENT));
  ImageButton actionButton=new ImageButton(mActivity,null,R.attr.actionbarCompatButtonStyle);
  actionButton.setId(item.getItemId());
  actionButton.setLayoutParams(new ViewGroup.LayoutParams((int)mActivity.getResources().getDimension(R.dimen.actionbar_compat_height),ViewGroup.LayoutParams.FILL_PARENT));
  actionButton.setImageDrawable(item.getIcon());
  actionButton.setScaleType(ImageView.ScaleType.CENTER);
  actionButton.setContentDescription(item.getTitle());
  actionButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      mActivity.onMenuItemSelected(Window.FEATURE_OPTIONS_PANEL,item);
    }
  }
);
  actionBar.addView(separator);
  actionBar.addView(actionButton);
  if (item.getItemId() == R.id.menu_refresh) {
    int buttonWidth=mActivity.getResources().getDimensionPixelSize(R.dimen.actionbar_compat_height);
    int buttonWidthDiv3=buttonWidth / 3;
    ProgressBar indicator=new ProgressBar(mActivity,null,R.attr.actionbarCompatProgressIndicatorStyle);
    LinearLayout.LayoutParams indicatorLayoutParams=new LinearLayout.LayoutParams(buttonWidthDiv3,buttonWidthDiv3);
    indicatorLayoutParams.setMargins(buttonWidthDiv3,buttonWidthDiv3,buttonWidth - 2 * buttonWidthDiv3,0);
    indicator.setLayoutParams(indicatorLayoutParams);
    indicator.setVisibility(View.GONE);
    indicator.setId(R.id.menu_refresh_progress);
    actionBar.addView(indicator);
  }
  return actionButton;
}
 

Example 27

From project gh4a, under directory /src/com/gh4a/.

Source file: LoadingDialog.java

  17 
vote

/** 
 * Show.
 * @param context the context
 * @param title the title
 * @param message the message
 * @param indeterminate the indeterminate
 * @param cancelable the cancelable
 * @param cancelListener the cancel listener
 * @param hideMainView the hide main view
 * @return the loading dialog
 */
public static LoadingDialog show(Context context,CharSequence title,CharSequence message,boolean indeterminate,boolean cancelable,OnCancelListener cancelListener,boolean hideMainView,int themeId){
  LoadingDialog dialog=new LoadingDialog(context,themeId);
  dialog.setTitle(title);
  dialog.setCancelable(cancelable);
  dialog.setOnCancelListener(cancelListener);
  dialog.addContentView(new ProgressBar(context),new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
  dialog.show();
  return dialog;
}
 

Example 28

From project HapiPodcastJ, under directory /src/info/xuluan/podcast/actionbar/.

Source file: ActionBarHelperBase.java

  17 
vote

/** 
 * Adds an action button to the compatibility action bar, using menu information from a  {@link android.view.MenuItem}. If the menu item ID is <code>menu_refresh</code>, the menu item's state can be changed to show a loading spinner using {@link com.example.android.actionbarcompat.ActionBarHelperBase#setRefreshActionItemState(boolean)}.
 */
private View addActionItemCompatFromMenuItem(final MenuItem item){
  final int itemId=item.getItemId();
  final ViewGroup actionBar=getActionBarCompat();
  if (actionBar == null) {
    return null;
  }
  ImageButton actionButton=new ImageButton(mActivity,null,itemId == android.R.id.home ? R.attr.actionbarCompatItemHomeStyle : R.attr.actionbarCompatItemStyle);
  actionButton.setLayoutParams(new ViewGroup.LayoutParams((int)mActivity.getResources().getDimension(itemId == android.R.id.home ? R.dimen.actionbar_compat_button_home_width : R.dimen.actionbar_compat_button_width),ViewGroup.LayoutParams.FILL_PARENT));
  if (itemId == R.id.menu_refresh) {
    actionButton.setId(R.id.actionbar_compat_item_refresh);
  }
  actionButton.setImageDrawable(item.getIcon());
  actionButton.setScaleType(ImageView.ScaleType.CENTER);
  actionButton.setContentDescription(item.getTitle());
  actionButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      mActivity.onMenuItemSelected(Window.FEATURE_OPTIONS_PANEL,item);
    }
  }
);
  actionBar.addView(actionButton);
  if (item.getItemId() == R.id.menu_refresh) {
    ProgressBar indicator=new ProgressBar(mActivity,null,R.attr.actionbarCompatProgressIndicatorStyle);
    final int buttonWidth=mActivity.getResources().getDimensionPixelSize(R.dimen.actionbar_compat_button_width);
    final int buttonHeight=mActivity.getResources().getDimensionPixelSize(R.dimen.actionbar_compat_height);
    final int progressIndicatorWidth=buttonWidth / 2;
    LinearLayout.LayoutParams indicatorLayoutParams=new LinearLayout.LayoutParams(progressIndicatorWidth,progressIndicatorWidth);
    indicatorLayoutParams.setMargins((buttonWidth - progressIndicatorWidth) / 2,(buttonHeight - progressIndicatorWidth) / 2,(buttonWidth - progressIndicatorWidth) / 2,0);
    indicator.setLayoutParams(indicatorLayoutParams);
    indicator.setVisibility(View.GONE);
    indicator.setId(R.id.actionbar_compat_item_refresh_progress);
    actionBar.addView(indicator);
  }
  return actionButton;
}
 

Example 29

From project ignition, under directory /ignition-core/ignition-core-lib/src/com/github/ignition/core/widgets/.

Source file: RemoteImageView.java

  17 
vote

protected View buildProgressSpinnerView(Context context){
  ProgressBar loadingSpinner=new ProgressBar(context);
  loadingSpinner.setIndeterminate(true);
  if (this.progressDrawable == null) {
    this.progressDrawable=loadingSpinner.getIndeterminateDrawable();
  }
 else {
    loadingSpinner.setIndeterminateDrawable(progressDrawable);
    if (progressDrawable instanceof AnimationDrawable) {
      ((AnimationDrawable)progressDrawable).start();
    }
  }
  FrameLayout.LayoutParams lp=new FrameLayout.LayoutParams(progressDrawable.getIntrinsicWidth(),progressDrawable.getIntrinsicHeight(),Gravity.CENTER);
  loadingSpinner.setLayoutParams(lp);
  return loadingSpinner;
}
 

Example 30

From project iosched, under directory /android/src/com/google/android/apps/iosched/util/.

Source file: ActivityHelper.java

  17 
vote

/** 
 * Adds an action button to the compatibility action bar, using menu information from a {@link MenuItem}. If the menu item ID is <code>menu_refresh</code>, the menu item's state can be changed to show a loading spinner using {@link ActivityHelper#setRefreshActionButtonCompatState(boolean)}.
 */
private View addActionButtonCompatFromMenuItem(final MenuItem item){
  final ViewGroup actionBar=getActionBarCompat();
  if (actionBar == null) {
    return null;
  }
  ImageView separator=new ImageView(mActivity,null,R.attr.actionbarCompatSeparatorStyle);
  separator.setLayoutParams(new ViewGroup.LayoutParams(2,ViewGroup.LayoutParams.FILL_PARENT));
  ImageButton actionButton=new ImageButton(mActivity,null,R.attr.actionbarCompatButtonStyle);
  actionButton.setId(item.getItemId());
  actionButton.setLayoutParams(new ViewGroup.LayoutParams((int)mActivity.getResources().getDimension(R.dimen.actionbar_compat_height),ViewGroup.LayoutParams.FILL_PARENT));
  actionButton.setImageDrawable(item.getIcon());
  actionButton.setScaleType(ImageView.ScaleType.CENTER);
  actionButton.setContentDescription(item.getTitle());
  actionButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      mActivity.onMenuItemSelected(Window.FEATURE_OPTIONS_PANEL,item);
    }
  }
);
  actionBar.addView(separator);
  actionBar.addView(actionButton);
  if (item.getItemId() == R.id.menu_refresh) {
    int buttonWidth=mActivity.getResources().getDimensionPixelSize(R.dimen.actionbar_compat_height);
    int buttonWidthDiv3=buttonWidth / 3;
    ProgressBar indicator=new ProgressBar(mActivity,null,R.attr.actionbarCompatProgressIndicatorStyle);
    LinearLayout.LayoutParams indicatorLayoutParams=new LinearLayout.LayoutParams(buttonWidthDiv3,buttonWidthDiv3);
    indicatorLayoutParams.setMargins(buttonWidthDiv3,buttonWidthDiv3,buttonWidth - 2 * buttonWidthDiv3,0);
    indicator.setLayoutParams(indicatorLayoutParams);
    indicator.setVisibility(View.GONE);
    indicator.setId(R.id.menu_refresh_progress);
    actionBar.addView(indicator);
  }
  return actionButton;
}
 

Example 31

From project iosched2011, under directory /android/src/com/google/android/apps/iosched/util/.

Source file: ActivityHelper.java

  17 
vote

/** 
 * Adds an action button to the compatibility action bar, using menu information from a {@link MenuItem}. If the menu item ID is <code>menu_refresh</code>, the menu item's state can be changed to show a loading spinner using {@link ActivityHelper#setRefreshActionButtonCompatState(boolean)}.
 */
private View addActionButtonCompatFromMenuItem(final MenuItem item){
  final ViewGroup actionBar=getActionBarCompat();
  if (actionBar == null) {
    return null;
  }
  ImageView separator=new ImageView(mActivity,null,R.attr.actionbarCompatSeparatorStyle);
  separator.setLayoutParams(new ViewGroup.LayoutParams(2,ViewGroup.LayoutParams.FILL_PARENT));
  ImageButton actionButton=new ImageButton(mActivity,null,R.attr.actionbarCompatButtonStyle);
  actionButton.setId(item.getItemId());
  actionButton.setLayoutParams(new ViewGroup.LayoutParams((int)mActivity.getResources().getDimension(R.dimen.actionbar_compat_height),ViewGroup.LayoutParams.FILL_PARENT));
  actionButton.setImageDrawable(item.getIcon());
  actionButton.setScaleType(ImageView.ScaleType.CENTER);
  actionButton.setContentDescription(item.getTitle());
  actionButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      mActivity.onMenuItemSelected(Window.FEATURE_OPTIONS_PANEL,item);
    }
  }
);
  actionBar.addView(separator);
  actionBar.addView(actionButton);
  if (item.getItemId() == R.id.menu_refresh) {
    int buttonWidth=mActivity.getResources().getDimensionPixelSize(R.dimen.actionbar_compat_height);
    int buttonWidthDiv3=buttonWidth / 3;
    ProgressBar indicator=new ProgressBar(mActivity,null,R.attr.actionbarCompatProgressIndicatorStyle);
    LinearLayout.LayoutParams indicatorLayoutParams=new LinearLayout.LayoutParams(buttonWidthDiv3,buttonWidthDiv3);
    indicatorLayoutParams.setMargins(buttonWidthDiv3,buttonWidthDiv3,buttonWidth - 2 * buttonWidthDiv3,0);
    indicator.setLayoutParams(indicatorLayoutParams);
    indicator.setVisibility(View.GONE);
    indicator.setId(R.id.menu_refresh_progress);
    actionBar.addView(indicator);
  }
  return actionButton;
}
 

Example 32

From project iosched_2, under directory /android/src/com/google/android/apps/iosched/util/.

Source file: ActivityHelper.java

  17 
vote

/** 
 * Adds an action button to the compatibility action bar, using menu information from a {@link MenuItem}. If the menu item ID is <code>menu_refresh</code>, the menu item's state can be changed to show a loading spinner using {@link ActivityHelper#setRefreshActionButtonCompatState(boolean)}.
 */
private View addActionButtonCompatFromMenuItem(final MenuItem item){
  final ViewGroup actionBar=getActionBarCompat();
  if (actionBar == null) {
    return null;
  }
  ImageView separator=new ImageView(mActivity,null,R.attr.actionbarCompatSeparatorStyle);
  separator.setLayoutParams(new ViewGroup.LayoutParams(2,ViewGroup.LayoutParams.FILL_PARENT));
  ImageButton actionButton=new ImageButton(mActivity,null,R.attr.actionbarCompatButtonStyle);
  actionButton.setId(item.getItemId());
  actionButton.setLayoutParams(new ViewGroup.LayoutParams((int)mActivity.getResources().getDimension(R.dimen.actionbar_compat_height),ViewGroup.LayoutParams.FILL_PARENT));
  actionButton.setImageDrawable(item.getIcon());
  actionButton.setScaleType(ImageView.ScaleType.CENTER);
  actionButton.setContentDescription(item.getTitle());
  actionButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      mActivity.onMenuItemSelected(Window.FEATURE_OPTIONS_PANEL,item);
    }
  }
);
  actionBar.addView(separator);
  actionBar.addView(actionButton);
  if (item.getItemId() == R.id.menu_refresh) {
    int buttonWidth=mActivity.getResources().getDimensionPixelSize(R.dimen.actionbar_compat_height);
    int buttonWidthDiv3=buttonWidth / 3;
    ProgressBar indicator=new ProgressBar(mActivity,null,R.attr.actionbarCompatProgressIndicatorStyle);
    LinearLayout.LayoutParams indicatorLayoutParams=new LinearLayout.LayoutParams(buttonWidthDiv3,buttonWidthDiv3);
    indicatorLayoutParams.setMargins(buttonWidthDiv3,buttonWidthDiv3,buttonWidth - 2 * buttonWidthDiv3,0);
    indicator.setLayoutParams(indicatorLayoutParams);
    indicator.setVisibility(View.GONE);
    indicator.setId(R.id.menu_refresh_progress);
    actionBar.addView(indicator);
  }
  return actionButton;
}
 

Example 33

From project liquidroid, under directory /src/liqui/droid/util/.

Source file: LoadingDialog.java

  17 
vote

/** 
 * Show.
 * @param context the context
 * @param title the title
 * @param message the message
 * @param indeterminate the indeterminate
 * @param cancelable the cancelable
 * @param cancelListener the cancel listener
 * @param hideMainView the hide main view
 * @param themeId the theme id
 * @return the loading dialog
 */
public static LoadingDialog show(Context context,CharSequence title,CharSequence message,boolean indeterminate,boolean cancelable,OnCancelListener cancelListener,boolean hideMainView,int themeId){
  if (hideMainView) {
    Activity activity=(Activity)context;
    activity.findViewById(R.id.main_content).setVisibility(View.INVISIBLE);
  }
  LoadingDialog dialog=new LoadingDialog(context,themeId);
  dialog.setTitle(title);
  dialog.setCancelable(cancelable);
  dialog.setOnCancelListener(cancelListener);
  dialog.addContentView(new ProgressBar(context),new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
  dialog.show();
  return dialog;
}
 

Example 34

From project Amantech, under directory /Android/CloudAppStudioAndroid/src/com/cloudappstudio/utility/.

Source file: ImageLoaderView.java

  16 
vote

private void instantiate(final Context context,final String imageUrl){
  mContext=context;
  this.setGravity(Gravity.CENTER);
  mImage=new ImageView(mContext);
  mImage.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT));
  mImage.setScaleType(ScaleType.CENTER_CROP);
  mImage.setDrawingCacheEnabled(true);
  this.setDrawingCacheEnabled(true);
  mSpinner=new ProgressBar(mContext);
  LayoutParams params=new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
  mSpinner.setLayoutParams(params);
  mSpinner.setIndeterminate(true);
  addView(mImage);
  addView(mSpinner);
  if (imageUrl != null) {
    setImageDrawable(imageUrl);
  }
}
 

Example 35

From project android-rackspacecloud, under directory /src/com/rackspacecloud/android/.

Source file: CloudActivity.java

  16 
vote

protected final void showDialog(){
  if (pDialog == null || !pDialog.isShowing()) {
    isLoading=true;
    pDialog=new ProgressDialog(this);
    pDialog.setProgressStyle(R.style.NewDialog);
    pDialog.setOnCancelListener(new OnCancelListener(){
      @Override public void onCancel(      DialogInterface dialog){
        finish();
      }
    }
);
    pDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
    pDialog.show();
    pDialog.setContentView(new ProgressBar(this),new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
  }
}
 

Example 36

From project cmsandroid, under directory /src/com/zia/freshdocs/widget/.

Source file: HostAdapter.java

  16 
vote

public void toggleProgress(View view,boolean active){
  RelativeLayout container=(RelativeLayout)view;
  int childIndex=container.indexOfChild(_hostProgressBar);
  if (active && childIndex == -1) {
    _hostProgressBar=new ProgressBar(getContext());
    _hostProgressBar.setIndeterminate(true);
    LayoutParams params=new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
    params.alignWithParent=true;
    params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
    params.addRule(RelativeLayout.CENTER_VERTICAL);
    container.addView(_hostProgressBar,params);
  }
 else   if (!active && childIndex > -1) {
    container.removeView(_hostProgressBar);
  }
}
 

Example 37

From project droid-fu, under directory /src/main/java/com/github/droidfu/widgets/.

Source file: WebImageView.java

  16 
vote

private void addLoadingSpinnerView(Context context){
  loadingSpinner=new ProgressBar(context);
  loadingSpinner.setIndeterminate(true);
  if (this.progressDrawable == null) {
    this.progressDrawable=loadingSpinner.getIndeterminateDrawable();
  }
 else {
    loadingSpinner.setIndeterminateDrawable(progressDrawable);
    if (progressDrawable instanceof AnimationDrawable) {
      ((AnimationDrawable)progressDrawable).start();
    }
  }
  LayoutParams lp=new LayoutParams(progressDrawable.getIntrinsicWidth(),progressDrawable.getIntrinsicHeight());
  lp.gravity=Gravity.CENTER;
  addView(loadingSpinner,0,lp);
}
 

Example 38

From project FlipDroid, under directory /web-image-view/src/main/java/com/goal98/android/.

Source file: WebImageView.java

  16 
vote

private void addLoadingSpinnerView(Context context){
  loadingSpinner=new ProgressBar(context);
  loadingSpinner.setIndeterminate(true);
  LayoutParams lp=null;
  if (this.progressDrawable == null) {
    this.progressDrawable=loadingSpinner.getIndeterminateDrawable();
    lp=new LayoutParams(progressDrawable.getIntrinsicWidth() / 2,progressDrawable.getIntrinsicHeight() / 2);
  }
 else {
    loadingSpinner.setIndeterminateDrawable(progressDrawable);
    loadingSpinner.setPadding(15,15,15,15);
    if (progressDrawable instanceof AnimationDrawable) {
      ((AnimationDrawable)progressDrawable).start();
    }
    lp=new LayoutParams(progressDrawable.getIntrinsicWidth(),progressDrawable.getIntrinsicHeight());
  }
  lp.gravity=Gravity.CENTER;
  addView(loadingSpinner,0,lp);
}
 

Example 39

From project generic-store-for-android, under directory /src/com/wareninja/opensource/droidfu/widgets/.

Source file: WebImageView.java

  16 
vote

private void addLoadingSpinnerView(Context context){
  loadingSpinner=new ProgressBar(context);
  loadingSpinner.setIndeterminate(true);
  if (this.progressDrawable == null) {
    this.progressDrawable=loadingSpinner.getIndeterminateDrawable();
  }
 else {
    loadingSpinner.setIndeterminateDrawable(progressDrawable);
    if (progressDrawable instanceof AnimationDrawable) {
      ((AnimationDrawable)progressDrawable).start();
    }
  }
  LayoutParams lp=new LayoutParams(progressDrawable.getIntrinsicWidth(),progressDrawable.getIntrinsicHeight());
  lp.gravity=Gravity.CENTER;
  addView(loadingSpinner,0,lp);
}
 

Example 40

From project gobandroid, under directory /src/org/ligi/gobandroid_hd/ui/.

Source file: SGFLoadActivity.java

  16 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  GoPrefs.init(this);
  progress=new ProgressBar(this,null,android.R.attr.progressBarStyleHorizontal);
  progress.setMax(100);
  progress.setProgress(10);
  LinearLayout lin=new LinearLayout(this);
  ImageView img=new ImageView(this);
  img.setImageResource(R.drawable.ic_launcher);
  img.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT));
  lin.setOrientation(LinearLayout.VERTICAL);
  lin.addView(img);
  FrameLayout frame=new FrameLayout(this);
  frame.addView(progress);
  message_tv=new TextView(this);
  message_tv.setText("starting");
  message_tv.setTextColor(0xFF000000);
  message_tv.setPadding(7,0,0,0);
  frame.addView(message_tv);
  lin.addView(frame);
  alert_dlg=new AlertDialog.Builder(this).setCancelable(false).setTitle(R.string.loading_sgf).setView(lin).show();
  EasyTracker.getTracker().trackEvent("ui_action","load_sgf",getIntent().getData().toString(),null);
  new Thread(this).start();
}
 

Example 41

From project actionbar, under directory /src/com/kamalan/widget/.

Source file: ActionBar.java

  15 
vote

public void init(){
  mInflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  RelativeLayout barView=(RelativeLayout)mInflater.inflate(R.layout.actionbar,null);
  addView(barView);
  mProgress=(ProgressBar)barView.findViewById(R.id.actionbar_progress);
  mTitleView=(TextView)barView.findViewById(R.id.actionbar_title);
  mImageView=(ImageView)barView.findViewById(R.id.actionbar_menu);
  mImageView.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      actionbarClickedListener.eventOccured(v.getId());
    }
  }
);
  ibStage=(ImageButton)barView.findViewById(R.id.actionbar_stage);
  ibStage.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      actionbarClickedListener.eventOccured(v.getId());
    }
  }
);
}
 

Example 42

From project ActionBarSherlock, under directory /samples/fragments/src/com/actionbarsherlock/sample/fragments/.

Source file: FragmentRetainInstanceSupport.java

  15 
vote

/** 
 * This is called when the Fragment's Activity is ready to go, after its content view has been installed; it is called both after the initial fragment creation and after the fragment is re-attached to a new activity.
 */
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  mProgressBar=(ProgressBar)getTargetFragment().getView().findViewById(R.id.progress_horizontal);
synchronized (mThread) {
    mReady=true;
    mThread.notify();
  }
}
 

Example 43

From project AlarmApp-Android, under directory /src/org/alarmapp/activities/.

Source file: AlarmStatusActivity.java

  15 
vote

@Override protected void onPostExecute(Collection<AlarmedUser> result){
  super.onPostExecute(result);
  AlarmStatusActivity.this.btRefresh.setVisibility(ImageButton.VISIBLE);
  AlarmStatusActivity.this.pbLoader.setVisibility(ProgressBar.GONE);
  if (result == null)   return;
  displayAlarmStatusView(result);
}
 

Example 44

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

Source file: ScoreBoardActivity.java

  15 
vote

public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  amenTypeThin=AmenoidApp.getInstance().getAmenTypeThin();
  amenTypeBold=AmenoidApp.getInstance().getAmenTypeBold();
  handler=new Handler();
  errorDialog=new AlertDialog.Builder(this);
  Log.d(TAG,"onCreate");
  service=AmenoidApp.getInstance().getService();
  setContentView(R.layout.score_board);
  ActionBar actionBar=getSupportActionBar();
  actionBar.setDisplayHomeAsUpEnabled(true);
  actionBar.setTitle("Scorecard");
  progressBar=(ProgressBar)findViewById(R.id.progress_listview);
  list=(ListView)findViewById(android.R.id.list);
  View header=getLayoutInflater().inflate(R.layout.score_header,null,false);
  list.addHeaderView(header);
  Intent startingIntent=getIntent();
  currentTopic=startingIntent.getParcelableExtra(Constants.EXTRA_TOPIC);
  String currentTopicName=startingIntent.getStringExtra(Constants.EXTRA_TOPIC_NAME);
  int currentObjectKind=startingIntent.getIntExtra(Constants.EXTRA_OBJEKT_KIND,0);
  Log.d(TAG,"currentTopic: " + currentTopic);
  Log.d(TAG,"currentTopicName: " + currentTopicName);
  if (currentTopic != null) {
    new TopicStatementsTask(this).executeOnThreadPool(currentTopic.getId() + "");
  }
 else {
    new TopicStatementsTask(this).executeOnThreadPool(currentTopicName);
  }
  adapter=new ScoreBoardAdapter(this,android.R.layout.simple_list_item_1,new ArrayList<RankedStatements>());
  setListAdapter(adapter);
  description=(TextView)findViewById(R.id.description_scope);
  description.setTypeface(amenTypeBold);
  if (currentTopic != null) {
    final String topicAsSentence=topicAsSentence(currentTopic);
    description.setText(topicAsSentence);
    actionBar.setSubtitle(topicAsSentence);
  }
}
 

Example 45

From project and-bible, under directory /tests/Buttons/src/org/andbible/buttons/.

Source file: CustomTitlebarActivityBase.java

  15 
vote

/** 
 * custom title bar code to add the FEATURE_CUSTOM_TITLE just before setContentView and set the new titlebar layout just after
 */
@Override public void setContentView(int layoutResID){
  requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
  super.setContentView(layoutResID);
  getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,R.layout.title_bar);
  mDocumentTitleLink=(Button)findViewById(R.id.titleDocument);
  mPageTitleLink=(Button)findViewById(R.id.titlePassage);
  mProgressBarIndeterminate=(ProgressBar)findViewById(R.id.progressCircular);
  mQuickBibleChangeLink=(Button)findViewById(R.id.quickBibleChange);
  mQuickCommentaryChangeLink=(Button)findViewById(R.id.quickCommentaryChange);
  mDocumentTitleLink.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
    }
  }
);
  mPageTitleLink.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
    }
  }
);
  mQuickBibleChangeLink.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
    }
  }
);
  mQuickCommentaryChangeLink.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
    }
  }
);
}
 

Example 46

From project android-bankdroid, under directory /src/com/liato/bankdroid/.

Source file: LockableActivity.java

  15 
vote

@Override public void setContentView(int layoutResID){
  super.setContentView(layoutResID);
  getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,R.layout.title);
  View titlebar=findViewById(R.id.layTitle);
  mTitlebarButtons=(LinearLayout)titlebar.findViewById(R.id.layTitleButtons);
  mInflater=(LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mHomeButton=(ImageView)titlebar.findViewById(R.id.imgTitle);
  mHomeButtonCont=titlebar.findViewById(R.id.layLogoContainer);
  mProgressBar=(ProgressBar)titlebar.findViewById(R.id.progressBar);
  OnClickListener listener=new View.OnClickListener(){
    public void onClick(    View v){
      Intent intent=new Intent(LockableActivity.this,MainActivity.class);
      intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
      startActivity(intent);
      LockableActivity.this.finish();
    }
  }
;
  mHomeButton.setOnClickListener(listener);
  mHomeButtonCont.setOnClickListener(listener);
  setHomeButtonEnabled(true);
}
 

Example 47

From project android-flash-cards, under directory /src/org/thomasamsler/android/flashcards/fragment/.

Source file: CardSetsFragment.java

  15 
vote

@Override public void onListItemClick(ListView l,View v,int position,long id){
  CardSet cardSet=mCardSets.get(position);
  if (!cardSet.isRemote() && !cardSet.hasCards()) {
    Toast.makeText(mMainApplication,R.string.view_cards_emtpy_set_message,Toast.LENGTH_SHORT).show();
    return;
  }
  if (cardSet.isRemote()) {
    mProgressBar.setVisibility(ProgressBar.VISIBLE);
    cardSet.setFragmentId(CardSet.CARDS_PAGER_FRAGMENT);
    if (hasConnectivity()) {
      GetExternalCardsTask getExternalCardsTask=new GetExternalCardsTask(cardSet);
      getExternalCardsTask.execute();
    }
 else {
      mProgressBar.setVisibility(ProgressBar.GONE);
      Toast.makeText(mMainApplication,R.string.util_connectivity_error,Toast.LENGTH_SHORT).show();
    }
  }
 else {
    mMainApplication.doAction(ACTION_SHOW_CARDS,cardSet);
  }
}
 

Example 48

From project android-pulltorefresh, under directory /pulltorefresh/src/com/markupartist/android/widget/.

Source file: PullToRefreshListView.java

  15 
vote

private void init(Context context){
  mFlipAnimation=new RotateAnimation(0,-180,RotateAnimation.RELATIVE_TO_SELF,0.5f,RotateAnimation.RELATIVE_TO_SELF,0.5f);
  mFlipAnimation.setInterpolator(new LinearInterpolator());
  mFlipAnimation.setDuration(250);
  mFlipAnimation.setFillAfter(true);
  mReverseFlipAnimation=new RotateAnimation(-180,0,RotateAnimation.RELATIVE_TO_SELF,0.5f,RotateAnimation.RELATIVE_TO_SELF,0.5f);
  mReverseFlipAnimation.setInterpolator(new LinearInterpolator());
  mReverseFlipAnimation.setDuration(250);
  mReverseFlipAnimation.setFillAfter(true);
  mInflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mRefreshView=(RelativeLayout)mInflater.inflate(R.layout.pull_to_refresh_header,this,false);
  mRefreshViewText=(TextView)mRefreshView.findViewById(R.id.pull_to_refresh_text);
  mRefreshViewImage=(ImageView)mRefreshView.findViewById(R.id.pull_to_refresh_image);
  mRefreshViewProgress=(ProgressBar)mRefreshView.findViewById(R.id.pull_to_refresh_progress);
  mRefreshViewLastUpdated=(TextView)mRefreshView.findViewById(R.id.pull_to_refresh_updated_at);
  mRefreshViewImage.setMinimumHeight(50);
  mRefreshView.setOnClickListener(new OnClickRefreshListener());
  mRefreshOriginalTopPadding=mRefreshView.getPaddingTop();
  mRefreshState=TAP_TO_REFRESH;
  addHeaderView(mRefreshView);
  super.setOnScrollListener(this);
  measureView(mRefreshView);
  mRefreshViewHeight=mRefreshView.getMeasuredHeight();
}
 

Example 49

From project android-thaiime, under directory /latinime/src/com/android/inputmethod/deprecated/voice/.

Source file: RecognitionView.java

  15 
vote

public void restoreState(){
  mUiHandler.post(new Runnable(){
    @Override public void run(){
      if (mState == WORKING) {
        ((ProgressBar)mProgress).setIndeterminate(false);
        ((ProgressBar)mProgress).setIndeterminate(true);
      }
    }
  }
);
}
 

Example 50

From project android-viewflow, under directory /viewflow-example/src/org/taptwo/android/widget/viewflow/example/.

Source file: AsyncAdapter.java

  15 
vote

private View drawView(int position,View view){
  ViewHolder holder=null;
  if (view == null) {
    view=mInflater.inflate(R.layout.day_view,null);
    holder=new ViewHolder();
    holder.mProgressBar=(ProgressBar)view.findViewById(R.id.progress);
    holder.mDate=(TextView)view.findViewById(R.id.date);
    holder.mContent=(View)view.findViewById(R.id.content);
    view.setTag(holder);
  }
 else {
    holder=(ViewHolder)view.getTag();
  }
  final String o=getItem(position);
  if (o != null) {
    holder.mProgressBar.setVisibility(View.GONE);
    holder.mDate.setText(o);
    holder.mContent.setVisibility(View.VISIBLE);
  }
 else {
    new LoadContentTask().execute(position,view);
    holder.mContent.setVisibility(View.GONE);
    holder.mProgressBar.setVisibility(View.VISIBLE);
  }
  return view;
}
 

Example 51

From project android-voip-service, under directory /src/main/java/org/linphone/.

Source file: FirstLoginActivity.java

  15 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.first_login_view);
  mPref=PreferenceManager.getDefaultSharedPreferences(this);
  setDefaultDomain(getString(R.string.default_domain));
  login=(TextView)findViewById(R.id.login);
  login.setText(mPref.getString(getString(R.string.pref_username_key),""));
  password=(TextView)findViewById(R.id.password);
  password.setText(mPref.getString(getString(R.string.pref_passwd_key),""));
  bar=(ProgressBar)findViewById(R.id.progress_bar);
  bar.setVisibility(View.INVISIBLE);
  findViewById(R.id.connect).setOnClickListener(this);
  instance=this;
}
 

Example 52

From project Android_1, under directory /LeftNavBarExample/LeftNavBarLibrary/src/com/example/google/tv/leftnavbar/.

Source file: TitleBarView.java

  15 
vote

@Override protected void onFinishInflate(){
  super.onFinishInflate();
  if (getChildCount() == 0) {
    LayoutInflater.from(mContext).inflate(R.layout.lib_title_bar,this,true);
  }
  mTitle=(TextView)findViewById(R.id.title);
  mSubtitle=(TextView)findViewById(R.id.subtitle);
  mLeftIcon=(ImageView)findViewById(R.id.left_icon);
  mRightIcon=(ImageView)findViewById(R.id.right_icon);
  mCircularProgress=(ProgressBar)findViewById(R.id.progress_circular);
  if (mCircularProgress != null) {
    mCircularProgress.setIndeterminate(true);
  }
  mHorizontalProgress=(ProgressBar)findViewById(R.id.progress_horizontal);
  if (mIsLegacy) {
    setTextStyle(mTitle,mTitleResource);
    disableSubtitle();
  }
 else {
    setTextStyle(mTitle,mTitleResource);
    setTextStyle(mSubtitle,mSubtitleResource);
    disableLeftIcon();
    disableRightIcon();
  }
}
 

Example 53

From project android_7, under directory /src/org/immopoly/android/dialog/.

Source file: WebViewDialog.java

  15 
vote

public void show(){
  View layout=getLayout();
  webView=(WebView)layout.findViewById(R.id.webView);
  if (webView == null) {
    Log.e(Const.LOG_TAG,"You must supply a WebView with id 'webView' in your dialog layout");
    return;
  }
  webView.getSettings().setJavaScriptEnabled(true);
  webView.setVerticalScrollbarOverlay(true);
  webView.setHorizontalScrollbarOverlay(true);
  webView.setBackgroundColor(0);
  webView.setMinimumHeight(300);
  webView.setWebViewClient(this);
  progressView=(ProgressBar)layout.findViewById(R.id.progress);
  AlertDialog.Builder builder=new AlertDialog.Builder(activity);
  builder.setTitle(title);
  builder.setCancelable(false).setPositiveButton(activity.getString(R.string.close),new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
      onClose();
      mTracker.stopSession();
      dialog.dismiss();
    }
  }
);
  builder.setView(layout);
  alert=builder.create();
  alert.show();
  loadURL(url);
}
 

Example 54

From project android_packages_apps_Gallery, under directory /src/com/android/camera/.

Source file: DeleteImage.java

  15 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Intent intent=getIntent();
  mUriList=intent.getParcelableArrayListExtra("delete-uris");
  if (mUriList == null) {
    finish();
  }
  setContentView(R.layout.delete_image);
  mProgressBar=(ProgressBar)findViewById(R.id.delete_progress);
  mContentResolver=getContentResolver();
}
 

Example 55

From project android_packages_apps_phone, under directory /src/com/android/phone/.

Source file: OtaUtils.java

  15 
vote

/** 
 * Initialize the OTA widgets for all OTA screens.
 */
private void initOtaInCallScreen(){
  if (DBG)   log("initOtaInCallScreen()...");
  mOtaWidgetData.otaTitle=(TextView)mInCallScreen.findViewById(R.id.otaTitle);
  mOtaWidgetData.otaTextActivate=(TextView)mInCallScreen.findViewById(R.id.otaActivate);
  mOtaWidgetData.otaTextActivate.setVisibility(View.GONE);
  mOtaWidgetData.otaTextListenProgressContainer=(ScrollView)mInCallScreen.findViewById(R.id.otaListenProgressContainer);
  mOtaWidgetData.otaTextListenProgress=(TextView)mInCallScreen.findViewById(R.id.otaListenProgress);
  mOtaWidgetData.otaTextProgressBar=(ProgressBar)mInCallScreen.findViewById(R.id.progress_large);
  mOtaWidgetData.otaTextProgressBar.setIndeterminate(true);
  mOtaWidgetData.otaTextSuccessFail=(TextView)mInCallScreen.findViewById(R.id.otaSuccessFailStatus);
  mOtaWidgetData.otaCallCardBase=(View)mInCallScreen.findViewById(R.id.otaBase);
  mOtaWidgetData.callCardOtaButtonsListenProgress=(View)mInCallScreen.findViewById(R.id.callCardOtaListenProgress);
  mOtaWidgetData.callCardOtaButtonsActivate=(View)mInCallScreen.findViewById(R.id.callCardOtaActivate);
  mOtaWidgetData.callCardOtaButtonsFailSuccess=(View)mInCallScreen.findViewById(R.id.callCardOtaFailOrSuccessful);
  mOtaWidgetData.otaEndButton=(Button)mInCallScreen.findViewById(R.id.otaEndButton);
  mOtaWidgetData.otaEndButton.setOnClickListener(mInCallScreen);
  mOtaWidgetData.otaSpeakerButton=(ToggleButton)mInCallScreen.findViewById(R.id.otaSpeakerButton);
  mOtaWidgetData.otaSpeakerButton.setOnClickListener(mInCallScreen);
  mOtaWidgetData.otaActivateButton=(Button)mInCallScreen.findViewById(R.id.otaActivateButton);
  mOtaWidgetData.otaActivateButton.setOnClickListener(mInCallScreen);
  mOtaWidgetData.otaSkipButton=(Button)mInCallScreen.findViewById(R.id.otaSkipButton);
  mOtaWidgetData.otaSkipButton.setOnClickListener(mInCallScreen);
  mOtaWidgetData.otaNextButton=(Button)mInCallScreen.findViewById(R.id.otaNextButton);
  mOtaWidgetData.otaNextButton.setOnClickListener(mInCallScreen);
  mOtaWidgetData.otaTryAgainButton=(Button)mInCallScreen.findViewById(R.id.otaTryAgainButton);
  mOtaWidgetData.otaTryAgainButton.setOnClickListener(mInCallScreen);
  mOtaWidgetData.otaDtmfDialerView=(DTMFTwelveKeyDialerView)mInCallScreen.findViewById(R.id.otaDtmfDialer);
  if (mOtaWidgetData.otaDtmfDialerView == null) {
    Log.e(LOG_TAG,"onCreate: couldn't find otaDtmfDialer",new IllegalStateException());
  }
  mOtaCallCardDtmfDialer=new DTMFTwelveKeyDialer(mInCallScreen,mOtaWidgetData.otaDtmfDialerView,null);
  mOtaCallCardDtmfDialer.startDialerSession();
  mOtaWidgetData.otaDtmfDialerView.setDialer(mOtaCallCardDtmfDialer);
}
 

Example 56

From project android_packages_apps_TouchWiz30Launcher, under directory /src/com/sec/android/app/twlauncher/.

Source file: MenuDrawer.java

  15 
vote

protected void onFinishInflate(){
  super.onFinishInflate();
  mProgressBar=(ProgressBar)getChildAt(0);
  mProgressBar.setIndeterminate(true);
  mMenuManager=(MenuManager)getChildAt(1);
  setAnimationCacheEnabled(false);
}
 

Example 57

From project android_packages_inputmethods_LatinIME, under directory /java/src/com/android/inputmethod/deprecated/voice/.

Source file: RecognitionView.java

  15 
vote

public void restoreState(){
  mUiHandler.post(new Runnable(){
    @Override public void run(){
      if (mState == WORKING) {
        ((ProgressBar)mProgress).setIndeterminate(false);
        ((ProgressBar)mProgress).setIndeterminate(true);
      }
    }
  }
);
}
 

Example 58

From project Anki-Android, under directory /src/com/ichi2/anki/.

Source file: DownloadViewWrapper.java

  15 
vote

ProgressBar getProgressBar(){
  if (mProgressBar == null) {
    mProgressBar=(ProgressBar)mBase.findViewById(R.id.progress_bar);
  }
  return mProgressBar;
}
 

Example 59

From project apps-for-android, under directory /Photostream/src/com/google/android/photostream/.

Source file: LoginActivity.java

  15 
vote

private void setupViews(){
  mUsername=(TextView)findViewById(R.id.input_username);
  mUsername.setOnKeyListener(this);
  mUsername.requestFocus();
  mAdapter=new UsersAdapter(this,initializeCursor());
  final ListView userList=(ListView)findViewById(R.id.list_users);
  userList.setAdapter(mAdapter);
  userList.setOnItemClickListener(this);
  registerForContextMenu(userList);
  mProgress=(ProgressBar)findViewById(R.id.progress);
}
 

Example 60

From project Barcamp-Bangalore-Android-App, under directory /actionbar/src/com/markupartist/android/widget/.

Source file: ActionBar.java

  15 
vote

public ActionBar(Context context,AttributeSet attrs){
  super(context,attrs);
  mInflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mBarView=(RelativeLayout)mInflater.inflate(R.layout.actionbar,null);
  addView(mBarView);
  mLogoView=(ImageView)mBarView.findViewById(R.id.actionbar_home_logo);
  mHomeLayout=(RelativeLayout)mBarView.findViewById(R.id.actionbar_home_bg);
  mHomeBtn=(ImageButton)mBarView.findViewById(R.id.actionbar_home_btn);
  mBackIndicator=mBarView.findViewById(R.id.actionbar_home_is_back);
  mTitleView=(TextView)mBarView.findViewById(R.id.actionbar_title);
  mActionsView=(LinearLayout)mBarView.findViewById(R.id.actionbar_actions);
  mProgress=(ProgressBar)mBarView.findViewById(R.id.actionbar_progress);
  TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.ActionBar);
  CharSequence title=a.getString(R.styleable.ActionBar_title);
  if (title != null) {
    setTitle(title);
  }
  a.recycle();
}
 

Example 61

From project com.juick.android, under directory /src/com/juick/android/.

Source file: MessagesFragment.java

  15 
vote

@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  LayoutInflater li=(LayoutInflater)getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  viewLoading=li.inflate(R.layout.listitem_loading,null);
  mRefreshView=(RelativeLayout)li.inflate(R.layout.pull_to_refresh_header,null);
  mRefreshViewText=(TextView)mRefreshView.findViewById(R.id.pull_to_refresh_text);
  mRefreshViewImage=(ImageView)mRefreshView.findViewById(R.id.pull_to_refresh_image);
  mRefreshViewProgress=(ProgressBar)mRefreshView.findViewById(R.id.pull_to_refresh_progress);
  mRefreshViewImage.setMinimumHeight(50);
  mRefreshView.setOnClickListener(this);
  mRefreshOriginalTopPadding=mRefreshView.getPaddingTop();
  mRefreshState=TAP_TO_REFRESH;
  getListView().setOnTouchListener(this);
  getListView().setOnScrollListener(this);
  getListView().setOnItemClickListener(this);
  getListView().setOnItemLongClickListener(new JuickMessageMenu(getActivity()));
  listAdapter=new JuickMessagesAdapter(getActivity(),0);
  init();
}
 

Example 62

From project cw-advandroid, under directory /SystemEvents/OnBattery/src/com/commonsware/android/sysevents/battery/.

Source file: BatteryMonitor.java

  15 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  bar=(ProgressBar)findViewById(R.id.bar);
  status=(ImageView)findViewById(R.id.status);
  level=(TextView)findViewById(R.id.level);
}
 

Example 63

From project cw-android, under directory /Rotation/RotationAsync/src/com/commonsware/android/rotation/async/.

Source file: RotationAsync.java

  15 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  bar=(ProgressBar)findViewById(R.id.progress);
  task=(RotationAwareTask)getLastNonConfigurationInstance();
  if (task == null) {
    task=new RotationAwareTask(this);
    task.execute();
  }
 else {
    task.attach(this);
    updateProgress(task.getProgress());
    if (task.getProgress() >= 100) {
      markAsDone();
    }
  }
}
 

Example 64

From project cw-omnibus, under directory /Intents/OnBattery/src/com/commonsware/android/battmon/.

Source file: BatteryFragment.java

  15 
vote

@Override public View onCreateView(LayoutInflater inflater,ViewGroup parent,Bundle savedInstanceState){
  View result=inflater.inflate(R.layout.batt,parent,false);
  bar=(ProgressBar)result.findViewById(R.id.bar);
  status=(ImageView)result.findViewById(R.id.status);
  level=(TextView)result.findViewById(R.id.level);
  return (result);
}
 

Example 65

From project danbooru-gallery-android, under directory /src/tw/idv/palatis/danboorugallery/.

Source file: ViewImageActivity.java

  15 
vote

public void init(ViewImageActivity a){
  activity=a;
  image=(ImageViewTouch)activity.findViewById(R.id.view_image_image);
  progress_indicator=(RelativeLayout)activity.findViewById(R.id.view_image_progress_indicator);
  progress_message=(TextView)activity.findViewById(R.id.view_image_progress_message);
  progress_progressbar=(ProgressBar)activity.findViewById(R.id.view_image_progress_progressbar);
}
 

Example 66

From project DigitbooksExamples, under directory /DigitbooksExamples/src/fr/digitbooks/android/examples/chapitre10/.

Source file: PiCalculatorActivity.java

  15 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.pi_calculator_choice);
  mLaunchButton=(Button)findViewById(R.id.button);
  mProgress=(ProgressBar)findViewById(R.id.progress);
  editText=(EditText)findViewById(R.id.number_limit);
  mRadioGroup=(RadioGroup)findViewById(R.id.radio_group);
  mLaunchButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View v){
      if (Config.INFO_LOGS_ENABLED) {
        Log.i(LOG_TAG,"onClick");
      }
      if (v.getId() == R.id.button) {
        int limit=0;
        if (editText.getText().length() != 0)         limit=Integer.parseInt(editText.getText().toString());
        if (limit > 0 && limit <= ALGORITHME_LIMIT) {
          final RadioButton javaModeChecked=(RadioButton)findViewById(R.id.mode_java);
          if (javaModeChecked.isChecked()) {
            if (Config.INFO_LOGS_ENABLED) {
              Log.i(LOG_TAG,"Start Java method ");
            }
            if (task == null)             task=new PiCalculatingJavaTask(PiCalculatorActivity.this).execute(limit);
          }
 else {
            if (Config.INFO_LOGS_ENABLED) {
              Log.i(LOG_TAG,"Start Ndk method ");
            }
            if (task == null)             task=new PiCalculatingNdkTask(PiCalculatorActivity.this).execute(limit);
          }
        }
 else {
          Toast.makeText(PiCalculatorActivity.this,R.string.bad_limit,Toast.LENGTH_LONG).show();
        }
      }
    }
  }
);
}
 

Example 67

From project dmix, under directory /MPDroid/src/com/namelessdev/mpdroid/fragments/.

Source file: NowPlayingFragment.java

  15 
vote

public void onCoverDownloaded(Bitmap cover){
  coverArtProgress.setVisibility(ProgressBar.INVISIBLE);
  DisplayMetrics metrics=new DisplayMetrics();
  try {
    getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics);
    if (cover != null) {
      cover.setDensity((int)metrics.density);
      BitmapDrawable myCover=new BitmapDrawable(getResources(),cover);
      coverArt.setImageDrawable(myCover);
    }
 else {
      onCoverNotFound();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
 

Example 68

From project droidkit, under directory /src/org/droidkit/app/.

Source file: UpdateActivity.java

  15 
vote

@Override public void onCreate(Bundle savedInstanceState){
  setTheme(android.R.style.Theme_Light_NoTitleBar);
  super.onCreate(savedInstanceState);
  setContentView(Resources.getId(this,"activity_update",Resources.TYPE_LAYOUT));
  bindService(new Intent(this,UpdateService.class),mConnection,BIND_AUTO_CREATE);
  mServiceRunning=true;
  mIconView=(ImageView)findViewById(Resources.getId(this,"update_act_icon",Resources.TYPE_ID));
  mTitleView=(TextView)findViewById(Resources.getId(this,"update_act_title",Resources.TYPE_ID));
  mAuthorView=(TextView)findViewById(Resources.getId(this,"update_act_author",Resources.TYPE_ID));
  mVersionView=(TextView)findViewById(Resources.getId(this,"update_act_ver",Resources.TYPE_ID));
  mDownloadLabel=(TextView)findViewById(Resources.getId(this,"update_act_dl",Resources.TYPE_ID));
  mNotesView=(WebView)findViewById(Resources.getId(this,"update_act_relnotes",Resources.TYPE_ID));
  mIconView.setImageResource(getApplicationInfo().icon);
  mProgressUpdate=(ProgressBar)findViewById(Resources.getId(this,"update_act_bar",Resources.TYPE_ID));
  mCloseButton=(Button)findViewById(Resources.getId(this,"update_act_cancel",Resources.TYPE_ID));
  mCloseButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      UpdateActivity.this.finish();
    }
  }
);
  mUpdateButton=(Button)findViewById(Resources.getId(this,"update_act_inst",Resources.TYPE_ID));
  mUpdateButton.setOnClickListener(mUpdateClick);
  try {
    String obj=getIntent().getStringExtra("json");
    JSONObject json=new JSONObject(obj);
    mTitleView.setText(json.getString("title"));
    mAuthorView.setText(json.getString("author"));
    JSONArray updates=json.getJSONArray("updates");
    JSONObject update=updates.getJSONObject(0);
    mNotesView.loadData(update.getString("release.notes"),"text/html","utf-8");
    mApkFile=update.getString("apk.url");
    mVersionView.setText("Version: " + update.getString("version.string"));
    Log.i("DroidKit","HTML: " + update.getString("release.notes"));
  }
 catch (  JSONException e) {
    Log.e("DroidKit","Error parsing the update JSON.");
  }
}
 

Example 69

From project dungbeetle, under directory /src/edu/stanford/mobisocial/dungbeetle/.

Source file: VoiceQuickRecordActivity.java

  15 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.voice_quick_recorder);
  Intent intent=getIntent();
  if (intent.hasExtra("feed_uri")) {
    feedUri=intent.getParcelableExtra("feed_uri");
  }
 else   if (intent.hasExtra("presence_mode")) {
    presenceUris=Push2TalkPresence.getInstance().getFeedsWithPresence();
    if (presenceUris.size() == 0) {
      presenceUris=null;
    }
  }
  if (intent.hasExtra("keydown")) {
    findViewById(R.id.sendRecord).setVisibility(View.GONE);
  }
  if (presenceUris == null && feedUri == null) {
    Toast.makeText(this,"No recipients for voice recording.",Toast.LENGTH_SHORT).show();
    finish();
    return;
  }
  int orientation=getResources().getConfiguration().orientation;
  setRequestedOrientation(orientation);
  mTimerRecord=(ProgressBar)findViewById(R.id.timerRecord);
  mTimerRecord.setMax(18 * 2);
  mStatusLabel=(TextView)findViewById(R.id.statusLabel);
  ((Button)findViewById(R.id.cancelRecord)).setOnClickListener(btnClick);
  ((Button)findViewById(R.id.sendRecord)).setOnClickListener(btnClick);
  RemoteControlReceiver.setSpecialKeyEventHandler(this);
  bufferSize=AudioRecord.getMinBufferSize(RECORDER_SAMPLERATE,RECORDER_CHANNELS,RECORDER_AUDIO_ENCODING);
  notifyStartRecording();
  startService(new Intent(this,DungBeetleService.class));
}
 

Example 70

From project Ebento, under directory /src/mobisocial/bento/ebento/ui/.

Source file: EventListFragment.java

  15 
vote

public EventListAsyncTask(EventListItemAdapter listAdapter,ListView listView,View listRoot){
  mListAdapter=listAdapter;
  mListView=listView;
  mEmptyText=(TextView)listRoot.findViewById(R.id.empty_message);
  mProgressBar=(ProgressBar)listRoot.findViewById(R.id.progress);
}
 

Example 71

From project eoit, under directory /EOIT/src/fr/eoit/activity/.

Source file: EOITActivity.java

  15 
vote

/** 
 * Called when the activity is first created.
 */
@Override public void onCreate(Bundle savedInstanceState){
  loadParametersOnCreate=false;
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  bar=(ProgressBar)findViewById(R.id.progressBar);
  bar.setIndeterminate(true);
  infoTextView=(TextView)findViewById(R.id.textView);
  File path=Environment.getDataDirectory();
  StatFs stat=new StatFs(path.getPath());
  long blockSize=stat.getBlockSize();
  long availableBlocks=stat.getAvailableBlocks();
  if (blockSize * availableBlocks > EOITConst.APPLICATION_SIZE) {
    new LoadItemsAsyncTask().execute(this);
  }
 else {
    new AlertDialog.Builder(this).setCancelable(false).setTitle(R.string.database_no_space).setMessage(getResources().getString(R.string.database_no_space_message,EOITConst.APPLICATION_SIZE / (1024 * 1024))).setIcon(android.R.drawable.ic_dialog_alert).setNegativeButton(R.string.database_locked_close_button_message,new DialogInterface.OnClickListener(){
      @Override public void onClick(      DialogInterface dialog,      int whichButton){
        finish();
      }
    }
).create().show();
  }
}
 

Example 72

From project examples_2, under directory /LeakingActivity/src/com/inazaruk/leak/.

Source file: LeakingActivity.java

  15 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  mStatus=(TextView)findViewById(R.id.status);
  mMemoryProgress=(ProgressBar)findViewById(R.id.progress);
  mHandler=new Handler();
  mLeaker=new Leaker();
  mLeaker.start();
}
 

Example 73

From project fanfoudroid, under directory /src/com/ch_linghu/fanfoudroid/.

Source file: SearchResultActivity.java

  15 
vote

@Override protected void setupState(){
  mTweets=new ArrayList<Tweet>();
  mTweetList=(PullToRefreshListView)findViewById(R.id.tweet_list);
  mAdapter=new TweetArrayAdapter(this);
  mTweetList.setAdapter(mAdapter);
  mTweetList.setOnRefreshListener(new OnRefreshListener(){
    @Override public void onRefresh(){
      doRetrieve();
    }
  }
);
  mListFooter=View.inflate(this,R.layout.listview_footer,null);
  mTweetList.addFooterView(mListFooter,null,true);
  loadMoreGIF=(ProgressBar)findViewById(R.id.rectangleProgressBar);
}
 

Example 74

From project finch, under directory /libs/JakeWharton-ActionBarSherlock-2eabf25/samples/fragments/src/com/actionbarsherlock/sample/fragments/.

Source file: FragmentRetainInstanceSupport.java

  15 
vote

/** 
 * This is called when the Fragment's Activity is ready to go, after its content view has been installed; it is called both after the initial fragment creation and after the fragment is re-attached to a new activity.
 */
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  mProgressBar=(ProgressBar)getTargetFragment().getView().findViewById(R.id.progress_horizontal);
synchronized (mThread) {
    mReady=true;
    mThread.notify();
  }
}
 

Example 75

From project framework_base_policy, under directory /src/com/android/internal/policy/impl/.

Source file: PhoneWindow.java

  15 
vote

private void showProgressBars(ProgressBar horizontalProgressBar,ProgressBar spinnyProgressBar){
  final int features=getLocalFeatures();
  if ((features & (1 << FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.INVISIBLE) {
    spinnyProgressBar.setVisibility(View.VISIBLE);
  }
  if ((features & (1 << FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getProgress() < 10000) {
    horizontalProgressBar.setVisibility(View.VISIBLE);
  }
}
 

Example 76

From project friendica-for-android, under directory /mw-android-friendica-01/src/de/wikilab/android/friendica01/.

Source file: FriendListFragment.java

  15 
vote

@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  myView=inflater.inflate(R.layout.friendlistinner,container,false);
  list=(GridView)myView.findViewById(R.id.gridview);
  progbar=(ProgressBar)myView.findViewById(R.id.progressbar);
  ((TextView)myView.findViewById(R.id.notice_bar)).setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      loadFriendList(true);
    }
  }
);
  return myView;
}
 

Example 77

From project Gaggle, under directory /src/com/geeksville/maps/.

Source file: PrefetchMapActivity.java

  15 
vote

/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.prefetch_map);
  Bundle extras=getIntent().getExtras();
  center=new GeoPoint(extras.getInt(EXTRA_LATITUDE),extras.getInt(EXTRA_LONGITUDE));
  zoomLevel=extras.getInt(EXTRA_ZOOMLEVEL);
  source=extras.getString(EXTRA_TILESOURCE);
  renderer=OpenStreetMapRendererFactory.getRenderer(source);
  startButton=(Button)findViewById(R.id.start);
  startButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      background=new DownloadTilesTask().execute();
    }
  }
);
  clearButton=(Button)findViewById(R.id.clear);
  clearButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      background=new ClearCacheTask().execute();
    }
  }
);
  editOptions=findViewById(R.id.editoptions);
  progress=(ProgressBar)findViewById(R.id.progress);
  progress.setVisibility(View.GONE);
  cancelButton=(Button)findViewById(R.id.cancel);
  cancelButton.setVisibility(View.GONE);
  cancelButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      background.cancel(false);
    }
  }
);
}
 

Example 78

From project gauges-android, under directory /app/src/main/java/com/github/mobile/gauges/ui/.

Source file: ItemListFragment.java

  15 
vote

@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  listView=(ListView)view.findViewById(android.R.id.list);
  listView.setOnItemClickListener(new OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
      onListItemClick((ListView)parent,view,position,id);
    }
  }
);
  progressBar=(ProgressBar)view.findViewById(id.pb_loading);
  emptyView=(TextView)view.findViewById(android.R.id.empty);
  configureList(getActivity(),getListView());
}
 

Example 79

From project Gibberbot, under directory /src/info/guardianproject/otr/app/im/app/.

Source file: UserPresenceView.java

  15 
vote

@Override protected void onFinishInflate(){
  super.onFinishInflate();
  if (isInEditMode())   return;
  mStatusDialogButton=(ImageButton)findViewById(R.id.statusDropDownButton);
  mStatusDialogButton.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
      showStatusListDialog();
    }
  }
);
  mProgressBar=(ProgressBar)findViewById(R.id.progressBar1);
}
 

Example 80

From project Gingerbread-Keyboard, under directory /src/com/android/inputmethod/voice/.

Source file: RecognitionView.java

  15 
vote

public void restoreState(){
  mUiHandler.post(new Runnable(){
    public void run(){
      if (mState == State.WORKING) {
        ((ProgressBar)mProgress).setIndeterminate(false);
        ((ProgressBar)mProgress).setIndeterminate(true);
      }
    }
  }
);
}
 

Example 81

From project Google-Tasks-Client, under directory /src/com/redditandroiddevelopers/googletasksclient/.

Source file: detailTasks.java

  15 
vote

protected void onPostExecute(Void result){
  progressView.setVisibility(ProgressBar.GONE);
  noteTextNew.setVisibility(TextView.VISIBLE);
  updatedTextNew.setVisibility(TextView.VISIBLE);
  updatedTextNew.setText(timeagoString);
  noteTextNew.setText(notesString);
  return;
}
 

Example 82

From project GSM-Signal-Tracking-, under directory /gpstracker/src/nl/sogeti/android/gpstracker/viewer/.

Source file: TrackList.java

  15 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  displayIntent(getIntent());
  this.setContentView(R.layout.tracklist);
  mImportProgress=(ProgressBar)findViewById(R.id.importProgress);
  ListView listView=getListView();
  listView.setItemsCanFocus(false);
  registerForContextMenu(listView);
}
 

Example 83

From project hsDroid, under directory /src/de/nware/app/hsDroid/ui/.

Source file: nActivity.java

  15 
vote

public void customTitle(String activityTitle){
  if (activityTitle.length() > 20)   activityTitle=activityTitle.substring(0,20);
  if (customTitleSupported) {
    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,R.layout.titlebar);
    System.out.println("test: " + this.getLocalClassName());
    if (this.getLocalClassName() == "HsDroidMain") {
      System.out.println("main class");
    }
 else {
      System.out.println("not main class");
    }
    if (this.getLocalClassName() != "HsDroidMain") {
      ImageView image=(ImageView)findViewById(R.id.appIconImageView);
      image.setOnClickListener(new OnClickListener(){
        @Override public void onClick(        View v){
          Intent dashIntent=new Intent(getApplicationContext(),Dashboard.class);
          dashIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
          startActivity(dashIntent);
          finish();
        }
      }
);
    }
    TextView titleTvActivityTitle=(TextView)findViewById(R.id.titleTvActivityTitle);
    titleTvActivityTitle.setText(activityTitle);
    titleProgressBar=(ProgressBar)findViewById(R.id.leadProgressBar);
    hideTitleProgress();
  }
}
 

Example 84

From project ICS_LatinIME_QHD, under directory /java/src/com/android/inputmethod/deprecated/voice/.

Source file: RecognitionView.java

  15 
vote

public void restoreState(){
  mUiHandler.post(new Runnable(){
    @Override public void run(){
      if (mState == WORKING) {
        ((ProgressBar)mProgress).setIndeterminate(false);
        ((ProgressBar)mProgress).setIndeterminate(true);
      }
    }
  }
);
}
 

Example 85

From project iJetty, under directory /i-jetty/i-jetty-ui/src/org/mortbay/ijetty/.

Source file: IJettyDownloader.java

  15 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (!tmpDir.exists()) {
    tmpDir.mkdirs();
  }
  setContentView(R.layout.jetty_downloader);
  progressBar=(ProgressBar)findViewById(R.id.progress);
  final Button startDownloadButton=(Button)findViewById(R.id.start_download);
  startDownloadButton.setOnClickListener(new StartDownloadOnClickListener());
}
 

Example 86

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

Source file: PullToRefreshListView.java

  15 
vote

private void init(Context context){
  mFlipAnimation=new RotateAnimation(0,-180,RotateAnimation.RELATIVE_TO_SELF,0.5f,RotateAnimation.RELATIVE_TO_SELF,0.5f);
  mFlipAnimation.setInterpolator(new LinearInterpolator());
  mFlipAnimation.setDuration(250);
  mFlipAnimation.setFillAfter(true);
  mReverseFlipAnimation=new RotateAnimation(-180,0,RotateAnimation.RELATIVE_TO_SELF,0.5f,RotateAnimation.RELATIVE_TO_SELF,0.5f);
  mReverseFlipAnimation.setInterpolator(new LinearInterpolator());
  mReverseFlipAnimation.setDuration(250);
  mReverseFlipAnimation.setFillAfter(true);
  mInflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mRefreshView=(LinearLayout)mInflater.inflate(R.layout.pull_to_refresh_header,null);
  mRefreshViewText=(TextView)mRefreshView.findViewById(R.id.pull_to_refresh_text);
  mRefreshViewImage=(ImageView)mRefreshView.findViewById(R.id.pull_to_refresh_image);
  mRefreshViewProgress=(ProgressBar)mRefreshView.findViewById(R.id.pull_to_refresh_progress);
  mRefreshViewLastUpdated=(TextView)mRefreshView.findViewById(R.id.pull_to_refresh_updated_at);
  mRefreshViewImage.setMinimumHeight(50);
  mRefreshView.setOnClickListener(new OnClickRefreshListener());
  mRefreshOriginalTopPadding=mRefreshView.getPaddingTop();
  mRefreshOriginalBottomPadding=mRefreshView.getPaddingBottom();
  addHeaderView(mRefreshView);
  mRefreshViewFT=(LinearLayout)mInflater.inflate(R.layout.endress_footer,null);
  mRefreshViewTextFT=(TextView)mRefreshViewFT.findViewById(R.id.pull_to_refresh_updated_at_ft);
  mRefreshViewProgressFT=(ProgressBar)mRefreshViewFT.findViewById(R.id.pull_to_refresh_progress_ft);
  mRefreshViewFT.setOnClickListener(new OnClickRefreshListener());
  mRefreshFTOriginalTopPadding=mRefreshViewFT.getPaddingTop();
  mRefreshFTOriginalBottomPadding=mRefreshViewFT.getPaddingBottom();
  addFooterView(mRefreshViewFT);
  mRefreshState=TAP_TO_REFRESH;
  super.setOnScrollListener(this);
  measureView(mRefreshView);
  mRefreshViewHeight=mRefreshView.getMeasuredHeight();
  mRefreshViewFTHeight=mRefreshViewFT.getMeasuredHeight();
  headerInvisible();
  footerInvisible();
}
 

Example 87

From project jamendo-android, under directory /src/com/teleca/jamendo/adapter/.

Source file: AlbumAdapter.java

  15 
vote

@Override public View getView(int position,View convertView,ViewGroup parent){
  View row=convertView;
  ViewHolder holder;
  if (row == null) {
    LayoutInflater inflater=mContext.getLayoutInflater();
    row=inflater.inflate(R.layout.album_row,null);
    holder=new ViewHolder();
    holder.image=(RemoteImageView)row.findViewById(R.id.AlbumRowImageView);
    holder.albumText=(TextView)row.findViewById(R.id.AlbumRowAlbumTextView);
    holder.artistText=(TextView)row.findViewById(R.id.AlbumRowArtistTextView);
    holder.progressBar=(ProgressBar)row.findViewById(R.id.AlbumRowRatingBar);
    row.setTag(holder);
  }
 else {
    holder=(ViewHolder)row.getTag();
  }
  holder.image.setDefaultImage(R.drawable.no_cd);
  holder.image.setImageUrl(mList.get(position).getImage(),position,getListView());
  holder.albumText.setText(mList.get(position).getName());
  holder.artistText.setText(mList.get(position).getArtistName());
  holder.progressBar.setMax(10);
  holder.progressBar.setProgress((int)(mList.get(position).getRating() * 10));
  return row;
}
 

Example 88

From project Juggernaut_SystemUI, under directory /src/com/android/systemui/usb/.

Source file: UsbStorageActivity.java

  15 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (mStorageManager == null) {
    mStorageManager=(StorageManager)getSystemService(Context.STORAGE_SERVICE);
    if (mStorageManager == null) {
      Log.w(TAG,"Failed to get StorageManager");
    }
  }
  mUIHandler=new Handler();
  HandlerThread thr=new HandlerThread("SystemUI UsbStorageActivity");
  thr.start();
  mAsyncStorageHandler=new Handler(thr.getLooper());
  requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  setProgressBarIndeterminateVisibility(true);
  getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
  if (Environment.isExternalStorageRemovable()) {
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
  }
  setTitle(getString(com.android.internal.R.string.usb_storage_activity_title));
  setContentView(com.android.internal.R.layout.usb_storage_activity);
  mIcon=(ImageView)findViewById(com.android.internal.R.id.icon);
  mBanner=(TextView)findViewById(com.android.internal.R.id.banner);
  mMessage=(TextView)findViewById(com.android.internal.R.id.message);
  mMountButton=(Button)findViewById(com.android.internal.R.id.mount_button);
  mMountButton.setOnClickListener(this);
  mUnmountButton=(Button)findViewById(com.android.internal.R.id.unmount_button);
  mUnmountButton.setOnClickListener(this);
  mProgressBar=(ProgressBar)findViewById(com.android.internal.R.id.progress);
}
 

Example 89

From project k-9, under directory /src/com/fsck/k9/fragment/.

Source file: MessageListFragment.java

  15 
vote

private View getFooterView(ViewGroup parent){
  if (mFooterView == null) {
    mFooterView=mInflater.inflate(R.layout.message_list_item_footer,parent,false);
    mFooterView.setId(R.layout.message_list_item_footer);
    FooterViewHolder holder=new FooterViewHolder();
    holder.progress=(ProgressBar)mFooterView.findViewById(R.id.message_list_progress);
    holder.progress.setIndeterminate(true);
    holder.main=(TextView)mFooterView.findViewById(R.id.main_text);
    mFooterView.setTag(holder);
  }
  return mFooterView;
}
 

Example 90

From project LitHub, under directory /LitHub-Android/src/com/markupartist/android/widget/.

Source file: ActionBar.java

  15 
vote

public ActionBar(Context context,AttributeSet attrs){
  super(context,attrs);
  mInflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mBarView=(RelativeLayout)mInflater.inflate(R.layout.actionbar,null);
  addView(mBarView);
  mLogoView=(ImageView)mBarView.findViewById(R.id.actionbar_home_logo);
  mHomeLayout=(RelativeLayout)mBarView.findViewById(R.id.actionbar_home_bg);
  mHomeBtn=(ImageButton)mBarView.findViewById(R.id.actionbar_home_btn);
  mBackIndicator=mBarView.findViewById(R.id.actionbar_home_is_back);
  mTitleView=(TextView)mBarView.findViewById(R.id.actionbar_title);
  mActionsView=(LinearLayout)mBarView.findViewById(R.id.actionbar_actions);
  mProgress=(ProgressBar)mBarView.findViewById(R.id.actionbar_progress);
  TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.ActionBar);
  CharSequence title=a.getString(R.styleable.ActionBar_title);
  if (title != null) {
    setTitle(title);
  }
  a.recycle();
}
 

Example 91

From project maven-android-plugin-samples, under directory /support4demos/src/com/example/android/supportv4/app/.

Source file: FragmentRetainInstanceSupport.java

  15 
vote

/** 
 * This is called when the Fragment's Activity is ready to go, after its content view has been installed; it is called both after the initial fragment creation and after the fragment is re-attached to a new activity.
 */
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  mProgressBar=(ProgressBar)getTargetFragment().getView().findViewById(R.id.progress_horizontal);
synchronized (mThread) {
    mReady=true;
    mThread.notify();
  }
}
 

Example 92

From project mediaphone, under directory /src/ac/robinson/mediaphone/provider/.

Source file: FrameAdapter.java

  15 
vote

public View newView(Context context,Cursor cursor,ViewGroup parent){
  final View view=mInflater.inflate(R.layout.frame_item,parent,false);
  FrameViewHolder holder=new FrameViewHolder();
  holder.display=(ImageView)view.findViewById(R.id.frame_item_image);
  holder.loader=(ProgressBar)view.findViewById(R.id.frame_item_load_progress);
  view.setTag(holder);
  final CrossFadeDrawable transition=new CrossFadeDrawable(mDefaultIconBitmap,null);
  transition.setCallback(view);
  transition.setCrossFadeEnabled(true);
  holder.transition=transition;
  return view;
}
 

Example 93

From project mobilis, under directory /DemoApps/MXAonFire/src/de/inf/tudresden/rn/mobilis/mxaonfire/activities/.

Source file: FileTransferActivity.java

  15 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.file_transfer_layout);
  mTv=(TextView)findViewById(R.id.file_transfer_info_tv);
  Bundle extras=getIntent().getExtras();
  mUserXMPPID=extras.getString(Const.USER_XMPPID);
  mPartnerXMPPID=extras.getString(Const.PARTNER_XMPPID);
  mTv.append("\nPartner: " + mPartnerXMPPID);
  mTv.append("\nUser: " + mUserXMPPID);
  FileTransferAccepter acceptor=new FileTransferAccepter();
  acceptor.registerHandler(mAcceptFileHandler);
  try {
    MXAController.get().getXMPPService().getFileTransferService().registerFileCallback(acceptor);
  }
 catch (  RemoteException e) {
    e.printStackTrace();
  }
  Intent i=new Intent(FileTransferActivity.this,FileChooserActivity.class);
  startActivityForResult(i,1);
  mBar=(ProgressBar)findViewById(R.id.file_transfer_progress_bar);
}
 

Example 94

From project mp3tunes-android, under directory /src/com/mp3tunes/android/activity/.

Source file: Player.java

  15 
vote

@Override public void onCreate(Bundle icicle){
  super.onCreate(icicle);
  requestWindowFeature(Window.FEATURE_NO_TITLE);
  setContentView(R.layout.audio_player);
  mLocker=(Locker)MP3tunesApplication.getInstance().map.get("mp3tunes_locker");
  mCurrentTime=(TextView)findViewById(R.id.currenttime);
  mTotalTime=(TextView)findViewById(R.id.totaltime);
  mProgress=(ProgressBar)findViewById(android.R.id.progress);
  mProgress.setMax(1000);
  mAlbum=(RemoteImageView)findViewById(R.id.album);
  mArtistName=(TextView)findViewById(R.id.track_artist);
  mTrackName=(TextView)findViewById(R.id.track_title);
  mPrevButton=(ImageButton)findViewById(R.id.rew);
  mPrevButton.setOnClickListener(mPrevListener);
  mPlayButton=(ImageButton)findViewById(R.id.play);
  mPlayButton.setOnClickListener(mPlayListener);
  mPlayButton.requestFocus();
  mNextButton=(ImageButton)findViewById(R.id.fwd);
  mNextButton.setOnClickListener(mNextListener);
  mQueueButton=(ImageButton)findViewById(R.id.playlist_button);
  mQueueButton.setOnClickListener(mQueueListener);
  mAlbumArtWorker=new Worker("album art worker");
  mAlbumArtHandler=new RemoteImageHandler(mAlbumArtWorker.getLooper(),mHandler);
  Music.bindToService(this);
  mIntentFilter=new IntentFilter();
  mIntentFilter.addAction(Mp3tunesService.META_CHANGED);
  mIntentFilter.addAction(Mp3tunesService.PLAYBACK_FINISHED);
  mIntentFilter.addAction(Mp3tunesService.PLAYBACK_STATE_CHANGED);
  mIntentFilter.addAction(Mp3tunesService.PLAYBACK_ERROR);
  mIntentFilter.addAction(Mp3tunesService.DATABASE_ERROR);
}