Rename message list widget classes

This commit is contained in:
cketti 2017-02-14 10:34:05 +01:00
parent 303be49889
commit cb52a6f4f6
12 changed files with 20 additions and 20 deletions

View file

@ -357,19 +357,19 @@
</receiver>
<receiver
android:name=".widget.list.MailListViewWidgetProvider"
android:icon="@drawable/mail_list_widget_icon"
android:name=".widget.list.MessageListWidgetProvider"
android:icon="@drawable/message_list_widget_preview"
android:label="@string/mail_list_widget_text">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/mail_list_view_widget_layout_info" />
android:resource="@xml/message_list_widget_info" />
</receiver>
<service
android:name=".widget.list.MailListViewWidgetService"
android:name=".widget.list.MessageListWidgetService"
android:enabled="true"
android:permission="android.permission.BIND_REMOTEVIEWS" />

View file

@ -44,7 +44,7 @@ import com.fsck.k9.service.BootReceiver;
import com.fsck.k9.service.MailService;
import com.fsck.k9.service.ShutdownReceiver;
import com.fsck.k9.service.StorageGoneReceiver;
import com.fsck.k9.widget.list.MailListViewWidgetProvider;
import com.fsck.k9.widget.list.MessageListWidgetProvider;
public class K9 extends Application {
/**
@ -587,7 +587,7 @@ public class K9 extends Application {
private void updateMailListWidget() {
try {
MailListViewWidgetProvider.updateMailViewList(K9.this);
MessageListWidgetProvider.updateMailViewList(K9.this);
} catch (Exception e) {
if (BuildConfig.DEBUG) {
throw e;

View file

@ -23,7 +23,7 @@ import com.fsck.k9.R;
import com.fsck.k9.provider.MessageProvider;
public class MailListRemoteViewFactory implements RemoteViewsService.RemoteViewsFactory {
public class MessageListRemoteViewFactory implements RemoteViewsService.RemoteViewsFactory {
private static String[] MAIL_LIST_PROJECTIONS = {
MessageProvider.MessageColumns.SENDER,
MessageProvider.MessageColumns.SEND_DATE,
@ -43,7 +43,7 @@ public class MailListRemoteViewFactory implements RemoteViewsService.RemoteViews
private int unreadTextColor;
public MailListRemoteViewFactory(Context context) {
public MessageListRemoteViewFactory(Context context) {
this.context = context;
calendar = Calendar.getInstance();
}
@ -103,7 +103,7 @@ public class MailListRemoteViewFactory implements RemoteViewsService.RemoteViews
@Override
public RemoteViews getViewAt(int position) {
RemoteViews remoteView = new RemoteViews(context.getPackageName(), R.layout.mail_list_item);
RemoteViews remoteView = new RemoteViews(context.getPackageName(), R.layout.message_list_widget_list_item);
MailItem item = mailItems.get(position);
CharSequence sender = item.unread ? bold(item.sender) : item.sender;
@ -139,7 +139,7 @@ public class MailListRemoteViewFactory implements RemoteViewsService.RemoteViews
@Override
public RemoteViews getLoadingView() {
RemoteViews loadingView = new RemoteViews(context.getPackageName(), R.layout.mail_list_loading_view);
RemoteViews loadingView = new RemoteViews(context.getPackageName(), R.layout.message_list_widget_loading);
loadingView.setTextViewText(R.id.loadingText, context.getString(R.string.mail_list_widget_loading));
loadingView.setViewVisibility(R.id.loadingText, View.VISIBLE);
return loadingView;

View file

@ -15,17 +15,17 @@ import com.fsck.k9.activity.MessageCompose;
import com.fsck.k9.activity.MessageList;
public class MailListViewWidgetProvider extends AppWidgetProvider {
public class MessageListWidgetProvider extends AppWidgetProvider {
private static String ACTION_UPDATE_MESSAGE_LIST = "UPDATE_MESSAGE_LIST";
public static void updateMailViewList(Context context) {
Context appContext = context.getApplicationContext();
AppWidgetManager widgetManager = AppWidgetManager.getInstance(appContext);
ComponentName widget = new ComponentName(appContext, MailListViewWidgetProvider.class);
ComponentName widget = new ComponentName(appContext, MessageListWidgetProvider.class);
int[] widgetIds = widgetManager.getAppWidgetIds(widget);
Intent intent = new Intent(context, MailListViewWidgetProvider.class);
Intent intent = new Intent(context, MessageListWidgetProvider.class);
intent.setAction(ACTION_UPDATE_MESSAGE_LIST);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, widgetIds);
context.sendBroadcast(intent);
@ -39,11 +39,11 @@ public class MailListViewWidgetProvider extends AppWidgetProvider {
}
private void updateAppWidget(Context context, AppWidgetManager appWidgetManager, int appWidgetId) {
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.mail_list_view_widget_layout);
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.message_list_widget_layout);
views.setTextViewText(R.id.folder, context.getString(R.string.integrated_inbox_title));
Intent intent = new Intent(context, MailListViewWidgetService.class);
Intent intent = new Intent(context, MessageListWidgetService.class);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
intent.setData(Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME)));
views.setRemoteAdapter(R.id.listView, intent);

View file

@ -5,9 +5,9 @@ import android.content.Intent;
import android.widget.RemoteViewsService;
public class MailListViewWidgetService extends RemoteViewsService {
public class MessageListWidgetService extends RemoteViewsService {
@Override
public RemoteViewsFactory onGetViewFactory(Intent intent) {
return new MailListRemoteViewFactory(this.getApplicationContext());
return new MessageListRemoteViewFactory(this.getApplicationContext());
}
}

View file

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View file

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:initialKeyguardLayout="@layout/mail_list_view_widget_layout"
android:initialLayout="@layout/mail_list_view_widget_layout"
android:initialKeyguardLayout="@layout/message_list_widget_layout"
android:initialLayout="@layout/message_list_widget_layout"
android:minHeight="180dp"
android:minWidth="250dp"
android:minResizeWidth="180dp"
android:minResizeHeight="110dp"
android:previewImage="@drawable/mail_list_widget_icon"
android:previewImage="@drawable/message_list_widget_preview"
android:resizeMode="horizontal|vertical"
android:updatePeriodMillis="86400000"
android:widgetCategory="home_screen|keyguard">