Skip to content

Commit

Permalink
Fixed issue with notification on 2.3 android devices.
Browse files Browse the repository at this point in the history
Fixed ignore app background issue in 2.3 android devices.
Changed SwitchPreference to CheckboxPreference in android devices below api 14.
  • Loading branch information
rumboalla committed Aug 28, 2016
1 parent d7ff8af commit a0478c8
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ private void createNotification(
mNotificationBuilder = new NotificationCompat.Builder(mContext);
mNotificationBuilder.setContentTitle(mContext.getString(R.string.notification_update_title));
mNotificationBuilder.setSmallIcon(R.drawable.ic_update_white_24dp);
mNotificationManager.notify(42, mNotificationBuilder.build());
mNotificationBuilder.setContentIntent(createPendingIntent());
mNotificationBuilder.setAutoCancel(true);
mNotificationBuilder.setLargeIcon(BitmapFactory.decodeResource(mContext.getResources(), R.mipmap.ic_launcher));
mNotificationManager.notify(42, mNotificationBuilder.build());
updateNotification(mMaxApps, 0);
}

Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/com/apkupdater/view/InstalledAppView.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,14 @@ public void bind(
if (options.getIgnoreList().contains(app.getPname())) {
if (android.os.Build.VERSION.SDK_INT >= 11) { // No alpha for old versions
setAlpha(0.50f);
} else {
setBackgroundColor(0x77000000);
}
} else {
if (android.os.Build.VERSION.SDK_INT >= 11) { // No alpha for old versions
setAlpha(1.0f);
} else {
setBackgroundColor(0x00FFFFFF);
}
}

Expand Down
70 changes: 70 additions & 0 deletions app/src/main/res/xml-v14/preferences.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
>
<PreferenceCategory
android:title="@string/preferences_general_category"
android:key="pref_key_general_settings"
>
<SwitchPreference
android:key="@string/preferences_general_skip_experimental_key"
android:summary="@string/preferences_general_skip_experimental_summary"
android:title="@string/preferences_general_skip_experimental_title"
android:defaultValue="false"
/>
<ListPreference
android:key="@string/preferences_general_theme_key"
android:title="@string/preferences_general_theme_title"
android:summary="%s"
android:entries="@array/theme_values"
android:entryValues="@array/theme_values"
android:defaultValue="@string/theme_blue"
/>
<ListPreference
android:key="@string/preferences_general_notification_key"
android:title="@string/preferences_general_notification_title"
android:summary="%s"
android:entries="@array/notification_values"
android:entryValues="@array/notification_values"
android:defaultValue="@string/notification_always"
/>
<ListPreference
android:key="@string/preferences_general_alarm_key"
android:title="@string/preferences_general_alarm_title"
android:summary="%s"
android:entries="@array/alarm_values"
android:entryValues="@array/alarm_values"
android:defaultValue="@string/alarm_daily"
/>
<EditTextPreference
android:key="@string/preferences_general_ignorelist_key"
android:title="@string/preferences_general_ignorelist_title"
android:summary="@string/preferences_general_ignorelist_summary"
android:defaultValue="@string/preferences_general_ignorelist_value"
/>
</PreferenceCategory>

<PreferenceCategory
android:title="@string/preferences_sources_category"
android:key="pref_key_sources_settings"
>
<SwitchPreference
android:key="@string/preferences_general_use_apkmirror_key"
android:summary="@string/preferences_general_use_apkmirror_summary"
android:title="@string/preferences_general_use_apkmirror_title"
android:defaultValue="true"
/>
<SwitchPreference
android:key="@string/preferences_general_use_googleplay_key"
android:summary="@string/preferences_general_use_googleplay_summary"
android:title="@string/preferences_general_use_googleplay_title"
android:defaultValue="false"
/>
<SwitchPreference
android:key="@string/preferences_general_use_apkpure_key"
android:summary="@string/preferences_general_use_apkpure_summary"
android:title="@string/preferences_general_use_apkpure_title"
android:defaultValue="false"
/>
</PreferenceCategory>
</PreferenceScreen>
8 changes: 4 additions & 4 deletions app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:title="@string/preferences_general_category"
android:key="pref_key_general_settings"
>
<SwitchPreference
<CheckBoxPreference
android:key="@string/preferences_general_skip_experimental_key"
android:summary="@string/preferences_general_skip_experimental_summary"
android:title="@string/preferences_general_skip_experimental_title"
Expand Down Expand Up @@ -48,19 +48,19 @@
android:title="@string/preferences_sources_category"
android:key="pref_key_sources_settings"
>
<SwitchPreference
<CheckBoxPreference
android:key="@string/preferences_general_use_apkmirror_key"
android:summary="@string/preferences_general_use_apkmirror_summary"
android:title="@string/preferences_general_use_apkmirror_title"
android:defaultValue="true"
/>
<SwitchPreference
<CheckBoxPreference
android:key="@string/preferences_general_use_googleplay_key"
android:summary="@string/preferences_general_use_googleplay_summary"
android:title="@string/preferences_general_use_googleplay_title"
android:defaultValue="false"
/>
<SwitchPreference
<CheckBoxPreference
android:key="@string/preferences_general_use_apkpure_key"
android:summary="@string/preferences_general_use_apkpure_summary"
android:title="@string/preferences_general_use_apkpure_title"
Expand Down

0 comments on commit a0478c8

Please sign in to comment.