use check arrow for chosen account

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2020-06-08 10:03:38 +02:00
parent 8cec637c24
commit ec12ad56d4
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7
5 changed files with 8 additions and 32 deletions

View file

@ -96,7 +96,6 @@ class ChooseAccountDialogFragment : DialogFragment(), AvatarGenerationListener,
val adapter = UserListAdapter(activity as BaseActivity,
accountManager,
getAccountListItems(),
null,
this,
false,
false)

View file

@ -32,7 +32,6 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
@ -74,8 +73,6 @@ import javax.inject.Inject;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.PopupMenu;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
@ -108,7 +105,6 @@ public class ManageAccountsActivity extends FileActivity implements UserListAdap
private ServiceConnection uploadServiceConnection;
private Set<String> originalUsers;
private String originalCurrentUser;
private Drawable tintedCheck;
private ArbitraryDataProvider arbitraryDataProvider;
private boolean multipleAccountsSupported;
@ -120,10 +116,6 @@ public class ManageAccountsActivity extends FileActivity implements UserListAdap
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
tintedCheck = DrawableCompat.wrap(ContextCompat.getDrawable(this, R.drawable.account_circle_white));
int tint = ThemeUtils.elementColor(this);
DrawableCompat.setTint(tintedCheck, tint);
setContentView(R.layout.accounts_layout);
recyclerView = findViewById(R.id.account_list);
@ -158,7 +150,6 @@ public class ManageAccountsActivity extends FileActivity implements UserListAdap
userListAdapter = new UserListAdapter(this,
accountManager,
getUserListItems(),
tintedCheck,
this,
multipleAccountsSupported, true);
@ -306,7 +297,6 @@ public class ManageAccountsActivity extends FileActivity implements UserListAdap
this,
accountManager,
getUserListItems(),
tintedCheck,
this,
multipleAccountsSupported, false);
recyclerView.setAdapter(userListAdapter);
@ -358,7 +348,6 @@ public class ManageAccountsActivity extends FileActivity implements UserListAdap
userListAdapter = new UserListAdapter(this,
accountManager,
userListItemArray,
tintedCheck,
this,
multipleAccountsSupported, false);
recyclerView.setAdapter(userListAdapter);

View file

@ -60,7 +60,6 @@ public class UserListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
private final BaseActivity context;
private List<UserListItem> values;
private Listener accountListAdapterListener;
private Drawable tintedCheck;
private UserAccountManager accountManager;
public static final String KEY_DISPLAY_NAME = "DISPLAY_NAME";
@ -72,7 +71,6 @@ public class UserListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
public UserListAdapter(BaseActivity context,
UserAccountManager accountManager,
List<UserListItem> values,
Drawable tintedCheck,
ClickListener clickListener,
boolean showAddAccount,
boolean showDotsMenu) {
@ -83,7 +81,6 @@ public class UserListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
this.accountListAdapterListener = (Listener) context;
}
this.accountAvatarRadiusDimension = context.getResources().getDimension(R.dimen.list_item_avatar_icon_radius);
this.tintedCheck = tintedCheck;
this.clickListener = clickListener;
this.showAddAccount = showAddAccount;
this.showDotsMenu = showDotsMenu;
@ -103,9 +100,7 @@ public class UserListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
View view;
if (UserListItem.TYPE_ACCOUNT == viewType) {
view = LayoutInflater.from(context).inflate(R.layout.account_item, parent, false);
AccountViewHolderItem viewHolder = new AccountViewHolderItem(view);
viewHolder.checkViewItem.setImageDrawable(tintedCheck);
return viewHolder;
return new AccountViewHolderItem(view);
} else {
view = LayoutInflater.from(context).inflate(R.layout.account_action, parent, false);
return new AddAccountViewHolderItem(view);
@ -301,10 +296,12 @@ public class UserListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
AccountViewHolderItem(@NonNull View view) {
super(view);
this.imageViewItem = view.findViewById(R.id.user_icon);
this.checkViewItem = view.findViewById(R.id.ticker);
this.usernameViewItem = view.findViewById(R.id.user_name);
this.accountViewItem = view.findViewById(R.id.account);
imageViewItem = view.findViewById(R.id.user_icon);
checkViewItem = view.findViewById(R.id.ticker);
ThemeUtils.tintDrawable(checkViewItem.getDrawable(), ThemeUtils.primaryColor(context, true));
usernameViewItem = view.findViewById(R.id.user_name);
accountViewItem = view.findViewById(R.id.account);
ImageView accountMenu = view.findViewById(R.id.account_menu);
view.setOnClickListener(this);

View file

@ -29,7 +29,6 @@ package com.owncloud.android.ui.dialog;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
@ -52,8 +51,6 @@ import javax.inject.Inject;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.fragment.app.DialogFragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
@ -85,15 +82,9 @@ public class MultipleAccountsDialog extends DialogFragment implements Injectable
final ReceiveExternalFilesActivity parent = (ReceiveExternalFilesActivity) getActivity();
AlertDialog.Builder builder = new AlertDialog.Builder(parent);
Drawable tintedCheck = DrawableCompat.wrap(ContextCompat.getDrawable(parent, R.drawable.account_circle_white));
int tint = ThemeUtils.primaryColor(getContext());
DrawableCompat.setTint(tintedCheck, tint);
UserListAdapter adapter = new UserListAdapter(parent,
accountManager,
getAccountListItems(),
tintedCheck,
this,
false,
false);

View file

@ -61,7 +61,7 @@
android:layout_gravity="bottom|end"
android:background="@drawable/round_bgnd"
android:contentDescription="@string/active_user"
android:src="@drawable/account_circle_white" />
android:src="@drawable/ic_check_circle" />
</FrameLayout>