|
|
@@ -8,6 +8,8 @@ import android.content.Intent;
|
|
|
import android.widget.RemoteViews;
|
|
|
|
|
|
import com.bumptech.glide.Glide;
|
|
|
+import com.bumptech.glide.load.resource.bitmap.CenterCrop;
|
|
|
+import com.bumptech.glide.request.RequestOptions;
|
|
|
import com.bumptech.glide.request.target.AppWidgetTarget;
|
|
|
|
|
|
import kr.co.zumo.app.R;
|
|
|
@@ -18,41 +20,27 @@ import kr.co.zumo.app.lifeplus.activity.MainActivity;
|
|
|
*/
|
|
|
public class LifeplusWidget extends AppWidgetProvider {
|
|
|
|
|
|
- private static String REFRESH_CLICK = "refresh_click";
|
|
|
-
|
|
|
|
|
|
static void updateAppWidget(Context context, AppWidgetManager appWidgetManager,
|
|
|
int appWidgetId) {
|
|
|
// Construct the RemoteViews object
|
|
|
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.lifeplus_widget);
|
|
|
|
|
|
-
|
|
|
Intent mainIntent = new Intent(context, MainActivity.class);
|
|
|
views.setOnClickPendingIntent(R.id.image_view_bi, PendingIntent.getActivity(context, 0, mainIntent, 0));
|
|
|
|
|
|
views.setTextViewText(R.id.text_view_title, "test Title");
|
|
|
views.setTextViewText(R.id.text_view_sub_title, "test Sub Title");
|
|
|
|
|
|
-
|
|
|
AppWidgetTarget backgroundImage = new AppWidgetTarget(context, R.id.image_view_background, views, appWidgetId);
|
|
|
|
|
|
- // TODO: RoundedCorners 적용 예정
|
|
|
-// Glide.with(context)
|
|
|
-// .asBitmap()
|
|
|
-// .load("http://210.216.157.64:38080/resources/contents/bucket/bg/img_bestbucket_1.jpg")
|
|
|
-// .apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(ResourceUtil.dpToPx(8))))
|
|
|
-// .into(backgroundImage);
|
|
|
-//
|
|
|
-
|
|
|
-// MultiTransformation multiTransformation = new MultiTransformation(
|
|
|
-// new CenterCrop(),
|
|
|
-// new RoundedCorners(100)
|
|
|
-// );
|
|
|
-
|
|
|
+ //views.setImageViewUri(R.id.image_view_background, Uri.parse("http://210.216.157.64:38080/resources/contents/bucket/bg/img_bestbucket_1.jpg"));
|
|
|
|
|
|
Glide.with(context)
|
|
|
.asBitmap()
|
|
|
.load("http://210.216.157.64:38080/resources/contents/bucket/bg/img_bestbucket_1.jpg")
|
|
|
+ .apply(new RequestOptions()
|
|
|
+ .transforms(new CenterCrop()))
|
|
|
.into(backgroundImage);
|
|
|
|
|
|
|
|
|
@@ -65,6 +53,7 @@ public class LifeplusWidget extends AppWidgetProvider {
|
|
|
for (int appWidgetId : appWidgetIds) {
|
|
|
updateAppWidget(context, appWidgetManager, appWidgetId);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -76,8 +65,6 @@ public class LifeplusWidget extends AppWidgetProvider {
|
|
|
public void onDisabled(Context context) {
|
|
|
// Enter relevant functionality for when the last widget is disabled
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|