Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b6408ca4 authored by Jason Monk's avatar Jason Monk Committed by Android (Google) Code Review
Browse files

Merge "Change drag label while dragging QS tiles" into nyc-dev

parents c049cb92 24dbd51b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1432,6 +1432,9 @@
    <!-- Label for area where tiles can be dragged out of [CHAR LIMIT=60] -->
    <string name="drag_to_add_tiles">Drag to add tiles</string>

    <!-- Label for area where tiles can be dragged in to [CHAR LIMIT=60] -->
    <string name="drag_to_remove_tiles">Drag here to remove</string>

    <!-- Button to edit the tile ordering of quick settings [CHAR LIMIT=60] -->
    <string name="qs_edit">Edit</string>

+9 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TextView;
import com.android.systemui.R;
import com.android.systemui.qs.QSIconView;
import com.android.systemui.qs.QSTileView;
@@ -153,7 +154,12 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta

    @Override
    public void onBindViewHolder(final Holder holder, int position) {
        if (holder.getItemViewType() == TYPE_EDIT) return;
        if (holder.getItemViewType() == TYPE_EDIT) {
            ((TextView) holder.itemView.findViewById(android.R.id.title)).setText(
                    mCurrentDrag != null ? R.string.drag_to_remove_tiles
                    : R.string.drag_to_add_tiles);
            return;
        }

        TileInfo info = mTiles.get(position);
        holder.mTileView.onStateChanged(info.state);
@@ -250,11 +256,13 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
            super.onSelectedChanged(viewHolder, actionState);
            if (mCurrentDrag != null) {
                mCurrentDrag.stopDrag();
                mCurrentDrag = null;
            }
            if (viewHolder != null) {
                mCurrentDrag = (Holder) viewHolder;
                mCurrentDrag.startDrag();
            }
            notifyItemChanged(mDividerIndex);
        }

        @Override