-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ce3900
commit 5023dcb
Showing
14 changed files
with
651 additions
and
117 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions
62
src/main/java/com/owncloud/android/ui/adapter/FileDetailTabAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Nextcloud Android client application | ||
* | ||
* @author Andy Scherzinger | ||
* Copyright (C) 2018 Andy Scherzinger | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public | ||
* License along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.owncloud.android.ui.adapter; | ||
|
||
import android.accounts.Account; | ||
import android.support.v4.app.Fragment; | ||
import android.support.v4.app.FragmentManager; | ||
import android.support.v4.app.FragmentStatePagerAdapter; | ||
|
||
import com.owncloud.android.datamodel.OCFile; | ||
import com.owncloud.android.ui.fragment.FileDetailActivitiesFragment; | ||
import com.owncloud.android.ui.fragment.FileDetailSharingFragment; | ||
|
||
/** | ||
* File details pager adapter. | ||
*/ | ||
public class FileDetailTabAdapter extends FragmentStatePagerAdapter { | ||
private OCFile file; | ||
private Account account; | ||
|
||
public FileDetailTabAdapter(FragmentManager fm, OCFile file, Account account) { | ||
super(fm); | ||
|
||
this.file = file; | ||
this.account = account; | ||
} | ||
|
||
@Override | ||
public Fragment getItem(int position) { | ||
switch (position) { | ||
case 0: | ||
return FileDetailActivitiesFragment.newInstance(file, account); | ||
case 1: | ||
return FileDetailSharingFragment.newInstance(file, account); | ||
default: | ||
return null; | ||
} | ||
} | ||
|
||
@Override | ||
public int getCount() { | ||
return 2; | ||
} | ||
} |
76 changes: 76 additions & 0 deletions
76
src/main/java/com/owncloud/android/ui/fragment/FileDetailActivitiesFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Nextcloud Android client application | ||
* | ||
* @author Andy Scherzinger | ||
* Copyright (C) 2018 Andy Scherzinger | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public | ||
* License along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.owncloud.android.ui.fragment; | ||
|
||
import android.accounts.Account; | ||
import android.os.Bundle; | ||
import android.support.annotation.NonNull; | ||
import android.support.v4.app.Fragment; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.TextView; | ||
|
||
import com.owncloud.android.R; | ||
import com.owncloud.android.datamodel.OCFile; | ||
import com.owncloud.android.ui.activity.FileActivity; | ||
|
||
public class FileDetailActivitiesFragment extends Fragment { | ||
|
||
private static final String ARG_FILE = "FILE"; | ||
private static final String ARG_ACCOUNT = "ACCOUNT"; | ||
|
||
private OCFile file; | ||
private Account account; | ||
|
||
public static FileDetailActivitiesFragment newInstance(OCFile file, Account account) { | ||
FileDetailActivitiesFragment fragment = new FileDetailActivitiesFragment(); | ||
Bundle args = new Bundle(); | ||
args.putParcelable(ARG_FILE, file); | ||
args.putParcelable(ARG_ACCOUNT, account); | ||
fragment.setArguments(args); | ||
return fragment; | ||
} | ||
|
||
@Override | ||
public View onCreateView(@NonNull LayoutInflater inflater, | ||
ViewGroup container, | ||
Bundle savedInstanceState) { | ||
|
||
file = getArguments().getParcelable(ARG_FILE); | ||
account = getArguments().getParcelable(ARG_ACCOUNT); | ||
|
||
if (savedInstanceState != null) { | ||
file = savedInstanceState.getParcelable(FileActivity.EXTRA_FILE); | ||
account = savedInstanceState.getParcelable(FileActivity.EXTRA_ACCOUNT); | ||
} | ||
|
||
View view = inflater.inflate(R.layout.file_details_activities_fragment, container, false); | ||
|
||
setupView(view); | ||
|
||
return view; | ||
} | ||
|
||
private void setupView(View view) { | ||
// TODO populate activities list | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.