Changeset 115
- Timestamp:
- 02/05/09 13:33:21 (12 months ago)
- Location:
- trunk/rapidandroid/org.rapidandroid
- Files:
-
- 7 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/rapidandroid/org.rapidandroid/res/layout/dashboard.xml
r109 r115 11 11 <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/rad_last500" android:id="@+id/dashboard_rad_500" android:paddingRight="8px"></RadioButton> 12 12 <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/dashboard_rad_all" android:text="@string/rad_all"></RadioButton> 13 </RadioGroup><TextView android:id="@+id/lbl_dashboardmessages" android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="@string/lbl_dashboardmessages" style="?android:attr/listSeparatorTextViewStyle"></TextView><ViewSwitcher android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/dashboard_switcher"><ListView android:id="@+id/lsv_dashboardmessages" android:layout_width="fill_parent" android:layout_height="fill_parent"></ListView> 13 </RadioGroup><TextView android:id="@+id/lbl_dashboardmessages" android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="@string/lbl_dashboardmessages" style="?android:attr/listSeparatorTextViewStyle"></TextView> 14 15 <TableLayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/dashboard_headertbl"></TableLayout><ViewSwitcher android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/dashboard_switcher"><ListView android:id="@+id/lsv_dashboardmessages" android:layout_width="fill_parent" android:layout_height="fill_parent"></ListView> 14 16 <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/dashboard_prog_loadingtext" android:text="Loading..." android:textSize="18sp" android:padding="8dip"></TextView> 15 17 </ViewSwitcher> 16 17 18 </LinearLayout> -
trunk/rapidandroid/org.rapidandroid/src/org/rapidandroid/activity/Dashboard.java
r112 r115 14 14 import org.rapidandroid.data.controller.MessageDataReporter; 15 15 import org.rapidandroid.data.controller.ParsedDataReporter; 16 import org.rapidandroid.view.SingleRowHeaderView; 16 17 import org.rapidandroid.view.adapter.FormDataGridCursorAdapter; 17 18 import org.rapidandroid.view.adapter.MessageCursorAdapter; … … 20 21 import org.rapidsms.java.core.model.Form; 21 22 import org.rapidsms.java.core.model.Message; 23 24 import sun.misc.GC; 22 25 23 26 import android.app.Activity; … … 36 39 import android.view.ContextMenu.ContextMenuInfo; 37 40 import android.view.View.OnClickListener; 38 import android.view.animation.Animation;39 import android.view.animation.AnimationUtils;40 41 import android.widget.AdapterView; 41 42 import android.widget.ArrayAdapter; … … 43 44 import android.widget.RadioButton; 44 45 import android.widget.Spinner; 46 import android.widget.TableLayout; 45 47 import android.widget.TextView; 46 48 import android.widget.ViewSwitcher; … … 60 62 public class Dashboard extends Activity { 61 63 62 /* (non-Javadoc) 64 /* 65 * (non-Javadoc) 66 * 63 67 * @see android.app.Activity#onRestart() 64 68 */ … … 69 73 } 70 74 71 /* (non-Javadoc) 75 /* 76 * (non-Javadoc) 77 * 72 78 * @see android.app.Activity#onResume() 73 79 */ … … 77 83 super.onResume(); 78 84 } 85 86 private SingleRowHeaderView headerView; 79 87 private SummaryCursorAdapter summaryView; 80 88 private FormDataGridCursorAdapter rowView; … … 82 90 83 91 private ViewSwitcher mViewSwitcher; 92 private TableLayout mHeaderTable; 84 93 85 94 // private ProgressDialog mLoadingDialog; … … 138 147 private RadioButton rball; 139 148 149 140 150 private OnClickListener radioClickListener = new OnClickListener() { 141 151 142 152 public void onClick(View v) { 143 RadioButton buttonView = (RadioButton) v;153 RadioButton buttonView = (RadioButton) v; 144 154 if (buttonView.equals(rb100)) { 145 mListCount = 100; 155 mListCount = 100; 146 156 rb100.setChecked(true); 147 157 rb500.setChecked(false); … … 164 174 beginListViewReload(); 165 175 } 166 167 } 168 176 177 } 178 169 179 }; 170 180 … … 175 185 setTitle("RapidAndroid :: Dashboard"); 176 186 setContentView(R.layout.dashboard); 177 187 178 188 this.initFormSpinner(); 179 189 // Set the event listeners for the spinner and the listview … … 222 232 rb100 = (RadioButton) findViewById(R.id.dashboard_rad_100); 223 233 rb100.setOnClickListener(radioClickListener); 224 234 225 235 rb500 = (RadioButton) findViewById(R.id.dashboard_rad_500); 226 236 rb500.setOnClickListener(radioClickListener); 227 237 228 238 rball = (RadioButton) findViewById(R.id.dashboard_rad_all); 229 239 rball.setOnClickListener(radioClickListener); 230 240 231 241 rb100.setChecked(true); 232 242 … … 238 248 mViewSwitcher = (ViewSwitcher) findViewById(R.id.dashboard_switcher); 239 249 240 //these animations are too fracking slow 241 // Animation in = AnimationUtils.loadAnimation(this, 242 // android.R.anim.fade_in); 243 // Animation out = AnimationUtils.loadAnimation(this, 244 // android.R.anim.fade_out); 245 // mViewSwitcher.setInAnimation(in); 246 //mViewSwitcher.setOutAnimation(out); 250 mHeaderTable =(TableLayout)findViewById(R.id.dashboard_headertbl); 251 // these animations are too fracking slow 252 // Animation in = AnimationUtils.loadAnimation(this, 253 // android.R.anim.fade_in); 254 // Animation out = AnimationUtils.loadAnimation(this, 255 // android.R.anim.fade_out); 256 // mViewSwitcher.setInAnimation(in); 257 // mViewSwitcher.setOutAnimation(out); 247 258 } 248 259 … … 255 266 protected void onRestoreInstanceState(Bundle savedInstanceState) { 256 267 super.onRestoreInstanceState(savedInstanceState); 257 268 258 269 if (savedInstanceState != null) { 259 270 if (savedInstanceState.containsKey(STATE_SPINNER_POSITION) 260 271 // && savedInstanceState.containsKey(STATE_LSV_POSITION) 261 272 && savedInstanceState.containsKey(STATE_LSV_VIEWMODE) 262 && savedInstanceState.containsKey(STATE_RAD_INDEX) //savedInstanceState.containsKey(STATE_DATE_START) && savedInstanceState.containsKey(STATE_DATE_END) 273 && savedInstanceState.containsKey(STATE_RAD_INDEX) // savedInstanceState.containsKey(STATE_DATE_START) 274 // && 275 // savedInstanceState.containsKey(STATE_DATE_END) 263 276 // STATE_RAD_COUNT 264 277 // && savedInstanceState.containsKey(STATE_SELECTED_FORM) … … 281 294 } 282 295 283 284 285 296 mIsInitializing = false; 286 297 formViewMode = savedInstanceState.getInt(STATE_LSV_VIEWMODE); 287 298 288 299 Spinner spin_forms = (Spinner) findViewById(R.id.cbx_forms); 289 spin_forms.setSelection(savedInstanceState.getInt(STATE_SPINNER_POSITION)); 300 spin_forms.setSelection(savedInstanceState.getInt(STATE_SPINNER_POSITION)); 290 301 } 291 302 … … 306 317 // TODO Auto-generated method stub 307 318 super.onSaveInstanceState(outState); 308 //outState.putLong(STATE_DATE_START, mStartDate.getTime());309 //outState.putLong(STATE_DATE_END, mEndDate.getTime());310 319 // outState.putLong(STATE_DATE_START, mStartDate.getTime()); 320 // outState.putLong(STATE_DATE_END, mEndDate.getTime()); 321 311 322 int chosenRadio = 0; 312 323 313 324 if (rb100.isChecked()) { 314 325 chosenRadio = 0; 315 } else if (rb500.isChecked()) {326 } else if (rb500.isChecked()) { 316 327 chosenRadio = 1; 317 } else if (rball.isChecked()) {328 } else if (rball.isChecked()) { 318 329 chosenRadio = 2; 319 330 } … … 322 333 Spinner spin_forms = (Spinner) findViewById(R.id.cbx_forms); 323 334 outState.putInt(STATE_SPINNER_POSITION, spin_forms.getSelectedItemPosition()); 324 335 325 336 } 326 337 … … 375 386 menu.add(0, MENU_CREATE_ID, 0, R.string.dashboard_menu_create).setIcon(android.R.drawable.ic_menu_add); 376 387 menu.add(0, MENU_FORM_REVIEW_ID, 0, R.string.dashboard_menu_edit).setIcon(android.R.drawable.ic_menu_agenda); 377 //menu.add(0, MENU_CHANGE_DATERANGE, 0, R.string.chart_menu_change_parameters.setIcon(android.R.drawable.ic_menu_recent_history); 388 // menu.add(0, MENU_CHANGE_DATERANGE, 0, 389 // R.string.chart_menu_change_parameters.setIcon(android.R.drawable.ic_menu_recent_history); 378 390 menu.add(0, MENU_CHARTS_ID, 0, R.string.dashboard_menu_view).setIcon(android.R.drawable.ic_menu_sort_by_size); 379 391 // menu.add(0, MENU_SHOW_REPORTS, 0, … … 394 406 return true; 395 407 396 //case MENU_CHANGE_DATERANGE:397 //startDateRangeActivity();398 //return true;408 // case MENU_CHANGE_DATERANGE: 409 // startDateRangeActivity(); 410 // return true; 399 411 case MENU_CHARTS_ID: 400 412 startActivityChart(); … … 483 495 484 496 private void startActivityChart() { 485 if (mListviewCursor == null) {497 if (mListviewCursor == null) { 486 498 Builder noDataDialog = new AlertDialog.Builder(this); 487 499 noDataDialog.setPositiveButton("Ok", null); … … 491 503 return; 492 504 } 493 505 494 506 Intent i = new Intent(this, ChartData.class); 495 507 Date now = new Date(); … … 506 518 return; 507 519 } 520 508 521 Date startDate; 509 522 if (mListviewCursor.getCount() > 0) { … … 584 597 } 585 598 586 private void finishListViewReload() { 599 private synchronized void finishListViewReload() { 600 if (mListviewCursor == null) { 601 return; 602 } 587 603 TextView lbl_recents = (TextView) findViewById(R.id.lbl_dashboardmessages); 588 604 589 605 lbl_recents.setText(this.mListviewCursor.getCount() + " Messages"); 590 606 591 607 ListView lsv = (ListView) findViewById(R.id.lsv_dashboardmessages); 592 608 … … 597 613 lsv.setAdapter(messageCursorAdapter); 598 614 } 599 //lsv.setVisibility(View.VISIBLE); 600 601 } 615 // lsv.setVisibility(View.VISIBLE); 616 617 } 618 602 619 final Handler mDashboardHandler = new Handler(); 603 620 final Runnable mUpdateResults = new Runnable() { 604 621 public void run() { 622 // while(!mIsInitializing) { 605 623 finishListViewReload(); 606 624 mViewSwitcher.showNext(); 625 // } 607 626 } 608 627 }; 609 628 610 629 private synchronized void beginListViewReload() { 611 630 // mLoadingDialog = ProgressDialog.show(this,"Loading data", … … 615 634 TextView lbl_recents = (TextView) findViewById(R.id.lbl_dashboardmessages); 616 635 lbl_recents.setText(TXT_WAIT); 617 mViewSwitcher.showNext(); 636 mViewSwitcher.showNext(); 618 637 resetListAdapters(); 619 638 new Thread(new Runnable() { … … 630 649 if (mListviewCursor == null) { 631 650 if (mChosenForm != null && !mShowAllMessages) { 632 // String whereclause = " rapidandroid_message.time >= '" 633 // + Message.SQLDateFormatter.format(mStartDate) + 634 // "' AND time <= '" 635 // + Message.SQLDateFormatter.format(mEndDate) + "'"; 636 // mListviewCursor = 637 // getContentResolver().query(Uri.parse(RapidSmsDBConstants.FormData.CONTENT_URI_PREFIX 638 // + mChosenForm.getFormId()), null,null,null,"LIMIT " + mListCount); 639 // 640 mListviewCursor = DashboardDataLayer.getCursorForFormData(this,mChosenForm, mListCount); 651 // String whereclause = " rapidandroid_message.time >= '" 652 // + Message.SQLDateFormatter.format(mStartDate) + 653 // "' AND time <= '" 654 // + Message.SQLDateFormatter.format(mEndDate) + "'"; 655 // mListviewCursor = 656 // getContentResolver().query(Uri.parse(RapidSmsDBConstants.FormData.CONTENT_URI_PREFIX 657 // + mChosenForm.getFormId()), null,null,null,"LIMIT " + 658 // mListCount); 659 // 660 mListviewCursor = DashboardDataLayer.getCursorForFormData(this, mChosenForm, mListCount); 641 661 642 662 } else if (mShowAllMessages && mChosenForm == null) { … … 648 668 // getContentResolver().query(RapidSmsDBConstants.Message.CONTENT_URI, 649 669 // null, whereclause, null, "time DESC"); 650 mListviewCursor = DashboardDataLayer.getCursorForRawMessages(this, mListCount);670 mListviewCursor = DashboardDataLayer.getCursorForRawMessages(this, mListCount); 651 671 652 672 } … … 660 680 ListView lsv = (ListView) findViewById(R.id.lsv_dashboardmessages); 661 681 682 if (this.headerView != null) { 683 mHeaderTable.removeAllViews(); 684 headerView = null; 685 } 686 662 687 if (mChosenForm == null) { 663 688 lsv.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, … … 680 705 */ 681 706 682 // if (headerView == null) { 683 // this.headerView = new SingleRowHeaderView(this, mChosenForm); 684 // lsv.addHeaderView(headerView); 685 // 707 686 708 if (this.formViewMode == Dashboard.LISTVIEW_MODE_SUMMARY_VIEW) { 687 709 // headerView.setVisibility(View.INVISIBLE); … … 690 712 691 713 } else if (this.formViewMode == Dashboard.LISTVIEW_MODE_TABLE_VIEW) { 714 if (this.headerView == null) { 715 headerView = new SingleRowHeaderView(this,mChosenForm,mScreenWidth); 716 mHeaderTable.addView(headerView); 717 int colcount = headerView.getColCount(); 718 for(int i = 0; i < colcount; i++) { 719 mHeaderTable.setColumnShrinkable(i, true); 720 } 721 } 722 692 723 rowView = new FormDataGridCursorAdapter(this, mChosenForm, mListviewCursor, mScreenWidth); 693 724 lsv.setAdapter(rowView); … … 701 732 */ 702 733 private void resetListAdapters() { 734 ListView lsv = (ListView) findViewById(R.id.lsv_dashboardmessages); 703 735 if (rowView != null) { 736 704 737 rowView = null; 705 738 } -
trunk/rapidandroid/org.rapidandroid/src/org/rapidandroid/data/controller/DashboardDataLayer.java
r109 r115 30 30 StringBuilder query = new StringBuilder(); 31 31 query.append("select " + RapidSmsDBConstants.FormData.TABLE_PREFIX); 32 query.append(f.getPrefix() + ".* ");32 query.append(f.getPrefix() + ".*, rapidandroid_message.message, rapidandroid_message.time, rapidandroid_monitor.phone "); 33 33 query.append(" from " + RapidSmsDBConstants.FormData.TABLE_PREFIX + f.getPrefix()); 34 34 query.append(" join rapidandroid_message on ("); … … 36 36 query.append(".message_id = rapidandroid_message._id"); 37 37 query.append(") "); 38 query.append(" join rapidandroid_monitor on (rapidandroid_message.monitor_id = rapidandroid_monitor._id) "); 38 39 query.append(" ORDER BY rapidandroid_message.time DESC LIMIT ").append(count); 39 40 -
trunk/rapidandroid/org.rapidandroid/src/org/rapidandroid/view/SingleGridRowView.java
r97 r115 38 38 mColWidth = colwidth; 39 39 40 mColCount = c.getColumnCount()- 2;40 mColCount = c.getColumnCount()-5; 41 41 42 42 mRow = new TableRow(context); … … 44 44 isOdd = (c.getPosition() % 2) == 1 ; 45 45 if(isOdd) { 46 mRow.setBackgroundColor(org.rapidandroid.R.color.background_gray);46 //mRow.setBackgroundColor(org.rapidandroid.R.color.background_gray); 47 47 } else { 48 48 //mRow.setBackgroundColor(android.R.color.background_dark); … … 68 68 coldata.setEllipsize(TruncateAt.END); //makeit ellipsize instead of spillage!!! 69 69 coldata.setWidth(mColWidth); 70 coldata.setBackgroundColor(Color.TRANSPARENT);70 //coldata.setBackgroundColor(Color.TRANSPARENT); 71 71 72 72 coldata.setPadding(0, 4, 0, 4); -
trunk/rapidandroid/org.rapidandroid/src/org/rapidandroid/view/SingleRowHeaderView.java
r97 r115 7 7 8 8 import android.content.Context; 9 import android.text.TextUtils.TruncateAt; 10 import android.view.Gravity; 9 11 import android.widget.TableLayout; 10 12 import android.widget.TableRow; … … 14 16 * @author Daniel Myung [email protected] 15 17 * @created Jan 27, 2009 16 * @deprecated18 * 17 19 */ 18 public class SingleRowHeaderView extends Table Layout{19 private int mColCount;20 public class SingleRowHeaderView extends TableRow { 21 private int mColCount; 20 22 21 23 TableRow mRow; … … 23 25 TextView mMonitorCol; 24 26 Vector<TextView> mDataCols; 27 25 28 26 29 /** 27 30 * @param context 28 31 */ 29 public SingleRowHeaderView(Context context, Form f ) {32 public SingleRowHeaderView(Context context, Form f, int screenWidth) { 30 33 super(context); 31 34 int itemCounter = 0; 32 35 33 mRow = new TableRow(context);34 mMessageIDCol = new TextView(context);35 mMessageIDCol.setText("ID |");36 mMessageIDCol.setGravity(1);37 mRow.addView(mMessageIDCol, itemCounter++);38 36 39 mMonitorCol = new TextView(context); 40 mMonitorCol.setText(" Mon | "); 41 mMonitorCol.setGravity(1); 42 mRow.addView(mMonitorCol, itemCounter++); 43 44 mRow.setWeightSum(itemCounter); 37 38 // mMessageIDCol = new TextView(context); 39 // mMessageIDCol.setText("ID |"); 40 // mMessageIDCol.setGravity(1); 41 // mRow.addView(mMessageIDCol, itemCounter++); 42 // 43 // mMonitorCol = new TextView(context); 44 // mMonitorCol.setText(" Mon | "); 45 // mMonitorCol.setGravity(1); 46 // mRow.addView(mMonitorCol, itemCounter++); 47 48 49 45 50 mDataCols = new Vector<TextView>(); 46 51 mColCount = f.getFields().length; 52 int width = screenWidth/mColCount; 47 53 Field[] fields = f.getFields(); 48 54 String suffix = " | "; 49 for(int i = 0; i < mColCount; i++) { 50 if(i == mColCount-1) { 51 suffix = ""; 52 } 55 for(int i = 0; i < mColCount; i++) { 53 56 TextView coldata = new TextView(getContext()); 54 coldata.setText(fields[i].getName() + suffix); 55 coldata.setGravity(1); 57 coldata.setText(fields[i].getName()); 58 coldata.setTextSize(14); 59 //coldata.setTextAppearance(context, android.R.style) 60 coldata.setGravity(Gravity.LEFT); 61 coldata.setEllipsize(TruncateAt.END); //makeit ellipsize instead of spillage!!! 62 coldata.setWidth(width); 56 63 57 64 mDataCols.add(coldata); 58 mRow.addView(coldata, itemCounter++); 59 } 60 65 addView(coldata); 66 } 67 this.setPadding(2, 2, 8, 2); 68 //this.setBackgroundResource(android.R.drawable.); 69 } 70 public int getColCount() { 71 return mColCount; 61 72 } 62 73 } -
trunk/rapidandroid/org.rapidandroid/src/org/rapidandroid/view/SummaryCursorView.java
r100 r115 1 1 package org.rapidandroid.view; 2 3 import java.text.ParseException; 4 import java.util.Date; 2 5 3 6 import org.rapidandroid.R; … … 9 12 import android.content.Context; 10 13 import android.database.Cursor; 14 import android.graphics.Color; 11 15 import android.view.Gravity; 12 16 import android.widget.TableLayout; … … 21 25 public class SummaryCursorView extends TableLayout { 22 26 23 Message mMsg;27 24 28 String[] mFields; 29 30 private int mColTime = -1; 31 private int mColMessage = -2; 32 private int mColPhone = -2; 25 33 26 34 //TableRow mMessageSummaryRow; … … 42 50 super(context); 43 51 // 52 53 mColMessage = formDataCursor.getColumnCount() -3; 54 mColTime = formDataCursor.getColumnCount() -2; 55 mColPhone = formDataCursor.getColumnCount() -1; 44 56 45 57 mFields = fields; … … 67 79 mRawMessageRow.setPadding(2, 2, 8, 2); 68 80 mRawMessageRow.setTextSize(12); 69 mRawMessageRow.setBackgroundColor(R.color.solid_green);81 //mRawMessageRow.setBackgroundColor(R.color.solid_green); 70 82 // addView(mRawMessageRow, new TableLayout.LayoutParams()); 71 83 addView(mRawMessageRow); 84 72 85 73 86 … … 84 97 mFieldLabels = new TextView[lenresults]; 85 98 mFieldValues = new TextView[lenresults]; 99 86 100 87 101 for (int i = 0; i < lenresults; i++) { 88 102 TableRow row = new TableRow(getContext()); 89 row.setBackgroundColor(R.color.background_red); 103 // row.setBackgroundColor(R.color.background_red); 104 // row.setDrawingCacheBackgroundColor(R.color.background_red); 105 //row.setBackgroundResource(android.R.drawable.) 90 106 91 107 TextView txvFieldName = new TextView(getContext()); 92 108 txvFieldName.setTextSize(14); 93 txvFieldName.setBackgroundColor(R.color.background_red); 109 // txvFieldName.setBackgroundColor(R.color.background_red); 110 // txvFieldName.setDrawingCacheBackgroundColor(R.color.background_red); 94 111 txvFieldName.setGravity(Gravity.LEFT); 95 112 txvFieldName.setPadding(10, 2, 2, 2); … … 121 138 122 139 private void setMessageTop(Cursor cr) { 123 mMsg = MessageTranslator.GetMessage(getContext(), cr.getInt(1)); 124 mMessageSummary.setText(Message.DisplayDateTimeFormat.format(mMsg.getTimestamp())); 125 if(mMsg.getMonitor() == null) { 126 mMonitorString.setText("null"); 127 } else { 128 mMonitorString.setText(" " + mMsg.getMonitor().getPhone()); 129 } 130 mRawMessageRow.setText(mMsg.getMessageText()); 140 Date msgDate; 141 try { 142 msgDate = Message.SQLDateFormatter.parse(cr.getString(mColTime)); 143 } catch (ParseException e) { 144 // TODO Auto-generated catch block 145 e.printStackTrace(); 146 msgDate = new Date(); 147 } 148 mMessageSummary.setText(Message.DisplayDateTimeFormat.format(msgDate)); 149 mRawMessageRow.setText(cr.getString(mColMessage)); 150 mMonitorString.setText(cr.getString(mColPhone)); 151 // mMsg = MessageTranslator.GetMessage(getContext(), cr.getInt(1)); 152 // mMessageSummary.setText(Message.DisplayDateTimeFormat.format(mMsg.getTimestamp())); 153 // if(mMsg.getMonitor() == null) { 154 // mMonitorString.setText("null"); 155 // } else { 156 // mMonitorString.setText(" " + mMsg.getMonitor().getPhone()); 157 // } 158 // mRawMessageRow.setText(mMsg.getMessageText()); 131 159 } 132 160 -
trunk/rapidandroid/org.rapidandroid/src/org/rapidandroid/view/adapter/FormDataGridCursorAdapter.java
r97 r115 33 33 mContext = context; 34 34 mWidth = screenWidth; 35 mColWidth = screenWidth/(c.getColumnCount()- 2);35 mColWidth = screenWidth/(c.getColumnCount()-5); 36 36 37 37 }