Project

General

Profile

« Previous | Next » 

Revision b92ad5cd

Added by Leszek Koltunski over 2 years ago

Download Update icons - progress.

View differences:

src/main/java/org/distorted/network/RubikNetwork.java
664 664
    {
665 665
    try
666 666
      {
667
      android.util.Log.e("D", "downloading "+url);
668

  
667 669
      java.net.URL connectURL = new URL(url);
668 670
      HttpURLConnection conn = (HttpURLConnection) connectURL.openConnection();
669 671
      conn.setDoInput(true);
......
688 690

  
689 691
    for(int c=0; c<numC; c++)
690 692
      {
691
      Bitmap icon = mUpdates.getCompletedIcon(c);
693
      int iconPresent = mUpdates.getCompletedIconPresent(c);
692 694

  
693
      if( icon==null )
694
        {
695
        String url = mUpdates.getCompletedURL(c);
696
        icon = downloadIcon(url);
697
        }
698
      if( icon!=null )
695
      if( iconPresent!=0 )
699 696
        {
700
        mUpdates.setCompletedIcon(c,icon);
701
        mUpdatee.iconDownloaded(c,icon);
697
        Bitmap icon = mUpdates.getCompletedIcon(c);
698

  
699
        if( icon==null )
700
          {
701
          String url = mUpdates.getCompletedURL(c);
702
          icon = downloadIcon(url);
703
          }
704
        if( icon!=null )
705
          {
706
          mUpdates.setCompletedIcon(c,icon);
707
          mUpdatee.iconDownloaded(c,icon);
708
          }
702 709
        }
703 710
      }
704 711

  
705 712
    for(int s=0; s<numS; s++)
706 713
      {
707
      Bitmap icon = mUpdates.getStartedIcon(s);
714
      int iconPresent = mUpdates.getStartedIconPresent(s);
708 715

  
709
      if( icon==null )
716
      if( iconPresent!=0 )
710 717
        {
711
        String url = mUpdates.getStartedURL(s);
712
        icon = downloadIcon(url);
713
        }
714
      if( icon!=null )
715
        {
716
        mUpdates.setStartedIcon(s,icon);
717
        mUpdatee.iconDownloaded(numC+s,icon);
718
        Bitmap icon = mUpdates.getStartedIcon(s);
719

  
720
        if( icon==null )
721
          {
722
          String url = mUpdates.getStartedURL(s);
723
          icon = downloadIcon(url);
724
          }
725
        if( icon!=null )
726
          {
727
          mUpdates.setStartedIcon(s,icon);
728
          mUpdatee.iconDownloaded(numC+s,icon);
729
          }
718 730
        }
719 731
      }
720 732
    }

Also available in: Unified diff