diff options
author | stom79 <tschneider.ac@gmail.com> | 2019-01-06 17:38:35 +0100 |
---|---|---|
committer | stom79 <tschneider.ac@gmail.com> | 2019-01-06 17:38:35 +0100 |
commit | 604617ca257ad51bd635bd9eca84dc36871a803a (patch) | |
tree | 1827fec59277e0367e806de350035afa9d8f7125 /app/src/main/java/fr/gouv | |
parent | 8738c1891a5b8e0cb375e037e8db4466f3f3835d (diff) |
Last fixes
Diffstat (limited to 'app/src/main/java/fr/gouv')
4 files changed, 14 insertions, 79 deletions
diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/NotificationReturnSlot.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/NotificationReturnSlot.java deleted file mode 100644 index c93e03e6f..000000000 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/NotificationReturnSlot.java +++ /dev/null @@ -1,23 +0,0 @@ -package fr.gouv.etalab.mastodon.activities; - -import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.util.Log; - -public class NotificationReturnSlot extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - // TODO Auto-generated method stub - super.onCreate(savedInstanceState); - String action = (String) getIntent().getExtras().get("DO"); - if (action.equals("volume")) { - Log.i("NotificationReturnSlot", "volume"); - //Your code - } else if (action.equals("stopNotification")) { - //Your code - Log.i("NotificationReturnSlot", "stopNotification"); - } - finish(); - } -}
\ No newline at end of file diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/PeertubeActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/PeertubeActivity.java index 939a48646..6d52592df 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/PeertubeActivity.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/PeertubeActivity.java @@ -244,6 +244,7 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube }else { webview_video.setVisibility(View.GONE); playerView.setVisibility(View.VISIBLE); + loader.setVisibility(View.VISIBLE); } diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java b/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java index 03ed49e62..5b73267da 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java @@ -1157,8 +1157,9 @@ public class Helper { item.setIcon(R.drawable.ic_person); String url = account.getAvatar(); if( url.startsWith("/") ){ - url = Helper.getLiveInstanceWithProtocol(activity) + account.getAvatar(); + url = "https://" + account.getInstance() + account.getAvatar(); } + if(!url.equals("null")) Glide.with(activity.getApplicationContext()) .asBitmap() .load(url) @@ -1169,6 +1170,17 @@ public class Helper { item.getIcon().setColorFilter(0xFFFFFFFF, PorterDuff.Mode.MULTIPLY); } }); + else + Glide.with(activity.getApplicationContext()) + .asBitmap() + .load(R.drawable.missing_peertube) + .into(new SimpleTarget<Bitmap>() { + @Override + public void onResourceReady(@NonNull Bitmap resource, Transition<? super Bitmap> transition) { + item.setIcon(new BitmapDrawable(activity.getResources(), resource)); + item.getIcon().setColorFilter(0xFFFFFFFF, PorterDuff.Mode.MULTIPLY); + } + }); item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { @Override diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/helper/NotificationPanel.java b/app/src/main/java/fr/gouv/etalab/mastodon/helper/NotificationPanel.java deleted file mode 100644 index 771138083..000000000 --- a/app/src/main/java/fr/gouv/etalab/mastodon/helper/NotificationPanel.java +++ /dev/null @@ -1,55 +0,0 @@ -package fr.gouv.etalab.mastodon.helper; - -import android.app.NotificationManager; -import android.app.PendingIntent; -import android.content.Context; -import android.content.Intent; -import android.support.v4.app.NotificationCompat; -import android.widget.RemoteViews; - -import fr.gouv.etalab.mastodon.R; -import fr.gouv.etalab.mastodon.activities.NotificationReturnSlot; - -public class NotificationPanel { - - private Context parent; - private NotificationManager nManager; - private NotificationCompat.Builder nBuilder; - private RemoteViews remoteView; - - public NotificationPanel(Context parent) { - // TODO Auto-generated constructor stub - this.parent = parent; - nBuilder = new NotificationCompat.Builder(parent) - .setContentTitle("Parking Meter") - .setSmallIcon(R.drawable.ic_launcher_background) - .setOngoing(true); - - remoteView = new RemoteViews(parent.getPackageName(), R.layout.notificationview); - - //set the button listeners - setListeners(remoteView); - nBuilder.setContent(remoteView); - - nManager = (NotificationManager) parent.getSystemService(Context.NOTIFICATION_SERVICE); - nManager.notify(2, nBuilder.build()); - } - - public void setListeners(RemoteViews view){ - //listener 1 - Intent volume = new Intent(parent,NotificationReturnSlot.class); - volume.putExtra("DO", "volume"); - PendingIntent btn1 = PendingIntent.getActivity(parent, 0, volume, 0); - view.setOnClickPendingIntent(R.id.btn1, btn1); - - //listener 2 - Intent stop = new Intent(parent, NotificationReturnSlot.class); - stop.putExtra("DO", "stop"); - PendingIntent btn2 = PendingIntent.getActivity(parent, 1, stop, 0); - view.setOnClickPendingIntent(R.id.btn2, btn2); - } - - public void notificationCancel() { - nManager.cancel(2); - } -}
\ No newline at end of file |