Merge branch 'develop' into refactor_remote_operation_to_create_folder

This commit is contained in:
David A. Velasco 2013-11-12 15:22:36 +01:00
commit 89b37b7508
92 changed files with 337 additions and 217 deletions

View file

@ -38,7 +38,7 @@
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="13" />
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" >
</uses-permission>
@ -112,7 +112,8 @@
</service>
<service
android:name=".syncadapter.FileSyncService"
android:exported="true" >
android:exported="true"
android:process=":sync">
<intent-filter>
<action android:name="android.content.SyncAdapter" />
</intent-filter>

View file

@ -42,6 +42,7 @@ import org.apache.http.conn.ssl.X509HostnameVerifier;
import android.util.Log;
/**
* AdvancedSSLProtocolSocketFactory allows to create SSL {@link Socket}s with
* a custom SSLContext and an optional Hostname Verifier.

View file

@ -34,6 +34,7 @@ import javax.net.ssl.X509TrustManager;
import android.util.Log;
/**
* @author David A. Velasco
*/

View file

@ -31,6 +31,7 @@ import org.apache.commons.httpclient.auth.MalformedChallengeException;
import android.util.Log;
/**
* Bearer authentication scheme as defined in RFC 6750.
*

View file

@ -34,7 +34,6 @@ import com.owncloud.android.oc_framework.network.ProgressiveDataTransferer;
import android.util.Log;
/**
* A RequestEntity that represents a PIECE of a file.
*

View file

@ -36,8 +36,6 @@ import android.util.Log;
import com.owncloud.android.oc_framework.network.ProgressiveDataTransferer;
/**
* A RequestEntity that represents a File.
*

View file

@ -44,7 +44,6 @@ import org.apache.http.params.CoreProtocolPNames;
import com.owncloud.android.oc_framework.network.BearerAuthScheme;
import com.owncloud.android.oc_framework.network.BearerCredentials;
import android.net.Uri;
import android.util.Log;

View file

@ -24,6 +24,7 @@ import org.apache.jackrabbit.webdav.property.DavPropertyName;
import org.apache.jackrabbit.webdav.property.DavPropertySet;
import android.net.Uri;
import android.util.Log;

View file

@ -26,6 +26,7 @@ import com.owncloud.android.oc_framework.network.webdav.OwnCloudClientFactory;
import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AccountsException;

View file

@ -8,6 +8,6 @@
# project structure.
# Project target.
target=android-17
android.library.reference.1=actionbarsherlock\\library
target=android-19
android.library.reference.1=actionbarsherlock/library
android.library.reference.2=oc_framework

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 802 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 884 B

View file

@ -190,26 +190,23 @@
android:id="@id/buttonOK"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/btn_default"
android:layout_above="@id/account_register"
android:layout_above="@+id/welcome_link"
android:layout_centerHorizontal="true"
android:enabled="false"
android:onClick="onOkClick"
android:text="@string/setup_btn_connect"
/>
android:text="@string/setup_btn_connect" />
<Button
android:id="@+id/account_register"
android:id="@id/welcome_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="@android:color/transparent"
android:textColor="#0000FF"
android:onClick="onRegisterClick"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="@string/auth_register"
/>
android:textColor="#0000FF"/>
</RelativeLayout>

View file

@ -171,24 +171,22 @@
android:id="@+id/buttonOK"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/btn_default"
android:layout_gravity="center_horizontal"
android:enabled="false"
android:onClick="onOkClick"
android:text="@string/setup_btn_connect"
/>
android:text="@string/setup_btn_connect" />
<Button
android:id="@+id/account_register"
android:id="@+id/welcome_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:textColor="#0000FF"
android:onClick="onRegisterClick"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="@string/auth_register"
/>
android:textColor="#0000FF"/>
</LinearLayout>
</ScrollView>

View file

@ -24,7 +24,8 @@
android:layout_height="wrap_content"
android:gravity="bottom">
<Button android:id="@+id/deleteLogHistoryButton"
<Button
android:id="@+id/deleteLogHistoryButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/prefs_log_delete_history_button"/>

View file

@ -68,9 +68,10 @@
style="@style/PassCodeStyle" />
</LinearLayout>
<Button android:layout_width="wrap_content"
<Button
android:id="@+id/cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/common_cancel"
android:textColor="@android:color/black"
android:id="@+id/cancel"/>
android:text="@string/common_cancel" />
</LinearLayout>

View file

@ -35,6 +35,6 @@
android:layout_width="fill_parent" android:layout_alignParentBottom="true" android:layout_height="wrap_content" android:orientation="vertical">
<Button android:layout_gravity="bottom" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:id="@+id/uploader_choose_folder"
android:text="@string/uploader_btn_upload_text"></Button>
android:text="@string/uploader_btn_upload_text"/>
</LinearLayout>
</RelativeLayout>

View file

@ -144,6 +144,7 @@
<string name="auth_timeout_title">El servidor ha trigat massa en respondre</string>
<string name="auth_incorrect_address_title">La URL esà malformada</string>
<string name="auth_ssl_general_error_title">La inicialització SSL ha fallat</string>
<string name="auth_ssl_unverified_server_title">No s\'ha pogut verificar la identitat SSL del servidor</string>
<string name="auth_bad_oc_version_title">Versió del servidor desconeguda</string>
<string name="auth_wrong_connection_title">No s\'ha pogut establir la connexió</string>
<string name="auth_secure_connection">S\'ha establert la connexió segura</string>

View file

@ -24,8 +24,10 @@
<string name="prefs_log_summary_history">여기서 기록된 로그를 보여줍니다</string>
<string name="prefs_log_delete_history_button">역사 삭제하기</string>
<string name="prefs_help">도움말</string>
<string name="prefs_recommend">친구들에게 권하기</string>
<string name="prefs_feedback">피드백</string>
<string name="prefs_imprint">임프린트</string>
<string name="recommend_subject">%1$s 을 스마트폰에서 사용해보세요!</string>
<string name="auth_check_server">서버 확인</string>
<string name="auth_host_url">서버 주소</string>
<string name="auth_username">사용자 이름</string>
@ -92,6 +94,7 @@
<string name="sync_foreign_files_forgotten_ticker">몇몇 로컬 파일이 사라졌습니다.</string>
<string name="sync_foreign_files_forgotten_content">%1$d 파일을 %2$s 디렉토리에 복사하지 못하였습니다.</string>
<string name="sync_foreign_files_forgotten_explanation">1.3.16 버전에서, 파일 업로드는 다수의 계정이 동시에 접속될때 데이터 유실을 피하기 위해 로컬 %1$s 폴더로 복사됩니다.⏎\n⏎\n이 변화로 인해, 예전 버전으로 올리신 파일들은 %2$s 폴더로 복사되었습니다. 그러나, 계정 동기화중 오류로 인해 작업을 완료하지 못할수 있습니다. 파일을 남기시고 %3$s로 연결되는 링크를 지우시거나, 혹은 파일을 %1$s 폴더로 이동시키고, %4$s에 링크를 유지시킬수 있습니다.⏎\n⏎\n아래에는 로컬 파일과 더불어, %5$s로 링크된 리모트 파일들의 목록이 있습니다.\n</string>
<string name="sync_current_folder_was_removed">%1$s 폴더가 존재하지 않습니다.</string>
<string name="foreign_files_move">모두 옮김</string>
<string name="foreign_files_success">모든 파일 옮김</string>
<string name="foreign_files_fail">몇몇 파일을 옮기지 못했습니다.</string>
@ -137,6 +140,7 @@
<string name="auth_timeout_title">서버 응답 시간이 초과되었습니다</string>
<string name="auth_incorrect_address_title">잘못된 URL</string>
<string name="auth_ssl_general_error_title">SSL 초기화 오류</string>
<string name="auth_ssl_unverified_server_title">SSL 서버의 신원을 확인할수 없습니다</string>
<string name="auth_bad_oc_version_title">확인할 수 없는 서버 버전</string>
<string name="auth_wrong_connection_title">연결을 수립할 수 없음</string>
<string name="auth_secure_connection">암호화된 연결 사용 중</string>
@ -144,7 +148,12 @@
<string name="auth_oauth_error">권한부여가 성공적으로 이뤄지지 않았습니다</string>
<string name="auth_oauth_error_access_denied">권한 서버로 부터 접근이 거부되었습니다</string>
<string name="auth_wtf_reenter_URL">뜻밖의 상태; 다시 서버 주소를 입력해주십시오</string>
<string name="auth_expired_oauth_token_toast">인증이 만료되었습니다. 다시 인증해주세요</string>
<string name="auth_expired_basic_auth_toast">현재 암호를 </string>
<string name="auth_expired_saml_sso_token_toast">세션이 만료되었습니다. 다시 접속해주세요</string>
<string name="auth_connecting_auth_server">인증 서버에 접속하는 중...</string>
<string name="auth_unsupported_auth_method">서버에서 이 인증 방법을 지원하지 않습니다.</string>
<string name="auth_unsupported_multiaccount">%1$s 에서는 다중 계정을 지원하지 않습니다</string>
<string name="fd_keep_in_sync">파일을 최신 정보로 유지</string>
<string name="common_rename">이름 바꾸기</string>
<string name="common_remove">삭제</string>
@ -165,6 +174,7 @@
<string name="wait_a_moment">잠시 기다려 주십시오</string>
<string name="filedisplay_unexpected_bad_get_content">예상하지 못한 오류입니다. 다른 앱에서 파일을 선택하십시오</string>
<string name="filedisplay_no_file_selected">선택한 파일 없음</string>
<string name="oauth_check_onoff">oAuth2로 로그인하기</string>
<string name="oauth_login_connection">oAuth2 서버에 연결중...</string>
<string name="ssl_validator_header">사이트 인증서를 확인할 수 없었습니다</string>
<string name="ssl_validator_reason_cert_not_trusted">- 서버 인증서를 신뢰할 수 없습니다</string>

View file

@ -44,5 +44,6 @@
<string name="pincode_stored">PIN App disimpan</string>
<string name="auth_no_net_conn_title">Tiada sambungan rangkaian</string>
<string name="common_rename">Namakan</string>
<string name="common_remove">Buang</string>
<string name="confirmation_remove_local">Lokal sahaja</string>
</resources>

View file

@ -95,6 +95,7 @@
<string name="sync_foreign_files_forgotten_ticker">Несколько локальных файлов были забыты</string>
<string name="sync_foreign_files_forgotten_content">%1$d файлы из %2$s папки не могут быть скопированы в</string>
<string name="sync_foreign_files_forgotten_explanation">файлы, загруженные с этого устройства, скопированы в локальную папку %1$s для предотвращения потери данных, когда отдельный файл синхронизируется с нескольких учётных записей. По причине этого изменения, все файлы, загруженные в предыдущих версиях этого приложения, были скопированы в папку %2$s. Однако, ошибка помешала завершению этой операции при синхронизации учётной записи. Вы можете либо оставить файлы как есть, или переместить их в папку %1$s и сохранить ссылку в %4$s. \nВ списке указаны локальные файлы, привязанные к файлам на сервере в папке %5$s.</string>
<string name="sync_current_folder_was_removed">Каталог %1$s больше не существует</string>
<string name="foreign_files_move">Переместить всё</string>
<string name="foreign_files_success">Все файлы были перемещены</string>
<string name="foreign_files_fail">Некоторые файлы не могут быть перемещены</string>

View file

@ -121,6 +121,7 @@
<string name="media_err_unsupported">Saknar stöd för denna mediatyp</string>
<string name="media_err_io">Mediafil kunde inte skapas</string>
<string name="media_err_malformed">Mediafilen är felaktigt kodad</string>
<string name="media_err_timeout">Försökt att spela för länge</string>
<string name="media_err_invalid_progressive_playback">Meidiafilen kan inte strömmas</string>
<string name="media_err_unknown">Mediefilen kan inte spelas med standardspelaren</string>
<string name="media_err_security_ex">Säkerhetsproplem när vi försöker spela %1$s</string>
@ -177,6 +178,7 @@
<string name="wait_a_moment">Var god vänta</string>
<string name="filedisplay_unexpected_bad_get_content">Oväntat problem; prova annat program för aktuell fil</string>
<string name="filedisplay_no_file_selected">Ingen fil vald</string>
<string name="oauth_check_onoff">Logga in med oAuth2.</string>
<string name="oauth_login_connection">Ansluter till oAuth2 servern…</string>
<string name="ssl_validator_header">Webbplatsens identitet kunde inte verifieras</string>
<string name="ssl_validator_reason_cert_not_trusted">- Servercertifikatet är inte tillförlitligt</string>

View file

@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources/>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="Theme.ownCloud.ButtonStyle" parent="@android:style/Widget.Holo.Light.Button">
<item name="android:background">@android:drawable/btn_default</item>
<item name="android:textColor">@color/button_text_color</item>
</style>
</resources>

View file

@ -2,8 +2,8 @@
<resources>
<!-- App name and other strings-->
<string name="app_name">ownCloud</string>
<string name="account_type">owncloud</string>
<string name="authority">org.owncloud</string>
<string name="account_type">owncloud</string> <!-- better if was a domain name; but changing it now would require migrate accounts when the app is updated -->
<string name="authority">org.owncloud</string> <!-- better if was the app package with ".provider" appended ; it identifies the provider -->
<string name ="db_file">owncloud.db</string>
<string name ="db_name">ownCloud</string>
<string name ="data_folder">owncloud</string>
@ -12,7 +12,8 @@
<!-- URLs and flags related -->
<string name="server_url"></string>
<bool name="show_server_url_input">true</bool>
<string name="url_account_register">"https://owncloud.com/mobile/new"</string>
<bool name="show_welcome_link">true</bool>
<string name="welcome_link_url">"https://owncloud.com/mobile/new"</string>
<!-- Flags to setup the authentication methods available in the app -->
<string name="auth_method_oauth2">off</string>
@ -25,6 +26,9 @@
<color name="actionbar_start_color">#1D2D44</color>
<color name="actionbar_end_color">#1D2D44</color>
<!-- Button -->
<color name="button_text_color">#000000</color>
<!-- Multiaccount support -->
<bool name="multiaccount_support">true</bool>
@ -41,3 +45,4 @@
</resources>

View file

@ -24,17 +24,25 @@
<style name="Theme.ownCloud" parent="style/Theme.Sherlock.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/Theme.ownCloud.Widget.ActionBar</item>
<item name="actionBarStyle">@style/Theme.ownCloud.Widget.ActionBar</item>
<item name="android:buttonStyle">@style/Theme.ownCloud.ButtonStyle</item>
<item name="actionDropDownStyle">@style/Theme.ownCloud.DropDownStyle</item>
<item name="android:actionDropDownStyle">@style/Theme.ownCloud.DropDownStyle</item>
</style>
<style name="Theme.ownCloud.noActionBar" parent="style/Theme.Sherlock.Light.NoActionBar">
<item name="android:actionBarStyle">@style/Theme.ownCloud.Widget.ActionBar</item>
<item name="actionBarStyle">@style/Theme.ownCloud.Widget.ActionBar</item>
<item name="android:buttonStyle">@style/Theme.ownCloud.ButtonStyle</item>
<item name="actionDropDownStyle">@style/Theme.ownCloud.DropDownStyle</item>
<item name="android:actionDropDownStyle">@style/Theme.ownCloud.DropDownStyle</item>
</style>
<style name="Theme.ownCloud.Fullscreen" parent="style/Theme.Sherlock.NoActionBar">
<item name="android:actionBarStyle">@style/Theme.ownCloud.Widget.ActionBar</item>
<item name="actionBarStyle">@style/Theme.ownCloud.Widget.ActionBar</item>
<item name="android:windowFullscreen">true</item>
<item name="actionDropDownStyle">@style/Theme.ownCloud.DropDownStyle</item>
<item name="android:actionDropDownStyle">@style/Theme.ownCloud.DropDownStyle</item>
</style>
@ -46,14 +54,14 @@
<item name="android:shadowRadius">1</item>
<item name="android:shadowDy">1</item>
<item name="android:backgroundSplit">@drawable/split_action_bg</item>
<item name="android:indeterminateProgressStyle">@style/Theme.ownCloud.IndeterminateStyle</item>
<item name="indeterminateProgressStyle">@style/Theme.ownCloud.IndeterminateStyle</item>
</style>
<!-- Dialogs -->
<style name="Theme.ownCloud.Dialog" parent="style/Theme.Sherlock.Light.Dialog">
</style>
<!-- PopDownMenu -->
<style name="Animations.PopDownMenu" />

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Buttons -->
<style name="Theme.ownCloud.ButtonStyle" parent="@android:style/Widget.Button">
<item name="android:background">@android:drawable/btn_default</item>
<item name="android:textColor">@color/button_text_color</item>
</style>
<!-- DropDown -->
<style name="Theme.ownCloud.DropDownStyle" parent="style/Widget.Sherlock.Spinner.DropDown.ActionBar">
<item name="android:background">@drawable/abs__spinner_ab_holo_dark</item>
</style>
<style name="Theme.ownCloud.IndeterminateStyle" parent="style/Widget.Sherlock.ProgressBar">
<item name="android:indeterminateDrawable">@drawable/abs__progress_medium_holo</item>
</style>
</resources>

View file

@ -25,4 +25,7 @@
android:contentAuthority="@string/authority"
android:accountType="@string/account_type"
android:supportsUploading="true"
android:userVisible="true"
android:allowParallelSyncs="true"
android:isAlwaysSyncable="true"
/>

View file

@ -26,6 +26,12 @@ import java.util.List;
import java.util.Stack;
import java.util.Vector;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountAuthenticator;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileUploader;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.AlertDialog;
@ -54,12 +60,6 @@ import android.widget.EditText;
import android.widget.SimpleAdapter;
import android.widget.Toast;
import com.owncloud.android.authentication.AccountAuthenticator;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.R;
/**
* This can be used to upload things to an ownCloud instance.

View file

@ -18,6 +18,10 @@
package com.owncloud.android.authentication;
import com.owncloud.android.Log_OC;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import android.accounts.*;
import android.content.Context;
import android.content.Intent;
@ -25,10 +29,6 @@ import android.os.Bundle;
import android.os.Handler;
import android.widget.Toast;
import com.owncloud.android.Log_OC;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.oc_framework.accounts.AccountTypeUtils;

View file

@ -25,7 +25,6 @@ import android.os.IBinder;
public class AccountAuthenticatorService extends Service {
private AccountAuthenticator mAuthenticator;
//static final public String ACCOUNT_TYPE = "owncloud";
@Override
public void onCreate() {

View file

@ -71,7 +71,6 @@ import com.owncloud.android.ui.dialog.SslValidatorDialog;
import com.owncloud.android.ui.dialog.SslValidatorDialog.OnSslValidatorListener;
import com.owncloud.android.oc_framework.utils.OwnCloudVersion;
/**
* This Activity is used to add an ownCloud account to the App
*
@ -194,11 +193,16 @@ implements OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
/// set Host Url Input Enabled
mHostUrlInputEnabled = getResources().getBoolean(R.bool.show_server_url_input);
/// complete label for 'register account' button
Button b = (Button) findViewById(R.id.account_register);
if (b != null) {
b.setText(String.format(getString(R.string.auth_register), getString(R.string.app_name)));
/// set visibility of link for new users
boolean accountRegisterVisibility = getResources().getBoolean(R.bool.show_welcome_link);
Button welcomeLink = (Button) findViewById(R.id.welcome_link);
if (welcomeLink != null) {
if (accountRegisterVisibility) {
welcomeLink.setVisibility(View.VISIBLE);
welcomeLink.setText(String.format(getString(R.string.auth_register), getString(R.string.app_name)));
} else {
findViewById(R.id.welcome_link).setVisibility(View.GONE);
}
}
/// initialization
@ -1272,14 +1276,6 @@ implements OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
setAccountAuthenticatorResult(intent.getExtras());
setResult(RESULT_OK, intent);
/// immediately request for the synchronization of the new account
Bundle bundle = new Bundle();
bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
ContentResolver.requestSync(mAccount, MainApp.getAuthTokenType(), bundle);
syncAccount();
// Bundle bundle = new Bundle();
// bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
// ContentResolver.requestSync(mAccount, MainApp.getAuthTokenType(), bundle);
return true;
}
}
@ -1398,7 +1394,7 @@ implements OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
* @param view 'Account register' button
*/
public void onRegisterClick(View view) {
Intent register = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.url_account_register)));
Intent register = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.welcome_link_url)));
setResult(RESULT_CANCELED);
startActivity(register);
}
@ -1649,13 +1645,6 @@ implements OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
mAuthMessage.setVisibility(View.GONE);
}
private void syncAccount(){
/// immediately request for the synchronization of the new account
Bundle bundle = new Bundle();
bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
ContentResolver.requestSync(mAccount, MainApp.getAuthTokenType(), bundle);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType) &&

