Skip to content

Commit

Permalink
flush
Browse files Browse the repository at this point in the history
  • Loading branch information
evilbunny2008 committed Apr 1, 2018
1 parent 6a957f0 commit 24a5d05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected void onDraw(Canvas canvas)
}
}

public void setGifBitmap(String filename)
public void setGifFromFile(String filename)
{
File file = new File(filename);
try
Expand Down
9 changes: 6 additions & 3 deletions app/src/main/java/com/odiousapps/weewxweather/Weather.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ScrollView;
import android.widget.TextView;

import java.io.File;
Expand Down Expand Up @@ -100,7 +99,7 @@ public boolean onLongClick(View v)
});

if(new File(common.context.getFilesDir() + "/radar.gif").exists())
gif.setGifBitmap(common.context.getFilesDir() + "/radar.gif");
gif.setGifFromFile(common.context.getFilesDir() + "/radar.gif");

reloadWebView();

Expand All @@ -124,6 +123,10 @@ private void reloadWebView()
Common.LogMessage("reload radar...");
final String radar = common.GetStringPref("RADAR_URL", "");

if(radar.equals(""))
return;


Thread t = new Thread(new Runnable()
{
@Override
Expand Down Expand Up @@ -183,7 +186,7 @@ public void handleMessage(Message msg)
{
try
{
gif.setGifBitmap(common.context.getFilesDir() + "/radar.gif");
gif.setGifFromFile(common.context.getFilesDir() + "/radar.gif");
} catch (Exception e) {
e.printStackTrace();
}
Expand Down

0 comments on commit 24a5d05

Please sign in to comment.