Merge branch 'Use_vector_drawables' into 'master'
Use vector drawables. See merge request fdroid/fdroidclient!946
@ -8,12 +8,6 @@ import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
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.cursoradapter.widget.CursorAdapter;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.ContextThemeWrapper;
|
||||
@ -26,6 +20,14 @@ import android.widget.CompoundButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.cursoradapter.widget.CursorAdapter;
|
||||
import androidx.loader.app.LoaderManager;
|
||||
import androidx.loader.content.CursorLoader;
|
||||
import androidx.loader.content.Loader;
|
||||
|
||||
import org.fdroid.fdroid.R;
|
||||
import org.fdroid.fdroid.data.InstalledAppProvider;
|
||||
import org.fdroid.fdroid.data.Schema.InstalledAppTable;
|
||||
@ -217,10 +219,10 @@ public class SelectAppsView extends SwapView implements LoaderManager.LoaderCall
|
||||
int resource;
|
||||
int colour;
|
||||
if (checked) {
|
||||
resource = R.drawable.ic_check_circle_white;
|
||||
resource = R.drawable.ic_check_circle;
|
||||
colour = getResources().getColor(R.color.swap_bright_blue);
|
||||
} else {
|
||||
resource = R.drawable.ic_add_circle_outline_white;
|
||||
resource = R.drawable.ic_add_circle_outline;
|
||||
colour = 0xFFD0D0D4;
|
||||
}
|
||||
imageView.setImageDrawable(getResources().getDrawable(resource));
|
||||
@ -228,5 +230,4 @@ public class SelectAppsView extends SwapView implements LoaderManager.LoaderCall
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,9 +7,6 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.net.wifi.WifiConfiguration;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
@ -22,7 +19,12 @@ import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import cc.mvdan.accesspoint.WifiApControl;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import org.fdroid.fdroid.FDroidApp;
|
||||
import org.fdroid.fdroid.R;
|
||||
import org.fdroid.fdroid.Utils;
|
||||
@ -30,6 +32,8 @@ import org.fdroid.fdroid.nearby.peers.Peer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import cc.mvdan.accesspoint.WifiApControl;
|
||||
|
||||
@SuppressWarnings("LineLength")
|
||||
public class StartSwapView extends SwapView {
|
||||
private static final String TAG = "StartSwapView";
|
||||
@ -67,7 +71,7 @@ public class StartSwapView extends SwapView {
|
||||
Peer peer = getItem(position);
|
||||
((TextView) convertView.findViewById(R.id.peer_name)).setText(peer.getName());
|
||||
((ImageView) convertView.findViewById(R.id.icon))
|
||||
.setImageDrawable(getResources().getDrawable(peer.getIcon()));
|
||||
.setImageDrawable(ContextCompat.getDrawable(getContext(), peer.getIcon()));
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
@ -17,17 +17,6 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.provider.Settings;
|
||||
import androidx.annotation.LayoutRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import androidx.core.view.MenuItemCompat;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
@ -45,9 +34,23 @@ import android.widget.ListView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import cc.mvdan.accesspoint.WifiApControl;
|
||||
|
||||
import androidx.annotation.LayoutRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.view.MenuItemCompat;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.google.zxing.integration.android.IntentIntegrator;
|
||||
import com.google.zxing.integration.android.IntentResult;
|
||||
|
||||
import org.fdroid.fdroid.BuildConfig;
|
||||
import org.fdroid.fdroid.FDroidApp;
|
||||
import org.fdroid.fdroid.NfcHelper;
|
||||
@ -75,6 +78,8 @@ import java.util.Set;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import cc.mvdan.accesspoint.WifiApControl;
|
||||
|
||||
import static org.fdroid.fdroid.views.main.MainActivity.ACTION_REQUEST_SWAP;
|
||||
|
||||
/**
|
||||
@ -955,19 +960,19 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
||||
if (TextUtils.isEmpty(FDroidApp.bssid) && !TextUtils.isEmpty(FDroidApp.ipAddressString)) {
|
||||
// empty bssid with an ipAddress means hotspot mode
|
||||
descriptionView.setText(R.string.swap_join_this_hotspot);
|
||||
wifiIcon.setImageDrawable(getResources().getDrawable(R.drawable.hotspot));
|
||||
wifiIcon.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_wifi_tethering));
|
||||
ssidView.setText(R.string.swap_active_hotspot);
|
||||
tapView.setText(R.string.swap_switch_to_wifi);
|
||||
} else if (TextUtils.isEmpty(FDroidApp.ssid)) {
|
||||
// not connected to or setup with any wifi network
|
||||
descriptionView.setText(R.string.swap_join_same_wifi);
|
||||
wifiIcon.setImageDrawable(getResources().getDrawable(R.drawable.wifi));
|
||||
wifiIcon.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_wifi));
|
||||
ssidView.setText(R.string.swap_no_wifi_network);
|
||||
tapView.setText(R.string.swap_view_available_networks);
|
||||
} else {
|
||||
// connected to a regular wifi network
|
||||
descriptionView.setText(R.string.swap_join_same_wifi);
|
||||
wifiIcon.setImageDrawable(getResources().getDrawable(R.drawable.wifi));
|
||||
wifiIcon.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_wifi));
|
||||
ssidView.setText(FDroidApp.ssid);
|
||||
tapView.setText(R.string.swap_view_available_networks);
|
||||
}
|
||||
|
@ -3,8 +3,10 @@ package org.fdroid.fdroid.nearby.peers;
|
||||
import android.bluetooth.BluetoothClass.Device;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.os.Parcel;
|
||||
import androidx.annotation.Nullable;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.fdroid.fdroid.R;
|
||||
|
||||
public class BluetoothPeer implements Peer {
|
||||
@ -44,7 +46,7 @@ public class BluetoothPeer implements Peer {
|
||||
|
||||
@Override
|
||||
public int getIcon() {
|
||||
return R.drawable.ic_bluetooth_white;
|
||||
return R.drawable.ic_bluetooth;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3,6 +3,7 @@ package org.fdroid.fdroid.nearby.peers;
|
||||
import android.net.Uri;
|
||||
import android.os.Parcel;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import org.fdroid.fdroid.R;
|
||||
import org.fdroid.fdroid.data.NewRepoConfig;
|
||||
|
||||
@ -62,7 +63,7 @@ public class WifiPeer implements Peer {
|
||||
|
||||
@Override
|
||||
public int getIcon() {
|
||||
return R.drawable.ic_network_wifi_white;
|
||||
return R.drawable.ic_network_wifi;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -13,20 +13,19 @@ import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.TypedValue;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.preference.CheckBoxPreference;
|
||||
import androidx.preference.ListPreference;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceCategory;
|
||||
import androidx.preference.PreferenceFragmentCompat;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.TypedValue;
|
||||
import info.guardianproject.panic.Panic;
|
||||
import info.guardianproject.panic.PanicResponder;
|
||||
import org.fdroid.fdroid.Preferences;
|
||||
import org.fdroid.fdroid.R;
|
||||
import org.fdroid.fdroid.installer.PrivilegedInstaller;
|
||||
@ -34,6 +33,9 @@ import org.fdroid.fdroid.installer.PrivilegedInstaller;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Set;
|
||||
|
||||
import info.guardianproject.panic.Panic;
|
||||
import info.guardianproject.panic.PanicResponder;
|
||||
|
||||
public class PanicPreferencesFragment extends PreferenceFragmentCompat
|
||||
implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
|
||||
@ -130,9 +132,9 @@ public class PanicPreferencesFragment extends PreferenceFragmentCompat
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Preference preference = new Preference(getActivity());
|
||||
Preference preference = new Preference(requireActivity());
|
||||
preference.setIntent(intent);
|
||||
Drawable icon = getResources().getDrawable(R.drawable.ic_add_circle_outline_white);
|
||||
Drawable icon = ContextCompat.getDrawable(requireContext(), R.drawable.ic_add_circle_outline);
|
||||
icon.setColorFilter(new LightingColorFilter(0, getResources().getColor(R.color.swap_light_grey_icon)));
|
||||
preference.setSingleLineTitle(true);
|
||||
preference.setTitle(R.string.panic_add_apps_to_uninstall);
|
||||
|
Before Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 899 B |
Before Width: | Height: | Size: 186 B |
Before Width: | Height: | Size: 283 B |
Before Width: | Height: | Size: 703 B |
Before Width: | Height: | Size: 701 B |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 783 B |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 623 B |
Before Width: | Height: | Size: 148 B |
Before Width: | Height: | Size: 207 B |
Before Width: | Height: | Size: 483 B |
Before Width: | Height: | Size: 486 B |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 220 B |
Before Width: | Height: | Size: 311 B |
Before Width: | Height: | Size: 906 B |
Before Width: | Height: | Size: 926 B |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 283 B |
Before Width: | Height: | Size: 455 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 368 B |
Before Width: | Height: | Size: 532 B |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB |
5
app/src/full/res/drawable/ic_add_circle_outline.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<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="M13,7h-2v4L7,11v2h4v4h2v-4h4v-2h-4L13,7zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
|
||||
</vector>
|
5
app/src/full/res/drawable/ic_arrow_forward.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<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="M12,4l-1.41,1.41L16.17,11H4v2h12.17l-5.58,5.59L12,20l8,-8z"/>
|
||||
</vector>
|
5
app/src/full/res/drawable/ic_bluetooth.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<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="M17.71,7.71L12,2h-1v7.59L6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 11,14.41L11,22h1l5.71,-5.71 -4.3,-4.29 4.3,-4.29zM13,5.83l1.88,1.88L13,9.59L13,5.83zM14.88,16.29L13,18.17v-3.76l1.88,1.88z"/>
|
||||
</vector>
|
5
app/src/full/res/drawable/ic_check_circle.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<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="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM10,17l-5,-5 1.41,-1.41L10,14.17l7.59,-7.59L19,8l-9,9z"/>
|
||||
</vector>
|
5
app/src/full/res/drawable/ic_network_wifi.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<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="M12.01,21.49L23.64,7c-0.45,-0.34 -4.93,-4 -11.64,-4C5.28,3 0.81,6.66 0.36,7l11.63,14.49 0.01,0.01 0.01,-0.01z"/>
|
||||
</vector>
|
5
app/src/full/res/drawable/ic_wifi.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<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="M1,9l2,2c4.97,-4.97 13.03,-4.97 18,0l2,-2C16.93,2.93 7.08,2.93 1,9zM9,17l3,3 3,-3c-1.65,-1.66 -4.34,-1.66 -6,0zM5,13l2,2c2.76,-2.76 7.24,-2.76 10,0l2,-2C15.14,9.14 8.87,9.14 5,13z"/>
|
||||
</vector>
|
5
app/src/full/res/drawable/ic_wifi_tethering.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<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="M12,11c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,13c0,-3.31 -2.69,-6 -6,-6s-6,2.69 -6,6c0,2.22 1.21,4.15 3,5.19l1,-1.74c-1.19,-0.7 -2,-1.97 -2,-3.45 0,-2.21 1.79,-4 4,-4s4,1.79 4,4c0,1.48 -0.81,2.75 -2,3.45l1,1.74c1.79,-1.04 3,-2.97 3,-5.19zM12,3C6.48,3 2,7.48 2,13c0,3.7 2.01,6.92 4.99,8.65l1,-1.73C5.61,18.53 4,15.96 4,13c0,-4.42 3.58,-8 8,-8s8,3.58 8,8c0,2.96 -1.61,5.53 -4,6.92l1,1.73c2.99,-1.73 5,-4.95 5,-8.65 0,-5.52 -4.48,-10 -10,-10z"/>
|
||||
</vector>
|
@ -43,7 +43,7 @@
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
tools:suppress="InconsistentLayout"
|
||||
android:src="@drawable/ic_add_circle_outline_white" />
|
||||
android:src="@drawable/ic_add_circle_outline" />
|
||||
|
||||
<TwoLineListItem
|
||||
android:layout_toRightOf="@android:id/icon"
|
||||
|
@ -39,7 +39,7 @@
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
tools:suppress="InconsistentLayout"
|
||||
android:src="@drawable/ic_add_circle_outline_white" />
|
||||
android:src="@drawable/ic_add_circle_outline" />
|
||||
|
||||
<TwoLineListItem
|
||||
android:layout_toEndOf="@android:id/icon"
|
||||
|
@ -25,7 +25,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/wifi_icon"
|
||||
android:src="@drawable/wifi"
|
||||
android:src="@drawable/ic_wifi"
|
||||
android:layout_below="@+id/text_description"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_centerInParent="true"
|
||||
tools:src="@drawable/ic_bluetooth_white"/>
|
||||
tools:src="@drawable/ic_bluetooth"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
android:layout_height="24dp"
|
||||
android:tint="@color/swap_grey_icon"
|
||||
android:contentDescription="@string/use_bluetooth"
|
||||
android:src="@drawable/ic_bluetooth_white"/>
|
||||
android:src="@drawable/ic_bluetooth"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
@ -76,7 +76,7 @@
|
||||
android:layout_height="24dp"
|
||||
android:tint="@color/swap_grey_icon"
|
||||
android:contentDescription="@string/wifi"
|
||||
android:src="@drawable/ic_network_wifi_white"/>
|
||||
android:src="@drawable/ic_network_wifi"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<item
|
||||
android:id="@+id/action_next"
|
||||
android:icon="@drawable/ic_arrow_forward_white"
|
||||
android:icon="@drawable/ic_arrow_forward"
|
||||
android:title="@string/next"
|
||||
android:titleCondensed="@string/next"/>
|
||||
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
<item
|
||||
android:id="@+id/action_search"
|
||||
android:icon="@drawable/ic_search_white"
|
||||
android:icon="@drawable/ic_search"
|
||||
android:title="@string/menu_search"
|
||||
android:titleCondensed="@string/menu_search"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_next"
|
||||
android:icon="@drawable/ic_arrow_forward_white"
|
||||
android:icon="@drawable/ic_arrow_forward"
|
||||
android:title="@string/next"
|
||||
android:titleCondensed="@string/next"/>
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<item
|
||||
android:id="@+id/action_search"
|
||||
android:icon="@drawable/ic_search_white"
|
||||
android:icon="@drawable/ic_search"
|
||||
android:title="@string/menu_search"
|
||||
android:titleCondensed="@string/menu_search"/>
|
||||
|
||||
|
@ -34,13 +34,14 @@ import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Process;
|
||||
import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.app.JobIntentService;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.fdroid.fdroid.data.Apk;
|
||||
import org.fdroid.fdroid.data.ApkProvider;
|
||||
@ -259,7 +260,7 @@ public class UpdateService extends JobIntentService {
|
||||
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
notificationBuilder = new NotificationCompat.Builder(this, NotificationHelper.CHANNEL_UPDATES)
|
||||
.setSmallIcon(R.drawable.ic_refresh_white)
|
||||
.setSmallIcon(R.drawable.ic_refresh)
|
||||
.setOngoing(true)
|
||||
.setCategory(NotificationCompat.CATEGORY_SERVICE)
|
||||
.setContentTitle(getString(R.string.update_notification_title));
|
||||
|
@ -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);
|
||||
final Drawable expandMore = ContextCompat.getDrawable(headerView.getContext(), R.drawable.ic_expand_more);
|
||||
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
|
||||
@ -956,7 +975,7 @@ public class AppDetailsRecyclerViewAdapter
|
||||
|
||||
@DrawableRes
|
||||
protected int getIcon() {
|
||||
return R.drawable.ic_lock_24dp_grey600;
|
||||
return R.drawable.ic_lock;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1004,7 +1023,7 @@ public class AppDetailsRecyclerViewAdapter
|
||||
|
||||
// Issues button
|
||||
if (uriIsSetAndCanBeOpened(app.issueTracker)) {
|
||||
addLinkItemView(contentView, R.string.menu_issues, R.drawable.ic_issues, app.issueTracker);
|
||||
addLinkItemView(contentView, R.string.menu_issues, R.drawable.ic_error, app.issueTracker);
|
||||
}
|
||||
|
||||
// Translation button
|
||||
@ -1281,7 +1300,7 @@ public class AppDetailsRecyclerViewAdapter
|
||||
expandedLayout.setVisibility(expand ? View.VISIBLE : View.GONE);
|
||||
versionCode.setVisibility(expand ? View.VISIBLE : View.GONE);
|
||||
expandArrow.setImageDrawable(ContextCompat.getDrawable(context, expand ?
|
||||
R.drawable.ic_expand_less_grey600 : R.drawable.ic_expand_more_grey600));
|
||||
R.drawable.ic_expand_less : R.drawable.ic_expand_more));
|
||||
|
||||
// This is required to make these labels
|
||||
// auto-scrollable when they are too long
|
||||
|
@ -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,28 +108,22 @@ 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) {
|
||||
if (sortClauseSelected.equalsIgnoreCase(SortClause.LAST_UPDATED)) {
|
||||
sortClauseSelected = SortClause.NAME;
|
||||
if (FDroidApp.isAppThemeLight()) {
|
||||
sortImage.setImageResource(R.drawable.ic_az_black);
|
||||
} else {
|
||||
sortImage.setImageResource(R.drawable.ic_az_white);
|
||||
}
|
||||
final Drawable alphabetical = DrawableCompat.wrap(
|
||||
ContextCompat.getDrawable(AppListActivity.this, R.drawable.ic_sort_by_alpha)).mutate();
|
||||
DrawableCompat.setTint(alphabetical, FDroidApp.isAppThemeLight() ? Color.BLACK : Color.WHITE);
|
||||
sortImage.setImageDrawable(alphabetical);
|
||||
} 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: 124 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 370 B |
Before Width: | Height: | Size: 155 B |
Before Width: | Height: | Size: 466 B |
Before Width: | Height: | Size: 484 B |
Before Width: | Height: | Size: 427 B |
Before Width: | Height: | Size: 151 B |
Before Width: | Height: | Size: 152 B |
Before Width: | Height: | Size: 364 B |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 294 B |
Before Width: | Height: | Size: 206 B |
Before Width: | Height: | Size: 366 B |
Before Width: | Height: | Size: 372 B |
Before Width: | Height: | Size: 381 B |
Before Width: | Height: | Size: 291 B |
Before Width: | Height: | Size: 505 B |
Before Width: | Height: | Size: 368 B |
Before Width: | Height: | Size: 93 B |
Before Width: | Height: | Size: 746 B |
Before Width: | Height: | Size: 742 B |
Before Width: | Height: | Size: 265 B |
Before Width: | Height: | Size: 112 B |
Before Width: | Height: | Size: 314 B |
Before Width: | Height: | Size: 360 B |
Before Width: | Height: | Size: 290 B |
Before Width: | Height: | Size: 128 B |
Before Width: | Height: | Size: 126 B |
Before Width: | Height: | Size: 259 B |
Before Width: | Height: | Size: 962 B |
Before Width: | Height: | Size: 1018 B |
Before Width: | Height: | Size: 199 B |
Before Width: | Height: | Size: 155 B |
Before Width: | Height: | Size: 249 B |
Before Width: | Height: | Size: 246 B |
Before Width: | Height: | Size: 778 B |
Before Width: | Height: | Size: 277 B |
Before Width: | Height: | Size: 373 B |
Before Width: | Height: | Size: 714 B |
Before Width: | Height: | Size: 97 B |