Skip to content

Commit

Permalink
Share UI issue fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
surinder-tsys committed Jun 15, 2023
1 parent 24b2397 commit 3f22acb
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 45 deletions.
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,8 @@
android:label="@string/share_dialog_title"
android:launchMode="singleTop"
android:theme="@style/Theme.ownCloud.Dialog.NoTitle"
android:windowSoftInputMode="adjustResize">
android:configChanges="orientation|screenSize"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import com.owncloud.android.operations.GetSharesForFileOperation;
import com.owncloud.android.ui.fragment.FileDetailSharingFragment;
import com.owncloud.android.ui.fragment.FileDetailsSharingProcessFragment;
import com.owncloud.android.ui.fragment.util.SharingMenuHelper;
import com.owncloud.android.utils.DisplayUtils;
import com.owncloud.android.utils.MimeTypeUtil;

Expand Down Expand Up @@ -147,7 +148,7 @@ protected void doShareWith(String shareeName, ShareType shareType) {
FileDetailsSharingProcessFragment.newInstance(getFile(),
shareeName,
shareType,
true),
SharingMenuHelper.canEditFile(this, getUser().get(), getStorageManager().getCapability(getUser().get()), getFile(), editorUtils)),
FileDetailsSharingProcessFragment.TAG)
.commit();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,30 +353,26 @@ class OCFileListDelegate(
sharedMessageView?.setTextColor(sharedWithMeColor)
}
file.isSharedWithSharee -> {
val shareIcon = viewThemeUtils.platform.tintDrawable(
context,
AppCompatResources.getDrawable(context, R.drawable.ic_shared)!!
val shareIcon = viewThemeUtils.platform.colorDrawable(
AppCompatResources.getDrawable(context, R.drawable.ic_shared)!!,
context.resources.getColor(R.color.primary, null)
)
sharedIconView.setImageDrawable(shareIcon)
sharedIconView.contentDescription = context.getString(R.string.shared_icon_shared)
//Added Code For Message Text
sharedMessageView?.text = context.resources.getString(R.string.placeholder_sharedMessage)
sharedMessageView?.let{
viewThemeUtils.platform.colorTextView(it)
}
sharedMessageView?.setTextColor(context.resources.getColor(R.color.primary, null))
}
file.isSharedViaLink -> {
val shareIcon = viewThemeUtils.platform.tintDrawable(
context,
AppCompatResources.getDrawable(context, R.drawable.ic_shared)!!
val shareIcon = viewThemeUtils.platform.colorDrawable(
AppCompatResources.getDrawable(context, R.drawable.ic_shared)!!,
context.resources.getColor(R.color.primary, null)
)
sharedIconView.setImageDrawable(shareIcon)
sharedIconView.contentDescription = context.getString(R.string.shared_icon_shared_via_link)
//Added Code For Message Text
sharedMessageView?.text = context.resources.getString(R.string.placeholder_sharedMessage)
sharedMessageView?.let{
viewThemeUtils.platform.colorTextView(it)
}
sharedMessageView?.setTextColor(context.resources.getColor(R.color.primary, null))
}
file.isEncrypted -> {
sharedIconView.visibility = View.GONE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ class QuickSharingPermissionsAdapter(
fun bindData(quickPermissionModel: QuickPermissionModel) {
binding.tvQuickShareName.text = quickPermissionModel.permissionName
if (quickPermissionModel.isSelected) {
viewThemeUtils.platform.colorImageView(binding.tvQuickShareCheckIcon)
binding.tvQuickShareCheckIcon.visibility = View.VISIBLE
} else {
binding.tvQuickShareCheckIcon.visibility = View.INVISIBLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
Expand All @@ -27,6 +28,7 @@
import com.owncloud.android.ui.components.SendButtonData;
import com.owncloud.android.ui.helpers.FileOperationsHelper;
import com.owncloud.android.utils.MimeTypeUtil;
import com.owncloud.android.utils.theme.ThemeColorUtils;
import com.owncloud.android.utils.theme.ViewThemeUtils;

import java.util.ArrayList;
Expand Down Expand Up @@ -204,7 +206,10 @@ private void requestPasswordForShareViaLink() {
}

private void themeShareButtonImage(ImageView shareImageView) {
viewThemeUtils.files.themeAvatarButton(shareImageView);
shareImageView.getBackground().setColorFilter(requireContext().getResources().getColor(R.color.primary, null),
PorterDuff.Mode.SRC_IN);
shareImageView.getDrawable().mutate().setColorFilter(requireContext().getResources().getColor(R.color.white, null),
PorterDuff.Mode.SRC_IN);
}

private void showResharingNotAllowedSnackbar() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ class FileDetailsSharingProcessFragment :

private fun themeView() {
CheckableThemeUtils.tintSwitch(binding.shareProcessSetPasswordSwitch)
CheckableThemeUtils.tintSwitch(binding.shareProcessAllowResharingCheckbox)
CheckableThemeUtils.tintSwitch(binding.shareProcessSetExpDateSwitch)
CheckableThemeUtils.tintSwitch(binding.shareProcessHideDownloadCheckbox)
CheckableThemeUtils.tintSwitch(binding.shareProcessChangeNameSwitch)
Expand Down Expand Up @@ -616,27 +617,7 @@ class FileDetailsSharingProcessFragment :
private fun validateShareProcessFirst() {
// TODO: Hide keyboard after download limit PR merged by NC
//hideKeyboard()
//get the permissions on the basis of selection
when {
binding.shareProcessPermissionReadOnly.isChecked -> {
permission = OCShare.READ_PERMISSION_FLAG
}
binding.shareProcessPermissionUploadEditing.isChecked -> {
permission = if (file?.isFolder == true || share?.isFolder == true) {
SharingMenuHelper.CAN_EDIT_PERMISSIONS_FOR_FOLDER
} else {
SharingMenuHelper.CAN_EDIT_PERMISSIONS_FOR_FILE
}
}
binding.shareProcessPermissionFileDrop.isChecked -> {
permission = OCShare.CREATE_PERMISSION_FLAG
}
}

if (binding.shareProcessAllowResharingCheckbox.isChecked) {
permission = getResharePermission()
}

permission = getSelectedPermission()
if (permission == OCShare.NO_PERMISSION) {
DisplayUtils.showSnackMessage(binding.root, R.string.no_share_permission_selected)
return
Expand Down Expand Up @@ -680,8 +661,8 @@ class FileDetailsSharingProcessFragment :
binding.shareProcessAllowResharingCheckbox.isChecked -> getResharePermission()
binding.shareProcessPermissionReadOnly.isChecked -> OCShare.READ_PERMISSION_FLAG
binding.shareProcessPermissionUploadEditing.isChecked -> when {
file?.isFolder == true || share?.isFolder == true -> OCShare.MAXIMUM_PERMISSIONS_FOR_FOLDER
else -> OCShare.MAXIMUM_PERMISSIONS_FOR_FILE
file?.isFolder == true || share?.isFolder == true -> SharingMenuHelper.CAN_EDIT_PERMISSIONS_FOR_FOLDER
else -> SharingMenuHelper.CAN_EDIT_PERMISSIONS_FOR_FILE
}
binding.shareProcessPermissionFileDrop.isChecked -> OCShare.CREATE_PERMISSION_FLAG
else -> permission
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
android:layout_marginRight="@dimen/standard_margin"
android:autofillHints="password"
android:hint="@string/hint_password"
android:textColorHighlight="@color/et_highlight_color"
android:inputType="textPassword"
android:textColor="@color/share_txt_color"
android:textColorHint="@color/grey_60"
Expand Down Expand Up @@ -336,6 +337,7 @@
android:layout_marginRight="@dimen/standard_margin"
android:hint="@string/hint_link_label"
android:importantForAutofill="no"
android:textColorHighlight="@color/et_highlight_color"
android:inputType="textNoSuggestions|textCapSentences"
android:textColor="@color/share_txt_color"
android:textColorHint="@color/grey_60"
Expand Down Expand Up @@ -380,6 +382,7 @@
android:imeOptions="actionDone"
android:importantForAutofill="no"
android:inputType="number"
android:textColorHighlight="@color/et_highlight_color"
android:maxLength="18"
android:maxLines="1"
android:textColor="@color/share_txt_color"
Expand Down Expand Up @@ -528,7 +531,7 @@
android:layout_marginTop="@dimen/standard_margin"
android:layout_marginEnd="@dimen/standard_margin"
android:text="@string/common_next"
android:theme="@style/Button.Primary"
style="@style/Button.Primary"
app:cornerRadius="@dimen/button_corner_radius"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/share_process_btn_cancel"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@
android:layout_width="48dp"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/sharedMessage"
android:clickable="true"
android:layout_toEndOf="@id/sharedMessage"
android:contentDescription="@string/shared_icon_share"
android:focusable="true"
android:minHeight="@dimen/min_list_item_size"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/bottom_sheet_bg_color"
android:paddingTop="@dimen/standard_padding"
android:paddingBottom="@dimen/standard_padding"
android:orientation="vertical">
Expand Down
3 changes: 0 additions & 3 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="splash_image_size">116dp</dimen>
<dimen name="grid_recyclerview_padding">4dp</dimen>
<dimen name="list_item_icons_size">16dp</dimen>
<dimen name="grid_item_icons_size">24dp</dimen>
<dimen name="media_grid_item_rv_spacing">6dp</dimen>
<dimen name="txt_size_14sp">14sp</dimen>
<dimen name="txt_size_16sp">16sp</dimen>
<dimen name="txt_size_18sp">18sp</dimen>
<dimen name="txt_size_15sp">15sp</dimen>
<dimen name="crop_corner_size">15dp</dimen>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
<!-- Dialogs -->
<style name="Theme.ownCloud.Dialog" parent="@style/Theme.Material3.DayNight.Dialog.Alert">
<item name="windowNoTitle">false</item>
<item name="colorPrimary">@color/primary</item>
<item name="colorAccent">@color/color_accent</item>
<item name="android:textAllCaps">false</item>
<item name="textInputStyle">@style/Widget.App.TextInputLayout</item>
Expand Down

0 comments on commit 3f22acb

Please sign in to comment.