import android.content.Context;
import android.content.Intent;
-import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.util.Log;
import android.view.LayoutInflater;
public void onAttachedToRecyclerView(@NonNull RecyclerView recyclerView) {
super.onAttachedToRecyclerView(recyclerView);
this.recyclerView = recyclerView;
- rearrangeHelper.attachToRecyclerView(recyclerView);
+ if (editingProfiles) rearrangeHelper.attachToRecyclerView(recyclerView);
}
public boolean editingProfiles() {
return this.editingProfiles;
final boolean sameProfile = currentProfile.equals(myProfile);
view.setAlpha(sameProfile ? 1 : 0.5f);
});
+
+ holder.mRearrangeHandle.setOnTouchListener((v, event) -> {
+ rearrangeHelper.startDrag(holder);
+ return true;
+ });
return holder;
}
@Override
holder.itemView.setTag(profile);
int hue = profile.getThemeId();
- if (hue == -1) holder.mColorTag.setBackgroundColor(Color.TRANSPARENT);
+ if (hue == -1) holder.mColorTag
+ .setBackgroundColor(Colors.getPrimaryColorForHue(Colors.DEFAULT_HUE_DEG));
else holder.mColorTag.setBackgroundColor(Colors.getPrimaryColorForHue(hue));
holder.mTitle.setText(profile.getName());
final boolean sameProfile = currentProfile.equals(profile);
holder.itemView.setAlpha(sameProfile ? 1 : 0.5f);
holder.itemView
- .setBackground(sameProfile ? new ColorDrawable(Colors.tableRowLightBG) : null);
+ .setBackground(sameProfile ? new ColorDrawable(Colors.tableRowDarkBG) : null);
if (editingProfiles) {
holder.mRearrangeHandle.setVisibility(View.VISIBLE);
holder.mEditButton.setVisibility(View.VISIBLE);