diff --git a/app/src/main/java/com/topjohnwu/magisk/model/adapters/StringListAdapter.java b/app/src/main/java/com/topjohnwu/magisk/model/adapters/StringListAdapter.java deleted file mode 100644 index b76064220..000000000 --- a/app/src/main/java/com/topjohnwu/magisk/model/adapters/StringListAdapter.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.topjohnwu.magisk.model.adapters; - -import android.app.Activity; -import android.util.DisplayMetrics; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.TextView; - -import java.util.List; - -import androidx.annotation.IdRes; -import androidx.annotation.LayoutRes; -import androidx.annotation.NonNull; -import androidx.recyclerview.widget.RecyclerView; - -public abstract class StringListAdapter - extends RecyclerView.Adapter { - - private RecyclerView rv; - private boolean dynamic; - private int screenWidth; - private int txtWidth = -1; - private int padding; - - protected List mList; - - public StringListAdapter(List list) { - this(list, false); - } - - public StringListAdapter(List list, boolean isDynamic) { - mList = list; - dynamic = isDynamic; - } - - @NonNull - @Override - public final VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { - View v = LayoutInflater.from(parent.getContext()).inflate(itemLayoutRes(), parent, false); - VH vh = createViewHolder(v); - if (txtWidth < 0) - onUpdateTextWidth(vh); - return vh; - } - - @Override - public void onBindViewHolder(@NonNull VH holder, int position) { - holder.txt.setText(mList.get(position)); - holder.txt.getLayoutParams().width = txtWidth; - if (dynamic) - onUpdateTextWidth(holder); - } - - protected void onUpdateTextWidth(VH vh) { - if (txtWidth < 0) { - txtWidth = screenWidth - padding; - } else { - vh.txt.measure(0, 0); - int width = vh.txt.getMeasuredWidth(); - if (width > txtWidth) { - txtWidth = width; - vh.txt.getLayoutParams().width = txtWidth; - } - } - if (rv.getWidth() != txtWidth + padding) - rv.requestLayout(); - } - - @Override - public void onAttachedToRecyclerView(@NonNull RecyclerView rv) { - DisplayMetrics displayMetrics = new DisplayMetrics(); - ((Activity) rv.getContext()).getWindowManager() - .getDefaultDisplay().getMetrics(displayMetrics); - screenWidth = displayMetrics.widthPixels; - padding = rv.getPaddingStart() + rv.getPaddingEnd(); - this.rv = rv; - } - - @Override - public final int getItemCount() { - return mList.size(); - } - - @LayoutRes - protected abstract int itemLayoutRes(); - - @NonNull - public abstract VH createViewHolder(@NonNull View v); - - public static abstract class ViewHolder extends RecyclerView.ViewHolder { - - public TextView txt; - - public ViewHolder(@NonNull View itemView) { - super(itemView); - txt = itemView.findViewById(textViewResId()); - } - - @IdRes - protected abstract int textViewResId(); - } -} diff --git a/app/src/main/java/com/topjohnwu/magisk/view/ArrowExpandable.java b/app/src/main/java/com/topjohnwu/magisk/view/ArrowExpandable.java deleted file mode 100644 index 81478cddd..000000000 --- a/app/src/main/java/com/topjohnwu/magisk/view/ArrowExpandable.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.topjohnwu.magisk.view; - -import android.view.View; -import android.view.animation.Animation; -import android.view.animation.RotateAnimation; - -public class ArrowExpandable extends Expandable { - protected Expandable mBase; - private View arrow; - - public ArrowExpandable(Expandable base, View arrow) { - mBase = base; - this.arrow = arrow; - } - - @Override - public void onExpand() { - mBase.onExpand(); - setRotate(new RotateAnimation(0, 180, - Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f)); - } - - @Override - public void onCollapse() { - mBase.onCollapse(); - setRotate(new RotateAnimation(180, 0, - Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f)); - } - - @Override - public void onSetExpanded(boolean expanded) { - mBase.onSetExpanded(expanded); - if (arrow != null) - arrow.setRotation(expanded ? 180 : 0); - } - - private void setRotate(RotateAnimation rotate) { - rotate.setDuration(300); - rotate.setFillAfter(true); - arrow.startAnimation(rotate); - } -} diff --git a/app/src/main/java/com/topjohnwu/magisk/view/UpdateCardHolder.java b/app/src/main/java/com/topjohnwu/magisk/view/UpdateCardHolder.java deleted file mode 100644 index 3e657e458..000000000 --- a/app/src/main/java/com/topjohnwu/magisk/view/UpdateCardHolder.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.topjohnwu.magisk.view; - -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.Button; -import android.widget.ImageView; -import android.widget.ProgressBar; -import android.widget.TextView; - -import com.topjohnwu.magisk.R; - -import butterknife.BindView; -import butterknife.Unbinder; - -public class UpdateCardHolder { - - @BindView(R.id.status_icon) public ImageView statusIcon; - @BindView(R.id.progress) public ProgressBar progress; - @BindView(R.id.status) public TextView status; - @BindView(R.id.current_version) public TextView currentVersion; - @BindView(R.id.latest_version) public TextView latestVersion; - @BindView(R.id.additional) public TextView additional; - @BindView(R.id.install) public Button install; - - public View itemView; - public Unbinder unbinder; - - public UpdateCardHolder(LayoutInflater inflater, ViewGroup root) { - itemView = inflater.inflate(R.layout.update_card, root, false); - unbinder = new UpdateCardHolder_ViewBinding(this, itemView); - } - - public void setClickable(View.OnClickListener listener) { - itemView.setClickable(true); - itemView.setFocusable(true); - itemView.setOnClickListener(listener); - } - - public void setValid(boolean valid) { - progress.setVisibility(View.GONE); - statusIcon.setVisibility(View.VISIBLE); - if (valid) { - install.setVisibility(View.VISIBLE); - latestVersion.setVisibility(View.VISIBLE); - } else { - install.setVisibility(View.GONE); - latestVersion.setVisibility(View.GONE); - } - } - - public void reset() { - progress.setVisibility(View.VISIBLE); - statusIcon.setVisibility(View.INVISIBLE); - latestVersion.setVisibility(View.GONE); - install.setVisibility(View.GONE); - status.setText(R.string.checking_for_updates); - } -} diff --git a/app/src/main/res/layout/list_item_console.xml b/app/src/main/res/layout/list_item_console.xml deleted file mode 100644 index 14e132c3a..000000000 --- a/app/src/main/res/layout/list_item_console.xml +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/app/src/main/res/layout/list_item_hide_app.xml b/app/src/main/res/layout/list_item_hide_app.xml deleted file mode 100644 index 6bf54d091..000000000 --- a/app/src/main/res/layout/list_item_hide_app.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/list_item_hide_process.xml b/app/src/main/res/layout/list_item_hide_process.xml deleted file mode 100644 index d3dbd0095..000000000 --- a/app/src/main/res/layout/list_item_hide_process.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/list_item_module.xml b/app/src/main/res/layout/list_item_module.xml deleted file mode 100644 index cc82443c7..000000000 --- a/app/src/main/res/layout/list_item_module.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/list_item_policy.xml b/app/src/main/res/layout/list_item_policy.xml deleted file mode 100644 index 6830c1e04..000000000 --- a/app/src/main/res/layout/list_item_policy.xml +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/list_item_repo.xml b/app/src/main/res/layout/list_item_repo.xml deleted file mode 100644 index aa50b056d..000000000 --- a/app/src/main/res/layout/list_item_repo.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/list_item_sulog.xml b/app/src/main/res/layout/list_item_sulog.xml deleted file mode 100644 index 5df989cf1..000000000 --- a/app/src/main/res/layout/list_item_sulog.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/list_item_sulog_group.xml b/app/src/main/res/layout/list_item_sulog_group.xml deleted file mode 100644 index baffe09be..000000000 --- a/app/src/main/res/layout/list_item_sulog_group.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - \ No newline at end of file