Merge pull request #1156 from nextcloud/new_details_view_animations
revamped details screen
|
@ -1,2 +1,2 @@
|
|||
DO NOT TOUCH; GENERATED BY DRONE
|
||||
<span class="mdl-layout-title">Lint Report: 45 errors and 821 warnings</span>
|
||||
<span class="mdl-layout-title">Lint Report: 45 errors and 780 warnings</span>
|
||||
|
|
|
@ -474,7 +474,7 @@ public class ThumbnailsCacheManager {
|
|||
if (MimeTypeUtil.isVideo(mFile)) {
|
||||
imageView.setImageBitmap(ThumbnailsCacheManager.mDefaultVideo);
|
||||
} else {
|
||||
imageView.setImageResource(MimeTypeUtil.getFileTypeIconId(null, mFile.getName()));
|
||||
imageView.setImageDrawable(MimeTypeUtil.getFileTypeIcon(null, mFile.getName(), null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -223,10 +223,10 @@ public class MediaControlView extends FrameLayout /* implements OnLayoutChangeLi
|
|||
if (mProgress != null) {
|
||||
if (mProgress instanceof SeekBar) {
|
||||
SeekBar seeker = (SeekBar) mProgress;
|
||||
ThemeUtils.colorPreLollipopHorizontalSeekBar(seeker);
|
||||
ThemeUtils.colorHorizontalSeekBar(seeker);
|
||||
seeker.setOnSeekBarChangeListener(this);
|
||||
} else {
|
||||
ThemeUtils.colorPreLollipopHorizontalProgressBar(mProgress);
|
||||
ThemeUtils.colorHorizontalProgressBar(mProgress, ThemeUtils.primaryAccentColor());
|
||||
}
|
||||
mProgress.setMax(1000);
|
||||
}
|
||||
|
|
|
@ -294,7 +294,7 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
|
|||
mQuotaProgressBar = (ProgressBar) findQuotaViewById(R.id.drawer_quota_ProgressBar);
|
||||
mQuotaTextPercentage = (TextView) findQuotaViewById(R.id.drawer_quota_percentage);
|
||||
mQuotaTextLink = (TextView) findQuotaViewById(R.id.drawer_quota_link);
|
||||
ThemeUtils.colorPreLollipopHorizontalProgressBar(mQuotaProgressBar);
|
||||
ThemeUtils.colorHorizontalProgressBar(mQuotaProgressBar, ThemeUtils.primaryAccentColor());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -33,6 +33,7 @@ import android.content.ContentResolver;
|
|||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
@ -71,6 +72,7 @@ import com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation;
|
|||
import com.owncloud.android.ui.events.TokenPushEvent;
|
||||
import com.owncloud.android.utils.DisplayUtils;
|
||||
import com.owncloud.android.utils.PushUtils;
|
||||
import com.owncloud.android.utils.ThemeUtils;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
@ -255,6 +257,8 @@ public class UserInfoActivity extends FileActivity {
|
|||
emptyContentMessage.setText("");
|
||||
|
||||
emptyContentIcon.setVisibility(View.GONE);
|
||||
multiListProgressBar.getIndeterminateDrawable().setColorFilter(ThemeUtils.primaryColor(),
|
||||
PorterDuff.Mode.SRC_IN);
|
||||
multiListProgressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -251,8 +251,7 @@ public class ActivityListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
|||
Glide.with(context).using(new CustomGlideStreamLoader()).load(uri).into(fileIcon); //Using custom fetcher
|
||||
|
||||
} else {
|
||||
fileIcon.setImageResource(MimeTypeUtil.getFileTypeIconId(file.getMimetype(),
|
||||
file.getFileName()));
|
||||
fileIcon.setImageDrawable(MimeTypeUtil.getFileTypeIcon(file.getMimetype(), file.getFileName(), null));
|
||||
}
|
||||
} else {
|
||||
// Folder
|
||||
|
|
|
@ -281,6 +281,7 @@ public class ExpandableUploadListAdapter extends BaseExpandableListAdapter imple
|
|||
String status = getStatusText(upload);
|
||||
switch (upload.getUploadStatus()) {
|
||||
case UPLOAD_IN_PROGRESS:
|
||||
ThemeUtils.colorHorizontalProgressBar(progressBar, ThemeUtils.primaryAccentColor());
|
||||
progressBar.setProgress(0);
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
|
||||
|
@ -496,12 +497,8 @@ public class ExpandableUploadListAdapter extends BaseExpandableListAdapter imple
|
|||
.getColor(R.color.background_color));
|
||||
}
|
||||
} else {
|
||||
fileIcon.setImageResource(MimeTypeUtil.getFileTypeIconId(
|
||||
upload.getMimeType(),
|
||||
fileName
|
||||
));
|
||||
fileIcon.setImageDrawable(MimeTypeUtil.getFileTypeIcon(upload.getMimeType(), fileName, account));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return view;
|
||||
|
|
|
@ -414,7 +414,9 @@ public class FileListListAdapter extends BaseAdapter {
|
|||
|
||||
|
||||
} else {
|
||||
fileIcon.setImageResource(MimeTypeUtil.getFileTypeIconId(file.getMimetype(), file.getFileName()));
|
||||
fileIcon.setImageDrawable(
|
||||
MimeTypeUtil.getFileTypeIcon(file.getMimetype(), file.getFileName(), mAccount)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -228,7 +228,9 @@ public class LocalFileListAdapter extends BaseAdapter implements FilterableListA
|
|||
} // else, already being generated, don't restart it
|
||||
}
|
||||
} else {
|
||||
fileIcon.setImageResource(MimeTypeUtil.getFileTypeIconId(null, file.getName()));
|
||||
fileIcon.setImageDrawable(
|
||||
MimeTypeUtil.getFileTypeIcon(null, file.getName(), null)
|
||||
);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
|
@ -126,8 +126,8 @@ public class UploaderAdapter extends SimpleAdapter {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
fileIcon.setImageResource(
|
||||
MimeTypeUtil.getFileTypeIconId(file.getMimetype(), file.getFileName())
|
||||
fileIcon.setImageDrawable(
|
||||
MimeTypeUtil.getFileTypeIcon(file.getMimetype(), file.getFileName(), mAccount)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,93 @@
|
|||
/**
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author masensio
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.ui.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.lib.resources.shares.OCShare;
|
||||
import com.owncloud.android.lib.resources.shares.ShareType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Adapter to show a user/group in Share With List in Details View
|
||||
*/
|
||||
public class UserListAdapter extends ArrayAdapter {
|
||||
|
||||
private Context mContext;
|
||||
private ArrayList<OCShare> mShares;
|
||||
|
||||
public UserListAdapter(Context context, int resource, ArrayList<OCShare> shares) {
|
||||
super(context, resource);
|
||||
mContext = context;
|
||||
mShares = shares;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mShares.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
return mShares.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull View getView(final int position, View convertView, @NonNull ViewGroup parent) {
|
||||
View view = convertView;
|
||||
if (view == null) {
|
||||
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
view = inflater.inflate(R.layout.file_details_share_user_item, parent, false);
|
||||
}
|
||||
|
||||
if (mShares != null && mShares.size() > position) {
|
||||
OCShare share = mShares.get(position);
|
||||
|
||||
TextView userName = (TextView) view.findViewById(R.id.userOrGroupName);
|
||||
ImageView icon = (ImageView) view.findViewById(R.id.userIcon);
|
||||
String name = share.getSharedWithDisplayName();
|
||||
if (share.getShareType() == ShareType.GROUP) {
|
||||
name = getContext().getString(R.string.share_group_clarification, name);
|
||||
icon.setImageResource(R.drawable.ic_group);
|
||||
} else if (share.getShareType() == ShareType.EMAIL) {
|
||||
name = getContext().getString(R.string.share_email_clarification, name);
|
||||
icon.setImageResource(R.drawable.ic_email);
|
||||
}
|
||||
userName.setText(name);
|
||||
|
||||
}
|
||||
return view;
|
||||
}
|
||||
}
|
|
@ -47,6 +47,10 @@ public class SharePasswordDialogFragment extends DialogFragment
|
|||
|
||||
private static final String ARG_FILE = "FILE";
|
||||
private static final String ARG_CREATE_SHARE = "CREATE_SHARE";
|
||||
public static final String PASSWORD_FRAGMENT = "PASSWORD_FRAGMENT";
|
||||
|
||||
private OCFile mFile;
|
||||
private boolean mCreateShare;
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
|
@ -57,11 +61,6 @@ public class SharePasswordDialogFragment extends DialogFragment
|
|||
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(ThemeUtils.primaryAccentColor());
|
||||
}
|
||||
|
||||
public static final String PASSWORD_FRAGMENT = "PASSWORD_FRAGMENT";
|
||||
|
||||
private OCFile mFile;
|
||||
private boolean mCreateShare;
|
||||
|
||||
/**
|
||||
* Public factory method to create new SharePasswordDialogFragment instances.
|
||||
*
|
||||
|
|
|
@ -24,7 +24,7 @@ package com.owncloud.android.ui.fragment;
|
|||
import android.accounts.Account;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.AppCompatCheckBox;
|
||||
import android.support.v7.widget.SwitchCompat;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
|
@ -32,8 +32,10 @@ import android.view.MenuItem;
|
|||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListAdapter;
|
||||
import android.widget.ListView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
@ -47,8 +49,10 @@ import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
|
|||
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
|
||||
import com.owncloud.android.lib.common.network.OnDatatransferProgressListener;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
import com.owncloud.android.lib.resources.shares.OCShare;
|
||||
import com.owncloud.android.ui.activity.FileActivity;
|
||||
import com.owncloud.android.ui.activity.FileDisplayActivity;
|
||||
import com.owncloud.android.ui.adapter.UserListAdapter;
|
||||
import com.owncloud.android.ui.dialog.RemoveFilesDialogFragment;
|
||||
import com.owncloud.android.ui.dialog.RenameFileDialogFragment;
|
||||
import com.owncloud.android.utils.AnalyticsUtils;
|
||||
|
@ -57,12 +61,14 @@ import com.owncloud.android.utils.MimeTypeUtil;
|
|||
import com.owncloud.android.utils.ThemeUtils;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
/**
|
||||
* This Fragment is used to display the details about a file.
|
||||
*/
|
||||
public class FileDetailFragment extends FileFragment implements OnClickListener {
|
||||
public class FileDetailFragment extends FileFragment implements OnClickListener,
|
||||
CompoundButton.OnCheckedChangeListener {
|
||||
|
||||
private int mLayout;
|
||||
private View mView;
|
||||
|
@ -70,6 +76,9 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
|
|||
|
||||
public ProgressListener mProgressListener;
|
||||
|
||||
// to show share with users/groups info
|
||||
private ArrayList<OCShare> mShares;
|
||||
|
||||
private static final String TAG = FileDetailFragment.class.getSimpleName();
|
||||
public static final String FTAG_CONFIRMATION = "REMOVE_CONFIRMATION_FRAGMENT";
|
||||
public static final String FTAG_RENAME_FILE = "RENAME_FILE_FRAGMENT";
|
||||
|
@ -143,14 +152,16 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
|
|||
mView = inflater.inflate(mLayout, null);
|
||||
|
||||
if (mLayout == R.layout.file_details_fragment) {
|
||||
mView.findViewById(R.id.fdFavorite).setOnClickListener(this);
|
||||
int accentColor = ThemeUtils.primaryAccentColor();
|
||||
SwitchCompat favoriteToggle = (SwitchCompat) mView.findViewById(R.id.fdFavorite);
|
||||
favoriteToggle.setOnCheckedChangeListener(this);
|
||||
ThemeUtils.tintSwitch(favoriteToggle, accentColor, false);
|
||||
ProgressBar progressBar = (ProgressBar)mView.findViewById(R.id.fdProgressBar);
|
||||
ThemeUtils.colorPreLollipopHorizontalProgressBar(progressBar);
|
||||
ThemeUtils.colorHorizontalProgressBar(progressBar, ThemeUtils.primaryAccentColor());
|
||||
mProgressListener = new ProgressListener(progressBar);
|
||||
mView.findViewById(R.id.fdCancelBtn).setOnClickListener(this);
|
||||
|
||||
AppCompatCheckBox favoriteCheckBox = (AppCompatCheckBox) mView.findViewById(R.id.fdFavorite);
|
||||
ThemeUtils.tintCheckbox(favoriteCheckBox, ThemeUtils.primaryAccentColor());
|
||||
((TextView)mView.findViewById(R.id.fdShareTitle)).setTextColor(accentColor);
|
||||
((TextView)mView.findViewById(R.id.fdShareWithUsersTitle)).setTextColor(accentColor);
|
||||
}
|
||||
|
||||
updateFileDetails(false, false);
|
||||
|
@ -328,11 +339,6 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.fdFavorite: {
|
||||
CheckBox cb = (CheckBox) getView().findViewById(R.id.fdFavorite);
|
||||
mContainerActivity.getFileOperationsHelper().toggleOfflineFile(getFile(),cb.isChecked());
|
||||
break;
|
||||
}
|
||||
case R.id.fdCancelBtn: {
|
||||
((FileDisplayActivity) mContainerActivity).cancelTransference(getFile());
|
||||
break;
|
||||
|
@ -343,6 +349,12 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
SwitchCompat favSwitch = (SwitchCompat) getView().findViewById(R.id.fdFavorite);
|
||||
mContainerActivity.getFileOperationsHelper().toggleOfflineFile(getFile(), favSwitch.isChecked());
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the fragment was created with an empty layout. An empty fragment can't show file details, must be replaced.
|
||||
*
|
||||
|
@ -389,8 +401,12 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
|
|||
|
||||
setTimeModified(file.getModificationTimestamp());
|
||||
|
||||
CheckBox cb = (CheckBox)getView().findViewById(R.id.fdFavorite);
|
||||
cb.setChecked(file.isAvailableOffline());
|
||||
SwitchCompat favSwitch = (SwitchCompat) getView().findViewById(R.id.fdFavorite);
|
||||
favSwitch.setChecked(file.isAvailableOffline());
|
||||
|
||||
setShareByLinkInfo(file.isSharedViaLink());
|
||||
|
||||
setShareWithUserInfo();
|
||||
|
||||
// configure UI for depending upon local state of the file
|
||||
FileDownloaderBinder downloaderBinder = mContainerActivity.getFileDownloaderBinder();
|
||||
|
@ -452,8 +468,11 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
|
|||
ImageView iv = (ImageView) getView().findViewById(R.id.fdIcon);
|
||||
|
||||
if (iv != null) {
|
||||
Bitmap thumbnail;
|
||||
iv.setTag(file.getFileId());
|
||||
// Name of the file, to deduce the icon to use in case the MIME type is not precise enough
|
||||
iv.setImageDrawable(MimeTypeUtil.getFileTypeIcon(file.getMimetype(), file.getFileName(), mAccount));
|
||||
|
||||
Bitmap thumbnail;
|
||||
|
||||
if (MimeTypeUtil.isImage(file)) {
|
||||
String tagId = String.valueOf(file.getRemoteId());
|
||||
|
@ -482,9 +501,7 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
|
|||
}
|
||||
}
|
||||
} else {
|
||||
// Name of the file, to deduce the icon to use in case the MIME type is not precise enough
|
||||
String filename = file.getFileName();
|
||||
iv.setImageResource(MimeTypeUtil.getFileTypeIconId(mimetype, filename));
|
||||
iv.setImageDrawable(MimeTypeUtil.getFileTypeIcon(file.getMimetype(), file.getFileName(), mAccount));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -492,12 +509,12 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
|
|||
/**
|
||||
* Updates the file size in view
|
||||
*
|
||||
* @param filesize in bytes to set
|
||||
* @param fileSize in bytes to set
|
||||
*/
|
||||
private void setFilesize(long filesize) {
|
||||
private void setFilesize(long fileSize) {
|
||||
TextView tv = (TextView) getView().findViewById(R.id.fdSize);
|
||||
if (tv != null) {
|
||||
tv.setText(DisplayUtils.bytesToHumanReadable(filesize));
|
||||
tv.setText(DisplayUtils.bytesToHumanReadable(fileSize));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -513,6 +530,90 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates Share by link data
|
||||
*
|
||||
* @param isShareByLink flag is share by link is enable
|
||||
*/
|
||||
private void setShareByLinkInfo(boolean isShareByLink) {
|
||||
TextView tv = (TextView) getView().findViewById(R.id.fdSharebyLink);
|
||||
if (tv != null) {
|
||||
tv.setText(isShareByLink ? R.string.filedetails_share_link_enable :
|
||||
R.string.filedetails_share_link_disable);
|
||||
}
|
||||
ImageView linkIcon = (ImageView) getView().findViewById(R.id.fdShareLinkIcon);
|
||||
if (linkIcon != null) {
|
||||
linkIcon.setVisibility(isShareByLink ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Share With data
|
||||
*/
|
||||
private void setShareWithUserInfo(){
|
||||
// Get Users and Groups
|
||||
if (((FileActivity) getActivity()).getStorageManager() != null) {
|
||||
FileDataStorageManager fileDataStorageManager = ((FileActivity) getActivity()).getStorageManager();
|
||||
mShares = fileDataStorageManager.getSharesWithForAFile(
|
||||
getFile().getRemotePath(),mAccount.name
|
||||
);
|
||||
|
||||
// Update list of users/groups
|
||||
updateListOfUserGroups();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateListOfUserGroups() {
|
||||
// Update list of users/groups
|
||||
// TODO Refactoring: create a new {@link ShareUserListAdapter} instance with every call should not be needed
|
||||
UserListAdapter mUserGroupsAdapter = new UserListAdapter(
|
||||
getActivity().getApplicationContext(),
|
||||
R.layout.share_user_item, mShares
|
||||
);
|
||||
|
||||
// Show data
|
||||
ListView usersList = (ListView) getView().findViewById(R.id.fdshareUsersList);
|
||||
|
||||
// No data
|
||||
TextView noList = (TextView) getView().findViewById(R.id.fdShareNoUsers);
|
||||
|
||||
if (mShares.size() > 0) {
|
||||
usersList.setVisibility(View.VISIBLE);
|
||||
usersList.setAdapter(mUserGroupsAdapter);
|
||||
noList.setVisibility(View.GONE);
|
||||
setListViewHeightBasedOnChildren(usersList);
|
||||
|
||||
} else {
|
||||
usersList.setVisibility(View.GONE);
|
||||
noList.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix scroll in listview when the parent is a ScrollView
|
||||
*/
|
||||
private static void setListViewHeightBasedOnChildren(ListView listView) {
|
||||
ListAdapter listAdapter = listView.getAdapter();
|
||||
if (listAdapter == null) {
|
||||
return;
|
||||
}
|
||||
int desiredWidth = View.MeasureSpec.makeMeasureSpec(listView.getWidth(), View.MeasureSpec.AT_MOST);
|
||||
int totalHeight = 0;
|
||||
View view = null;
|
||||
for (int i = 0; i < listAdapter.getCount(); i++) {
|
||||
view = listAdapter.getView(i, view, listView);
|
||||
if (i == 0) {
|
||||
view.setLayoutParams(new ViewGroup.LayoutParams(desiredWidth, ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||
}
|
||||
view.measure(desiredWidth, View.MeasureSpec.UNSPECIFIED);
|
||||
totalHeight += view.getMeasuredHeight();
|
||||
}
|
||||
ViewGroup.LayoutParams params = listView.getLayoutParams();
|
||||
params.height = totalHeight + (listView.getDividerHeight() * (listAdapter.getCount() - 1));
|
||||
listView.setLayoutParams(params);
|
||||
listView.requestLayout();
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables buttons for a file being downloaded
|
||||
*/
|
||||
|
|
|
@ -242,11 +242,11 @@ public class LocalFileListFragment extends ExtendedListFragment {
|
|||
* @return File paths to the files checked by the user.
|
||||
*/
|
||||
public String[] getCheckedFilePaths() {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
SparseBooleanArray positions = mCurrentListView.getCheckedItemPositions();
|
||||
if (positions.size() > 0) {
|
||||
for (int i = 0; i < positions.size(); i++) {
|
||||
if (positions.get(positions.keyAt(i)) == true) {
|
||||
if (positions.get(positions.keyAt(i))) {
|
||||
result.add(((File) mCurrentListView.getItemAtPosition(
|
||||
positions.keyAt(i))).getAbsolutePath());
|
||||
}
|
||||
|
|
|
@ -206,8 +206,9 @@ public class ShareFileFragment extends Fragment implements ShareUserListAdapter.
|
|||
// Setup layout
|
||||
// Image
|
||||
ImageView icon = (ImageView) view.findViewById(R.id.shareFileIcon);
|
||||
icon.setImageResource(MimeTypeUtil.getFileTypeIconId(mFile.getMimetype(),
|
||||
mFile.getFileName()));
|
||||
icon.setImageDrawable(
|
||||
MimeTypeUtil.getFileTypeIcon(mFile.getMimetype(), mFile.getFileName(), mAccount)
|
||||
);
|
||||
if (MimeTypeUtil.isImage(mFile)) {
|
||||
String remoteId = String.valueOf(mFile.getRemoteId());
|
||||
Bitmap thumbnail = ThumbnailsCacheManager.getBitmapFromDiskCache(remoteId);
|
||||
|
|
|
@ -138,7 +138,7 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
|
|||
mView = inflater.inflate(R.layout.file_download_fragment, container, false);
|
||||
|
||||
ProgressBar progressBar = (ProgressBar)mView.findViewById(R.id.progressBar);
|
||||
ThemeUtils.colorPreLollipopHorizontalProgressBar(progressBar);
|
||||
ThemeUtils.colorHorizontalProgressBar(progressBar, ThemeUtils.primaryAccentColor());
|
||||
mProgressListener = new ProgressListener(progressBar);
|
||||
|
||||
(mView.findViewById(R.id.cancelBtn)).setOnClickListener(this);
|
||||
|
|
|
@ -359,8 +359,9 @@ public class DisplayUtils {
|
|||
|
||||
// Remove last slash from path
|
||||
if (path.length() > 1 && path.charAt(path.length() - 1) == OCFile.PATH_SEPARATOR.charAt(0)) {
|
||||
path = path.substring(0, path.length() - 1);
|
||||
return path.substring(0, path.length() - 1);
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ import android.graphics.drawable.Drawable;
|
|||
import android.net.Uri;
|
||||
import android.webkit.MimeTypeMap;
|
||||
|
||||
import com.owncloud.android.MainApp;
|
||||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.datamodel.OCFile;
|
||||
|
||||
|
@ -71,6 +72,36 @@ public class MimeTypeUtil {
|
|||
populateMainMimeTypeMapping();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Drawable of an image to use as icon associated to a known MIME type.
|
||||
*
|
||||
* @param mimetype MIME type string; if NULL, the method tries to guess it from the extension in filename
|
||||
* @param filename Name, with extension.
|
||||
* @return Drawable of an image resource.
|
||||
*/
|
||||
public static Drawable getFileTypeIcon(String mimetype, String filename) {
|
||||
return getFileTypeIcon(mimetype, filename, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Drawable of an image to use as icon associated to a known MIME type.
|
||||
*
|
||||
* @param mimetype MIME type string; if NULL, the method tries to guess it from the extension in filename
|
||||
* @param filename Name, with extension.
|
||||
* @param account account which color should be used
|
||||
* @return Drawable of an image resource.
|
||||
*/
|
||||
public static Drawable getFileTypeIcon(String mimetype, String filename, Account account) {
|
||||
int iconId = MimeTypeUtil.getFileTypeIconId(mimetype, filename);
|
||||
Drawable icon = MainApp.getAppContext().getResources().getDrawable(iconId);
|
||||
|
||||
if(R.drawable.file_zip == iconId) {
|
||||
ThemeUtils.tintDrawable(icon, ThemeUtils.primaryColor(account));
|
||||
}
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the resource identifier of an image to use as icon associated to a known MIME type.
|
||||
*
|
||||
|
|
|
@ -179,17 +179,6 @@ public class ThemeUtils {
|
|||
return ColorUtils.HSLToColor(hsl);
|
||||
}
|
||||
|
||||
/**
|
||||
* sets the coloring of the given progress bar to color_accent.
|
||||
*
|
||||
* @param progressBar the progress bar to be colored
|
||||
*/
|
||||
public static void colorPreLollipopHorizontalProgressBar(ProgressBar progressBar) {
|
||||
if (progressBar != null && Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||
colorHorizontalProgressBar(progressBar, ThemeUtils.primaryAccentColor());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* sets the tinting of the given ImageButton's icon to color_accent.
|
||||
*
|
||||
|
@ -219,15 +208,13 @@ public class ThemeUtils {
|
|||
*
|
||||
* @param seekBar the seek bar to be colored
|
||||
*/
|
||||
public static void colorPreLollipopHorizontalSeekBar(SeekBar seekBar) {
|
||||
if (seekBar != null && Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||
colorPreLollipopHorizontalProgressBar(seekBar);
|
||||
public static void colorHorizontalSeekBar(SeekBar seekBar) {
|
||||
int color = ThemeUtils.primaryAccentColor();
|
||||
colorHorizontalProgressBar(seekBar, color);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||
int color = ThemeUtils.primaryAccentColor();
|
||||
seekBar.getThumb().setColorFilter(color, PorterDuff.Mode.SRC_IN);
|
||||
seekBar.getThumb().setColorFilter(color, PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||
seekBar.getThumb().setColorFilter(color, PorterDuff.Mode.SRC_IN);
|
||||
seekBar.getThumb().setColorFilter(color, PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Before Width: | Height: | Size: 820 B |
Before Width: | Height: | Size: 920 B |
Before Width: | Height: | Size: 608 B |
Before Width: | Height: | Size: 600 B |
Before Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 802 B |
|
@ -176,7 +176,7 @@
|
|||
android:ems="10"
|
||||
android:enabled="false"
|
||||
android:inputType="textUri"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:text="@string/oauth2_url_endpoint_auth"
|
||||
android:textColor="@color/login_text_color"
|
||||
android:textColorHint="@color/login_text_hint_color"
|
||||
|
@ -196,7 +196,7 @@
|
|||
android:ems="10"
|
||||
android:enabled="false"
|
||||
android:text="@string/oauth2_url_endpoint_access"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:inputType="textUri"
|
||||
android:textColor="@color/login_text_color"
|
||||
android:textColorHint="@color/login_text_hint_color"
|
||||
|
|
|
@ -168,7 +168,7 @@
|
|||
android:ems="10"
|
||||
android:enabled="false"
|
||||
android:inputType="textUri"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:text="@string/oauth2_url_endpoint_auth"
|
||||
android:textColor="@color/login_text_color"
|
||||
android:textColorHint="@color/login_text_hint_color"
|
||||
|
@ -188,7 +188,7 @@
|
|||
android:ems="10"
|
||||
android:enabled="false"
|
||||
android:inputType="textUri"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:text="@string/oauth2_url_endpoint_access"
|
||||
android:textColor="@color/login_text_color"
|
||||
android:textColorHint="@color/login_text_hint_color"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:singleLine="false"
|
||||
android:layout_margin="@dimen/standard_margin"
|
||||
style="?android:attr/editTextPreferenceStyle"
|
||||
android:text="@string/manage_space_description"
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
android:layout_gravity="center_vertical"
|
||||
android:textAppearance="?android:attr/textAppearanceLargePopupMenu"
|
||||
android:duplicateParentState="true"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="marquee"
|
||||
android:fadingEdge="horizontal" />
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
android:shadowDx="0.5"
|
||||
android:shadowDy="0"
|
||||
android:shadowRadius="2"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/drawer_header_text"
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
android:text="@string/share_with_edit_title"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
android:padding="@dimen/standard_padding"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="middle"
|
||||
/>
|
||||
|
||||
|
@ -61,7 +61,7 @@
|
|||
android:layout_marginTop="@dimen/standard_half_margin"
|
||||
android:textColor="@color/color_accent"
|
||||
android:paddingLeft="@dimen/zero"
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
style="@style/TextAppearance.AppCompat.Body2"
|
||||
/>
|
||||
|
||||
<android.support.v7.widget.AppCompatCheckBox
|
||||
|
@ -97,7 +97,7 @@
|
|||
android:layout_marginTop="@dimen/standard_half_margin"
|
||||
android:textColor="@color/color_accent"
|
||||
android:paddingLeft="@dimen/zero"
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
style="@style/TextAppearance.AppCompat.Body2"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<!--
|
||||
ownCloud Android client application
|
||||
|
||||
Copyright (C) 2012 Bartek Przybylski
|
||||
Copyright (C) 2015 ownCloud Inc.
|
||||
Copyright (C) 2012 Bartek Przybylski
|
||||
Copyright (C) 2017 ownCloud GmbH.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2,
|
||||
|
@ -18,199 +18,195 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/fdScrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
>
|
||||
android:id="@+id/fdScrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true">
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/fdFileHeaderContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/standard_margin"
|
||||
android:layout_marginRight="@dimen/standard_margin"
|
||||
android:layout_marginTop="@dimen/standard_margin">
|
||||
android:layout_margin="@dimen/standard_margin">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fdIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/file" />
|
||||
android:src="@drawable/file"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fdFilename"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toRightOf="@+id/fdIcon"
|
||||
android:id="@+id/fdFilename"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toRightOf="@+id/fdIcon"
|
||||
android:paddingLeft="@dimen/standard_padding"
|
||||
android:text="@string/placeholder_filename"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
android:text="@string/placeholder_filename"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/fdDetailsContainer"
|
||||
<TableLayout
|
||||
android:id="@+id/fdDetailsTable"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/standard_margin"
|
||||
android:layout_marginRight="@dimen/standard_margin"
|
||||
android:layout_marginTop="@dimen/standard_margin"
|
||||
android:layout_below="@id/fdFileHeaderContainer" >
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginBottom="8dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/fdLabelContainer"
|
||||
android:layout_width="wrap_content"
|
||||
<TableRow
|
||||
android:id="@+id/fdTypeRow"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true" >
|
||||
android:layout_marginBottom="@dimen/standard_half_margin">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fdTypeLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/filedetails_type"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fdSizeLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/fdTypeLabel"
|
||||
android:layout_marginTop="@dimen/fragment_margin"
|
||||
android:text="@string/filedetails_size"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fdCreatedLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/fdSizeLabel"
|
||||
android:layout_marginTop="@dimen/fragment_margin"
|
||||
android:text="@string/filedetails_created"
|
||||
android:visibility="gone"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fdModifiedLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/fdCreatedLabel"
|
||||
android:layout_marginTop="@dimen/fragment_margin"
|
||||
android:text="@string/filedetails_modified"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/fdValueContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginLeft="@dimen/standard_margin"
|
||||
android:layout_toRightOf="@+id/fdLabelContainer" >
|
||||
|
||||
android:textSize="16sp" />
|
||||
<TextView
|
||||
android:id="@+id/fdType"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/placeholder_filetype"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
android:textSize="16sp"
|
||||
android:layout_marginLeft="@dimen/standard_half_margin" />
|
||||
|
||||
</TableRow>
|
||||
<TableRow
|
||||
android:id="@+id/fdSizeRow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/standard_half_margin">
|
||||
<TextView
|
||||
android:id="@+id/fdSizeLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/filedetails_size"
|
||||
android:textSize="16sp"/>
|
||||
<TextView
|
||||
android:id="@+id/fdSize"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/fdType"
|
||||
android:layout_marginTop="@dimen/fragment_margin"
|
||||
android:text="@string/placeholder_filesize"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
android:textSize="16sp"
|
||||
android:layout_marginLeft="@dimen/standard_half_margin" />
|
||||
|
||||
</TableRow>
|
||||
<TableRow
|
||||
android:id="@+id/fdCreatedRow"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="5dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:visibility="gone">
|
||||
<TextView
|
||||
android:id="@+id/fdCreatedLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/filedetails_created"
|
||||
android:textSize="16sp" />
|
||||
<TextView
|
||||
android:id="@+id/fdCreated"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/fdSize"
|
||||
android:layout_marginTop="@dimen/fragment_margin"
|
||||
android:visibility="gone"
|
||||
android:text="@string/placeholder_timestamp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
android:textSize="16sp"
|
||||
android:layout_marginLeft="4dp" />
|
||||
|
||||
</TableRow>
|
||||
<TableRow
|
||||
android:id="@+id/fdModifiedRow"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/standard_half_margin">
|
||||
<TextView
|
||||
android:id="@+id/fdModifiedLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/filedetails_modified"
|
||||
android:textSize="16sp" />
|
||||
<TextView
|
||||
android:id="@+id/fdModified"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/fdCreated"
|
||||
android:layout_marginTop="@dimen/fragment_margin"
|
||||
android:text="@string/placeholder_timestamp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
android:textSize="16sp"
|
||||
android:layout_marginLeft="@dimen/standard_half_margin" />
|
||||
|
||||
</RelativeLayout>
|
||||
</TableRow>
|
||||
|
||||
</RelativeLayout>
|
||||
</TableLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/list_divider_background"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/fdProgressAndControl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/fdDetailsContainer"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_margin="@dimen/standard_margin"
|
||||
>
|
||||
android:layout_marginBottom="@dimen/standard_half_margin"
|
||||
android:layout_marginLeft="@dimen/standard_margin"
|
||||
android:layout_marginRight="@dimen/standard_margin"
|
||||
android:layout_marginTop="@dimen/standard_half_margin"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<android.support.v7.widget.AppCompatCheckBox
|
||||
<android.support.v7.widget.SwitchCompat
|
||||
android:id="@+id/fdFavorite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_gravity="start"
|
||||
android:text="@string/favorite"
|
||||
android:checked="false" />
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/fdFavorite"
|
||||
android:orientation="vertical" >
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fdProgressText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/downloader_download_in_progress_ticker"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/fdProgressBlock"
|
||||
<TextView
|
||||
android:id="@+id/fdProgressText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="@dimen/fragment_margin"
|
||||
android:layout_marginBottom="@dimen/fragment_margin"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/downloader_download_in_progress_ticker"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/fdProgressBar"
|
||||
android:layout_width="@dimen/zero"
|
||||
<LinearLayout
|
||||
android:id="@+id/fdProgressBlock"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/standard_quarter_margin"
|
||||
android:layout_marginTop="@dimen/standard_half_margin"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/fdProgressBar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:indeterminate="false"
|
||||
android:indeterminateOnly="false"
|
||||
/>
|
||||
android:indeterminate="false"
|
||||
android:indeterminateOnly="false"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/fdCancelBtn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/fragment_margin"
|
||||
android:src="@drawable/ic_action_cancel_grey"
|
||||
android:layout_marginLeft="@dimen/standard_half_margin"
|
||||
android:background="@android:color/transparent"
|
||||
/>
|
||||
android:src="@drawable/ic_cancel"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -218,6 +214,79 @@
|
|||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/list_divider_background"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/fdShareContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="@dimen/standard_half_margin"
|
||||
android:layout_marginLeft="@dimen/standard_margin"
|
||||
android:layout_marginRight="@dimen/standard_margin"
|
||||
android:layout_marginTop="@dimen/standard_half_margin"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fdShareTitle"
|
||||
style="@style/TextAppearance.AppCompat.Body2"
|
||||
android:textColor="@color/color_accent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/standard_half_margin"
|
||||
android:text="@string/action_share"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fdShareLinkIcon"
|
||||
android:layout_width="14sp"
|
||||
android:layout_height="14sp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="@dimen/standard_half_margin"
|
||||
android:src="@drawable/shared_via_link"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fdSharebyLink"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:text="@string/filedetails_share_link_disable"/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fdShareWithUsersTitle"
|
||||
style="@style/TextAppearance.AppCompat.Body2"
|
||||
android:textColor="@color/color_accent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:layout_marginBottom="@dimen/standard_half_margin"
|
||||
android:layout_marginTop="@dimen/standard_half_margin"
|
||||
android:text="@string/filedetails_share_users_with_access"/>
|
||||
|
||||
<ListView
|
||||
android:id="@+id/fdshareUsersList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dip"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fdShareNoUsers"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/share_no_users"
|
||||
android:textSize="14sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
|
41
src/main/res/layout/file_details_share_user_item.xml
Normal file
|
@ -0,0 +1,41 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
ownCloud Android client application
|
||||
Copyright (C) 2015 ownCloud Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2,
|
||||
as published by the Free Software Foundation.
|
||||
|
||||
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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/userIcon"
|
||||
android:layout_width="32sp"
|
||||
android:layout_height="32sp"
|
||||
android:src="@drawable/ic_user"
|
||||
android:layout_gravity="center_vertical"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16dip"
|
||||
android:text="@string/username"
|
||||
android:id="@+id/userOrGroupName"
|
||||
android:layout_margin="12dp"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="middle"
|
||||
android:textColor="@color/black"/>
|
||||
</LinearLayout>
|
|
@ -18,7 +18,6 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
|
|
@ -94,8 +94,8 @@
|
|||
android:layout_marginRight="@dimen/standard_quarter_margin"
|
||||
android:ellipsize="middle"
|
||||
android:gravity="center_horizontal"
|
||||
android:singleLine="true"
|
||||
android:text="TextView"
|
||||
android:maxLines="1"
|
||||
android:text="@string/placeholder_filename"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="@dimen/grid_item_text_size" />
|
||||
|
||||
|
|
|
@ -94,8 +94,8 @@
|
|||
android:layout_marginLeft="@dimen/zero"
|
||||
android:layout_marginRight="@dimen/standard_quarter_margin"
|
||||
android:ellipsize="middle"
|
||||
android:singleLine="true"
|
||||
android:text="TextView"
|
||||
android:maxLines="1"
|
||||
android:text="@string/placeholder_filename"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="@dimen/two_line_primary_text_size" />
|
||||
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:textStyle="bold"
|
||||
android:textSize="@dimen/log_item_text_size"
|
||||
android:textColor="#000000"
|
||||
|
|
|
@ -74,11 +74,7 @@
|
|||
android:layout_width="@dimen/zero"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="@dimen/seek_bar_height"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:progressDrawable="@color/white"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:splitTrack="false"/>
|
||||
|
||||
<TextView android:id="@+id/totalTimeText"
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<TextView android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="marquee"
|
||||
android:fadingEdge="horizontal"
|
||||
style="@style/Theme.ownCloud.NotificationText.Title"
|
||||
|
@ -46,7 +46,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/standard_eighth_margin_negative"
|
||||
android:layout_marginBottom="@dimen/standard_eighth_margin_negative"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:fadingEdge="horizontal"
|
||||
android:ellipsize="marquee"
|
||||
style="@style/Theme.ownCloud.NotificationText.Content"
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
android:layout_toEndOf="@+id/shareFileIcon"
|
||||
android:layout_toRightOf="@+id/shareFileIcon"
|
||||
android:ellipsize="middle"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:text="@string/placeholder_filename"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/two_line_primary_text_size"/>
|
||||
|
@ -92,7 +92,7 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/shareWithUsersSectionTitle"
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
style="@style/TextAppearance.AppCompat.Body2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
|
@ -140,7 +140,7 @@
|
|||
|
||||
<android.support.v7.widget.SwitchCompat
|
||||
android:id="@+id/shareViaLinkSectionSwitch"
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
style="@style/TextAppearance.AppCompat.Body2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
android:layout_marginBottom="@dimen/standard_half_margin"
|
||||
android:layout_marginLeft="@dimen/standard_half_margin"
|
||||
android:textColor="@color/textColor"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="middle"
|
||||
android:layout_gravity="center_vertical"/>
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
android:gravity="bottom">
|
||||
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12dp"
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/uploadListGroupName"
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
style="@style/TextAppearance.AppCompat.Body2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:divider="@null"
|
||||
|
@ -14,6 +15,8 @@
|
|||
android:showDividers="none"
|
||||
android:textColor="@color/color_accent"
|
||||
android:paddingLeft="@dimen/standard_padding"
|
||||
android:paddingTop="@dimen/standard_padding"
|
||||
android:paddingBottom="@dimen/standard_half_margin"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
|
@ -37,7 +37,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:ellipsize="middle"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/textColor"
|
||||
android:text="@string/placeholder_filename"
|
||||
android:textSize="@dimen/two_line_primary_text_size" />
|
||||
|
@ -53,7 +53,7 @@
|
|||
android:gravity="left"
|
||||
android:textColor="@color/list_item_lastmod_and_filesize_text"
|
||||
android:ellipsize="middle"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:text="@string/placeholder_filesize"
|
||||
android:textSize="@dimen/upload_list_item_text_size"/>
|
||||
<TextView
|
||||
|
@ -87,7 +87,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/list_item_lastmod_and_filesize_text"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:text="@string/auth_username"
|
||||
android:textSize="@dimen/upload_list_item_text_size_independent"/>
|
||||
|
||||
|
@ -97,7 +97,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/list_item_lastmod_and_filesize_text"
|
||||
android:ellipsize="middle"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:text="@string/instant_upload_path"
|
||||
android:textSize="@dimen/upload_list_item_text_size_independent"/>
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
android:layout_marginLeft="@dimen/zero"
|
||||
android:layout_marginRight="@dimen/standard_quarter_margin"
|
||||
android:ellipsize="middle"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:text="TextView"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="@dimen/two_line_primary_text_size" />
|
||||
|
|
|
@ -524,6 +524,9 @@
|
|||
<string name="share_known_remote_clarification">%1$s ( at %2$s )</string>
|
||||
|
||||
<string name="share_sharee_unavailable">Upgrade the server version to allow sharing between users from within their clients.\nPlease contact your administrator</string>
|
||||
<string name="filedetails_share_link_enable">Share by link enabled</string>
|
||||
<string name="filedetails_share_link_disable">Not shared by link</string>
|
||||
<string name="filedetails_share_users_with_access">Users and Groups with access</string>
|
||||
<string name="share_privilege_can_share">can share</string>
|
||||
<string name="share_privilege_can_edit">can edit</string>
|
||||
<string name="share_privilege_can_edit_create">create</string>
|
||||
|
|
|
@ -225,7 +225,7 @@
|
|||
<item name="android:digits">1234567890</item>
|
||||
<item name="android:maxLength">1</item>
|
||||
<item name="android:password">true</item>
|
||||
<item name="android:singleLine">true</item>
|
||||
<item name="android:maxLines">1</item>
|
||||
|
||||
</style>
|
||||
|
||||
|
|