android:layout_height="56dp">
<FrameLayout
- android:layout_width="56dp"
+ android:layout_width="wrap_content"
android:layout_height="56dp"
android:focusable="false"
android:focusableInTouchMode="false">
<ImageView
android:id="@+id/imageView1"
- android:layout_width="wrap_content"
- android:layout_height="48dp"
- android:layout_gravity="center_vertical"
+ android:layout_width="16dp"
+ android:layout_height="16dp"
+ android:layout_gravity="center_vertical|center"
android:layout_margin="4dp"
android:src="@drawable/ic_menu_archive" />
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
+ android:layout_marginRight="4dp"
+ android:ellipsize="middle"
+ android:singleLine="true"
android:text="TextView"
android:textColor="#303030"
- android:textSize="20dip" />
+ android:textSize="16dip" />
- <TextView
- android:id="@+id/Extension"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:text="TextView"
- android:textColor="#D0D0D0"
- android:textSize="20dip" />
</LinearLayout>
</LinearLayout>
private int mUploadType;
private Notification mNotification;
private int mTotalDataToSend, mSendData;
- private int mCurrentIndexUpload;
+ private int mCurrentIndexUpload, mPreviousPercent;
@Override
public IBinder onBind(Intent arg0) {
mAccount.name.lastIndexOf('@'));
String password = mAccountManager.getPassword(mAccount);
- mTotalDataToSend = mSendData = 0;
+ mTotalDataToSend = mSendData = mPreviousPercent = 0;
mNotification = new Notification(
eu.alefzero.owncloud.R.drawable.icon, "Uploading...",
public void OnUploadProgress(long currentProgress) {
mSendData += currentProgress;
int percent = (int)(100*mSendData/mTotalDataToSend);
- String text = String.format("%d%% Uploading %s file", percent, new File(mLocalPaths[mCurrentIndexUpload]).getName());
- mNotification.contentView.setProgressBar(R.id.status_progress, 100, percent, false);
- mNotification.contentView.setTextViewText(R.id.status_text, text);
- mNotificationManager.notify(42, mNotification);
+ if (percent != mPreviousPercent) {
+ String text = String.format("%d%% Uploading %s file", percent, new File(mLocalPaths[mCurrentIndexUpload]).getName());
+ mNotification.contentView.setProgressBar(R.id.status_progress, 100, percent, false);
+ mNotification.contentView.setTextViewText(R.id.status_text, text);
+ mNotificationManager.notify(42, mNotification);
+ }
+ mPreviousPercent = percent;
}
}
setProgressBarIndeterminateVisibility(false);\r
// if (getSupportFragmentManager().findFragmentById(R.id.fileList) ==\r
// null)\r
- Log.e("ASDaaa", "ASDaaa");\r
setContentView(R.layout.files);\r
\r
}\r
if (mFiles.size() > position) {\r
OCFile file = mFiles.get(position);\r
TextView fileName = (TextView) view.findViewById(R.id.Filename);\r
- TextView ext_text = (TextView) view.findViewById(R.id.Extension);\r
String name = file.getFileName();\r
- String ext = file.getFileName();\r
- if (name.lastIndexOf('.') != -1) {\r
- name = name.substring(0, name.lastIndexOf('.'));\r
- ext = ext.substring(ext.lastIndexOf('.'));\r
- } else {\r
- ext = "";\r
- }\r
\r
fileName.setText(DisplayUtils.HtmlDecode(name));\r
- ext_text.setText(ext);\r
ImageView fileIcon = (ImageView) view.findViewById(R.id.imageView1);\r
if (!file.getMimetype().equals("DIR")) {\r
fileIcon.setImageResource(R.drawable.file);\r