View file

@ -21,6 +21,7 @@ import java.lang.ref.WeakReference;
import com.owncloud.android.Log_OC;
import android.graphics.Bitmap;
import android.os.Handler;
import android.os.Message;

View file

@ -30,6 +30,7 @@ import com.owncloud.android.MainApp;
import com.owncloud.android.db.ProviderMeta.ProviderTableMeta;
import com.owncloud.android.utils.FileStorageUtils;
import android.accounts.Account;
import android.content.ContentProviderClient;
import android.content.ContentProviderOperation;
@ -390,12 +391,14 @@ public class FileDataStorageManager {
if (id > FileDataStorageManager.ROOT_PARENT_ID) {
Log_OC.d(TAG, "Updating size of " + id);
if (getContentResolver() != null) {
getContentResolver().update(ProviderTableMeta.CONTENT_URI_DIR, null,
getContentResolver().update(ProviderTableMeta.CONTENT_URI_DIR,
new ContentValues(), // won't be used, but cannot be null; crashes in KLP
ProviderTableMeta._ID + "=?",
new String[] { String.valueOf(id) });
} else {
try {
getContentProviderClient().update(ProviderTableMeta.CONTENT_URI_DIR, null,
getContentProviderClient().update(ProviderTableMeta.CONTENT_URI_DIR,
new ContentValues(), // won't be used, but cannot be null; crashes in KLP
ProviderTableMeta._ID + "=?",
new String[] { String.valueOf(id) });

View file

@ -22,6 +22,7 @@ import java.io.File;
import com.owncloud.android.Log_OC;
import android.os.Parcel;
import android.os.Parcelable;
import android.webkit.MimeTypeMap;

View file

@ -20,9 +20,13 @@ package com.owncloud.android.files;
import java.io.File;
import com.owncloud.android.Log_OC;
import com.owncloud.android.MainApp;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.db.DbHandler;
import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.utils.FileStorageUtils;
import android.accounts.Account;
import android.content.BroadcastReceiver;
@ -36,9 +40,6 @@ import android.preference.PreferenceManager;
import android.provider.MediaStore.Images.Media;
import android.webkit.MimeTypeMap;
import com.owncloud.android.Log_OC;
import com.owncloud.android.MainApp;
import com.owncloud.android.utils.FileStorageUtils;
public class InstantUploadBroadcastReceiver extends BroadcastReceiver {

View file

@ -29,6 +29,7 @@ import com.owncloud.android.oc_framework.operations.RemoteOperationResult.Result
import com.owncloud.android.ui.activity.ConflictsResolveActivity;
import android.accounts.Account;
import android.content.Context;
import android.content.Intent;

View file

@ -21,12 +21,13 @@ package com.owncloud.android.files.managers;
import java.util.HashMap;
import java.util.Map;
import com.owncloud.android.R;
import android.app.Notification;
import android.app.NotificationManager;
import android.content.Context;
import android.widget.RemoteViews;
import com.owncloud.android.R;
public class OCNotificationManager {

View file

@ -28,6 +28,8 @@ import java.util.Vector;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AuthenticatorActivity;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
@ -59,9 +61,6 @@ import android.os.Message;
import android.os.Process;
import android.widget.RemoteViews;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
public class FileDownloader extends Service implements OnDatatransferProgressListener {
public static final String EXTRA_ACCOUNT = "ACCOUNT";

View file

@ -30,6 +30,7 @@ import com.owncloud.android.files.OwnCloudFileObserver;
import com.owncloud.android.operations.SynchronizeFileOperation;
import com.owncloud.android.utils.FileStorageUtils;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.Service;

View file

@ -33,10 +33,14 @@ import org.apache.jackrabbit.webdav.DavConstants;
import org.apache.jackrabbit.webdav.MultiStatus;
import org.apache.jackrabbit.webdav.client.methods.PropFindMethod;
import com.owncloud.android.Log_OC;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountAuthenticator;
import com.owncloud.android.authentication.AuthenticatorActivity;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.db.DbHandler;
import com.owncloud.android.operations.ChunkedUploadFileOperation;
import com.owncloud.android.operations.CreateFolderOperation;
import com.owncloud.android.operations.ExistenceCheckOperation;
@ -45,13 +49,18 @@ import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
import com.owncloud.android.operations.UploadFileOperation;
import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.oc_framework.utils.OwnCloudVersion;
import com.owncloud.android.oc_framework.network.webdav.OnDatatransferProgressListener;
import com.owncloud.android.oc_framework.accounts.OwnCloudAccount;
import com.owncloud.android.oc_framework.network.webdav.OwnCloudClientFactory;
import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
import com.owncloud.android.oc_framework.network.webdav.WebdavEntry;
import com.owncloud.android.oc_framework.network.webdav.WebdavUtils;
import com.owncloud.android.ui.activity.FailedUploadActivity;
import com.owncloud.android.ui.activity.FileActivity;
import com.owncloud.android.ui.activity.FileDisplayActivity;
import com.owncloud.android.ui.activity.InstantUploadActivity;
import com.owncloud.android.ui.preview.PreviewImageActivity;
import com.owncloud.android.ui.preview.PreviewImageFragment;
import android.accounts.Account;
import android.accounts.AccountManager;
@ -71,16 +80,6 @@ import android.os.Process;
import android.webkit.MimeTypeMap;
import android.widget.RemoteViews;
import com.owncloud.android.Log_OC;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.db.DbHandler;
import com.owncloud.android.ui.activity.FailedUploadActivity;
import com.owncloud.android.ui.activity.FileActivity;
import com.owncloud.android.ui.activity.FileDisplayActivity;
import com.owncloud.android.ui.activity.InstantUploadActivity;
import com.owncloud.android.ui.preview.PreviewImageActivity;
import com.owncloud.android.ui.preview.PreviewImageFragment;
public class FileUploader extends Service implements OnDatatransferProgressListener {

View file

@ -42,6 +42,7 @@ import java.util.Locale;
import com.owncloud.android.R;
/**
* View containing controls for a {@link MediaPlayer}.
*

View file

@ -43,6 +43,7 @@ import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.ui.activity.FileActivity;
import com.owncloud.android.ui.activity.FileDisplayActivity;
/**
* Service that handles media playback, both audio and video.
*

View file

@ -176,6 +176,12 @@ public class MediaServiceBinder extends Binder implements MediaController.MediaP
return (currentState == MediaService.State.PLAYING || currentState == MediaService.State.PAUSED);
}
@Override
public int getAudioSessionId() {
return 1; // not really used
}
}

View file

@ -34,6 +34,7 @@ import com.owncloud.android.oc_framework.network.webdav.ChunkFromFileChannelRequ
import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
import com.owncloud.android.oc_framework.network.webdav.WebdavUtils;
import android.accounts.Account;

View file

@ -21,9 +21,6 @@ import java.io.File;
import java.io.IOException;
import org.apache.jackrabbit.webdav.client.methods.DavMethodBase;
//import org.apache.jackrabbit.webdav.client.methods.MoveMethod;
import android.accounts.Account;
import com.owncloud.android.Log_OC;
import com.owncloud.android.datamodel.FileDataStorageManager;
@ -34,6 +31,10 @@ import com.owncloud.android.oc_framework.operations.RemoteOperation;
import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.utils.FileStorageUtils;
//import org.apache.jackrabbit.webdav.client.methods.MoveMethod;
import android.accounts.Account;
/**

View file

@ -23,10 +23,6 @@ import org.apache.jackrabbit.webdav.DavConstants;
import org.apache.jackrabbit.webdav.MultiStatus;
import org.apache.jackrabbit.webdav.client.methods.PropFindMethod;
import android.accounts.Account;
import android.content.Context;
import android.content.Intent;
import com.owncloud.android.Log_OC;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
@ -39,6 +35,10 @@ import com.owncloud.android.oc_framework.operations.RemoteOperation;
import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
import android.accounts.Account;
import android.content.Context;
import android.content.Intent;
public class SynchronizeFileOperation extends RemoteOperation {

View file

@ -22,13 +22,8 @@ import org.apache.commons.httpclient.methods.GetMethod;
import org.json.JSONException;
import org.json.JSONObject;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.content.Context;
import com.owncloud.android.authentication.AccountAuthenticator;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.Log_OC;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.oc_framework.accounts.OwnCloudAccount;
import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
import com.owncloud.android.oc_framework.operations.RemoteOperation;
@ -36,6 +31,10 @@ import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.oc_framework.utils.OwnCloudVersion;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.content.Context;
/**
* Remote operation that checks the version of an ownCloud server and stores it locally

View file

@ -33,8 +33,6 @@ import org.apache.commons.httpclient.methods.RequestEntity;
import org.apache.http.HttpStatus;
import com.owncloud.android.Log_OC;
import android.accounts.Account;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.oc_framework.network.ProgressiveDataTransferer;
@ -48,6 +46,8 @@ import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.utils.FileStorageUtils;
import android.accounts.Account;
/**
* Remote operation performing the upload of a file to an ownCloud server

View file

@ -28,6 +28,7 @@ import com.owncloud.android.db.ProviderMeta;
import com.owncloud.android.db.ProviderMeta.ProviderTableMeta;
import android.content.ContentProvider;
import android.content.ContentProviderOperation;
import android.content.ContentProviderResult;

View file

@ -30,6 +30,7 @@ import com.owncloud.android.oc_framework.accounts.AccountUtils.AccountNotFoundEx
import com.owncloud.android.oc_framework.network.webdav.OwnCloudClientFactory;
import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AuthenticatorException;
@ -52,7 +53,7 @@ public abstract class AbstractOwnCloudSyncAdapter extends
private AccountManager accountManager;
private Account account;
private ContentProviderClient contentProvider;
private ContentProviderClient mContentProviderClient;
private FileDataStorageManager mStoreManager;
private WebdavClient mClient = null;
@ -62,6 +63,11 @@ public abstract class AbstractOwnCloudSyncAdapter extends
this.setAccountManager(AccountManager.get(context));
}
public AbstractOwnCloudSyncAdapter(Context context, boolean autoInitialize, boolean allowParallelSyncs) {
super(context, autoInitialize, allowParallelSyncs);
this.setAccountManager(AccountManager.get(context));
}
public AccountManager getAccountManager() {
return accountManager;
}
@ -78,12 +84,12 @@ public abstract class AbstractOwnCloudSyncAdapter extends
this.account = account;
}
public ContentProviderClient getContentProvider() {
return contentProvider;
public ContentProviderClient getContentProviderClient() {
return mContentProviderClient;
}
public void setContentProvider(ContentProviderClient contentProvider) {
this.contentProvider = contentProvider;
public void setContentProviderClient(ContentProviderClient contentProvider) {
this.mContentProviderClient = contentProvider;
}
public void setStorageManager(FileDataStorageManager storage_manager) {

View file

@ -28,6 +28,7 @@ import com.owncloud.android.authentication.AccountAuthenticator;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.oc_framework.accounts.OwnCloudAccount;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AuthenticatorException;
@ -53,7 +54,7 @@ public class ContactSyncAdapter extends AbstractOwnCloudSyncAdapter {
public void onPerformSync(Account account, Bundle extras, String authority,
ContentProviderClient provider, SyncResult syncResult) {
setAccount(account);
setContentProvider(provider);
setContentProviderClient(provider);
Cursor c = getLocalContacts(false);
if (c.moveToFirst()) {
do {

View file

@ -38,6 +38,7 @@ import com.owncloud.android.operations.UpdateOCVersionOperation;
import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.ui.activity.ErrorsWhileCopyingHandlerActivity;
import android.accounts.Account;
import android.accounts.AccountsException;
import android.app.Notification;
@ -97,7 +98,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
/**
* Creates an {@link FileSyncAdapter}
* Creates a {@link FileSyncAdapter}
*
* {@inheritDoc}
*/
@ -106,12 +107,22 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
}
/**
* Creates a {@link FileSyncAdapter}
*
* {@inheritDoc}
*/
public FileSyncAdapter(Context context, boolean autoInitialize, boolean allowParallelSyncs) {
super(context, autoInitialize, allowParallelSyncs);
}
/**
* {@inheritDoc}
*/
@Override
public synchronized void onPerformSync(Account account, Bundle extras,
String authority, ContentProviderClient provider,
String authority, ContentProviderClient providerClient,
SyncResult syncResult) {
mCancellation = false;
@ -126,8 +137,8 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
mSyncResult.delayUntil = 60*60*24; // avoid too many automatic synchronizations
this.setAccount(account);
this.setContentProvider(provider);
this.setStorageManager(new FileDataStorageManager(account, provider));
this.setContentProviderClient(providerClient);
this.setStorageManager(new FileDataStorageManager(account, providerClient));
try {
this.initClientForCurrentAccount();
} catch (IOException e) {

View file

@ -17,6 +17,8 @@
*/
package com.owncloud.android.syncadapter;
import com.owncloud.android.Log_OC;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
@ -37,6 +39,11 @@ public class FileSyncService extends Service {
public static final String ACCOUNT_NAME = "ACCOUNT_NAME";
public static final String SYNC_RESULT = "SYNC_RESULT";
// Storage for an instance of the sync adapter
private static FileSyncAdapter sSyncAdapter = null;
// Object to use as a thread-safe lock
private static final Object sSyncAdapterLock = new Object();
public static String getSyncMessage(){
return FileSyncService.class.getName().toString() + SYNC_MESSAGE;
}
@ -45,6 +52,11 @@ public class FileSyncService extends Service {
*/
@Override
public void onCreate() {
synchronized (sSyncAdapterLock) {
if (sSyncAdapter == null) {
sSyncAdapter = new FileSyncAdapter(getApplicationContext(), true);
}
}
}
/*
@ -52,7 +64,7 @@ public class FileSyncService extends Service {
*/
@Override
public IBinder onBind(Intent intent) {
return new FileSyncAdapter(getApplicationContext(), true).getSyncAdapterBinder();
return sSyncAdapter.getSyncAdapterBinder();
}
}

View file

@ -38,6 +38,7 @@ import java.util.ArrayList;
import com.owncloud.android.R;
/**
* Popup window, shows action list as icon and text like the one in Gallery3D
* app.

View file

@ -47,15 +47,14 @@ import com.actionbarsherlock.app.SherlockListActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import com.owncloud.android.authentication.AccountAuthenticator;
import com.owncloud.android.authentication.AuthenticatorActivity;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.oc_framework.accounts.OwnCloudAccount;
import com.owncloud.android.Log_OC;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
public class AccountSelectActivity extends SherlockListActivity implements
AccountManagerCallback<Boolean> {
@ -96,12 +95,6 @@ public class AccountSelectActivity extends SherlockListActivity implements
(mPreviousAccount != null && !mPreviousAccount.equals(current))) {
/// the account set as default changed since this activity was created
// trigger synchronization
ContentResolver.cancelSync(null, MainApp.getAuthTokenType());
Bundle bundle = new Bundle();
bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
ContentResolver.requestSync(AccountUtils.getCurrentOwnCloudAccount(this), MainApp.getAuthTokenType(), bundle);
// restart the main activity
Intent i = new Intent(this, FileDisplayActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

View file

@ -43,10 +43,12 @@ import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.ui.dialog.IndeterminateProgressDialog;
import com.owncloud.android.utils.FileStorageUtils;
/**
* Activity reporting errors occurred when local files uploaded to an ownCloud account with an app in
* version under 1.3.16 where being copied to the ownCloud local folder.
@ -118,6 +120,7 @@ public class ErrorsWhileCopyingHandlerActivity extends SherlockFragmentActivity
/// customize buttons
Button cancelBtn = (Button) findViewById(R.id.cancel);
Button okBtn = (Button) findViewById(R.id.ok);
okBtn.setText(R.string.foreign_files_move);
cancelBtn.setOnClickListener(this);
okBtn.setOnClickListener(this);

View file

@ -17,6 +17,8 @@
package com.owncloud.android.ui.activity;
import com.owncloud.android.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
@ -24,7 +26,6 @@ import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import com.owncloud.android.R;
/**
* This Activity is used to display a detail message for failed uploads
@ -44,8 +45,9 @@ public class FailedUploadActivity extends Activity {
String message = getIntent().getStringExtra(MESSAGE);
TextView textView = (TextView) findViewById(R.id.faild_upload_message);
textView.setText(message);
Button close_button = (Button) findViewById(R.id.failed_uploadactivity_close_button);
close_button.setOnClickListener(new OnClickListener() {
Button closeBtn = (Button) findViewById(R.id.failed_uploadactivity_close_button);
closeBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
finish();

View file

@ -31,8 +31,10 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.IntentFilter.AuthorityEntry;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.content.SyncRequest;
import android.content.res.Resources.NotFoundException;
import android.database.Cursor;
import android.net.Uri;
@ -63,9 +65,9 @@ import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileDownloader;
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
import com.owncloud.android.files.services.FileObserverService;
import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
import com.owncloud.android.operations.CreateFolderOperation;
import com.owncloud.android.oc_framework.operations.OnRemoteOperationListener;
@ -89,6 +91,7 @@ import com.owncloud.android.ui.preview.PreviewImageActivity;
import com.owncloud.android.ui.preview.PreviewMediaFragment;
import com.owncloud.android.ui.preview.PreviewVideoActivity;
/**
* Displays, what files the user has available in his ownCloud.
*
@ -493,12 +496,27 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
}
private void startSynchronization() {
ContentResolver.cancelSync(null, MainApp.getAuthTokenType()); // cancel the current synchronizations of any ownCloud account
Log_OC.e(TAG, "Got to start sync");
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.KITKAT) {
Log_OC.e(TAG, "Canceling all syncs for " + MainApp.getAuthority());
ContentResolver.cancelSync(null, MainApp.getAuthority()); // cancel the current synchronizations of any ownCloud account
Bundle bundle = new Bundle();
bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
bundle.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true);
Log_OC.e(TAG, "Requesting sync for " + getAccount().name + " at " + MainApp.getAuthority());
ContentResolver.requestSync(
getAccount(),
MainApp.getAuthTokenType(), bundle);
MainApp.getAuthority(), bundle);
} else {
Log_OC.e(TAG, "Requesting sync for " + getAccount().name + " at " + MainApp.getAuthority() + " with new API");
SyncRequest.Builder builder = new SyncRequest.Builder();
builder.setSyncAdapter(getAccount(), MainApp.getAuthority());
builder.setExpedited(true);
builder.setManual(true);
builder.syncOnce();
SyncRequest request = builder.build();
ContentResolver.requestSync(request);
}
}
@ -1237,7 +1255,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
@Override
public void onSavedCertificate() {
startSynchronization();
startSyncFolderOperation(getCurrentDir());
}

View file

@ -33,6 +33,7 @@ import android.widget.TextView;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.owncloud.android.R;
/**
* Activity showing a text message and, optionally, a couple list of single or paired text strings.
*

View file

@ -19,6 +19,14 @@ package com.owncloud.android.ui.activity;
import java.util.ArrayList;
import java.util.List;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.db.DbHandler;
import com.owncloud.android.files.InstantUploadBroadcastReceiver;
import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.utils.FileStorageUtils;
import android.accounts.Account;
import android.app.Activity;
import android.content.Intent;
@ -41,13 +49,6 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.db.DbHandler;
import com.owncloud.android.files.InstantUploadBroadcastReceiver;
import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.utils.FileStorageUtils;
/**
* This Activity is used to display a list with images they could not be
@ -76,10 +77,10 @@ public class InstantUploadActivity extends Activity {
super.onCreate(savedInstanceState);
setContentView(R.layout.failed_upload_files);
Button delete_all_btn = (Button) findViewById(R.id.failed_upload_delete_all_btn);
delete_all_btn.setOnClickListener(getDeleteListner());
Button retry_all_btn = (Button) findViewById(R.id.failed_upload_retry_all_btn);
retry_all_btn.setOnClickListener(getRetryListner());
Button deleteAllBtn = (Button) findViewById(R.id.failed_upload_delete_all_btn);
deleteAllBtn.setOnClickListener(getDeleteListner());
Button retryAllBtn = (Button) findViewById(R.id.failed_upload_retry_all_btn);
retryAllBtn.setOnClickListener(getRetryListner());
this.failed_upload_all_cb = (CheckBox) findViewById(R.id.failed_upload_headline_cb);
failed_upload_all_cb.setOnCheckedChangeListener(getCheckAllListener());
listView = (LinearLayout) findViewById(R.id.failed_upload_scrollviewlayout);

View file

@ -38,6 +38,7 @@ import com.owncloud.android.utils.FileStorageUtils;
public class LogHistoryActivity extends SherlockPreferenceActivity implements OnPreferenceChangeListener {
String logpath = FileStorageUtils.getLogPath();
File logDIR = null;
@ -52,6 +53,7 @@ public class LogHistoryActivity extends SherlockPreferenceActivity implements On
actionBar.setDisplayHomeAsUpEnabled(true);
ListView listView = (ListView) findViewById(android.R.id.list);
Button deleteHistoryButton = (Button) findViewById(R.id.deleteLogHistoryButton);
deleteHistoryButton.setOnClickListener(new OnClickListener() {
@Override

View file

@ -19,7 +19,6 @@ package com.owncloud.android.ui.activity;
import java.util.Arrays;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.owncloud.android.R;
import android.app.AlertDialog;
@ -81,8 +80,6 @@ public class PinCodeActivity extends SherlockFragmentActivity {
mText3 = (EditText) findViewById(R.id.txt3);
mText4 = (EditText) findViewById(R.id.txt4);
SharedPreferences appPrefs = PreferenceManager
.getDefaultSharedPreferences(getApplicationContext());

View file

@ -41,6 +41,7 @@ import com.owncloud.android.OwnCloudSession;
import com.owncloud.android.R;
import com.owncloud.android.db.DbHandler;
/**
* An Activity that allows the user to change the application's settings.
*

View file

@ -35,14 +35,14 @@ import android.widget.TextView;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.ActionBar.OnNavigationListener;
import com.actionbarsherlock.view.MenuItem;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
import com.owncloud.android.ui.dialog.IndeterminateProgressDialog;
import com.owncloud.android.ui.fragment.ConfirmationDialogFragment;
import com.owncloud.android.ui.fragment.LocalFileListFragment;
import com.owncloud.android.ui.fragment.ConfirmationDialogFragment.ConfirmationDialogFragmentListener;
import com.owncloud.android.utils.FileStorageUtils;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
/**
* Displays local files and let the user choose what of them wants to upload
@ -108,6 +108,7 @@ public class UploadFilesActivity extends FileActivity implements
mUploadBtn = (Button) findViewById(R.id.upload_files_btn_upload);
mUploadBtn.setOnClickListener(this);
// Action bar setup
ActionBar actionBar = getSupportActionBar();
actionBar.setHomeButtonEnabled(true); // mandatory since Android ICS, according to the official documentation

View file

@ -28,6 +28,9 @@ import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import java.util.Vector;
import com.owncloud.android.DisplayUtils;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
@ -37,8 +40,6 @@ import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
import com.owncloud.android.ui.activity.TransferServiceGetter;
import java.util.Vector;
/**
* This Adapter populates a ListView with all files and folders in an ownCloud
@ -54,9 +55,6 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
private FileDataStorageManager mStorageManager;
private Account mAccount;
private TransferServiceGetter mTransferServiceGetter;
//total size of a directory (recursive)
private Long totalSizeOfDirectoriesRecursive = null;
private Long lastModifiedOfAllSubdirectories = null;
public FileListListAdapter(Context context, TransferServiceGetter transferServiceGetter) {
mContext = context;

View file

@ -24,6 +24,7 @@ import java.util.Comparator;
import com.owncloud.android.DisplayUtils;
import com.owncloud.android.R;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

View file

@ -2,6 +2,8 @@ package com.owncloud.android.ui.adapter;
import java.io.File;
import com.owncloud.android.R;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@ -13,7 +15,6 @@ import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.owncloud.android.R;
public class LogListAdapter extends ArrayAdapter<String> {

View file

@ -26,6 +26,7 @@ import android.webkit.WebView;
import com.actionbarsherlock.app.SherlockDialogFragment;
import com.owncloud.android.R;
/**
* Dialog to show the contents of res/raw/CHANGELOG.txt
*/

View file

@ -29,6 +29,7 @@ import com.actionbarsherlock.app.SherlockDialogFragment;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.owncloud.android.R;
/**
* Dialog which will be displayed to user upon keep-in-sync file conflict.
*

View file

@ -32,6 +32,7 @@ import com.actionbarsherlock.app.SherlockDialogFragment;
import com.owncloud.android.R;
/**
* Dialog to request the user to input a name, optionally initialized with a former name.
*

View file

@ -27,6 +27,7 @@ import android.view.KeyEvent;
import com.actionbarsherlock.app.SherlockDialogFragment;
import com.owncloud.android.R;
public class IndeterminateProgressDialog extends SherlockDialogFragment {
private static final String ARG_MESSAGE_ID = IndeterminateProgressDialog.class.getCanonicalName() + ".ARG_MESSAGE_ID";

View file

@ -29,6 +29,9 @@ import java.util.Map;
import javax.security.auth.x500.X500Principal;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
@ -37,8 +40,6 @@ import android.view.Window;
import android.widget.Button;
import android.widget.TextView;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
import com.owncloud.android.oc_framework.network.CertificateCombinedException;
import com.owncloud.android.oc_framework.network.NetworkUtils;
import com.owncloud.android.oc_framework.operations.RemoteOperationResult;

View file

@ -26,6 +26,7 @@ import android.os.Bundle;
import com.actionbarsherlock.app.SherlockDialogFragment;
import com.owncloud.android.Log_OC;
public class ConfirmationDialogFragment extends SherlockDialogFragment {
public final static String ARG_CONF_RESOURCE_ID = "resource_id";

View file

@ -23,6 +23,7 @@ import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
import com.owncloud.android.ui.ExtendedListView;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;

View file

@ -48,9 +48,9 @@ import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
import com.owncloud.android.files.services.FileObserverService;
import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
import com.owncloud.android.oc_framework.network.webdav.OnDatatransferProgressListener;
import com.owncloud.android.oc_framework.operations.OnRemoteOperationListener;

View file

@ -24,6 +24,7 @@ import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.FileHandler;
import com.owncloud.android.ui.activity.TransferServiceGetter;
/**
* Common methods for {@link Fragment}s containing {@link OCFile}s
*

View file

@ -19,8 +19,11 @@ package com.owncloud.android.ui.fragment;
import java.io.File;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
import com.owncloud.android.ui.adapter.LocalFileListAdapter;
import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;
@ -32,8 +35,6 @@ import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.ListView;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
/**
* A Fragment that lists all files and folders in a given LOCAL path.

View file

@ -43,6 +43,7 @@ import com.owncloud.android.ui.fragment.ConfirmationDialogFragment.ConfirmationD
import com.owncloud.android.ui.preview.PreviewImageFragment;
import com.owncloud.android.ui.preview.PreviewMediaFragment;
import android.accounts.Account;
import android.app.Activity;
import android.os.Bundle;

View file

@ -19,6 +19,12 @@ package com.owncloud.android.ui.preview;
import java.lang.ref.WeakReference;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
import com.owncloud.android.ui.fragment.FileFragment;
import android.accounts.Account;
import android.app.Activity;
import android.os.Bundle;
@ -31,13 +37,7 @@ import android.widget.ImageButton;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
import com.owncloud.android.oc_framework.network.webdav.OnDatatransferProgressListener;
import com.owncloud.android.ui.fragment.FileFragment;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
/**

View file

@ -35,20 +35,20 @@ import android.view.View.OnTouchListener;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.view.MenuItem;
import com.actionbarsherlock.view.Window;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileDownloader;
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
import com.owncloud.android.ui.activity.FileActivity;
import com.owncloud.android.ui.activity.FileDisplayActivity;
import com.owncloud.android.ui.dialog.LoadingDialog;
import com.owncloud.android.ui.fragment.FileFragment;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
/**
* Holds a swiping galley where image files contained in an ownCloud directory are shown

View file

@ -50,6 +50,8 @@ import android.widget.Toast;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.oc_framework.network.webdav.WebdavUtils;
@ -60,9 +62,6 @@ import com.owncloud.android.operations.RemoveFileOperation;
import com.owncloud.android.ui.fragment.ConfirmationDialogFragment;
import com.owncloud.android.ui.fragment.FileFragment;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
/**
* This fragment shows a preview of a downloaded image.

View file

@ -22,6 +22,9 @@ import java.util.Map;
import java.util.Set;
import java.util.Vector;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.ui.fragment.FileFragment;
import android.accounts.Account;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
@ -29,8 +32,6 @@ import android.support.v4.app.FragmentStatePagerAdapter;
import android.view.ViewGroup;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.ui.fragment.FileFragment;
/**
* Adapter class that provides Fragment instances

View file

@ -52,6 +52,8 @@ import android.widget.VideoView;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.media.MediaControlView;
@ -67,8 +69,6 @@ import com.owncloud.android.ui.activity.FileDisplayActivity;
import com.owncloud.android.ui.fragment.ConfirmationDialogFragment;
import com.owncloud.android.ui.fragment.FileFragment;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
/**
* This fragment shows a preview of a downloaded media file (audio or video).

View file

@ -17,6 +17,13 @@
package com.owncloud.android.ui.preview;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.media.MediaService;
import com.owncloud.android.ui.activity.FileActivity;
import android.accounts.Account;
import android.app.AlertDialog;
import android.content.DialogInterface;
@ -30,14 +37,8 @@ import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;
import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.oc_framework.accounts.AccountUtils;
import com.owncloud.android.oc_framework.accounts.AccountUtils.AccountNotFoundException;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.media.MediaService;
import com.owncloud.android.ui.activity.FileActivity;
/**
* Activity implementing a basic video player.

View file

@ -19,15 +19,16 @@ package com.owncloud.android.utils;
import java.io.File;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
import android.annotation.SuppressLint;
import android.content.Context;
import android.net.Uri;
import android.os.Environment;
import android.os.StatFs;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
/**
* Static methods to help in access to local file system.

View file

@ -22,6 +22,7 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import com.owncloud.android.R;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;

View file

@ -1,11 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry combineaccessrules="false" kind="src" path="/owncloud-android"/>
<classpathentry kind="lib" path="/oc_framework/bin/oc_framework.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

View file

@ -2,7 +2,6 @@ package com.owncloud.android.test;
import com.owncloud.android.db.ProviderMeta.ProviderTableMeta;
import com.owncloud.android.providers.FileContentProvider;
import android.annotation.TargetApi;
import android.net.Uri;
import android.os.Build;