Android Open Source - TheCompressYourFiles Ultra Base Adapter






From Project

Back to project page TheCompressYourFiles.

License

The source code is released under:

Apache License

If you think the Android project TheCompressYourFiles listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package th.watsize.filebrowser;
//  w  ww  .ja va2  s  .  c o  m
import java.io.File;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import th.watsize.filebrowser.FilebrowserULTRAActivity.Fonts;

import th.watsize.filebrowser.R;


import android.content.Context;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;



class ViewHolder {
    public TextView name=null;
    public TextView info=null;
    public CheckBox select=null;
    public ImageView image=null;
    public LinearLayout rowlayout;
  
    ViewHolder(View row){
      name = (TextView)row.findViewById(R.id.label);
      name.setTypeface(Fonts.ICS);
      info = (TextView)row.findViewById(R.id.info);
     info.setTypeface(Fonts.ICS);
      
      image = (ImageView)row.findViewById(R.id.icon);
      select=(CheckBox)row.findViewById(R.id.select_icon);
      
      
    }
    void populateFrom(String s)
    {
    name.setText(s);
    }
  }

class ViewHolderGrid {
    public TextView name=null;
    public TextView info=null;
    public CheckBox select=null;
    public ImageView image=null;
  
    ViewHolderGrid(View row){
      name = (TextView)row.findViewById(R.id.label_grid);
      name.setTypeface(Fonts.SONY);
      image = (ImageView)row.findViewById(R.id.icon_grid);
      select=(CheckBox)row.findViewById(R.id.select_icon_grid);
      
    }
    void populateFrom(String s)
    {
    name.setText(s);
    }
  }


public class UltraBaseAdapter extends BaseAdapter {
  ViewHolderGrid holderGrid;
  ViewHolder holderList;
  // viewmode 
  public static final int VIEWMODE_LIST = 0;
  public static final int VIEWMODE_ICON = 1;

  private Context mcontext = null;
  private List<File> mfiles = null;

  private int mViewMode = VIEWMODE_ICON;

  public UltraBaseAdapter(Context context, List<File> files) {
    mcontext = context;
    mfiles = files;
  }

  @Override
  public int getCount() {
    int msize = 0;

    if(mfiles != null)
      msize = mfiles.size();

    return msize;
  }

  @Override
  public File getItem(int position) {

    if((position >= 0) && (position < this.getCount()))
      return mfiles.get(position);  

    return null;
  }

  @Override
  public long getItemId(int position) {

    return position;
  }


  @Override
  public void notifyDataSetChanged() {

    super.notifyDataSetChanged();

  }

  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    
    switch (mViewMode) {
    case VIEWMODE_LIST:
    {
      
    }
    break;
    case VIEWMODE_ICON:
    {
      

      
    }
    break;
    default:
      break;
    }

    return convertView;
  }

  

  
   

}




Java Source Code List

com.android.gestures.CreateGestureActivity.java
com.android.gestures.GestureBuilderActivity.java
com.android.gestures.GestureMonitorActivity.java
com.markupartist.android.widget.ActionBar.java
com.markupartist.android.widget.ScrollingTextView.java
com.mirrorlabs.ui.widgets.ClickableSlidingDrawer.java
com.mirrorlabs.ui.widgets.DropDownMenu.java
com.mirrorlabs.ui.widgets.IcsListPopupWindow.java
com.mirrorlabs.ui.widgets.JavaYoutubeDownloader.java
com.mirrorlabs.ui.widgets.Panel.java
com.mirrorlabs.ui.widgets.ScrollPager.java
com.mirrorlabs.ui.widgets.SlidingFrameLayout.java
org.zeroxlab.widget.AnimationLayout.java
org.zeroxlab.widget.MyHorizontalScrollView.java
th.watsize.customcheckboxwidget.DontPressWithParentCheckBox.java
th.watsize.customtoast.Toaster.java
th.watsize.filebrowser.BackupManager.java
th.watsize.filebrowser.BaseActivity.java
th.watsize.filebrowser.BitmapManager.java
th.watsize.filebrowser.BookmarksProvider.java
th.watsize.filebrowser.CMDProcessor.java
th.watsize.filebrowser.CompressManager.java
th.watsize.filebrowser.DesEncrypter.java
th.watsize.filebrowser.DrawableManager.java
th.watsize.filebrowser.DrawableThreadLoader.java
th.watsize.filebrowser.DuplicatesManager.java
th.watsize.filebrowser.ExtractManager.java
th.watsize.filebrowser.FileUtils.java
th.watsize.filebrowser.FilebrowserULTRAActivity.java
th.watsize.filebrowser.ImageThreadLoader.java
th.watsize.filebrowser.LinuxShell.java
th.watsize.filebrowser.MimeTypes.java
th.watsize.filebrowser.MyApplication.java
th.watsize.filebrowser.PDFViewer.java
th.watsize.filebrowser.PreferenceActivity.java
th.watsize.filebrowser.ProcessManager.java
th.watsize.filebrowser.RootUtils.java
th.watsize.filebrowser.SearchFilesDialog.java
th.watsize.filebrowser.SearchFilesWidget.java
th.watsize.filebrowser.UltraBaseAdapter.java
th.watsize.imageviewer.EclairMotionEvent.java
th.watsize.imageviewer.ExpandImage.java
th.watsize.imageviewer.TouchImageView.java
th.watsize.imageviewer.WrapMotionEvent.java
th.watsize.menupopup.MenuItem.java
th.watsize.menupopup.PopupMenu.java
th.watsize.musicplayer.DBHelper.java
th.watsize.musicplayer.PlayerActivity.java
th.watsize.quickaction3D.ActionItem.java
th.watsize.quickaction3D.PopupWindows.java
th.watsize.quickaction3D.QuickAction.java
th.watsize.quickaction.ActionItem.java
th.watsize.quickaction.PopupWindows.java
th.watsize.quickaction.QuickAction.java
th.watsize.widgets.ExampleAppWidgetProvider1.java
th.watsize.widgets.ExampleAppWidgetProvider.java
th.watsize.widgets.UpdateWidgetService1.java
th.watsize.widgets.UpdateWidgetService.java