|
|
|
@ -28,7 +28,6 @@ import android.content.Intent;
|
|
|
|
|
import android.content.SharedPreferences;
|
|
|
|
|
import android.graphics.Color;
|
|
|
|
|
import android.net.Uri;
|
|
|
|
|
import android.view.View;
|
|
|
|
|
import android.widget.RemoteViews;
|
|
|
|
|
|
|
|
|
|
import androidx.preference.PreferenceManager;
|
|
|
|
@ -38,7 +37,6 @@ public class WidgetUnified extends AppWidgetProvider {
|
|
|
|
|
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
|
|
|
|
|
|
|
|
boolean pro = ActivityBilling.isPro(context);
|
|
|
|
|
for (int appWidgetId : appWidgetIds) {
|
|
|
|
|
long account = prefs.getLong("widget." + appWidgetId + ".account", -1L);
|
|
|
|
|
long folder = prefs.getLong("widget." + appWidgetId + ".folder", -1L);
|
|
|
|
@ -58,8 +56,6 @@ public class WidgetUnified extends AppWidgetProvider {
|
|
|
|
|
if (!semi)
|
|
|
|
|
views.setInt(R.id.widget, "setBackgroundColor", Color.TRANSPARENT);
|
|
|
|
|
|
|
|
|
|
views.setViewVisibility(R.id.pro, pro ? View.GONE : View.VISIBLE);
|
|
|
|
|
if (pro) {
|
|
|
|
|
String name = prefs.getString("widget." + appWidgetId + ".name", null);
|
|
|
|
|
if (name == null)
|
|
|
|
|
views.setTextViewText(R.id.title, context.getString(R.string.title_folder_unified));
|
|
|
|
@ -82,8 +78,6 @@ public class WidgetUnified extends AppWidgetProvider {
|
|
|
|
|
context, ActivityView.REQUEST_WIDGET, thread, PendingIntent.FLAG_UPDATE_CURRENT);
|
|
|
|
|
|
|
|
|
|
views.setPendingIntentTemplate(R.id.lv, piItem);
|
|
|
|
|
} else
|
|
|
|
|
views.setTextViewText(R.id.pro, context.getText(R.string.title_pro_feature));
|
|
|
|
|
|
|
|
|
|
appWidgetManager.updateAppWidget(appWidgetId, views);
|
|
|
|
|
}
|
|
|
|
|