Replace access time and last updated PNGs with a vector drawable.
@ -6,7 +6,9 @@ import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.text.Html;
|
||||
@ -28,12 +30,14 @@ import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.LayoutRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.FileProvider;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.core.os.ConfigurationCompat;
|
||||
import androidx.core.os.LocaleListCompat;
|
||||
import androidx.core.view.ViewCompat;
|
||||
@ -42,6 +46,7 @@ import androidx.gridlayout.widget.GridLayout;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearSmoothScroller;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.fdroid.fdroid.Preferences;
|
||||
import org.fdroid.fdroid.R;
|
||||
@ -830,7 +835,17 @@ public class AppDetailsRecyclerViewAdapter
|
||||
* user can expand/collapse this item.
|
||||
*/
|
||||
protected void updateExpandableItem(boolean isExpanded) {
|
||||
TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(headerView, getIcon(), 0, isExpanded ? R.drawable.ic_expand_less_grey600 : R.drawable.ic_expand_more_grey600, 0);
|
||||
final int icon = getIcon();
|
||||
Drawable iconDrawable = ContextCompat.getDrawable(headerView.getContext(), icon);
|
||||
if (icon == R.drawable.ic_access_time) {
|
||||
assert iconDrawable != null;
|
||||
iconDrawable = DrawableCompat.wrap(iconDrawable).mutate();
|
||||
DrawableCompat.setTint(iconDrawable, Color.parseColor("#B4B4B4"));
|
||||
}
|
||||
final Drawable expandLess = ContextCompat.getDrawable(headerView.getContext(), R.drawable.ic_expand_less_grey600);
|
||||
final Drawable expandMore = ContextCompat.getDrawable(headerView.getContext(), R.drawable.ic_expand_more_grey600);
|
||||
TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(headerView,
|
||||
iconDrawable, null, isExpanded ? expandLess : expandMore, null);
|
||||
}
|
||||
}
|
||||
|
||||
@ -855,7 +870,7 @@ public class AppDetailsRecyclerViewAdapter
|
||||
|
||||
@DrawableRes
|
||||
protected int getIcon() {
|
||||
return R.drawable.ic_access_time_24dp_grey600;
|
||||
return R.drawable.ic_access_time;
|
||||
}
|
||||
}
|
||||
|
||||
@ -865,7 +880,11 @@ public class AppDetailsRecyclerViewAdapter
|
||||
NoVersionsViewHolder(View view) {
|
||||
super(view);
|
||||
headerView = (TextView) view.findViewById(R.id.information);
|
||||
TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(headerView, R.drawable.ic_access_time_24dp_grey600, 0, 0, 0);
|
||||
final Drawable accessTime = DrawableCompat.wrap(ContextCompat.getDrawable(headerView.getContext(),
|
||||
R.drawable.ic_access_time)).mutate();
|
||||
DrawableCompat.setTint(accessTime, Color.parseColor("#B4B4B4"));
|
||||
TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(headerView,
|
||||
accessTime, null, null, null);
|
||||
|
||||
itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
@ -23,15 +23,9 @@ package org.fdroid.fdroid.views.apps;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.loader.app.LoaderManager;
|
||||
import androidx.loader.content.CursorLoader;
|
||||
import androidx.loader.content.Loader;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
@ -39,7 +33,20 @@ import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.loader.app.LoaderManager;
|
||||
import androidx.loader.content.CursorLoader;
|
||||
import androidx.loader.content.Loader;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.nostra13.universalimageloader.core.ImageLoader;
|
||||
|
||||
import org.fdroid.fdroid.FDroidApp;
|
||||
import org.fdroid.fdroid.R;
|
||||
import org.fdroid.fdroid.Utils;
|
||||
@ -101,11 +108,10 @@ public class AppListActivity extends AppCompatActivity implements LoaderManager.
|
||||
});
|
||||
|
||||
sortImage = (ImageView) findViewById(R.id.sort);
|
||||
if (FDroidApp.isAppThemeLight()) {
|
||||
sortImage.setImageResource(R.drawable.ic_last_updated_black);
|
||||
} else {
|
||||
sortImage.setImageResource(R.drawable.ic_last_updated_white);
|
||||
}
|
||||
final Drawable lastUpdated = DrawableCompat.wrap(ContextCompat.getDrawable(this,
|
||||
R.drawable.ic_access_time)).mutate();
|
||||
DrawableCompat.setTint(lastUpdated, FDroidApp.isAppThemeLight() ? Color.BLACK : Color.WHITE);
|
||||
sortImage.setImageDrawable(lastUpdated);
|
||||
sortImage.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
@ -118,11 +124,7 @@ public class AppListActivity extends AppCompatActivity implements LoaderManager.
|
||||
}
|
||||
} else {
|
||||
sortClauseSelected = SortClause.LAST_UPDATED;
|
||||
if (FDroidApp.isAppThemeLight()) {
|
||||
sortImage.setImageResource(R.drawable.ic_last_updated_black);
|
||||
} else {
|
||||
sortImage.setImageResource(R.drawable.ic_last_updated_white);
|
||||
}
|
||||
sortImage.setImageDrawable(lastUpdated);
|
||||
}
|
||||
getSupportLoaderManager().restartLoader(0, null, AppListActivity.this);
|
||||
appView.scrollToPosition(0);
|
||||
|
Before Width: | Height: | Size: 555 B |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 368 B |
Before Width: | Height: | Size: 962 B |
Before Width: | Height: | Size: 1018 B |
Before Width: | Height: | Size: 714 B |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 5.9 KiB |
6
app/src/main/res/drawable/ic_access_time.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FFFFFF" android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z"/>
|
||||
<path android:fillColor="#FFFFFF" android:pathData="M12.5,7H11v6l5.25,3.15 0.75,-1.23 -4.5,-2.67z"/>
|
||||
</vector>
|