mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 15:15:51 +03:00
add inject for SyncedFolderProvider, more to come
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
c5a705d58f
commit
da2676bd31
4 changed files with 14 additions and 12 deletions
|
@ -58,6 +58,7 @@ import com.owncloud.android.authentication.PassCodeManager;
|
|||
import com.owncloud.android.datamodel.ArbitraryDataProvider;
|
||||
import com.owncloud.android.datamodel.ArbitraryDataProviderImpl;
|
||||
import com.owncloud.android.datamodel.FileDataStorageManager;
|
||||
import com.owncloud.android.datamodel.SyncedFolderProvider;
|
||||
import com.owncloud.android.datamodel.UploadsStorageManager;
|
||||
import com.owncloud.android.ui.activities.data.activities.ActivitiesRepository;
|
||||
import com.owncloud.android.ui.activities.data.activities.ActivitiesServiceApi;
|
||||
|
@ -121,6 +122,13 @@ class AppModule {
|
|||
return new ArbitraryDataProviderImpl(dao);
|
||||
}
|
||||
|
||||
@Provides
|
||||
SyncedFolderProvider syncedFolderProvider(ContentResolver contentResolver,
|
||||
AppPreferences appPreferences,
|
||||
Clock clock) {
|
||||
return new SyncedFolderProvider(contentResolver, appPreferences, clock);
|
||||
}
|
||||
|
||||
@Provides
|
||||
ActivitiesServiceApi activitiesServiceApi(UserAccountManager accountManager) {
|
||||
return new ActivitiesServiceApiImpl(accountManager);
|
||||
|
|
|
@ -52,8 +52,10 @@ class ShortcutUtil @Inject constructor(private val mContext: Context) {
|
|||
* @param file The file/folder to which a pinned shortcut should be added to the home screen.
|
||||
*/
|
||||
fun addShortcutToHomescreen(
|
||||
file: OCFile, viewThemeUtils: ViewThemeUtils,
|
||||
user: User, syncedFolderProvider: SyncedFolderProvider
|
||||
file: OCFile,
|
||||
viewThemeUtils: ViewThemeUtils,
|
||||
user: User,
|
||||
syncedFolderProvider: SyncedFolderProvider
|
||||
) {
|
||||
if (ShortcutManagerCompat.isRequestPinShortcutSupported(mContext)) {
|
||||
val intent = Intent(mContext, FileDisplayActivity::class.java)
|
||||
|
|
|
@ -26,7 +26,6 @@ import android.graphics.Bitmap;
|
|||
import android.os.Bundle;
|
||||
|
||||
import com.nextcloud.client.account.User;
|
||||
import com.nextcloud.client.core.Clock;
|
||||
import com.nextcloud.java.util.Optional;
|
||||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.databinding.ShareActivityBinding;
|
||||
|
@ -59,10 +58,8 @@ public class ShareActivity extends FileActivity {
|
|||
|
||||
static final String TAG_SHARE_FRAGMENT = "SHARE_FRAGMENT";
|
||||
|
||||
private SyncedFolderProvider syncedFolderProvider;
|
||||
|
||||
@Inject
|
||||
Clock clock;
|
||||
SyncedFolderProvider syncedFolderProvider;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -71,8 +68,6 @@ public class ShareActivity extends FileActivity {
|
|||
ShareActivityBinding binding = ShareActivityBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
syncedFolderProvider = new SyncedFolderProvider(getContentResolver(), preferences, clock);
|
||||
|
||||
OCFile file = getFile();
|
||||
Optional<User> optionalUser = getUser();
|
||||
if (!optionalUser.isPresent()) {
|
||||
|
|
|
@ -205,8 +205,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
|||
@Inject EditorUtils editorUtils;
|
||||
@Inject ShortcutUtil shortcutUtil;
|
||||
@Inject Clock clock;
|
||||
|
||||
private SyncedFolderProvider syncedFolderProvider;
|
||||
@Inject SyncedFolderProvider syncedFolderProvider;
|
||||
|
||||
protected FileFragment.ContainerActivity mContainerActivity;
|
||||
|
||||
|
@ -329,8 +328,6 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
|||
viewThemeUtils.material.themeFAB(mFabMain);
|
||||
}
|
||||
|
||||
syncedFolderProvider = new SyncedFolderProvider(requireActivity().getContentResolver(), preferences, clock);
|
||||
|
||||
Log_OC.i(TAG, "onCreateView() end");
|
||||
return v;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue